• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Who to add new skills?

bomba

Member
Joined
Feb 26, 2008
Messages
635
Reaction score
7
Location
Brazil
Is it possible? create new "skills" using "storage"?
Example: "Minning Skill", I can increase my "minning skill" for level 2 speaking with the NPC.
I would like to see an example of "skill" made in LUA. For I see my "new skills" I needed a book.

Please, someone show me some example!

Code:
local SKILL_MINNING = storage(?)
getPlayerSkill(cid, SKILL_MINNING)
doPlayerAddSkillTry(cid, SKILL_MINNING, 1)
 
LUA:
if getPlayerStorageValue(cid, 5002) < 1 then
setPlayerStorageValue(cid, 5002, 20)
end

level = getPlayerStorageValue(cid, 5000)
tries = getPlayerStorageValue(cid, 5001)

if item.actionid == 1000 then
setPlayerStorageValue(cid, 5001, tries + 1)
if neededTries - tries <= 0 then
setPlayerStorageValue(cid, 5000, 2) --Level up~
setPlayerStorageValue(cid, 5002, getPlayerStorageValue(cid, 5002)*2)
end
end

Wasn't really motivated by your post, so didn't bother improving it. This is the basic atleast. ZzzZZZZz, good night :p
 
I can use:
...or no?
SKILL_MINNING = getPlayerStorageValue(cid, 5000)
Code:
if SKILL_MINNING == 1 then
local limitRandom = 5
local random = math.random(1, limitRandom)
if random == limitRandom then
doPlayerAddItem(cid, XXX)
--You advanced in minning skill.
end
return TRUE
end

Code:
if SKILL_MINNING == 2 then
local limitRandom = 3
local random = math.random(1, limitRandom)
if random == limitRandom then
doPlayerAddItem(cid, XXX)
--You advanced in minning skill.
end
return TRUE
end

Code:
if SKILL_MINNING == 3 then
doPlayerAddItem(cid, XXX)
--You advanced in minning skill.
end
return TRUE
end
give-me some examples please
 
Last edited:
Code:
function getPlayerMiningSkill(cid)
	local skill = getPlayerStorageValue(cid, xxxx)
	return skill
end

Code:
function doPlayerAddMiningSkill(cid, add)
	local skill = getPlayerStorageValue(cid, xxxx)
	skill = skill + add
	setPlayerStorageValue(cid, xxx, skill)
	return TRUE
end
 
Back
Top