Ir para conteúdo

Wise

Membro
  • Registro em

  • Última visita

Tudo que Wise postou

  1. local price = false -- Preço para usar o comando (caso queira um preço específico para cada lugar, deixe local price = false) local locations = { -- [nome do monstro] = {posição, preço (caso o price seja false)}, ["demon"] = {pos = {x = 140, y = 120, z = 7}, price = 1000}, ["black knight"] = {pos = {x = 220, y = 500, z = 7}, price = 125} } function onSay(cid, words, param) local str = "Available locations:\n\n" if not param or not locations[param:lower()] then for a, b in pairs(locations) do str = str.."• "..a.."\n" end doPlayerPopupFYI(cid, str) return doPlayerSendCancel(cid, "Specify the location.") elseif price and not doPlayerRemoveMoney(cid, price) or not price and locations[param:lower()].price and not doPlayerRemoveMoney(cid, locations[param:lower()].price) then return doPlayerSendCancel(cid, "Insufficient money. The cost is "..(not price and locations[param:lower()].price or price).." gold coins.") elseif getCreatureCondition(cid, CONDITION_INFIGHT) then return doPlayerSendCancel(cid, "You can't be teleported in battle.") end doTeleportThing(cid, locations[param:lower()].pos) doSendMagicEffect(getCreaturePosition(cid), 10) return true end
  2. vocitem.lua (data/actions/scripts): function onUse(cid, item, fromPos, toPos) local voc = 5 -- new vocationID if getPlayerVocation(cid) == voc then return doPlayerSendCancel(cid, 'You are already a '..getPlayerVocationName(cid)) end doPlayerSetVocation(cid, voc) doSendMagicEffect(toPos, CONST_ME_STUN) doRemoveItem(item.uid, 1) return true end Tag - actions.xml (data/actions): <action itemid="ITEMID" script="vocitem.lua"/>
  3. function onUse(cid) local pos = {x=123, y=456, z=7} doTeleportThing(cid, pos) doSendMagicEffect(pos, CONST_ME_TELEPORT) return true end
  4. Isso ficou confuso, cara. Você só mencionou sobre esse único baú com o bow e a arrow, mas e sobre os outros? (já que só vai poder escolher um, é óbvio que deve ter outros). Especifique, senão como posso te ajudar?
  5. Wise postou uma resposta no tópico em Suporte Tibia OTServer
    Ah sim..desculpe a minha falta de atenção.
  6. Wise postou uma resposta no tópico em Suporte Tibia OTServer
    Tente: freepoints.lua (data/talkactions/scripts): function onSay(cid) local stor, points = 54321, 15 if getPlayerStorageValue(cid, stor) > 0 then return doPlayerSendCancel(cid, 'You can only use this command one time.') end setPlayerStorageValue(cid, stor, 1) db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + "..points.." WHERE `name` ='"..getPlayerAccount(cid).."'") doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You earned '..points..' points for free!') return true end Tag - talkactions.xml (data/talkactions): <talkaction words="!freepoints" event="script" value="freepoints.lua"/>
  7. <instant name="Reflect" words="reflect" lvl="20" mana="500" prem="1" aggressive="0" exhaustion="1000" needlearn="0" event="script" value="especiais/reflect.lua"> </instant>
  8. Adicione à lib do seu servidor: function jumpBehindTarget(cid, target) local player = Player(cid) local target = Creature(target) local targetPos = target:getPosition() local targetPositions = { north = Position(targetPos.x, targetPos.y-1, targetPos.z), east = Position(targetPos.x+1, targetPos.y, targetPos.z), west = Position(targetPos.x-1, targetPos.y, targetPos.z), south = Position(targetPos.x, targetPos.y+1, targetPos.z) } local targetDir = target:getDirection() if targetDir == NORTH then dir = targetPositions.south elseif targetDir == EAST then dir = targetPositions.west elseif targetDir == WEST then dir = targetPositions.east elseif targetDir == SOUTH then dir = targetPositions.north end return dir end Creature event attack: function onAttack(cid, target) local vocs = {4, 8} if isCreature(cid) and isCreature(target) and isInArray(vocs, getPlayerVocation(cid)) then jumpBehindTarget(cid, target) end return true end não se esqueça de registrá-lo em login.lua
  9. A quebra de linha é representada por \n e não SHIFT+ENTER. Portanto, seria: local level = 100 local pos = {x=33212, y=31671, z=13} local txt = {"Parabens! Voce tem a oportunidade de concluir a Annihilator Quest.\nLevel Recomendado: 100\nRecompensa: Sword of Valor, Stonecutter Axe, Demon Armor ou Bonebreaker Adkko", "Você não pode ser teleportado por não ter level suficiente..blablabla"} function onUse(cid, fromPos, toPos) if getPlayerLevel(cid) >= level then doTeleportThing(cid, pos) doSendMagicEffect(toPos, CONST_ME_TELEPORT) doShowTextDialog(cid, 2175, txt[1]) else doShowTextDialog(cid, 2175, txt[2]) end return true end
  10. local level = 100 local pos = {x=406, y=1523, z=13} local txt = {'Você foi teleportado..blablabla', 'Você não pode ser teleportado por não ter level suficiente..blablabla'} function onUse(cid, fromPos, toPos) if getPlayerLevel(cid) >= level then doTeleportThing(cid, pos) doSendMagicEffect(toPos, CONST_ME_TELEPORT) doShowTextDialog(cid, 2175, txt[1]) else doShowTextDialog(cid, 2175, txt[2]) end return true end
  11. Certo, tente (adicione apenas a tag do movement onEquip): local effect = {15, 3} -- {magicEffectNumber, delay in minutes} local item = {5432, 1} -- {itemID, slotNumber} function itemEffect(cid) if isPlayer(cid) then doSendMagicEffect(getCreaturePosition(cid), effect[1]) if getPlayerSlotItem(cid, item[2]).itemid == item[1] then addEvent(itemEffect, effect[2] * 1000, cid) end end return true end function onEquip(cid, item, slot) itemEffect(cid) return true end
  12. Wise postou uma resposta no tópico em Suporte Tibia OTServer
    @Adriano SwaTT O problema não é nos escopos, amigo. A lib dele não contém a função exhaustion com seus metamétodos e por isso retorna nil. @delsonzovisk Você adicionou os códigos na lib do seu servidor?
  13. partyhat.lua (data/movements/scripts): local effect = {15, 3} -- {magicEffectNumber, delay in seconds} function itemEffect(cid) if isPlayer(cid) then doSendMagicEffect(getCreaturePosition(cid), effect[1]) ieffect = addEvent(itemEffect, effect[2] * 1000, cid) end return true end function onEquip(cid) itemEffect(cid) return true end function onDeEquip(cid) stopEvent(ieffect) return true end Tag - movements.xml (data/movements) <movevent type="Equip" itemid="ITEMID" slot="head" event="script" value="partyhat.lua"/> <movevent type="DeEquip" itemid="ITEMID" slot="head" event="script" value="partyhat.lua"/>
  14. Poste os códigos do seu creatureevent.cpp (em um spoiler, de preferência). Ok, eu só precisava saber o parâmetro do creature event usado na tag e os parâmetros do callback, pra te explicar.
  15. Wise postou uma resposta no tópico em Suporte Tibia OTServer
    Se o seu pedido foi atendido, por favor clique no botão que está localizado abaixo do post de quem te ajudou. Automaticamente ele irá ficar destacado como a melhor resposta e o tópico ficará com o prefixo "Resolvido" no início do título.
  16. Dá pra fazer por um creature event. @lolksky Se ninguém te responder antes, logo eu faço.
  17. Wise postou uma resposta no tópico em Suporte Tibia OTServer
    @falling Você não entendeu..olha, faça o seguinte: quest.lua (data/actions/scripts): function onUse(cid) local t = {item = {5432, 1}, stor = {50040, 50041}} -- {item = {itemID, amount}, stor = {storage, globalstorage}} if getGlobalStorageValue(t.stor[2]) < 1 then if getPlayerStorageValue(cid, t.stor[1]) < 1 then setPlayerStorageValue(cid, t.stor[1], 1) setGlobalStorageValue(t.stor[2], 1) doPlayerAddItem(cid, t.item[1], t.item[2]) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You received '..t.item[2]..' '..t.item[1]) else return doPlayerSendCancel(cid, 'You already have completed this quest.') end else return doPlayerSendCancel(cid, 'Someone already has done this quest today, try tomorrow.') end return true end Tag - actions.xml (data/actions): <action actionid="ACTIONID" script="quest.lua"/> resetquest.lua (data/globalevents/scripts): function onTime() local globalstor = 50041 if getGlobalStorageValue(globalstor) > 0 then setGlobalStorageValue(globalstor, -1) end return true end Tag - globalevents.xml (data/globalevents): <globalevent name="ResetQuest" time="00:00" event="script" value="resetquest.lua"/>
  18. Vai ser preciso reformular tudo, esse script não determina possíveis vencedores.
  19. Wise postou uma resposta no tópico em Suporte Tibia OTServer
    Sim, procure através do diretório do seu servidor: data/lib Crie um arquivo no diretório da sua lib e adicione os seguintes códigos à ele (desconheço as funções dessa versão, então tente estes códigos com funções um pouco mais "básicas"): exhaustion = { check = function (cid, storage) return getPlayerStorageValue(cid, storage) >= os.time(t) end, get = function (cid, storage) local exhaust = getPlayerStorageValue(cid, storage) if(exhaust > 0) then local left = exhaust - os.time(t) if(left >= 0) then return left end end return false end, set = function (cid, storage, time) setPlayerStorageValue(cid, storage, os.time(t) + time) end, make = function (cid, storage, time) local exhaust = exhaustion.get(cid, storage) if(not exhaust) then exhaustion.set(cid, storage, time) return true end return false end }
  20. Pareceu que havia sido resolvido, então eu avisei apenas.
  21. Wise postou uma resposta no tópico em Suporte Tibia OTServer
    Não, amigo. Eu quis dizer que você deve adicionar ao baú (via Remere's Map Editor), o actionID (caso tenha posto a tag com um actionID) ou o uniqueID (caso tenha posto a tag com um uniqueID). Ex: <action actionid="54321" script="quest.lua"/> Nesse caso, você deverá adicionar o actionID 54321 ao baú da quest.
  22. Wise postou uma resposta no tópico em Suporte Tibia OTServer
    Droga, li o erro errado. Editei, tente agora.
  23. Wise postou uma resposta no tópico em Suporte Tibia OTServer
    Adicione à lib do seu servidor: exhaustion = { check = function (cid, storage) if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then return false end return getPlayerStorageValue(cid, storage) >= os.time(t) end, get = function (cid, storage) if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then return false end local exhaust = getPlayerStorageValue(cid, storage) if(exhaust > 0) then local left = exhaust - os.time(t) if(left >= 0) then return left end end return false end, set = function (cid, storage, time) setPlayerStorageValue(cid, storage, os.time(t) + time) end, make = function (cid, storage, time) local exhaust = exhaustion.get(cid, storage) if(not exhaust) then exhaustion.set(cid, storage, time) return true end return false end }
  24. @TsplayerT Se o seu erro foi solucionado, clique no botão que está localizado abaixo do post de quem te ajudou. Automaticamente ele irá ficar destacado como a melhor resposta e o tópico ficará com o prefixo "Resolvido" no início do título.
  25. Wise postou uma resposta no tópico em Suporte Tibia OTServer
    @falling Deve executar sim.

Informação Importante

Confirmação de Termo