59 lines
1.9 KiB
Plaintext
59 lines
1.9 KiB
Plaintext
// team_reset_u - Team Rest Object Used
|
|
// modified 5-29-2004: allowed use if game controller has left the game. JG
|
|
// modified Sept 30, 2008: Deva Winblood - Remove team equipment
|
|
|
|
#include "equip_h"
|
|
|
|
void fnSetFactionToEnemy(object oPC,string sID)
|
|
{ // Set faction that you control to friendly
|
|
object oMember=GetObjectByTag(sID+"_PROXY");
|
|
if (oMember!=OBJECT_INVALID)
|
|
{ // !OI
|
|
AdjustReputation(oPC,oMember,-100);
|
|
} // !OI
|
|
else
|
|
{
|
|
SendMessageToPC(oPC,"CRITICAL AREA: A creature placed with tag "+sID+"_PROXY could not be found and is required to set faction you control to friendly!!!");
|
|
}
|
|
} // fnSetFactionToEnemy()
|
|
|
|
|
|
void main()
|
|
{
|
|
object oPC=GetLastUsedBy();
|
|
int nFirst=GetLocalInt(oPC,"nFirstPlayer");
|
|
object oMod=GetModule();
|
|
object oMember;
|
|
string sID;
|
|
float fDelay=0.1;
|
|
if (nFirst==TRUE||!GetIsObjectValid(GetLocalObject(GetModule(),"oFirstPlayer")))
|
|
{
|
|
DeleteLocalObject(oMod,"oTeamLeadSPID");
|
|
DeleteLocalObject(oMod,"oTeamLeadUND");
|
|
DeleteLocalObject(oMod,"oTeamLeadUNC");
|
|
DeleteLocalObject(oMod,"oTeamLeadDWF");
|
|
oMember=GetFirstPC();
|
|
while(oMember!=OBJECT_INVALID)
|
|
{ // reset
|
|
if (GetIsDM(oMember)==FALSE)
|
|
{ // not a DM
|
|
DeleteLocalInt(oMember,"bTeamLeader");
|
|
sID=GetLocalString(oMember,"sTeamID");
|
|
DeleteLocalString(oMember,"sTeamID");
|
|
fnSetFactionToEnemy(oMember,sID);
|
|
DeleteLocalInt(oMember,"nTeamNum");
|
|
RemoveJournalQuestEntry(sID,oPC,FALSE);
|
|
RemoveJournalQuestEntry(sID+"UNITS",oPC,FALSE);
|
|
DelayCommand(fDelay,PurgeExistingEquipment(oPC));
|
|
fDelay=fDelay+0.2;
|
|
SendMessageToPC(oMember,"All teams have been reset. You need to choose a team again.");
|
|
} // not a DM
|
|
oMember=GetNextPC();
|
|
} // reset
|
|
}
|
|
else
|
|
{
|
|
AssignCommand(OBJECT_SELF,SpeakString("*"+GetName(oPC)+" you are not the game settings player. You cannot use me.*"));
|
|
}
|
|
}
|