Ir para conteúdo

Storm

Héroi
  • Registro em

  • Última visita

Tudo que Storm postou

  1. @Jociel local t = { [569] = {570, 1020, 3000, 3000}, } local itemid, count = 8306 , 1 local level = 1500 local newlevel = 1 -- Level apos resetar 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) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local a = t[getPlayerVocation(cid)] local playerid = getPlayerGUID(cid) if msgcontains(msg, "mystic promotion") then if a then if getPlayerLevel(cid) >= level then if doPlayerRemoveItem(cid, itemid, count) then local outfit = {lookType = a[2]} doPlayerSetVocation(cid, a[1]) doCreatureChangeOutfit(cid, outfit) setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + a[3]) setCreatureMaxMana(cid, getCreatureMaxMana(cid) + a[4]) db.executeQuery("UPDATE `players` SET `level`="..newlevel..",`experience`= 0 WHERE `players`.`id`= ".. playerid .."") addEvent(doRemoveCreature, 1000, cid) else selfSay('Voce precisa de '.. count ..' '.. getItemInfo(itemid).name ..' para fazer a Mystic Promotion.', cid) end else selfSay('Você precisa estar no level '.. level ..'.', cid) end else selfSay('Sua Vocation não tem Promotion disponivel, Voce Precisa estar na ultima Transform!', cid) end return true end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  2. Storm postou uma resposta no tópico em Suporte Tibia OTServer
    @Emanueldk Agora tá funcional , testei em meu próprio servidor : function onUse(cid, item, fromPosition, itemEx, toPosition) local pos = getCreaturePosition(cid) if getPlayerBlessing(cid, 5) then doPlayerSendCancel(cid, "Você já tem todas as bless.") doSendMagicEffect(pos, 3) return true end doSendMagicEffect(pos, 3) doPlayerSendTextMessage(cid, 27, "voce foi abencoado pelos deuses") for b = 1, 5 do doPlayerAddBlessing(cid, b) end return true end
  3. Storm postou uma resposta no tópico em Suporte Tibia OTServer
    @Emanueldk local cost = 1000 -- Quanto irá custar a bless function onUse(cid, item, itemEx, fromPosition, toPosition) local pos = getCreaturePosition(cid) if getPlayerBlessing(cid, 5) then doPlayerSendCancel(cid, "Você já tem todas as bless.") return false end if doPlayerRemoveMoney(cid, cost) then for b = 1, 5 do doPlayerAddBlessing(cid, b) doSendMagicEffect(pos, 2) doPlayerSendTextMessage(cid, 27, "voce foi abencoado pelos deuses") end else doSendMagicEffect(pos, 2) return doPlayerSendTextMessage(cid, 27, "Você não tem grana") end return true end
  4. Este tópico foi movido para a área correta. Esta é uma mensagem automática! Pedimos que leia as regras do fórum!
  5. local block = {11192, 2090} -- Coloque aqui os itens bloqueados function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end if isInArray(block, tonumber(t[1])) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce não pode criar esses itens") return true end local t = string.explode(param, ",") local ret = RETURNVALUE_NOERROR local pos = getCreaturePosition(cid) local id = tonumber(t[1]) if(not id) then errors(false) id = getItemIdByName(t[1]) errors(true) if(not id) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item with such name does not exists.") return true end end local amount = 100 if(t[2]) then amount = t[2] end local item = doCreateItemEx(id, amount) if(t[3] and getBooleanFromString(t[3])) then if(t[4] and getBooleanFromString(t[4])) then pos = getCreatureLookPosition(cid) end ret = doTileAddItemEx(pos, item) else ret = doPlayerAddItemEx(cid, item, true) end if(ret ~= RETURNVALUE_NOERROR) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Couldn't add item: " .. t[1]) return true end doDecayItem(item) if(not isPlayerGhost(cid)) then doSendMagicEffect(pos, CONST_ME_MAGIC_RED) end return true end
  6. Este tópico foi movido para a área correta. Esta é uma mensagem automática! Pedimos que leia as regras do fórum!
  7. @mullino
  8. Aqui no TibiaKing mensagens como UP e BUMP são proibidas, utilize o botão subir este tópico. Esta é uma mensagem automática! Pedimos que leia as regras do fórum!
  9. @Daniel Parece que você está copiando errado , ta aparecendo uns erros estranhos , enfim testei na minha propria base e não está com esses erros, vou te mandar a script atualizada e voce baixa e cola creatureScripts.lua // Essa aqui vai ficar na pasta creaturescripts talkactions.lua // Esse vai ficar na talkactions No login.lua , você vai remover o evento que você adicionou desse sistema do Vankk, e vai registrar no monster em que você quiser essa tag <script> <event name="Event"/> </script> Agora novamente no login.lua , você vai dar um CTRL + F e procurar por RETURN TRUE, e em cima do return true você vai colocar esse código local storage = { a = 134567, -- Storage que ganhará ao matar o monstro b = 341567, -- Storage que ganhará ao matar 5 monstros c = 123457 -- Storage que ganhará ao ganhar o item } if getCreatureStorage(cid, 134511) == -1 then doCreatureSetStorage(cid, storage.a, 0) doCreatureSetStorage(cid, storage.b, 0) doCreatureSetStorage(cid, storage.c, 0) doCreatureSetStorage(cid, 134511, 1) end Agora em creatureScripts.XML você cola a tag <event type="death" name="Sol" event="script" value="sol.lua"/>
  10. Este tópico foi movido para a área correta. Esta é uma mensagem automática! Pedimos que leia as regras do fórum! @aicilopmes123 Dar up em tópicos é proibido , já existe uma ferramenta para isso.
  11. @Daniel Você está errando nas configurações , primeiro que na XML fica assim <event type="death" name="Sol" event="script" value="sol.lua"/> Não precisa registrar evento no login.lua , apenas registra na XML do monstro
  12. @Daniel Remova essa parte , não há necessidade: local monsters { d = {"Demon", "dragon", "orc"], } Você vai registrar na XML de cada monstro e a script valerá por todos
  13. @Daniel Sim , não esqueça de registrar no XML
  14. Storm postou uma resposta no tópico em Suporte Tibia OTServer
    Aqui no TibiaKing mensagens como UP e BUMP são proibidas, utilize o botão subir este tópico. Esta é uma mensagem automática! Pedimos que leia as regras do fórum!
  15. Tem como, mas existem várias formas, tem alguma preferência ?
  16. CreatureScripts local storage = { a = 13456, -- Storage que ganhará ao matar o monstro b = 34156, -- Storage que ganhará ao matar 5 monstros c = 12345 -- Storage que ganhará ao ganhar o item } local required = 5 -- Quantos monstros terá que matar local itemid, count = 2160, 5 -- Item ID e sua count function onDeath(cid, corpse, deathList) local killer = deathList[1] if isPlayer(killer) and isMonster(cid) then doCreatureSetStorage(killer, storage.a, getCreatureStorage(killer, storage.a) + 1) if getCreatureStorage(killer, storage.a) >= required then doCreatureSetStorage(killer, storage.a, 0) doCreatureSetStorage(killer, storage.b, getCreatureStorage(killer, storage.b) + 1) doCreatureSetStorage(killer, storage.c, getCreatureStorage(killer, storage.c) + 1) doPlayerAddItem(killer, itemid, count) doPlayerSendTextMessage(killer, 18, "Voce recebeu ".. count .." ".. getItemInfo(itemid).name .." ao matar o monstro.") return true end return true end return true end Login.lua , antes do ultimo return true você adiciona essas linhas: local storage = { a = 13456, -- Storage que ganhará ao matar o monstro b = 34156, -- Storage que ganhará ao matar 5 monstros c = 12345 -- Storage que ganhará ao ganhar o item } if getCreatureStorage(cid, 13451) == -1 then doCreatureSetStorage(cid, storage.a, 0) doCreatureSetStorage(cid, storage.b, 0) doCreatureSetStorage(cid, storage.c, 0) doCreatureSetStorage(cid, 13451, 1) end Talkactions local required = 5 -- Quantos monstros terá que matar local storage = { a = 13456, -- Storage que ganhará ao matar o monstro b = 34156, -- Storage que ganhará ao matar 5 monstros c = 12345 -- Storage que ganhará ao ganhar o item } function onSay(cid, words, param, channel) doPlayerSendTextMessage(cid, 27, "Você já matou ".. getCreatureStorage(cid, storage.b) * required .." e recebeu ".. getCreatureStorage(cid, storage.c) .." itens especiais") return true end
  17. @mullino Tentar resolver o erro as cegas assim é impossível , você vai ter que usar um depurador para descobrir em que arquivo isso ocorreu , alguns tutoriais aqui http://www.lrc.ic.unicamp.br/~luciano/courses/mc202-2s2009/tutorial_gdb.txt https://www.vivaolinux.com.br/artigo/Aprendendo-a-utilizar-o-GNU-Debugger-(parte-1)
  18. È linux ?
  19. @Luccaw Perdão pelos meus erros, agora vai: local config = { time = 5, -- Minutos para o player sair da area global = 3242, -- Global storage storage = 3214, -- Storage cost = 1000, -- Custo para entrar dentro = {x = 94 , y = 200, z = 7}, -- Pos de dentro da arena onde sera teleportado ao iniciar o evento fora = {x = 90, y = 195, z = 6} -- Pos de fora da arena onde ele sera teleportado ao acabar o tempo } local toPos = {x = 94 , y = 200, z = 7} -- | -- | Começo e final da arena local fromPos = {x = 94 , y = 200, z = 7} -- | local function Arena(cid) if isPlayer(cid) then if getCreatureStorage(cid, config.storage) == 1 then doCreatureSetStorage(cid, config.storage, -1) doTeleportThing(cid, config.fora) return true end return true end doSetStorage(config.global, -1) return true end function onUse(cid, item, fromPosition, itemEx, toPosition) local pos = getCreaturePosition(cid) if getStorage(config.global) == -1 then if doPlayerRemoveMoney(cid, config.cost) then doTeleportThing(cid, config.dentro) doCreatureSetStorage(cid, config.storage, 1) doSetStorage(config.global, 1) addEvent(Arena, 60 * config.time * 1000, cid) return doPlayerSendTextMessage(cid, 26, "Voce iniciou a arena") else doPlayerSendTextMessage(cid, 27, "Voce precisa de ".. config.cost .." money para entrar na arena") return doSendMagicEffect(pos, 3) end else doPlayerSendTextMessage(cid, 27, "Já existe alguem na arena no momento, aguarde.") return doSendMagicEffect(pos, 3) end return true end
  20. @Luccaw Você pode criar uma script para cada arena , mudando os storages
  21. @Luccaw Tenta assim local config = { time = 5, -- Minutos para o player sair da area global = 3242, -- Global storage storage = 3214, -- Storage cost = 1000, -- Custo para entrar dentro = {x = 94 , y = 200, z = 7}, -- Pos de dentro da arena onde sera teleportado ao iniciar o evento fora = {x = 90, y = 195, z = 6} -- Pos de fora da arena onde ele sera teleportado ao acabar o tempo } local toPos = {x = 94 , y = 200, z = 7} -- | -- | Começo e final da arena local fromPos = {x = 94 , y = 200, z = 7} -- | local function Arena(cid) if isPlayer(cid) then if getCreatureStorage(cid, config.storage) == 1 then doCreatureSetStorage(cid, config.storage, -1) doTeleportThing(cid, config.fora) return true end return true end doSetStorage(config.global, -1) return true end function onUse(cid, item, fromPosition, itemEx, toPosition) local pos = getCreaturePosition(cid) if getStorage(config.global) == -1 then if doPlayerRemoveMoney(cid, config.cost) then doTeleportThing(cid, config.dentro) doCreatureSetStorage(cid, config.storage, 1) addEvent(Arena, 60 * config.time * 1000, cid) return doPlayerSendTextMessage(cid, 26, "Voce iniciou a arena") else doPlayerSendTextMessage(cid, 27, "Voce precisa de ".. config.cost .." money para entrar na arena") return doSendMagicEffect(pos, 3) end else doPlayerSendTextMessage(cid, 27, "Já existe alguem na arena no momento, aguarde.") return doSendMagicEffect(pos, 3) end return true end
  22. @Luccaw Pode dar um exemplo ? não entendi muito bem
  23. @Luccaw Não esqueça de registrar no login.lua , sobre a action , da algum erro ? <event type="preparedeath" name="arena" event="script" value="arena.lua"/>
  24. Storm postou uma resposta no tópico em Suporte OTServer Derivados
    Este tópico foi movido para a área correta. Esta é uma mensagem automática! Pedimos que leia as regras do fórum!
  25. @TrafalgarLaw local function isWalkable(pos, creature, proj, pz)-- by Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true 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 onCastSpell(cid, var) local effect = 13 -- Efeito ao teleportar local a = {x = getCreaturePosition(cid).x, y = getCreaturePosition(cid).y - 10, z = getCreaturePosition(cid).z} -- North local b = {x = getCreaturePosition(cid).x, y = getCreaturePosition(cid).y + 10, z = getCreaturePosition(cid).z} -- South local c = {x = getCreaturePosition(cid).x - 10, y = getCreaturePosition(cid).y, z = getCreaturePosition(cid).z} -- West local d = {x = getCreaturePosition(cid).x + 10, y = getCreaturePosition(cid).y, z = getCreaturePosition(cid).z} -- East local pos = getCreaturePosition(cid) if getCreatureLookDirection(cid) == NORTH then if isWalkable(a, true, true, true) and not getHouseFromPos(a) then doSendMagicEffect(pos, effect) doSendMagicEffect(a, effect) return doTeleportThing(cid, a) else doPlayerSendTextMessage(cid, 27, "A posição onde você quer ir não é andavel") return doSendMagicEffect(getCreaturePosition(cid), 2) end elseif getCreatureLookDirection(cid) == SOUTH then if isWalkable(b, true, true, true) and not getHouseFromPos(b) then doSendMagicEffect(pos, effect) doSendMagicEffect(b, effect) return doTeleportThing(cid, b) else doPlayerSendTextMessage(cid, 27, "A posição onde você quer ir não é andavel") return doSendMagicEffect(getCreaturePosition(cid), 2) end elseif getCreatureLookDirection(cid) == EAST then if isWalkable(d, true, true, true) and not getHouseFromPos(d) then doSendMagicEffect(pos, effect) doSendMagicEffect(b, effect) return doTeleportThing(cid, d) else doPlayerSendTextMessage(cid, 27, "A posição onde você quer ir não é andavel") return doSendMagicEffect(getCreaturePosition(cid), 2) end elseif getCreatureLookDirection(cid) == WEST then if isWalkable(c, true, true, true) and not getHouseFromPos(c) then doSendMagicEffect(pos, effect) doSendMagicEffect(b, effect) return doTeleportThing(cid, c) else doPlayerSendTextMessage(cid, 27, "A posição onde você quer ir não é andavel") return doSendMagicEffect(getCreaturePosition(cid), 2) end end end

Informação Importante

Confirmação de Termo