Need Help With Custom "FeedBack" Skill

0WN3D

New Member
Reaction score
15
If you do not know what is feedback ability, it is a skill that burn mana of the attacked unit each time it is hit. Its in the original Warcraft. Well any way... my problem is that I want a skill that burns mana equals to the amount of intelligence the attacked unit have. But it doesnt work. Here's the trigger.
Trigger:
  • Events
    • Unit - A unit Is attacked
    • Conditions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Level of Critical Strikea for (Attacking unit)) Equal to 1
      • Then - Actions
        • Unit - Set mana of (Attacked unit) to ((Mana of (Attacked unit)) - ((Real((Intelligence of (Attacked unit) (Include bonuses)))) x 0.25))
      • Else - Actions
rep for any1 who can help me:D.
 

Skippy

Active Member
Reaction score
39
Are you sure that level of Critical Strike is 1?
Anyway, I think the mana should be burned when the unit takes damage, not when the unit is attacked. However, this is not an error, just an advice.
 

0WN3D

New Member
Reaction score
15
Well I base it off the original crit strike and the onli thing i change is the %.. Its a hero skill i assume it is one as it requires learning.
 

Ayanami

칼리
Reaction score
288
I suggest you don't use "Unit is attacked event" as you'll realize that this event can be abused by spamming "S" when attacking. Here's a way to do it. Base your spell on something that places a buff on attack, for example, Envenomed Spears. I'll use Envenomed Spears as an example here.

Create an Envenomed Spears spell. Ensure that it doesn't require any upgrades and change it to a hero spell if you want. Set the duration of the poison to any duration. Set the values such as damage and movement speed reduction to 0. Now, you need an efficient Damage Detection system. Well, there's several in this forums, and there's 1 neat damage detection system that is GUI-friendly. So, what are you waiting for? Get it today! You do not need any JASS knowledge to use this. Anyways, back to the spell.

Now, you'll need to create 2 buffs, which are originally the 2 buffs from Envenomed Spears. They're Poison (Non-stacking) and Poison (Stacking). Create the buffs and just name it A and B. Doesn't matter. Now, here's the trigger.

Trigger:
  • Feedback
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (GDD_Damaged_Unit has buff A) Equal to True
          • (GDD_Damaged_Unit has buff B) Equal to True
    • Actions
      • Trigger - Turn off (This trigger) <-- To prevent infinite loops
      • Set TempReal = Set TempReal = (Real((Intelligence of GDD_Damage_Source (Include bonuses)))) <-- This is the feedback amount
      • Unit - Set mana of GDD_Damaged_Unit to ((Mana of GDD_Damaged_Unit) - TempReal) <-- Reducing the mana
      • Unit - Cause GDD_Damage_Source to damage GDD_Damaged_Unit, dealing TempReal damage of attack type Spells and damage type Magic <-- Dealing the feedback damage
      • Special Effect - Create a special effect attached to the origin of GDD_Damaged_Unit using Abilities\Spells\Human\Feedback\SpellBreakerAttack.mdl <-- Special effect for your feedback
      • Special Effect - Destroy (Last created special effect) <--Destroying the special effect to prevent memory leak
      • Unit - Remove A buff from GDD_Damaged_Unit <-- Removing the buff applied
      • Unit - Remove B buff from GDD_Damaged_Unit <-- Removing the buff applied
      • Trigger - Turn on (This trigger) <-- Turn the trigger on again


And there you have it, a custom feedback! Only downside is that Buff Placers cannot stack with other Buff Placers. But the original feedback is an Orb Effect anyways. Hope this helps.
 

mapguy

New Member
Reaction score
46
I think he doesn't want it to be orb effect...
since he based the spell on critical strike.
 

Ayanami

칼리
Reaction score
288
I think he doesn't want it to be orb effect...
since he based the spell on critical strike.

He didn't specify. And he didn't say he didn't want it orb effect. He was simply creating a custom feedback to modify the feedback amount to some value * hero's intelligence.
 

0WN3D

New Member
Reaction score
15
Glenphir Well.... I want it to be a custom one that does not involve orb effect... sorry for being vague... But i want to ask something... What if I change the condition for buff into condition for level of my spell? Will it Work?
 

Ayanami

칼리
Reaction score
288
Well.... I want it to be a custom one that does not involve orb effect... sorry for being vague...

I see. To do that, you'll have to trigger all your spell damage. There's no easy way to detect a damage dealt by normal attack unless you trigger all your spell's damage. A most reliable way would be to use a Buff Placer. But if you want to do it the complicated way of using a damage system, by all means.

Replay @ EDIT
Well it will work, but all damage will have the mana burn effect, meaning damage from spells, etc will still have the mana burn effect.
 

hgkjfhfdsj

Active Member
Reaction score
55
another alternative is to base off your spell on (though less accurate, and i wouldnt recommend) onAttack by emjlrs. its method registers when a unit is attacked which sets up a dynamic unit damage event and uses a timer of 2s that destroys the trigger, timer etc. it is when the unit is damaged by the original 'attacker' it registers this as an attack, therefore it isnt as accurate, but close enough
 

mapguy

New Member
Reaction score
46
try this

when the unit attack u add it to a unit group called (ATTACKERS)
when to unit cast a spell or uses an item you move it to (NON-ATTACKER)

then, when a unit takes damage you check if the source_unit is in ATTACKERS group.
 

Ayanami

칼리
Reaction score
288
try this

when the unit attack u add it to a unit group called (ATTACKERS)
when to unit cast a spell or uses an item you move it to (NON-ATTACKER)

then, when a unit takes damage you check if the source_unit is in ATTACKERS group.

There's also passive damaging abilities and there might be damage over time abilities occurring, so your method is flawed. You need a damage system to accurately achieve this. Else, the method hgkjfhfdsj described is the closest.
 

Dirac

22710180
Reaction score
147
mapguy's idea isnt a total mess:

instead of adding casting units to nonattackers, remove attackers from the group when they deal damage, and add em when they attack, so the gap is only between attack animation and missile speed.

Could do some good
 

0WN3D

New Member
Reaction score
15
LOLOLOL... Guess what? I just added a 0.01 sec wait in fornt of all the action and it workz... dunno y lol... Case Closed
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top