polymorphing_angel.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import sys
  2. from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest
  3. from net.sf.l2j.gameserver.ai import CtrlIntention
  4. # Angel spawns...when one of the angels in the keys dies, the other angel will spawn.
  5. class polymorphing_angel(JQuest) :
  6. # init function. Add in here variables that you'd like to be inherited by subclasses (if any)
  7. def __init__(self,id,name,descr):
  8. self.AngelSpawns ={
  9. 20830:20859,
  10. 21067:21068,
  11. 21062:21063,
  12. 20831:20860,
  13. 21070:21071
  14. }
  15. # finally, don't forget to call the parent constructor to prepare the event triggering
  16. # mechanisms etc.
  17. JQuest.__init__(self,id,name,descr)
  18. def onKill (self,npc,player,isPet):
  19. npcId = npc.getNpcId()
  20. if self.AngelSpawns.has_key(npcId) :
  21. newNpc = self.addSpawn(self.AngelSpawns[npcId],npc)
  22. killer = player
  23. if isPet :
  24. killer = player.getPet()
  25. newNpc.setRunning()
  26. newNpc.addDamageHate(killer,0,999)
  27. newNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, killer)
  28. return
  29. # now call the constructor (starts up the ai)
  30. QUEST = polymorphing_angel(-1,"polymorphing_angel","ai")
  31. for i in QUEST.AngelSpawns.keys() :
  32. QUEST.addKillId(i)