- Fórum
- OTServ
- Recursos
- Scripting
- Actions e Talkactions
- [moveevent] Luva De Akilliz
DG
moveevent
[moveevent] Luva De Akilliz
Por dgprado, 30 de ago. de 2009 em Actions e Talkactions
otserv
tibia
script
2
1.7k
1 mês depois...
21 de setembro de 2009 às 12:31
Editado Setembro 21 por EdImundo


info
Grupo: Barão
Registrado: 06/07/08
Posts: 206
Reputação: +14
Char no Tibia: Nao Jogo tibia
Agora esta gastando o tempo corretamente script fixed por Marcryzius.
Testado no crying dansom 0.3.5 pl1(8.5)
Bom este e um item muito bacana e com certeza sera muito cobiçado em qualquer servidor, principalmente os de baixa xp. Quando voce veste a luva voce passa a ganhar 2x a xp das criaturas e quando voce tira vc volta a ganhar a xp normal, porem este item tem 60 minutos de duraçao, que pode ser facilmente modificado. Quando descarregar a luva, ela podera ser recarregada por um npc da mesma forma q uma soft boots
Os itens usados serao os de numero 10309, 10310, 10311 "Claw of 'The Noxious Spawn", o 10309 sera a luva equipada, o 10310 a luva desequipada e o 10311 a luva descarregada.
Primeiro vamos modificar os itens no itens.xml para dar-lhes os devidos atributos, ficarao assim :
<item id="10309" article="a" name="Luva de Akilliz"> <attribute key="weight" value="40"/> <attribute key="description" value="Voce pode sentir o poder desta luva."/> <attribute key="slotType" value="ring"/> <attribute key="decayTo" value="10311"/> <attribute key="transformDeEquipTo" value="10310"/> <attribute key="duration" value="3600"/> <attribute key="showduration" value="1"/> </item> <item id="10310" article="a" name="Luva de Akilliz"> <attribute key="weight" value="40"/> <attribute key="description" value="Dizem os sabios que esta luva pode aumentar seu poder evolutivo quando vestida."/> <attribute key="slotType" value="ring"/> <attribute key="transformEquipTo" value="10309"/> <attribute key="stopduration" value="1"/> <attribute key="showduration" value="1"/> </item> <item id="10311" article="a" name="Luva de Akilliz descarregada"> <attribute key="weight" value="40"/> <attribute key="description" value="Talvez o homem mais forte do mundo possa recarregar este poderoso acessorio."/> </item>Agora va na pasta movements/scripts copie qualker arquivo e renomeie para luva.lua, apague tudo e cole o code abaixo:
Agora va na pasta movements e adicione as tags no movements.xml como segue abaixo:
Feito a luva esta pronta, agora so falta o npc que ira carrega-la.(Nao entrarei em muitos detalhes sobre o npc).
Aki vai o xml do npc:
<?xml version="1.0" encoding="UTF-8"?> <npc name="Akilliz" script="data/npc/scripts/Akilliz2.lua" access="3" lookdir="1" walkinterval="2000"> <health now="1" max="1"/> <parameters> <parameter key="message_greet" value="Posso recarregar sua {luva} magica." /> </parameters> <look type="255" head="78" body="19" legs="19" feet="114" corpse="3128"/> </npc>Aki o .lua do npc:
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, 'luva') or msgcontains(msg, 'magica')) then selfSay('Voce gostaria de recarregar sua luva por 50000 moedas de ouro?', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if(getPlayerItemCount(cid, 10311) >= 1) then if(doPlayerRemoveMoney(cid, 50000)) then local item = getPlayerItemById(cid, true, 10311) doTransformItem(item.uid, 10310) selfSay('Aki esta.', cid) else selfSay('Voce nao tem 50k.', cid) end elseif(getPlayerItemCount(cid, 10311) >= 1) then if(doPlayerRemoveMoney(cid, 50000)) then local item = getPlayerItemById(cid, true, 10311) doTransformItem(item.uid, 10310) selfSay('Here you are.', cid) else selfSay('Voce nao tem 50k.', cid) end else selfSay('Voce nao tem uma luva descarregada.', cid) end talkState[talkUser] = 0 elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser])) then talkState[talkUser] = 0 selfSay('Ok.', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())O movement eu catei no otland post do dragaoart, mas tamb n era dele o script, e era um ring nao recarregavel, a montagem dos itens eu fiz e o npc adaptei a partir da soft boots, muito simples porem axo que fico muito bacana, no meu server eu fiz uma quest com varias missoes para a galera suar tentando catar este item, dae nada mais justo que ele poder ser recarregado.
Espero q gostem, acabei de terminar este item e apesar de eu ter testado pode haver algum bug.
Thx :smile_positivo: GODines :smile_positivo:
Editado Setembro 6 por dgprado