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

Spell makes game crash! Why?

Status
Not open for further replies.
Level 5
Joined
May 27, 2007
Messages
144
I made a spell that has a chance to drain life points from enemies! Sometimes when hero drains life points the game crush. Her is the Tigger i hope someone can help me.
  • BloodSuck chance
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (learned Hero Skill) equal to BloodSuck
    • Actions
      • Set TRiggeringUnit[8] = (Triggering unit)
      • Set BloodSuckChance = (Random integer number between 1 and (14 - (Level of BloodSuck for TriggeringUnit[8]
      • Set BloodSuckPercentChance = 1
[/TRIGGER]
  • BloodSuck
    • Events
      • Unit -A unit is attacked
    • Conditions
      • ((Attacked unit) is A structure) equal to false
      • ((Attacked unit) belongs to an enemy of (owner of TriggeringUnit[8])) equal to true
      • ((Attacked unit) is in (Units within 900.00 of (Position of TriggeringUnit[8]))) Equal to True
    • Actions
      • Set AttackedUnit [1] = (Attacked unit)
      • Set BloodSuckChance = (Random integer number between 1 and (14-(Level of BloodSuck for TriggeringUnit[8])))
      • If (ALL Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BloodSuckChance Equal to BloodSuckPercentChance
        • Then - Actions
          • Unit - Add Sucklife effect to TriggeringUnit[8]
          • Unit - Set level of Sucklife effect for TriggeringUnit[8] to (Level of BLoodSuck for TriggeringUnit[8])
          • Unit - Order TriggeringUnit[8] to Neutral Dark Ranger - Life Drain AttackedUnit[1]
          • Wait 10.00 seconds
          • Unit - Remove Sucklife effect from TriggeringUnit[8]
        • Else - Actions
 
Last edited by a moderator:
Level 11
Joined
Jul 12, 2005
Messages
764
Well, you could make this far more efficient, and in one trigger only, WITHOUT variables, so it'll be MUI. Download spells, look at how other spell-makers create spells, and "steal" the tricks.
  • BloodSuck
    • Events
      • Unit -A unit is attacked
    • Conditions
      • (Level of BloodSuck for Attacking unit) is greater then 0
    • Actions
      • If (ALL Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and (14-(Level of BloodSuck for Attacking unit))) is equal to 1
        • Then - Actions
          • Unit - Add Sucklife effect to Attacking unit
          • Unit - Set level of Sucklife effect for Attacking unit to (Level of BLoodSuck for Attacking unit)
          • Unit - Order Attacking unit to Neutral Dark Ranger - Life Drain (Triggering unit)
          • Wait 10.00 seconds
          • Unit - Remove Sucklife effect from Attacking unit
          • Else - Actions
 
Level 5
Joined
May 27, 2007
Messages
144
Thx but know he dont stop to cast sucklife effeckt when a trigerring unit is dead.
 
Last edited:
Level 11
Joined
Jul 12, 2005
Messages
764
Well, I only "converted" YOUR trigger, that's not my problem anymore, your trigger neither stops to cast 'sucklife'...
But because i'm so kind, i made it for you. Needs one line of custom script (jass).
  • BloodSuck
    • Events
      • Unit -A unit is attacked
    • Conditions
      • (Level of BloodSuck for Attacking unit) is greater then 0
    • Actions
      • If (ALL Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and (14-(Level of BloodSuck for Attacking unit))) is equal to 1
        • Then - Actions
          • Unit - Add Sucklife effect to Attacking unit
          • Unit - Set level of Sucklife effect for Attacking unit to (Level of BLoodSuck for Attacking unit)
          • Unit - Order Attacking unit to Neutral Dark Ranger - Life Drain (Triggering unit)
          • For each integer from 1 to 10 do Actions
            • Loop - Actions
              • Custom script: exitwhen GetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE) <= 0
              • Wait 1.00 seconds
          • Unit - Remove Sucklife effect from Attacking unit
          • Else - Actions
 
Status
Not open for further replies.
Top