- Joined
- Jul 26, 2008
- Messages
- 1,009
Alright so first off this function crashes my game, yet I cannot see a reason for it to do so. Perhaps it's just so convoluted that it's too messy for me to read. However it's just a repeating trigger that sets ALL the players against those not in their force and with players that are in their force. Simple nuff. I imagine there's an easier/short way too. This is called via ExecuteFunc btw.
Also, another question: Is there any way to set up Quests through Local commands via GetLocalPlayer(). I can't see to get any to work, though they dont' disconnect the game. They just give no results or unexpected results. Thanks
JASS:
function CycleAlliance takes nothing returns nothing
local integer i = 0
local integer i2 = 0
loop
debug call BJDebugMsg("Loop Starts 1")
exitwhen i > bj_MAX_PLAYER_SLOTS
set i2 = 0
loop
debug call BJDebugMsg("Loop Starts 2")
exitwhen i2 > bj_MAX_PLAYER_SLOTS
if i != i2 then
if IsPlayerInForce(Player(i), BloodPack) then
debug call BJDebugMsg("Start BP")
if IsPlayerInForce(Player(i2), BloodPack) then
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_PASSIVE, true)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_HELP_REQUEST, true)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_HELP_RESPONSE, true)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_SHARED_XP, true)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_SHARED_SPELLS, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_PASSIVE, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_HELP_REQUEST, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_HELP_RESPONSE, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_SHARED_XP, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_SHARED_SPELLS, true)
else
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_PASSIVE, false)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_HELP_REQUEST, false)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_HELP_RESPONSE, false)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_SHARED_XP, false)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_SHARED_SPELLS, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_PASSIVE, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_HELP_REQUEST, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_HELP_RESPONSE, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_SHARED_XP, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_SHARED_SPELLS, false)
endif
elseif IsPlayerInForce(Player(i), FangSquad) then
if IsPlayerInForce(Player(i2), FangSquad) then
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_PASSIVE, true)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_HELP_REQUEST, true)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_HELP_RESPONSE, true)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_SHARED_XP, true)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_SHARED_SPELLS, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_PASSIVE, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_HELP_REQUEST, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_HELP_RESPONSE, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_SHARED_XP, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_SHARED_SPELLS, true)
else
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_PASSIVE, false)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_HELP_REQUEST, false)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_HELP_RESPONSE, false)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_SHARED_XP, false)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_SHARED_SPELLS, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_PASSIVE, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_HELP_REQUEST, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_HELP_RESPONSE, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_SHARED_XP, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_SHARED_SPELLS, false)
endif
elseif IsPlayerInForce(Player(i), HellHorde) then
if IsPlayerInForce(Player(i2), HellHorde) then
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_PASSIVE, true)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_HELP_REQUEST, true)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_HELP_RESPONSE, true)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_SHARED_XP, true)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_SHARED_SPELLS, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_PASSIVE, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_HELP_REQUEST, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_HELP_RESPONSE, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_SHARED_XP, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_SHARED_SPELLS, true)
else
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_PASSIVE, false)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_HELP_REQUEST, false)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_HELP_RESPONSE, false)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_SHARED_XP, false)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_SHARED_SPELLS, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_PASSIVE, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_HELP_REQUEST, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_HELP_RESPONSE, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_SHARED_XP, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_SHARED_SPELLS, false)
endif
elseif IsPlayerInForce(Player(i), CrimsonHunters) then
if IsPlayerInForce(Player(i2), CrimsonHunters) then
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_PASSIVE, true)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_HELP_REQUEST, true)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_HELP_RESPONSE, true)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_SHARED_XP, true)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_SHARED_SPELLS, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_PASSIVE, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_HELP_REQUEST, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_HELP_RESPONSE, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_SHARED_XP, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_SHARED_SPELLS, true)
else
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_PASSIVE, false)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_HELP_REQUEST, false)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_HELP_RESPONSE, false)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_SHARED_XP, false)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_SHARED_SPELLS, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_PASSIVE, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_HELP_REQUEST, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_HELP_RESPONSE, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_SHARED_XP, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_SHARED_SPELLS, false)
endif
elseif IsPlayerInForce(Player(i), VileLegion) then
if IsPlayerInForce(Player(i2), VileLegion) then
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_PASSIVE, true)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_HELP_REQUEST, true)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_HELP_RESPONSE, true)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_SHARED_XP, true)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_SHARED_SPELLS, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_PASSIVE, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_HELP_REQUEST, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_HELP_RESPONSE, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_SHARED_XP, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_SHARED_SPELLS, true)
else
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_PASSIVE, false)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_HELP_REQUEST, false)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_HELP_RESPONSE, false)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_SHARED_XP, false)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_SHARED_SPELLS, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_PASSIVE, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_HELP_REQUEST, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_HELP_RESPONSE, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_SHARED_XP, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_SHARED_SPELLS, false)
endif
elseif IsPlayerInForce(Player(i), ChosenVampire) then
if IsPlayerInForce(Player(i2), ChosenVampire) then
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_PASSIVE, true)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_HELP_REQUEST, true)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_HELP_RESPONSE, true)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_SHARED_XP, true)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_SHARED_SPELLS, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_PASSIVE, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_HELP_REQUEST, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_HELP_RESPONSE, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_SHARED_XP, true)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_SHARED_SPELLS, true)
else
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_PASSIVE, false)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_HELP_REQUEST, false)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_HELP_RESPONSE, false)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_SHARED_XP, false)
call SetPlayerAlliance(Player(i), Player(i2), ALLIANCE_SHARED_SPELLS, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_PASSIVE, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_HELP_REQUEST, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_HELP_RESPONSE, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_SHARED_XP, false)
call SetPlayerAlliance(Player(i2), Player(i), ALLIANCE_SHARED_SPELLS, false)
endif
endif
endif
set i2 = i2 + 1
debug call BJDebugMsg(I2S(i))
endloop
set i = i + 1
endloop
debug call BJDebugMsg("GGGGGG!!!!!!OOOOOT THROUGH IT!")
endfunction
Also, another question: Is there any way to set up Quests through Local commands via GetLocalPlayer(). I can't see to get any to work, though they dont' disconnect the game. They just give no results or unexpected results. Thanks