#include "rd_spawnzones" #include "utl_i_sqluuid" void main() { object oPC = GetEnteringObject(); vector vPC; vector vNew; location lLoc; int iRndX; int iRndY; int iLevel; string sTag; if (GetIsPC(oPC)) { if (Random(20) == 0) { if (GetLocalInt(GetArea(OBJECT_SELF),"SpecialTrig") == 0) { SetLocalInt(GetArea(OBJECT_SELF),"SpecialTrig",1); SendMessageToPC(oPC,"You hear a twig snap..."); iLevel = GetHitDice(oPC); iLevel = ZoneLevel(GetArea(oPC),iLevel); vPC = GetPosition(oPC); iRndX = Random(6) + 4; iRndY = Random(6) + 4; if (Random(2) == 1) iRndX=iRndX * -1; if (Random(2) == 1) iRndY=iRndY * -1; vNew = vPC + Vector( iRndX/1.0, iRndY/1.0, 0.0 ); lLoc = Location(GetArea(oPC), vNew, VectorToAngle( -1.0 * vNew ) ); if (iLevel > 25) sTag = "fiend"; else if (iLevel>10) sTag = "merc"; else sTag = "bandit"; if (SQLocalsUUID_GetInt(oPC,"EvilPath") > 1) { if (iLevel>25) sTag = "angelic"; else if (Random(2) == 0) sTag = "elf"; else sTag = "dwarf"; } if (iLevel < 3) { CreateObject(OBJECT_TYPE_CREATURE,"en3_stirge",lLoc); CreateObject(OBJECT_TYPE_CREATURE,"en3_stirge",lLoc); } else { GetRaceCreatures(sTag,lLoc,iLevel,Random(2)+2); } vPC = GetPosition(oPC); iRndX = Random(6) + 4; iRndY = Random(6) + 4; if (Random(2) == 1) iRndX=iRndX * -1; if (Random(2) == 1) iRndY=iRndY * -1; vNew = vPC + Vector( iRndX/1.0, iRndY/1.0, 0.0 ); lLoc = Location(GetArea(oPC), vNew, VectorToAngle( -1.0 * vNew ) ); if (iLevel < 3) { CreateObject(OBJECT_TYPE_CREATURE,"en3_stirge",lLoc); CreateObject(OBJECT_TYPE_CREATURE,"en3_stirge",lLoc); } else { GetRaceCreatures(sTag,lLoc,iLevel,Random(2)+2); } } else { SetLocalInt(GetArea(OBJECT_SELF),"SpecialTrig",0); } } } }