Hi hive, I'm having problems with this spell, Chaotic Fire. It picks every unit around it in range, then it damages them. The damage works just fine, but the special effects doesn't show up! I don't know why. Help will be appreciated.
JASS:
scope ChaoticFire initializer Init
globals
private constant integer SPELL_ID = 'A01G'
private constant string EFFECT_TARGET ="Abilities\\Spells\\Orc\\Disenchant\\DisenchantSpecialArt.mdl"
private constant string EFFECT_CASTER ="Abilities\\Spells\\Human\\FlameStrike\\FlameStrike1.mdl"
private group all
private group copy
private boolexpr b
endglobals
private function Targets takes unit target returns boolean
return (GetWidgetLife(target) > 0.405) and(IsUnitType(target, UNIT_TYPE_STRUCTURE) == false) and(IsUnitType(target, UNIT_TYPE_MAGIC_IMMUNE) == false) and(IsUnitType(target, UNIT_TYPE_MECHANICAL) == false)
endfunction
private function Pick takes nothing returns boolean
return Targets(GetFilterUnit())
endfunction
private function CopyGroup takes group g returns group
set bj_groupAddGroupDest = CreateGroup()
call ForGroup(g, function GroupAddGroupEnum)
return bj_groupAddGroupDest
endfunction
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == SPELL_ID
endfunction
private function Actions takes nothing returns nothing
local unit hero = GetTriggerUnit()
local player owner = GetOwningPlayer(hero)
local integer pid = GetPlayerId(owner) + 1
local real x = GetUnitX(hero)
local real y = GetUnitY(hero)
local unit f
local real dmg = udg_StatsMentalPower[pid] * 2.0
call GroupEnumUnitsInRange(all, x, y, 750,b)
set copy = CopyGroup(all)
call DestroyEffect(AddSpecialEffectTarget(EFFECT_CASTER, hero, "origin"))
loop
set f = FirstOfGroup(all)
exitwhen (f == null)
call GroupRemoveUnit(all, f)
if IsUnitEnemy(f, owner) then
call DestroyEffect(AddSpecialEffectTarget(EFFECT_TARGET, f, "origin"))
call UnitDamageTarget(hero, f, dmg, false, true,ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, null)
call ZTS_ApplyHealThreat( GetTriggerUnit(), GetSpellTargetUnit(), 85, true, true)
endif
endloop
set hero = null
endfunction
//===========================================================================
private function Init takes nothing returns nothing
local trigger ChaoticFireTrg = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( ChaoticFireTrg, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( ChaoticFireTrg, Condition( function Conditions ) )
call TriggerAddAction(ChaoticFireTrg, function Actions )
set all = CreateGroup()
set b = Condition(function Pick)
set copy = CreateGroup()
call Preload(EFFECT_CASTER)
call Preload(EFFECT_TARGET)
endfunction
endscope