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

Ability Help

Status
Not open for further replies.
Level 2
Joined
Feb 26, 2010
Messages
15
I am creating a passive ability, which doesn't seem to be working. Here is the code(s) I have so far.

quickie.jpg

Basically, when a hero with 'Soul Alchemy' attacks a unit, it deals extra damage equal to a percent (Lv of ability x .10) of the damage inflicted and increases your gold by an equal amount. SA Caster trigger sets who the hero is, as well as defines the percentage of the damage it works off of. SA Detection 1 and 2 sets the units that will be damaged to increase gold/deal damage.

The problem is nothing happens, and I can't figure out why :(

(Also, if anyone knows how to check if damage source is an attack and not a skill, that would also help.)
 
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Group = (Units in (Playable map area))
      • Unit Group - Pick every unit in Group and do (Actions)
        • Loop - Actions
          • Trigger - Add to Trigger 3 <gen> the event (Unit - (Picked unit) Takes damage)
      • Custom script: call DestroyGroup (udg_Group)
  • Trigger 2
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Trigger - Add to Trigger 3 <gen> the event (Unit - (Triggering unit) Takes damage)
  • Trigger 3
    • Events
    • Conditions
      • (Level of Brilliance Aura for (Damage source)) Greater than 0
    • Actions
      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) - ((Damage taken) x ((Real((Level of Brilliance Aura for (Damage source)))) x 0.10)))
      • Floating Text - Create floating text that reads (+ + (String(((Damage taken) x ((Real((Level of Brilliance Aura for (Damage source)))) x 0.10))))) above (Triggering unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 4.00 seconds
Use these triggers instead. For the gold part, it doesn't get added, because Damage Taken is a real value, while the gold requires integer values. And no, the conversion from real to integer is not enough. I suggest adding a fixed amount of gold to the player, e.g. 20 gold, unless you want to muddle up with math functions.
 
Level 2
Joined
Feb 26, 2010
Messages
15
Well, that doesn't explain how to make it for attacks only, and not spells. Even with the way you have it, spells affect it. The main reason why this is important is because my character has a skill that does continuous damage, and it makes my gold from nothing to 'holy crap' real quick if used as constant instead of damage dealt. Also, dealing an extra 10% damage on top of spells is a bit OP.

Edit: btw, what do you mean by conversion from real to int is not enough?

Double Edit:
  • Soul Alchemy
    • Events
      • Unit - SA_Target Takes damage
    • Conditions
      • ((Owner of (Triggering unit)) is an enemy of (Owner of (Damage source))) Equal to True
    • Actions
      • Set SA_Target = No unit
      • Set _Real_Local = ((((Real((Level of Soul Alchemy for (Damage source)))) x 0.10) + ((Real((Level of Engineering for (Damage source)))) x 0.05)) x (Damage taken))
      • If ((Life of (Triggering unit)) Greater than _Real_Local) then do (Do nothing) else do (Set _Real_Local = ((Life of (Triggering unit)) - 1.00))
      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) - _Real_Local)
      • Player - Set (Owner of (Damage source)) Current gold to (((Owner of (Damage source)) Current gold) + (Integer(_Real_Local)))
      • Floating Text - Create floating text that reads (+ + (String((Integer(_Real_Local))))) at (Position of (Triggering unit)) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 0.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Set the velocity of (Last created floating text) to 30.00 towards 90.00 degrees
      • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
  • Soul Alchemy Detection
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Level of Soul Alchemy for (Attacking unit)) Greater than 0
          • (Level of Soul Alchemy (Engineering Lv1) for (Attacking unit)) Greater than 0
          • (Level of Soul Alchemy (Engineering Lv2) for (Attacking unit)) Greater than 0
          • (Level of Soul Alchemy (Engineering Lv3) for (Attacking unit)) Greater than 0
          • (Level of Soul Alchemy (Engineering Lv4) for (Attacking unit)) Greater than 0
          • (Level of Soul Alchemy (Engineering Lv5) for (Attacking unit)) Greater than 0
    • Actions
      • Set SA_Target = (Attacked unit)
Alright, it works now :D was reviewing your post and it helped. Figured out how to make it for attacks only (and not spells), so this is solved (unless you see something that can be cleaned up).
 
Last edited:
Status
Not open for further replies.
Top