How do i not use the bjs. I cant find natives to do them...? Or how to do i make a more efficient code of it.
JASS:
scope regrowtrees initializer Init
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == 039;tGrw039;
endfunction
private function regrow takes nothing returns nothing
call DestructableRestoreLife( GetEnumDestructable(), GetDestructableMaxLife(GetEnumDestructable()), true ))
endfunction
private function Actions takes nothing returns nothing
local location loc = GetSpellTargetLoc()
call EnumDestructablesInCircleBJ( 300.00, loc, function regrow )
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Items\\AIvi\\AIviTarget.mdl", GetLocationX(loc) , GetLocationY(loc))
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
private function Init takes nothing returns nothing
local trigger regrowtrees = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( regrowtrees, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( regrowtrees, Condition( function Conditions ) )
call TriggerAddAction( regrowtrees, function Actions )
set regrowtrees = null
endfunction
endscope