//Those are not even optimisations. I just decided to waste time doing that.
#define <InitCustomTeams takes nothing returns nothing> = {
    InitCus##tomTeams takes nothing returns nothing
	local integer i = 0
	local integer i2
		loop
			call SetPla##yerTeam(Pla##yer(i), 0)
			call SetPla##yerState(Pla##yer(i), PLAYER_STATE_ALLIED_VICTORY, 1)
            call SetPla##yerAlliance(Pla##yer(i), Pla##yer(10), ALLIANCE_PASSIVE, true)
            call SetPla##yerAlliance(Pla##yer(i), Pla##yer(10), ALLIANCE_SHARED_VISION, true)
            call SetPla##yerAlliance(Pla##yer(10), Pla##yer(i), ALLIANCE_PASSIVE, true)
            call SetPla##yerAlliance(Pla##yer(10), Pla##yer(i), ALLIANCE_SHARED_VISION, true)
			set  i2 = 0
			loop
                if ( i2 != i ) then
                    call SetPla##yerAlliance(Pla##yer(i), Pla##yer(i2), ALLIANCE_PASSIVE, true)
                    call SetPla##yerAlliance(Pla##yer(i), Pla##yer(i2), ALLIANCE_SHARED_VISION, true)
                    //call SetPla##yerAlliance(Pla##yer(i), Pla##yer(i2), ALLIANCE_HELP_REQUEST, true)
                    //call SetPla##yerAlliance(Pla##yer(i), Pla##yer(i2), ALLIANCE_HELP_RESPONSE, true)
                    //call SetPla##yerAlliance(Pla##yer(i), Pla##yer(i2), ALLIANCE_SHARED_XP, true)
                    call SetPla##yerAlliance(Pla##yer(i), Pla##yer(i2), ALLIANCE_SHARED_SPELLS, true)
                endif
                if ( i2 != i ) then
                    set i2 = i2 + 1
                else
                    set  i2 = i2 + 2
                endif
                exitwhen i2 >= 5
			endloop
			exitwhen i == 4
			set i = i + 1
		endloop
		set  i = 5
		loop
			call SetPla##yerTeam(Pla##yer(i), 1)
			call SetPla##yerState(Pla##yer(i), PLAYER_STATE_ALLIED_VICTORY, 1)
            call SetPla##yerAlliance(Pla##yer(i), Pla##yer(11), ALLIANCE_PASSIVE, true)
            call SetPla##yerAlliance(Pla##yer(i), Pla##yer(11), ALLIANCE_SHARED_VISION, true)
            call SetPla##yerAlliance(Pla##yer(11), Pla##yer(i), ALLIANCE_PASSIVE, true)
            call SetPla##yerAlliance(Pla##yer(11), Pla##yer(i), ALLIANCE_SHARED_VISION, true)
			set  i2 = 5
			loop
				if ( i2 != i ) then
                    call SetPla##yerAlliance(Pla##yer(i), Pla##yer(i2), ALLIANCE_PASSIVE, true)
                    call SetPla##yerAlliance(Pla##yer(i), Pla##yer(i2), ALLIANCE_SHARED_VISION, true)
                    //call SetPla##yerAlliance(Pla##yer(i), Pla##yer(i2), ALLIANCE_HELP_REQUEST, true)
                    //call SetPla##yerAlliance(Pla##yer(i), Pla##yer(i2), ALLIANCE_HELP_RESPONSE, true)
                    //call SetPla##yerAlliance(Pla##yer(i), Pla##yer(i2), ALLIANCE_SHARED_XP, true)
                    call SetPla##yerAlliance(Pla##yer(i), Pla##yer(i2), ALLIANCE_SHARED_SPELLS, true)
                endif
                if ( i2 != i ) then
                    set i2 = i2 + 1
                else
                    set  i2 = i2 + 2
                endif
                exitwhen i2 >= 10
			endloop
			exitwhen i == 9
			set i = i + 1
		endloop
}

#define <SetPlayerAlliance>(arg1, agr2, arg3, arg4) = {}
#define <SetPlayerTeam>(arg1, agr2) = {}
#define <SetPlayerState>(arg1, agr2, arg3) = {}
#define <call > = {}


#define <SetPlayerStartLocation>(arg1, agr2) = {}
#define <ForcePlayerStartLocation>(arg1, agr2) = {}
#define <SetPlayerColor>(arg1, agr2) = {}
#define <SetPlayerRacePreference>(arg1, agr2) = {}
#define <SetPlayerRaceSelectable>(arg1, agr2) = {}
#define <SetPlayerController>(arg1, agr2) = {}

#define <InitCustomPlayerSlots takes nothing returns nothing> = {
    InitCustom##PlayerSlots takes nothing returns nothing
        local integer i = 0
        loop
            call SetPlayer##StartLocation(Pla##yer(i), i)
            call ForcePlayer##StartLocation(Pla##yer(i), i)
            call SetPlayer##Color(Pla##yer(i), ConvertPlayerColor(i))
            call SetPlayer##RacePreference(Pla##yer(i), RACE_PREF_HUMAN)
            call SetPlayer##RaceSelectable(Pla##yer(i), true)//Kinda the only thing to change there
            call SetPlayer##Controller(Pla##yer(i), MAP_CONTROL_USER)
            exitwhen  i == 9
            set  i = i + 1
        endloop
}

#define Player( i ) = {
         PlayerArray[i]
}

#define <local integer itemID> = {
    set  PlayerArray[ 0] = Pla##yer(0)
    set  PlayerArray[ 1] = Pla##yer(1)
    set  PlayerArray[ 2] = Pla##yer(2)
    set  PlayerArray[ 3] = Pla##yer(3)
    set  PlayerArray[ 4] = Pla##yer(4)
    set  PlayerArray[ 5] = Pla##yer(5)
    set  PlayerArray[ 6] = Pla##yer(6)
    set  PlayerArray[ 7] = Pla##yer(7)
    set  PlayerArray[ 8] = Pla##yer(8)
    set  PlayerArray[ 9] = Pla##yer(9)
    set  PlayerArray[10] = Pla##yer(10)
    set  PlayerArray[11] = Pla##yer(11)
    set  PlayerArray[12] = Pla##yer(12)
    set  PlayerArray[13] = Pla##yer(13)
    set  PlayerArray[14] = Pla##yer(14)
    set  PlayerArray[15] = Pla##yer(15)
}

#define SetPlayerAllianceStateAllyBJ( sourcePlayer, otherPlayer, flag ) = {
         SetPlayerAlliance(sourcePlayer, otherPlayer, ALLIANCE_PASSIVE,       flag)
    call SetPlayerAlliance(sourcePlayer, otherPlayer, ALLIANCE_HELP_REQUEST,  flag)
    call SetPlayerAlliance(sourcePlayer, otherPlayer, ALLIANCE_HELP_RESPONSE, flag)
    call SetPlayerAlliance(sourcePlayer, otherPlayer, ALLIANCE_SHARED_XP,     flag)
    call SetPlayerAlliance(sourcePlayer, otherPlayer, ALLIANCE_SHARED_SPELLS, flag)
}

#define SetPlayerAllianceStateVisionBJ( sourcePlayer, otherPlayer, flag ) = {
         SetPlayerAlliance(sourcePlayer, otherPlayer, ALLIANCE_SHARED_VISION, flag)
}



Просмотров: 100