i created a script that adds skill but i noticed that when people have utito tempo or utito tempo san and they use they script they get more skill than what they should get, basically the formula i use is getcurrentskill + 50 so lets say if they actually have 150 and utito tempo makes them have 175 skill then when they use the command !sword they will have 225 sword skill instead of 200 so what i was wondering is if there's a condition that will detect if they're strengthened ? this is the script i made: EDIT: Also when they're wearing equipment that adds skill it bugs the script so i want something that will get the Raw skill of the player and not the edited skill
Code:
function onSay(cid, words)
local config = {
item = 5952, -- Item required for command
skills = 400, -- Top skill for Sword, Axe, Club, Distance, & Shield
incrementSkills = 50, -- By how much does the skill increases everytime the command is used
magicKnight = 15, -- Top magic skill for a knight
incrementMagicKnight = 5, -- By how much does the magic skill increase everytime they use the command
magicPaladin = 90, -- Top magic skill for a paladin
incrementMagicPaladin = 25, -- By how much does the magic skill increase everytime they use the command
magicMage = 250, -- Top magic skill for sorcerers & druids
IncrementMagicMage = 25, -- By how much does the magic skill increase everytime they use the command
action = TRUE -- Do not change
}
skillID = -1
if words == "!club" then
if getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 8 then
skillID = 1
else
doPlayerSendCancel(cid, 'voce precisa ser knight para usar o comando.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
elseif words == "!sword" then
if getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 8 then
skillID = 2
else
doPlayerSendCancel(cid, 'voce precisa ser knight para usar o comando.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
elseif words == "!axe" then
if getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 8 then
skillID = 3
else
doPlayerSendCancel(cid, 'voce precisa ser knight para usar o comando.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
elseif words == "!distance" then
if getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 then
skillID = 4
else
doPlayerSendCancel(cid, 'voce precisa ser paladin para usar o comando.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
elseif words == "!shield" then
skillID = 5
elseif words == "!magic" then
if getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 8 then
skillID = 6
elseif getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 then
skillID = 7
else
skillID = 8
end
else
diag = 'Skill Commands:\n\n!magic\n!sword\n!axe\n!club\n!distance\n!shield'
doShowTextDialog(cid, 5958, diag)
config.action = FALSE
end
if config.action == TRUE then
if (getTilePzInfo(getCreaturePosition(cid)) == TRUE) then
if skillID < 6 and skillID ~= -1 then
if getPlayerSkillLevel(cid, skillID) == config.skills then
doPlayerSendCancel(cid, 'You have achieved the maximum skill.')
else
if doPlayerRemoveItem(cid,config.item,1) == TRUE then
if getPlayerSkillLevel(cid, skillID) < ( config.skills - config.incrementSkills ) then
doPlayerSetSkill(cid, skillID, ( getPlayerSkillLevel(cid, skillID) + config.incrementSkills ) )
elseif getPlayerSkillLevel(cid, skillID) >= ( config.skills - config.incrementSkills ) and getPlayerSkillLevel(cid, skillID) < config.skills then
doPlayerSetSkill(cid, skillID, config.skills)
end
else
doPlayerSendCancel(cid, 'voce precisa um skill scroll para usar este comando.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
end
elseif skillID == 6 then
if getPlayerMagLevel(cid, true) == config.magicKnight then
doPlayerSendCancel(cid, 'You have achieved the maximum skill.')
else
if doPlayerRemoveItem(cid,config.item,1) == TRUE then
if getPlayerMagLevel(cid, true) < ( config.magicKnight - config.incrementMagicKnight ) then
doPlayerSetMagic(cid, (getPlayerMagLevel(cid, true) + config.incrementMagicKnight ))
elseif getPlayerMagLevel(cid, true) >= ( config.magicKnight - config.incrementMagicKnight ) and getPlayerMagLevel(cid, true) < config.magicKnight then
doPlayerSetMagic(cid, config.magicKnight)
end
else
doPlayerSendCancel(cid, 'voce precisa um skill scroll para usar este comando.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
end
elseif skillID == 7 then
if getPlayerMagLevel(cid, true) == config.magicPaladin then
doPlayerSendCancel(cid, 'You have achieved the maximum skill.')
else
if doPlayerRemoveItem(cid,config.item,1) == TRUE then
if getPlayerMagLevel(cid, true) < ( config.magicPaladin - config.incrementMagicPaladin ) then
doPlayerSetMagic(cid, (getPlayerMagLevel(cid, true) + config.incrementMagicPaladin ))
elseif getPlayerMagLevel(cid, true) >= ( config.magicPaladin - config.incrementMagicPaladin ) and getPlayerMagLevel(cid, true) < config.magicPaladin then
doPlayerSetMagic(cid, config.magicPaladin)
end
else
doPlayerSendCancel(cid, 'voce precisa um skill scroll para usar este comando.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
end
elseif skillID == 8 then
if getPlayerMagLevel(cid, true) == config.magicMage then
doPlayerSendCancel(cid, 'You have achieved the maximum skill.')
else
if doPlayerRemoveItem(cid,config.item,1) == TRUE then
if getPlayerMagLevel(cid, true) < ( config.magicMage - config.IncrementMagicMage ) then
doPlayerSetMagic(cid, (getPlayerMagLevel(cid, true) + config.IncrementMagicMage ))
elseif getPlayerMagLevel(cid, true) >= ( config.magicMage - config.IncrementMagicMage ) and getPlayerMagLevel(cid, true) < config.magicMage then
doPlayerSetMagic(cid, config.magicMage)
end
else
doPlayerSendCancel(cid, 'voce precisa um skill scroll para usar este comando.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
end
end
else
doPlayerSendCancel(cid,"você precisa estar em protection zone pra poder usar este comando.")
end
end
end
Last edited: