////////////////////////////////////////////////////////// //::use: #include"sd_reset_inc" //:: //:: //:: Slayers of Darkmoon //:: Dungeon Resetting Toolkit //:: //:: //:: Commche 2014 //:: const string COLORTOKEN = " ##################$%&'()*+,-./0123456789:;;==?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[[]^_`abcdefghijklmnopqrstuvwxyz{|}~~"; string ColorString(string sText, int nRed=255, int nGreen=255, int nBlue=255) { return "" + sText + ""; } int GetIsEmpty() // empty chest check routine { int iCount; object oItem = GetFirstItemInInventory(); while (GetIsObjectValid(oItem)) { ++iCount; oItem = GetNextItemInInventory(); } if (iCount==0)return TRUE; return FALSE; } void SD_PURGE(string sCont, int iName = 0) { int iCount; object oItem; object oArea = OBJECT_SELF; object oCont = GetFirstObjectInArea(oArea); while (GetIsObjectValid(oCont)) { if (iName==1) { if (GetName(oCont)=="Remains") { oItem = GetFirstItemInInventory(oCont); while (GetIsObjectValid(oItem)) { DestroyObject(oItem); oItem = GetNextItemInInventory(oCont); } DestroyObject(oCont); } oCont = GetNextObjectInArea(oArea); } else { if (GetTag(oCont)==sCont) { oItem = GetFirstItemInInventory(oCont); while (GetIsObjectValid(oItem)) { DestroyObject(oItem); oItem = GetNextItemInInventory(oCont); } DestroyObject(oCont); } oCont = GetNextObjectInArea(oArea); } } } void SD_DESTROY(string sTag) { object oArea = OBJECT_SELF; object oPlc = GetFirstObjectInArea(oArea); while (GetIsObjectValid(oPlc)) { if (GetTag(oPlc)==sTag) { DestroyObject(oPlc); } oPlc =GetNextObjectInArea(oArea); } } void SD_CLEAN(object oPC) { object oItem; object oArea = OBJECT_SELF; object oCont = GetFirstObjectInArea(oArea); while (GetIsObjectValid(oCont)) { if (GetObjectType(oCont)==OBJECT_TYPE_CREATURE) { if (GetIsEnemy(oCont, oPC)) { AssignCommand(oCont, SetIsDestroyable(TRUE)); DestroyObject(oCont); } } if (GetTag(oCont)=="Bloodstain")DestroyObject(oCont); oCont = GetNextObjectInArea(oArea); } } void AREA_CLEAR(object oPC) { effect eDeath = EffectDeath(TRUE); object oMob, oArea, oTrig; oArea = GetArea(OBJECT_SELF); oMob = GetFirstObjectInArea(oArea); while (GetIsObjectValid(oMob)) { if (GetObjectType(oMob)== OBJECT_TYPE_CREATURE) { if (GetIsEnemy(oMob, oPC) && GetIsDead(oMob)==FALSE) { ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oMob); AssignCommand(oMob, SetIsDestroyable(TRUE)); DestroyObject(oMob, 60.0); } } oMob = GetNextObjectInArea(oArea); } SD_PURGE("rr_sack"); SD_CLEAN(oPC); } //void main() {}