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

Heal spell aint working

Status
Not open for further replies.
Level 2
Joined
Sep 21, 2005
Messages
13
well it aint working
Heal
Code:
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Heal 
    Actions
        Set Int[(Player number of (Owner of (Casting unit)))] = (Intelligence of (Casting unit) (Include bonuses))
        Game - Display to (All players) the text: (String((Int[(Player number of (Owner of (Casting unit)))] x 3)))
        Unit - Set life of (Targeted unit) to ((Life of (Targeted unit)) + ((Real(Int[(Player number of (Owner of (Casting unit)))])) x 3.00))
        Floating Text - Create floating text that reads (String((Int[(Player number of (Owner of (Triggering unit)))] x 3))) above (Targeted unit) with Z offset 0.00, using font size 8.00, color (0.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

I think the problem is in this line: "Unit - Set life of (Targeted unit) to ((Life of (Targeted unit)) + ((Real(Int[(Player number of (Owner of (Casting unit)))])) x 3.00))
Floating Text - Create floating text that reads (String((Int[(Player number of (Owner of (Triggering unit)))] x 3))) above (Targeted unit)"

and I dont see eny floading text.. what am i doing wrong.?

Int is a intiger array (10)
 
Level 2
Joined
Sep 21, 2005
Messages
13
Well i made it work.....I changed "Targeted unit" too "Target unit of Ability being cast" solved the problem. and I also changed the event too "unit begins the efffect of"

here are my code now..
Code:
Heal lvl 1 too 9
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Heal 
        (Level of (Casting unit)) Less than 10
    Actions
        Set Int[(Player number of (Owner of (Casting unit)))] = (100 + ((Intelligence of (Casting unit) (Include bonuses)) x 2))
        Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + ((Real(Int[(Player number of (Owner of (Casting unit)))])) x 1.00))
        Floating Text - Create floating text that reads (String(Int[(Player number of (Owner of (Casting unit)))])) above (Target unit of ability being cast) with Z offset 0.00, using font size 10.00, color (0.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 64.00 towards 90.00 degrees
        Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
        Wait 5.00 seconds
        Floating Text - Destroy (Last created floating text)
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
the reason the one works and not the other

Targeted Unit refers to a unit is the target of a unit order

whereas

Target Unit of Ability Being Cast.. well... duuh

also... good thing you switched the event, because if you press Stop after beginning to cast an ability, Begins Casting will still activate whereas Starts the Effect of will not :)
 
Status
Not open for further replies.
Top