Chance to cast a spell with trigger...?

rafaxik

New Member
Reaction score
2
I know if I change Orb of lightning's data in Obj Editor, I can do this stuff. But I don't want to create an orb effect, so help me with this trigger. All Actions is warned by chat, just to make sure it's working and they really are being displayed:

Trigger:
  • ShakujosHit
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) has buff Shakujo (Shakujo)) Equal to True
    • Actions
      • Set ShakujoInt = (Random integer number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ShakujoInt Less than or equal to (((Level of Shakujo's Hit for (Attacking unit)) x 5) + 10)
        • Then - Actions
          • Game - Display to (All players) the text: conditions worked!
          • Unit - Create 1 dummy00 for (Owner of (Attacking unit)) at (Position of (Attacking unit)) facing Default building facing degrees
          • Game - Display to (All players) the text: created unit worked!
          • Unit - Add Shakujo's Strike to (Last created unit)
          • Game - Display to (All players) the text: add Shakujo's Strik...
          • Unit - Set level of Shakujo's Strike for (Last created unit) to (Level of Shakujo's Hit for (Attacking unit))
          • Game - Display to (All players) the text: Level of Shakujo's ...
          • Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike (Attacking unit)
          • Game - Display to (All players) the text: order shadow strike...
          • Unit - Remove (Last created unit) from the game
          • Game - Display to (All players) the text: remove unit worked!
        • Else - Actions

Note¹ : Chance to shadow strike attacked unit
Note² : I based Shakujo's Hit on Endurance Aura
Note³ : I based Shakujo's Strike on Shadow Strike

Thanks for help

EDIT:
Resume for the spell:
When the hero attacks, it has 15/20/25 % chance to "shadow strike" attacked unit (It's not orb effect, nor buff placer, trigger only)
 

Ph[o]bia

New Member
Reaction score
7
eh whats your problem?


note:
Trigger:
  • Unit - Create 1 dummy00 for (Owner of (Attacking unit)) at(Position of (Attacking unit)) facing Default building facing degrees


the (Postion of (Attacking unit)) leak, you should put it in a variable. then destroy it whit "call RemoveLocation(udg_"variable's name")"
 

rafaxik

New Member
Reaction score
2
eh whats your problem?

the (Postion of (Attacking unit)) leak, you should put it in a variable. then destroy it whit "call RemoveLocation(udg_"variable's name")"

Like this Variable ShakujoPoint = (Position of (Attacking unit)) ??
If that's so, still leaks... more ideas?

EDIT:
And why does it leak afterall ?
EDIT 2: I got the leak idea, see the initial thread's edit now.
 

rafaxik

New Member
Reaction score
2
bah... I want help you but I don't what you want or what is your problem so...

and for leak:

http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=27242

Well, thanks for your help. With that link I had ideas to make it work and now it has no leak.
Notes: I changed the dummy00 to Stats - Hide minimap display - True and I changed the missile speed and the cast range of the ability to the maximum

and the trigger is now:

Trigger:
  • ShakujosHit
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) has buff Shakujo (Shakujo)) Equal to True
    • Actions
      • Set ShakujoPoint = (Position of (Attacking unit))
      • Set ShakujoInt = (Random integer number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ShakujoInt Less than or equal to (((Level of Shakujo's Hit for (Attacking unit)) x 5) + 10)
        • Then - Actions
          • Game - Display to (All players) the text: conditions worked!
          • Unit - Create 1 dummy00 for Neutral Hostile at ShakujoPoint facing Default building facing degrees
          • Game - Display to (All players) the text: created unit worked!
          • Unit - Add Shakujo's Strike to (Last created unit)
          • Game - Display to (All players) the text: add Shakujo's Strik...
          • Unit - Set level of Shakujo's Strike for (Last created unit) to (Level of Shakujo's Hit for (Attacking unit))
          • Game - Display to (All players) the text: Level of Shakujo's ...
          • Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike (Attacked unit)
          • Game - Display to (All players) the text: order shadow strike...
          • Set TempUnit = (Last created unit)
          • Wait 10.00 seconds
          • Unit - Remove TempUnit from the game
          • Game - Display to (All players) the text: remove unit worked!
        • Else - Actions
      • Set TempUnit = No unit
      • Custom script: call RemoveLocation(udg_ShakujoPoint)
 

Ph[o]bia

New Member
Reaction score
7
Well, thanks for your help. With that link I had ideas to make it work and now it has no leak.
Notes: I changed the dummy00 to Stats - Hide minimap display - True and I changed the missile speed and the cast range of the ability to the maximum

and the trigger is now:

Trigger:
  • ShakujosHit
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) has buff Shakujo (Shakujo)) Equal to True
    • Actions
      • Set ShakujoPoint = (Position of (Attacking unit))
      • Set ShakujoInt = (Random integer number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ShakujoInt Less than or equal to (((Level of Shakujo's Hit for (Attacking unit)) x 5) + 10)
        • Then - Actions
          • Game - Display to (All players) the text: conditions worked!
          • Unit - Create 1 dummy00 for Neutral Hostile at ShakujoPoint facing Default building facing degrees
          • Game - Display to (All players) the text: created unit worked!
          • Unit - Add Shakujo's Strike to (Last created unit)
          • Game - Display to (All players) the text: add Shakujo's Strik...
          • Unit - Set level of Shakujo's Strike for (Last created unit) to (Level of Shakujo's Hit for (Attacking unit))
          • Game - Display to (All players) the text: Level of Shakujo's ...
          • Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike (Attacked unit)
          • Game - Display to (All players) the text: order shadow strike...
          • Set TempUnit = (Last created unit)
          • Wait 10.00 seconds
          • Unit - Remove TempUnit from the game
          • Game - Display to (All players) the text: remove unit worked!
        • Else - Actions
      • Set TempUnit = No unit
      • Custom script: call RemoveLocation(udg_ShakujoPoint)

lol pls , don't use wait. now it's not mui -.-
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
You want to remove the unit after 10 seconds? Or you put the wait there because if you don't, the unit will not be removed?
 

rafaxik

New Member
Reaction score
2
You want to remove the unit after 10 seconds? Or you put the wait there because if you don't, the unit will not be removed?

I put the wait cause the unit is removed before it casts Shadow Strike nad I want to remove it later cause it may cause mass lag
EDIT: "Shadow Strike" means "Shakujo's Strike" based on the first...
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
Add expiration timer. It is under Action - Unit - Add expiration timer. Look for it, and set it to a 2 second generic timer. It should be enough unless the cast time is long.
 

rafaxik

New Member
Reaction score
2
Add expiration timer. It is under Action - Unit - Add expiration timer. Look for it, and set it to a 2 second generic timer. It should be enough unless the cast time is long.

Still Leaks.... ='/
Memory Leaks bcause of a lot of action to different units and positions...
Wait action allows to give trigger time to "act" I guess
 

tooltiperror

Super Moderator
Reaction score
231
False.

You can use timers to provide accurate waits, but the most helpful systems are in JASS.

If you want, I can just JASS this spell for you. Much easier.

Edit: Go into the unit editor, find the spell, and press CTRL+D. The raw codes will pop up. Could you tell me the raw code of your spell?
 

rafaxik

New Member
Reaction score
2
False.

You can use timers to provide accurate waits, but the most helpful systems are in JASS.

If you want, I can just JASS this spell for you. Much easier.

Edit: Go into the unit editor, find the spell, and press CTRL+D. The raw codes will pop up. Could you tell me the raw code of your spell?

A00O:AOae = Shakujo's Hit (Based on Endurance Aura)
A01S:AEsh = Shakujo's Strike (Based on Shadow Strike)
 

msakni

New Member
Reaction score
8
Trigger:
  • Unit - Add a 10.00 second Generic expiration timer to (Triggering unit)

is better than the wait, and the code is still the same, except it's mui :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top