• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

0 move speed and a buffs ? (help plz)

Status
Not open for further replies.
Level 5
Joined
Nov 14, 2007
Messages
161
ok, ive spent way to long on this and it has to be easier...

im making a skill off the game lineage 2 (for those familiar) called Ultimate Defense. basically i need it to buff the unit that casts it for 20 seconds which increases armor by a %, magic reduction by a % but sets movement speed to 0 (or as close to not moving as possible) for some strange reason i cant get it right.

this needs to be MUI, and im fine with a JASS code, my current ones trigger and run (used ingame text) but it doesnt work as intended.

im game for either an idea on how to do this properly and which skills/buffs to give him and how to set speed correctly to 0. SetUnitSpeed i assume, but i somehow am going wrong.

This is my current system which doesnt seem to work, and i've checked ID's like 10 times each.
JASS:
function Trig_Ultimate_Defense_JASS_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A02E'
endfunction

function Trig_Ultimate_Defense_JASS_Actions takes nothing returns nothing
    local unit UDunit = GetEnumUnit()
    
    call SetUnitMoveSpeed(UDunit, 1.0)
    call UnitAddAbility(UDunit, 'A02C')
    call SetUnitAbilityLevel(UDunit, 'A02C', GetUnitAbilityLevel(UDunit, 'A02E')
    call IssueImmediateOrder( UDunit, "defend" )
    call IssueImmediateOrder( UDunit, "stop" )
    
    call DisplayTextToForce( GetPlayersAll(),"Debug: defending yet?")
    call PolledWait(20.0)
    
    call UnitRemoveAbility(UDunit, 'A02C')
    call SetUnitMoveSpeed(UDunit, GetUnitDefaultMoveSpeed(UDunit))
    call DisplayTextToForce( GetPlayersAll(),"Debug: All Done")

    set UDunit = null
endfunction

//===========================================================================
function InitTrig_Ultimate_Defense_JASS takes nothing returns nothing
    set gg_trg_Ultimate_Defense_JASS = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Ultimate_Defense_JASS, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Ultimate_Defense_JASS, Condition( function Trig_Ultimate_Defense_JASS_Conditions ) )
    call TriggerAddAction( gg_trg_Ultimate_Defense_JASS, function Trig_Ultimate_Defense_JASS_Actions )
endfunction
 
Level 5
Joined
Nov 14, 2007
Messages
161
lol, i remember there is something in gameplay constants, 'minimum movement speed'
even simpler =P
it's set to 0.0, ive answered a few of those before for other people.


Create a dummy unit which casts an invisible ensnare on the casting unit, and then increase the armor with a skill like inner fire.

Nothing fancy needed here i guess =P

humm ensnare... totally skipped my mind... i like ;) to bad my rep dont count.
 
Level 5
Joined
Nov 14, 2007
Messages
161
alright, so another buff that adds magic defense? not immunity, just like a 15/30/45% reduction.
 
Level 5
Joined
Nov 14, 2007
Messages
161
i just relized inner fire isnt a %.... got one for me? ;) my original idea was to give the unit the defend skill and order it to use it cus it had both.
 
Level 5
Joined
Nov 14, 2007
Messages
161
i could, but i was attempting to avoid spell books if possible, for some reason i've always sucked at making them... but if i must, i must. any other simple buffs? im looking but cant find one.
 
Level 17
Joined
Jan 21, 2007
Messages
2,014
If you want it to be notarget cast you could use berserk as a "dummy" ability and set it to -50%(or whatever value you want). The use the ensnare on him and voila!

Remeber that damage taken is also spells, so you wont need any spell reduction with this version.

If you want %armor then i think the easiest way is with devotion aura.
 
Level 6
Joined
Sep 5, 2007
Messages
264
Here's what I have... ('A000' is an ability based off "defend")

JASS:
call UnitAddAbility(caster, 'A000')
call IssueImmediateOrder(caster, "defend")
call SetPlayerAbilityAvailable(GetOwningPlayer(caster), 'A000', false)
call TriggerSleepAction(20)
call SetPlayerAbilityAvailable(GetOwningPlayer(caster), 'A000', true)
call IssueImmediateOrder(caster, "undefend")
call UnitRemoveAbility(caster, 'A000')

I based the dummy ability off of "berserk - item" with the following stats:
Attack speed increase = 0.00
Damage taken increase = 0.00
Movement speed increase = -10.00 (to be certain that your unit STOPS DEAD)

The "defend" ability stats:
Chance to deflect = 0.00
Deflect damage taken = 1.00
Movement speed factor = 0.00
Targets allowed = air,debris,enemies,friend,ground,invulnerable,neutral,self,structure,vulnerable,ward
Damage taken = 0.5
Magic damage reduction = 0.5

"Defend" is the ability that actually reduces the damage, berserk stops movement (but the unit can still turn, easily fixed with SetUnitTurnSpeed). I tested it with these settings and I had a 50% reduction on any damage (friendly or enemy, spell or attack).

I know that I used a "TriggerSleepAction" in that code, I did this in a hurry and was only testing it, so that was fine. I'd recommend using a reasonably med/high-speed timer that checks for the berserk buff, then removes defend. Don't forget the line:
JASS:
call IssueImmediateOrder(caster, "undefend")
This line was vital to make it work, and the SetPlayerAbilityAvailable calls are just to hide the defend ability.
 
Level 5
Joined
Nov 14, 2007
Messages
161
im at school so i cant test it now, but would you mind attaching the map for me? my original trigger and everything was suppose to work that way but it just wasnt working right. thanks ahead of time.

EDIT: ok this is what i have now and im pretty sure it's not giving, nor activating the defend skill, any ideas?

attachment.php

JASS:
function Trig_Ultimate_Defense_JASS_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A00D'
endfunction

function Trig_Ultimate_Defense_JASS_Actions takes nothing returns nothing
    local unit caster = GetEnumUnit()
    
    call DisplayTextToForce( GetPlayersAll(),"Debug: start")
    
    call UnitAddAbility(caster, 'A00A')
    call IssueImmediateOrder(caster, "defend")
    call SetPlayerAbilityAvailable(GetOwningPlayer(caster), 'A00A', false)
    
    call DisplayTextToForce( GetPlayersAll(),"Debug: defending?")
    call TriggerSleepAction(20)
                                                                    
    call SetPlayerAbilityAvailable(GetOwningPlayer(caster), 'A00A', true)
    call IssueImmediateOrder(caster, "undefend")
    call UnitRemoveAbility(caster, 'A00A')
    
    
    call DisplayTextToForce( GetPlayersAll(),"Debug: All Done")
    set caster = null
    
endfunction

//===========================================================================
function InitTrig_Ultimate_Defense_JASS takes nothing returns nothing
    set gg_trg_Ultimate_Defense_JASS = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Ultimate_Defense_JASS, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Ultimate_Defense_JASS, Condition( function Trig_Ultimate_Defense_JASS_Conditions ) )
    call TriggerAddAction( gg_trg_Ultimate_Defense_JASS, function Trig_Ultimate_Defense_JASS_Actions )
endfunction

NOTE: all debug msgs apear correctly, so it's activating and the hero stands still, just not with defend.

Just a thought, is it setting caster right? i want triggering unit
 

Attachments

  • defend ids.jpg
    defend ids.jpg
    5.6 KB · Views: 169
Last edited:
Level 6
Joined
Jun 14, 2008
Messages
176
You can give the unit a modifyed Devotion aura for a set amount of time, since it can be set to % armor

i could, but i was attempting to avoid spell books if possible, for some reason i've always sucked at making them... but if i must, i must. any other simple buffs? im looking but cant find one.

Set the duration of the Devotional to "5 seconds"(or whatever duration you want), make an item with Devotional, and then give it to the unit, then immediately remove it.

Also, make the trigger check if the unit has an inventory, if it doesn't, add an inventory(that can be used), add item, then immediately remove both the item and inventory, no wait triggers needed.
 
Level 6
Joined
Sep 5, 2007
Messages
264
You appeared to be using avatar as the dummy ability... I would strongly suggest using berserk...

Also, yes, you do want caster = GetTriggerUnit() not caster = GetEnumUnit().

GetEnumUnit() is the JASS version of "Matching Unit" in GUI, it is used to detect the currently selected unit when doing group filters.

From what I saw, you were on the right track. :thumbs_up:
 
Level 5
Joined
Nov 14, 2007
Messages
161
You appeared to be using avatar as the dummy ability... I would strongly suggest using berserk...

Also, yes, you do want caster = GetTriggerUnit() not caster = GetEnumUnit().

GetEnumUnit() is the JASS version of "Matching Unit" in GUI, it is used to detect the currently selected unit when doing group filters.

From what I saw, you were on the right track. :thumbs_up:

Damn, lol well i did wonder about that, and avatar is just the icon, it was based of something else. ty ty
 
Level 6
Joined
Sep 5, 2007
Messages
264
Noticed a bug...

:thumbs_down: A minor bug in this method, infact that only bug I've found, is that I can't get it to effect hero attack damage.

Spells and unit attacks are all good. But, nothing I try will make it work against hero attacks.

I've just been my own simple damage detection system to check damage dealt.

The only possible workaround that I can think of would involve giving 1/2 the health back to the unit, doing a check to see if it was "attacked" by a hero.
But, I'd sorta see that as a bit of a hack... :ugly:

It's up to you.
 
Status
Not open for further replies.
Top