[Python][Help]Select NpcId

This is not a Support area! Discuss about the Server here. Non-Server related discussion goes in Off-Topic Discussion.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
PapaHarni
Posts: 31
Joined: Wed Jun 04, 2008 3:24 pm
Location: Germany/NRW/H.a.S.
Contact:

[Python][Help]Select NpcId

Post by PapaHarni »

Hello Community,

I'm work on a event who life longest (PvM),

now i will be add ony few Mobs in the event not xxxx Mobs for this Event in the Database.
I search now a way to set the stats of the Mobs up per round.

I have test this , but this not work :(

Code: Select all

 				npc.setNpcId(MobsOnRound[luck])				newhp = npc.getHP()*self.RoundCount				npc.setHP(newhp)				newmp = npc.getMP()*self.RoundCount				npc.setMP(newmp)				newpatk = npc.getPAtk()*self.RoundCount				npc.setPAtk(newpatk)				newmatk = npc.getMAtk()*self.RoundCount				npc.setMAtk(newmatk)				newpdef = npc.getPDef()*self.RoundCount				npc.setPDef(newpdef)				newmdef = npc.getMDef()*self.RoundCount				npc.setMDef(newmdef)				self.Mobs.append(mob) 
Anyone have an Ideas how can work it?

First problem is select the npc ( npc.setNpcId(MobsOnRound[luck]) ).
MobsOnRound[] is a array with few Monster IDs.


Regards
PapaHarni
Probe
Posts: 915
Joined: Thu Sep 03, 2009 6:36 pm
Location: Israel
Contact:

Re: [Python][Help]Select NpcId

Post by Probe »

you can't do that..
there is no such method setNpcId
if you want to get an npc use the npc template table
PapaHarni
Posts: 31
Joined: Wed Jun 04, 2008 3:24 pm
Location: Germany/NRW/H.a.S.
Contact:

Re: [Python][Help]Select NpcId

Post by PapaHarni »

hmm okay.
On first round i use the current stats of the monster but can it work if i add the stats of the monster in self.xxxx on kill

Code: Select all

 def onKill(self,npc,player,isPet): if npcs not in self.MobStats:  self.Mobstats.append(npcs) 
Can i use now the stats in the next round?

Code: Select all

 def onAdvEvent (self,event,npc,player): if event == "startround":  if self.RoundCount >= 2:   for currmob in self.MobStats:    newhp = currmob.getHP()*self.RoundCount    currmob.setHP(newhp)    newmp = currmob.getMP()*self.RoundCount    currmob.setMP(newmp)    newpatk = currmob.getPAtk()*self.RoundCount    currmob.setPAtk(newpatk)    newmatk = currmob.getMAtk()*self.RoundCount    currmob.setMAtk(newmatk)    newpdef = currmob.getPDef()*self.RoundCount    currmob.setPDef(newpdef)    newmdef = currmob.getMDef()*self.RoundCount    currmob.setMDef(newmdef)  for i in range(MobsCountRound):   luck = Rnd.get(len(MobsOnRound))   luck = luck - 1   mob = self.addSpawn(MobsOnRound[luck],xzone,yzone,zzone,0,False,0)   self.Mobs.append(mob) 
Post Reply