• 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.

[Trigger] Spell Bug

Status
Not open for further replies.
Level 12
Joined
May 12, 2012
Messages
631
Hi Hive! can someone help me with my spell, it crashes the game when an illusion is made
  • Juxtapose
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacking unit) Equal to Phantom_Lancer
      • ((Attacking unit) is an illusion) Equal to False
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Juxtapose for Phantom_Lancer) Equal to 1
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of Phantom_Lancer) Less than or equal to 1
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Random integer number between 1 and 100) Equal to 12
                • Then - Actions
                  • Set Temp_point[2] = (Position of (Attacking unit))
                  • Unit - Create 1 Juxtapose for (Owner of (Attacking unit)) at Temp_point[2] facing Default building facing degrees
                  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                  • Unit - Add Juxtapose illusion to (Last created unit)
                  • Unit - Set level of Juxtapose illusion for (Last created unit) to (Level of Juxtapose for Phantom_Lancer)
                  • Custom script: call IssueTargetOrderById(bj_lastCreatedUnit, 852274, GetAttacker())
                  • Custom script: call RemoveLocation(udg_Temp_point[2])
                  • Unit - Set the custom value of Phantom_Lancer to ((Custom value of Phantom_Lancer) + 1)
                • Else - Actions
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Juxtapose for Phantom_Lancer) Equal to 2
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of Phantom_Lancer) Less than or equal to 3
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Random integer number between 1 and 100) Equal to 12
                • Then - Actions
                  • Set Temp_point[2] = (Position of (Attacking unit))
                  • Unit - Create 1 Juxtapose for (Owner of (Attacking unit)) at Temp_point[2] facing Default building facing degrees
                  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                  • Unit - Add Juxtapose illusion to (Last created unit)
                  • Unit - Set level of Juxtapose illusion for (Last created unit) to (Level of Juxtapose for Phantom_Lancer)
                  • Custom script: call IssueTargetOrderById(bj_lastCreatedUnit, 852274, GetAttacker())
                  • Custom script: call RemoveLocation(udg_Temp_point[2])
                  • Unit - Set the custom value of Phantom_Lancer to ((Custom value of Phantom_Lancer) + 1)
                • Else - Actions
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Juxtapose for Phantom_Lancer) Equal to 3
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of Phantom_Lancer) Less than or equal to 5
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Random integer number between 1 and 100) Equal to 12
                • Then - Actions
                  • Set Temp_point[2] = (Position of (Attacking unit))
                  • Unit - Create 1 Juxtapose for (Owner of (Attacking unit)) at Temp_point[2] facing Default building facing degrees
                  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                  • Unit - Add Juxtapose illusion to (Last created unit)
                  • Unit - Set level of Juxtapose illusion for (Last created unit) to (Level of Juxtapose for Phantom_Lancer)
                  • Custom script: call IssueTargetOrderById(bj_lastCreatedUnit, 852274, GetAttacker())
                  • Custom script: call RemoveLocation(udg_Temp_point[2])
                  • Unit - Set the custom value of Phantom_Lancer to ((Custom value of Phantom_Lancer) + 1)
                • Else - Actions
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Juxtapose for Phantom_Lancer) Equal to 4
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of Phantom_Lancer) Less than or equal to 7
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Random integer number between 1 and 100) Equal to 12
                • Then - Actions
                  • Set Temp_point[2] = (Position of (Attacking unit))
                  • Unit - Create 1 Juxtapose for (Owner of (Attacking unit)) at Temp_point[2] facing Default building facing degrees
                  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                  • Unit - Add Juxtapose illusion to (Last created unit)
                  • Unit - Set level of Juxtapose illusion for (Last created unit) to (Level of Juxtapose for Phantom_Lancer)
                  • Custom script: call IssueTargetOrderById(bj_lastCreatedUnit, 852274, GetAttacker())
                  • Custom script: call RemoveLocation(udg_Temp_point[2])
                  • Unit - Set the custom value of Phantom_Lancer to ((Custom value of Phantom_Lancer) + 1)
                • Else - Actions
            • Else - Actions
        • Else - Actions
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
What's this order:
  • Custom script: call IssueTargetOrderById(bj_lastCreatedUnit, 852274, GetAttacker())
Do you have any triggers that run on unit entering map?

Some general observations:
- you can remove the last 3 if/then/else sections, and check the values (e.g. illusion limit) by adding and multiplying the level of the ability for the unit
- This:
  • (Random integer number between 1 and 100) Equal to 12
Equates to 1%, you should use
  • (Random integer number between 1 and 100) Less than or equal to 12
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
What's this order:
  • Custom script: call IssueTargetOrderById(bj_lastCreatedUnit, 852274, GetAttacker())
That function is to order your dummy unit to cast Wand of Illusion-based ability.
In GUI, you don't have this order in the list, that's why you have to do this.

Either doing that, or give an item (that has Wand of Illusion-based ability) to the dummy, order the dummy to use that item on Caster.
But it requires extra function - so it's better to use the first one.
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
Well it's time to learn!

Open up the Object Editor, and then the Ability Editor.

On the left, right at the bottom, you'll see PL's spells under Custom Abilities. There are two folders: Unit and Hero. The spells we're looking for are in the Unit folder. They're all based on the same spell (Illusion), so you'll have to fix all of them. Select the first one. On the right, a whole bunch of data will appear. Scroll down until you find Stats - Buff. Right click it, and select "reset to default". Now copy this field (ctrl c), and paste it at every other field that says "Stats - Buff". In each ability there are 4 levels, each one must be replaced.
 
Status
Not open for further replies.
Top