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

Lightning Spell

Status
Not open for further replies.
Level 10
Joined
Mar 19, 2010
Messages
622
Recently, I was working to make a spell. This spell upon cast, will calls down 3 lightning to strike on caster, the caster then focuses the energy to send 1(2 actually, but stacked up to make it look like 1) focused lightning beam to targeted enemy, dealing damage to it. But it happens to crash the game if i casts it several time. I'll post the triggers, can anyone out there help me to take a look it it has any leak?

  • Thunder Bolt Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Bolt
    • Actions
      • Set TB_Caster = (Triggering unit)
      • Set TB_Target = (Target unit of ability being cast)
      • Set TB_Point = (Position of TB_Caster)
      • Set TB_TempPoint = (TB_Point offset by (Random real number between 50.00 and 225.00) towards ((Facing of TB_Caster) + (Random real number between 90.00 and 270.00)) degrees)
      • Set TB_Dmg = (((Real((Intelligence of TB_Caster (Include bonuses)))) x 1.20) + ((Real((Agility of TB_Caster (Include bonuses)))) x 0.80))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to 35
        • Then - Actions
          • Set TB_Dmg = (TB_Dmg x 3.35)
        • Else - Actions
      • Set TB_Dmg = (TB_Dmg / 2.00)
      • For each (Integer B) from 1 to 3, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy [High] for (Owner of TB_Caster) at TB_TempPoint facing Default building facing degrees
          • Unit - Add Thunder Bolt Dummy Effect to (Last created unit)
          • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning TB_Caster
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_TB_TempPoint)
      • Custom script: call SetUnitAnimationByIndex( gg_unit_H003_0004, 4 )
      • For each (Integer B) from 1 to 2, do (Actions)
        • Loop - Actions
          • Set TB_TempPoint = (TB_Point offset by 50.00 towards ((Facing of TB_Caster) - 90.00) degrees)
          • Unit - Create 1 Dummy for (Owner of TB_Caster) at TB_TempPoint facing Default building facing degrees
          • Unit - Add Thunder Bolt Dummy Effect to (Last created unit)
          • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning TB_Target
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Unit - Cause TB_Caster to damage TB_Target, dealing TB_Dmg damage of attack type Spells and damage type Normal
          • Custom script: call RemoveLocation(udg_TB_TempPoint)
      • Custom script: call RemoveLocation(udg_TB_Point)
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Random integer number between 1 and 100) Less than or equal to 35
    • Then - Actions
      • Set TB_Dmg = (TB_Dmg x 3.35)
    • Else - Actions
      • Set TB_Dmg = (TB_Dmg / 2.00) <-- You have this one OUTSIDE the If/Then/Else. It should be in the "Else".
 
Level 10
Joined
Mar 19, 2010
Messages
622
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Random integer number between 1 and 100) Less than or equal to 35
    • Then - Actions
      • Set TB_Dmg = (TB_Dmg x 3.35)
    • Else - Actions
      • Set TB_Dmg = (TB_Dmg / 2.00) <-- You have this one OUTSIDE the If/Then/Else. It should be in the "Else".

It's suppose to be out side, in the lower part of the trigger each lightning deals 1 times of damage, so if i wanna deal 200 dmg in total i should divide it by 2 and then deals it in each individual lightning.


Still anyone seeks any possibility that it causes a War3 crash?
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
If the casting unit hasn't stats (Int/Agi/Str) = it's not a hero, it may crash. The trigger itself has nothing "crashable" about. You could try to use Integer A instead of B, or a custom Integer but I doubt it has some impact on this.
 
Status
Not open for further replies.
Top