Tópico atualizado.
Como o nome diz, é um anél que aumenta a experiência de sua caçada' (configurável)
\o/
Vamos lá...
1º Passo
Abra o arquivo "Items.xml" (pasta Data / Items)
Com o editor de sua preferência, use o comando de busca (geralmente "Ctrl + F") e digite a ID "7697".
Vai achar o item "signet ring" que estará assim: (na maioria dos OTServ's)
<item id="7697" article="a" name="signet ring"> <attribute key="weight" value="80" /> <attribute key="slotType" value="ring" /> </item>
Substitua isso por:
<item id="7697" article="a" name="experience ring"> <attribute key="weight" value="500" /> <attribute key="description" value="Este anel lhe da 2x mais experiencia (ativo)." /> <attribute key="slotType" value="ring" /> <attribute key="duration" value="4320" /> <attribute key="decayTo" value="0" /> <attribute key="showduration" value="1" /> <attribute key="transformDeEquipTo" value="7708" /> </item>
Logo em seguida, procure pela ID "7708".
Encontrará o item "ring" que estará assim: (na maioria dos OTServ's)
<item id="7708" article="a" name="ring"> <attribute key="weight" value="40" /> <attribute key="slotType" value="ring" /> </item>
Substitua isso por:
<item id="7708" article="a" name="ring experience"> <attribute key="weight" value="500" /> <attribute key="slotType" value="ring" /> <attribute key="stopduration" value="1" /> <attribute key="showduration" value="1" /> <attribute key="transformEquipTo" value="7697" /> </item>
Pronto, em Items.xml não mexeremos mais.
2º Passo
Abra o arquivo "Movements.xml" (pasta Data / Movements)
Adicione as tags abaixo:
<movevent type="Equip" itemid="7697" slot="ring" event="script" value="exp_ring.lua"/> <movevent type="DeEquip" itemid="7697" slot="ring" event="script" value="exp_ring.lua"/> <movevent type="Equip" itemid="7708" slot="ring" event="script" value="exp_ring.lua"/> <movevent type="DeEquip" itemid="7708" slot="ring" event="script" value="exp_ring.lua"/>
Pronto, em "movements.xml" é só.
3º Passo
Aqui, temos duas opções...
O Exp Ring Tradicional é para server com Experiência fixa, ou seja, a EXP é sempre a mesma..
Já o Exp Ring por Stages é para server que a Experiência varia de acordo com o level do player.
Clique no Spoiler referente ao seu server.
EXP RING Tradicional:
Abra a pasta (Data / Movements / Scripts) e crie um arquivo com o nome "exp_ring.lua" (pode copiar um arquivo existente e renomeá-lo).
Após fazer isto, abra este arquivo (exp_ring.lua) e cole o código abaixo dentro.
Obs: se tiver algo escrito do arquivo, apague-o e deixe somente o código abaixo.
function onEquip(cid, item, slot) doTransformItem(item.uid, 7697, 1) doPlayerSendTextMessage(cid, 22, 'Agora ganha 2x mais experiencia!') doPlayerSetExperienceRate(cid, getConfigValue("rateExperience")*0.2) return TRUE end function onDeEquip(cid, item, slot) doTransformItem(item.uid, 7708, 1) doPlayerSendTextMessage(cid, 22, 'Experiencia extra cancelada.') doPlayerSetExperienceRate(cid, 1) return TRUE end
EXP RING por Stages:
Abra a pasta (Data / Movements / Scripts) e crie um arquivo com o nome "exp_ring.lua" (pode copiar um arquivo existente e renomeá-lo).
Após fazer isto, abra este arquivo (exp_ring.lua) e cole o código abaixo dentro.
Obs: se tiver algo escrito do arquivo, apague-o e deixe somente o código abaixo.
function onEquip(cid, item, slot) local rate = {} if getPlayerLevel(cid) <= 200 then rate = 1.3 elseif getPlayerLevel(cid) > 200 and getPlayerLevel(cid) <= 280 then rate = 1.15 elseif getPlayerLevel(cid) > 280 then rate = 1.05 end doTransformItem(item.uid, 7697, 1) doPlayerSendTextMessage(cid, 22, "Sua experiencia foi aumentada em "..((rate - 1)*100).." %.") doPlayerSetExperienceRate(cid, rate) return TRUE end function onDeEquip(cid, item, slot) doTransformItem(item.uid, 7708, 1) doPlayerSendTextMessage(cid, 22, "Sua experiencia esta de volta ao normal.") doPlayerSetExperienceRate(cid, 1.0) return TRUE end
Salve-o e feche o arquivo.
Para aprender configurar a rate do Script clique no spoiler abaixo:
Eu não testei, mas creio que onde está:
doPlayerSetExperienceRate(cid, getConfigValue("rateExperience")*2)
Azul: É o valor em vezes que aumentará a experiência. Ex:
Onde está o "2" no código, você pode substituir por quantas vezes que que seja a multiplicação da EXP' (2 é igual a 2x mais Exp)...
Ou pode por em porcentagens usando como está abaixo:
1.5 = 50%
1.2 = 20%
E assim sucessivamente.
Sei que vão pedir, então segue abaixo "Experience Ring Recarregável"
Se quer um Anel de Experiencia Recarregável (como soft boots), clique no Spoiler abaixo.
1º Passo
Abra o arquivo "Items.xml" (pasta Data / Items)
Com o editor de sua preferência, use o comando de busca (geralmente "Ctrl + F") e digite a ID "7697".
Vai achar o item "signet ring" que estará assim: (na maioria dos OTServ's)
<item id="7697" article="a" name="signet ring"> <attribute key="weight" value="80" /> <attribute key="slotType" value="ring" /> </item>
Substitua isso por:
<item id="7697" article="a" name="experience ring"> <attribute key="weight" value="500" /> <attribute key="description" value="Este anel lhe da 2x mais experiencia (ativo)." /> <attribute key="slotType" value="ring" /> <attribute key="duration" value="4320" /> <attribute key="decayTo" value="2122" /> <attribute key="showduration" value="1" /> <attribute key="transformDeEquipTo" value="7708" /> </item>
OBS: Eu usei o Item "Elven Brooch" (ID 2122) pois estava sem tempo para procurar um item para por no lugar, ou seja, quando acabar o anél ele transformará no "Elven Brooch".
Agora procure pela ID "7708".
Encontrará o item "ring" que estará assim: (na maioria dos OTServ's)
<item id="7708" article="a" name="ring"> <attribute key="weight" value="40" /> <attribute key="slotType" value="ring" /> </item>
Substitua isso por:
<item id="7708" article="a" name="ring experience"> <attribute key="weight" value="500" /> <attribute key="slotType" value="ring" /> <attribute key="stopduration" value="1" /> <attribute key="showduration" value="1" /> <attribute key="transformEquipTo" value="7697" /> </item>
Procure também pela ID "2122".
Achará o item "Elven Brooch".
Provavelmente achará o item abaixo:
<item id="2122" article="an" name="elven brooch"> <attribute key="weight" value="100" /> </item>
Substitua isso por:
<item id="2122" article="a" name="broken experience ring"> <attribute key="weight" value="100" /> <attribute key="slotType" value="ring" /> </item>
Pronto, em Items.xml não mexeremos mais.
2º Passo
Abra o arquivo "Movements.xml" (pasta Data / Movements)
Adicione as tags abaixo:
<movevent type="Equip" itemid="7697" slot="ring" event="script" value="exp_ring.lua"/> <movevent type="DeEquip" itemid="7697" slot="ring" event="script" value="exp_ring.lua"/> <movevent type="Equip" itemid="7708" slot="ring" event="script" value="exp_ring.lua"/> <movevent type="DeEquip" itemid="7708" slot="ring" event="script" value="exp_ring.lua/">
Pronto, em "movements.xml" é só.
3º Passo
Abra a pasta (Data / Movements / Scripts) e crie um arquivo com o nome "exp_ring.lua" (pode copiar um arquivo existente e renomeá-lo).
Após fazer isto, abra este arquivo (exp_ring.lua) e cole o código abaixo dentro.
Obs: se tiver algo escrito do arquivo, apague-o e deixe somente o código abaixo.
function onEquip(cid, item, slot) doTransformItem(item.uid, 7697, 1) doPlayerSendTextMessage(cid, 22, 'Agora ganha 2x mais experiencia!') doPlayerSetExperienceRate(cid, getConfigValue("rateExperience")*0.2) return TRUE end function onDeEquip(cid, item, slot) doTransformItem(item.uid, 7708, 1) doPlayerSendTextMessage(cid, 22, 'Experiencia extra cancelada.') doPlayerSetExperienceRate(cid, 1) return TRUE end
4º Passo
Abra a pasta (Data / NPC ) e crie um arquivo com o nome "Joalheiro.xml" (pode copiar um arquivo existente e renomeá-lo).
Após fazer isto, abra este arquivo (Joalheiro.xml) e cole o código abaixo dentro.
Obs: se tiver algo escrito do arquivo, apague-o e deixe somente o código abaixo.
<!--?xml version="1.0" encoding="UTF-8"?--> <npc name="Joalheiro" script="data/npc/scripts/Sell/ring_repair.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"> <look type="128" head="40" body="37" legs="116" feet="95" addons="0"> <parameters> <parameter key="message_greet" value="Just great, another ... 'customer'. Hello, |PLAYERNAME|. If you want to trade, let's get it over with."> <parameter key="message_farewell" value="That's music in my ears."> <parameter key="message_walkaway" value="Yeah, get lost."> <parameter key="message_onsendtrade" value="Yeah, buy something."> <parameter key="module_shop" value="1"> </parameters> </npc>
Salve e feche.
Agora vá na pasta ( Data / NPC / Scripts / Sell ) e crie um arquivo com o nome "ring_repair.lua" (pode copiar um arquivo existente e renomeá-lo).
Após fazer isto, abra este arquivo (ring_repair.lua) e cole o código abaixo dentro.
Obs: se tiver algo escrito do arquivo, apague-o e deixe somente o código abaixo.
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 onThink() npcHandler:onThink() 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 if(msgcontains(msg, 'ring') or msgcontains(msg, 'experience')) then selfSay('Do you want to repair your experience ring for 50000 gold coins?', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if(getPlayerItemCount(cid, 2122) >= 1) then if(doPlayerRemoveMoney(cid, 50000) == TRUE) then doPlayerRemoveItem(cid, 2122, 1) doPlayerAddItem(cid, 7697) selfSay('Here you are.', cid) else selfSay('Sorry, you don\'t have enough gold.', cid) end else selfSay('Sorry, you don\'t have the item.', cid) end talkState[talkUser] = 0 elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then talkState[talkUser] = 0 selfSay('Ok then.', cid) return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Salve e feche.
Configurações do NPC:
Recolhe: "broken experience ring"
Custo: "50k"
Devolte: "Brand-New Experience Ring"
5º Passo
Agora vá no Map Editor e adicione seu novo NPC em seu Mapa.
É, acho que é isso...
Qualquer coisa postem aqui para resolvermos juntos.
Eu editei o Script, criei o NPC e criei o Tutorial.
Créditos pelo tutorial: AdrianoSwaTT
Créditos pelo Exp Ring Stages: Vodkart
Créditos pelo Script: OTLand
Abraços, espero que seja útil'