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

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.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top