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

Damage Taken Request

Status
Not open for further replies.
Level 4
Joined
Aug 12, 2004
Messages
76
Is there a way to use the Unit- Takes damage event with generic unit event? cause i need it for a mana stealing spell ><

Event- I want it to be "A unit takes damage"
Condition- Mana of triggering unit is greater then damage taken x .08.
Action- Add blah blah blah mana.
 
Level 13
Joined
Aug 31, 2005
Messages
823
there may be an easier way to make a unit lose mana than using a trigger. Try looking under the custom object data for "Mana steal" i think its one of sephoriths abilities. If not lifesteal i think might have the option to change to mana. and as far as the .80 thing, im not sure how to do that.
 
Level 4
Joined
Nov 22, 2004
Messages
62
Code:
set units
    Events
        Time - Elapsed game time is 0.05 seconds
        Unit - A unit enters (Playable map area)
    Conditions
    Actions
        Trigger - Add to return <gen> the event (Unit - (Entering unit) Takes damage)
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                Trigger - Add to return <gen> the event (Unit - (Picked unit) Takes damage)


return
    Events
    Conditions
    Actions
        Floating Text - Create floating text that reads (String((Integer((Damage taken))))) above (Triggering unit) with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        Floating Text - Set the velocity of (Last created floating text) to 96.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 0.50 seconds
        Floating Text - Change the fading age of (Last created floating text) to 0.00 seconds

i posted on another thread but ill post here too.
it shows damage done over attacked unit.

it doesn leaks, i already tested so u can change for sumthign like:

Code:
return
    Events
    Conditions
    Actions
        Unit - Set mana of (Damage source) to ((Mana of (Damage source)) + ((Damage taken) x 0.08))

it will give the attaking unit (damage source)
mana eatch hit equal to 8% of damage dealt, if thats what you want.[/code]
 
Level 4
Joined
Nov 22, 2004
Messages
62
sorry that is indeed wrong. ot all of it:

this trigger picks units as they enter the game map
Code:
pick starting units
    Events
        Unit - A unit enters (Playable map area)
    Conditions
    Actions
        Trigger - Add to damage <gen> the event (Unit - (Entering unit) Takes damage)

this one picks the units already inserted in the map since beggining
Code:
pick units
    Events
        Time - Elapsed game time is 0.05 seconds
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                Trigger - Add to damage <gen> the event (Unit - (Picked unit) Takes damage)

the last trigger excetutes the actiosn based on "damage taken" event:
Code:
damage
    Events
    Conditions
    Actions
        Floating Text - Create floating text that reads (String((Integer((Damage taken))))) above (Triggering unit) with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        Floating Text - Set the velocity of (Last created floating text) to 96.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 0.50 seconds
        Floating Text - Change the fading age of (Last created floating text) to 0.00 seconds

for the last trigge ri made is so the damage causes appears above attacked units head. you can make anything else.

thats it, that one didnt worked =P
 
Status
Not open for further replies.
Top