Causing random damage /w random type

Lumograph090

New Member
Reaction score
22
I'm currently working on a hero called Lady Luck, all spells and abilities will be random. They will cause random damage, random buffs/debuffs, affects, etc.

I'm working on one of my spells and I'm just wondering if its possible to use multiple
Trigger:
  • (Random integer number between 1 and 6) Equal to (==) X
in the same ability.

For example this spell is called "Roll of the Dice"

Lady Luck tries her hand at damaging a single target. Rolling her dice and causing damage based on the roll. Damage caused and damage type is based on the outcome of the roll.

Rank 1 - Causes 50 - 125 damage.

Rank 2 - Causes 75 - 225 damage.

Rank 3 - Causes 100 - 325 damage.

Rank 4 - Causes 125 - 425 damage.

Rank 5 - Causes 150 - 525 damage.
Damage type inflicted can be Siege, Normal, Pierce, Magic, Hero, and Chaos.

Here is what I have so far in my Trigger...

Trigger:
  • Roll of the Dice Rank 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Roll of the Dice
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 6) Equal to (==) 1
        • Then - Actions
          • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Random real number between 50.00 and 125.00) damage of attack type Normal and damage type Shadow Strike
          • Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and 6) Equal to (==) 2
            • Then - Actions
              • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Random real number between 50.00 and 125.00) damage of attack type Pierce and damage type Shadow Strike
              • Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Random integer number between 1 and 6) Equal to (==) 3
                • Then - Actions
                  • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Random real number between 50.00 and 125.00) damage of attack type Siege and damage type Shadow Strike
                  • Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
                  • Special Effect - Destroy (Last created special effect)
                • Else - Actions
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Random integer number between 1 and 6) Equal to (==) 4
                    • Then - Actions
                      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Random real number between 50.00 and 125.00) damage of attack type Magic and damage type Shadow Strike
                      • Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
                      • Special Effect - Destroy (Last created special effect)
                    • Else - Actions
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Random integer number between 1 and 6) Equal to (==) 5
                        • Then - Actions
                          • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Random real number between 50.00 and 125.00) damage of attack type Chaos and damage type Shadow Strike
                          • Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
                          • Special Effect - Destroy (Last created special effect)
                        • Else - Actions
                          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Random integer number between 1 and 6) Equal to (==) 6
                            • Then - Actions
                              • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Random real number between 50.00 and 125.00) damage of attack type Hero and damage type Shadow Strike
                              • Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
                              • Special Effect - Destroy (Last created special effect)
                            • Else - Actions


Now as far as causing random damage /w a random damage type is easy. But what I'm not quite able to grasp is how to in a single Trigger have a random chance to cause the random damage as well as choose which damage type will be used... Normal, Siege, Hero, Pierce, Magic, Chaos.

Any help would be appreciated =)
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Yes multiple randoms works and just store attack types in a variable with a random int and the damage just use a random int
 

Lumograph090

New Member
Reaction score
22
Yes multiple randoms works and just store attack types in a variable with a random int and the damage just use a random int

1) Would what I have in my OP work correctly? 2) Would you be willing to give me an example of what you're saying? Including what my Variable would look like, etc. :D
 

Sui-cookie

You can change this now in User CP.
Reaction score
49
o_O seems like a stretch... can you just use two simple things?

setting "tempinteger[1]" to a random number of the damage range you want, then setting "tempinteger[2]" to a random number of kinds of attacks there is... each kind of attack with a dummy unit... then increase the attack of the dummy unit by "tempinteger[1]" ? :confused: then making the dummy unit attack the target of spell
 

Lumograph090

New Member
Reaction score
22
o_O seems like a stretch... can you just use two simple things?

setting "tempinteger[1]" to a random number of the damage range you want, then setting "tempinteger[2]" to a random number of kinds of attacks there is... each kind of attack with a dummy unit... then increase the attack of the dummy unit by "tempinteger[1]" ? :confused: then making the dummy unit attack the target of spell

Well, I don't need to use dummy units when I can use
Trigger:
  • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Random real number between 50.00 and 125.00) damage of attack type X and damage type Shadow Strike
 

Lumograph090

New Member
Reaction score
22
Well, I don't need to use dummy units when I can use
Trigger:
  • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Random real number between 50.00 and 125.00) damage of attack type X and damage type Shadow Strike

bump for answers :banghead:
 

Komaqtion

You can change this now in User CP.
Reaction score
469
I think this should suit your needs:
Trigger:
  • Random Stuff
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Random_Damage[1] = Chaos
      • Set Random_Damage[2] = Normal
      • Set Random_Damage[3] = Pierce
      • Set Random_Damage[4] = Siege
      • Set Random_Damage[5] = Magic
      • Set Random_Damage[6] = Hero


Trigger:
  • Roll of the Dice
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Random real number between (((Real((Level of Animate Dead for (Triggering unit)))) + 1.00) x 25.00) and ((100.00 x (Real((Level of Animate Dead for (Triggering unit))))) + 25.00)) damage of attack type Random_Damage[(Random integer number between 1 and 6)] and damage type Shadow Strike
      • Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
      • Special Effect - Destroy (Last created special effect)


This merges it to just 3 lines + 6 lines :D
 

Lumograph090

New Member
Reaction score
22
I think this should suit your needs:
Trigger:
  • Random Stuff
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Random_Damage[1] = Chaos
      • Set Random_Damage[2] = Normal
      • Set Random_Damage[3] = Pierce
      • Set Random_Damage[4] = Siege
      • Set Random_Damage[5] = Magic
      • Set Random_Damage[6] = Hero


Trigger:
  • Roll of the Dice
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Random real number between (((Real((Level of Animate Dead for (Triggering unit)))) + 1.00) x 25.00) and ((100.00 x (Real((Level of Animate Dead for (Triggering unit))))) + 25.00)) damage of attack type Random_Damage[(Random integer number between 1 and 6)] and damage type Shadow Strike
      • Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
      • Special Effect - Destroy (Last created special effect)


This merges it to just 3 lines + 6 lines :D

Hmm, awesome. However will this Trigger apply the correct damage per level?

Level 1: 50 - 125 damage
Level 2: 75 - 225 damage
Level 3: 100 - 325 damage
Level 4: 125 - 425 damage
Level 5: 150 - 525 damage

Will the Trigger you supplied me with apply the correct damage for each level?

Also, how do I apply the variables correctly for Random_Damage? I can see "Damage Type (damagetype) from the variable list, when I go to set up the Initialization Trigger and set Random_damage = X all i can choose from is Unknown, Normal, Enchanted, Fire, Cold, etc. There is no Chaos, Normal, Pierce, Hero, Magic, Siege.
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
Yes that trigger works for your damage, do the math.
That variable is Attack Type not Damage Type.
 

Lumograph090

New Member
Reaction score
22
Would it be possible to create floating text above the unit showing the actual damage done and damage type caused?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
It's a bit trickier since you can't convert attack-type to string, but this should work:
Trigger:
  • Random Stuff
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Random_Damage[1] = Chaos
      • Set Random_Damage[2] = Normal
      • Set Random_Damage[3] = Pierce
      • Set Random_Damage[4] = Siege
      • Set Random_Damage[5] = Magic
      • Set Random_Damage[6] = Hero
      • Set Atk_Type_String[1] = Chaos
      • Set Atk_Type_String[2] = Normal
      • Set Atk_Type_String[3] = Pierce
      • Set Atk_Type_String[4] = Siege
      • Set Atk_Type_String[5] = Magic
      • Set Atk_Type_String[6] = Hero


Trigger:
  • Roll of the Dice
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Set Temp_Int = (Random integer number between 1 and 6)
      • Set Temp_Atk_Type = Random_Damage[Temp_Int]
      • Set Temp_Real = (((Real((Level of Animate Dead for (Triggering unit)))) + 1.00) x 25.00)
      • Set Temp_Real2 = (((Real((Level of Animate Dead for (Triggering unit)))) x 100.00) + 25.00)
      • Set Temp_Dmg = (Random real number between Temp_Real and Temp_Real2)
      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing Temp_Dmg damage of attack type Temp_Atk_Type and damage type Shadow Strike
      • Floating Text - Create floating text that reads ((String(Temp_Dmg)) + ( + (Atk_Type_String[Temp_Int] + ( + damage!)))) above (Target unit of ability being cast) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Set the velocity of (Last created floating text) to 10.00 towards 90.00 degrees
      • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 4.00 seconds
      • Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
      • Special Effect - Destroy (Last created special effect)
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
You don't need those temp reals.
And besides, you messed up on the 2nd real's formula.
(((Real((Level of Animate Dead for (Triggering unit)))) x 100.00) x 25.00) would give 2500 for lvl 1 ^^.

And you might want to add velocity and a lifespan.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Temp_Real's no, not needed but easier to read and confogure ;)

Changed that mistake there XD

Added velocity and lifespawn/fading age ;)
 
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