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

blocking skill question

Status
Not open for further replies.
right now i'm working on a skill called Flashing Blade, and this is what it does

*passive*
give 75% chance of blocking whenever you attack, Blocked foe loses 25 energy

the block effect (the enemy loses energy part and the fact that it only happens when you attack) alone took me like 2 weeks and still can't make it happen DX

also I want the screen to show -25 whenever block happens

any ideas?

btw, should i put this in the trigger forum or here?
 
Level 3
Joined
Feb 23, 2010
Messages
73
hmmm making this only work while attacking is tricky. Here is what I would do:

Make the real ability a 75% evasion ability.
now make a dummy ability with all the same art and stats, only change the chance to dodge to 0%.
Make sure you keep everything the same!! only change Data - Chance to evade! you will want this field set to 75% on the real ability, and 0% on the dummy. Also, make the editor prefix of the dummy ability " (dummy)". this is so you can tell them apart.
you will need 3 total triggers:
- 1 for the 25 energy drain.
- 2 for the enableing only when attacking.

Energy Drain Trig:
  • Events
    • Unit - A unit is Attacked
  • Conditions
    • Unit-Type of (attacking unit) Equal to YourDude
  • Actions
    • Unit - Set mana of (attacked unit) to (mana of (attacked unit) - 25.00)
    • Special Effect - create a special effect attached to the origin of (Attacked Unit) using Abilities\Spells\Human\Feedback\SpellBreakerAttack.mdl
    • Floating Text - create Floating Text that reads -25 above (attacked unit) with Z offset 50.00, using font size 8, color (65.00%, 100.00%, 15.00%), and 0.00% transparency
    • 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 2.00 seconds
    • Floating Text - Change the Fading age of (last created floating text) to 1.00 seconds
    • Floating Text - Change (last created floating text): Disable Permanence
that will do the mana.

now for the tricky one:
  • Events
    • Unit - A Unit is Attacked
  • Conditions
    • Unit-Type of (attacking unit) Equal to YourDude
  • Actions
    • Set FBcaster = (attacking unit)
    • Unit - Remove Flashing Blade (dummy) from (attacking unit)
    • Unit - Add Flashing Blade to (attacking unit)
    • Timer - Start FlashingBladeCD as a one-shot timer that will expire in 5.00 seconds
  • Events
    • Timer - FlashingBladeCD expires
  • Conditions
  • Actions
    • Unit - Remove Flashing Blade from FBcaster
    • Unit - Add Flashing Blade (dummy) to caster
**WARNING** I did not include memory leak removal in these, so please add them. This will make your unit have a 75% evasion for 5 seconds after it attacks, and this will not stack. so If it attacks every second for 10 seconds, then stops attacking, It will keep its 75% evasion for the duration of its attack, and for 5 seconds after it stops. To lower that duration, simply shange the duration of the one shot timer FlashingBladeCD.

I hope this helps!!!
 
Level 5
Joined
Apr 22, 2008
Messages
139
youll need to make the ability give the unit a buff for this to work:

Events
Unit - A unit Is attacked
Conditions
((Attacking unit) has buff Flashing Blade) Equal to True
(Random integer number between 1 and 20) Greater than or equal to 5
Actions
Unit - Set mana of (Attacked unit) to ((Mana of (Attacked unit)) - 25.00)
Floating Text - Create floating text that reads -25 above (Attacked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Wait 0.25 seconds
Floating Text - Destroy (Last created floating text)

tested ingame and it works.
change the color to whatever you want, its currently at red
 
Status
Not open for further replies.
Top