yep, you are right the script crashed my test server, because the duplicate tomb is floating type npc, tested and worked...
not entirely like tomb per see, because when the scenario 2 player killing same mob id from the list mob, the npc will move to the last killed mob
ex: player a killed poring (1002) on prontera 150 150, then npc will spawned there, then after 10 seconds, player B kill poring (1002) too on prontera 180 180, the npc that spwaned after player A killed poring will move to player B killed poring
you need many duplicate npc, to match exact number of your amount spawned mobs, or with src mod will be more easier
btw here the tested script
- script Main NPC -1,{
end;
OnNPCKillEvent:
if (.state != 1)
end;
.@inlist = inarray(.moblist[0], killedrid);
if (.@inlist == -1)
end;
.@npcid = getelementofarray(getvariableofnpc(.tombid, "TheTomb"), .@inlist);
debugmes "npcid: "+.@npcid;
getunitdata(killedgid, .@md);
setunitdata(.@npcid, UNPC_MAPID, .@md[UMOB_MAPID]);
setunitdata(.@npcid, UNPC_X, .@md[UMOB_X]);
setunitdata(.@npcid, UNPC_Y, .@md[UMOB_Y]);
setunitdata(.@npcid, UNPC_LOOKDIR, 0);
end;
OnInit:
setarray .moblist[0], 1002, 1003, 1004, 1005;
.@moblistsize = getarraysize(.moblist);
.@tombcount = getvariableofnpc(.tombcount, "TheTomb");
if (.@moblistsize < .@tombcount) {
debugmes "The Tomb count isn't match with the mob count in list";
debugmes "Size of Mob List: "+.@moblistsize+", NPC Tomb Count: "+.@tombcount;
end;
}
.state = 1;
end;
}
- script TheTomb -1,{
end;
OnInit:
if (strnpcinfo(2) == "")
end;
.tombcount++;
.tombid[.tombcount-1] = getnpcid(0);
end;
}
prontera,0,0,0 duplicate(TheTomb) Tomb#1 112
prontera,0,0,0 duplicate(TheTomb) Tomb#2 112
prontera,0,0,0 duplicate(TheTomb) Tomb#3 112
prontera,0,0,0 duplicate(TheTomb) Tomb#4 112