// OnEnter - Mage Guild Defense void main() { object oPC=GetEnteringObject(); object oShout=GetNearestObjectByTag("MGS3"); int nMember=GetLocalInt(oPC,"nMGMember"); object oPlace=GetNearestObject(OBJECT_TYPE_PLACEABLE,oPC); if (oShout==OBJECT_INVALID) oShout=GetNearestObjectByTag("MGS2"); if (oShout==OBJECT_INVALID) oShout=GetNearestObjectByTag("MGS1"); if (oShout==OBJECT_INVALID) oShout=GetNearestObjectByTag("Lamar"); if (oShout==OBJECT_INVALID) oShout=GetNearestObjectByTag("EXPELLER"); if (nMember<1) { // adjust reputation AdjustReputation(oPC,oShout,-100); // enemy AssignCommand(oShout,ActionAttack(oPC)); AssignCommand(oPlace,PlaySound("as_cv_bell2")); } // adjust reputation }