N
Naruto[Leaf]
Guest
Code:
function Trig_Tremor_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A00C'
endfunction
function Tremor_Destroy_Trees takes nothing returns nothing
call KillDestructable(GetEnumDestructable())
endfunction
function Tremor_Destroy takes nothing returns nothing
local destructable d = bj_lastCreatedDestructable
call TriggerSleepAction(5)
call RemoveDestructable( d )
set d = null
endfunction
function Tremor_Effects takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = GetHandleUnit(t,"u")
local real ang = GetHandleReal(t,"ang")
local real dist = GetHandleReal(t,"dist")
local integer i = GetHandleInt(t,"i")
local real x = GetUnitX(u) + dist * Cos(ang * bj_DEGTORAD) + GetRandomReal(-50, 50 )
local real y = GetUnitY(u) + dist * Sin(ang * bj_DEGTORAD) + GetRandomReal(-50, 50 )
local rect re = Rect(x - 175., y - 175., x + 175., y + 175.)
if i> 20 then
call PauseTimer(t)
call FlushHandleLocals(t)
call DestroyTimer(t)
set t = null
call EnumDestructablesInRect(re,null,function Tremor_Destroy_Trees)
else
set bj_lastCreatedDestructable = CreateDestructable( 'B000', x,y, ang, .5, 0 )
call ExecuteFunc("Tremor_Destroy")
call DestroyEffect(AddSpecialEffect( "Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl",x,y))
endif
call SetHandleReal(t,"dist",dist+60)
call SetHandleInt(t,"i",i+1)
call RemoveRect(re)
set re = null
set t = null
set u = null
endfunction
function Trig_Tremor_Actions takes nothing returns nothing
local timer t = CreateTimer()
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local location l = GetSpellTargetLoc()
local real ang = bj_RADTODEG*Atan2(GetLocationY(l) - y, GetLocationX(l) - x)
call SetHandleHandle(t,"u",u)
call SetHandleReal(t,"ang",ang)
call SetHandleReal(t,"dist",60)
call SetHandleInt(t,"i",0)
call TimerStart(t,0.01,true,function Tremor_Effects)
set t = null
set u = null
call RemoveLocation(l)
set l = null
endfunction
//====================================================================== =====
function InitTrig_Fissure takes nothing returns nothing
set gg_trg_Fissure = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Fissure, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Fissure, Condition( function Trig_Tremor_Conditions ) )
call TriggerAddAction( gg_trg_Fissure, function Trig_Tremor_Actions )
endfunction
Ok that's the fissure I got from a friend. How do I set the duration of the fissure shorter? How could I also decrease the range and make the fissure fit more closely together? Could anyone please help me decode that jumble of Jass? hehe Thx in advance. It works fine, i just wanted some improvements