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

Triggered Ability -- Stupify

Status
Not open for further replies.
Level 4
Joined
Oct 23, 2006
Messages
65
I can't see what is wrong with this, can you?

Code:
Stupify
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Stupify 
    Actions
        Wait 0.50 seconds
        Set StupifyTarget = (Position of (Target unit of ability being cast))
        Special Effect - Create a special effect at StupifyTarget using Doodads\Cinematic\Lightningbolt\Lightningbolt.mdl
        Special Effect - Create a special effect at StupifyTarget using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of Stupify  for (Casting unit)) Equal to 1
            Then - Actions
                Hero - Modify Intelligence of (Targeted unit): Subtract 1
            Else - Actions
                Hero - Modify Intelligence of (Targeted unit): Subtract (Random integer number between 1 and 2)
 
Level 4
Joined
Oct 23, 2006
Messages
65
PurplePoot said:
Also, the wait sux, the Begins Casting instead of Stats the Effect sux, the 2 leaking SFX sux, the leaking location sux, and the Casting Unit instead of Triggering Unit sux. fix those, and youll be good to go.

This is why I need help, lol.

Also, Stupify is an alternative spelling.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Well, first, get rid of that damn wait

Second, change the event to

A Unit Starts the Effect of an Ability

Third, change the two lines where it mods the intelligence to

Set int of TRIGGERING UNIT to x

Fourth, at the end of the trigger saying

Custom Script: call RemoveLocation( udg_StupifyTarget )

Fifth, assign those two effects to variables or something, and destroy them using

Destroy (effect)

at the end of the trigger.
 
Level 4
Joined
Oct 23, 2006
Messages
65
Okay, I tried to make it better and make myself not look like an idiot.

Code:
Stupify
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Stupify 
    Actions
        Set StupifyTarget = (Position of (Target unit of ability being cast))
        Special Effect - Create a special effect at StupifyTarget using Doodads\Cinematic\Lightningbolt\Lightningbolt.mdl
        Set StupifyEffect[1] = (Last created special effect)
        Special Effect - Create a special effect at StupifyTarget using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
        Set StupifyEffect[2] = (Last created special effect)
        Custom script:   call RemoveLocation( udg_StupifyTarget )
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of Stupify  for (Triggering unit)) Equal to 1
            Then - Actions
                Hero - Modify Intelligence of (Target unit of ability being cast): Subtract 1
            Else - Actions
                Hero - Modify Intelligence of (Target unit of ability being cast): Subtract (Random integer number between 1 and 2)
        Wait 2.00 seconds
        For each (Integer A) from 1 to 2, do (Actions)
            Loop - Actions
                Special Effect - Destroy StupifyEffect[(Integer A)]
 
Status
Not open for further replies.
Top