Skip to content

Someone Can Help Me?

Featured Replies

Someone can help me to do an html for this code? Its an NOBLESS NPC script

import sys
from net.sf.l2j.gameserver.model.actor.instance import L2PcInstance
from java.util import Iterator
from net.sf.l2j.gameserver.datatables import SkillTable
from net.sf.l2j			       import L2DatabaseFactory
from net.sf.l2j.gameserver.model.actor.appearance import PcAppearance
from net.sf.l2j.gameserver.model.quest import State
from net.sf.l2j.gameserver.model.actor.appearance import PcAppearance
from net.sf.l2j.gameserver.model.quest import QuestState
from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest

qn = "8204_NpcNoblesse"

NPC=[100009]
GOLDBAR= 3470
NOBLESS_TIARA = 7694
QuestId     = 8204
QuestName   = "NpcNoblesse"
QuestDesc   = "custom"
InitialHtml = "1.htm"

print "INFO Loaded: Noblesse Manager"

class Quest (JQuest) :

	def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)


	def onEvent(self,event,st):
		htmltext = event
		count=st.getQuestItemsCount(GOLDBAR)
		
		if count < 250  and st.getPlayer().getLevel() < 75 :
			htmltext = "<html><head><body>Sorry, but you dont have enought gb or u low lvl</body></html>"

		elif st.getPlayer().isNoble() == 1 :
			htmltext = "<html><head><body>Sorry, But you are alrdy nobles</body></html>"


		else:
			st.getPlayer().setTarget(st.getPlayer())
			
			if event == "2":
		            	st.takeItems(GOLDBAR,250)
                                st.getPlayer().setNoble(true)
                                st.giveItems(NOBLESS_TIARA,1)
                                st.playSound("ItemSound.quest_finish")
				st.setState(State.COMPLETED)
				return "End.htm"
                                st.exitQuest(1)	
	
				
			if htmltext != event:
				st.setState(State.COMPLETED)
				st.exitQuest(1)
		return htmltext


	def onTalk (self,npc,player):
	   st = player.getQuestState(qn)
	   htmltext = "<html><head><body>I have nothing to say to you</body></html>"
	   st.setState(State.STARTED)
	   return InitialHtml

QUEST       = Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc)

for npcId in NPC:
 QUEST.addStartNpc(npcId)
 QUEST.addTalkId(npcId)

Thanks, sorry for my bad english, and i dont know how to create an htm, for the npc 100009 .

  • Author

Thanks, i change the npc id, but now i think that i have to do a html called 1.htm ?, and i dont know what put on 1.html

Copy and htm from htm folder, paste inside your custom folder and rename it to 1 then change the content.

Edited by SweeTs

  • Author

I've do it , but, someone saids to me that is not declared initial state, and that onTalk method is wrong, have you any idea? . Its l2j C4

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.