Chance for two effects

bumbaclo

New Member
Reaction score
3
I'm trying to make a passive spell that has a % chance to slow and deal extra damage. It seems simple enough but I can only find a spell that can do one or the other. I'm not even sure how I could put this into trigger form. Is there a spell that can allow 2 different effects in the same chance?
 

HeX.16

Isn't Trollin You Right Now
Reaction score
131
This has many chances to do multiple effects
Trigger:
  • Hurl Boulder
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Hurl Boulder
    • Actions
      • Set TempPoint = (Position of (Target unit of ability being cast))
      • Set _IntegerVarAll[7] = (Random integer number between 1 and 15)
      • Unit - Create 1 Inflictor for (Owner of (Casting unit)) at TempPoint facing Default building facing degrees
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • _IntegerVarAll[7] Equal to 1
        • Then - Actions
          • Unit - Add 3 Sec Stun to (Last created unit)
          • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • _IntegerVarAll[7] Equal to 2
        • Then - Actions
          • Unit - Add Hex (Neutral Hostile) to (Last created unit)
          • Unit - Order (Last created unit) to Orc Shadow Hunter - Hex (Target unit of ability being cast)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • _IntegerVarAll[7] Equal to 3
        • Then - Actions
          • Unit - Add Mana Burn (Neutral Hostile 1) to (Last created unit)
          • Unit - Order (Last created unit) to Night Elf Demon Hunter - Mana Burn (Target unit of ability being cast)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • _IntegerVarAll[7] Equal to 4
        • Then - Actions
          • Unit - Add Shadow Strike (Neutral Hostile) to (Last created unit)
          • Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike (Target unit of ability being cast)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • _IntegerVarAll[7] Equal to 5
        • Then - Actions
          • Unit - Add Silence to (Last created unit)
          • Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Drunken Haze (Target unit of ability being cast)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • _IntegerVarAll[7] Equal to 6
        • Then - Actions
          • Unit - Add Chain Lightning (Neutral Hostile) to (Last created unit)
          • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning (Target unit of ability being cast)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • _IntegerVarAll[7] Equal to 7
        • Then - Actions
          • Unit - Add Lightning Shield (Neutral Hostile) to (Last created unit)
          • Unit - Order (Last created unit) to Orc Shaman - Lightning Shield (Target unit of ability being cast)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • _IntegerVarAll[7] Equal to 8
        • Then - Actions
          • Unit - Add Slow (Neutral Hostile) to (Last created unit)
          • Unit - Order (Last created unit) to Human Sorceress - Slow (Target unit of ability being cast)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • _IntegerVarAll[7] Equal to 9
        • Then - Actions
          • Unit - Add Invisibility to (Last created unit)
          • Unit - Order (Last created unit) to Human Sorceress - Invisibility (Target unit of ability being cast)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • _IntegerVarAll[7] Equal to 10
        • Then - Actions
          • Unit - Add Frost Nova (Neutral Hostile) to (Last created unit)
          • Unit - Order (Last created unit) to Undead Lich - Frost Nova (Target unit of ability being cast)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • _IntegerVarAll[7] Equal to 11
        • Then - Actions
          • Unit - Add Finger of Pain (Neutral Hostile) to (Last created unit)
          • Unit - Order (Last created unit) to Special Archimonde - Finger Of Death (Target unit of ability being cast)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • _IntegerVarAll[7] Equal to 12
        • Then - Actions
          • Unit - Add Faerie Fire (Neutral Hostile) to (Last created unit)
          • Unit - Order (Last created unit) to Night Elf Druid Of The Talon - Faerie Fire (Target unit of ability being cast)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • _IntegerVarAll[7] Equal to 13
        • Then - Actions
          • Unit - Add Banish (Neutral Hostile) to (Last created unit)
          • Unit - Order (Last created unit) to Human Blood Mage - Banish (Target unit of ability being cast)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • _IntegerVarAll[7] Equal to 14
        • Then - Actions
          • Unit - Create 1 Inflictor for (Owner of (Target unit of ability being cast)) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Unit - Add Rejuvenation to (Last created unit)
          • Unit - Order (Last created unit) to Night Elf Druid Of The Claw - Rejuvenation (Target unit of ability being cast)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • _IntegerVarAll[7] Equal to 15
        • Then - Actions
          • Unit - Create 1 Inflictor for (Owner of (Target unit of ability being cast)) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Unit - Add Bloodlust (Neutral Hostile 1) to (Last created unit)
          • Unit - Order (Last created unit) to Orc Shaman - Bloodlust (Target unit of ability being cast)
        • Else - Actions
          • Do nothing
      • Custom script: call RemoveLocation(udg_TempPoint)
 

roaaaarrrr

New Member
Reaction score
33
Could you just use the frost orb item ability? That adds damage and has a % chance to slow...
 

Bogrim

y hello thar
Reaction score
154
HeX.16, can you please stop posting unnecessary long triggers that barely has anything to do with what the original poster has requested? It's very confusing for new posters to be presented to such triggers, which they'd have to heavily modify to gain what they requested.

Bumbaclo, I don't know what spell you are using, but you can achieve this by casting an additional spell on the target by chance. With triggers you can create just about anything in the game, including a second "invisible" unit that can do various things to supplement your original spell. We call these units dummy units.

To create a standard dummy unit, go make a copy of the Locust unit in the object editor, and do the following things:

1. Change the unit's art model to ".mdl" (this will make the unit invisible).
2. Turn off the unit's shadow model.
3. Turn off the unit's attack.
4. Give the unit as large a mana amount as you can type.

You can further adjust the dummy unit, but this will suit your basic needs.

Now to create a trigger, we can use the Frost Nova ability to cause both additional damage and slow the target. By default, Frost Nova causes area of effect damage, but if you set the area of effect to 0, only the main target will be hit. You can also edit how much damage and for how long you want the slow to last this way.

Trigger:
  • Events
    • Unit - A unit Starts the effect of an ability

The event states that this trigger should fire when a unit uses an ability. This is central for how the trigger will respond to the ability you are triggering.
Trigger:
  • Conditions
    • (Ability being cast) Equal to Your Spell
    • (Random integer number between 1 and 10) Equal to 1

In the first condition, replace "Your Spell" with the spell you are using for this ability. This condition is essential to make sure the trigger only occurs with your specific spell and not any other spell.

In the second condition, we use the game's random seed to create effect of a chance. By default, I set it to 10%. If you want the chance to increase per level, you can use the spell's level as a mathematic equation:
Trigger:
  • (Random integer number between 1 and 10) Less than or equal to (Level of Your Spell for (Triggering unit))

This will give the spell a 10/20/30% chance of proccing the bonus effect.

For the actions, you first need to create some variables (access the variable window by pressing CTRL + B). Variables are what triggers use when refering to data or objects in the game. Because we need to create a dummy unit to cast our additional spell, we need to create a location for the unit to appear at. Create a point variable and name it "Temp_Point".

Your first action should be "Set Variable" using the variable you just created:
Trigger:
  • Actions
    • Set Temp_Point = (Position of (Target unit of ability being cast))

Next we create the unit to cast the spell with at the location we just specified with a variable. There are many unit actions to choose from, but a simple "Create unit" will do.
Trigger:
  • Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at Temp_Point facing Default building facing degrees

Your Dummy Unit will most likely be listed under Custom Undead units if you made a copy of Locust like I said earlier.

You can just add the ability the unit should be casting beforehand in the object editor, but it's easier to just add through an action and then you can use the same dummy unit for any other triggers as well.
Trigger:
  • Unit - Add Frost Nova (Dummy Unit) to (Last created unit)

Remember that the ability should not be a hero ability, otherwise the unit cannot use the ability.

If you want the bonus effect to scale with the levels of your main ability, add levels to the Frost Nova ability and use this action:
Trigger:
  • Unit - Set level of Frost Nova (Dummy) for (Last created unit) to (Level of Your Spell for (Triggering unit))

The dummy unit is in place and has the ability required for the bonus effect, now just make the unit use the ability with the "Unit - Issue Order Targeting A Unit" action:
Trigger:
  • Unit - Order (Last created unit) to Undead Lich - Frost Nova (Target unit of ability being cast)

Finally we have to get rid of the objects we used to create this effect, otherwise they will just remain and take up useless memory in the game (making it slower). We do this with these actions:
Trigger:
  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
    • Custom Script: call RemoveLocation( udg_Temp_Point )

And there you have it. The final trigger should look like this:
Trigger:
  • Melee Initialization
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Your Spell
      • (Random integer number between 1 and 10) Less than or equal to (Level of Your Spell for (Triggering unit))
    • Actions
      • Set Temp_Point = (Position of (Target unit of ability being cast))
      • Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at Temp_Point facing Default building facing degrees
      • Unit - Add Frost Nova (Dummy) to (Last created unit)
      • Unit - Set level of Frost Nova (Dummy) for (Last created unit) to (Level of Your Spell for (Triggering unit))
      • Unit - Order (Last created unit) to Undead Lich - Frost Nova (Target unit of ability being cast)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation( udg_Temp_Point )

If you want the special effect to look different, just edit the Frost Nova to whichever effects you prefer (if none, just delete the ability's effects).
 

bumbaclo

New Member
Reaction score
3
Thanks for the detailed reply Bogrim, it makes sense, but is not quite what I originally wanted. I forgot to mention my spell is to be a passive spell, and the two effects should proc on the same chance. The spell I originally tried to base it off was the orb of slow ability, which gives a chance to slow; however I can't seem to be able to add extra damage to it as well (only when the slow occurs).
 

Bogrim

y hello thar
Reaction score
154
That makes quite a difference in the amount of explaining required.

Just make Orb of Slow's spell cast Frost Nova instead of Slow. ;-)
 

roaaaarrrr

New Member
Reaction score
33
Hmm, what about bash or drunken brawler. Don't have editor in front of me now, but I think bash is a chance to stun and deal extra damage. Just change the stun buff to a frost nova buff instead.
 

Bogrim

y hello thar
Reaction score
154
Hmm, what about bash or drunken brawler. Don't have editor in front of me now, but I think bash is a chance to stun and deal extra damage. Just change the stun buff to a frost nova buff instead.
It doesn't work like that. Buffs only manipulate the art attachments and tooltip displayed by the effect, but you can't change the actual effect with buffs.
 

roaaaarrrr

New Member
Reaction score
33
yeah, I meant the effect... I wasnt sure if there was an option to change that in bash... I know in several spells you can change the spell effect.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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

      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