DeiviD,
I works very well. I just finished settling it in to my shard.
To be Distro compatible you'd have to put the consts from control.src into a settings.cfg. No big deal, but they sure do like their settings files.
One other thing I'd suggest. You need to have an altar reset at shard startup otherwise the nextLVLDownCheck time gets out of sync with the skulls. You could do it in the deactivateAltar function or simply pop a few lines right near the top of control.src.
eg:
Code: Select all
var numRedSkulls := CInt(GetObjProperty(altar, "lrskull"));
for i := 1 to numRedSkulls
destroyLastRedSkull(altar);
endfor
Because I am NOT OSI compliant I also decided to do a few other things like nuke all the monsters when you have levelled all the way down. This also lets players get to the altar and start at the beginning.
Eg:
Code: Select all
function destroyLastRedSkull(altar)
var lskull := CInt(GetObjProperty(altar, "lrskull"));
var skulls := array;
skulls := GetObjProperty(altar, "rskulls");
if ( !lskull )
// no skulls, lets nuke the area
nukeArea(altar);
return 0;
endif
var skull := skulls[lskull];
DestroyItem(SystemFindObjectBySerial(skull));
skulls.erase(lskull);
SetObjProperty(altar, "lrskull", lskull - 1);
SetObjProperty(altar, "rskulls", skulls);
return 1;
endfunction
function nukeArea(altar)
foreach npc in ListMobilesNearLocationEx(altar.x, altar.y, LIST_IGNORE_Z, 32, LISTEX_FLAG_NORMAL + LISTEX_FLAG_HIDDEN, altar.realm)
if ( npc.npctemplate and GetObjProperty(npc, "champspawn") )
KillNPC(npc);
sleepms(20);
endif
endforeach
endfunction
The "champspawn" cprop is set when you Create thenpc.
But thanks for the code. I had no idea how it was done and I found your scripts good and easy to follow and certainly would not disgrace the distro.
Well done.