--////////////// Commands setup
command = 0;
OnCharacterDispensePowerup(
function(character,powerup)
CommandDM = "Command_Deathmatch_ord"
CommandCon = "Command_Conquest_ord"
CommandDef = "Command_Defend_ord"
CommandDes = "Command_Destroy_ord"
CommandRes = "Command_Reset_ord"
Toggle = "Toggle_Command_ord"
if GetEntityClass(powerup) == GetEntityClassPtr(CommandRes) then
ClearAIGoals(ATT)
elseif GetEntityClass(powerup) == GetEntityClassPtr(CommandDef) then
AddAIGoal(ATT, "Defend", 500)
elseif GetEntityClass(powerup) == GetEntityClassPtr(CommandDes) then
AddAIGoal(ATT, "Destroy", 500)
elseif GetEntityClass(powerup) == GetEntityClassPtr(CommandDM) then
AddAIGoal(ATT, "Deathmatch", 500)
elseif GetEntityClass(powerup) == GetEntityClassPtr(CommandCon) then
AddAIGoal(ATT, "Conquest", 500)
elseif GetEntityClass(powerup) == GetEntityClassPtr(Toggle) then
if command == 0 then
SetProperty("rep_inf_ep3_commander", "WeaponName4", "Command_Deathmatch")
command = 1;
elseif command == 1 then
SetProperty("rep_inf_ep3_commander", "WeaponName4", "Command_Defend")
command = 2;
elseif command == 2 then
SetProperty("rep_inf_ep3_commander", "WeaponName4", "Command_Destroy")
command = 3;
elseif command == 3 then
SetProperty("rep_inf_ep3_commander", "WeaponName4", "Command_Reset")
command = 4;
else
SetProperty("rep_inf_ep3_commander", "WeaponName4", "Command_Conquest")
command = 0;
end
end
end
)