Postado Janeiro 8, 2012 13 anos bem eu queria q vcs juntassem esses 2 scripts (vou tenta explicar da melhor forma) http://tibiaking.com...-points-system/ http://tibiaking.com...y-skydangerous/ é o seguinte eu queria q modificassem o system de pontos para tipo nao ganha por tempo on eu quero transformar tipo como no pontos do gesior so q no ot isso é possivel disso eu sei é o seguinte eu quero q os pontos tejam comando para add ponto no player ai o player !plist e ve os pontos ai quanto ao shop quero q juntem para ter la preço:ja tem uma sword la exemplo Fire Sword, Preço:21000 eu quero por Preço: exemplo Preço: 10 Pontos e quando fala !buy Fire Sword sai 10 pontos do player eu vo add mais coisas é para meu server de pokemon eu pensei nisso ai e mais uma edite outro script por favor esse aki local ballslot = 12355 local ballslot_run = 12352 local stoneslot = 12354 local stoneslot_run = 12353 local button = 12356 local button_run = 12357 function isRunning(id) if isInArray({button_run, stoneslot_run, ballslot_run}, id) then return true end return false end boost_stones = { ["Bulbasaur"] = {leaf}, ["Ivysaur"] = {leaf}, ["Venusaur"] = {leaf}, ["Charmander"] = {fire}, ["Charmeleon"] = {fire}, ["Charizard"] = {fire}, ["Squirtle"] = {water}, ["Wartortle"] = {water}, ["Blastoise"] = {water}, ["Caterpie"] = {coccon}, ["Metapod"] = {coccon}, ["Butterfree"] = {coccon}, ["Weedle"] = {coccon}, ["Kakuna"] = {coccon}, ["Beedrill"] = {coccon}, ["Pidgey"] = {heart}, ["Pidgeotto"] = {heart}, ["Pidgeot"] = {heart}, ["Rattata"] = {heart}, ["Raticate"] = {heart}, ["Spearow"] = {heart}, ["Fearow"] = {heart}, ["Ekans"] = {venom}, ["Arbok"] = {venom}, ["Pikachu"] = {thunder}, ["Raichu"] = {thunder}, ["Sandshrew"] = {earth}, ["Sandslash"] = {earth}, ["Nidoran Female"] = {venom}, ["Nidorina"] = {venom}, ["Nidoqueen"] = {venom, earth}, ["Nidoran Male"] = {venom}, ["Nidorino"] = {venom}, ["Nidoking"] = {venom, earth}, ["Clefairy"] = {heart}, ["Clefable"] = {heart}, ["Vulpix"] = {fire}, ["Ninetales"] = {fire}, ["Jigglypuff"] = {heart}, ["Wigglytuff"] = {heart}, ["Zubat"] = {venom}, ["Golbat"] = {venom}, ["Oddish"] = {leaf, venom}, ["Gloom"] = {leaf, venom}, ["Vileplume"] = {leaf, venom}, ["Paras"] = {coccon, leaf}, ["Parasect"] = {coccon, leaf}, ["Venonat"] = {coccon, venom}, ["Venomoth"] = {coccon, venom}, ["Diglett"] = {earth}, ["Dugtrio"] = {earth}, ["Meowth"] = {heart}, ["Persian"] = {heart}, ["Psyduck"] = {water}, ["Golduck"] = {water, enigma}, ["Mankey"] = {punch}, ["Primeape"] = {punch}, ["Growlithe"] = {fire}, ["Arcanine"] = {fire}, ["Poliwag"] = {water}, ["Poliwhirl"] = {water}, ["Poliwrath"] = {water, punch}, ["Abra"] = {enigma}, ["Kadabra"] = {enigma}, ["Alakazam"] = {enigma}, ["Machop"] = {punch}, ["Machoke"] = {punch}, ["Machamp"] = {punch}, ["Bellsprout"] = {leaf, venom}, ["Weepinbell"] = {leaf, venom}, ["Victreebel"] = {leaf, venom}, ["Tentacool"] = {water, venom}, ["Tentacruel"] = {water, venom}, ["Geodude"] = {earth, rock}, ["Graveler"] = {earth, rock}, ["Golem"] = {earth, rock}, ["Ponyta"] = {fire}, ["Rapidash"] = {fire}, ["Slowpoke"] = {water, enigma}, ["Slowbro"] = {water, enigma}, ["Magnemite"] = {thunder, metal}, ["Magneton"] = {thunder, metal}, ["Farfetch'd"] = {heart}, ["Doduo"] = {heart}, ["Dodrio"] = {heart}, ["Seel"] = {water, ice}, ["Dewgong"] = {water, ice}, ["Grimer"] = {venom}, ["Muk"] = {venom}, ["Shellder"] = {water, ice}, ["Cloyster"] = {water, ice}, ["Gastly"] = {dark}, ["Haunter"] = {dark}, ["Gengar"] = {dark}, ["Onix"] = {rock, earth}, ["Drowzee"] = {enigma}, ["Hypno"] = {enigma}, ["Krabby"] = {water}, ["Kingler"] = {water}, ["Voltorb"] = {thunder}, ["Electrode"] = {thunder}, ["Exeggcute"] = {enigma, leaf}, ["Exeggutor"] = {enigma, leaf}, ["Cubone"] = {earth}, ["Marowak"] = {earth}, ["Hitmonlee"] = {punch}, ["Hitmonchan"] = {punch}, ["Lickitung"] = {heart}, ["Koffing"] = {venom}, ["Weezing"] = {venom}, ["Rhyhorn"] = {earth, rock}, ["Rhydon"] = {earth, rock}, ["Chansey"] = {heart}, ["Tangela"] = {leaf}, ["Kangaskhan"] = {heart}, ["Horsea"] = {water}, ["Seadra"] = {water}, ["Goldeen"] = {water}, ["Seaking"] = {water}, ["Staryu"] = {water}, ["Starmie"] = {water}, ["Mr. Mime"] = {enigma}, ["Scyther"] = {coccon}, ["Jynx"] = {enigma, ice}, ["Electabuzz"] = {thunder}, ["Magmar"] = {fire}, ["Pinsir"] = {coccon}, ["Tauros"] = {heart}, ["Magikarp"] = {water}, ["Gyarados"] = {water, crystal}, ["Lapras"] = {water, ice}, ["Ditto"] = {heart}, ["Eevee"] = {heart}, ["Vaporeon"] = {water}, ["Jolteon"] = {thunder}, ["Flareon"] = {fire}, ["Porygon"] = {heart, enigma}, ["Omanyte"] = {rock, water}, ["Omastar"] = {rock, water}, ["Kabuto"] = {rock, water}, ["Kabutops"] = {rock, water}, ["Aerodactyl"] = {rock}, ["Snorlax"] = {heart}, ["Articuno"] = {ice}, ["Zapdos"] = {thunder}, ["Moltres"] = {fire}, ["Dratini"] = {crystal}, ["Dragonair"] = {crystal}, ["Dragonite"] = {crystal}, ["Mewtwo"] = {enigma}, ["Mew"] = {enigma}} function doRestoreBoostMachine(cid, b_pos, p_pos, s_pos, msg, msg2) doSendAnimatedText(b_pos, "DONE.", 215) if isCreature(cid) then doCreatureSetNoMove(cid, false) doPlayerSendTextMessage(cid, 27, msg) doPlayerSendTextMessage(cid, 27, msg2) end local ball_s = getTileItemById(p_pos, ballslot_run) doTransformItem(ball_s.uid, ballslot) local stne_s = getTileItemById(s_pos, stoneslot_run) doTransformItem(stne_s.uid, stoneslot) local butn_s = getTileItemById(b_pos, button_run) doTransformItem(butn_s.uid, button) end local stones_required = { -- custo base de stones para boostar [heart] = 1, [leaf] = 1, [water] = 1, [venom] = 1, [thunder] = 1, [rock] = 1, [punch] = 1, [fire] = 1, [coccon] = 1, [crystal] = 1, [dark] = 1, [earth] = 1, [enigma] = 1, [ice] = 1, } local stone_increase = { -- a cada quantos boosts irá aumentar o custo de stones [heart] = 3, [leaf] = 3, [water] = 3, [venom] = 4, [thunder] = 4, [rock] = 3, [punch] = 4, [fire] = 3, [coccon] = 2, [crystal] = 15, [dark] = 4, [earth] = 4, [enigma] = 4, [ice] = 4, } function onUse(cid, item, topos, item2, frompos) if isRunning(item.itemid) then doPlayerSendCancel(cid, "Wait until boosting finishes.") return true end if item.itemid == button then local pbpos = topos pbpos.x = pbpos.x + 1 local ball_slot = getTileItemById(pbpos, ballslot) local myball = getContainerItem(ball_slot.uid, 0) if myball.uid <= 0 or getItemWeight(myball.uid) == 0 then doPlayerSendCancel(cid, "You need to put a pokeball in the ball slot.") return true end local pokemon = getItemAttribute(myball.uid, "poke") local boost = getItemAttribute(myball.uid, "boost") or 0 if boost >= 150 then doPlayerSendCancel(cid, "Your pokemon is already at maximum boost.") return true end local stnpos = pbpos stnpos.x = stnpos.x - 2 local stone_slot = getTileItemById(stnpos, stoneslot) local stone = getContainerItem(stone_slot.uid, 0) if stone.uid <= 0 then doPlayerSendCancel(cid, "You need to put a stone in the stone slot.") return true end if not isStone(stone.itemid) then doPlayerSendCancel(cid, "Please, put only stones in the stone slot.") return true end if not isInArray(boost_stones[pokemon], stone.itemid) then local cancelstr = "Sorry, you are not using the correct stone." if #boost_stones[pokemon] > 1 then local stonesused = "" cancelstr = cancelstr.." This pokemon needs " for su = 1, #boost_stones[pokemon] do local n = doCorrectString(getItemNameById(boost_stones[pokemon][su])) if su == #boost_stones[pokemon] then stonesused = stonesused.." or "..getArticle(n).." "..n.."" elseif su == 1 then stonesused = stonesused..""..getArticle(n).." "..n.."" else stonesused = stonesused..", "..n.."" end end cancelstr = cancelstr..""..stonesused.." to be boosted." else cancelstr = cancelstr.." This pokemon needs a "..doCorrectString(getItemNameById(boost_stones[pokemon][1])).." to be boosted." end doPlayerSendCancel(cid, cancelstr) return true end local removeStones = 0 local extraStones = math.floor(boost / stone_increase[stone.itemid]) local required_stones = stones_required[stone.itemid] + extraStones local boosts = 0 for a = 0, getContainerSize(stone_slot.uid) - 1 do local it = getContainerItem(stone_slot.uid, a) if it.uid > 0 then if not isStone(it.itemid) then doPlayerSendCancel(cid, "Please, put only stones in the stone slot.") return true end if it.itemid ~= stone.itemid then doPlayerSendCancel(cid, "Please, put only one type of stone in the stone slot.") return true end if required_stones > 0 then required_stones = required_stones - 1 if required_stones <= 0 then boosts = boosts + 1 removeStones = removeStones + stones_required[stone.itemid] + extraStones if boost + boosts <= 49 then extraStones = math.floor((boost + boosts) / stone_increase[stone.itemid]) required_stones = stones_required[stone.itemid] + extraStones end end end end end if required_stones > 0 and boosts == 0 then doPlayerSendCancel(cid, "You need more stones to boost this pokemon.") return true end for b = 1, removeStones do doRemoveItem(getContainerItem(stone_slot.uid, 0).uid, 1) end local off = pokes[pokemon].offense * boost_rate * boosts local def = pokes[pokemon].defense * boost_rate * boosts local agi = pokes[pokemon].agility * boosts local spatk = pokes[pokemon].specialattack * boost_rate * boosts local vit = pokes[pokemon].vitality * boost_rate * boosts doSetItemAttribute(myball.uid, "boost", boost + boosts) doItemSetAttribute(myball.uid, "offense", getItemAttribute(myball.uid, "offense") + off) doItemSetAttribute(myball.uid, "defense", getItemAttribute(myball.uid, "defense") + def) doItemSetAttribute(myball.uid, "speed", getItemAttribute(myball.uid, "speed") + agi) doItemSetAttribute(myball.uid, "specialattack", getItemAttribute(myball.uid, "specialattack") + spatk) doItemSetAttribute(myball.uid, "vitality", getItemAttribute(myball.uid, "vitality") + vit) local msg = "Your "..getPokeballName(myball.uid).." ["..getItemAttribute(myball.uid, "level").."] has been boosted!" local msg2 = "• Boost: "..(boost + boosts).." (+"..boosts..") • Offense: +"..doMathDecimal(off).." • Defense: +"..doMathDecimal(def).." • Spc. Atk: +"..doMathDecimal(spatk).." • Agility: +"..doMathDecimal(agi).." • Vitality: +"..doMathDecimal(vit).."" local downpos = getThingPos(cid) downpos.y = downpos.y + 1 local mypos = getThingPos(cid) doTeleportThing(cid, downpos, false) doTeleportThing(cid, mypos, false) doTransformItem(ball_slot.uid, ballslot_run) doTransformItem(stone_slot.uid, stoneslot_run) doTransformItem(item.uid, button_run) doCreatureSetNoMove(cid, true) doCreatureAddCondition(cid, boostcondition) addEvent(doRestoreBoostMachine, 3000, cid, getThingPos(item.uid), getThingPos(ball_slot.uid), getThingPos(stone_slot.uid), msg, msg2) return true end end eu quero q so fassa mudar para usa so um item na ball ai saia o efeito 18 e esse um item é Boost Stone ai ta Boost Machine eu quero por Stone para ser so uma stone uso uma vez na ball Boost +1 2 vez Boost +2 e assim vai é q ja ta com limite de 150 boosts no lib se eu quiser aumento mais tentem fazer por favor Attr: Snowsz @UP Puis Quote Editado Janeiro 12, 2012 13 anos por 1215171 (veja o histórico de edições) Ae ajudei? Rep+
Postado Janeiro 9, 2012 13 anos Olha faz assim, adc o sistema de points normalmente tenho 2 formas ah de talkaction e a de npc. NPC: local focuses = {} local items = { [12427] = {price = 10, requirePremium = false}, [2400] = {price = 1500, requirePremium = true} } local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks) local info = items[item] if(info and doPlayerRemoveItem(cid, 6527, info.price)) then doPlayerAddItem(cid, item) selfSay("Here we are!", cid) lookAtFocus(focuses) else selfSay("You can't buy this item!", cid) end return true end function onCreatureSay(cid, type, msg) local shopWindow = {} local msg = msg:lower() or "" if(msg:find("hi") or msg:find("hello") and not(isFocused(cid, focuses)) and getNpcDistanceTo(cid) <= 4) then focuses[cid] = {talkstate = 1} selfSay("Hiho, ".. getCreatureName(cid) .. ". I can sell to you some {items} for {P Points}.", cid) addFocus(cid, focuses) selfFocus(cid) elseif(msg:find("bye") or msg:find("goodbye") and isFocused(cid, focuses)) then selfSay("Goodbye!", cid) closeShopWindow(cid) removeFocus(cid, focuses) lookAtFocus(focuses) end if(focuses[cid].talkstate == 1) then if(msg:find("items") or msg:find("trade")) then selfSay("Take a look at my items!", cid) for index, info in pairs(items) do if(not(info.requirePremium) or (isPremium(cid) and info.requirePremium)) then table.insert(shopWindow, {id = index, subType = 0, buy = info.price, sell = 0, name = getItemNameById(index)}) end end openShopWindow(cid, shopWindow, onBuy, onSell) end end return true end function onThink() for i, focus in pairs(focuses) do if(isPlayer(focus) and isFocused(focus, focuses)) then local distance = getNpcDistanceTo(focus) or -1 if(distance >= 4 or distance == -1) then selfSay("Hmph!") closeShopWindow(focus) removeFocus(focus, focuses) end end end lookAtFocus(focuses) end e depois adiciona isso em data/npc/lib. function isFocused(cid, t) for i, v in pairs(t) do if(v == cid) then return true end end return false end function addFocus(cid, t) if(not isFocused(cid, t)) then table.insert(t, cid) end end function setFocus(t) for i, v in pairs(t) do if(isPlayer(v)) then doNpcSetCreatureFocus(v) return end end doNpcSetCreatureFocus(0) end function removeFocus(cid, t) for i, v in pairs(t) do if(v == cid) then table.remove(t, i) setFocus(focuses) break end end end function onCreatureDisappear(cid) if isFocused(cid, focuses) then removeFocus(cid, focuses) if isPlayer(cid) then closeShopWindow(cid) end end end lookAtFocus = setFocus agora se quiser o de talkactions: local config = { minlvl = false, premmyonly = false, } local list = { ["magic plate armor"] = {points = 10, id = 2472}, ["golden legs"] = {points = 7, id = 2470}, ["magic longsword"] = {points = 20, id = 2390}, } function onSay(cid, words, param) local param = param:lower() if (param ~= "list") and (param ~= "help")then return doPlayerSendTextMessage(cid, 27, "You must use the correct parameters.\n If you need help use: ".. words .. " help\n and to se the items list use: ".. words .. " list") end if (premmyonly and getPlayerPremiumDays(cid) < 1) then return doPlayerSendTextMessage(cid, 27, "Only players that have premium account can use shop system.") end if (type(minlvl) == "number" and getPlayerLevel(cid) < minlvl) then return doPlayerSendTextMessage(cid, 27, "Only players with level ".. config.minlvl .." or higher can use the Point Shop System.") end if (param == "help") then return doPlayerPopupFYI(cid, "Points Shop System Help: \n\n\n*How to see the list of items that have in the shop.\n\nIt's simple, you only need use this command: " .. words .. " list\nand will show in your screen the list of items that are display in shop.\n\n\n*How to buy a item.\n\nIt's simple, you only need use: " .. words .. " item name\n Example: " .. words .. " magic plate armor.") elseif (param == "list") then indexloks = "This is the shop list:\n" for a, b in pairs(list) do poin = "points" if b.points < 2 then poin = "point" end indexloks = "\n" .. indexloks .. a:sub(1, 1):upper().. a:sub(2):lower() .. " - " .. b.points .. " " .. poin ..";" end indexloks = indexloks:sub(1, #indexloks-1) .. "." return doShowTextDialog(cid, 2160, indexloks) end if getPoints(cid) < list[param].points then lawl = "a" .. getPoints(cid) - list[param].points return doPlayerSendTextMessage(cid, 27, "To buy " .. param:sub(1, 1):upper().. param:sub(2):lower() .. " you must have more ".. lawl:sub(3, #lawl) .. " point(s).") end doPlayerAddItem(cid, list[param].id, 1) doPlayerRemovePoints(cid, list[param].points) return doPlayerSendTextMessage(cid, 27, "You bought " .. param:sub(1, 1):upper().. param:sub(2):lower() .. " for " .. list[param].points ..", now you have " .. getPoints(cid) .. " points.") end e adc isso em talkactions.xml: <talkaction words="!pshop" sensitive="false" event="script" value="pshop.lua"/> bem não vou explicar mas acho que você vai conseguir editar. creditos pelo npc: ramza editado por Garou creditos pela talkactions: MaXwEllDeN espero que de certo. www.patronum.online
Postado Janeiro 9, 2012 13 anos Autor o script nao pego Editado Janeiro 10, 2012 13 anos por 1215171 (veja o histórico de edições) Ae ajudei? Rep+
Postado Janeiro 9, 2012 13 anos Cara, você postou na area errada, Acho que isso é uma duvida ou um pedido, então a area certa seria essa E outra coisa, o titulo do topico nao é muito explciativo, peço que você leia as regras do TibiaKing. Abraços.
Postado Janeiro 9, 2012 13 anos Autor mais cera q auguem vai fazer da boost stone ? por favor auguem fassa Editado Janeiro 10, 2012 13 anos por 1215171 (veja o histórico de edições) Ae ajudei? Rep+
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.