Jump to content

npc [OTG][NPC][Storages][Rookgaard] Liberando os acessos das Quests e Missões pelo NPC Oracle


Recommended Posts

otgskull.gif

otgking0.png

 

Open Source MMORPG emulador de Tibia escrito em C++.

Servidor Oficial do Tibiaking!

 

 

 

 

 

Spoiler

 

 

 

separador.png

 

[OTG][NPC][Storages][Rookgaard] Liberando os acessos das Quests e Missões pelo NPC Oracle

Tutorial explicado de como liberar as acessos, missões e quests para todos os jogadores!

 

separador.png

NPC Oracle

Abra o script do npc the_oracle.lua localizado na pasta data/npc/scripts/ e substitua todo o código pelo código abaixo:

 

Spoiler



local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

local vocation = {}
local town = {}
local config = {
    towns = {
		["venore"] = 9,
		["thais"] = 8,
		["carlin"] = 6
    },

    vocations = {
        ["sorcerer"] = {
            text = "A SORCERER! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!",
            vocationId = 1,
            --equipment spellbook, wand of vortex, magician's robe, mage hat, studded legs, leather boots, scarf
            {{2175, 1}, {2190, 1}, {8819, 1}, {8820, 1}, {2468, 1}, {2643, 1}, {2661, 1}},
            --container rope, shovel, mana potion, adventurer's stone
            {{2120, 1}, {2554, 1}, {7620, 1}, {18559, 1}}
        },

        ["druid"] = {
            text = "A DRUID! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!",
            vocationId = 2,
            --equipment spellbook, snakebite rod, magician's robe, mage hat, studded legs, leather boots scarf
            {{2175, 1}, {2182, 1}, {8819, 1}, {8820, 1}, {2468, 1}, {2643, 1}, {2661, 1}},
            --container rope, shovel, mana potion, adventurer's stone
            {{2120, 1}, {2554, 1}, {7620, 1}, {18559, 1}}
        },

        ["paladin"] = {
            text = "A PALADIN! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!",
            vocationId = 3,
            --equipment dwrven shield, 5 spear, ranger's cloak, ranger legs scarf, legion helmet
            {{2525, 1}, {2389, 5}, {2660, 1}, {8923, 1}, {2643, 1}, {2661, 1}, {2480, 1}},
            --container rope, shovel, health potion, bow, 50 arrow, adventurer's stone
            {{2120, 1}, {2554, 1}, {7618, 1}, {2456, 1}, {2544, 50}, {18559, 1}}
        },

        ["knight"] = {
            text = "A KNIGHT! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!",
            vocationId = 4,
            --equipment dwarven shield, steel axe, brass armor, brass helmet, brass legs scarf
            {{2525, 1}, {8601, 1}, {2465, 1}, {2460, 1}, {2478, 1}, {2643, 1}, {2661, 1}},
            --container jagged sword, daramian mace, rope, shovel, health potion, adventurer's stone
            {{8602, 1}, {2439, 1}, {2120, 1}, {2554, 1}, {7618, 1}, {18559, 1}}
        }
    }
}

local function greetCallback(cid)
    local player = Player(cid)
    local level = player:getLevel()
    if level < 8 then
        npcHandler:say("CHILD! COME BACK WHEN YOU HAVE GROWN UP!", cid)
        npcHandler:resetNpc(cid)
        return false
    elseif level > 10 then
        npcHandler:say(player:getName() ..", I CAN'T LET YOU LEAVE - YOU ARE TOO STRONG ALREADY! YOU CAN ONLY LEAVE WITH LEVEL 9 OR LOWER.", cid)
        npcHandler:resetNpc(cid)
        return false
    elseif player:getVocation():getId() > 0 then
        npcHandler:say("YOU ALREADY HAVE A VOCATION!", cid)
        npcHandler:resetNpc(cid)
        return false
    else
        npcHandler:setMessage(MESSAGE_GREET, player:getName() ..", ARE YOU PREPARED TO FACE YOUR DESTINY?")
    end
    return true
end

local function creatureSayCallback(cid, type, msg)
    if not npcHandler:isFocused(cid) then
        return false
    end

    local player = Player(cid)
    if npcHandler.topic[cid] == 0 then
        if msgcontains(msg, "yes") then
			npcHandler:say("IN WHICH TOWN DO YOU WANT TO LIVE: {CARLIN}, {THAIS}, OR {VENORE}?", cid)
            npcHandler.topic[cid] = 1
        end
    elseif npcHandler.topic[cid] == 1 then
        local cityTable = config.towns[msg:lower()]
        if cityTable then
            town[cid] = cityTable
            npcHandler:say("IN ".. string.upper(msg) .."! AND WHAT PROFESSION HAVE YOU CHOSEN: {KNIGHT}, {PALADIN}, {SORCERER}, OR {DRUID}?", cid)
            npcHandler.topic[cid] = 2
        else
			npcHandler:say("IN WHICH TOWN DO YOU WANT TO LIVE: {CARLIN}, {THAIS}, OR {VENORE}?", cid)
        end
    elseif npcHandler.topic[cid] == 2 then
        local vocationTable = config.vocations[msg:lower()]
        if vocationTable then
            npcHandler:say(vocationTable.text, cid)
            npcHandler.topic[cid] = 3
            vocation[cid] = vocationTable.vocationId
        else
            npcHandler:say("{KNIGHT}, {PALADIN}, {SORCERER}, OR {DRUID}?", cid)
        end
    elseif npcHandler.topic[cid] == 3 then
        if msgcontains(msg, "yes") then
            npcHandler:say("SO BE IT!", cid)
            player:setVocation(Vocation(vocation[cid]))
            player:setTown(Town(town[cid]))

            -- The Mermaid Marina
            player:setStorageValue(Storage.FriendsandTraders.DefaultStart, 1)
            player:setStorageValue(Storage.FriendsandTraders.TheMermaidMarina, 2)

            -- Forgotten Knowledge
            player:setStorageValue(Storage.ForgottenKnowledge.Tomes, 1)
            player:setStorageValue(Storage.ForgottenKnowledge.LastLoreKilled, 1)
            player:setStorageValue(Storage.ForgottenKnowledge.TimeGuardianKilled, 1)
            player:setStorageValue(Storage.ForgottenKnowledge.HorrorKilled, 1)
            player:setStorageValue(Storage.ForgottenKnowledge.DragonkingKilled, 1)
            player:setStorageValue(Storage.ForgottenKnowledge.ThornKnightKilled, 1)
            player:setStorageValue(Storage.ForgottenKnowledge.LloydKilled, 1)
            player:setStorageValue(Storage.ForgottenKnowledge.LadyTenebrisKilled, 1)
            player:setStorageValue(Storage.ForgottenKnowledge.AccessMachine, 1)

            -- The Explorer Society Quest
            player:setStorageValue(Storage.ExplorerSociety.QuestLine, 61)
            player:setStorageValue(Storage.ExplorerSociety.JoiningtheExplorers, 4)
            player:setStorageValue(Storage.ExplorerSociety.TheIceDelivery, 7)
            player:setStorageValue(Storage.ExplorerSociety.TheButterflyHunt, 16)
            player:setStorageValue(Storage.ExplorerSociety.ThePlantCollection, 26)
            player:setStorageValue(Storage.ExplorerSociety.TheLizardUrn, 29)
            player:setStorageValue(Storage.ExplorerSociety.TheBonelordSecret, 32)
            player:setStorageValue(Storage.ExplorerSociety.TheOrcPowder, 35)
            player:setStorageValue(Storage.ExplorerSociety.TheElvenPoetry, 38)
            player:setStorageValue(Storage.ExplorerSociety.TheMemoryStone, 41)
            player:setStorageValue(Storage.ExplorerSociety.TheRuneWritings, 44)
            player:setStorageValue(Storage.ExplorerSociety.TheEctoplasm, 47)
            player:setStorageValue(Storage.ExplorerSociety.TheSpectralDress, 50)
            player:setStorageValue(Storage.ExplorerSociety.TheSpectralStone, 55)
            player:setStorageValue(Storage.ExplorerSociety.TheAstralPortals, 56)
            player:setStorageValue(Storage.ExplorerSociety.TheIslandofDragons, 59)
            player:setStorageValue(Storage.ExplorerSociety.TheIceMusic, 62)
            player:setStorageValue(Storage.ExplorerSociety.CalassaQuest, 3)

            -- In Service Of Yalahar
            player:setStorageValue(Storage.InServiceofYalahar.Questline, 48)
            player:setStorageValue(Storage.InServiceofYalahar.Mission01, 6)
            player:setStorageValue(Storage.InServiceofYalahar.Mission02, 8)
            player:setStorageValue(Storage.InServiceofYalahar.Mission03, 6)
            player:setStorageValue(Storage.InServiceofYalahar.Mission04, 6)
            player:setStorageValue(Storage.InServiceofYalahar.Mission05, 8)
            player:setStorageValue(Storage.InServiceofYalahar.Mission06, 5)
            player:setStorageValue(Storage.InServiceofYalahar.Mission07, 5)
            player:setStorageValue(Storage.InServiceofYalahar.Mission08, 4)
            player:setStorageValue(Storage.TheWayToYalahar.QuestLine, 30)

            -- Searoutes Around Yalahar
            player:setStorageValue(Storage.SearoutesAroundYalahar.TownsCounter, 8)
            player:setStorageValue(Storage.SearoutesAroundYalahar.AbDendriel, 1)
            player:setStorageValue(Storage.SearoutesAroundYalahar.Darashia, 1)
            player:setStorageValue(Storage.SearoutesAroundYalahar.Venore, 1)
            player:setStorageValue(Storage.SearoutesAroundYalahar.Ankrahmun, 1)
            player:setStorageValue(Storage.SearoutesAroundYalahar.PortHope, 1)
            player:setStorageValue(Storage.SearoutesAroundYalahar.Thais, 1)
            player:setStorageValue(Storage.SearoutesAroundYalahar.LibertyBay, 1)
            player:setStorageValue(Storage.SearoutesAroundYalahar.Carlin, 1)

            -- Children Of The Revolution
            player:setStorageValue(Storage.ChildrenoftheRevolution.Questline, 18)
            player:setStorageValue(Storage.ChildrenoftheRevolution.Mission00, 2)
            player:setStorageValue(Storage.ChildrenoftheRevolution.Mission01, 3)
            player:setStorageValue(Storage.ChildrenoftheRevolution.Mission02, 5)
            player:setStorageValue(Storage.ChildrenoftheRevolution.Mission04, 3)
            player:setStorageValue(Storage.ChildrenoftheRevolution.Mission05, 6)

            -- The Travelling Trader
            player:setStorageValue(Storage.TravellingTrader.Mission01, 2)
            player:setStorageValue(Storage.TravellingTrader.Mission02, 5)
            player:setStorageValue(Storage.TravellingTrader.Mission03, 3)
            player:setStorageValue(Storage.TravellingTrader.Mission04, 3)
            player:setStorageValue(Storage.TravellingTrader.Mission05, 3)
            player:setStorageValue(Storage.TravellingTrader.Mission06, 2)
            player:setStorageValue(Storage.TravellingTrader.Mission07, 1)
            player:setStorageValue(Storage.TravellingTrader.packageDoor, 1)

            -- The Inquisition
            player:setStorageValue(Storage.TheInquisition.Questline, 14)
            player:setStorageValue(Storage.TheInquisition.Mission01, 7)
            player:setStorageValue(Storage.TheInquisition.Mission02, 3)
            player:setStorageValue(Storage.TheInquisition.Mission03, 6)
            player:setStorageValue(Storage.TheInquisition.Mission04, 3)
            player:setStorageValue(Storage.PitsOfInferno.ThronePumin, 1)

            -- The New Frontier
            player:setStorageValue(Storage.TheNewFrontier.Questline, 24)
            player:setStorageValue(Storage.TheNewFrontier.Mission01, 3)
            player:setStorageValue(Storage.TheNewFrontier.Mission02, 6)
            player:setStorageValue(Storage.TheNewFrontier.Mission03, 3)
            player:setStorageValue(Storage.TheNewFrontier.Mission04, 2)
            player:setStorageValue(Storage.TheNewFrontier.Mission05, 7)
            player:setStorageValue(Storage.TheNewFrontier.Mission06, 3)
            player:setStorageValue(Storage.TheNewFrontier.Mission07, 3)
            player:setStorageValue(Storage.TheNewFrontier.Mission08, 2)
            player:setStorageValue(Storage.TheNewFrontier.TomeofKnowledge, 12)

            -- Barbarian Test
            player:setStorageValue(Storage.BarbarianTest.Questline, 8)
            player:setStorageValue(Storage.BarbarianTest.Mission01, 3)
            player:setStorageValue(Storage.BarbarianTest.Mission02, 3)
            player:setStorageValue(Storage.BarbarianTest.Mission03, 3)

            -- Wrath Of The Emperor
            player:setStorageValue(Storage.WrathoftheEmperor.Questline, 24)
            player:setStorageValue(Storage.WrathoftheEmperor.Mission01, 3)
            player:setStorageValue(Storage.WrathoftheEmperor.Mission02, 3)
            player:setStorageValue(Storage.WrathoftheEmperor.Mission03, 3)
            player:setStorageValue(Storage.WrathoftheEmperor.Mission04, 3)
            player:setStorageValue(Storage.WrathoftheEmperor.Mission05, 3)
            player:setStorageValue(Storage.WrathoftheEmperor.Mission06, 4)
            player:setStorageValue(Storage.WrathoftheEmperor.Mission07, 6)

            -- Djinn War Factions
            player:setStorageValue(Storage.DjinnWar.EfreetFaction.Start, 1)
            player:setStorageValue(Storage.DjinnWar.EfreetFaction.Mission01, 3)
            player:setStorageValue(Storage.DjinnWar.EfreetFaction.Mission02, 3)
            player:setStorageValue(Storage.DjinnWar.EfreetFaction.Mission03, 3)
            player:setStorageValue(Storage.DjinnWar.MaridFaction.Start, 1)
            player:setStorageValue(Storage.DjinnWar.MaridFaction.Mission01, 2)
            player:setStorageValue(Storage.DjinnWar.MaridFaction.Mission02, 2)
            player:setStorageValue(Storage.DjinnWar.MaridFaction.Mission03, 3)
            player:setStorageValue(Storage.DjinnWar.MaridFaction.RataMari, 2)

            -- Big Foot Burden
            player:setStorageValue(Storage.BigfootBurden.QuestLine, 30)
            player:setStorageValue(Storage.BigfootBurden.Rank, 30)
            player:setStorageValue(Storage.BigfootBurden.Warzone1Access, 2)
            player:setStorageValue(Storage.BigfootBurden.Warzone2Access, 2)
            player:setStorageValue(Storage.BigfootBurden.Warzone3Access, 2)
            player:setStorageValue(Storage.BigfootBurden.WarzoneStatus, 1)

            -- The Shattered Isles
            player:setStorageValue(Storage.TheShatteredIsles.DefaultStart, 1)
            player:setStorageValue(Storage.TheShatteredIsles.ADjinnInLove, 5)
            player:setStorageValue(Storage.TheShatteredIsles.APoemForTheMermaid, 3)
            player:setStorageValue(Storage.TheShatteredIsles.AccessToGoroma, 1)
            player:setStorageValue(Storage.TheShatteredIsles.AccessToLagunaIsland, 1)
            player:setStorageValue(Storage.TheShatteredIsles.AccessToMeriana, 1)
            player:setStorageValue(Storage.TheShatteredIsles.TheCounterspell, 4)
            player:setStorageValue(Storage.TheShatteredIsles.TheErrand, 2)
            player:setStorageValue(Storage.TheShatteredIsles.TheGovernorDaughter, 3)

            -- Cults of Tibia
            player:setStorageValue(Storage.CultsOfTibia.Questline, 1)
            player:setStorageValue(Storage.CultsOfTibia.Minotaurs.Mission, 1)
            player:setStorageValue(Storage.CultsOfTibia.MotA.Mission, 1)
            player:setStorageValue(Storage.CultsOfTibia.Barkless.Mission, 1)
            player:setStorageValue(Storage.CultsOfTibia.Misguided.Mission, 1)
            player:setStorageValue(Storage.CultsOfTibia.Orcs.Mission, 1)
            player:setStorageValue(Storage.CultsOfTibia.Life.Mission, 1)
            player:setStorageValue(Storage.CultsOfTibia.Humans.Mission, 1)

            -- The First Dragon
            player:setStorageValue(Storage.FirstDragon.tamorilTasks, 1)
            player:setStorageValue(Storage.FirstDragon.tamorilTasksPower, 0)
            player:setStorageValue(Storage.FirstDragon.tamorilTasksKnowledge, 0)
            player:setStorageValue(Storage.FirstDragon.tamorilTasksLife, 0)
            player:setStorageValue(Storage.FirstDragon.tamorilTasksTreasure, 0)
            player:setStorageValue(Storage.FirstDragon.tamorilTasksTreasure, 0)

            -- Achievements
            player:addAchievement("Just in Time")
            player:addAchievement("Recognised Trader")
            player:addAchievement("Bearhugger")
            player:addAchievement("Honorary Barbarian")
            player:addAchievement("Ghostwhisperer")
            player:addAchievement("Efreet Ally")
            player:addAchievement("Marid Ally")
            player:addAchievement("Explorer")
            player:addAchievement("Sea Scout")

            -- Effects And Teleport
            player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
            player:teleportTo(Town(town[cid]):getTemplePosition())
            player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have received a backpack with starting items for reaching the mainlands.")

            local targetVocation = config.vocations[Vocation(vocation[cid]):getName():lower()]
            for i = 1, #targetVocation[1] do
                player:addItem(targetVocation[1][i][1], targetVocation[1][i][2])
            end

            local backpack = player:addItem(1988)
            for i = 1, #targetVocation[2] do
                backpack:addItem(targetVocation[2][i][1], targetVocation[2][i][2])
            end
        else
            npcHandler:say("THEN WHAT? {KNIGHT}, {PALADIN}, {SORCERER}, OR {DRUID}?", cid)
            npcHandler.topic[cid] = 2
        end
    end
    return true
end

local function onAddFocus(cid)
    town[cid] = 0
    vocation[cid] = 0
end

local function onReleaseFocus(cid)
    town[cid] = nil
    vocation[cid] = nil
end

npcHandler:setCallback(CALLBACK_ONADDFOCUS, onAddFocus)
npcHandler:setCallback(CALLBACK_ONRELEASEFOCUS, onReleaseFocus)
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setMessage(MESSAGE_FAREWELL, "COME BACK WHEN YOU ARE PREPARED TO FACE YOUR DESTINY!")
npcHandler:setMessage(MESSAGE_WALKAWAY, "COME BACK WHEN YOU ARE PREPARED TO FACE YOUR DESTINY!")
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

 

separador.png

CRÉDITOS:

@EddyHavoc

@Marco Oliveira

Edited by EddyHavoc (see edit history)
Link to post
Share on other sites

  • EddyHavoc changed the title to [OTG][NPC][Storages] Liberando os acessos das Quests e Missões pelo NPC Oracle
  • EddyHavoc changed the title to [OTG][NPC][Storages][Rookgaard] Liberando os acessos das Quests e Missões pelo NPC Oracle

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Similar Content

    • By Maniaco
      Boa Tarde TibiaKing!!!
       
      Bom estou precisando de um script não deve ser muito difícil !! (pra quem sabe  !)
      Quem poder ajudar já agradeço. ++ Rep
       
       
      Seria um Npc Exemplo
      Player :Hi
      Npc: Ola (PLAYERNAME) gostaria de receber {buff} ?
       
      Player: Buff 
      Npc: Gostaria de receber qual, Buff 1, buff 2, buff 3,..... buff 12.
       
      Player: Buff 12
      Npc: voce precisar ter recebido o Buff Anterior (Buff 11) para receber o próximo Buff (Buff 12)
       
      Player: Buff 1
      Npc: você precisa do item xxxx <<< !! Alem do item uma storage certa e o level!
       
      Player: Buff 1 "novamente <"
      Npc: você já recebeu esse buff!
       
      Config do npc
       
      [buff 01] = life 1000000 (Permanente)
                        mana = 10000000 ( Permanente)
      Level = 100 <!! ele so pode receber buff 01 no level 100 e assim em diante
      Storage = 211100 ( caso ele não tenha < vai aparecer o seguinte "você não completou a missão dos buffs"
      [buff 02] = life 1000000 (Permanente)
                        mana = 10000000 (Permanente)
      Level = 200
      Storage = 211101
       
       
       
      o player só poderá receber o próximo buff se ele Receber o primeiro Buff antes (Ex ele so pode ter buff 02 se tiver recebido o buff 01) 
       
      Espero que de para entender tudo!! 
       
       
       
       
       
       
       
    • By Fakeownerz
      Olá!
      Primeiramente peço desculpas pelo que vão ler, pois não entendo muito do assunto (por isso vim fazer o tópico '-')
       
      Vamos lá.
       
      Ao tentar abrir o servidor , me deparo com o seguinte erro:
       
       
      Meu config.lua está assim:
       
       
      Gostaria de saber como arrumar (só para abrir em meu pc , pra dar uma olhada pra arrumar algums bugs...) ou até mesmo só passar pra sqlite (que eu acho bem mais simples e tenho o mínimo de noção... Agradeço a atenção e peço desculpas novamente pela ignorância sobre o assunto caso seja algo extremamente simples.
    • By marvadon
      Bom Dia pessoal do TK
       
      estou com problemas com o npc xodet.
      ele não entrega e nem vende a wand of dragonbreath, aparece na lista de compra mas não ocorre nehuma ação referente a entrega e cobrança de gold.
       
      todos os outros itens ele entrega normalmente.
       
      alguém poderia me ajudar.
       
       
      Obrigado
      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 local shopModule = ShopModule:new() npcHandler:addModule(shopModule) shopModule:addBuyableItem({'spellbook'}, 2175, 150, 1, 'spellbook') shopModule:addBuyableItem({'small health'}, 8704, 20, 1, 'small health potion') shopModule:addBuyableItem({'health potion'}, 7618, 45, 1, 'health potion') shopModule:addBuyableItem({'mana potion'}, 7620, 50, 1, 'mana potion') shopModule:addBuyableItem({'strong health'}, 7588, 100, 1, 'strong health potion') shopModule:addBuyableItem({'strong mana'}, 7589, 80, 1, 'strong mana potion') shopModule:addBuyableItem({'great health'}, 7591, 190, 1, 'great health potion') shopModule:addBuyableItem({'great mana'}, 7590, 120, 1, 'great mana potion') shopModule:addBuyableItem({'great spirit'}, 8472, 190, 1, 'great spirit potion') shopModule:addBuyableItem({'ultimate health'}, 8473, 310, 1, 'ultimate health potion') shopModule:addSellableItem({'normal potion flask', 'normal flask'}, 7636, 5, 'empty small potion flask') shopModule:addSellableItem({'strong potion flask', 'strong flask'}, 7634, 10, 'empty strong potion flask') shopModule:addSellableItem({'great potion flask', 'great flask'}, 7635, 15, 'empty great potion flask') shopModule:addBuyableItem({'instense healing'}, 2265, 95, 1, 'intense healing rune') shopModule:addBuyableItem({'ultimate healing'}, 2273, 100, 1, 'ultimate healing rune') shopModule:addBuyableItem({'fire bomb'}, 2305, 117, 1, 'fire bomb') shopModule:addBuyableItem({'destroy field'}, 2261, 15, 1, 'destroy field rune') shopModule:addBuyableItem({'light magic missile'}, 2287, 4, 1, 'light magic missile rune') shopModule:addBuyableItem({'heavy magic missile'}, 2311, 12, 1, 'heavy magic missile rune') shopModule:addBuyableItem({'great fireball'}, 2304, 45, 1, 'great fireball rune') shopModule:addBuyableItem({'explosion'}, 2313, 31, 1, 'explosion rune') shopModule:addBuyableItem({'sudden death'}, 2268, 40, 1, 'sudden death rune') shopModule:addBuyableItem({'convince creature'}, 2290, 80, 1, 'convince creature rune') shopModule:addBuyableItem({'chameleon'}, 2291, 210, 1, 'chameleon rune') shopModule:addBuyableItem({'desintegrate'}, 2310, 80, 1, 'desintegreate rune') shopModule:addBuyableItem({'fire field'}, 2301, 28, 1, 'fire field rune') shopModule:addBuyableItem({'energy field'}, 2301, 38, 1, 'energy field rune') shopModule:addBuyableItem({'avalanche rune'}, 2274, 45, 1, 'avalanche rune') shopModule:addBuyableItem({'antidote rune'}, 2266, 65, 1, 'antidote rune') shopModule:addBuyableItem({'energy wall'}, 2279, 85, 1, 'energy wall rune') shopModule:addBuyableItem({'icicle'}, 2271, 30, 1, 'icicle rune') shopModule:addBuyableItem({'magic wall rune'}, 2293, 30, 1, 'magic wall rune') shopModule:addBuyableItem({'wild growth rune'}, 2269, 15, 1, 'wild growth rune') shopModule:addBuyableItem({'poison field'}, 2285, 21, 1, 'poison field rune') shopModule:addBuyableItem({'poison wall'}, 2289, 52, 1, 'poison wall rune') shopModule:addBuyableItem({'blank'}, 2260, 10, 1, 'blank rune') shopModule:addBuyableItem({'paralyze rune'}, 2278, 5, 1, 'paralyze rune') shopModule:addBuyableItem({'fire ball'}, 2302, 30, 1, 'fire ball rune') shopModule:addBuyableItem({'wand of vortex', 'vortex'}, 2190, 500, 'wand of vortex') shopModule:addBuyableItem({'wand of dragonbreath', 'dragonbreath'}, 2191, 1000, 1, 'wand of dragonbreath') shopModule:addBuyableItem({'wand of decay', 'decay'}, 2188, 5000, 'wand of decay') shopModule:addBuyableItem({'wand of draconia', 'draconia'}, 8921, 7500, 'wand of draconia') shopModule:addBuyableItem({'wand of cosmic energy', 'cosmic energy'}, 2189, 10000, 'wand of cosmic energy') shopModule:addBuyableItem({'wand of inferno', 'inferno'}, 2187, 15000, 'wand of inferno') shopModule:addBuyableItem({'wand of starstorm', 'starstorm'}, 8920, 18000, 'wand of starstorm') shopModule:addBuyableItem({'wand of voodoo', 'voodoo'}, 8922, 22000, 'wand of voodoo') shopModule:addSellableItem({'normal potion flask', 'normal flask'}, 7636, 5, 'empty small potion flask') shopModule:addSellableItem({'strong potion flask', 'strong flask'}, 7634, 10, 'empty strong potion flask') shopModule:addSellableItem({'great potion flask', 'great flask'}, 7635, 15, 'empty great potion flask') shopModule:addSellableItem({'wand of vortex', 'vortex'}, 2190, 250, 'wand of vortex') shopModule:addSellableItem({'wand of dragonbreath', 'dragonbreath'}, 2191, 500, 'wand of dragonbreath') shopModule:addSellableItem({'wand of decay', 'decay'}, 2188, 2500, 'wand of decay') shopModule:addSellableItem({'wand of draconia', 'draconia'}, 8921, 3750, 'wand of draconia') shopModule:addSellableItem({'wand of cosmic energy', 'cosmic energy'}, 2189, 5000, 'wand of cosmic energy') shopModule:addSellableItem({'wand of inferno', 'inferno'},2187, 7500, 'wand of inferno') shopModule:addSellableItem({'wand of starstorm', 'starstorm'}, 8920, 9000, 'wand of starstorm') shopModule:addSellableItem({'wand of voodoo', 'voodoo'}, 8922, 11000, 'wand of voodoo') shopModule:addSellableItem({'snakebite rod', 'snakebite'}, 2182, 250, 1, 'snakebite rod') shopModule:addSellableItem({'moonlight rod', 'moonlight'}, 2186, 500, 1, 'moonlight rod') shopModule:addSellableItem({'necrotic rod', 'necrotic'}, 2185, 2500, 1, 'necrotic rod') shopModule:addSellableItem({'northwind rod', 'northwind'}, 8911, 3750, 1, 'northwind rod') shopModule:addSellableItem({'terra rod', 'terra'}, 2181, 5000, 1, 'terra rod') shopModule:addSellableItem({'hailstorm rod', 'hailstorm'}, 2183, 7500, 1, 'hailstorm rod') shopModule:addSellableItem({'springsprout rod', 'springsprout'}, 8912, 9000, 1, 'springsprout rod') shopModule:addSellableItem({'underworld rod', 'underworld'}, 8910, 11000, 1, 'underworld rod') shopModule:addBuyableItem({'snakebite rod', 'snakebite'}, 2182, 500, 'snakebite rod') shopModule:addBuyableItem({'moonlight rod', 'moonlight'}, 2186, 1000, 'moonlight rod') shopModule:addBuyableItem({'necrotic rod', 'necrotic'}, 2185, 5000, 'necrotic rod') shopModule:addBuyableItem({'northwind rod', 'northwind'}, 8911, 7500, 'northwind rod') shopModule:addBuyableItem({'terra rod', 'terra'}, 2181, 10000, 'terra rod') shopModule:addBuyableItem({'hailstorm rod', 'hailstorm'}, 2183, 15000, 'hailstorm rod') shopModule:addBuyableItem({'springsprout rod', 'springsprout'}, 8912, 18000, 'springsprout rod') shopModule:addBuyableItem({'underworld rod', 'underworld'}, 8910, 22000, 'underworld rod') npcHandler:addModule(FocusModule:new())
    • By O.J
      Olá amigos estou aqui mais uma vez para pedir uma coisa, um NPC que peça items para o player e se o player trazer os itens ele ganha um prêmio, só que depois que ele pegasse o prêmio ele não pudesse fazer a quest novamente colocassem tipo uma storage que checa se ele ja fez a quest entendem? Por favor se puderem ajudar agradeço muito meu Ot é 8.60 obrigado comunidade .
    • By Beyond Sky
      Estou voltando ao mundo do Open Tibia (na área de desenvolvimento) e estou testando meu potencial em scriptings quando me fiz ausente tinha um conhecimento bom já não tão grande mas quebrava um galho agora voltei e percebi que regredi bastante. Enfim, eu estava pegando uns scripts pra dar uma estudada e me deparei com uma coisa louca e gostaria muito que vocês experientes me ajudassem com isso.
       
      Peguei esse script da annihilator lever e está muito louco bem diferente do antigo postarei os dois e gostaria de saber qual a diferença entre os dois e se pudessem me explicar as vantagens e as condições usada no novo pq me embananei todo olhando esse script.
       
      Script Novo (que não entendi nada, o que aconteceu com a famosa function onUse(cid, item, frompos, item2, topos)) :
       
      local players_area = { {x = 33225, y = 31671, z = 13}, {x = 33222, y = 31671, z = 13} } local new_player_pos = { {x = 33222, y = 31659, z = 13}, {x = 33221, y = 31659, z = 13}, {x = 33220, y = 31659, z = 13}, {x = 33219, y = 31659, z = 13} } local demonPos = { {x = 33219, y = 31657, z = 13}, {x = 33221, y = 31657, z = 13}, {x = 33223, y = 31659, z = 13}, {x = 33224, y = 31659, z = 13}, {x = 33220, y = 31661, z = 13}, {x = 33222, y = 31661, z = 13} } function getPlayerCountInArea(toPos, fromPos) local count = 0 local cid = {} for x = fromPos.x, toPos.x do for y = fromPos.y, toPos.y do for z = toPos.z, toPos.z do local creature = getTopCreature({x = x, y = y, z = z, stackpos = 255}).uid if(creature > 0) then if(isPlayer(creature)) then table.insert(cid, creature) count = count + 1 if(getPlayerLevel(creature) < 100) then return "All players must be above level 100." end elseif(isMonster(creature)) then return "Players are allowed only." end end end end end if(count < 4) then return "You need 4 players." else for i = 1,4 do Player(cid[5-i]):teleportTo(new_player_pos[i]) Player(cid[5-i]):getPosition():sendMagicEffect(CONST_ME_TELEPORT) end end return true end function SummonDemon(Pos) local count = 0 local cid = {} for x = Pos[1].x, Pos[4].x do for y = Pos[1].y, Pos[6].y do for z = Pos[1].z, Pos[6].z do local creature = getTopCreature({x = x, y = y, z = z, stackpos = 255}).uid if(creature > 0) then if(isPlayer(creature)) then return "A team is already inside the quest room." elseif(isMonster(creature)) then table.insert(cid, creature) count = count + 1 end end end end end for i = 1, #cid do doRemoveCreature(cid[i]) end for i = 1, #Pos do doSummonCreature("Demon", Pos[i]) end return getPlayerCountInArea(players_area[1], players_area[2]) end function onUse(cid, item) if(item.itemid == 1946) then local condition = SummonDemon(demonPos) if(condition ~= true) then doPlayerSendCancel(cid, condition) end else Item(item.uid):transform(1946) end return true end  
      Script Antigo (do qual tenho total conhecimento sobre o que acontece ou não e por que)
      -- Alavanca Annihilator Quest -- by Nottinghster   function onUse(cid, item, frompos, item2, topos)         if item.uid == 7000 and item.itemid == 1945 then                 player1pos = {x=1109, y=1204, z=11, stackpos=253}                 player1 = getThingfromPos(player1pos)                   player2pos = {x=1110, y=1204, z=11, stackpos=253}                 player2 = getThingfromPos(player2pos)                   player3pos = {x=1111, y=1204, z=11, stackpos=253}                 player3 = getThingfromPos(player3pos)                   player4pos = {x=1112, y=1204, z=11, stackpos=253}                 player4 = getThingfromPos(player4pos)                     if player1.itemid > 0 and player2.itemid > 0 and player3.itemid > 0 and player4.itemid > 0 then                         queststatus1 = getPlayerStorageValue(player1.uid,7000)                         queststatus2 = getPlayerStorageValue(player2.uid,7000)                         queststatus3 = getPlayerStorageValue(player3.uid,7000)                         queststatus4 = getPlayerStorageValue(player4.uid,7000)                           if queststatus1 == -1 and queststatus2 == -1 and queststatus3 == -1 and queststatus4 == -1 then                                 nplayer1pos = {x=1128, y=1181, z=11}                                 nplayer2pos = {x=1129, y=1181, z=11}                                 nplayer3pos = {x=1130, y=1181, z=11}                                 nplayer4pos = {x=1131, y=1181, z=11}                                   doSendMagicEffect(player1pos,2)                                 doSendMagicEffect(player2pos,2)                                 doSendMagicEffect(player3pos,2)                                 doSendMagicEffect(player4pos,2)                                   doTeleportThing(player1.uid,nplayer1pos)                                 doTeleportThing(player2.uid,nplayer2pos)                                 doTeleportThing(player3.uid,nplayer3pos)                                 doTeleportThing(player4.uid,nplayer4pos)                                   doSendMagicEffect(nplayer1pos,10)                                 doSendMagicEffect(nplayer2pos,10)                                 doSendMagicEffect(nplayer3pos,10)                                 doSendMagicEffect(nplayer4pos,10)                                   doTransformItem(item.uid,item.itemid+1)                         else                                 doPlayerSendCancel(cid,"Alguém em seu time já fez esta quest.")                         end                 else                         doPlayerSendCancel(cid,"Você precisa de um grupo de 4 pessoas para esta quest.")                 end           elseif item.uid == 7000 and item.itemid == 1946 then                 if getPlayerAccess(cid) > 0 then                         doTransformItem(item.uid,item.itemid-1)                 else                         doPlayerSendCancel(cid,"Desculpe, não é possível.")                 end         else                 return FALSE         end           return TRUE end
  • Recently Browsing   0 members

    No registered users viewing this page.


×
×
  • Create New...

Important Information

Confirmação de Termo