• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] I need gui help, a LOT of help :)

Status
Not open for further replies.
Level 9
Joined
Jun 25, 2009
Messages
427
I wanted to ask you guys how to gui trigger this thing:
A unit casts abilitie that stuns the target... question could someone help me to make 70% of chance to stun the target.(not 100% as usual)
A unit casts abilitie that damages the target in a 3x critical hit(need help with this) and has 70% (or whatever chance) to hit that abilitie to opponent and if doesnt hit it write Miss!...

Is that possible?
If it this, then i ask for your help to help me trigger this. (ofc in gui :grin: :))

EDIT: Is it possible to make something like this. You cast abilitie, (range 130) you become invulnerable, your unit (the caster) uses animation attack1 after like 0.3sec, attack2 and then blast or something? :) (thanks :))
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Stun
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Stun
    • Actions
      • -------- local variables specific to this unit --------
      • Custom script: local unit udg_TempUnit
      • Custom script: local integer udg_StunEffectToDestroy
      • Set TempUnit = (Target unit of ability being cast)
      • Set TempInt = (Random integer number between 1 and 100)
      • -------- ------------------------------------- --------
      • -------- delay between the time of casting beginning and the effect applying --------
      • Wait 1.00 seconds
      • -------- ------------------------------------- --------
      • -------- stun proc chance is an integer variable that determines the chance for the skill to proc --------
      • -------- set the initial value to 70 if you want to have 70% chance of the effect applying --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempInt Less than or equal to StunProcChance
        • Then - Actions
          • -------- this is a simple damage equation --------
          • -------- SpellDamageModifier is a variable of type real. Set it to whatever to scale the damage --------
          • Unit - Cause (Triggering unit) to damage TempUnit, dealing (((Real((Strength of (Triggering unit) (Include bonuses)))) x 2.00) x SpellDamageModifier) damage of attack type Hero and damage type Magic
          • -------- create stun effect above the unit --------
          • Special Effect - Create a special effect attached to the overhead of TempUnit using Abilities\Spells\Human\Thunderclap\ThunderclapTarget.mdl
          • Set StunSpecialEffects[StunEffectsInt] = (Last created special effect)
          • Set StunEffectToDestroy = StunEffectsInt
          • Set StunEffectsInt = (StunEffectsInt + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • StunEffectsInt Equal to 9
            • Then - Actions
              • Set StunEffectsInt = 0
            • Else - Actions
          • Unit - Pause TempUnit
          • Wait 10.00 seconds
          • Unit - Unpause TempUnit
          • Special Effect - Destroy StunSpecialEffects[StunEffectToDestroy]
        • Else - Actions
          • Floating Text - Create floating text that reads Miss! above (Casting unit) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.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 (Last created floating text): Disable permanence
          • 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.75 seconds
The another thing you ask for is possible. Go ahead and do it :)
 
Level 3
Joined
Feb 13, 2008
Messages
65
  • Stun
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Stun
    • Actions
      • -------- local variables specific to this unit --------
      • Custom script: local unit udg_TempUnit
      • Custom script: local integer udg_StunEffectToDestroy
      • Set TempUnit = (Target unit of ability being cast)
      • Set TempInt = (Random integer number between 1 and 100)
      • -------- ------------------------------------- --------
      • -------- delay between the time of casting beginning and the effect applying --------
      • Wait 1.00 seconds
      • -------- ------------------------------------- --------
      • -------- stun proc chance is an integer variable that determines the chance for the skill to proc --------
      • -------- set the initial value to 70 if you want to have 70% chance of the effect applying --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempInt Less than or equal to StunProcChance
        • Then - Actions
          • -------- this is a simple damage equation --------
          • -------- SpellDamageModifier is a variable of type real. Set it to whatever to scale the damage --------
          • Unit - Cause (Triggering unit) to damage TempUnit, dealing (((Real((Strength of (Triggering unit) (Include bonuses)))) x 2.00) x SpellDamageModifier) damage of attack type Hero and damage type Magic
          • -------- create stun effect above the unit --------
          • Special Effect - Create a special effect attached to the overhead of TempUnit using Abilities\Spells\Human\Thunderclap\ThunderclapTarget.mdl
          • Set StunSpecialEffects[StunEffectsInt] = (Last created special effect)
          • Set StunEffectToDestroy = StunEffectsInt
          • Set StunEffectsInt = (StunEffectsInt + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • StunEffectsInt Equal to 9
            • Then - Actions
              • Set StunEffectsInt = 0
            • Else - Actions
          • Unit - Pause TempUnit
          • Wait 10.00 seconds
          • Unit - Unpause TempUnit
          • Special Effect - Destroy StunSpecialEffects[StunEffectToDestroy]
        • Else - Actions
          • Floating Text - Create floating text that reads Miss! above (Casting unit) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.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 (Last created floating text): Disable permanence
          • 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.75 seconds
The another thing you ask for is possible. Go ahead and do it :)

This way would work, but there is a simpler way to achieve this.

First of all make the spell that you want based off of the skill storm bolt. You'll be able to set the stun duration and damage to whatever you want accordingly. For this example, i'm going to name my skill Custom Storm Bolt.

  • Events
  • Unit - Unit begins casting an ability
  • Conditions
  • (Ability being cast) Equal to Custom Storm Bolt
  • Actions
  • Set StormBoltChance = (Random real number between 1 and 10)
  • Set StormBoltTarget = (Target Unit of Ability being cast)
  • If (All Condtions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • StormBoltChance Less than or Equal to 3
    • Then - Actions
      • For Each (Integer A) from 1 to 5, do (Actions)
        • Loop (Actions)
          • Wait .30 seconds
          • Unit - Remove Stunned buff from StormBoltTarget
          • Unit - Remove Stunned (Pause) buff from StormBoltTarget
      • Else - Actions

Pretty short and sweet trigger. This will check every time that you cast Custom Storm Bolt if the real variable StormBoltChance (Which can only be 1 through 10) is less than or equal to 3 (30% chance), and if it is, it will remove the stun from the target. If it is not, then the stun will go through as normal.

Btw StormBoltTarget is just a unit variable
 
Last edited:
Level 16
Joined
Mar 3, 2006
Messages
1,564
I am not sure, but if he make a global variable named TempUnit, won't this overlap. The local is called udg_TempUnit and if the global, which is also udg_TempUnit, if they both are used inside the Action function that may not work, so I think it better to remove udg_ from the local as it is a prefix used to define globals
 

Rmx

Rmx

Level 19
Joined
Aug 27, 2007
Messages
1,164
I am not sure, but if he make a global variable named TempUnit, won't this overlap. The local is called udg_TempUnit and if the global, which is also udg_TempUnit, if they both are used inside the Action function that may not work, so I think it better to remove udg_ from the local as it is a prefix used to define globals

No it will work .. not overlap or anythin, i laso made a Learning Guide about it.

Not gonna say where, or i'll advertise :razz:.

But it will work 100%, it shadows the global ... making it local ..

But you can only use 1 local .. so i don't think the local integer should work :S

Tough that is what i heard .. you could just only use one !
 
Status
Not open for further replies.
Top