• 🏆 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!

Add a Hero-Spell in the skillmenu with a trigger

Status
Not open for further replies.
Level 2
Joined
Jan 25, 2011
Messages
25
Hey guys

I want to add a herospell in the skillmenu of a hero with a trigger. Not over the maximum of 5.

Its not possible with GUI orders is there a way in Jass or Costumescript.

Thanks for Helping
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Custom script is JASS.
And it's possible in GUI as well.

Add all abilities to the hero.

Then add this trigger:
  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Disable Ability 1 for (Picked player)
          • Player - Disable Ability 2 for (Picked player)
          • Player - Disable Ability 3 for (Picked player)
          • // ... do this for all your abilities
When the hero 'gains' a spell, simply enable it again.
  • Player - Enable Ability for Player

There may be other methods as well...
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
pardon, but I think he meant this???...

JASS:
call UnitAddAbility(udg_hero, 'Aloc') //this adds locust ability to your hero (hero is a unit variable)
How would adding the ability Locust to the hero solve his problem? :/
Either I am missing something, or I have absolutely no idea how you could even misinterpret the first post like that.

He wants to be able to add hero abilities (because UnitAddAbility doesn't add abilities which can level).
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
no, Im just explaining how to add an ability to a unit/hero, not the 'locust' thing...

and yes UnitAddAbility cant level but I know that you know that it can be leveled up by SetUnitAbilityLevel...
Well, he wants a hero skill, not a unit skill that can be leveled.

Although you can create a spellbook with dummy abilities that look like they're leveling the abilities, while triggers are doing it (that's another option).
 
Status
Not open for further replies.
Top