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: 208

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.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top