HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trigger spells

03-08-2004, 10:24 PM#1
Nieffed
I'm trying to make a book that teaches you a hero ability. I'm pretty sure that its with triggers, how do u do this? heres what i have

Events-A unit aquires an item
Conditions-item blahblah is equal to blahblah
Actions-blah learns my custom ability

Plz help! This is essential to my campaign! :o
03-08-2004, 10:45 PM#2
Maxxthepenguin
Sorry, but you cant learn hero abilities through triggers
03-08-2004, 11:12 PM#3
ThyFlame
Are you quite sure? I remember there being a way to do it... Spellbook perhaps.
03-09-2004, 01:38 PM#4
Kamux
You can use unit-add abillity or hero-learn abillity. Or use upgrades to set the level of abillities.
03-09-2004, 01:50 PM#5
RaeVanMorlock
You can't add abilities to a hero's ability menu; however, you can increase the level of an ability with a custom upgrade and you can add an ability (at level 1) to a hero.
03-09-2004, 02:16 PM#6
Kamux
Yes, when the unit aquiers an item, give it the abillity you want and then use custom upgrades to set the level of the abillity for the unit.

You can also make a verion for each level you want it to have and then give the right level abillity to the unit.
03-09-2004, 02:57 PM#7
BattleBotv8.2
Event:
Generic
Unit Aquires an Item or Uses an item (What ever you want).

Condtiction:
Interger Comparisen:
(Level of XAbility Equal for Hero Manipulating Item) Equal to X

Item-Type comparisen:
(Item-type of item being manipulated) Equal to X

Action:
Unit - Remove Ability
Remove Hero Skill from XUnit

Unit - Add Ability
Add Hero Skill to XUnit
03-09-2004, 06:11 PM#8
RaeVanMorlock
Define:
- Firebolt is an ability
- Firebolt is an upgrade that increases the level of Firebolt
- Book of Firebolt is an item that, when used, will teach the user how to use the Firebolt spell (and subsequent uses will increase the level of the spell).

Assume:
- If a player controls more than one hero, none of them will have overlapping abilities (each hero in the game must have unique abilities).
- A hero may not "unlearn" an ability (may be able to remove it, but relearning it would retain the current level.)
- Book of Firebolt is a charged item

Code:
Event:
  A unit uses an item
Condition:
  Item-type of (Item being manipulated) is equal to (Book of Firebolt)
Actions:
  If Conditions then Then-Actions else Else-Actions
    Conditions:
     (Level of Firebolt for (Hero manipulating item) is equal to 0) Then
    Then - Actions:
      Add ability Firebolt to Hero manipulating item
    Else - Actions:
      Add 1 to  FireboltUpgrade for (Owner of (Hero manipulating item))



Update:

Alternately, if your goal was to replace the traditional "Ability Point" system with acquiring items, you could do this..

Code:
No Ability Points
  Events:
    A unit gains a level
  Conditions:
  Actions:
    Modify unspent skill points of (Leveling Hero): Set 0 points

Learn Firebolt
  Events:
    A unit uses an item
  Conditions:
    Unit-type of (Item being manipulated) Equal to (Book of Firebolt)
  Actions:
    Modify unspent skill points of (Hero manipulating item): Set 1 points
    Learn skill for (Hero manipulating item): Firebolt
03-09-2004, 09:26 PM#9
Nieffed
OK. what if im using a custom item such as "Learn Starfall"?wat should be the item manipulated in comparrison to the other?