-
Total de itens
273 -
Registro em
-
Última visita
-
Dias Ganhos
4
Tudo que bepokemon postou
-
Bitch, please .... local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_INVISIBLE) local area = createCombatArea(AREA_CIRCLE3X3) setCombatArea(combat, area) function onCastSpell(cid, var) return doCombat(cid, combat, var) end
-
Eu fiz sem testar, mas acho que deve funcionar: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState, shopState = {}, {} 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 local m, stat = string.lower(msg), {} local tables = { sellAble = {['coconut'] = 10}, buyAble = {['coconut'] = 5} } function doPlayerAddHundreds(cid, itemid, count) -- By Byerne XTibia if count <= 100 then return doPlayerAddItem(cid, itemid, count) end local count_now = count while count_now > 100 do doPlayerAddItem(cid, itemid, 100) count_now = count_now - 100 end return doPlayerAddItem(cid, itemid, count_now) end if talkState[talkUser] == 0 then for table,list in ipairs(tables) do if list[m] then table.insert(stat[m], table) end end if #stat[m] == 2 then selfSay('Do you want to buy or sell '..m..'?', cid) shopState[talkUser] = {getItemIdByName(m)} talkState[talkUser] = 2 else talkState[talkUser] = 1 if stat[m][1] == 1 then selfSay('How many '..m..' do you want to sell?', cid) shopState[talkUser] = {getItemIdByName(m), 'sell', sellAble[m]} elseif stat[m][1] == 2 then selfSay('How many '..m..' do you want to buy?', cid) shopState[talkUser] = {getItemIdByName(m), 'buy', buyAble[m]} end end elseif talkState[talkUser] == 1 then if tonumber(msg) then shopState[talkUser][4] = tonumber(msg) talkState[talkUser] = 3 end elseif talkState[talkUser] == 2 then if msgcontains(msg, 'buy') then shopState[talkUser][2] = 'buy' shopState[talkUser][3] = buyAble[getItemNameById(shopState[talkUser][1])] talkState[talkUser] = 1 elseif msgcontains(msg, 'sell') then shopState[talkUser][2] = 'sell' shopState[talkUser][3] = sellAble[getItemNameById(shopState[talkUser][1])] talkState[talkUser] = 1 end elseif(talkState[talkUser] == 3 and msgcontains(msg, 'yes')) then local s = shopState[talkUser] if s[2] == 'sell' then if doPlayerRemoveItem(cid, s[1], s[4]) then doPlayerAddMoney(cid, s[3]*100) selfSay('Thank you very much.',cid) end else if doPlayerRemoveMoney(cid, s[3]*100) then doPlayerAddHundreds(cid, s[1], s[4]) selfSay('Here you are.', cid) end end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
Function Doplayeraddhundreds(Cid, Itemid, Count)
um tópico no fórum postou bepokemon Mods, funções e outros
Introdução Olá novamente, precisei utilizar essa funcao para um NPC que vende items, e a quantidade precisava ser maior que 100, entao criei essa funcao aqui pra galerinha quem precisar/quiser. =) Code function doPlayerAddHundreds(cid, itemid, count) -- By Byerne XTibia if count <= 100 then return doPlayerAddItem(cid, itemid, count) end local count_now = count while count_now > 100 do doPlayerAddItem(cid, itemid, 100) count_now = count_now - 100 end return doPlayerAddItem(cid, itemid, count_now) end Identado no pastebin. Versão mais longa e mal feita pelo Matheus function doPlayerAddHundreds(cid, itemid, count) doPlayerAddItem(cid, itemid, count > 100 and 100 or count) return count-100 > 0 and doPlayerAddHundreds(cid, itemid, count-100) or true end -
--// Requerimento para compatibilidade com as novas versões de OTServer \\ local mayNotMove = doCreatureSetNoMove function doPushCreature(pos, target) creature = getThingfromPos({x=target.x, y=target.y, z=target.z, stackpos=253}).uid if target.y < pos.y and target.x == pos.x then newpos = {x=target.x, y=target.y-1, z=target.z} elseif target.y > pos.y and target.x == pos.x then newpos = {x=target.x, y=target.y+1, z=target.z} elseif target.y == pos.y and target.x > pos.x then newpos = {x=target.x+1, y=target.y, z=target.z} elseif target.y == pos.y and target.x < pos.x then newpos = {x=target.x-1, y=target.y, z=target.z} elseif target.y < pos.y and target.x > pos.x then newpos = {x=target.x+1, y=target.y-1, z=target.z} elseif target.y > pos.y and target.x < pos.x then newpos = {x=target.x-1, y=target.y+1, z=target.z} elseif target.y > pos.y and target.x > pos.x then newpos = {x=target.x+1, y=target.y+1, z=target.z} elseif target.y < pos.y and target.x < pos.x then newpos = {x=target.x-1, y=target.y-1, z=target.z} end if creature > 0 then if queryTileAddThing(creature, newpos) == TRUE then doTeleportThing(creature, newpos, TRUE) end end end local arr = { [1] = { {1,1,1}, {1,2,1}, {1,1,1} }, [2] = { {0,1,1,1,0}, {1,0,0,0,1}, {1,0,2,0,1}, {1,0,0,0,1}, {0,1,1,1,0} }, [3] = { {0,0,1,1,1,0,0}, {0,1,0,0,0,1,0}, {1,0,0,0,0,0,1}, {1,0,0,2,0,0,1}, {1,0,0,0,0,0,1}, {0,1,0,0,0,1,0}, {0,0,1,1,1,0,0} }, [4] = { {0,0,0,1,1,1,0,0,0}, {0,0,1,0,0,0,1,0,0}, {0,1,0,0,0,0,0,1,0}, {1,0,0,0,0,0,0,0,1}, {1,0,0,0,2,0,0,0,1}, {1,0,0,0,0,0,0,0,1}, {0,1,0,0,0,0,0,1,0}, {0,0,1,0,0,0,1,0,0}, {0,0,0,1,1,1,0,0,0} } } function onTargetCreature(cid, target) doPushCreature(getCreaturePosition(cid), target) doCreateItem(2160, math.random(4,9), getThingPos(cid)) end combat = {} for n, v in pairs(arr) do combat[n] = createCombatObject() _G["callback"..n] = onTargetCreature setCombatCallback(combat[n], CALLBACK_PARAM_TARGETTILE, "callback"..n) setCombatParam(combat[n], COMBAT_PARAM_EFFECT, 2) setCombatArea(combat[n], createCombatArea(v)) end function onCastSpell(cid, var) mayNotMove(cid, TRUE) for i = 1, #combat do addEvent(doCombat, i*150-150, cid, combat[i], var) if i == #combat then addEvent(mayNotMove, i*150-150, cid, FALSE) end end return TRUE end
-
Quando ele loga ele ganha level, etc? Se for eh porque antes de ele ganhar os levels ele ganha o items, e nao tem cap para segura-los.
-
Já mudei lá. Era string.lower(msg) e não string.lower[msg].
-
Troca o onTimer() por onThink()
-
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState, outfitState = {}, {} 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 local outfits, msg = { ['gentleman'] = {101,278}, ['athletic'] = {104,165}}, string.lower(msg) local o = outfits[msg] if(o and talkState[talkUser] == 1) then selfSay('So you want to buy the '..msg..' clothes right? This will cost you '.. o[2] ..' dollars, are you taking it?') talkState[talkUser] = 2 outfitState[talkUser] = o elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 2) then local state = outfitState[talkUser] if getPlayerStorageValue(cid, state[1]) <= 0 then if(doPlayerRemoveMoney(cid, state[2] * 100)) then selfSay('Very nice choice! Thanks for it!') setPlayerStorageValue(cid, state[1], 1) doPlayerSendOutfitWindow(cid) else selfSay('Oh dear, you can\'t afford for this clothes.') end else selfSay('You have already bought this clothes sweetie!') end talkState[talkUser] = 1 elseif(msgcontains(msg, 'no') and talkState[talkUser] == 2) then selfSay('Yeah, you are right. This was not the best for you.') talkState[talkUser] = 1 elseif(msgcontains(msg, 'offer') or msgcontains(msg, 'list') or msgcontains(msg, 'clothes')) then if getPlayerSex(cid) == 1 then selfSay('I can sell you some {gentleman} clothes, or else you could try the {elite} pokemon trainer clothes, or maybe an {athletic} clothes, what do you think?') elseif getPlayerSex(cid) == 0 then selfSay('Hmm, what about some {lady} clothes? If you don\'t like it i can sell you an {elite} pokemon trainer clothes, or maybe the newest clothes available, the {athletic} clothes.') end talkState[talkUser] = 1 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Soh precisa mudar la na table. [ 'nome do outfit'] = {storage, preco em dolares}, Boa sorte.
-
Coloque logo abaixo, tipo assim: ----------------- FIM DAS CONFIG ----------------- if getGlobalStorageValue(21928) == -1 then doPlayerSendCancel(cid, "The castle war is closed.") return true end
-
Uma condicao na alavanca. Se quiser, poste o script que eu coloco ..
-
Sem alguém para coordenar os scripters, no caso do meu projeto que são 3. Tudo fica uma completa bagunca. Normalmente é apenas o mais experiente, tanto em scripting quanto em projetos. Mas eu acho que tem que ser o mais dedicado e responsável.
-
Troque onTimer() por onThink().
-
Seria assim, voce colocaria um attributo no item "storagetoequip". De preferencia um entre 15000 e 16000. (Exemplo) O Script checaria se o player tem um storage deste mesmo numero positivo. E se tiver entao ele poderá equipar tal item. Repensei agora e só daria certo por unique id. function onEquip(cid, item, slot) if getPlayerStorageValue(cid, item.uid) == -1 then doPlayerSendCancel(cid, "You can't equip this item.") return false end return true end A tag ficaria assim: <movevent type="Equip" fromuid="15000" touid="16000" slot="hand" event="script" value="nome seu script.lua"/> Ai voce teria que colocar o uid do item X. E o player teria que ter um storage de mesmo valor X igual a 1 para usa-lo.
-
Bom, era aonde voce ja tinha colocado, tem como voce repostar o script em um code? Deu uma bugada aqui e eu nao consigo ler.
-
doItemSetAttribute(new_item.uid, "description", 'Pertence a ' .. getCreatureName(cid) .. ' [iD:' .. id .. '].')
-
function onSay(cid, words, param) t = {["open"] = 1, ["close"] = -1} setGlobalStorageValue(21928, t[param]) doBroadcastMessage("The castle war is now "..param.."ed.") return true end Agora precisa colocar um IF na alavanca: if getGlobalStorageValue(21928) == -1 then doPlayerSendCancel(cid, "The castle war is closed.") return true end
-
Primeiro você vai ter que criar uma coluna nova em accounts. Execute esta query na sua database: ALTER TABLE accounts ADD first_vip INTEGER NOT NULL DEFAULT 0 Agora coloque dentro do seu login.lua if getDataInt(db.getResult("SELECT `first_vip` FROM `accounts` WHERE `id` = '".. getPlayerAccountId(cid) ..";")), "first_vip")) == 0 then -- função que adiciona 1 dia vip ao player db.executeQuery("SET `first_vip` == '1' FROM `accounts` WHERE `id` "".. getPlayerAccountId(cid) .."' end
-
1- [Warning - Spawns::loadFromXml] Sibang ( 00087 / 00213 / 007 ) spawntime cannot be less than 1 seconds. 2- [Warning - IOMap::loadMap] Movable item in house: 384, item type: 1740, pos 512/344/8 3- [Warning - Houses::loadFromXml] House entry not set for: Forgotten headquarter (Flat 1, Area 42) (384) 3- [Warning - Houses::loadFromXml] House entry not set for: Forgotten headquarter (Flat 1, Area 42) (387) Um monstro "Sibang" está com o respawn rápido demais. Vá no map editor, procure o "Sibang" na posição (87,213,07) e mude seu tempo de respawn para 30 segundos ou mais. Existe um item que pode ser movido dentro da casa número 384. Ele é de itemid 1740 e está na posição (512,344,8) delete-o. As duas casas (384 e 387) não tem "saída/entrada". Você deve clicar na ferramentas de house, e em set house entry pelo map editor, e logo após clicar em um SQM do lado de fora da casa (enfrente a porta). Se quiser, pode postar o seu arquivo map.xml e eu o edito.
-
Ajuda!script De Fechar Portas Por Talkactions.
pergunta respondeu ao leandroskt8 de bepokemon em Scripts
Você tem TeamViewer? Posso entrar e configurar pra você. ._. Resolvemos qualquer problema o/- 28 respostas
-
- ajuda!script de fechar portas
- tibia
- (e 2 mais)
-
Ajuda!script De Fechar Portas Por Talkactions.
pergunta respondeu ao leandroskt8 de bepokemon em Scripts
O meu se estivesse funcionando seria só mudar fromPos e toPos e o script procuraria todas as portas e trocaria elas. No caso da table doors teria que adicionar 27 portas. O entendimento do seu script é bem mais fácil. Mas colocar 27 portas e mais tenso que duas posicoes. Anyways, nao to querendo competir nem nada ._. [ironic]Afinal, todos sabemos que voce nao sabe nada de scripting e perderia muito feio.[/ironic]- 28 respostas
-
- ajuda!script de fechar portas
- tibia
- (e 2 mais)
-
Voce não está errada. O SISTEMA leva tanto actions quanto movements. Para ver oque é oque lembresse disso:
-
Preciso De Um Npc Que Treine Jutsus E Se Puder Também De Mudar De Vocaçao !
tópico respondeu ao vaicente de bepokemon em Lixeira Pública
Outra dica. Do que aditanta fazer um "OT" de "Naruto" se voce nao tem a minima ideia do que está fazendo? Procure um Scripter que possa te ajudar, mesmo sendo meu trabalho, que eu faco com todo prazer, criar scripts para contribuir com a comunidade eu nao gosto de pensar que estou fazendo um OT inteiro para outra pessoa. -
Preciso De All Monsters Do Narutibia ! Ajuda Ae.
tópico respondeu ao vaicente de bepokemon em Lixeira Pública
Vou pedir que ultize a secao de pedidos para fazer qualquer tipo de pedido. Qualquer pedido em area indevida a partir desta data sera negativado. -
talkaction [Talkactions] Mana Scroll
tópico respondeu ao rogeriocene de bepokemon em Actions e Talkactions
Isso vai acabar fazendo ultrapassar do valor limite, melhor deixar assim: setCreatureMaxMana(cid, math.min(1807735400, getCreatureMaxMana(cid) + 7500000)) -
Galera Quando Eu Boto Para Meu Otserv Ficar Online Da Erro Na Conf.lua
tópico respondeu ao tibia0roberto de bepokemon em Lixeira Pública
Definitavemente não é isso. Ele não tá conseguindo ler o arquivo por algum erro de escrita. Tente tirar todos os comentários. (-- Tipo assim)
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.