• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Attack Speed autocast!

Status
Not open for further replies.
Level 5
Joined
Nov 21, 2014
Messages
151
I want an ability that behaves like Searing Arrows which adds damage on attack, but instead of adding damage it adds attack speed. So for instance level one it adds 40% attack speed but each hit costs 5 mana to keep it active. I tried self-casting bloodlusts, etc but that doesn't seem to work.. Anyone can help me out on this? :wink:
 
Level 22
Joined
Aug 27, 2013
Messages
3,973
I doubt such ability exists in world editor by default. You can do some triggering and make a custom spell to achieve it. Probably using DDS to keep track of attacking unit and give him a bonus attack speed for every successful attack. Simply give the unit an auto-cast ability to make each hit costs mana.
 
Level 5
Joined
Nov 21, 2014
Messages
151
Just check if the ability is active, and use one of the following:


Attack Speed only:
http://www.hiveworkshop.com/forums/spells-569/atack-speed-library-v1-01-a-276550/

State manipulation:
BonusMod
Bonus
http://www.hiveworkshop.com/forums/spells-569/jass-custom-stat-system-css-v1-5g-229885/

I'm afraid they all are JASS/vJASS.

I'm very far into it now (using auras without buffs for the attack speed, etc. But how do I "check if ability is active" ??? Because right now it only works if I click with the ability.. not auto cast it.. (an event)

EDIT: also is there a way to "hide" icons?
EDIT2: Hid the icons using the spellbook trick, still need the event for autocasted abilities..
 
Last edited:
Level 18
Joined
Nov 21, 2012
Messages
835
this may help you to detect when unit has active/inactive searing arrows
you need unit indexer click

JASS:
globals
    boolean array isSearingArrowActive
endglobals
//--------------------------------------------------------------------
function Trig_ord_Actions takes nothing returns boolean
    local integer ord = GetIssuedOrderId()
    local integer id = GetUnitUserData(GetOrderedUnit())

    if ord == 852174 then
        set isSearingArrowActive[id] = true
    elseif ord == 852175 then
        set isSearingArrowActive[id] = false
    endif

    return false
endfunction
//========================================================
function InitTrig_ord takes nothing returns nothing
    set gg_trg_ord = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_ord, EVENT_PLAYER_UNIT_ISSUED_ORDER )
    call TriggerAddCondition( gg_trg_ord, Condition(function Trig_ord_Actions ))
endfunction
 
Level 5
Joined
Nov 21, 2014
Messages
151
this may help you to detect when unit has active/inactive searing arrows
you need unit indexer click

JASS:
globals
    boolean array isSearingArrowActive
endglobals
//--------------------------------------------------------------------
function Trig_ord_Actions takes nothing returns boolean
    local integer ord = GetIssuedOrderId()
    local integer id = GetUnitUserData(GetOrderedUnit())

    if ord == 852174 then
        set isSearingArrowActive[id] = true
    elseif ord == 852175 then
        set isSearingArrowActive[id] = false
    endif

    return false
endfunction
//========================================================
function InitTrig_ord takes nothing returns nothing
    set gg_trg_ord = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_ord, EVENT_PLAYER_UNIT_ISSUED_ORDER )
    call TriggerAddCondition( gg_trg_ord, Condition(function Trig_ord_Actions ))
endfunction

Umm okay, first of all how does one implement this? I never work with JASS. Second of all how does this work with custom abilities my ability is based of searing arrows, it isn't the exact same ability. And how do I link this to the trigger(s) I have right now? Thanks for helping me though!:goblin_good_job:
 
Level 18
Joined
Nov 21, 2012
Messages
835
You can use this code if you have custom ability, but based on original 'searing arrows' . That's ok, because order id cannot be changed and is still 852174 / 852175 for right click-activate and deactivate ability.

Make sure you didnt write anything to Custom Value of units. It is reserved for Unit Indexers. Import Bribe unit indexer, if you dont have any indexer already in your map.
You can use , waht I send this way:
create trigger named ord, convert to custom text. Delete all inside this trigger, copy/paste code from previous post.

Its basicaly setting boolean flag for any unit that activate/deactivate your ability. Tocheck if unit has activated ability use this boolean
isSearingArrowActive[GetUnitUserData(YourUnitHere)]
it returns true is ability is activated, false if it's deactivated.

And one more importand: do you have only one ability based on searing arrows you going to use or more?
 
Level 5
Joined
Nov 21, 2014
Messages
151
You can use this code if you have custom ability, but based on original 'searing arrows' . That's ok, because order id cannot be changed and is still 852174 / 852175 for right click-activate and deactivate ability.

Make sure you didnt write anything to Custom Value of units. It is reserved for Unit Indexers. Import Bribe unit indexer, if you dont have any indexer already in your map.
You can use , waht I send this way:
create trigger named ord, convert to custom text. Delete all inside this trigger, copy/paste code from previous post.

Its basicaly setting boolean flag for any unit that activate/deactivate your ability. Tocheck if unit has activated ability use this boolean
isSearingArrowActive[GetUnitUserData(YourUnitHere)]
it returns true is ability is activated, false if it's deactivated.


I have imported your trigger etc. But how do I exactly check for it with my (non custom text) trigger? How do I "isSearingArrowActive[GetUnitUserData(YourUnitHere)]" ?

Also the trigger gives "Exptected variable name" and "expected end of line"
 
Last edited:
Level 5
Joined
Nov 21, 2014
Messages
151
And one more importand: do you have only one ability based on searing arrows you going to use or more?

Oh and, if it's too much work just one, but if possible I would like the ability to have 3 levels in total, but can't we use like poisoned arrows and the quill boar ability for that??
 
Level 5
Joined
Nov 21, 2014
Messages
151
make attack speed ability with more levels
after adding attack speed ability (852174 order) add this line:
  • Unit - Set level of Item Attack Speed Bonus (Greater) for (Ordered unit) to (Level of Searing Arrows for (Ordered unit))
ofc use your custom abilities;]

You are truly amazing! One problem, and it made me quite scared... after about 20 seconds into the game, I get "FATAL ERROR: program c:\wc3\warcraft III\War3.exe
Exception: 0xC0000005 (ACCES VIOLATION) at ....
The isntruction at '0x6F2F3B10' referenced memory at '0x0000000C'
The memory could not be 'read'
Press OK to terminate the application.


I'm not blaming you but I got it when I imported your triggers... am i doing something wrong? (I changed them a bit though)

EDIT: Apparantly the building I placed for testing made it crash (A yellow human castle)
But I don't know why that would make it crash...
 
Last edited:
Status
Not open for further replies.
Top