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

[Trigger] Aquiring abilities through spellbook

Status
Not open for further replies.
Level 3
Joined
Mar 7, 2010
Messages
16
I'm trying to have a hero have a spell book as one of his abilities, in the spellbook are a set of abilities that when pressed, remove the spell book and replace it with the chosen abilities
this is my trigger:

  • Untitled Trigger 001
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Shotgun Slugs (Dummy)
        • Then - Actions
          • Unit - Remove Invulnerable buff from (Triggering unit)
          • Unit - Add Shotgun Slugs to (Triggering unit)
          • Unit - Set level of Shotgun Slugs for (Triggering unit) to 1
          • Unit - Remove Gun Enchancements from (Triggering unit)
        • Else - Actions
          • Do nothing
The result is that the selected ability appears and the spellbook dissapears, however, in the Hero Abilities windows, the spell book remains and the selected ability is not. What would be the solution?
 
Level 12
Joined
Aug 22, 2008
Messages
911
I think the abilities adding applies only to the abilities stated in the object editor.
But I have an idea that could help!
1. If we're talking about an ability that doesn't have to be MUI you could add this action to your posted trigger:
  • Set ability = Shotgun Slugs
If not, we're talking hashtables:
  • Hashtable - Save Shotgun Slugs as 0 of Key(Triggering Unit) in hashtable
2. We're going to make a trigger that adds a level to the ability instead of adding to the spellbook, so that after casting the dummy ability when the hero upgrades his spellbook ability what he will ACTUALLY do is upgrade the Shotgun Slugs:
  • Add to Ability
    • Events
      • Unit - A unit learns an ability
      • OR
      • Unit - A unit adds to an ability
    • Conditions
      • Ability equal to Spellbook
    • Actions
      • Unit - Remove Spellbook from (Triggering Unit)
      • Unit - Set level of ability for (Triggering Unit) to ((Level of ability for (Triggering Unit)) + 1)
 
Level 9
Joined
Jun 25, 2009
Messages
427
I'm trying to have a hero have a spell book as one of his abilities, in the spellbook are a set of abilities that when pressed, remove the spell book and replace it with the chosen abilities
this is my trigger:

  • Untitled Trigger 001
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Shotgun Slugs (Dummy)
        • Then - Actions
          • Unit - Remove Invulnerable buff from (Triggering unit)
          • Unit - Add Shotgun Slugs to (Triggering unit)
          • Unit - Set level of Shotgun Slugs for (Triggering unit) to 1
          • Unit - Remove Gun Enchancements from (Triggering unit)
        • Else - Actions
          • Do nothing
The result is that the selected ability appears and the spellbook dissapears, however, in the Hero Abilities windows, the spell book remains and the selected ability is not. What would be the solution?

Idodik's idea should be the answer, but anyway, just to remind to all of you people, DON'T USE
  • Do nothing
Tiche3:grin:
 
Status
Not open for further replies.
Top