duderock101
Check out my 2 Player Co-op RPG!
- Reaction score
- 71
Purchasing Abilities - WoW Style
First we just copy and paste any Itemand delete all it's abilities. Then it's up to you what you set the gold cost and text but for this snippet we shall be creating a purchase trigger for buying Storm Bolt (the one with 3 levels).
Createds the item? Good! Now here is the one simple trigger.
There are comments on it for basic help but i will go deeper into the trigger for you starters. First we have the event -
Starts when a unit purchases an item from a shop
Conditions -
Checks whether or not the unit is hero (can be changed if you want to give a unit a unit ability)
I called the custom tome Storm Bolt so don't get confused, just put your custom tome here to determine whether the unit is purchasing that specific item.
Actions -
Firstly we remove the item that you have purchased
Secondly we see if the unit has learnt storm bolt before, if it hasn't we add it to the unit and give it a nice bit of text saying it's learnt it.
If it has learnt it we then go and check whether the ability (Storm Bolt) is level 3 (the defult max level of the ability). If you have a custom abilitiy with 5 levels then change the amount to 5. If the ability is level 3 then it won't have any effect, expect a text saying it's reached the highest level.
BUT if it hasn't it will set the level of the Storm Bolt + 1 to what the purchasing unit already has and will display a text for the what the ability level is now at.
Remember to keep the last bit of text after the action that raises the level of the ability up or it won't recognise it's gone up a level.
This is Duderock101's snippet of the day, I hope i helped some people out with this simple thing, heres a small map for you to download.
Please give feedback + bugs but i shouldn't think there are any because i have tested!
DO NOT USE TOMES, A SMALL GOLD MARK WILL BE LEFT IF YOU USE TOMES, IT DOSN'T MATTER WHAT ITEM YOU USE BUT IT CANNOT BE TOMES
Change Log
First we just copy and paste any Itemand delete all it's abilities. Then it's up to you what you set the gold cost and text but for this snippet we shall be creating a purchase trigger for buying Storm Bolt (the one with 3 levels).
Createds the item? Good! Now here is the one simple trigger.
Code:
Storm Bolt
Events
Unit - A unit Sells an item (from shop)
Conditions
(Item-type of (Sold Item)) Equal to (==) Storm Bolt
((Buying unit) is A Hero) Equal to (==) True
Actions
Item - Remove (Sold Item)
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Storm Bolt for (Buying unit)) Equal to (==) 0
Then - Actions
-------- First it finds out if the unit has acutally learnt Storm Bolt --------
Game - Display to (All players) for 5.00 seconds the text: |cFFFF0000You learn...
Unit - Add Storm Bolt to (Buying unit)
Else - Actions
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Storm Bolt for (Buying unit)) Equal to (==) 3
Then - Actions
-------- If it has learnt it, it will then see if Storm Bolt is level 3, if so it will not allow it to be raised as thats it's max level --------
Game - Display to (All players) for 5.00 seconds the text: |cFFFF0000You canno...
Else - Actions
-------- You must set the level of storm bolt before displaying text, or the text will say its one level lower than it should be --------
Unit - Set level of Storm Bolt for (Buying unit) to ((Level of Storm Bolt for (Buying unit)) + 1)
Game - Display to (All players) for 5.00 seconds the text: (|cFFFF0000Storm Bolt is now level|r + (String((Level of Storm Bolt for (Buying unit)))))
There are comments on it for basic help but i will go deeper into the trigger for you starters. First we have the event -
Starts when a unit purchases an item from a shop
Conditions -
Checks whether or not the unit is hero (can be changed if you want to give a unit a unit ability)
I called the custom tome Storm Bolt so don't get confused, just put your custom tome here to determine whether the unit is purchasing that specific item.
Actions -
Firstly we remove the item that you have purchased
Secondly we see if the unit has learnt storm bolt before, if it hasn't we add it to the unit and give it a nice bit of text saying it's learnt it.
If it has learnt it we then go and check whether the ability (Storm Bolt) is level 3 (the defult max level of the ability). If you have a custom abilitiy with 5 levels then change the amount to 5. If the ability is level 3 then it won't have any effect, expect a text saying it's reached the highest level.
BUT if it hasn't it will set the level of the Storm Bolt + 1 to what the purchasing unit already has and will display a text for the what the ability level is now at.
Remember to keep the last bit of text after the action that raises the level of the ability up or it won't recognise it's gone up a level.
This is Duderock101's snippet of the day, I hope i helped some people out with this simple thing, heres a small map for you to download.
Please give feedback + bugs but i shouldn't think there are any because i have tested!
DO NOT USE TOMES, A SMALL GOLD MARK WILL BE LEFT IF YOU USE TOMES, IT DOSN'T MATTER WHAT ITEM YOU USE BUT IT CANNOT BE TOMES
Change Log
V0.1 - Created it, triggers and everything
V1 - Removed a major bug with tomes, updated post and updated map, no bugs now!
V1 - Removed a major bug with tomes, updated post and updated map, no bugs now!