• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Little help with my trigger

Status
Not open for further replies.
Level 3
Joined
Feb 9, 2008
Messages
63
I'm trying to make a GUI spell based on dark portal that's supposed to follow these descriptions:

1.summon 1 random type of monster for the caster

Additional info:
Call is based on Dark Portal
Summon Type 1,2 and 3 is based on Feral Spirit

Encountered Problems:

1.How do i make this trigger shorter? (i know it sucks)

  • Melee Initialization
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Call (Archimonde)
    • Actions
      • Set SummonChance[1] = Summon Type 1
      • Set SummonChance[2] = Summon Type 2
      • Set SummonChance[3] = Summon Type 3
      • Set SummonPoint[1] = (Target point of ability being cast)
      • Set SummonPoint[2] = (Position of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 3) Equal to 1
        • Then - Actions
          • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at SummonPoint[1] facing SummonPoint[2]
          • Unit - Add SummonChance[1] to (Last created unit)
          • Unit - Set level of SummonChance[1] for (Last created unit) to (Level of Call (Archimonde) for (Triggering unit))
          • Unit - Order (Last created unit) to Orc Far Seer - Feral Spirit
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and 3) Equal to 2
            • Then - Actions
              • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at SummonPoint[1] facing SummonPoint[2]
              • Unit - Add SummonChance[2] to (Last created unit)
              • Unit - Set level of SummonChance[2] for (Last created unit) to (Level of Call (Archimonde) for (Triggering unit))
              • Unit - Order (Last created unit) to Orc Far Seer - Feral Spirit
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Random integer number between 1 and 3) Equal to 3
                • Then - Actions
                  • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at SummonPoint[1] facing SummonPoint[2]
                  • Unit - Add SummonChance[3] to (Last created unit)
                  • Unit - Set level of SummonChance[3] for (Last created unit) to (Level of Call (Archimonde) for (Triggering unit))
                  • Unit - Order (Last created unit) to Orc Far Seer - Feral Spirit
                  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                • Else - Actions
      • Custom script: call RemoveLocation (udg_SummonPoint[1])
      • Custom script: call RemoveLocation (udg_SummonPoint[2])
2. for some reason there are times that the spell doesn't create a dummy thus not summoning anything, how do i solve this?

3. how do i make it MUI?

Thanks in advance
 
Last edited:
Level 23
Joined
Apr 16, 2012
Messages
4,041
The problem with this trigger is that sometimes you may hit the empty else because every another elseif you are compairing newly generated integer to the value(1,2,3)

Also dont use location array just because of 2 locations, just use 2 locations like loc1 and loc2.

Create another integer of type integer and name it someway.
Then set that to Random number between 1 and 3 and then do(including your location array, laziness):
  • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at SummonPoint[1] facing SummonPoint[2]
  • Unit - Add SummonChance[!integer!] to (Last created unit)
  • Unit - Set level of SummonChance[!integer!] for (Last created unit) to (Level of Call (Archimonde) for (Triggering unit))
  • Unit - Order (Last created unit) to Orc Far Seer - Feral Spirit
  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
change the !integer! to the integer you have created The rest is good enough
 
Level 3
Joined
Feb 9, 2008
Messages
63
That IS... his purpose.
10% chance to summon each unit - else fails.

I must apologize first for posting the wrong descriptions, the spell is supposed to summon a random monster it has no chance to fail again i apologize.

i already fixed it in the first post



The problem with this trigger is that sometimes you may hit the empty else because every another elseif you are compairing newly generated integer to the value(1,2,3)

here's what i did it works all the time now
  • Melee Initialization
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Call (Archimonde)
    • Actions
      • Set SummonChance[1] = Summon Type 1
      • Set SummonChance[2] = Summon Type 2
      • Set SummonChance[3] = Summon Type 3
      • Set SummonPoint[1] = (Target point of ability being cast)
      • Set SummonPoint[2] = (Position of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 3) Equal to 1
        • Then - Actions
          • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at SummonPoint[1] facing SummonPoint[2]
          • Unit - Add SummonChance[1] to (Last created unit)
          • Unit - Set level of SummonChance[1] for (Last created unit) to (Level of Call (Archimonde) for (Triggering unit))
          • Unit - Order (Last created unit) to Orc Far Seer - Feral Spirit
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and 3) Equal to 2
            • Then - Actions
              • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at SummonPoint[1] facing SummonPoint[2]
              • Unit - Add SummonChance[2] to (Last created unit)
              • Unit - Set level of SummonChance[2] for (Last created unit) to (Level of Call (Archimonde) for (Triggering unit))
              • Unit - Order (Last created unit) to Orc Far Seer - Feral Spirit
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
            • Else - Actions
              • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at SummonPoint[1] facing SummonPoint[2]
              • Unit - Add SummonChance[3] to (Last created unit)
              • Unit - Set level of SummonChance[3] for (Last created unit) to (Level of Call (Archimonde) for (Triggering unit))
              • Unit - Order (Last created unit) to Orc Far Seer - Feral Spirit
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation (udg_SummonPoint[1])
      • Custom script: call RemoveLocation (udg_SummonPoint[2])
the problems is that is still very long and if the solution is...
Create another integer of type integer and name it someway.
Then set that to Random number between 1 and 3 and then do(including your location array, laziness):
  • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at SummonPoint[1] facing SummonPoint[2]
  • Unit - Add SummonChance[!integer!] to (Last created unit)
  • Unit - Set level of SummonChance[!integer!] for (Last created unit) to (Level of Call (Archimonde) for (Triggering unit))
  • Unit - Order (Last created unit) to Orc Far Seer - Feral Spirit
  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
change the !integer! to the integer you have created The rest is good enough
i simply dont get it...can you explain a little bit further?

thanks for replying :D
 
Status
Not open for further replies.
Top