//:://///////////////////////////////////////////// //:: Name: x2_onrest //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* The generic wandering monster system */ //::////////////////////////////////////////////// //:: Created By: Georg Zoeller //:: Created On: June 9/03 //::////////////////////////////////////////////// #include "x2_inc_restsys" #include "x2_inc_switches" void main() { object oPC = GetLastPCRested(); if (GetModuleSwitchValue(MODULE_SWITCH_USE_XP2_RESTSYSTEM) == TRUE) { /* Georg, August 11, 2003 Added this code to allow the designer to specify a variable on the module Instead of using a OnAreaEnter script. Nice new toolset feature! Basically, the first time a player rests, the area is scanned for the encounter table string and will set it up. */ object oArea = GetArea (oPC); string sTable = GetLocalString(oArea,"X2_WM_ENCOUNTERTABLE") ; if (sTable != "" ) { int nDoors = GetLocalInt(oArea,"X2_WM_AREA_USEDOORS"); int nDC = GetLocalInt(oArea,"X2_WM_AREA_LISTENCHECK"); WMSetAreaTable(oArea,sTable,nDoors,nDC); //remove string to indicate we are set up DeleteLocalString(oArea,"X2_WM_ENCOUNTERTABLE"); } object oTarget; oTarget=GetHenchman(oPC); DestroyObject(oTarget); } }