Laiev
Hey Listen!!
- Reaction score
- 188
well, the problem is... the spell don't work, the damage not happen and none debug msg show :banghead: also no syntax error.
JASS:
scope MegaPunch
globals
private constant integer ABILID = 039;A03G039; //ability of hero
private constant string EFFECT = "Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl" //spawn effect
private constant real RADIUS = 400 //range of effect
endglobals
private function filter takes nothing returns boolean
return IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true and GetFilterUnit() != GetSpellTargetUnit()
endfunction
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit t = GetSpellTargetUnit()
local unit v
local real x = GetUnitX(t)
local real y = GetUnitY(t)
local group g = CreateGroup()
local integer i = u:STR
local real d = I2R(i) * (GetUnitAbilityLevel(u, ABILID) * .2 )
call BJDebugMsg("a")
call Damage_Spell (u, t, (GetUnitAbilityLevel(u, ABILID) * 200) + 200 )
call TextTag_UnitColor (t, I2S((GetUnitAbilityLevel(u, ABILID) * 200) + 200), 100, 20, 20, 100)
call GroupEnumUnitsInRange (g, x, y, RADIUS, Filter(function filter))
loop
set v = FirstOfGroup(g)
exitwhen v == null
call BJDebugMsg("b")
set x = GetUnitX(v)
set y = GetUnitY(v)
call DestroyEffect(AddSpecialEffect(EFFECT, x, y))
call Damage_Spell (u, v, d)
call TextTag_UnitColor (v, R2S(d), 100, 20, 20, 100)
call GroupRemoveUnit(g, v)
endloop
call DestroyGroup(g)
set u = null
set t = null
set g = null
set v = null
endfunction
private function Condi takes nothing returns boolean
if GetSpellAbilityId() == ABILID then
call Actions()
call BJDebugMsg("c")
endif
return false
endfunction
//===========================================================================
public function InitTrig takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function Condi))
endfunction
endscope