Tassadar Posted May 13, 2011 Posted May 13, 2011 Good day, Help me please with script, how change script to make NPC say text when hi spawn import sys from com.l2jfrozen.gameserver.model.quest import State from com.l2jfrozen.gameserver.model.quest import QuestState from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest from com.l2jfrozen.gameserver.network.serverpackets import CreatureSay from com.l2jfrozen.util.random import Rnd # timak_orc_overlord class timak_orc_overlord(JQuest) : # init function. Add in here variables that you'd like to be inherited by subclasses (if any) def __init__(self,id,name,descr): self.timak_orc_overlord = 20588 self.FirstAttacked = False # finally, don't forget to call the parent constructor to prepare the event triggering # mechanisms etc. JQuest.__init__(self,id,name,descr) def onAttack (self,npc,player,damage,isPet): objId=npc.getObjectId() if self.FirstAttacked: if Rnd.get(50) : return npc.broadcastPacket(CreatureSay(objId,0,npc.getNam e(),"Dear ultimate power!!!")) else : self.FirstAttacked = True return def onKill (self,npc,player,isPet): npcId = npc.getNpcId() if npcId == self.timak_orc_overlord: objId=npc.getObjectId() self.FirstAttacked = False elif self.FirstAttacked : self.addSpawn(npcId,npc.getX(), npc.getY(), npc.getZ(),npc.getHeading(),True,0) return QUEST = timak_orc_overlord(-1,"timak_orc_overlord","ai") CREATED = State('Start', QUEST) QUEST.setInitialState(CREATED) QUEST.addKillId(QUEST.timak_orc_overlord) QUEST.addAttackId(QUEST.timak_orc_overlord) Thanks! Quote
Question
Tassadar
Good day,
Help me please with script, how change script to make NPC say text when hi spawn
Thanks!
0 answers 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.