• 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!

Looking for Skill Doll script.

DukeeH

Active Member
Joined
Dec 6, 2010
Messages
550
Solutions
3
Reaction score
39
Hello, I had a skill doll script that i've used a few years ago, I made a post on support because it wasn't working as it should, some players got skill 300+ somehow because instead of adding 3 skills it was adding something based on player actual skill or related to vocation.

Support thread: https://otland.net/threads/2-scripts-fix.242638/ (first script)

So what I need to request, is a fix, or someone to make a new one (if easier) a talkaction that you say !skill skillname and you get 3 levels of that skill, but also be possible tu use parameter magic to get 3 magic levels.
The other part would be a storage that allow the max of 3 dolls per player (I can do this part) I'm only having problem with adding skills and magiclevels correctly.

EDIT: TFS 0.4

Thanks Otland.
 
Last edited:
Could you post the skill doll script that you used previously? Also, did the players get 300 skills added or did they manage to surpass it?
 
Could you post the skill doll script that you used previously? Also, did the players get 300 skills added or did they manage to surpass it?
Code:
function onSay(cid, words, param)
local Skillsy = { ["fist"]={SKILL_FIST}, ["club"]={SKILL_CLUB}, ["sword"]={SKILL_SWORD}, ["axe"]={SKILL_AXE}, ["distance"]={SKILL_DISTANCE}, ["shield"]={SKILL_SHIELD}, ["fishing"]={SKILL_FISHING}, ["magic"]={SKILL__MAGLEVEL} }
local msg = {"Escolha um skill (!skill nome), Opções de skill: fist, club, sword, axe, distance, shield, fishing, magic!", "Seus skills foram adicionados!", "Precisa de uma skill doll, visite nosso shop!", "Você só pode usar 3 skill dolls por character!"}
local param = string.lower(param)
local storage = 490289 -- storageID to use.


if(param ~= "" and Skillsy[param]) then
if(getPlayerItemCount(cid, 165) > 0) then
if getPlayerStorageValue(cid, storage) < 2 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[2])
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
doPlayerAddSkill(cid, Skillsy[param][1], 8)
doPlayerRemoveItem(cid, 165, 1)
setPlayerStorageValue(cid, storage, (getPlayerStorageValue(cid, storage)+1))
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[4])
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[3])
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[1])
end
return true
end
Somehow it was adding more skills for a player and less for others... Based on how many skills player already had,
 
tabbed.
Code:
function onSay(cid, words, param)
    local Skillsy = { ["fist"]={SKILL_FIST}, ["club"]={SKILL_CLUB}, ["sword"]={SKILL_SWORD}, ["axe"]={SKILL_AXE}, ["distance"]={SKILL_DISTANCE}, ["shield"]={SKILL_SHIELD}, ["fishing"]={SKILL_FISHING}, ["magic"]={SKILL__MAGLEVEL} }
    local msg = {"Escolha um skill (!skill nome), Opções de skill: fist, club, sword, axe, distance, shield, fishing, magic!", "Seus skills foram adicionados!", "Precisa de uma skill doll, visite nosso shop!", "Você só pode usar 3 skill dolls por character!"}
    local param = string.lower(param)
    local storage = 490289 -- storageID to use.


    if(param ~= "" and Skillsy[param]) then
        if(getPlayerItemCount(cid, 165) > 0) then
            if getPlayerStorageValue(cid, storage) < 2 then
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[2])
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
                doPlayerAddSkill(cid, Skillsy[param][1], 8)
                doPlayerRemoveItem(cid, 165, 1)
                setPlayerStorageValue(cid, storage, (getPlayerStorageValue(cid, storage)+1))
            else
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[4])
            end
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[3])
        end
    else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[1])
    end
    return true
end
Code:
doPlayerAddSkill(cid, Skillsy[param][1], 8)
Did you ever test this yourself for each vocation?
I honestly see nothing wrong with the code.

instead we could try something else.. like adding skill tries..
But skilltries are based on your server skill_rate, although I'm pretty true there is a hidden useMultiplier attribute.. so we can try to disable it.
Also have to made sure to not check for buff's and only the base magic/skill levels

Anyways.. try to replace the addSkill with this..
Code:
doPlayerAddSkill(cid, Skillsy[param][1], 8)
Code:
if param == "magic" then
    local player_magic = getPlayerRequiredMana(cid, getPlayerMagLevel(cid, false)) - getPlayerSpentMana(cid)
    doPlayerAddSpentMana(cid, player_magic, false)
else
    local player_skill = getPlayerRequiredSkillTries(cid, Skillsy[param][1], getPlayerSkillLevel(cid, Skillsy[param][1], false)) - getPlayerSkillTries(cid, Skillsy[param][1])
    doPlayerAddSkillTry(cid, Skillsy[param][1], player_skill, false)
end

Hope it works.

Xikini
 
Back
Top