Snippet A simple way to purchase abilities - WoW style

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.

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!
 

Attachments

  • Purchasing Abilities - Wow Style.w3x
    12.3 KB · Views: 205

duderock101

Check out my 2 Player Co-op RPG!
Reaction score
71
that is a completly different way, and at least i have a trigger on the forum you havn't even tested the map
 

kvasir

New Member
Reaction score
2
THX Duderock, that was very helpful
I preferred your tut to Andrewgosu's as it's shorter and isn't such a hassle.

BTW I found your professions tut very useful too - and bearing it in mind as inspiration I managed to work out how to create other professions like Herbalism, skinning, Engineering, etc.
 

duderock101

Check out my 2 Player Co-op RPG!
Reaction score
71
thanks for that comment! I wwas going to do engernering but never got around to it... hmm well thanks again for your comment, being compared to someone great is excellent but saying it's better is awsom (how ever you spell it...) :thup:


---- WOO 666 post!!!! go satan!!!! ----
 

UndeadDragon

Super Moderator
Reaction score
447
I can already see this is helping people. Good Job :thup:
 

dzen_n00b

New Member
Reaction score
0
Hi

I saw something strange in maps with "buy tome" function
When you buy tome a very very small thing is placed near the shop:



The consequence of that is the map soon begins to lag depending on number of "things"

:confused::confused::confused:
 

duderock101

Check out my 2 Player Co-op RPG!
Reaction score
71
humm... i've heard about that happening, perhaps try and add a remove item trigger... i will look into it and will update when i have found out, try finding the solution as well... If you find it +Rep!


EDIT - Found out the problem and i am editing the first post!
 

dzen_n00b

New Member
Reaction score
0
Well I think another good approach is to make that if someone is close to the shop a menu will popup. Using a FSGUI this must be nice feature to rpg maps :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top