HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Adding buff to a unit instantly

02-06-2007, 03:02 PM#1
CommanderZ
Hello,
I need to stun a unit from JASS for several seconds and then remove the buff after several seconds, it is not an effect of any ability, I just need to stun it. Can this be done in some really simple way?
02-06-2007, 03:11 PM#2
wyrmlord
Make an ability that has the buff that you want (perhaps Tornado Aura that just targets self and doesn't slow) and give that ability to the unit that you want to have the buff. You can't just add a buff to a unit, you need to add an ability instead.
02-06-2007, 04:06 PM#3
CommanderZ
Okay, thanks

Just hoped it will be simplier
02-06-2007, 04:17 PM#4
The)TideHunter(
Use Blu's Stun System. Much easier, work done for you, Blu's system lets you stun one or multiple units for as long as you like, no problems.

Here is a link to the system.
02-06-2007, 04:41 PM#5
CommanderZ
I have to make the clone of Tornado(slowing aura) ability and set "Stats - Buffs" to stunned or stunned (pause) (what is the difference?) , right? Are there any other parameters I should change (such as Area of Effect as I need to stun just a single unit)? I used command
Collapse JASS:
call UnitAddAbility( GetSellingUnit(),'A002')

And it doesn't work Btw...is it possible to this with buildings? I need to stun a building.

The)TideHunter(: Thanks, looks nice, but I don't know the duration of the effect - the system seems to need to know exact length of the stun

PS: Sorry if my questions are dumb, I'm newbie to wc3 modding, I started to learn JASS yesterday ;)
02-06-2007, 05:08 PM#6
Captain Griffen
You can't actually stun instantly. You'll need to use a dummy unit to use a stunning ability on the building.
02-06-2007, 05:21 PM#7
CommanderZ
How do I use such dummy?

Are there any other (better) ways to disable a building?

Thanks for patience :)
02-06-2007, 05:24 PM#8
StockBreak
Quote:
Originally Posted by CommanderZ
Are there any other (better) ways to disable a building?

Thanks for patience :)
You could simply pause it :)
02-06-2007, 05:31 PM#9
CommanderZ
I managed to pause it, but I failed in unpausing it, I used this:
Collapse JASS:
call PauseUnit( GetSellingUnit(),true )
...block of commands
call PauseUnit( GetSellingUnit(),false )

The building stays paused :(
02-06-2007, 05:37 PM#10
Captain Griffen
GetSellingUnit() may not work after a wait. Try setting it to a local unit.
02-06-2007, 06:43 PM#11
CommanderZ
I tred it, but it still remains paused :(

Here is whole function:
Collapse JASS:
    local integer i
    local unit sellingu
    set sellingu=GetSellingUnit()
    set i = 1
    call Msg("Flushing")
    call PauseUnit( sellingu,true )
    call Msg("PLAYERNR"+I2S(playernr))
    loop
        set i = 1
        //call Msg("CELKEM ON FLUSH"+I2S(udg_queue_c[playernr]))
        exitwhen(udg_queue_c[playernr]==0)
        call spawn(udg_queue_u[queueNr(playernr,1)],playernr)
        call RemoveUnit(udg_queue_ru[queueNr(playernr,1)])     
        loop
            exitwhen(i==udg_queue_c[playernr])
            exitwhen(udg_queue_c[playernr]==1)
            call SetUnitPositionLoc( udg_queue_ru[queueNr(playernr,i+1)], GetRectCenter(udg_queue_r[queueNr(playernr,i)]) )
            set udg_queue_ru[queueNr(playernr,i)] = udg_queue_ru[queueNr(playernr,i+1)]
            set udg_queue_u[queueNr(playernr,i)] = udg_queue_u[queueNr(playernr,i+1)]
            set i=i+1
        endloop
        call TriggerSleepAction( 1.00 )
        set udg_queue_c[playernr]=udg_queue_c[playernr]-1
    endloop
    //call Msg("WOW") 
    call PauseUnit( sellingu,false )
02-06-2007, 07:36 PM#12
Captain Griffen
If you have debug messages, feel free to tell us what they say.

Does the "WOW" display when tested?
02-06-2007, 08:04 PM#13
Joker
I would blame that wait in that loop
02-06-2007, 08:40 PM#14
CommanderZ
Yes, "wow" displays well (when not commented). Whole script works as expected (not saying well, still has several bugs)

Joker: Why, what is wrong? The scipt should spawn several queued units with one second delays