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

A little help please?

Status
Not open for further replies.
Level 8
Joined
Aug 15, 2010
Messages
216
hello my friends!
as always, sorry for being a noob and wasting your time with my stupid questions, but here we go:
so, I am making this hero, avenger, (hellion phoenix avenger dafaq?)
and I have a little problem! looka here:
the spell, hellion reap, goes as this : Tries to take the soul out of the body of an enemy, dealing X + (str x Lvl) + (int x Lvl) damage to the target, in addition, if the target dies within 2 seconds, heals you equal to 10 x Lvl% health, and also resets the cooldown of hellion trasmission. this effect will not occur if the cooldown is reset. Level 1 X: 40 Level 2 X: 80 Level 3 X: 120 Level 4 X:160 Level 5 X: 200|R
So as you can see, its VERY complicated and only pro guys should do it! (just kidding), turns out, the damaging trigger goes really well, but there are a few problems :
  • Hellion reap
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Hellion reap (Neutral Hostile)
    • Actions
      • Set HellionboltLvl = (Level of Hellion reap (Neutral Hostile) for (Casting unit))
      • Set CastinHeroInt = (Real((Intelligence of (Casting unit) (Include bonuses))))
      • Set CastinHeroStr = (Real((Strength of (Casting unit) (Include bonuses))))
      • Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing ((CastinHeroInt x (Real(HellionboltLvl))) + (CastinHeroStr x (Real(HellionboltLvl)))) damage of attack type Normal and damage type Normal
      • Special Effect - Create a special effect attached to the chest of (Target unit of ability being cast) using Life Low_Portrait.mdx
      • Set REALCASTER = (Casting unit)
      • Set Justtorollhellionspell = (Random integer number between 1 and 100)
      • Set CHANCE = (10 x (Level of Crusade for (Casting unit)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Justtorollhellionspell Less than or equal to CHANCE
        • Then - Actions
          • Set HellionboltLvl = (Level of Hellion reap (Neutral Hostile) for REALCASTER)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • HellionboltLvl Greater than 0
            • Then - Actions
              • Unit - Remove Hellion reap (Neutral Hostile) from REALCASTER
              • Unit - Add Hellion reap (Neutral Hostile) to REALCASTER
              • Unit - Set level of Hellion reap (Neutral Hostile) for REALCASTER to HellionboltLvl
              • Floating Text - Create floating text that reads |CFF0033FF Hellion ... above REALCASTER with Z offset 70.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
              • Floating Text - Set the velocity of (Last created floating text) to 34.00 towards 90.00 degrees
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
        • Else - Actions
Sooooo its not complete I know. lets take a look at this one simple trigger:
  • Undertheeffect
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) has buff Bieng reaped) Equal to True
      • (Unit-type of (Killing unit)) Equal to |CFFFF3300Hellion Phoenix Avenger|R
    • Actions
      • Set HellionboltLvl = (Level of Hellion reap (Neutral Hostile) for (Casting unit))
      • Unit - Set life of (Casting unit) to ((Life of (Casting unit)) + (((Max life of (Casting unit)) / 100.00) x (10.00 x (Real(HellionboltLvl)))))
NOW the problem is: IT WONT WORK!
when a unit dies in one shot with this, it wont work, when it resets its cd as said, it wont work. help plz?:goblin_cry:
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
You have to use a hashtable or an array (boolean array ) with unit indexer for this to work.

You need to check if the dying unit ( use triggering unit instead) was affected by the spell.
To do this set the array or hashtable for that unit using a boolean. (true if it is affect false if it is not.)
When the spell is cast set it to true. Also set in the hashtable or in another array (unit array this time) the unit that cast it on the target unit.
Then after 2 seconds change it to false. ( Don't use waits)
In the unit dies trigger check if the boolean is true and the add health to the casting unit (the one in the unit array.)

Also try to describe what your problem is in the question. Like help with spell or something.
 
Level 8
Joined
Aug 15, 2010
Messages
216
so... though I didn't really understand i'll work it out somehow... man I always had problems with MUI. so, to progress, about this: when a unit gets one shotted by the spell, it doesn't really even activate the effect/buff. what about that?

edit: tnx btw!
edit 2:... can we add buffs to units with triggers?!
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
so... though I didn't really understand i'll work it out somehow... man I always had problems with MUI. so, to progress, about this: when a unit gets one shotted by the spell, it doesn't really even activate the effect/buff. what about that?

edit: tnx btw!

I'm not sure what gets done first between unit starts effect of an ability and a unit dies event.

To check this make a spell deal way more than damage required to kill something. Have a trigger with unit dies and a trigger with starts effect of ability. In each have no conditions. In both triggers display a number through a game message. ( different numbers) Whichever displays the number is the one that fires first. ( i believe it is the unit starts effect)

Yes you can add buffs but you need a dummy unit to cast the buff onto the target unit.
 
Level 8
Joined
Aug 15, 2010
Messages
216
wow! thanks! i'm so stupid I didn't think of it myself!
so here is the plan : i'll make a dummy unit above my target, make it cast a dummy spell(based on inner fire or smt) and if my hero kills a unit under the effect, he'll get the bonuses. i'll have to rework the spell entirely. BUT! another problem remains : when the cooldown is reset due to the passive spell "Crusade", the damage is not done correctly, I know its stupid, but, any ideas?

Edit: I gone reading your tutorial, cool points bro, really helped :D, I didn't even know what was that dice and slide thing meant.
 
Status
Not open for further replies.
Top