scope IncantationSpells initializer In_Incantation
globals
private string array messages[6]
endglobals
private struct INC
unit caster
unit utarget
real x
real y
location target
integer count
endstruct
private function Spells_Inc_Phrases takes nothing returns nothing
local INC i = GetTimerData(GetExpiredTimer())
local unit dummy
if (GetUnitCurrentOrder(i.caster) == 852125) or (GetUnitCurrentOrder(i.caster) == 852580) or (GetUnitCurrentOrder(i.caster) == 852095) then
if i.count == 5 then
call CreateTextTagUnitBJ(messages[i.count], i.caster, 0, 10, 100, 100, 100, 0 )
call SetTextTagPermanent( bj_lastCreatedTextTag, false )
call SetTextTagLifespan( bj_lastCreatedTextTag, 2.00 )
set dummy = CreateUnit(GetOwningPlayer(i.caster), 'h00E', i.x, i.y, 0)
call UnitAddAbility(dummy, 'A048')
call SetUnitAbilityLevel(dummy, 'A048', 4 + GetUnitAbilityLevel(i.caster, 'A04K'))
call IssueTargetOrderById(dummy, 852095, i.utarget)
call UnitApplyTimedLife(dummy, 'BTLF', 1.00)
call ReleaseTimer(GetExpiredTimer())
call i.destroy()
elseif i.count == 3 then
call CreateTextTagUnitBJ(messages[i.count], i.caster, 0, 10, 100, 100, 100, 0 )
call SetTextTagPermanent( bj_lastCreatedTextTag, false )
call SetTextTagLifespan( bj_lastCreatedTextTag, 2.00 )
set dummy = CreateUnit(GetOwningPlayer(i.caster), 'h00E', i.x, i.y, 0)
call UnitAddAbility(dummy, 'A046')
call SetUnitAbilityLevel(dummy, 'A046', 5 + GetUnitAbilityLevel(i.caster, 'A04J'))
call IssuePointOrderLoc(dummy, "breathoffire", i.target)
call UnitApplyTimedLife(dummy, 'BTLF', 1.00)
call ReleaseTimer(GetExpiredTimer())
call i.destroy()
elseif i.count == 1 then
call CreateTextTagUnitBJ(messages[i.count], i.caster, 0, 10, 100, 100, 100, 0 )
call SetTextTagPermanent( bj_lastCreatedTextTag, false )
call SetTextTagLifespan( bj_lastCreatedTextTag, 2.00 )
set dummy = CreateUnit(GetOwningPlayer(i.caster), 'h00E', i.x, i.y, 0)
call UnitAddAbility(dummy, 'A04G')
call SetUnitAbilityLevel(dummy, 'A04G', 5 + GetUnitAbilityLevel(i.caster, 'A04I'))
call IssuePointOrderLoc(dummy, "carrionswarm", i.target)
call UnitApplyTimedLife(dummy, 'BTLF', 1.00)
call ReleaseTimer(GetExpiredTimer())
call i.destroy()
endif
else
call CreateTextTagUnitBJ( "fail", i.caster, 0, 10, 100, 100, 100, 0 )
call SetTextTagPermanent( bj_lastCreatedTextTag, false )
call SetTextTagLifespan( bj_lastCreatedTextTag, 2.00 )
call ReleaseTimer(GetExpiredTimer())
call i.destroy()
endif
endfunction
private function Spells_Inc_Actions takes nothing returns boolean
local INC i
local timer t
if ( GetSpellAbilityId() == 'A04I' ) then
set i = INC.create()
set i.caster = GetTriggerUnit()
set i.target = GetSpellTargetLoc()
set i.x = GetUnitX(i.caster)
set i.y = GetUnitY(i.caster)
call CreateTextTagUnitBJ(messages[0], i.caster, 0, 10, 100, 100, 100, 0 )
call SetTextTagPermanent( bj_lastCreatedTextTag, false )
call SetTextTagLifespan( bj_lastCreatedTextTag, 2.00 )
set i.count = 1
set t = NewTimer()
call SetTimerData(t,i)
call TimerStart(t, 2, false, function Spells_Inc_Phrases)
elseif ( GetSpellAbilityId() == 'A04J' ) then
set i = INC.create()
set i.caster = GetTriggerUnit()
set i.target = GetSpellTargetLoc()
set i.x = GetUnitX(i.caster)
set i.y = GetUnitY(i.caster)
call CreateTextTagUnitBJ(messages[2], i.caster, 0, 10, 100, 100, 100, 0 )
call SetTextTagPermanent( bj_lastCreatedTextTag, false )
call SetTextTagLifespan( bj_lastCreatedTextTag, 2.00 )
set i.count = 3
set t = NewTimer()
call SetTimerData(t,i)
call TimerStart(t, 2, false, function Spells_Inc_Phrases)
elseif ( GetSpellAbilityId() == 'A04K' ) then
set i = INC.create()
set i.caster = GetTriggerUnit()
call CreateTextTagUnitBJ(messages[4], i.caster, 0, 10, 100, 100, 100, 0 )
call SetTextTagPermanent( bj_lastCreatedTextTag, false )
call SetTextTagLifespan( bj_lastCreatedTextTag, 2.00 )
set i.count = 5
set i.utarget = GetSpellTargetUnit()
set t = NewTimer()
call SetTimerData(t,i)
call TimerStart(t, 2, false, function Spells_Inc_Phrases)
endif
return false
endfunction
//===========================================================================
private function In_Incantation takes nothing returns nothing
local trigger t_Spells_Inc = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( t_Spells_Inc, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( t_Spells_Inc, Condition( function Spells_Inc_Actions ) )
set t_Spells_Inc = null
set messages[0] = "Ye lord! Mask of blood and flesh, all creation, flutter of wings, ye who bears the name of Man!"
set messages[1] = "Inferno and pandemonium, the sea barrier surges, march on to the south!"
set messages[2] = "Ye lord! Mask of flesh and bone, flutter of wings, ye who bears the name of Man!"
set messages[3] = "Truth and temperance, upon this sinless wall of dreams unleash but slightly the wrath of your claws"
set messages[4] = "Carriage of Thunder. Bridge of a spinning wheel"
set messages[5] = "With light, divide this into six!"
endfunction
endscope