• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Buying ablilities

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,259
Well its simple, appon the purchasing of an item (event)

You run your data base system to get from an item type (integer), an ability ID (integer) which you then add to the buying unit (appears as the correct spell).

You can make such a system even with 1 global integer array and a loop comparision system. Although not the most efficent, is is by far the quickest to set up and since you buy the abilites not very often, it should not really cause any lag at all and ultimatly acts like a database system does outside of games (only less efficent).
 
Level 6
Joined
Dec 13, 2007
Messages
213
ok do this, make a trigger that goes a little like this: make ur ability EX. fire ball
make an item called "fire ball ability" it wont do anything when you buy it by the way. make an item shop sell it

Event:
Specific unit event-when (Item shop) sells an item(from shop)
Condition:
Item type comparison-(item type of (sold item)) equal to fire ball ability
Action:
Unit-Add (fireball) to triggering unit.

would that work?
 
Level 4
Joined
Dec 6, 2007
Messages
78
Grade A Kill's is good. Except this is the one I usually use. It's also a bit easier. Make a dummy item, like for example, Potion of Healing. Change its name, tooltip, price, and icon to the ones you'd want for the ability. Then just add the dummy item to the unit you want to have selling the ability. Then you make the trigger. It should look something like...

Events:
Unit - A unit Acquires an item
Conditions:
(Item-type of (Item being manipulated)) Equal to Learn Fireball
Actions:
Item - Remove (Item being manipulated) (This one is important if you don't want the dummy item to stay in your inventory after purchasing)
Unit - Add Fireball to (Hero manipulating item) If you don't want it to be a hero, then just do
Unit - Add Fireball to (Triggering unit)

You can also use the Conditions to limit the units that the trigger applies to. Like for example, only units owned by allies of player 1 red, etc.
 
Status
Not open for further replies.
Top