function Trig_Leech_Seed_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'LEEH'
endfunction
function Trig_Leech_Seed_Actions takes nothing returns nothing
local unit u = GetSpellAbilityUnit()
local unit t = GetSpellTargetUnit()
local effect e
local effect e2
local integer i = 0
call AddSpecialEffectTargetUnitBJ( "overhead", t, "Abilities\\Spells\\NightElf\\FaerieDragonInvis\\FaerieDragon_Invis.mdl" )
set e = GetLastCreatedEffectBJ()
call TriggerSleepAction(7)
call DestroyEffect(e)
call AddSpecialEffectTargetUnitBJ( "overhead", t, "Abilities\\Spells\\Other\\Drain\\DrainCaster.mdl" )
set e = GetLastCreatedEffectBJ()
call AddSpecialEffectTargetUnitBJ( "overhead", u, "Abilities\\Spells\\Other\\Drain\\DrainTarget.mdl" )
set e2 = GetLastCreatedEffectBJ()
loop
exitwhen i == 10
set i = i + 1
if IsUnitAliveBJ(t) == true then
call UnitDamageTargetBJ(u, t, 25, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL)
call SetUnitLifeBJ(u, GetUnitStateSwap(UNIT_STATE_LIFE, u) + 25)
else
set i = 10
endif
call TriggerSleepAction(1)
endloop
call DestroyEffect(e)
call DestroyEffect(e2)
endfunction
//===========================================================================
function InitTrig_Leech_Seed takes nothing returns nothing
set gg_trg_Leech_Seed = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Leech_Seed, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Leech_Seed, Condition( function Trig_Leech_Seed_Conditions ) )
call TriggerAddAction( gg_trg_Leech_Seed, function Trig_Leech_Seed_Actions )
endfunction
Events
Unit - A unit Dies
Conditions
((Triggering unit) is An Ancient) Equal to True
Actions
Set PlayersLeft = (PlayersLeft - 1)
Set RemoveHero[(Player number of (Owner of (Dying unit)))] = (Dying unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Killing unit) Not equal to No unit
Then - Actions
Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( has been killed by + (Name of (Owner of (Killing unit)))))
Set PlayerScores[(Player number of (Owner of (Killing unit)))] = (PlayerScores[(Player number of (Owner of (Killing unit)))] + 2)
Leaderboard - Change the value for (Owner of (Killing unit)) in LeaderBoard to PlayerScores[(Player number of (Owner of (Killing unit)))]
Else - Actions
Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + has been killed by the forces of nature)
Set PlayerScores[(Player number of (Owner of (Triggering unit)))] = (PlayerScores[(Player number of (Owner of (Triggering unit)))] - 2)
Leaderboard - Change the value for (Owner of (Triggering unit)) in LeaderBoard to PlayerScores[(Player number of (Owner of (Triggering unit)))]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
PlayersLeft Equal to 1
Then - Actions
Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) is An Ancient) Equal to True))) and do (Actions)
Loop - Actions
Game - Display to (All players) the text: ((Name of (Owner of (Picked unit))) + has won the match and received an extra 3 points)
Set PlayerScores[(Player number of (Owner of (Picked unit)))] = (PlayerScores[(Player number of (Owner of (Picked unit)))] + 3)
Leaderboard - Change the value for (Owner of (Picked unit)) in LeaderBoard to PlayerScores[(Player number of (Owner of (Picked unit)))]
Set RemoveHero[(Player number of (Owner of (Picked unit)))] = (Picked unit)
Custom script: call DestroyGroup(GetLastCreatedGroup())
Countdown Timer - Pause Timer
Trigger - Run Victory Conditions <gen> (checking conditions)
Else - Actions
Leaderboard - Sort LeaderBoard by Value in Descending order