Hello,
currently i'm trying to develop a script that automatically spawns one random boss monster (out of bloody branch) on a given map. As soon as it gets killed it should wait for one hour to respawn another random boss monster.
Does anyone know why:
1. I'm not able to use the 'strnpcinfo'-commands below. I get an error that no player is attached, but i don't understand why there should be one, since i'm just querying the map of the npc and its unique name?
2. As soon as a boss monster is killed there should also spawn a tomb at the position where the monster was killed. It should disappear as soon as another boss monster spawns on the map. Is there a command to spawn a tomb? (Or to spawn and to remove a random self-scriped npc? I only found a code snippet for spawning a tomb in the map.c source file)
Here's my script:
- script SpawnPvE FAKE_NPC,{ OnInit: // init map callfunc("mobspawn", 0, strnpcinfo(NPC_MAP), strnpcinfo(NPC_NAME_UNIQUE)); end; // when a player kills a monster OnMonsterDead: callfunc("mobspawn", 3600000, strnpcinfo(NPC_MAP), strnpcinfo(NPC_NAME_UNIQUE)); end; } function script mobspawn { .@timeout = getarg(0); .@map$ = getarg(1); .@npcname$ = getarg(2); if (mobcount(.@map$, "all") < 1) { sleep(.@timeout); // bloody branch spawn monster(.@map$,0,0,--en--,-3,1,.@npcname$+"::OnMonsterDead"); } } pvp_n_3-1,0,0,0 duplicate(SpawnPvE) SpawnPvE#1 FAKE_NPC pvp_n_3-2,0,0,0 duplicate(SpawnPvE) SpawnPvE#2 FAKE_NPC pvp_n_3-3,0,0,0 duplicate(SpawnPvE) SpawnPvE#3 FAKE_NPC pvp_n_3-4,0,0,0 duplicate(SpawnPvE) SpawnPvE#4 FAKE_NPC pvp_n_3-5,0,0,0 duplicate(SpawnPvE) SpawnPvE#5 FAKE_NPC
Thanks for your help!
-simh