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

[Spell] Feedback Arrow (Needs a complete rescript)

Status
Not open for further replies.
Level 12
Joined
May 20, 2009
Messages
822
I do have triggers already made for this spell, but they are INSANELY buggy. I need help completely rescripting them.

What this spell does:
When my hero attacks a unit, if this spell is used for that attack (Because it is autocast, but of course can be manually targeted) then I want mana to be taken away from that unit and deal damage equal to the amount of mana taken away.

The problem is, I'm having quite a lot of trouble because my triggers run very slowly. I will post the triggers I have in here, but do note that these need to be completely rewritten and that is why I am posting in these forums instead of the Trigger / Scripting forum.

  • Feedback Arrow Level 1 Manual
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Ranger
          • (Owner of (Triggering unit)) Equal to Player 1 (Red)
    • Actions
      • Set FeedbackCasterP1 = (Casting unit)
      • Set FeedbackTargetP1 = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Level of Feedback Arrows (Ranger) for (Triggering unit)) Equal to 1
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
            • Then - Actions
              • Wait until ((FeedbackTargetP1 has buff Feedback Arrows ) Equal to True), checking every 0.30 seconds
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Mana of FeedbackTargetP1) Greater than or equal to 22.00
                • Then - Actions
                  • Unit - Set mana of FeedbackTargetP1 to ((Mana of FeedbackTargetP1) - 22.00)
                  • Unit - Cause FeedbackCasterP1 to damage FeedbackTargetP1, dealing 22.00 damage of attack type Spells and damage type Normal
                • Else - Actions
                  • Set ManaOfSpellcasterP1 = (Mana of FeedbackTargetP1)
                  • Unit - Set mana of FeedbackTargetP1 to 0.00
                  • Unit - Cause FeedbackCasterP1 to damage FeedbackTargetP1, dealing ManaOfSpellcasterP1 damage of attack type Spells and damage type Normal
                  • Set ManaOfSpellcasterP1 = 0.00
            • Else - Actions
        • Else - Actions
Last I remember, this has quite a lot of issues. Sometimes it takes away mana, but does no damage and sometimes neither function happens.

There is also a very abusable bug on Blizzards behalf, and that is if an Autocast spell's Autocast is turned off as the spell is being performed, and then turned back on, the cooldown will be completely ignored every time.

I have a DDS, this one to be exact: GUI Friendly Damage Detection

I'd really appreciate some help. =)

(I don't really quite know where to start...AGAIN, do note I am meaning to COMPLETELY rescript this. I am not asking for it to be FIXED.)

EDIT: This version of the trigger is for the MANUAL casting, as you need a different trigger for the Autocasting and the Manual casting because you have to pick up on them with different events.
EDIT2: I say this needs to be completely rewritten because I may just have to do it in JASS so it's a lot faster.
 
Last edited:
Level 12
Joined
May 20, 2009
Messages
822
I recommend using orders instead, in GUI it might cost around 3 triggers, but it should be paid off by more precise accuracy and better execution.
I don't have time and kinda forget the trick, but I hope it's a good reference.

Orders as in events or orders as in actions?

If events, that won't work because then you could just constantly order the spell, cancel it, and the effects will still occur.

If by issuing an order, I don't like doing that either because it's extremely limited, at least in GUI anyway.


Dont use Wait Action in your spell

Well, that's not really an issue, and you posting this does not make me any closer to solving my issue, but whatever.
 
Level 10
Joined
Jun 6, 2007
Messages
392
I'll use GDD in this example. Base your ability on frost arrows with a custom buff. Then make a trigger:

  • Events
    • Game - GDD_Event becomes Equal to 0.00
  • Conditions
    • GDD_DamagedUnit has a buff <YOUR BUFF> equal to true
  • Actions
    • Remove <YOUR BUFF> from GDD_DamagedUnit
    • set DrainAmount = min (22.00, current mana of GDD_DamagedUnit)
    • set GDD_DamagedUnit's manage to current mana of GDD_DamagedUnit - DrainAmount
    • Cause GDD_DamageSource to damage GDD_DamagedUnit by DrainAmount attack type chaos and damage type universal
The trigger may not be exactly similar, you'll get the idea. This method works because the buff is placed right before the damage. Also this way you don't need separate triggers for attacking and manual casting.
 
Level 12
Joined
May 20, 2009
Messages
822
I'll use GDD in this example. Base your ability on frost arrows with a custom buff. Then make a trigger:

  • Events
    • Game - GDD_Event becomes Equal to 0.00
  • Conditions
    • GDD_DamagedUnit has a buff <YOUR BUFF> equal to true
  • Actions
    • Remove <YOUR BUFF> from GDD_DamagedUnit
    • set DrainAmount = min (22.00, current mana of GDD_DamagedUnit)
    • set GDD_DamagedUnit's manage to current mana of GDD_DamagedUnit - DrainAmount
    • Cause GDD_DamageSource to damage GDD_DamagedUnit by DrainAmount attack type chaos and damage type universal
The trigger may not be exactly similar, you'll get the idea. This method works because the buff is placed right before the damage. Also this way you don't need separate triggers for attacking and manual casting.

Thanks, that's so much more efficient then mine. This actually even fires instantly instead of before it took about half a second before the mana and damage was calculated. =)
 
Status
Not open for further replies.
Top