Ir para conteúdo
  • 0

ajuda editar script pokemon seller


Peter222

Pergunta

boa tarde Xtibia este script esta funciona porem eu quero e não posso determinar o preço de cada Pokémon, este script determina por si só quanto custa cada Pokémon mesmo uma magikarp esta valendo horrores, eu gostaria de acrecentar uma tabela estabelecendo o preço de cada pokemon eu ate consegui colocar a tabela, porem ela não funciona com Pokémons shinys então não me serve
o script editado por mim parcialmente funcional

Spoiler

local priceLinearSlope = 12
local priceLinearIntercept = 1900
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

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

    if msgcontains(msg, 'bye') then
        selfSay('Ok then.', cid)
        npcHandler:releaseFocus(cid)
    elseif msgcontains(msg, 'name') or msgcontains(msg, 'sell') or msgcontains(msg, 'buy') then
        selfSay('Just say the name of the pokemon you wanna sell me.', cid)
    elseif msg == "Pikachu" then
        selfSay('I do not like this pokemon.', cid)
    else
        local player = Player(cid)
        local monsterType = MonsterType(msg)
        local pokePrice = {
["Charmander"] = 3000,
["Shiny Charmander"] = 30000,
["Charmeleon"] = 8000, 
["Charizard"] = 18000,
["Bulbasaur"] =  3000,
["Ivysaur"] =  8000,
["Venusaur"] =  18000,
["Squirtle"] =  3000,
["Wartortle"] =  8000,
["Blastoise"] =  18000,
["Caterpie"] =  50,
["Metapod"] =  250,
["Butterfree"] =  2000,
["Weedle"] =  50,
["Kakuna"] =  250,
["Beedrill"] =  2000,
["Pidgey"] =  60,
["Pidgeotto"] =  1500,
["Pidgeot"] =  11500,
["Rattata"] =  5,
["Raticate"] =  2000,
["Spearow"] =  100,
["Fearow"] =  5100,
["Ekans"] =  300,
["Arbok"] =  3000,
["Pikachu"] =  8000,
["Raichu"] =  18000,
["Sandshrew"] =  1000,
["Sandslash"] =  11000,
["Nidoran Female"] =  125,
["Nidorina"] =  2250,
["Nidoqueen"] =  12250,
["Nidoran Male"] =  125,
["Nidorino"] =  2250,
["Nidoqueen"] = 12250,
["Clefairy"] =  8000,
["Clefable"] =  18000,
["Vulpix"] =  1000,
["Ninetales"] = 11000,
["Jigglypuff"] =  8000,
["Wigglytuff"] =  18000,
["Zubat"] =  120,
["Golbat"] =  3000,
["Oddish"] =  80,
["Gloom"] =  2250,
["Vileplume"] =  12000,
["Paras"] =  60,
["Parasect"] =  7250, 
["Venonat"] =  1500,
["Venomoth"] =  7250,
["Diglett"] =  200,
["Dugtrio"] =  3000,
["Meowth"] =  300,
["Persian"] =  3000,
["Psyduck"] =  1500,
["Golduck"] =  11500,
["Mankey"] =  300,
["Primeape"] =  7250,
["Growlithe"] =  3500,
["Arcanine"] =  60000,
["Poliwag"] =  80,
["Poliwhirl"] =  3000,
["Poliwrath"] =  13000,
["Abra"] =  800,
["Kadabra"] =  5800,
["Alakazam"] =  16000,
["Machop"] =  2000,
["Machoke"] =  7000,
["Machamp"] =  17000,
["Bellsprout"] =  80,
["Wepinbell"] =  2250,
["Victreebel"] =  12000,
["Tentacool"] =  300,
["Tentacruel"] =  10000,
["Geodude"] =  300,
["Graveler"] =  5000,
["Golem"] =  15000,
["Ponyta"] =  1500,
["Rapidash"] =  6500,
["Slowpoke"] =  400,
["Slowbro"] =  8000,
["Magnemite"] =  400,
["Magneton"] =  5400,
["Farfetch'd"] =  7000,
["Doduo"] =  600,
["Dodrio"] =  5600,
["Seel"] =  2000,
["Dewgong"] = 12000,
["Grimer"] =  300,
["Muk"] =  11000,
["Shellder"] =  200,
["Cloyster"] =  10200,
["Gastly"] =  3000,
["Haunter"] =  8000,
["Gengar"] =  18000,
["Onix"] =  6000,
["Drowzee"] =  1000,
["Hypno"] =  6000,
["Krabby"] =  200,
["Kingler"] =  5200,
["Voltorb"] =  250,
["Electrode"] =  3000,
["Exeggute"] =  200,
["Exeggutor"] =  10000,
["Cubone"] =  1000,
["Marowak"] =  11000,
["Hitmonlee"] =  20000,
["Hitmonchan"] =  20000,
["Lickitung"] =  60000,
["Koffing"] =  300,
["Weezing"] =  3000,
["Rhyhorn"] =  3000,
["Rhydon"] =  13000,
["Chansey"] =  40000,
["Tangela"] =  10000,
["Kangaskhan"] = 120000,
["Horsea"] =  200,
["Seadra"] =  5500,
["Goldeen"] =  200,
["Seaking"] =  3000,
["Staryu"] =  400,
["Starmie"] =  3000,
["Mr. Mime"] =  120000,
["Scyther"] =  120000,
["Jynx"] =  120000,
["Electabuzz"] =  120000,
["Magmar"] =  120000,
["Pinsir"] =  9000,
["Tauros"] =  5000,
["Magikarp"] =  5,
["Gyarados"] =  5000,
["Lapras"] =  120000,
["Ditto"] =  70000,
["Eevee"] =  45000,
["Vaporeon"] =  50000,
["Jolteon"] =  50000,
["Flareon"] =  50000,
["Porygon"] =  60000,
["Omanyte"] =  20000,
["Omastar"] =  75000,
["Kabuto"] =  2000,
["Kabutops"] =  75000,
["Aerodactyl"] =  2000000,
["Snorlax"] =  200000,
["Dratini"] =  15000,
["Dragonair"] =  65000,
["Dragonite"] =  125000,
 
-- Segunda Geração

["Chikorita"] = 3000,
["Bayleef"] = 8000,
["Meganium"] = 18000,
["Cydaquil"] = 3000,
["Quilava"] = 8000,
["Typhlosion"] = 18000,
["Totodile"] = 3000,
["Croconaw"] = 8000,
["Feraligatr"] = 18000,
["Sentret"] = 250,
["Furret"] = 3000,
["Hoothoot"] = 1500,
["Noctowl"] = 11500,
["Ledyba"] = 250,
["Ledian"] = 3000,
["Spinarak"] = 250,
["Ariados"] = 3000,
["Crobat"] = 58000,
["Chinchou"] = 1000,
["Lanturn"] = 6000,
["Pichu"] = 3000,
["Cleffa"] = 3000,
["Igglybuff"] = 3000,
["Togepi"] = 15000,
["Togetic"] = 25000,
["Natu"] = 3000,
["Xatu"] = 130000,
["Mareep"] = 3000,
["Flaaffy"] = 8000,
["Ampharos"] = 18000,
["Bellossom"] = 12000,
["Marill"] = 3000,
["Azumarill"] = 13000,
["Sudowoodo"] = 120000,
["Politoed"] = 8000,
["Hoppip"] = 80,
["Skiploom"] = 2250,
["Jumpluff"] = 12000,
["Aipom"] = 8000,
["Sunkern"] = 50,
["Sunflora"] = 5000,
["Yanma"] = 9000,
["Wooper"] = 2000,
["Quagsire"] = 12000,
["Espeon"] = 50000,
["Umbreon"] = 50000,
["Murkrow"] = 10000,
["Slowking"] = 11000,
["Misdreavus"] = 100000,
["Wobbuffet"] = 200000,
["Girafarig"] = 120000,
["Pineco"] = 300,
["Forretress"] = 10000,
["Dunsparce"] = 3000,
["Gligar"] = 8000,
["Steelix"] = 110000,
["Snubbull"] = 22500,
["Granbull"] = 12500,
["Qwilfish"] = 10000,
["Scizor"] = 220000,
["Shuckle"] = 3500,
["Heracross"] = 120000,
["Sneasel"] = 10000,
["Teddiursa"] = 80000,
["Ursaring"] = 150000,
["Slugma"] = 1000,
["Magcargo"] = 11000,
["Swinub"] = 1000,
["Piloswine"] = 11000,
["Corsola"] = 9000,
["Remoraid"] = 200,
["Octillery"] = 10000,
["Delibird"] = 10000,
["Mantine"] = 120000,
["Skarmory"] = 120000,
["Houndour"] = 5000,
["Houndoom"] = 13500,
["kingdra"] = 70000,
["Phanpy"] = 3000,
["Donphan"] = 13000,
["Porygon2"] = 120000,
["Stantler"] = 10000,
["Tyrogue"] = 15000,
["Hitmontop"] = 50000,
["Smoochum"] = 45000,
["Elikid"] = 45000,
["Magby"] = 45000,
["Miltank"] = 120000,
["Blissey"] = 140000,
["Larvitar"] = 15000,
["Pupitar"] = 65000,
["Electivire"] = 125000,
["Magmortar"] = 125000,
["Tyranitar"] = 125000,
["Giant Magikarp"] = 50000,
["Shiny Giant Magikarp"] = 200000,
-- shiny --
["Shiny Fearow"] = 1500000,
["Shiny Vileplume"] = 1500000,
["Shiny Golem"] = 1500000,
["Shiny Nidoking"] = 1500000,
["Shiny Hypno"] = 1500000,
["Shiny Vaporeon"] = 1500000,
["Shiny Jolteon"] = 1500000,
["Shiny Flareon"] = 1500000,
["Shiny Hitmontop"] = 1500000,
["Shiny Tangrowth"] = 1500000,
["Tangrowth"] = 50000,
["Yanmega"] = 500000,
}

        if monsterType then
            local balls = player:getPokeballs()
            for i=1, #balls do
                local ball = balls[i]
                local name = firstToUpper(ball:getSpecialAttribute("pokeName"))
                if name == msg then
                    local isBallBeingUsed = ball:getSpecialAttribute("isBeingUsed")
                    if isBallBeingUsed and isBallBeingUsed == 1 then
                        selfSay('Sorry, not possible while using the Pokemon.', cid)
                        return true
                    end

                    local boost = ball:getSpecialAttribute("pokeBoost") or 0
                    local level = ball:getSpecialAttribute("pokeLevel")
                    local rawPrice = pokePrice[name] 
                    local price = rawPrice + boost * 1000
                    
                    if ball:remove() then
                        selfSay('Take ' .. price .. ' by your ' .. name .. ' level ' .. level .. ' boost ' .. boost .. '. Thanks!', cid)
                        player:addMoney(price)
                        player:refreshPokemonBar({}, {})
                    end
                    return true
                end
            end
            selfSay('You do not have this pokemon.', cid)
        else
            selfSay('I do not like this pokemon.', cid)
        end
    end
    return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 

 espero que alguem possa me ajudar a base que estou usando e essa   https://xtibia.com/forum/topic/253494-1098-pokedash-pota-v10-tfs-12-server-client-sources-site-map-editor-e-item-editor/

Editado por Peter222
Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...