• 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] Spell Book Auto-Kill Help

Status
Not open for further replies.
Level 3
Joined
Aug 18, 2009
Messages
21
Good Day to All.
I have a problem with adding spell book and stuff... When I try to add a spell book and increase it's level the unit that gains that spell book automatically dies. Inside that spell book is an ability based on Devotion Aura which adds 0.5 armor per skill level.
  • Song of Celerity
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Song of Celerity [E]
    • Actions
      • Unit - Remove Aria book from (Triggering unit)
      • Unit - Remove Song book from (Triggering unit)
      • Unit - Remove Hymn book from (Triggering unit)
      • Unit - Add Song book to (Triggering unit)
      • Unit - Set level of Song book for (Triggering unit) to (Level of Song of Celerity [E] for (Triggering unit))
This on with Command Aura
  • Hymn of Valor
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Hymn of Valor [|cffffcc00Q|r] - [|cffffcc00Level %d|r]
    • Actions
      • Set Location[1] = (Position of (Triggering unit))
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 400.00 of Location[1] matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))) and do (Actions)
        • Loop - Actions
          • Unit - Cause (Triggering unit) to damage (Picked unit), dealing ((Real((70 x (Level of (Ability being cast) for (Triggering unit))))) + (0.65 x (Real((Intelligence of (Triggering unit) (Include bonuses)))))) damage of attack type Spells and damage type Normal
          • Custom script: call RemoveLocation(udg_Location[1])
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Undead\AbsorbMana\AbsorbManaBirthMissile.mdl
          • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_Location[1])
      • Unit - Remove Song book from (Triggering unit)
      • Unit - Remove Hymn book from (Triggering unit)
      • Unit - Remove Aria book from (Triggering unit)
      • Unit - Add Hymn book to (Triggering unit)
      • Unit - Set level of Hymn book for (Triggering unit) to (Level of Aria of Preserverance [|cffffcc00W|r] - [|cffffcc00Level %d|r] for (Triggering unit))
This one with with Endurance Aura
  • Aria of Preserverance
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Aria of Preserverance [|cffffcc00W|r] - [|cffffcc00Level %d|r]
    • Actions
      • Set Location[1] = (Position of (Triggering unit))
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 500.00 of Location[1] matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to False)) and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (((0.65 x (Real((Intelligence of (Triggering unit) (Include bonuses))))) x 1.00) + (55.00 x (Real((Level of Aria of Preserverance [|cffffcc00W|r] - [|cffffcc00Level %d|r] for (Triggering unit)))))))
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Undead\VampiricAura\VampiricAuraTarget.mdl
          • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_Location[1])
      • Unit - Remove Song book from (Triggering unit)
      • Unit - Remove Aria book from (Triggering unit)
      • Unit - Remove Hymn book from (Triggering unit)
      • Wait 0.50 seconds
      • Unit - Add Aria book to (Triggering unit)
      • Unit - Set level of Aria book for (Triggering unit) to (Level of Aria of Preserverance [|cffffcc00W|r] - [|cffffcc00Level %d|r] for (Triggering unit))
Thank you for your help ^_^
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,259
You are running code which potentially is dealing damage or altering a unit's health. Make sure that the death is not the result of a scripting error by disabling any piece of the script that has the potential to kill a unit.

Be aware that some active abilities could be accidently made to kill the caster when used. I advise also testing if casts with all interacting triggers disabled also cause the unit to die.
 
Level 3
Joined
Aug 18, 2009
Messages
21
Thanks for the ideas. I disabled all other triggers but casting any of the 3 skills still cause an automatic death. Another thing... This bug only happens when my unit's stat points are around 100str/agiand/or int and 1000+ hit points. I guess i have the same problems as this guy http://www.hiveworkshop.com/forums/world-editor-help-zone-98/spellbook-suicide-issue-138204/
EDIT!!!
I forget to mention that even when removing the damage dealing/life altering parts the unit still dies...
 
Here is solution:

  1. Create only 1 spellbook ability.
  2. Create all auras you will use and add them to spell book.
  3. Make them have "number + 1" levels you want.
  4. Edit ability "target field" for last or first level to not self, mechanical or dunno something that will remove aura buff and effect from possible targets in your map.
  5. When you cast spell or whatever just set level of unused abilities to that "fake" level that will null auras effects. Then just set level of your aura to level of ability (add +1 if you used level 1 for fake effect).
With 1 array that will store abilities, and few integers you can create this in single trigger :)

I can upload test map in few hours when I come home?
 
Status
Not open for further replies.
Top