• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Spell] Changing spells in Bear-form but keeping their cooldowns

Status
Not open for further replies.
Level 8
Joined
Feb 17, 2018
Messages
114
Hi. I have read several threads considering this topic but haven't find a solution yet (or just me being me and couldn't get thigs right). Now I'll try to make clear what I mean. So I want hero to have one set of spells in elf-form and another one in bear-form and they should have separated cooldowns. Engeneering Upgrade causes lots of bugs like complete spells removals. These are triggers I have so far (for 1 spell in two forms, spells are based of different spells):

  • Learn
    • Events
      • Unit - A unit learns skill
    • Conditions
      • (Learned Hero Skill) equals dummy hero's skill thath show no icon
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • if - conditions
          • (Level of bear form indicator skill that only bear-form has for (Triggering unit)) equals to 1
        • Then - Action
          • Unit - Add bear-form needed spell which is actually a unit's spell not hero's to (Triggering unit)
          • Unit - Set level of bear-form needed spell which is actually a unit's spell not hero's for (Triggering unit) to (Level of dummy hero's skill thath show no icon) for (Triggering unit))
        • Else - Action
          • Unit - Add elf-form needed spell which is actually a unit's spell not hero's to (Triggering unit)
          • Unit - Set level of elf-form needed spell which is actually a unit's spell not hero's for
  • Morph
    • Events
      • Unit - A finishes casting the spell
    • Conditions
      • (Ability being cast) equals bear-form
      • (Level of dummy hero's skill thath show no icon) for (Triggering unit)) equals 1
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • if - Condition
          • (Level of bear form indicator skill that only bear-form has for (Triggering unit)) equals 1
        • Then - Action
          • Unit - Add bear-form needed spell which is actually a unit's spell not hero's to (Triggering unit)
          • Unit - Set level of bear-form needed spell which is actually a unit's spell not hero's for (Triggering unit) to (Level of dummy hero's skill thath show no icon) for (Triggering unit))
        • Else - Action
          • Unit - Add elf-form needed spell which is actually a unit's spell not hero's to (Triggering unit)
          • Unit - Set level of elf-form needed spell which is actually a unit's spell not hero's for (Triggering unit) to (Level of dummy hero's skill thath show no icon) for (Triggering unit))
I think these are pretty self-explanatory. looking for solution to make it work properly. Thanks in advance!
 
Level 8
Joined
Feb 17, 2018
Messages
114
JASS:
native UnitMakeAbilityPermanent     takes unit whichUnit, boolean permanent, integer abilityId returns boolean
Use that after adding the skill the first time, then it is kept over morphing.
  • Custom script: call UnitMakeAbilityPermanent(GetTriggerUnit(), true, udg_Spell)
Thanks for a quick response! But I have an error like missing endif. It seems like i need to replace udg_Spell with something else, what exactly?
 
The skill you want to take over. either you set an variable and use it or you look in object Editor change to raw data view and write the raw code example: 'A000' the ' are important instead. But wait I reRead your first post. You also need to hide the abilities I think.

  • Init
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Set Spell = Impale
      • Custom script: call UnitMakeAbilityPermanent(GetTriggerUnit(), true, udg_Spell)
 
Level 8
Joined
Feb 17, 2018
Messages
114
The skill you want to take over. either you set an variable and use it or you look in object Editor change to raw data view and write the raw code example: 'A000' the ' are important instead. But wait I reRead your first post. You also need to hide the abilities I think.

  • Init
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Set Spell = Impale
      • Custom script: call UnitMakeAbilityPermanent(GetTriggerUnit(), true, udg_Spell)
It says missing code's operator (manual translate)
 
Level 8
Joined
Feb 17, 2018
Messages
114
you need to create variable Spell

I did before saying that, I made the exact same trigger
  • fru
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) equals my unit
    • Actions
      • Set Spell = one of my spells
      • Custom script: Custom script: call UnitMakeAbilityPermanent(GetTriggerUnit(), true, udg_Spell)
 
yeah since 1.29 once can hide/disable abilities unit specific.
  • Unit - For (Triggering unit), Ability Impale, Hide ability: True
But it can be a bit tricky one has to make sure one does not hiden/unhide to often.
Else the opposite won't work cause it is counter based, it seems.

maybe also the x = 0 , y = -11 thing works, never tested, but no that would be global.
 
Last edited:
Level 8
Joined
Feb 17, 2018
Messages
114
Thanks once again, you really helped me out a lot! But considering my friends (map-testers) are greedy tomatoes and don't want to buy wc3 so we have o stick unoffcial 1.27a version I'll stick to disabling for now keeping 1.29 feature in mind.
 
Status
Not open for further replies.
Top