- Mundo Conhecido
- [Resolvido]Problema com spears, bolt e arrow
-
setCreatureLight
O que significa o -1? Faz muito tempo que eu não trabalho com otserv.
-
setCreatureLight
Eu não quero colocar time, quero setar pra infinito o tempo enquanto a pessoa usar o item -EDIT- funcionou, mas como eu faço pro tempo ficar infinito?
-
setCreatureLight
dae, beleza? Tou fazendo um script pra um item, que quando ele é movido pra um slot (como se fosse a mão, a backpack, o necklace, enfim) ele altera a luz do personagem. Como se fosse uma torch, uma magiclight wand, mas sem precisar dar use no item. tenho o seguinte script function onEquip(cid, item, slot) function doSetCreatureLight(cid, lightLevel, lightColor, time) condition = createConditionObject(CONDITION_LIGHT) setConditionParam(condition, CONDITION_PARAM_LIGHT_LEVEL, 10) setConditionParam(condition, CONDITION_PARAM_LIGHT_COLOR, 212) doAddCondition(cid, condition) end return TRUE end A questão é: Ele funciona, mas só quando eu uso o meu GOD. Qualquer player, quando equipa o item, não acontece nada. Quando meu god equipa o item, o ambiente fica iluminado. alguém sabe o que pode estar acontecendo? Agora, existe outra maneira de abordar essa questão usando o seguinte script: function onEquip(cid, item, slot) local pos = getCreaturePosition(cid) if getPlayerSlotItem(cid,CONST_SLOT_BACKPACK).itemid == 10521 then doSetCreatureLight(pos,11,205) end return TRUE end Nessa segunda ocasião o erro é o seguinte: [19/07/2012 02:28:52] [Error - MoveEvents Interface] [19/07/2012 02:28:52] data/movements/scripts/shine.lua:onEquip [19/07/2012 02:28:52] Description: [19/07/2012 02:28:52] (luaDoAddCondition) Creature not found Agradeço desde já!
-
Problema com spears
8.6
-
Problema com spears
Dae galera, beleza? Eu to usando um server TFS não lembro a versão.. A qeustão é a seguinte: Quando eu uso spears e a função removeAmmo tá como "yes" no config.lua, os spears são lançados, não voltam pra mão e somem (como se eles quebrassem de primeira). No items.xml existe uma chance de 6% de quebra e MOVEBACK. Alguem sabe me dizer o que tá acontecendo de errado? Agradeço desde já
-
NPC de Quest [2]
Eu tentei aqui, deu Unexpected symbol near then at line 23. Mas dei uma olhada lá parece tudo certinho.. Agora eu to sem tempo pra ver isso ai, de noite eu volto pra dar uma olhada melhor. -EDIT- Beleza, eu olhei o script, achei o erro nele, arrumei ele e funcionou. Vc consegue me explicar por cima o que foi feito pra arrumar, qual era o problema?
-
NPC de Quest [2]
eu fiz isso, agora tá assim: 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 storage1 = 171717 if (msgcontains(msg,'Piece of Draconian Steel')) then if getPlayerStorageValue(cid,storage1) >= 1 then selfSay("I can\'t help you anymore, you already got your obsidian knife", cid) talkState[talkUser] = 0 end if getPlayerStorageValue(cid,storage1) < 1 then selfSay("You bringing me draconian steel and obsidian lance in exchange for obsidian knife?",cid) talkState[talkUser] = 1 elseif (msgcontains(msg,'yes') and talkState[talkUser] == 1) then if(getPlayerItemCount(cid,2425) >= 1) and (getPlayerItemCount(cid,5889) >= 1) then doPlayerRemoveItem(cid, 2425, 1) doPlayerRemoveItem(cid, 5889, 1) doPlayerAddItem(cid,5908,1) setPlayerStorageValue(cid,storage1,1) selfSay("You have it.",cid) talkState[talkUser] = 0 else selSay("You need to bring me a Piece of Draconian Steel and a Obsidian Lance.",cid) talkState[talkUser] = 0 end end end return true end npcHandler:setMessage(MESSAGE_GREET, "Hiho Player! Wanna weapon, eh?") npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) e tá dando o seguinte erro: Uploaded with ImageShack.us
-
NPC de Quest [2]
Dae galera, seguinte: tou fazendo outro npc, o UZGOD do tibia RL. Tenho o seguinte script: 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 storage1 = 171717 if (msgcontains(msg,'Piece of Draconian Steel')) then if getPlayerStorageValue(cid,storage1) >= 1 then selfSay("I can\'t help you anymore, you already got your obsidian knife", cid) talkState[talkUser] = 0 end if getPlayerStorageValue(cid,storage1) < 1 then selfSay("You bringing me draconian steel and obsidian lance in exchange for obsidian knife?",cid) talkState[talkUser] = 1 if (msgcontains(msg,'yes') and talkState[talkUser] == 1) then if (doPlayerRemoveItem(cid,5889,1) == TRUE and doPlayerRemoveItem(cid,2425,1) == TRUE) then doPlayerAddItem(cid,5908,1) setPlayerStorageValue(cid,storage1,1) selfSay("You have it.",cid) talkState[talkUser] = 0 else selSay("You need to bring me a Piece of Draconian Steel and a Obsidian Lance.",cid) talkState[talkUser] = 0 end end end end end npcHandler:setMessage(MESSAGE_GREET, "Hiho Player! Wanna weapon, eh?") npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) E o meu problema é que quando vc fala piece of draconian steel e depois YES, ele não remove os itens de ID 5889 e 2425, nem adiciona o item de id 5908 Quem aí pode me ajudar? Valeu
-
Problema com NPC de quest
bom, dei uma limpada no script e mesmo assim não tá funcionando 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 stg1 = 17171 --status da bast skirt stg2 = 17172 --Status da missão completa local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if (msgcontains(msg, "uth'lokr") or msgcontains(msg, "Uth'lokr") or msgcontains(msg, "uth'Lokr") or msgcontains(msg, "Uth'Lokr")) then if getPlayerStorageValue(cid, stg2) >= 1 then --testa se já completou a missão selfSay("Sorry, you already completed this mission!!", cid) talkState[talkUser] = 0 else --se não completou a missão selfSay("Firy steel it is. Need green ones' breath to melt. Or red even better. Me can make from shield. Lil' one want to trade?", cid) if msgcontains(msg, "yes") then if getPlayerStorageValue(cid, stg1) >= 1 then --testa se já entregou skirts if doPlayerRemoveItem(cid, 2516, 1) == TRUE then doPlayerAddItem(cid, 5889,1) setPlayerStorageValue(cid, stg2, 1) selfSay("Cling clang!, Good bye lil' one",cid) talkState[talkUser] = 0 else selfSay("You don't have a Dragon Shield, get one and come back!",cid) talkState[talkUser] = 0 end end if getPlayerStorageValue(cid, stg1) < 1 then --se ele não entregou selfSay("Me need gift for woman. We dance, so me want to give her bast skirt. But she big is. So I need many to make big one. Bring three okay? Me wait.", cid) if msgcontains(msg, "bast skirt") then if doPlayerRemoveItem(cid,3983,3) then -- remove bastskirts selfSay("Good good! Woman happy will be. Now me happy too and help you.",cid) setPlayerStorageValue(cid, stg1, 1) if doPlayerRemoveItem(cid, 2516, 1) == TRUE then doPlayerAddItem(cid, 5889,1) setPlayerStorageValue(cid, stg2, 1) selfSay("Cling clang!, Good bye lil' one",cid) talkState[talkUser] = 0 else selfSay("You don't have a Dragon Shield, get one and come back!",cid) talkState[talkUser] = 0 end else selfSay("Go get and bring to me, then me help you.",cid) talkState[talkUser] = 0 end end end else return TRUE end end else selfSay("I'm the Obsidian Knife NPC",cid) end end npcHandler:setMessage(MESSAGE_GREET, "Hum Humm! Welcume lil' player.") npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) agora ele tá indo direto pra mensagem "I'm the Obsidian Knife NPC" consegue resolver isso aí?
-
Problema com NPC de quest
Dae galera, de boa? Eu to fazendo a quest da obsidian knife bem parecida com a do Global, pra isso eu preciso do NPC A Sweaty Cyclops. Eis que eu comecei a desenvolver o código dele que é o seguinte: 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 stg1 = 17171 --status da bast skirt stg2 = 17172 --Status da missão completa local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if (msgcontains(msg, "uth'lokr") or msgcontains(msg, "Uth'lokr") or msgcontains(msg, "uth'Lokr") or msgcontains(msg, "Uth'Lokr")) then if getPlayerStorageValue(cid, stg2) >= 1 then --testa se já completou a missão selfSay("Sorry, you already completed this mission!!", cid) talkState[talkUser] = 0 else --se não completou a missão selfSay("Firy steel it is. Need green ones' breath to melt. Or red even better. Me can make from shield. Lil' one want to trade?", cid) if msgcontains(msg, "yes") then if getPlayerStorageValue(cid, stg1) >= 1 then --testa se já entregou skirts if doPlayerRemoveItem(cid, 2516, 1) == TRUE then doPlayerAddItem(cid, 5889,1) setPlayerStorageValue(cid, stg2, 1) selfSay("Cling clang!, Good bye lil' one",cid) talkState[talkUser] = 0 else selfSay("You don't have a Dragon Shield, get one and come back!",cid) talkState[talkUser] = 0 end else --se ele não entregou selfSay("Wait. Me work no cheap is. Do favour for me first, yes?", cid) if msgcontains(msg, "yes") then selfSay("Me need gift for woman. We dance, so me want to give her bast skirt. But she big is. So I need many to make big one. Bring three okay? Me wait.", cid) if msgcontains(msg, "bast skirt") then selfSay("So Lil' one bring 3 bast skirts?",cid) if msgcontains(msg, "yes") then if doPlayerRemoveItem(cid,3983,3) then -- remove bastskirts selfSay("Good good! Woman happy will be. Now me happy too and help you.",cid) setPlayerStorageValue(cid, stg1, 1) if doPlayerRemoveItem(cid, 2516, 1) == TRUE then -- remove dragon shield doPlayerAddItem(cid, 5889,1) -- dá o draconian steel setPlayerStorageValue(cid, stg2, 1) -- marca como terminada a missão selfSay("Cling clang!, Good bye lil' one",cid) talkState[talkUser] = 0 else selfSay("You don't have a Dragon Shield, get one and come back!",cid) talkState[talkUser] = 0 end else selfSay("Go get and bring to me, then me help you.",cid) talkState[talkUser] = 0 end else selfSay("Bring me 3 Bast Skirts",cid) talkState[talkUser] = 0 end else selfSay("Good bye lil' one.",cid) talkState[talkUser] = 0 end else selfSay("See you later.",cid) talkState[talkUser] = 0 end end else selfSay("ByeBye",cid) talkState[talkUser] = 0 end end else selfSay("I'm the Obsidian Knife NPC",cid) end end npcHandler:setMessage(MESSAGE_GREET, "Hum Humm! Welcume lil' player.") npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Quando eu abro o OT, nenhum problema acontece. Porém, quando eu falo com o npc, HI, Uth'Lokr ele responde o seguinte: "Firy steel it is. Need green ones' breath to melt. Or red even better. Me can make from shield. Lil' one want to trade?" e depois ele termina a conversa com "Byebye". Parece que ele ignora tudo e vai pro final. alguém sabe qual o erro no meu script? Agradeço desde já.
-
-
Problema com Movements scripts
consegui cara, valeu ae -EDIT- Detalhe a considerar. doCreatureSay não funcionou, mas se eu colocar doSendAnimatedText funciona, tem ideia porquê?
-
Problema com Movements scripts
Agora bugou de vez, toda vez que eu crio uma sword buga tudo e fexa o tibia :X Além disso, no console diz: [Warning - Event ::loadScript] Evend onDeEquip not found <data/movements/scripts/swordsound.lua> Obviamente, como não tem nenhum evento de DeEquip no script lua, ele dá essa mensagem. A questão é: Sou obrigado a colocar algo com DeEquip? do tipo Function onDeEquip(cid,item,slot)?
-
Problema com Movements scripts
Não fez diferença colocar HANDS em slot, e também não fez diferença colocar o end e o return no final da função.. ainda assim nada acontece