#include "rd_spawnzones" void main() { object oPC; vector vPC; vector vNew; location lLoc; int iRndX; int iRndY; int iLevel; int iRandom; int iCount; string sTag; oPC = GetEnteringObject(); if (GetIsPC(oPC)) { if (Random(20) == 0) { if (GetLocalInt(GetArea(OBJECT_SELF),"SpecialTrig") == 0) { SetLocalInt(GetArea(OBJECT_SELF),"SpecialTrig",1); SendMessageToPC(oPC,"You hear squeaking..."); 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 ) ); iCount = 0; iRandom=Random(3)+1; while (iCount < iRandom) { if (Random(2)==0) sTag = "en4_rat"; else sTag = "en4_drat"; CreateObject(OBJECT_TYPE_CREATURE, sTag,lLoc); iCount++; } 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 ) ); iCount = 0; iRandom=Random(3)+1; while (iCount < iRandom) { if (Random(2)==0) sTag = "en4_rat"; else sTag = "en4_drat"; CreateObject(OBJECT_TYPE_CREATURE, sTag,lLoc); iCount++; } } else { SetLocalInt(GetArea(OBJECT_SELF),"SpecialTrig",0); } } } }