Postado Outubro 15, 2018 6 anos Diga em poucas palavras a base utilizada (Nome do servidor ou nome do website). 0.4 Base: Baiak Barão Qual erro está surgindo/O que você procura? Estou com o seguinte problema, no meu OT server tem um sistema de points, a cada level upado o player ganha points e com esses points ele pode evoluir skills como ml, sword, axe entre outros. Porem ele tem um problema bem grave, se por acaso o player estiver de utito tempo ou utito tempo san, e der o comando para adicionar os pontos, ele adiciona uma skill absurda para o personagem, exemplo: Meu Pally estava 77 de Distance. Usei a spell Utito tempo san, ele ficou com 100 de skill, quando dei o comando !points add, distance, 1 ele deixou o pally com 117 de distance, e mesmo acabando o utito tempo san, permaneceu esse skill. Acredito que a solução seja bloquear para não usar o script caso esteja usando utito tempo ou utito tempo san, só que não faço ideia de como fazer isso, alguem poderia me ajudar porfavor? Você tem o código disponível? Se tiver publique-o aqui: Esse é o .lua do talkactions -- ####################################### -- ####### Developed by MaXwEllDeN ####### -- ####### Level Points System ####### -- ####### Version: 1.0 ####### -- ####################################### function onSay(cid, words, param) if not (L_LvlPoints.vocPoints[getPlayerVocation(cid)]) then return false end local param = param:lower() local p2 = string.explode(param, ",") if (getPlayerStorageValue(cid, 14574) < 0) then setPlayerStorageValue(cid, 14574, 0) end local skillids = { ["shielding"] = 5, ["sword"] = 2, ["axe"] = 3, ["club"] = 1, ["distance"] = 4, ["fishing"] = 6, ["fist"] = 0, } if (param == "check") then doPlayerPopupFYI(cid, "~*~*~ Level Points System by MaXwEllDeN ~*~*~\n\nPontos disponíveis: ".. getPlayerStorageValue(cid, 14574) .."\nPontos por level: ".. L_LvlPoints.vocPoints[getPlayerVocation(cid)]) elseif (p2[1] and p2[1] == "add") and (L_LvlPoints.attributes[p2[2]]) and (tonumber(p2[3])) then if (getPlayerStorageValue(cid, 14574) < tonumber(p2[3]) * L_LvlPoints.attributes[p2[2]].np) then doPlayerSendCancel(cid, "Você não tem pontos suficientes para distribuir!") return doSendMagicEffect(getThingPos(cid), 2) end if (p2[2] == "hp") then setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + L_LvlPoints.attributes[p2[2]].vl * tonumber(p2[3])) doCreatureAddHealth(cid, L_LvlPoints.attributes[p2[2]].vl * tonumber(p2[3])) elseif (p2[2] == "mp") then setCreatureMaxMana(cid, getCreatureMaxMana(cid) + L_LvlPoints.attributes[p2[2]].vl * tonumber(p2[3])) doCreatureAddMana(cid, L_LvlPoints.attributes[p2[2]].vl * tonumber(p2[3])) elseif (p2[2] == "magic") then doPlayerAddMagLevel(cid, 1) elseif(skillids[p2[2]]) then for a = 1, tonumber(p2[3]) do doPlayerAddSkillTry(cid, skillids[p2[2]], getPlayerRequiredSkillTries(cid, skillids[p2[2]], getPlayerSkillLevel(cid, skillids[p2[2]]) + 1) - getPlayerSkillTries(cid, skillids[p2[2]]), false) end end doSendMagicEffect(getThingPos(cid), 29) doSendMagicEffect(getThingPos(cid), 30) doSendAnimatedText(getThingPos(cid), "-" .. tonumber(p2[3]) * L_LvlPoints.attributes[p2[2]].np, 180) setPlayerStorageValue(cid, 14574, getPlayerStorageValue(cid, 14574) - tonumber(p2[3]) * L_LvlPoints.attributes[p2[2]].np) else local msgx = "" for i, v in pairs(L_LvlPoints.attributes) do local add = (v.np > 1) and "s" or "" msgx = msgx .. string.upper(i:sub(1,1)) .. i:sub(2, #i) .. " - ".. v.np .. " ponto".. add .. " ~ " .. v.vl .. " ".. v.nm .. "\n" end doPlayerPopupFYI(cid, "~*~*~ Level Points System by MaXwEllDeN ~*~*~\n\nPontos necessários para aumentar os stats:\n\n".. msgx .. "\nExemplo de uso: ".. words .." add, vitalidade, 5\n\nPontos disponíveis: ".. getPlayerStorageValue(cid, 14574)) end return true end Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.
Postado Outubro 15, 2018 6 anos Autor Em 15/10/2018 em 17:55, FlavioHulk disse: posta seu script do utito tempo ou utito tempo san, por favor Claro, segue os 2 scripts: Utito tempo san: sharpshooter.lua local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, 10000) setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCEPERCENT, 140) setConditionParam(condition, CONDITION_PARAM_BUFF, true) setCombatCondition(combat, condition) function onCastSpell(cid, var) return doCombat(cid, combat, var) end Utito tempo: blood rage.lua local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, 10000) setConditionParam(condition, CONDITION_PARAM_SKILL_MELEEPERCENT, 135) setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELDPERCENT, -100) setConditionParam(condition, CONDITION_PARAM_BUFF, true) setCombatCondition(combat, condition) function onCastSpell(cid, var) return doCombat(cid, combat, var) end Editado Outubro 15, 2018 6 anos por douglera21 (veja o histórico de edições)
Postado Outubro 15, 2018 6 anos Solução local skillids = { ["shielding"] = 5, ["sword"] = 2, ["axe"] = 3, ["club"] = 1, ["distance"] = 4, ["fishing"] = 6, ["fist"] = 0, } function onSay(cid, words, param) if not (L_LvlPoints.vocPoints[getPlayerVocation(cid)]) then return false end local param = param:lower() local p2 = string.explode(param, ",") if (getPlayerStorageValue(cid, 14574) < 0) then setPlayerStorageValue(cid, 14574, 0) end if (param == "check") then doPlayerPopupFYI(cid, "~*~*~ Level Points System by MaXwEllDeN ~*~*~\n\nPontos disponíveis: ".. getPlayerStorageValue(cid, 14574) .."\nPontos por level: ".. L_LvlPoints.vocPoints[getPlayerVocation(cid)]) elseif (p2[1] and p2[1] == "add") and (L_LvlPoints.attributes[p2[2]]) and (tonumber(p2[3])) then if getCreatureCondition(cid, CONDITION_ATTRIBUTES) then doPlayerSendCancel(cid, "Você não pode usar esse comando enquanto está com buff.") return doSendMagicEffect(getThingPos(cid), 2) end if (getPlayerStorageValue(cid, 14574) < tonumber(p2[3]) * L_LvlPoints.attributes[p2[2]].np) then doPlayerSendCancel(cid, "Você não tem pontos suficientes para distribuir!") return doSendMagicEffect(getThingPos(cid), 2) end if (p2[2] == "hp") then setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + L_LvlPoints.attributes[p2[2]].vl * tonumber(p2[3])) doCreatureAddHealth(cid, L_LvlPoints.attributes[p2[2]].vl * tonumber(p2[3])) elseif (p2[2] == "mp") then setCreatureMaxMana(cid, getCreatureMaxMana(cid) + L_LvlPoints.attributes[p2[2]].vl * tonumber(p2[3])) doCreatureAddMana(cid, L_LvlPoints.attributes[p2[2]].vl * tonumber(p2[3])) elseif (p2[2] == "magic") then doPlayerAddMagLevel(cid, 1) elseif(skillids[p2[2]]) then for a = 1, tonumber(p2[3]) do doPlayerAddSkillTry(cid, skillids[p2[2]], getPlayerRequiredSkillTries(cid, skillids[p2[2]], getPlayerSkillLevel(cid, skillids[p2[2]]) + 1) - getPlayerSkillTries(cid, skillids[p2[2]]), false) end end doSendMagicEffect(getThingPos(cid), 29) doSendMagicEffect(getThingPos(cid), 30) doSendAnimatedText(getThingPos(cid), "-" .. tonumber(p2[3]) * L_LvlPoints.attributes[p2[2]].np, 180) setPlayerStorageValue(cid, 14574, getPlayerStorageValue(cid, 14574) - tonumber(p2[3]) * L_LvlPoints.attributes[p2[2]].np) else local msgx = "" for i, v in pairs(L_LvlPoints.attributes) do local add = (v.np > 1) and "s" or "" msgx = msgx .. string.upper(i:sub(1,1)) .. i:sub(2, #i) .. " - ".. v.np .. " ponto".. add .. " ~ " .. v.vl .. " ".. v.nm .. "\n" end doPlayerPopupFYI(cid, "~*~*~ Level Points System by MaXwEllDeN ~*~*~\n\nPontos necessários para aumentar os stats:\n\n".. msgx .. "\nExemplo de uso: ".. words .." add, vitalidade, 5\n\nPontos disponíveis: ".. getPlayerStorageValue(cid, 14574)) end return true end
Postado Outubro 16, 2018 6 anos Autor Em 15/10/2018 em 22:14, FlavioHulk disse: local skillids = { ["shielding"] = 5, ["sword"] = 2, ["axe"] = 3, ["club"] = 1, ["distance"] = 4, ["fishing"] = 6, ["fist"] = 0, } function onSay(cid, words, param) if not (L_LvlPoints.vocPoints[getPlayerVocation(cid)]) then return false end local param = param:lower() local p2 = string.explode(param, ",") if (getPlayerStorageValue(cid, 14574) < 0) then setPlayerStorageValue(cid, 14574, 0) end if (param == "check") then doPlayerPopupFYI(cid, "~*~*~ Level Points System by MaXwEllDeN ~*~*~\n\nPontos disponíveis: ".. getPlayerStorageValue(cid, 14574) .."\nPontos por level: ".. L_LvlPoints.vocPoints[getPlayerVocation(cid)]) elseif (p2[1] and p2[1] == "add") and (L_LvlPoints.attributes[p2[2]]) and (tonumber(p2[3])) then if getCreatureCondition(cid, CONDITION_ATTRIBUTES) then doPlayerSendCancel(cid, "Você não pode usar esse comando enquanto está com buff.") return doSendMagicEffect(getThingPos(cid), 2) end if (getPlayerStorageValue(cid, 14574) < tonumber(p2[3]) * L_LvlPoints.attributes[p2[2]].np) then doPlayerSendCancel(cid, "Você não tem pontos suficientes para distribuir!") return doSendMagicEffect(getThingPos(cid), 2) end if (p2[2] == "hp") then setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + L_LvlPoints.attributes[p2[2]].vl * tonumber(p2[3])) doCreatureAddHealth(cid, L_LvlPoints.attributes[p2[2]].vl * tonumber(p2[3])) elseif (p2[2] == "mp") then setCreatureMaxMana(cid, getCreatureMaxMana(cid) + L_LvlPoints.attributes[p2[2]].vl * tonumber(p2[3])) doCreatureAddMana(cid, L_LvlPoints.attributes[p2[2]].vl * tonumber(p2[3])) elseif (p2[2] == "magic") then doPlayerAddMagLevel(cid, 1) elseif(skillids[p2[2]]) then for a = 1, tonumber(p2[3]) do doPlayerAddSkillTry(cid, skillids[p2[2]], getPlayerRequiredSkillTries(cid, skillids[p2[2]], getPlayerSkillLevel(cid, skillids[p2[2]]) + 1) - getPlayerSkillTries(cid, skillids[p2[2]]), false) end end doSendMagicEffect(getThingPos(cid), 29) doSendMagicEffect(getThingPos(cid), 30) doSendAnimatedText(getThingPos(cid), "-" .. tonumber(p2[3]) * L_LvlPoints.attributes[p2[2]].np, 180) setPlayerStorageValue(cid, 14574, getPlayerStorageValue(cid, 14574) - tonumber(p2[3]) * L_LvlPoints.attributes[p2[2]].np) else local msgx = "" for i, v in pairs(L_LvlPoints.attributes) do local add = (v.np > 1) and "s" or "" msgx = msgx .. string.upper(i:sub(1,1)) .. i:sub(2, #i) .. " - ".. v.np .. " ponto".. add .. " ~ " .. v.vl .. " ".. v.nm .. "\n" end doPlayerPopupFYI(cid, "~*~*~ Level Points System by MaXwEllDeN ~*~*~\n\nPontos necessários para aumentar os stats:\n\n".. msgx .. "\nExemplo de uso: ".. words .." add, vitalidade, 5\n\nPontos disponíveis: ".. getPlayerStorageValue(cid, 14574)) end return true end Nossa voce é um monstro, muito obrigadooooooooooo! Funcionou perfeitamente haha!
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.