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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..