Page 1 of 1

[Python][Help]Select NpcId

Posted: Fri Nov 13, 2009 6:56 pm
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

Re: [Python][Help]Select NpcId

Posted: Fri Nov 13, 2009 7:15 pm
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

Re: [Python][Help]Select NpcId

Posted: Fri Nov 13, 2009 7:41 pm
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)