Potion Creating Spell (trigger help)?

Zorve

New Member
Reaction score
0
Hi,

i need some help with creating a Potion Creating spell. I have made one that creat a Greater healing potion. But i want it to be an equal chance that i creat a mana potion etc. lets say 4 diffrent potions.

Trigger:
  • Potion Making
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Potion Making
    • Actions
      • Hero - Create Potion of Greater Healing and give it to (Triggering unit)


Thanks. :)
 
Reaction score
86
Create a global variable called Chance. In the actions you would want to do something like:
set Chance = Math - Random Integer from 1-X (X is the number of different options.)
Next you would have an if statement like:
if Chance == 1 Then
Create Greater Healing Potion and...
ElseIf Chance==2 Then
Create Greter Mana Potion and...
ElseIf....
 

FhelZone

Have a drink of a nice cold mellowberry juice!
Reaction score
103
The trigger would go like the one below, just like infiniteedge said, make an integer variable and name it whatever you want, it will serve you for every chance trigger you will make.

Trigger:
  • Potion Making
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Potion Making
    • Actions
      • Set Temp_Integer = (Random integer number between 1 and 4)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Temp_Integer Equal to 1
        • Then - Actions
          • Hero - Create Potion 1 and give it to (Triggering unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Temp_Integer Equal to 2
        • Then - Actions
          • Hero - Create Potion 2 and give it to (Triggering unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Temp_Integer Equal to 3
        • Then - Actions
          • Hero - Create Potion 3 and give it to (Triggering unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Temp_Integer Equal to 4
        • Then - Actions
          • Hero - Create Potion 4 and give it to (Triggering unit)
        • Else - Actions
 
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