void main() { object oPC = GetLastUsedBy(); string sName = GetName(oPC); string sFlag = GetName (OBJECT_SELF); effect eBlueFlag; effect eRedFlag; eBlueFlag = SupernaturalEffect(EffectVisualEffect(VFX_DUR_FLAG_BLUE)); eRedFlag = SupernaturalEffect(EffectVisualEffect(VFX_DUR_FLAG_RED)); if (!GetIsPC(oPC)) return; //if PC is stealing flag, sets FX and variable if (GetLocalInt(oPC, "RedTeam") == 1) { ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBlueFlag, oPC); SetLocalInt(oPC, "HasFlag", 1); SendMessageToAllDMs (" "+ sName +" has stolen the "+ sFlag +" "); return; } //check if PC is not a member of any team, and asks if they want to join one if (GetLocalInt(oPC, "BlueTeam") != 1) { AssignCommand(OBJECT_SELF, ActionStartConversation(oPC, "")); return; } //rewards PC if delivers opposing flag if (GetLocalInt(oPC, "HasFlag") == 1) { SendMessageToAllDMs (" "+ sName +" has delivered the enemy flag "); SetLocalInt (oPC, "HasFlag", 0); //gives PC a score marker CreateItemOnObject("scoreartifact", oPC); //removes flag effect effect eLoop=GetFirstEffect(oPC); while (GetIsEffectValid(eLoop)) { if (GetEffectType(eLoop)==EFFECT_TYPE_VISUALEFFECT) RemoveEffect(oPC, eLoop); eLoop=GetNextEffect(oPC); } } }