#include "header_sounds" void fnAlertWizards(string sMsg,int nDC) { // message and sound if the Wizard senses it - special ability // of wizards in this game object oPC=GetFirstPC(); int nSC; while(oPC!=OBJECT_INVALID) { // alert PCs if (GetLevelByClass(CLASS_TYPE_WIZARD,oPC)>0) { // is a wizard nSC=GetLevelByClass(CLASS_TYPE_WIZARD,oPC)+d20(); if (nSC>=nDC) { // give Message SendMessageToPC(oPC,sMsg); AssignCommand(oPC,fnSoundAlert("as_mg_telepin1")); } // give Message } // is a wizard oPC=GetNextPC(); } // alert PCs } // fnAlertWizards() void main() { object oArea=OBJECT_SELF; int nR; object oWP; object oCreature; string sRes; string sTag=GetTag(oArea); SetLocalInt(oArea,"nBreachCount",0); nR=Random(10); oWP=GetObjectByTag("PLANAR_BREACH",nR); while(oWP==OBJECT_INVALID) { // find waypoint nR=Random(10); oWP=GetObjectByTag("PLANAR_BREACH",nR); } // find waypoint if (GetLocalObject(oWP,"oCreature")==OBJECT_INVALID) { // spawn okay nR=d20(); if (sTag=="TheRealmofShadows") { // shadow plane sRes="nw_shadow"; if (nR>4&&nR<9) sRes="nw_shmastif"; else if (nR>8&&nR<12) sRes="nw_shfiend"; else if (nR==12||nR==13) { sRes="nw_bodak"; } else if (nR==14) sRes="penlord"; } // shadow plane else { // realm of in between sRes="slaadred001"; if (nR>4&&nR<9) sRes="slaadbl001"; else if (nR>8&&nR<12) sRes="slaadgrn001"; else if (nR==12||nR==13) { sRes="slaadgray001"; } else if (nR==14) sRes="slaaddeth001"; } // realm of in between oCreature=CreateObject(OBJECT_TYPE_CREATURE,sRes,GetLocation(oWP)); fnAlertWizards("You sensed an opening to the outer planes in the direction of "+GetName(GetArea(oWP))+". Something entered this world.",16); SetLocalObject(oWP,"oCreature",oCreature); } // spawn okay }