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

Made a skill that works! Almost. Skill-LVL use question.

Status
Not open for further replies.
Level 2
Joined
Jan 18, 2010
Messages
16
  • Made a skill that works! Almost. Skill-LVL use question.[/b]
  • Hello all, this is my first post and it's concerning a triggering issue (or so I hope).
  • I'm relatively new to all this, so most probably the solution to my problem will be a simple one (or at least I hope so).
  • Here's the skill I want to create:
  • [QUOTE][img]http://i43.photobucket.com/albums/e394/DotA_Icons/BTNTransmute.png[/img]
  • [font=Arial][size=3][color=#99CCFF][b]Mammon’s Fury[/b][/color][/size][/font]
  • Vingdal, Mammon Servant sacrifices 2/3 of his money to land a devastating strike!
  • [color=#FFCC33]Level 1[/color] – dmg = Used amount of money x 1
  • [color=#FFCC33]Level 2[/color] – dmg = Used amount of money x 1.5
  • [color=#FFCC33]Level 3[/color] – dmg = Used amount of money x 2
  • Vingdal strikes an enemy unit with amplified damage using all his money. On lvl 3 = 1500g = 2000 dmg[/QUOTE]
  • I managed to do everything except the increased lvl damage.
  • I used the formula: 0.5 + LVL/2
  • This schould get 1 for LVL 1, 1.5 for LVL 2 and 2 for LVL 3
  • But why isn't it working?
  • Here's the code:
  • [CODE]Unit- Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (MammonDamageCount x [B](0.50 + ((Real((Level of Mammon's Fury for (Picked unit)))) / 2.00)))[/B] damage of attack type Normal and damage type Divine
  • [/CODE]
  • Note that 'MammonDamageCount' has the formula: Actual Gold x 0.67
  • When I try it out it always gives me the damage times 1.
  • Does anybody know what's wrong with my code?
  • Thanks in advance!
  • Erandir
  • PS.: it's my first code ever so be patient with me :)
 
Last edited:
Level 2
Joined
Jan 18, 2010
Messages
16
Ok here's the whole GUI code, hope it clarifies it a bit (although it's partly in german ^^)
 

Attachments

  • CropperCapture[4].jpg
    CropperCapture[4].jpg
    177 KB · Views: 110
Level 6
Joined
Jul 17, 2008
Messages
185
I dont know if i got the problem right but it might be an error in the calculations:

(0.50 + ((Real((Level of Mammon's Fury for (Picked unit)))) / 2.00)))

if lvl=1 then this would give 0.75 as result...

oh and also: when you post triggers post them bettween trigger tags:
HTML:
[TRIGGER][/TRIGGER]

like this:
  • Debug
    • Events
      • Time - Every 20.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Abomination) and do (Actions)
        • Loop - Actions
          • Unit - Order (Entering unit) to Attack-Move To runnerloc
this as nothing to do with ur trigger... just an example :p

good luck anyway
 
Level 4
Joined
Oct 18, 2007
Messages
57
instead of using "triggering unit", use "Event Response - Casting Unit" however this only works if your event is "A unit begins casting an ability"
 
Level 2
Joined
Jan 18, 2010
Messages
16
Ok hey thanks for all the responses, gonna try it out right now.

Concerning integer vs real, my floating dmg counter always has decimals. Like 1234.0. Is it correct that i would have to convert the real number into an integer before displaying it? (don't want any decimals)

Oh and btw, i think the formula is correct... 0.5 + half of lvl 1 (0.5) equals 1
 
Level 2
Joined
Jan 18, 2010
Messages
16
So I changed some things, and here's the new code:

  • Mammons Fury
    • Events
      • Unit - A unit starts effect of an ability
    • Conditions
      • (Ability being cast) is Mammon's Fury
    • Actions
      • Set Gold_Actual = (Real(((Owner of (Triggering unit)) actual Gold)))
      • Set MammonDamageCount = (Gold_Actual x 0.67)
      • Set Caster = (Casting unit)
      • Set Distance = 0.00
      • Set Angle = (Angle from (Position of Caster) to (Target point of ability being cast))
      • Set Cast_Point = (Position of Caster)
      • Unit - Create 1 Spell-Dummy for (Owner of (Casting unit)) at (Position of (Casting unit)) facing (Position of (Targeted unit))
      • Unit - Cause (Last created unit) to damage (Target unit of ability being cast), dealing (MammonDamageCount x (0.50 + ((Real((Level of Mammon's Fury for (Triggering unit)))) / 2.00))) damage of attack type Normal and damage type Divine
      • Unit - Add a 1.00 second Standard expiration timer to (Last created unit)
      • Player - Add ((Integer(MammonDamageCount)) x -1) to (Owner of (Triggering unit)) actual Gold
      • Floating Text - Create floating text that reads (String(MammonDamageCount, 7, 0)) above (Target unit of ability being cast) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 30.00% transparency
      • Floating Text - Change (Last created floating text): deactivate permanence
      • 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 2.00 seconds
Everything works except the damage output... (didn't apply the hint from JeffQ though... will follow)

Has anyone an idea?
 
Last edited:
Level 2
Joined
Jan 18, 2010
Messages
16
Ignoring the skill-lvl, it always hits with 2/3rd of his actual money...

Gold: 5000
Hit on lvl 1: Rounds up to 3350 actually (Should be 3333)
Hit on lvl 2: 3350 (Should be 5000)
Hit on lvl 3: 3350 (Should be 6666)
 
Level 2
Joined
Jan 18, 2010
Messages
16
Here's the new code.
Now what I do is to calculate the damage in advance, using 1/3rd of the variables I used before:

  • Mammons Fury
    • Events
      • Unit - A unit starts the effekt of an ability
    • Conditions
      • (Ability being cast) is Mammon's Fury
    • Actions
      • Set Dmg_output = ((Integer((0.50 + ((Real((Level of Mammon's Fury for (Triggering unit)))) / 2.00)))) x (Integer(((Real(((Owner of (Triggering unit)) actual Gold))) x 0.67))))
      • Set Caster = (Casting unit)
      • Set Distance = 0.00
      • Set Angle = (Angle from (Position of Caster) to (Target point of ability being cast))
      • Set Cast_Point = (Position of Caster)
      • Unit - Create 1 Spell-Dummy for (Owner of (Casting unit)) at (Position of (Casting unit)) facing (Position of (Target unit of ability being cast))
      • Unit - Cause (Last created unit) to damage (Target unit of ability being cast), dealing (Real(Dmg_output)) damage of attack type Normal and damage type Divine
      • Unit - Add a 1.00 second Standard expiration timer to (Last created unit)
      • Player - Add ((Integer(((Real(((Owner of (Triggering unit)) actual Gold))) x 0.67))) x -1) to (Owner of (Triggering unit)) actual Gold
      • Floating Text - Create floating text that reads (String(Dmg_output)) above (Target unit of ability being cast) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 30.00% transparency
      • Floating Text - Change (Last created floating text): Deaktivieren permanence
      • 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.50 seconds
But still he messes up the damage.
What works now is everything but the LVL 2 of the skill.

On lvl 2 he still strikes with lvl 1 damage...
 
Level 2
Joined
Jan 18, 2010
Messages
16
Ok sorry for so much posting but it's clear to me now. I have to calculate the damage BEFORE changing them to INTEGER values. All clear.
Sry for such excessive posting again!

For all who are interested, here's the final code:

  • Mammons Fury
    • Events
      • Unit - A unit starts the effekt of an ability
    • Conditions
      • (Ability being cast) is Mammon's Fury
    • Actions
      • Set Dmg_output = (Integer(((0.50 + ((Real((Level of Mammon's Fury for (Triggering unit)))) / 2.00)) x ((Real(((Owner of (Triggering unit)) Aktuelles Gold))) x 0.67))))
      • Set Caster = (Casting unit)
      • Set Distance = 0.00
      • Set Angle = (Angle from (Position of Caster) to (Target point of ability being cast))
      • Set Cast_Point = (Position of Caster)
      • Unit - Create 1 Spell-Dummy for (Owner of (Casting unit)) at (Position of (Casting unit)) facing (Position of (Target unit of ability being cast))
      • Unit - Cause (Last created unit) to damage (Target unit of ability being cast), dealing (Real(Dmg_output)) damage of attack type Normal and damage type Divine
      • Unit - Add a 1.00 second Standard expiration timer to (Last created unit)
      • Player - Add ((Integer(((Real(((Owner of (Triggering unit)) actual Gold))) x 0.67))) x -1) to (Owner of (Triggering unit)) actual Gold
      • Floating Text - Create floating text that reads (String(Dmg_output)) above (Target unit of ability being cast) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 30.00% transparency
      • Floating Text - Change (Last created floating text): Deaktivieren permanence
      • 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.50 seconds
 
Last edited:
Status
Not open for further replies.
Top