• 🏆 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!

[Spell] How can i use 2 different arrows (flaming and cold) together?

Status
Not open for further replies.
Level 17
Joined
Jun 2, 2009
Messages
1,137
How can i use 2 different arrows (flaming and cold) at different times

I mean if i unlocked cold arrows and flaming arrows, it always shoots one of them (with shortcut key or when clicked)

i know if i will enable auto-cast, i can use any of them i want but i need a solution

Example: I have a Cold Arrows and Flaming Arrows. Their shortcuts are D and F.

If i will click F, i can shoot Flaming Arrows but if i will click D i can't shoot cold arrows. It shoots Flaming Arrows.

How can i shot any arrow with shortcut key?

OR

is there a way to activate autocast with shortcut keys?
 
Last edited:
Level 13
Joined
Mar 24, 2013
Messages
1,105
Edit: I'm not sure I properly understood the question so maybe ignore below. If you use the standard hotkeys for Searing Arrows, you Click R then click a valid enemy target and your unit will attack.

Alternatively you can probably catch when they are ordered to use Searing Arrows then just order them to toggle the searing arrows on.

Hope I was closer to your question!

/*
I do not think you can use searing arrows and frost arrows at the same time. The solution for this could be to use the Frost Attack from the Neurbian Tower, that will seemingly stack with the Searing Arrows. However, I think the slow will then be a Gameplay constant which may be less than ideal.

A potential workaround could be using a DDS and triggering the slow or the bonus damage from searing arrows. If you're worried about the projectile change Im not to sure that this has an answer for that.
*/
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
What you are experiencing is an internal thing of how wc3 handles all those single cast arrow abilities. It will just choose the one that was added to the unit later (with some other conditions).

In the following I will give two kind of solutions.

1:
Here it detects an order and orders autocast on and then the same order again. Having autocast on will cast the correct one.

It has the disadvantage that when the order is executed the command queue of the unit is deleted and that when using single cast auto cast of the used ability is activated.
JASS:
function Trig_unit_ord_Actions takes nothing returns nothing
  if ( udg_triggeredOrder == false) then
    if ( GetIssuedOrderId() == String2OrderIdBJ("flamingarrowstarg") ) then
        set udg_triggeredOrder = true
        call IssueImmediateOrderBJ( gg_unit_Hblm_0000, "flamingarrows" )
        call IssueTargetOrderBJ( gg_unit_Hblm_0000, "flamingarrowstarg", GetOrderTargetUnit() )
    else
    endif
    if ( GetIssuedOrderId() == String2OrderIdBJ("coldarrowstarg") ) then
        set udg_triggeredOrder = true
        call IssueImmediateOrderBJ( gg_unit_Hblm_0000, "coldarrows" )
        call IssueTargetOrderBJ( gg_unit_Hblm_0000, "coldarrowstarg", GetOrderTargetUnit() )
    else
    endif
  else
    set udg_triggeredOrder = false
  endif
endfunction

//===========================================================================
function InitTrig_unit_ord takes nothing returns nothing
    set gg_trg_unit_ord = CreateTrigger(  )
    call TriggerRegisterUnitEvent( gg_trg_unit_ord, gg_unit_Hblm_0000, EVENT_UNIT_ISSUED_TARGET_ORDER )
    call TriggerAddAction( gg_trg_unit_ord, function Trig_unit_ord_Actions )
endfunction

2:
In the second solution the abilities are removed and added again depending on the given order.

Here the command queue is not deleted, after a single cast all autocasts will be disabled though. Also this needs extra attention if the ability is a levelable hero ability. Also if your arrow abilities have cooldowns this can be a problem as removing and adding an ability resets cooldown.
  • xxx
    • Events
      • Unit - Blood Mage 0000 <gen> Is issued an order targeting an object
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Issued order) Equal to (Order(coldarrowstarg))
        • Then - Actions
          • Unit - Remove Searing Arrows from Blood Mage 0000 <gen>
          • Unit - Add Searing Arrows to Blood Mage 0000 <gen>
          • Unit - Remove Cold Arrows from Blood Mage 0000 <gen>
          • Unit - Add Cold Arrows to Blood Mage 0000 <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Issued order) Equal to (Order(flamingarrowstarg))
        • Then - Actions
          • Unit - Remove Cold Arrows from Blood Mage 0000 <gen>
          • Unit - Add Cold Arrows to Blood Mage 0000 <gen>
          • Unit - Remove Searing Arrows from Blood Mage 0000 <gen>
          • Unit - Add Searing Arrows to Blood Mage 0000 <gen>
        • Else - Actions
There are better solutions for sure, depending on what you need they might be far more complex though, so giving these two "hotfixes" might help you.
 
Last edited:
Status
Not open for further replies.
Top