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.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top