Page 1 of 1

Monster

Posted: Sat May 23, 2009 8:40 am
by Tharon
Hallo,

I want to create a monstergroup and if all monster auf this group are killed, it should create a new monstergroup.
Sorry for my bad english. I hope you can help me.

Also ich möchte eine Monstergruppe createn und wenn alle Monster dieser Gruppe getötet wurden, soll das script eine weitere Gruppe erstellen. Ich hab es versucht aber kriege das nicht hin, habe auch keine Beispielscripte :( .
Ich hoffe ihr könnt mir helfen.

Bitte nicht auslachen das war mein versuch:

Code: Select all

program test(who)


var i;
var x;
var y;
var array1 := {};

for ( x := -2; x <= 1; x := x + 1)
for ( y := -1; y <= 2; y := y + 2)
array1.append ( CreateNpcFromTemplate ( "Zombie", who.x+x, who.y-y, who.z ));

for (i:=0; i < array1.size(); i:=i+1)
if ("life" < 0)
CreateNpcFromTemplate ( "mummy", who.x+x, who.y-y, who.z );
endif

endfor
endfor
endfor

endptogram

Re: Monster

Posted: Sat May 23, 2009 9:05 am
by Tomi
First you need to have a script which creates this monster group and stores the serials of the npc's somewhere.

then you need to add the checks in death.src in scripts/misc when the monster dies and if necessary launch the group creating script from there again.

Re: Monster

Posted: Sat May 23, 2009 9:13 am
by Tharon
I create the group with:

for ( x := -2; x <= 1; x := x + 1)
for ( y := -1; y <= 2; y := y + 2)
CreateNpcFromTemplate ( "Zombie", who.x+x, who.y-y, who.z )
endfor
endfor

can you give me an example?