• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

A EXP store!

Ragna Story

New Member
Joined
Nov 27, 2014
Messages
17
Reaction score
1
So, I wan`t to make on my server a store, that uses exp to buy upgrades.
Something like a real RPG, where in Tibia case, you can buy like skills with exp points.
And if its possible, make a image of the skill when you select it to buy, also have a skill limit. Like you can`t go more than that.
 
So, I wan`t to make on my server a store, that uses exp to buy upgrades.
Something like a real RPG, where in Tibia case, you can buy like skills with exp points.
And if its possible, make a image of the skill when you select it to buy, also have a skill limit. Like you can`t go more than that.
We need to know more tho. Which kind of upgrades? How many times can the player buy the upgrades etc
 
Like I said, buy skills, cap, health, mana, spells.
I know how to make a simple "talk" store that do this, but I didn`t know how to make the real Store, like with list and all.
And also, you will need a vocation requirement to use the store.
Thanks
 
Didn't read wether you posted your tfs or not. This one is based on 0.3.6+
Probably not the best possible way to do this but it'll work i suppose, you need to add your skills n such yourself tho.
Code:
local limit = 50 -- Skill limit
local remove = 100 -- Exp to remove on use
local amount = 100 -- Checks if the player has enough experience to even remove 100
local storage = 1000 -- Storage for limit check
local message = "You have bought something I suppose"

function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerExperience(cid) >= amount and getPlayerStorageValue(cid, storage) < limit then
doPlayerAddExperience(cid, -remove)
doCreatureSay(cid, message, 19)
doPlayerSetStorageValue(cid, storage, storage == -1 and 1 or getPlayerStorageValue(cid, storage) + 1)
doSendMagicEffect(getPlayerPosition(cid), 13)
-- Add your script here

elseif getPlayerExperience(cid) >= amount and getPlayerStorageValue(cid, storage) >= limit then
doCreatureSay(cid, "You cant buy anymore of this skill!", 19)
else
doCreatureSay(cid, "Are you sure you have the correct requirements for this?", 19)
end
return true
end
 
No problem, if you havent already added it. Which vocation do you want it to be required to use it?

@Edit @Ragna Story updated with vocation required to use it.
If it returns an error, remove a "end" above return true
Code:
local limit = 50 -- Skill limit
local remove = 100 -- Exp to remove on use
local amount = 100 -- Checks if the player has enough experience to even remove 100
local storage = 1000 -- Storage for limit check
local message = "You have bought something I suppose"
local vocation = getPlayerVocation(cid) -- vocation returns a function
local id = 1, 2, 3, 4 -- Vocation ids in order to use the lever

function onUse(cid, item, fromPosition, itemEx, toPosition)
if(isInArray({id}, vocation)) then
if getPlayerExperience(cid) >= amount and getPlayerStorageValue(cid, storage) < limit then
doPlayerAddExperience(cid, -remove)
doCreatureSay(cid, message, 19)
doPlayerSetStorageValue(cid, storage, storage == -1 and 1 or getPlayerStorageValue(cid, storage) + 1)
doSendMagicEffect(getPlayerPosition(cid), 13)
-- Add your script here

elseif getPlayerExperience(cid) >= amount and getPlayerStorageValue(cid, storage) >= limit then
doCreatureSay(cid, "You cant buy anymore of this skill!", 19)
else
doCreatureSay(cid, "Are you sure you have the correct requirements for this?", 19)
end
end
return true
end
 
Last edited:
Back
Top