Name | Type | is_array | initial_value |
//TESH.scrollpos=35
//TESH.alwaysfold=0
//==================================================================================================================================
// Start of constants. These will need to be changed by you. They provide the user with easier implementing//changing of the spell's rawcodes and effects.
//==================================================================================================================================
constant function Divine_ID takes nothing returns integer
return 'h001' // Divine Knight unit rawcode.
endfunction
constant function Dummy_ID takes nothing returns integer
return 'h002' // Dummy Unit rawcode.
endfunction
constant function Spirit_ID takes nothing returns integer
return 'h003' // Spirit Knight unit rawcode.
endfunction
constant function Holy_ID takes nothing returns integer
return 'A000' // Holy Spirit ability rawcode.
endfunction
constant function Burst_ID takes nothing returns integer
return 'A001' // Holy Burst ability rawcode.
endfunction
constant function Conversion_ID takes nothing returns integer
return 'A003' // Holy Conversion ability rawcode.
endfunction
constant function Blind_ID takes nothing returns integer
return 'A005' // Blinding Light ability rawcode.
endfunction
//==================================================================================================================================
// End of constants. Do not touch anything below this unless you are familiar with JASS.
//==================================================================================================================================
function Trig_Spell_Copy_Conditions takes nothing returns boolean
return GetSpellAbilityId() == Conversion_ID()
endfunction
function Trig_Spell_Copy_Actions takes nothing returns nothing
// Declares Local Variables
local effect HandRight
local effect HandLeft
local effect Chest
local effect Overhead
local unit t = GetSpellTargetUnit()
local unit dk
local real x = GetUnitX(t)
local real y = GetUnitY(t)
// Pauses/Replaces the targeted unit
call PauseUnit( t, true )
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl", x, y))
call ShowUnit(t, false)
// Creates Divine Knight
set dk = CreateUnit(GetOwningPlayer(t), Divine_ID(), x, y, GetUnitFacing(t))
call SetUnitOwner( dk, GetOwningPlayer(t), true )
call UnitApplyTimedLife(dk, 'BTLF', 45.00)
call RemoveUnit(t)
set t = null
// Adds Special Effects onto the Divine Knight
set HandRight = AddSpecialEffectTarget("Abilities\\Spells\\NightElf\\FaerieFire\\FaerieFireTarget.mdl",dk,"hand, right")
set HandLeft = AddSpecialEffectTarget("Abilities\\Spells\\NightElf\\FaerieFire\\FaerieFireTarget.mdl",dk,"hand, left")
set Chest = AddSpecialEffectTarget("Abilities\\Spells\\Human\\DivineShield\\DivineShieldTarget.mdl",dk,"origin")
set Overhead = AddSpecialEffectTarget("Abilities\\Spells\\Human\\InnerFire\\InnerFireTarget.mdl",dk,"overhead")
set dk = null
call TriggerSleepAction( 45.00 )
// Destroys the Special Effects that were attached the Divine Knight
call DestroyEffect( HandRight )
set HandRight = null
call DestroyEffect( HandLeft )
set HandLeft = null
call DestroyEffect( Chest )
set Chest = null
call DestroyEffect( Overhead )
set Overhead = null
endfunction
//===========================================================================
function InitTrig_Spell takes nothing returns nothing
set gg_trg_Spell = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Spell, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Spell, Condition( function Trig_Spell_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Spell, function Trig_Spell_Copy_Actions )
endfunction
//TESH.scrollpos=36
//TESH.alwaysfold=0
function Trig_Dies_Conditions takes nothing returns boolean
return GetUnitTypeId(GetTriggerUnit()) == Divine_ID()
endfunction
function Holy_Filter_B takes nothing returns boolean
return IsPlayerEnemy(GetOwningPlayer(GetTriggerUnit()), GetOwningPlayer(GetFilterUnit())) == true and GetUnitRace(GetFilterUnit()) == RACE_UNDEAD and IsUnitType(GetFilterUnit(), UNIT_TYPE_DEAD) != true
endfunction
function Holy_Filter_A takes nothing returns boolean
return IsPlayerEnemy(GetOwningPlayer(GetTriggerUnit()), GetOwningPlayer(GetFilterUnit())) != true and GetUnitRace(GetFilterUnit()) != RACE_UNDEAD and IsUnitType(GetFilterUnit(), UNIT_TYPE_DEAD) != true
endfunction
function Trig_Dies_Actions takes nothing returns nothing
// Declares Local/Global Variables
local effect e
local unit t = GetTriggerUnit()
local unit u
local unit d
local unit q
local unit r
local unit s
local unit v
local real x = GetUnitX(t)
local real y = GetUnitY(t)
local group g = CreateGroup()
local group h = CreateGroup()
local player p = GetOwningPlayer(t)
local integer i = 0
// Creates Special Effect
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\ReviveHuman\\ReviveHuman.mdl", x, y))
// Creates a Holy Spirit that ascends to heaven
set u = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), Spirit_ID(), x, y, GetUnitFacing(t))
call UnitApplyTimedLife( u, 'BTLF', 2.5 )
call SetUnitAnimation( u, "Stand Victory" )
call UnitAddAbility( u, 'Arav' )
call UnitRemoveAbility( u, 'Arav' )
call SetUnitFlyHeight( u, 3000.00, 850.00 )
set d = CreateUnit(p, Dummy_ID(), x, y, 0.0)
call UnitApplyTimedLife( d, 'BTLF', 1.50 )
call UnitApplyTimedLife( t, 'BTLF', 3.00 )
call UnitAddAbility( d, Holy_ID() )
call IssueTargetOrder( d, "banish", u )
// Creates the Unit Groups
call GroupEnumUnitsInRange(g, x, y, 900.00, Condition(function Holy_Filter_A))
call GroupEnumUnitsInRange(h, x, y, 900.00, Condition(function Holy_Filter_B))
loop
exitwhen i >= 16
set i = ( i + 1 )
set q = CreateUnit(p, Dummy_ID(), x, y, 0.0)
call UnitAddAbility( q, Burst_ID() )
call UnitApplyTimedLife( q, 'BTLF', 1.00 )
set s = FirstOfGroup(g)
call GroupRemoveUnit(g, s)
call IssueTargetOrder( q, "holybolt", s )
set r = CreateUnit(p, Dummy_ID(), x, y, 0.0)
call UnitAddAbility( r, Blind_ID() )
call UnitApplyTimedLife( r, 'BTLF', 1.00 )
set v = FirstOfGroup(h)
call GroupRemoveUnit(h, v)
call IssueTargetOrder( r, "drunkenhaze", v )
endloop
call DestroyGroup(g)
set g = null
call DestroyGroup(h)
set p = null
set h = null
set d = null
set q = null
set s = null
set r = null
set v = null
set t = null
set u = null
endfunction
//===========================================================================
function InitTrig_Dies takes nothing returns nothing
set gg_trg_Dies = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Dies, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Dies, Condition( function Trig_Dies_Conditions ) )
call TriggerAddAction( gg_trg_Dies, function Trig_Dies_Actions )
endfunction