Log in
Current Version: v0.0.01A
Alpha version
Changelogs to come
Latest topics
Version Progress
Changes for v0.02.0A||||||||||||||||||||[●] [general]
||||||||||||||||||||[●] [Heroes]
||||||||||||||||||||[●] [Items]
||||||||||||||||||||[●] [Bugs]
||||||||||||||||||||[●] [Total]
creep defense and such
Page 1 of 1
creep defense and such
protect friendlies
and the functions SameTeam and PlayerForceById
- Code:
function Trig_Protect_Friendly_Conditions takes nothing returns boolean
return SameTeam(GetTriggerUnit(), GetAttacker())
endfunction
function Trig_Protect_Friendly_Actions takes nothing returns nothing
if GetUnitState(GetTriggerUnit(), UNIT_STATE_LIFE) > 150 then
call IssueImmediateOrderById(GetAttacker(), OrderId("stop"))
endif
endfunction
//===========================================================================
function InitTrig_Protect_Friendly takes nothing returns nothing
set gg_trg_Protect_Friendly = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Protect_Friendly, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Protect_Friendly, Condition( function Trig_Protect_Friendly_Conditions ) )
call TriggerAddAction( gg_trg_Protect_Friendly, function Trig_Protect_Friendly_Actions )
endfunction
and the functions SameTeam and PlayerForceById
- Code:
function PlayerForceById takes integer i returns integer
if IsPlayerInForce(Player(i), udg_team[1]) then
return 0
elseif IsPlayerInForce(Player(i), udg_team[2]) then
return 1
endif
return 3
endfunction
- Code:
function SameTeam takes unit u, unit v returns boolean
return PlayerForceById(GetPlayerId(GetOwningPlayer(u))) == PlayerForceById(GetPlayerId(GetOwningPlayer(v)))
endfunction
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|
Thu Mar 05, 2020 5:09 am by Occuli.Imperator.Aquillon
» Faction creeps
Sun Dec 21, 2014 12:49 am by Grass Hopper
» [SCII] [Inquisition] Hector Rex
Thu Dec 18, 2014 9:06 am by Grass Hopper
» [necrons] Orikan, the Diviner
Tue Dec 16, 2014 5:58 pm by Grass Hopper
» Talent System
Mon Dec 15, 2014 10:59 am by Grass Hopper
» Capture Points system
Fri Dec 12, 2014 2:36 pm by Grass Hopper
» [SCII] [Orks] Warboss(es)
Fri Dec 12, 2014 11:44 am by Grass Hopper
» Game Guide
Thu Dec 11, 2014 2:12 pm by Grass Hopper
» [Inquisition] Mordrak
Wed Dec 10, 2014 3:28 pm by Grass Hopper
» [inquiition] Kaldor Draigo
Wed Dec 10, 2014 3:07 pm by Grass Hopper