HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Imitating "Sleep"

07-11-2007, 07:32 AM#1
Pyrogasm
Is there any way to imitate the "Sleep" spell (magical sleep) such that units will not auto-acquire the sleeping unit as a target and the unit will be "frozen" without actually using a dummy sleep spell? AKA: I want to do this without having a buff show up on the command card.

I tried adding the "sleeping" classifaction, but that did nothing. Would making it a "worker" work/do anything?
07-11-2007, 08:43 AM#2
GamesSmash
I think this would work:
Trigger:
Sleep
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to (==) Earthquake
Collapse Actions
Unit - Make (Target unit of ability being cast) Vulnerable
Unit - Pause (Target unit of ability being cast)
Unit - Remove All buffs from (Target unit of ability being cast)
07-11-2007, 08:55 AM#3
Pyrogasm
I want units to not auto-acquire that specific unit; your trigger does not solve that.
07-11-2007, 09:02 AM#4
Toink
Tried adding worker classification?
07-11-2007, 09:08 AM#5
Pyrogasm
I thought about it, but I realized that would stop the units from auto-acquiring any target.

Here are the triggers I'm using (just detecting when Faerie Fire is cast); I'm going to try adding a pause to see if that affects anything.
Collapse JASS:
function Trig_Sleep_Test_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A002'
endfunction

function Trig_Sleep_Test_Actions takes nothing returns nothing
    local unit TestUnit = GetSpellTargetUnit()
    call UnitAddTypeBJ( UNIT_TYPE_SLEEPING, TestUnit )
    call DisplayTextToForce( GetPlayersAll(), "Sleeping Added" )
    loop
        call PolledWait(0.01)
        exitwhen not(UnitHasBuffBJ(TestUnit, 'Bfae'))
    endloop
    call DisplayTextToForce( GetPlayersAll(), "Sleeping Removed" )
    call UnitRemoveTypeBJ( UNIT_TYPE_SLEEPING, TestUnit )
endfunction

//===========================================================================
function InitTrig_Sleep_Test takes nothing returns nothing
    set gg_trg_Sleep_Test = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Sleep_Test, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Sleep_Test, Condition( function Trig_Sleep_Test_Conditions ) )
    call TriggerAddAction( gg_trg_Sleep_Test, function Trig_Sleep_Test_Actions )
endfunction

Trigger:
Init Add
Collapse Events
Map initialization
Conditions
Collapse Actions
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Trigger - Add to Remove Buff <gen> the event (Unit - (Picked unit) Takes damage))
Trigger:
Remove Buff
Events
Collapse Conditions
((Triggering unit) has buff Faerie Fire) Equal to True
Collapse Actions
Unit - Remove Faerie Fire buff from (Triggering unit)

Edit: Pausing does nothing.
07-11-2007, 10:50 AM#6
Anitarf
What's so bad about displaying a buff?
07-11-2007, 10:56 AM#7
Pyrogasm
I'm trying to make an autocast sleep by basing the spell off of Faerie Fire. The advantage of using that as the base is that the caster will not re-cast the spell on the unit until it is woken up/the duration ends (whenever the buff is not present).

If I have to use a dummy sleep, the unit would gain 2 buffs on its command card, neither of which I can remove. If I remove the Faerie Fire-based buff, the caster will autocast on it again; if I remove the sleep buff, the unit will wake up.

Edit: Also, I'm making a hero based off of the sleep mechanic, so being able to just go call SleepUnit(GetTriggerUnit(), 12.50) would be useful.
07-11-2007, 06:11 PM#8
GamesSmash
You can try this:

Trigger:
Sleep
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to (==) Earthquake
Actions
Game - Wait 5.00 game time seconds
Unit - Make (Target unit of ability being cast) Inulnerable
Unit - Remove All buffs from (Target unit of ability being cast)
07-11-2007, 09:43 PM#9
Tide-Arc Ephemera
Couldn't you like... just remove the icon from sleep-buff for dummy casting?
07-11-2007, 09:49 PM#10
Pyrogasm
That would do nothing, Tide-Arc Ephemera. Instead of having a nice, lovely buff icon, the spell would now have a glaring green box for a buff icon.

And GamesSmash, do you have any idea what I'm trying to do?
07-11-2007, 10:02 PM#11
Timmay
I'm pretty sure that if you set a buff icon to NONE, then it will not show the icon when a unit has that buff. However, you can still see the buff tooltips when you scroll over where the icon should be.
07-11-2007, 11:03 PM#12
Thunder_Eye
You could use "Textures\Black32.blp".
07-11-2007, 11:11 PM#13
Pyrogasm
Ok, so we've determined that I can make the buff "invisible" by changing the buff icon.

I'm still wondering if there is any combination of classifications/other stuff that would allow me to create a custom sleep function.
07-11-2007, 11:13 PM#14
xombie
Timmay, you're wrong. If you set the icon to 'None' then it displays, as Pyro said, a glaring bright green box.

Pyrogasm, try basing the buff off of something that by default doesn't have an icon. You don't have to base it off of the 'Sleep' buff. Find a buff that is initiated off of a target-cast and replace the buff on your 'Sleep' with said buff.

If thats not what you're going for then I'm sorry I'll do better when I'm updated.
07-11-2007, 11:25 PM#15
sas_Skorpion
How about this ... when u cast the pause thing sleep whatever is .... tun on a trigger like this:

Trigger:
Unit - A unit comes within 300.00 of (That unit)
and now i don't remember the command to turn off auto acquisition ... when the unit leaves the range of the hero you turn it again on :)

EDIT: I'm not 100% sure cause i didn't figure out yet how to turn it again on ...