• 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.

[Trigger] Speed Boost Ability , help please.

Status
Not open for further replies.
Level 8
Joined
Sep 25, 2007
Messages
382
hi ppl , i need an ability that boost speed for a moment. this skill is lvl 6 ( 6 - 11 - 16).
--------------------------------------------------------------------------
Speed Boost:

LVL Upgrade: +100 MS , 6 secs.
+150 MS , 6 secs.
+200 MS , 6 secs.

Mana Required: 150 / 175 / 200.
Cooldown: 90 secs.
LVL Required: 6.
LVL Grow: 6 - 11 - 16.
--------------------------------------------------------------------------
please , i need help xD.
 
Level 11
Joined
Feb 22, 2006
Messages
752
I don't know how to increase movement speed by an absolute value (other than triggers), but you can use modified speed scroll spell or beserk to increase movement speed by percentage. If you need absolute increases you would need a trigger that fires when the hero casts a dummy spell and set the movement speed of the hero to a desired value, then after a set amount of time set the movement speed of the hero back to normal.
 
Level 21
Joined
Aug 9, 2006
Messages
2,384
Create a trigger, which gives to the unit the item ability of the boots of speed which increases movement speed when casted and waits then for the needed time and removes the ability again, manipulate the ability for your needs and it works.

Or you use the Set Movement Speed trigger and just take the current movement speed + your calculated (with a formula) Movement Speed and reset it when the spell runs out.

Or you use the Scroll which increases movement speed for all around and simply set it to self-only and give it the needed attributes.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
[Edit] whops, sorry for double post didn't notice I wasn't on edit lol.

  • Untitled Trigger 002
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Player - Enable Acid Bomb for (Owner of (Triggering unit))
      • Wait 6.00 seconds
      • Player - Disable Acid Bomb for (Owner of (Triggering unit))

The ability should be which ever one you want.
Since this isn't MUI, ill give you the custom script code with a local variable which makes this MUI (don't start crying its just this trigger + 2 lines :p)

Code:
function Trig_[COLOR="Lime"]Untitled_Trigger_002[/COLOR]_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'AUan' ) ) then
        return false
    endif
    return true
endfunction

function Trig_[COLOR="Lime"]Untitled_Trigger_002[/COLOR]_Actions takes nothing returns nothing
    [COLOR="Red"]local unit u = GetTriggerUnit()[/COLOR]
    call SetPlayerAbilityAvailableBJ( true, 'ANab', GetOwningPlayer([COLOR="red"]u[/COLOR]) )
    call TriggerSleepAction( 6.00 )
    call SetPlayerAbilityAvailableBJ( false, 'ANab', GetOwningPlayer([COLOR="red"]u[/COLOR]) )
    [COLOR="red"]set u = null[/COLOR]
endfunction

//===========================================================================
function InitTrig_[COLOR="lime"]Untitled_Trigger_002[/COLOR] takes nothing returns nothing
    set gg_trg_[COLOR="lime"]Untitled_Trigger_002 [/COLOR]= CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( [COLOR="lime"]gg_trg_Untitled_Trigger_002[/COLOR], EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_[COLOR="lime"]Untitled_Trigger_002[/COLOR], Condition( function Trig_[COLOR="lime"]Untitled_Trigger_002[/COLOR]_Conditions ) )
    call TriggerAddAction( gg_trg_[COLOR="lime"]Untitled_Trigger_002[/COLOR], function Trig_[COLOR="lime"]Untitled_Trigger_002[/COLOR]_Actions )
endfunction


The red parts are the changes.
You add a local, change "GetTriggerUnit()" to "u" (at those 2 red "u"s) and then null u.
I suggest you to NOT copy this code because it will not work for you unless your trigger is called "Untitled Trigger 002" and I guess you don't want it to be called like this ?
If you still want to copy it, change all the green parts to your trigger name ( "_" is a space so if your trigger is called "I Am Cool", in custom script it'll be "I_Am_Cool").

Rawcodes
In case you don't know whats a rawcode, take an example at the start of that code there is this line

"if ( not ( GetSpellAbilityId() == 'AUan' ) ) then"

The purple part is the rawcode of Animate Dead.
So, if you want to change it to your own abilitie's rawcode, you'll need to go to the Object Manager, click Ctrl+D (click Ctrl+D again to disable this) and it will change the abilities/items/units and everything else's names to rawcodes.
Now just change it.

The first rawcode is the ability the unit casts, the second and third ones are the disabled speed passive ability.


[Notes]
- your ability should be inside a disabled spell book if you don't want the players to see it.
Click here to learn more on spell books and how to create invisible passive abilities.

- Be sure to disable your ability at the start of the game (0.00).
 
Last edited:
Level 5
Joined
Jan 15, 2007
Messages
199
This is a way to make it MUI in GUI

  • Add Ability
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Custom script: local unit udg_caster
      • Set Caster = (Triggering unit)
      • Unit - Add Acid Bomb to Caster
      • Unit - Set level of Acid Bomb for Caster to (Level of Animate Dead for Caster)
      • Wait 6.00 seconds
      • Unit - Remove Acid Bomb from Caster
      • Set Caster = No unit
function Trig_Untitled_Trigger_002_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'AUan' ) ) then
return false
endif
return true
endfunction

function Trig_Untitled_Trigger_002_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
call SetPlayerAbilityAvailableBJ( true, 'ANab', GetOwningPlayer(u) )
call TriggerSleepAction( 6.00 )
call SetPlayerAbilityAvailableBJ( false, 'ANab', GetOwningPlayer(u) )
set u = null
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_002 takes nothing returns nothing
set gg_trg_Untitled_Trigger_002 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Untitled_Trigger_002, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Untitled_Trigger_002, Condition( function Trig_Untitled_Trigger_002_Conditions ) )
call TriggerAddAction( gg_trg_Untitled_Trigger_002, function Trig_Untitled_Trigger_002_Actions )
endfunction

If you do post in JASS, you might as well still make it efficient... And also, you didn't make it MUI, you made it MPI.

Code:
function Trig_Untitled_Trigger_002_Conditions takes nothing returns boolean
   return GetSpellAbilityId() == 'AUan' //This is where you put the ID of the spell
endfunction

function Trig_Untitled_Trigger_002_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit() //This sets the variable 'u' to the casting unit, to be used multiple times later.
    local integer spellId = 'ANab' //This is where you set the ID of the spell to add.
    call UnitAddAbility( u, spellId ) //Adds the ability
    call SetUnitAbilityLevel( u, spellId, GetUnitAbilityLevel( u, 'AUan' ) ) //Sets the level of ability to level of ability cast
    call TriggerSleepAction( 6.00 ) //Wait 6 seconds.
    call UnitRemoveAbility( u, spellId ) //Removes ability
    set u = null//Stops variable 'u' from leaking by nulling it
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_002 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_002 = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Untitled_Trigger_002, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Untitled_Trigger_002, Condition( function Trig_Untitled_Trigger_002_Conditions ) )
    call TriggerAddAction( gg_trg_Untitled_Trigger_002, function Trig_Untitled_Trigger_002_Actions )
endfunction
 
Last edited:
Level 8
Joined
Sep 25, 2007
Messages
382
well , but that triggers make the unit go faster for seconds? because it doesnt look like xD , if not , im noob :xxd:...
 
Level 8
Joined
Sep 25, 2007
Messages
382
so , it is impossible to surpass +200 MS without item triggers... it have to be made with spellbook ... well , so if im not wrong (cuz i dun understand to much) da trigger you made is for the spellbok...
i want for the ability.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
The trigger we made gives you the passive ability (I suggest you to base it off "Item Move Speed Bonus" which is the ability "Boots of Speed" uses), and then after 6 seconds removes it.

Im not really sure how this will work with a disabled spell book, probably they mention it in the tutorial I gave you though.

Oh and change a bit of code Bobo made.
If you create that local that'll be the rawcode, chnage

call UnitAddAbility( u, rawcode )
to
call UnitAddAbility( u, spellId )

If you don't make that local, then put there the rawcode.
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
What is wrong with ability of Haste Rune ?
make it hero ability and give mana cost

IF IT DOESNT WORK (Im sure it will)

make a dummy casts some speed increasing ability to you
 
Status
Not open for further replies.
Top