66 lines
1.3 KiB
Plaintext
66 lines
1.3 KiB
Plaintext
|
void main()
|
||
|
{
|
||
|
|
||
|
|
||
|
object oObject = GetFirstObjectInArea();
|
||
|
|
||
|
object oPC=GetEnteringObject();
|
||
|
|
||
|
if (!GetIsPC(oPC))
|
||
|
{
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
if (GetIsDM(oPC))
|
||
|
{
|
||
|
return;
|
||
|
}
|
||
|
int nRandom;
|
||
|
string sWP="jw_machine_sp_wp";
|
||
|
string sCheckstring;
|
||
|
object oParty=GetFirstFactionMember(oPC,FALSE);
|
||
|
while (GetIsObjectValid(oParty))
|
||
|
{
|
||
|
if (GetTag(GetArea(oParty))=="jw_brightdun3")
|
||
|
{
|
||
|
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_IMP_UNSUMMON),oParty);
|
||
|
|
||
|
AssignCommand( oParty, ClearAllActions() );
|
||
|
nRandom=d8();
|
||
|
|
||
|
sCheckstring=sWP+IntToString(nRandom);
|
||
|
AssignCommand( oParty, JumpToObject( GetWaypointByTag(sCheckstring) ) );
|
||
|
}
|
||
|
oParty=GetNextFactionMember(oPC,FALSE);
|
||
|
}
|
||
|
|
||
|
|
||
|
int nPCinArea=FALSE;
|
||
|
|
||
|
|
||
|
oObject=GetFirstObjectInArea();
|
||
|
|
||
|
while (GetIsObjectValid(oObject))
|
||
|
{
|
||
|
if (GetIsPC(oObject)&&(oObject!=oPC))
|
||
|
{
|
||
|
nPCinArea = TRUE;
|
||
|
}
|
||
|
oObject=GetNextObjectInArea();
|
||
|
}
|
||
|
|
||
|
/// this returns true if there are any PCs in the area that are NOT
|
||
|
/// the object that just entered the area
|
||
|
|
||
|
if ((nPCinArea != TRUE)&&(!GetIsObjectValid(GetObjectByTag("jw_the_machine2"))))
|
||
|
{
|
||
|
|
||
|
object oMachine= CreateObject(OBJECT_TYPE_PLACEABLE,"jw_the_machine2",GetLocation(GetWaypointByTag("jw_machine2_wp")));
|
||
|
SetLocalInt(oMachine,"nStatus",1);
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
}
|