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.

      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