Help with Fissure

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 :)
 

phyrex1an

Staff Member and irregular helper
Reaction score
447
Code:
call TriggerSleepAction(5)
That is the duration of each destructable created. For now it is 5 seconds.

Code:
if i> 20 then
This is how many destructables that is created, 20 for now.

Code:
call TimerStart(t,0.01,true,function Tremor_Effects)
This is how long time it is between the creation of each destructable, as for now it is 0.01 sec between each destructable.

Code:
call SetHandleReal(t,"dist",60)
This is how far from the unit the first destructable is created, 60 for now.

Code:
call SetHandleReal(t,"dist",dist+60)
This is the distance between each destructable, 60 for now.
 
P

patcat

Guest
o_O

wow...... you are the only person I've ever seen to solve a problem with just one post... :eek: i am in awe

lol
 

emjlr3

Change can be a good thing
Reaction score
395
that code looks awefully familiar
 
N

Naruto[Leaf]

Guest
Yeah made it myself ;) Hehe jk I will not reveal who made this trigger !!!
 

emjlr3

Change can be a good thing
Reaction score
395
er....I made it...lol
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top