• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Solved] Metamorphosis Spellbook

Level 10
Joined
Dec 16, 2017
Messages
373
Hi guys, i have a spellbook for each hero in my map, they gain spells as they tier up, and at the last tier they have like 11 spells in spellbook, 1 by default and 4 hero skills, on my new class Demon Hunter, i want to use Metamorphosis as last spell, bu when i use the skill, the spells from spellbook are gone..the heroes have the same skills (for the normal unit and alternate unit). What could make the spells from the spellbook dissappear?
 
Level 10
Joined
Dec 16, 2017
Messages
373
So it would look like this?
  • Demon Hunter Spellbook Increase Job 4
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Unit-type of (Leveling Hero)) Equal to |c00A330C9[Demon Hunter] - |c00FF00FF[Job 4]|r
      • (Hero level of (Leveling Hero)) Greater than or equal to 1
      • (Level of Mana Burn Demon Hunter Job 234 for (Leveling Hero)) Equal to 1
      • (Level of Immolation Demon Hunter Job 234 for (Leveling Hero)) Equal to 1
      • (Level of Evasion Demon Hunter Job 234 for (Leveling Hero)) Equal to 1
      • (Level of Life Drain Demon Hunter Job 234 for (Leveling Hero)) Equal to 1
    • Actions
      • Unit - Set level of Mana Burn Demon Hunter Job 234 for (Leveling Hero) to 3
      • Unit - Set level of Immolation Demon Hunter Job 234 for (Leveling Hero) to 3
      • Unit - Set level of Evasion Demon Hunter Job 234 for (Leveling Hero) to 3
      • Unit - Set level of Life Drain Demon Hunter Job 234 for (Leveling Hero) to 3
      • Custom script: call UnitMakeAbilityPermanent(E008, true,A0CP)
      • Custom script: call UnitMakeAbilityPermanent(E008, true,A0D5)
      • Custom script: call UnitMakeAbilityPermanent(E008, true,A0DE)
      • Custom script: call UnitMakeAbilityPermanent(E008, true,A0DG)
Or i have to put the unit as a variable? I have it saved as
  • Set VariableSet Hero[(Player number of (Triggering player))] = (Last created unit)
How would this look as jass?
 
Level 20
Joined
Feb 27, 2019
Messages
616
Its a bug. The same issue here: Spellbook Issues! [Solved]
I also found that instead of removing the spellbook, the abilities can be restored by increasing and decreasing the level of the ability. It works even if the ability only has 1 level.
JASS:
call UnitMakeAbilityPermanent(unit, true, ability)
The function is used to make abilities permanent that were added to units via triggers, not for abilities already on a unit by default.
As you can see the function has three arguments (unit, true (boolean), ability) so youre on kinda the right track. Heres about how it can be structured:
call UnitMakeAbilityPermanent(udg_Hero[...], true, 'A0CP')
  • Set VariableSet Hero[(Player number of (Triggering player))] = (Last created unit)
To turn this into jass: Create a new trigger, copy the action unto the trigger, select the new trigger, within the Trigger Editor press Edit and press Convert To Custom Text.
 
Level 10
Joined
Dec 16, 2017
Messages
373
Its a bug. The same issue here: Spellbook Issues! [Solved]
I also found that instead of removing the spellbook, the abilities can be restored by increasing and decreasing the level of the ability. It works even if the ability only has 1 level.
JASS:
call UnitMakeAbilityPermanent(unit, true, ability)
The function is used to make abilities permanent that were added to units via triggers, not for abilities already on a unit by default.
As you can see the function has three arguments (unit, true (boolean), ability) so youre on kinda the right track. Heres about how it can be structured:
call UnitMakeAbilityPermanent(udg_Hero[...], true, 'A0CP')
  • Set VariableSet Hero[(Player number of (Triggering player))] = (Last created unit)
To turn this into jass: Create a new trigger, copy the action unto the trigger, select the new trigger, within the Trigger Editor press Edit and press Convert To Custom Text.
I don't have that option for it
 
Level 10
Joined
Dec 16, 2017
Messages
373
  • Demon Hunter Spellbook Increase Job 4 Copy
    • Events
      • Game - Button for ability Metamorphosis Demon Hunter Job 4 and order Night Elf Demon Hunter - Metamorphosis pressed.
    • Conditions
      • (Hero level of (Triggering unit)) Greater than or equal to 1
      • (Level of Mana Burn Demon Hunter Job 234 for (Triggering unit)) Equal to 1
      • (Level of Immolation Demon Hunter Job 234 for (Triggering unit)) Equal to 1
      • (Level of Evasion Demon Hunter Job 234 for (Triggering unit)) Equal to 1
      • (Level of Life Drain Demon Hunter Job 234 for (Triggering unit)) Equal to 1
    • Actions
      • Set VariableSet TestUnit = (Triggering unit)
      • Unit - Set level of Mana Burn Demon Hunter Job 234 for (Triggering unit) to 3
      • Custom script: call UnitMakeAbilityPermanent(udg_TestUnit, true,'A0CP')
      • Unit - Set level of Immolation Demon Hunter Job 234 for (Triggering unit) to 3
      • Custom script: call UnitMakeAbilityPermanent(udg_TestUnit, true,'A0D5')
      • Unit - Set level of Evasion Demon Hunter Job 234 for (Triggering unit) to 3
      • Custom script: call UnitMakeAbilityPermanent(udg_TestUnit, true,'A0DE')
      • Unit - Set level of Life Drain Demon Hunter Job 234 for (Triggering unit) to 3
      • Custom script: call UnitMakeAbilityPermanent(udg_TestUnit, true,'A0DG')
So i managed to make it this way and they remain, i have them by default in the spellbook, and they still save, they don't have to be custom added with triggers.

But, if i use this variable of TEstUnit, would it work if there are like 2+ demon hunters in the game and they cast the metamorphosis?
I mean, even if they would overlap, i don't think it's a bad situation, they will still increase and keep their spells.
 

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,703
But, if i use this variable of TEstUnit, would it work if there are like 2+ demon hunters in the game and they cast the metamorphosis?
I mean, even if they would overlap, i don't think it's a bad situation, they will still increase and keep their spells.
You're making the ability permanent for the given unit.

I know Jass may seem like a mystery at first but it's really just the same old GUI stuff you're used to:
  • Unit - Make (Some ability) permanent for (Triggering unit)
 
Level 10
Joined
Dec 16, 2017
Messages
373
You're making the ability permanent for the given unit.

I know Jass may seem like a mystery at first but it's really just the same old GUI stuff you're used to:
  • Unit - Make (Some ability) permanent for (Triggering unit)
Haha, hi there
Is this just a custom made by you, or GUI has this function aswell? xD
Yeah, i made it with jass, i was a little worried about the TestUnit variable, because the same hero can be in the map multiple times, not just one time, so if they might cast 2 metamorphosis at the same time, to not bug their spellbook when it finishes :D
 
Level 20
Joined
Feb 27, 2019
Messages
616
So i managed to make it this way and they remain, i have them by default in the spellbook, and they still save, they don't have to be custom added with triggers.
Oh, the spells in the spell book are made permanent. I was thinking about it the wrong way around.
  • Game - Button for ability Metamorphosis Demon Hunter Job 4 and order Night Elf Demon Hunter - Metamorphosis pressed.
Doesnt this still trigger if the unit is stunned and so on? Or its just for testing?
 

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,703
Haha, hi there
Is this just a custom made by you, or GUI has this function aswell? xD
Yeah, i made it with jass, i was a little worried about the TestUnit variable, because the same hero can be in the map multiple times, not just one time, so if they might cast 2 metamorphosis at the same time, to not bug their spellbook when it finishes :D
The same trigger can't happen "at the same time", minus some rare cases that you probably shouldn't worry about and even then it's not the same trigger.

What you're doing is a one-time thing that happens in the same game frame, it's not some prolonged effect that needs to continuously track the unit.

And no, that was a made up function, but my point was that it would look something like that if it was in GUI.
 
Last edited:
Level 10
Joined
Dec 16, 2017
Messages
373
Oh, the spells in the spell book are made permanent. I was thinking about it the wrong way around.
  • Game - Button for ability Metamorphosis Demon Hunter Job 4 and order Night Elf Demon Hunter - Metamorphosis pressed.
Doesnt this still trigger if the unit is stunned and so on? Or its just for testing?
Well, the tag for metamorphosis is "Uninterruptable" so, no stun or anything else can make it not happen, it's not a channeling

The same trigger can't happen "at the same time", minus some rare cases that you probably shouldn't worry about and even then it's not the same trigger.

What you're doing is a one-time thing that happens in the same game frame, it's not some prolonged effect that needs to continuously track the unit.

And no, that was a made up function, but my point is that it would look something like that if it was in GUI>
Ah yea :D
Thank you guys for helping out!
 
Top