How to learn custom skill?

Sayiain

You can change this now in User CP.
Reaction score
0
I want to make for example 5 spells.
I want each of them to have 5 levels.
I want them to be bought is a shop each level for 2 times more than the previous one starting from gold.
How to make it?

An example with 1 spell would be enough.
Please help!
 

Furby

Current occupation: News poster
Reaction score
144
You adjust the player's money after buying the actual spell.

You make real cost of the spell 0. And write how much each level costs to a tooltip. When player buys spell you check if he has enough money if not, show error message.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
make your spells, for this well just call them spell 1 2 3 4 and 5, and make an item out of a rune base, remove all of its abilities and make a trigger like this

Trigger:
  • Events
    • A unit purchases an item
    • Conditions
      • Item type of item being manipulated is item 1
    • Actions
      • If then else
        • If
          • Ability_1 = true (boolean variable)
          • Level of spell 1 for triggering unit is less than 5
        • Then
          • Unit - increase level of spell 1 for triggering unit
        • Else
          • If then else
            • Ability_1 = false
          • Then
            • Unit - add spell 1 to triggering unit
          • Else
            • Player - set owner of triggering unit (gold or lumber) equal to gold of owner of triggering unit + cost of spell)
            • Game Text - create game text for owner of triggering unit that reads You have maxxed out this spell. for (however long you want this displayed)


now the purchase price is different, thats harder to trigger

with that you can start it the same way, but put all of the actions in an if then else action like so

Trigger:
  • events
    • conditions
    • actions
      • if then else
        • if
          • level of spell 1 for triggering unit is less than 5 (integer comparison)
          • gold of owner of triggering unit greater than (your spell cost x [2^level of spell 1 for triggering unit]) (real or integer comparison i forget)
        • then
          • Player - set gold of owner of triggering unit equal to gold of owner of triggering unit - (your spell cost x [2^level of spell 1 for triggering unit])
          • HERE <---------------- is where you insert the actions from the first trigger
        • Else
          • if then else
            • if
              • Unit has spell 1 is equal to true (boolean)
            • then
              • Game Text - create game text for owner of triggering unit that reads You have maxxed out this spell. for (however long you want this displayed)
            • else
              • Game Text - create game text for owner of triggering unit that reads Sorry, you dont have the gold required to purchase this ability. for (however long you want this displayed)
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
lol i did that freehand on my lunch break at work :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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