I wrote this spell which is supposed to deal physical power * 0.75, I also wrote a script that shows how much my physical power is and it indicates that it is 12 in game, but when I use the spell chop it doesn't do anything Im sure of my globals, If i say + it does damage.
Would appreciate any help!
JASS:
scope Chop initializer Init
globals
private constant integer CHOP_VILLAGER = 'A000'
private constant string CHOP_EFFECT = "Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl"
endglobals
private function Chop_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A000'
endfunction
private function Actions takes nothing returns nothing
local unit hero
local unit target
local integer lvl
local real damage
local integer pid
local player owner
set hero = GetTriggerUnit()
set owner = GetOwningPlayer(hero)
set pid = GetPlayerId(owner)
set target = GetSpellTargetUnit()
set lvl = GetUnitAbilityLevel(hero,CHOP_VILLAGER)
set damage = udg_StatsPhysicalPower[pid]* 0.75
call UnitDamageTarget(hero,target,damage,ATTACK_TYPE_NORMAL,true,false)
call DestroyEffect(AddSpecialEffectTarget(CHOP_EFFECT,target,"origin") )
endfunction
//===========================================================================
private function Init takes nothing returns nothing
local trigger ChopTrg = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( ChopTrg, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( ChopTrg, Condition( function Chop_Conditions ) )
call TriggerAddAction( ChopTrg, function Actions )
call Preload(CHOP_EFFECT)
endfunction
endscope
Would appreciate any help!
Last edited: