Need someone to add wait to this spell

mordocai

New Member
Reaction score
17
Need someone to add pause to this spell

Hey guys, i have a spell request that i need done and it should be very easy. I asked wolfie already so he was the one that put in the pause into the spell, but now whenever i cast it, it just keeps spamming the spell over and over and over again. Can someone put the waits into the right parts so it doesnt spam?
+rep and credits will be awarded as usual
 

Attachments

  • Suiton - Suishouha.w3x
    59 KB · Views: 77

Exide

I am amazingly focused right now!
Reaction score
448
I'm just guessing here.
Try increasing:

JASS:

    private constant real    WaveInterval        = 2.00


or

JASS:

    private constant real    TimeOut             = 0.02
 

Sooda

Diversity enchants
Reaction score
318
Next time please post code directly to forum because downloading, starting World Editor, opening map is tiresome work. Especially when trigger is in JASS.
This thread belongs to JASS forum.

I paused caster now, but for me it bugs, caster starts to cast infinitely. I don't understand is it only my game bug or happens it to others:
JASS:
//**********************************
//*                                *
//*     W A T E R   W A V E       *
//*             v1.2             *
//*                             *
//*       By: Ribenamania      *
//*                           *
//****************************

scope Water initializer init

globals
    //***************************************************************************************
    //* These are variables that can be manipulate to have various effects of the spell     *
    //***************************************************************************************
    //* FollowCaster      - Do the waves centered at the caster every time boolean          *
    //* WaveTimesLevel    - Do the wave's time multiple with level boolean                  *
    //* WaveIntervalLevel - Do the wave's interval multiple with level boolean              *
    //* WaveIntervalUp    - Do the wave's interval go up or down [true - up] [false - down] *
    //* DummyNumberLevel  - Do the wave's dummynumber multiple with level boolean           *
    //* KnockbackLevel    - Do the wave's knockback multiple with level boolean             *
    //* WaveDamageLevel   - Do the wave's damage multiple with level boolean                *
    //* SpellRawCode      - Raw Code of The Spell                                          *
    //* DummyRawCode      - Raw Code of The Dummy                                         *
    //* WaveTimes         - Times of Wave                                                *
    //* WaveInterval      - Interval Between Wave Times                                 *
    //* DummyNumber       - Numbers of Waves/Dummies Summoned Out                      *
    //* Knockback         - Distance of Knockback                                     *
    //* WaveDamage        - Damage per TimeOut of Wave [Per Level]                   *
    //* WaveRadius        - Radius of Wave Hit Units                                *
    //* Timeout           - Timer's Time Out [Controls the speed of the wave       *
    //* CasterSFX         - The Special Effect of Caster When Spell Was Started   *
    //* SFX               - The Special Effect When A Unit Has Been Hit          *
    //***************************************************************************
    private constant boolean FollowCaster        = true
    private constant boolean WaveTimesLevel      = true
    private constant boolean WaveIntervalLevel   = true
    private constant boolean WaveIntervalUp      = false
    private constant boolean DummyNumberLevel    = true
    private constant boolean KnockbackLevel      = true
    private constant boolean WaveDamageLevel     = true
    private constant integer SpellRawCode        = 'A000'
    private constant integer DummyRawCode        = 'n000'
    private constant real    WaveTimes           = 1.00
    private constant real    DummyNumber         = 2.00
    private constant real    WaveInterval        = 2.00
    private constant real    Knockback           = 1.00
    private constant real    WaveDamage          = 3.00
    private constant real    WaveRadius          = 90.00
    private constant real    TimeOut             = 0.02
    private constant string  CasterSFX           = "Objects\\Spawnmodels\\Naga\\NagaDeath\\NagaDeath.mdl"
    private constant string  SFX                 = "Abilities\\Spells\\Other\\CrushingWave\\CrushingWaveDamage.mdl"
    
    //************************************************************
    //*       These are variables that cannot be manipulate     *
    //**********************************************************
    private constant group WaterGroup            = CreateGroup()
    private constant timer tim                   = CreateTimer()
    private integer total                        = 0
    private integer array water
    private unit wave                            = null
endglobals

private struct Water_Data
    unit s
endstruct

//*******************************************************
//*               Spell Starts Here                    *
//*****************************************************
private function Update takes nothing returns nothing
    local unit u
    local unit enum
    local Water_Data wd
    local integer i = total - 1
    local real level
    local real knockang
    local real x 
    local real y
    local real ang
    local real Knock = Knockback
    local real Damage = WaveDamage
    loop
        exitwhen i < 0
        set wd = water<i>
        set u = wd.s
        set wave = u
        if GetWidgetLife(u) &lt; .405 then
	        call wd.destroy()
            set total = total - 1
            if total &lt; 0 then
                call PauseTimer(tim)
                set total = 0
            else
                set water<i> = water[total]
            endif
        else
            set ang = GetUnitFacing(u)
            set x = GetUnitX(u) + 5 * Cos(ang * bj_DEGTORAD)
            set y = GetUnitY(u) + 5 * Sin(ang * bj_DEGTORAD)
            call SetUnitPosition(u, x, y)
            call GroupEnumUnitsInRange(WaterGroup, x, y, WaveRadius, null)
            set enum = FirstOfGroup(WaterGroup)
            loop
                exitwhen enum == null
                set level = I2R(GetUnitAbilityLevel(wave, &#039;Avul&#039;))
                set knockang = bj_RADTODEG * Atan2(GetUnitY(enum) - GetUnitY(wave), GetUnitX(enum) - GetUnitX(wave))
                if KnockbackLevel == true then
                    set Knock = Knockback * level
                endif
                if WaveDamageLevel == true then
                    set Damage = WaveDamage * level
                endif
                set x = GetUnitX(enum) + Knock * Cos(knockang * bj_DEGTORAD)
                set y = GetUnitY(enum) + Knock * Sin(knockang * bj_DEGTORAD)
                if ( GetWidgetLife(enum) &gt; .405 == true and IsUnitEnemy(enum, GetOwningPlayer(wave))) then
                    call UnitDamageTarget(wave, enum, Damage, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
                    if IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY) == false then
                        call SetUnitPosition(enum, x, y)
                    endif
                    call DestroyEffect(AddSpecialEffect(SFX, x, y))
                endif
                call GroupRemoveUnit(WaterGroup, enum)
                set enum = null
                set enum = FirstOfGroup(WaterGroup)
            endloop
	    endif
        set wave = null
        set i = i - 1
    endloop
    set u = null
endfunction

private function Trig_Suiton_Suishouha_Actions takes nothing returns nothing
    local Water_Data wd
    local unit caster = GetTriggerUnit()
    local real casterlevel = I2R(GetUnitAbilityLevel(caster, SpellRawCode))
    local real angle = 360.00 / DummyNumber
    local real cx = GetUnitX(caster)
    local real cy = GetUnitY(caster)
    local real x = GetUnitX(caster)
    local real y = GetUnitY(caster)
    local integer i = 1
    local integer loopi = 1
    local real DummyNum = DummyNumber
    local real WaveTime = WaveTimes
    local real WaveInter = WaveInterval
    
    call PauseUnit(caster, true) // Pauses caster, edit by Sooda (thehelper.net).
    
    if DummyNumberLevel == true then
        set DummyNum = DummyNumber * casterlevel
    endif
    if WaveTimesLevel == true then
        set WaveTime = WaveTimes * casterlevel
    endif
    if WaveIntervalLevel == true then
        if WaveIntervalUp == false then
            set WaveInter = WaveInterval / casterlevel
        else
            set WaveInter = WaveInterval * casterlevel
        endif
    endif
    loop
        exitwhen loopi &gt; WaveTime
        loop
            exitwhen i &gt; DummyNum
            set wd = Water_Data.create()
            if FollowCaster == true then
                set x = GetUnitX(caster) + 90 * Cos((GetUnitFacing(caster) + angle) * bj_DEGTORAD)
                set y = GetUnitY(caster) + 90 * Sin((GetUnitFacing(caster) + angle) * bj_DEGTORAD)
            else
                set x = cx + 90 * Cos((GetUnitFacing(caster) + angle) * bj_DEGTORAD)
                set y = cy + 90 * Sin((GetUnitFacing(caster) + angle) * bj_DEGTORAD)
            endif
            set wd.s = CreateUnit(GetOwningPlayer(caster), DummyRawCode, x, y, (GetUnitFacing(caster) + angle))
            call SetUnitAbilityLevel(wd.s, &#039;Avul&#039;, GetUnitAbilityLevel(caster, SpellRawCode))
            set water[total] = wd
            set total = total + 1
            set angle = angle + 360.00 / DummyNum
            set i = i + 1
        endloop
        if FollowCaster == true then
            call DestroyEffect(AddSpecialEffect(CasterSFX, GetUnitX(caster), GetUnitY(caster)))
        else
            call DestroyEffect(AddSpecialEffect(CasterSFX, cx, cy))
        endif
        if total == R2I(DummyNum) then
            call TimerStart(tim, TimeOut, true, function Update)
        endif
        set angle = 360.00 / DummyNum
        set i = 1
        call TriggerSleepAction(WaveInter)
        set loopi = loopi + 1
    endloop
    
    call PauseUnit(caster, false) // unpauses caster when ability is finished, edit by Sooda (thehelper.net).
    set caster = null
endfunction

private function Trig_Suiton_Suishouha_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == SpellRawCode
endfunction

//===========================================================================
private function init takes nothing returns nothing
    local integer index = 0
    set gg_trg_Suiton_Suishouha =CreateTrigger( )
    loop
        call TriggerRegisterPlayerUnitEvent(gg_trg_Suiton_Suishouha, Player(index), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
        set index = index + 1
        exitwhen index == bj_MAX_PLAYER_SLOTS
    endloop
    call TriggerAddCondition( gg_trg_Suiton_Suishouha, Condition(function Trig_Suiton_Suishouha_Conditions))
    call TriggerAddAction( gg_trg_Suiton_Suishouha, function Trig_Suiton_Suishouha_Actions )
endfunction
endscope
</i></i>
 
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