Hey guys, I'm kinda new on vJASS (been studing for 3-4 months) and I'm 'cleaning' my scripts, removing all BJ's. I've noticed that some BJ's are better when not removed and I've searched about this specific:
and it doesn't seems to be working on my code:
I revised every line and if there's an error I couldn't find it's my fault. Anyone to clear my mind?
JASS:
function UnitHasBuffBJ takes unit whichUnit, integer buffcode returns boolean
return (GetUnitAbilityLevel(whichUnit, buffcode) > 0)
endfunction
and it doesn't seems to be working on my code:
JASS:
scope Spells initializer onInit
globals
private trigger DamageT = CreateTrigger()
endglobals
private function Damage takes nothing returns nothing
local unit t = GetTriggerUnit()
local unit u = GetEventDamageSource()
local integer agi = GetHeroAgi(u, true)
local integer str = GetHeroStr(u, true)
local integer int = GetHeroInt(u, true)
local real dmg
local real dmg2
//======= Firebolt ========
if (GetUnitAbilityLevel(t, 'B000') > 0) then
set dmg = int*3
set dmg2 = dmg*3
call UnitRemoveAbility(t, 'B000')
call TextTagSystem_Create( c_red, I2S(R2I(dmg)), t, 12, 90, 64, GetOwningPlayer(u), true)
call UnitDamageTarget(u, t, dmg, false, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
call Timers_InitDamage(u, t, dmg2, 10.0, 1.0, "Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl", "origin", null, c_red)
endif
endfunction
private function AddEvent takes nothing returns nothing
local unit u = GetTriggerUnit()
call TriggerRegisterUnitEvent(DamageT, u, EVENT_UNIT_DAMAGED)
endfunction
private function AddEventInit takes nothing returns nothing
local unit u = GetEnumUnit()
call TriggerRegisterUnitEvent(DamageT, u, EVENT_UNIT_DAMAGED)
endfunction
private function onInit takes nothing returns nothing
local group g = CreateGroup()
local trigger t = CreateTrigger()
local region r = CreateRegion()
call RegionAddRect(r, bj_mapInitialPlayableArea)
call TriggerRegisterEnterRegion(t, r, null)
call TriggerAddAction(t, function AddEvent)
call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea, null)
call ForGroup(g, function AddEventInit)
call TriggerAddAction( DamageT, function Damage )
endfunction
endscope
I revised every line and if there's an error I couldn't find it's my fault. Anyone to clear my mind?