Hello, I have a problem with this ability not dealing any damage and I dont know how to make it deal damage properly, is the caster not set properly? Or is there a different issue causing this.
JASS:
function Trig_Kamikaze_Sound_Conditions takes nothing returns boolean
return((GetSpellAbilityId()=='A00I'))or((GetSpellAbilityId()=='A884'))
endfunction
function Trig_Kamikaze_Sound_Actions takes nothing returns nothing
call PlaySoundOnUnitBJ(udg_sound17, 100, GetTriggerUnit())
set udg_Caster[GetConvertedPlayerId(GetTriggerPlayer())] = GetTriggerUnit()
endfunction
function Trig_Kamikaze_Attack_Conditions takes nothing returns boolean
return((GetUnitTypeId(GetDyingUnit())=='h00B'))
endfunction
function Trig_Kamikaze_Attack_Func009002003 takes nothing returns boolean
return(IsPlayerAlly(GetOwningPlayer(GetFilterUnit()),GetOwningPlayer(GetTriggerUnit()))==false)
endfunction
function Trig_Kamikaze_Attack_Func010A takes nothing returns nothing
call UnitDamageTargetBJ(udg_Caster[GetConvertedPlayerId(GetTriggerPlayer())], GetEnumUnit(), udg_real02, ATTACK_TYPE_MELEE, DAMAGE_TYPE_NORMAL)
endfunction
function Trig_Kamikaze_Attack_Func012Func001C takes nothing returns boolean
return((IsDestructableAliveBJ(GetEnumDestructable())))
endfunction
function Trig_Kamikaze_Attack_Func012A takes nothing returns nothing
if((IsDestructableAliveBJ(GetEnumDestructable())))then
call KillDestructable(GetEnumDestructable())
call TriggerExecute(udg_trigger623)
endif
endfunction
function Trig_Kamikaze_Attack_Actions takes nothing returns nothing
set udg_location08=GetUnitLoc(GetTriggerUnit())
call SetTerrainTypeBJ(udg_location08,'Kdtr',-1,3,0)
call SetTerrainTypeBJ(udg_location08,'Jdtr',-1,2,0)
call CreateNUnitsAtLoc(1,'h02N',GetTriggerPlayer(),udg_location08,bj_UNIT_FACING)
call SetUnitVertexColorBJ(bj_lastCreatedUnit,0.00,100.00,0.00,0)
if (GetSpellAbilityId()=='A00I') then
set udg_real02 = ((I2R(GetHeroStatBJ(2, udg_Caster[GetConvertedPlayerId(GetTriggerPlayer())], false)) * (I2R(GetUnitAbilityLevelSwapped('A00I', udg_Caster[GetConvertedPlayerId(GetTriggerPlayer())])) * 9.00)) + 100.00)
endif
if (GetSpellAbilityId()=='A884') then
set udg_real02 = ((I2R(GetHeroStatBJ(2, udg_Caster[GetConvertedPlayerId(GetTriggerPlayer())], false)) * (I2R(GetUnitAbilityLevelSwapped('A884', udg_Caster[GetConvertedPlayerId(GetTriggerPlayer())])) * 9.00)) + 100.00)
endif
call CreateNUnitsAtLoc(1,'h028',GetTriggerPlayer(),udg_location08,bj_UNIT_FACING)
set udg_group05=GetUnitsInRangeOfLocMatching(400.00,udg_location08,Condition(function Trig_Kamikaze_Attack_Func009002003))
call ForGroupBJ(udg_group05,function Trig_Kamikaze_Attack_Func010A)
call DestroyGroup(udg_group05)
call EnumDestructablesInCircleBJ(400.00,udg_location08,function Trig_Kamikaze_Attack_Func012A)
call RemoveLocation(udg_location08)
endfunction