Jump to content
  • 0

Help gia alagh payment se script npc.


Question

Posted

Loipon exw to ekseis provlima dokimasa pola ala den mporo na ftiaksw na doulevei

Exw ayto to script to opio doulevei mia xara gia Hero Manager

 

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_NpcHero"

NPC=[7202]
GOLDBAR = 3470
DESTINY_CIRCLET = 6842
QuestId     = 8204
QuestName   = "NpcHero"
QuestDesc   = "custom"
InitialHtml = "1.htm"

print "--INFO Loaded: Custom Hero Seller--"

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 < 10  and st.getPlayer().getLevel() < 80 :
		htmltext = "<html><head><body>You dont have enough items to use this Action NOOB.</body></html>"

	elif st.getPlayer().isHero() == 1 :
		htmltext = "<html><head><body> Sorry, You Have Already Hero Status!</body></html>"

	elif st.getQuestItemsCount(GOLDBAR) < 20 :	
                       htmltext = "<html><head><body>You dont have enough items to use this Action.</body></html>"

	else:
		st.getPlayer().setTarget(st.getPlayer())

		if event == "2":
			st.takeItems(GOLDBAR,20)
                               st.getPlayer().setHero(True)
                               st.giveItems(DESTINY_CIRCLET,1)
                               st.playSound("ItemSound.quest_finish")
			st.setState(State.COMPLETED)
			return "HeroFinish.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)

Ti thelw tora Anti na pernei Gold bar thelw na pernei 4 pragmata me diaforetiko ID pws to ftiaxnw ayto?

Opios mporei na mou diksei ena paradigma h na mou to diorthosh ayto me id tis epiloghs tou gia na katalavw pws ginete tha to ektimousa.

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...