Jump to content
  • 0

[help]NPC say's text on spawn (pyton script)


Question

Posted

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!

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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...