
Tudo que xWhiteWolf postou
-
[Duvida] Vocations.Xml
New Slayer Yurots\data\XML\Vocations.xml < o meu é aqui
-
MW BUGADA
compartilhe conosco a resolução
- [PEDIDO] Item dar efeito de gelo!
-
[PEDIDO] Item dar efeito de gelo!
como prometido: creaturescripts/scripts/glacierrobe.lua --[[Script made 100% by Night Wolf and Nogard do not remove the fucking credits or I may kill you and practice necrofily with your filthy body]] --condição que irá adicionar local gelocondition = createConditionObject(CONDITION_PARALYZE) setConditionParam(gelocondition, CONDITION_PARAM_TICKS, 10000) setConditionFormula(gelocondition, -0.9, 0, -0.9, 0) ------- local config = { itemid = 7897, --id do item que deverá ser equipado para ativar o gelo place = 4, --posição que o item deve estar para funcionar, cheque na tabela abaixo percent = 5, --se vc quiser 20%, coloque 5 pois 1/5 = 0,2 (20%) valorvida = 300 --quanto deve ser o valor minimo de vida a perder para executar o script } --[[ Tabela de places possíveis CONST_SLOT_HEAD (1) = helmet CONST_SLOT_NECKLACE (2) = necklace slot (amulet of loss etc.) CONST_SLOT_BACKPACK (3) = backpack, bag CONST_SLOT_ARMOR (4) = armor CONST_SLOT_LEFT (5) = left hand (its really hand placed >> (right page on screen)) CONST_SLOT_RIGHT (6) = right hand (its really hand placed << (left page on screen)) CONST_SLOT_LEGS (7) = legs CONST_SLOT_FEET (8) = boots CONST_SLOT_RING (9) = ring slot CONST_SLOT_AMMO (10) = ammo slot (arrows etc.)]] ----------------------------------------------- function canEffect(pos, pz, proj) -- Night Wolf based on Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTilePzInfo(pos) and not pz then return false end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function onStatsChange(cid, attacker, type, combat, value) if type == STATSCHANGE_HEALTHLOSS and value >= config.valorvida then if (getPlayerSlotItem(cid, config.place).itemid == config.itemid) then if math.random (1,config.percent) == 1 then local pos = getPlayerPosition (cid) local effectPositions = { {x = pos.x, y = pos.y - 2, z = pos.z}, {x = pos.x, y = pos.y + 2, z = pos.z}, {x = pos.x - 2, y = pos.y, z = pos.z}, {x = pos.x + 2, y = pos.y, z = pos.z}, {x = pos.x - 2, y = pos.y - 1, z = pos.z}, {x = pos.x + 2, y = pos.y - 1, z = pos.z}, {x = pos.x + 2, y = pos.y + 1, z = pos.z}, {x = pos.x - 2, y = pos.y + 1, z = pos.z}, {x = pos.x - 1, y = pos.y - 2, z = pos.z}, {x = pos.x + 1, y = pos.y - 2, z = pos.z}, {x = pos.x + 1, y = pos.y + 2, z = pos.z}, {x = pos.x - 1, y = pos.y + 2, z = pos.z} } local conditionPositions = { {x = pos.x, y = pos.y - 2, z = pos.z}, {x = pos.x, y = pos.y + 2, z = pos.z}, {x = pos.x - 2, y = pos.y, z = pos.z}, {x = pos.x + 2, y = pos.y, z = pos.z}, {x = pos.x - 2, y = pos.y - 1, z = pos.z}, {x = pos.x + 2, y = pos.y - 1, z = pos.z}, {x = pos.x + 2, y = pos.y + 1, z = pos.z}, {x = pos.x - 2, y = pos.y + 1, z = pos.z}, {x = pos.x - 1, y = pos.y - 2, z = pos.z}, {x = pos.x + 1, y = pos.y - 2, z = pos.z}, {x = pos.x + 1, y = pos.y + 2, z = pos.z}, ---- {x = pos.x, y = pos.y - 1, z = pos.z}, {x = pos.x, y = pos.y + 1, z = pos.z}, {x = pos.x - 1, y = pos.y, z = pos.z}, {x = pos.x + 1, y = pos.y, z = pos.z}, {x = pos.x - 1, y = pos.y + 1, z = pos.z}, {x = pos.x - 1, y = pos.y - 1, z = pos.z}, {x = pos.x + 1, y = pos.y - 1, z = pos.z}, {x = pos.x + 1, y = pos.y + 1, z = pos.z}, ------ {x = pos.x - 1, y = pos.y + 2, z = pos.z} } if isCreature(cid) == TRUE then for _, cPos in ipairs(conditionPositions) do local mob = getTopCreature(cPos).uid if canEffect (cPos) and mob ~= 0 and isMonster(mob) then doAddCondition(mob, gelocondition) end end for _, ePos in ipairs(effectPositions) do if canEffect(ePos) then doSendMagicEffect(ePos, 41) end end else end else end return true else end return true end return true end creaturescripts.xml: <event type="statschange" name="glacierrobe" event="script" value="glacierrobe.lua"/> creaturescripts/scripts/login.lua obs: coloca embaixo dos outros registerCreatureEvent registerCreatureEvent(cid, "glacierrobe") Faça bom proveito do script! obs2: não remova os créditos obs3: sinta-se a vontade pra me REPar
-
Help
dica: cole o script aqui porque muita gente vai ter preguiça de ler isso aí inclusive eu
-
Problema com FIRST ITEMS.
deve ser por causa da versão do seu tibia, o meu é 8.54 auhauhhu tem umas diferenças... dá um REP+ aí pra fortalecer kkk
-
alguém ajuda ....
no meu server eu tinha esse problema com dois itens: 1) era uma runa que estava setada pra duas actions diferentes: a primeira era uma mana rune e a segunda era uma spell rune (quando usasse a runa em si mesmo recuperava mana e se usasse no chão criava um energy hur) Solução: O jeito de resolver foi mudando o id de uma das runas, dai uma ficou uma mana rune e outra runa de um id que não tava sendo usado virou o da spell rune 2) O ruby estava sendo usado pra duas coisas: colocar no helmet of the ancients e usar pra encantar itens Solução: Tive que mudar o script do helmet of the ancients pra, ao invés de usar a ruby no helmet, usar o helmet na ruby; Troquei os ID's no actions.xml e tirei o erro do server
-
(Resolvido)[SUPPORT/SPELL] Destroy Field
se deu errado significa que esse script não é o único de destroy field que vc no seu servidor porque esse daí tá perfeito e infinito. tenta isso daqui: function onUse(cid, item, frompos, item2, topos) fieldpos = topos fieldpos.stackpos = 254 fielditem = getThingfromPos(fieldpos) if getPlayerMagLevel(cid) >= 3 then if fielditem.itemid > 0 and fielditem.itemid ~= 1497 and fielditem.itemid ~= 1498 then doSendMagicEffect(topos,2) doRemoveItem(fielditem.uid,1) if item.type > 1 then doChangeTypeItem(item.uid,item.type) else end else doSendMagicEffect(frompos,2) return 0 end else doSendMagicEffect(frompos,2) doPlayerSendCancel(cid,"You don't have the required magic level to use that rune.") end return 1 end
-
Problema com FIRST ITEMS.
não sei cara, era pra dar certo isso aí. Algum outro script deve estar indo de confronto com esse ou o seu site tá programado pra criar chars sem nada. Em nenhum dos casos eu vou saber te ajudar, mas oque dá pra fazer é modificar a área que o player for nascer qnd cria a conta pelo primeira vez e fazer uma sala com vários baús onde ele pode pegar os itens da vocação que ele escolheu
-
[PEDIDO] Top PvP & Top Arena & Top Level e etc..
isso não é um script, é um sistema. Não sei como funciona seu sistema de arena então precisaria que vc postasse aqui e explicasse como ele funciona no seu server
- Erro de onTimer evento Dota
-
[SUPORTE] Anti-Divulger - Proibe o Proprio IP?
depende da forma que seu anti divulguer for feito.. se ele checa strings do tipo "www." e "192" "189" "191" separadamente então há grandes chances do seu antidivulguer bloquear qualquer mensagem que contenha essas strings (INCLUSIVE AS DO PRÓPRIO SERVER), o ideal seria colocar algumas excessões, do tipo que ele cheque se a string contém 'www.' mas não seja 'www.seusite.com.br' (se for, ele não bloqueia). Mas a gente só vai conseguir te ajudar nisso se vc postar o script
-
MW BUGADA
depois diga se funcionou a dica da amiguinha aqui de cima
-
Problema com FIRST ITEMS.
oque eu uso no meu server é esse daqui: mods\firstitems.xml <?xml version="1.0" encoding="UTF-8"?> <mod name="First Items" version="1.0" author="The Forgotten Server" contact="otland.net" enabled="yes"> <config name="firstitems_config"><![CDATA[ config = { storage = 30001, items = {2050, 2382} } ]]></config> <event type="login" name="FirstItems" event="script"><![CDATA[ domodlib('firstitems_config') function onLogin(cid) if(getPlayerStorageValue(cid, config.storage) > 0) then return true end for _, id in ipairs(config.items) do doPlayerAddItem(cid, id, 1) end if(getPlayerSex(cid) == PLAYERSEX_FEMALE) then doPlayerAddItem(cid, 2651, 1) else doPlayerAddItem(cid, 2650, 1) end doAddContainerItem(doPlayerAddItem(cid, 1987, 1), 2674, 1) setPlayerStorageValue(cid, config.storage, 1) return true end ]]></event> </mod> creaturescripts\scripts\firstitems.lua local firstItems = {} firstItems[0] = { 2173, 2525, 2428, 2124, 2460, 2478, 2643 } firstItems[1] = { 2173, 2525, 2190, 2124, 2460, 2478, 2643 } firstItems[2] = { 2173, 2525, 2182, 2124, 2460, 2478, 2643 } firstItems[3] = { 2173, 2525, 2389, 2124, 2460, 2478, 2643 } firstItems[4] = { 2173, 2525, 2428, 2124, 2460, 2478, 2643 } function onLogin(cid) if getPlayerStorageValue(cid, 30001) == -1 then for i = 1, table.maxn(firstItems[getPlayerVocation(cid)]) do doPlayerAddItem(cid, firstItems[getPlayerVocation(cid)][i], 1) end if getPlayerSex(cid) == 0 then doPlayerAddItem(cid, 2465, 1) else doPlayerAddItem(cid, 2465, 1) end local bag = doPlayerAddItem(cid, 10518, 1) doAddContainerItem(bag, 2160, 2) doAddContainerItem(bag, 2554, 1) doAddContainerItem(bag, 2120, 1) doAddContainerItem(bag, 7618, 1) doAddContainerItem(bag, 2383, 1) setPlayerStorageValue(cid, 30001, 1) end return TRUE end creaturescripts.xml <event type="login" name="FirstItems" event="script" value="firstitems.lua"/>
-
NPC QUE VENDE PREMIUM ACCOUNT
peguei esse script aqui do fórum mesmo, o script é do tonyplyson scripts/buypremmy.lua days = 30 vipcoins = 2160 quant = 1 local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function santaNPC(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end if (parameters.present == true) then if isPlayer(cid) then if getPlayerItemCount(cid,vipcoins) >= quant then doPlayerAddPremiumDays(cid,days) doPlayerRemoveItem(cid,vipcoins,quant) npcHandler:say('Obrigado |PLAYERNAME|, Está aqui seus "..days.." dias de Premium', cid) else npcHandler:say('Voce não tem "..quant.." crystal coin(s)', cid) end end npcHandler:resetNpc() return true end end npcHandler:setMessage(MESSAGE_GREET, "Olá |PLAYERNAME|. Eu vendo {Premium} Days.") local noNode = KeywordNode:new({'no'}, santaNPC, {present = false}) local yesNode = KeywordNode:new({'yes'}, santaNPC, {present = true}) local node = keywordHandler:addKeyword({'premium'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce gostaria de comprar "..days.." dias de Premium por "..quant.." crystal coins?'}) node:addChildKeywordNode(yesNode) node:addChildKeywordNode(noNode) npcHandler:addModule(FocusModule:new()) Npc.xml <?xml version="1.0" encoding="UTF-8"?> <npc name="Premium Seller" script="buypremmy.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="160" head="0" body="112" legs="93" feet="95"/> </npc>
-
(Resolvido)[Pedido Duplo] NPC que reseta e Nova Moeda
@Lyon @azzouks o script funcinou até na parte de editar as skills? é que eu nunca havia mexido com npc antes, foi realmente um "desafio".
-
alguém ajuda ....
para de spam mano, relaxa que eventualmente a gente vai te responder.. Esse problema no actions.xml é por causa que você tá usando um mesmo id pra diversos scripts diferentes. OBJETO DUPLICADO COM ID: XXXX Se você fosse scripter eu te ensinaria a arrumar isso da melhor forma, mas já que vc não é eu só vou te dizer pra escolher uma das actions e abrir mão da outra pra acabar com esse erro; A segunda opção é deixar o erro e não se importar, já que isso daí provavelmente não vai afetar em nada seu servidor
-
Script Upgrade
só trocar isso daqui na lib e deve resolver: --[[ PERFECT UPGRADE SYSTEM 2.0 Criado por Oneshot É proibido a venda ou a cópia sem os devidos créditos desse script. ]]-- UpgradeHandler = { levels = { [1] = {100, false, true}, [2] = {90, false, true}, [3] = {80, false, true}, [4] = {70, false, true}, [5] = {60, false, true}, [6] = {50, false, true}, [7] = {40, false, true}, [8] = {30, false, true}, [9] = {20, false, true}, [10] = {10, false, true} }, broadcast = 9, attributes = { ["attack"] = 2, ["defense"] = 1, ["armor"] = 1 }, message = { console = "Trying to refine %s to level +%s with %s%% success rate.", success = "You have upgraded %s to level +%s", fail = "You have failed in upgrade of %s to level +%s", downgrade = "The upgrade level of %s has downgraded to +%s", erase = "The upgrade level of %s has been erased.", maxlevel = "The targeted %s is already on max upgrade level.", notupgradeable = "This item is not upgradeable.", broadcast = "The player %s was successful in upgrading %s to level +%s.\nCongratulations!!", invalidtool = "This is not a valid upgrade tool.", toolrange = "This upgrade tool can only be used in items with level between +%s and +%s" }, tools = { [8306] = {range = {0, 10}, info = {chance = 0, removeable = true}}, }, isEquipment = function(self) local weaponType = self:getItemWeaponType() return ((weaponType > 0 and weaponType < 7) or self.item.armor ~= 0) end, setItemName = function(self, name) return doItemSetAttribute(self.item.uid, "name", name) end, chance = function(self) local chances = {} chances.upgrade = (self.levels[self.item.level + 1][1] or 100) chances.downgrade = (self.item.level * 5) chances.erase = (self.item.level * 11) return chances end } function UpgradeHandler:new(item) local obj, ret = {} obj.item = {} obj.item.level = 0 obj.item.uid = item.uid for key, value in pairs(getItemInfo(item.itemid)) do obj.item[key] = value end ret = setmetatable(obj, {__index = function(self, index) if _G[index] then return (setmetatable({callback = _G[index]}, {__call = function(self, ...) return self.callback(item.uid, ...) end})) else return UpgradeHandler[index] end end}) if ret:isEquipment() then ret:update() return ret end return false end function UpgradeHandler:update() self.item.level = (tonumber(self:getItemName():match("%+(%d+)")) or 0) end function UpgradeHandler:refine(uid, item) if not self.item then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, self.message.notupgradeable) return "miss" end local tool = self.tools[item.itemid] if(tool == nil) then doPlayerSendTextMessage(uid, MESSAGE_EVENT_DEFAULT, self.message.invalidtool) return "miss" end if(self.item.level > #self.levels) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.maxlevel:format(self.item.name)) return "miss" end if(self.item.level < tool.range[1] or self.item.level >= tool.range[2]) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.toolrange:format(unpack(tool.range))) return "miss" end local chance = (self:chance().upgrade + tool.info.chance) doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, self.message.console:format(self.item.name, (self.item.level + 1), math.min(100, chance))) if(tool.info.removeable == true) then doRemoveItem(item.uid, 1) end if chance * 100 > math.random(1, 10000) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_ORANGE, self.message.success:format(self.item.name, (self.item.level + 1))) if (self.item.level + 1) >= self.broadcast then end self:setItemName((self.item.level > 0 and self:getItemName():gsub("%+(%d+)", "+".. (self.item.level + 1)) or (self:getItemName() .." +1"))) for key, value in pairs(self.attributes) do if getItemAttribute(self.item.uid, key) ~= nil or self.item[key] ~= 0 then doItemSetAttribute(self.item.uid, key, (self.item.level > 0 and getItemAttribute(self.item.uid, key) or self.item[key]) + value) end end return "success" else if(self.levels[self.item.level][11] == true and (self:chance().erase * 100) > math.random(1, 10000)) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.erase:format(self.item.name)) self:setItemName(self.item.name) for key, value in pairs(self.attributes) do if self.item[key] > 0 then doItemSetAttribute(self.item.uid, key, self.item[key]) end end elseif(self.levels[self.item.level][2] == true and (self:chance().downgrade * 100) > math.random(1, 10000)) then doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.downgrade:format(self.item.name, (self.item.level - 1))) self:setItemName((self.item.level == 1 and self.item.name or self:getItemName():gsub("%+(%d+)", "+".. (self.item.level - 1)))) for key, value in pairs(self.attributes) do if getItemAttribute(self.item.uid, key) ~= nil or self.item[key] ~= 0 then doItemSetAttribute(self.item.uid, key, (self.item[key] + value * (self.item.level - 1))) end end else doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.fail:format(self.item.name, (self.item.level + 1))) doRemoveItem(self.item.uid, 1) end return "fail" end end
-
(Resolvido)[SUPPORT/SPELL] Destroy Field
errado.. se vc remover aquilo que ele falou a runa vai parar de funcionar. remova essa parte aqui if item.type > 1 then doChangeTypeItem(item.uid,item.type-1) else doRemoveItem(item.uid,1) end ficando assim function onUse(cid, item, frompos, item2, topos) fieldpos = topos fieldpos.stackpos = 254 fielditem = getThingfromPos(fieldpos) if getPlayerMagLevel(cid) >= 3 then if fielditem.itemid > 0 and fielditem.itemid ~= 1497 and fielditem.itemid ~= 1498 then doSendMagicEffect(topos,2) doRemoveItem(fielditem.uid,1) else doSendMagicEffect(frompos,2) return 0 end else doSendMagicEffect(frompos,2) doPlayerSendCancel(cid,"You don't have the required magic level to use that rune.") end return 1 end
-
(Resolvido)[Pedido Duplo] NPC que reseta e Nova Moeda
comente alguma coisa.... funcionou? não funcionou? eu dediquei muito tempo fazendo isso pra você e eu gostaria de um feedback.
-
[PEDIDO] Item dar efeito de gelo!
eu sei como fazer o script, falta eu arrumar tempo pra fazer ele.. Quando eu conseguir fazer eu irei postar aqui pra que as outras pessoas possam usar as ferramentes que eu vou fornecer para ajustar futuros scripts. É assim que funciona cara, não dá pra eu fazer coisa exclusiva pra você :/
-
MW BUGADA
é um problema nas sources, aposto que seu server é o daemon 0.3.6, acertei? Ele ta dando PZ em todo script que usa "COMBAT_PARAM_CREATEITEM", ainda não sei como arrumar.
-
(Resolvido)[Pedido Duplo] NPC que reseta e Nova Moeda
se não funcionar agora: desisto. Só trabalho com as versões que eu tenho aqui em casa, isso daí é oque, 9.1? Tenta isso daqui, talvez a parte de skills funcione agora (mas só se o level funcionar tb) --[[Script made 100% by Nogard and Night Wolf. You can feel free to edit anything you want, but don't remove the credits]] local config = { minlevel = 50, --- level inical para resetar price = 10000, --- preço inicial para resetar newlevel = 20, --- level após reset priceByReset = 10000, --- preço acrescentado por reset mlnew = 20, --- quanto de ml vai adicionar ao resetar skillnew = 25 --- quanto de skill vai dar (axe, club, sword, shield, distance) } --- end config function addReset(cid) resets = getResets(cid) setPlayerStorageValue(cid, 378378, resets+1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) ------------------------------------ MUDE AQUI A % DE VIDA QUE GANHA AO RESETAR --------------------- local hp = getCreatureMaxHealth(cid) local resethp = hp*0.25 setCreatureMaxHealth(cid, resethp) local differencehp = (hp - resethp) doCreatureAddHealth(cid, -differencehp) local mana = getCreatureMaxMana(cid) local resetmana = mana*0.25 setCreatureMaxMana(cid, resetmana) local differencemana = (mana - resetmana) doCreatureAddMana(cid, -differencemana) ------------------------------------ FIM ---------------------------- ------------------------------ EDIÇÃO DAS SKILLS -------------------- if isInArray({1,5,2,6}, getPlayerVocation(cid)) then local magic = getPlayerSkillLevel(cid, SKILL__MAGLEVEL) db.executeQuery("UPDATE `player_skills` SET `value` = " .. (magic + config.mlnew) .. ", `count` = 0 WHERE `skillid` = 7 and `player_id` = " .. playerid .. ";") end if isInArray({4,8}, getPlayerVocation(cid)) then local club = getPlayerSkillLevel(cid, SKILL_CLUB) local sword = getPlayerSkillLevel(cid, SKILL_SWORD) local axe = getPlayerSkillLevel(cid, SKILL_AXE) local shield = getPlayerSkillLevel(cid, SKILL_SHIELD) db.executeQuery("UPDATE `player_skills` SET `value` = " .. (shield + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 5 and `player_id` = " .. playerid .. ";") db.executeQuery("UPDATE `player_skills` SET `value` = " .. (axe + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 3 and `player_id` = " .. playerid .. ";") db.executeQuery("UPDATE `player_skills` SET `value` = " .. (sword + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 2 and `player_id` = " .. playerid .. ";") db.executeQuery("UPDATE `player_skills` SET `value` = " .. (club + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 1 and `player_id` = " .. playerid .. ";") end if isInArray({3,7}, getPlayerVocation(cid)) then local distance = getPlayerSkillLevel(cid, SKILL_DISTANCE) local shield = getPlayerSkillLevel(cid, SKILL_SHIELD) db.executeQuery("UPDATE `player_skills` SET `value` = " .. (shield + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 5 and `player_id` = " .. playerid .. ";") db.executeQuery("UPDATE `player_skills` SET `value` = " .. (distance + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 4 and `player_id` = " .. playerid .. ";") end ------------------------FIM ---------------------------------- doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `description` = ' [Reset: "..resets.."]' WHERE `players`.`id`= ".. playerid .."") db.executeQuery("UPDATE `players` SET `level`="..config.newlevel..",`experience`= 0 WHERE `players`.`id`= ".. playerid .."") return TRUE end function getResets(cid) resets = getPlayerStorageValue(cid, 378378) if resets < 0 then resets = 0 end return resets end local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local newPrice = config.price + (getResets(cid) * config.priceByReset) if msgcontains(msg, 'reset') then if getResets(cid) == resets then selfSay('You want to reset your character? It will cost '..newPrice..' gp\'s!', cid) talkState[talkUser] = 1 else selfSay('I couldnt acess your bank of acess!', cid) end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if getPlayerMoney(cid) < newPrice then selfSay('Its necessary to have at least '..newPrice..' gp\'s for reseting!', cid) elseif getPlayerLevel(cid) < config.minlevel then selfSay('The minimum level for reseting is '..config.minlevel..'!', cid) else doPlayerRemoveMoney(cid,newPrice) playerid = getPlayerGUID(cid) addEvent(addReset, (5*1000), cid) local msg ="---[Reset: "..getResets(cid).."]-- You have reseted! You'll be disconnected in 5 seconds." if doPlayerPopupFYI(cid, msg) then end end talkState[talkUser] = 0 elseif(msgcontains(msg, 'no')) and isInArray({1}, talkState[talkUser]) == TRUE then talkState[talkUser] = 0 selfSay('Ok.', cid) elseif msgcontains(msg, 'quantity') then selfSay('You have a total of '..getResets(cid)..' reset(s).', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
alguém ajuda ....
abre seu talkactions.xml, procure a palavra "/ban", provavel que tenha duas. Escolha uma das duas e delete-a
-
(Resolvido)[Pedido Duplo] NPC que reseta e Nova Moeda
que versão de tibia vc usa? esse comando é pra fazer determinada função na database SQL. Eu testei na 8.54 e deu certinho