34 lines
1.0 KiB
Plaintext
34 lines
1.0 KiB
Plaintext
// OnEnter - The spawn routine for random houses
|
|
void fnSpawnHouse(object oDoor,string sID);
|
|
|
|
/////////////////////////////////////////////////////////////// MAIN
|
|
void main()
|
|
{
|
|
object oPC=GetEnteringObject();
|
|
object oDoor;
|
|
string sID;
|
|
if (GetIsPC(oPC)==TRUE)
|
|
{ // is PC
|
|
oDoor=GetNearestObject(OBJECT_TYPE_DOOR,oPC,1);
|
|
if (GetStringLeft(GetTag(oDoor),10)!="INSIDEDOOR")
|
|
oDoor=GetNearestObject(OBJECT_TYPE_DOOR,oPC,2);
|
|
if (GetStringLeft(GetTag(oDoor),10)=="INSIDEDOOR")
|
|
{ // valid door
|
|
sID=GetStringRight(GetTag(oDoor),2);
|
|
if (GetLocalInt(oDoor,"nActivated")!=TRUE)
|
|
{ // spawn this house
|
|
SetLocalInt(oDoor,"nActivated",TRUE);
|
|
fnSpawnHouse(oDoor,sID);
|
|
} // spawn this house
|
|
} // valid door
|
|
} // is PC
|
|
}
|
|
//////////////////////////////////////////////////////////////// MAIN
|
|
|
|
//////////////////////////
|
|
// FUNCTIONS
|
|
//////////////////////////
|
|
void fnSpawnHouse(object oDoor,string sID)
|
|
{ // populate the house
|
|
} // fnSpawnHouse()
|