Tudo que jotape1322 postou
-
(Resolvido)exercise dummy
.Qual servidor ou website você utiliza como base? 1.3 Qual o motivo deste tópico? seguinte, o script ta funcionando lindo e perfeito, exceto quando eu estou treinando e deslogo o char sem parar de treinar, ai quando eu relogo o char ele fala pra mim que eu já estou treinando daí não consigo treinar mais, sei que tem algo a ver com o storage do player que ta setado como treinando preciso que quando ele deslogue ele mude esse storage Está surgindo algum erro? Se sim coloque-o aqui. Você tem o código disponível? Se tiver publique-o aqui: local skills = { [32384] = {id=SKILL_SWORD,voc=4}, -- KNIGHT [32385] = {id=SKILL_AXE,voc=4}, -- KNIGHT [32386] = {id=SKILL_CLUB,voc=4}, -- KNIGHT [32387] = {id=SKILL_DISTANCE,voc=3,range=CONST_ANI_SIMPLEARROW}, -- PALADIN [32388] = {id=SKILL_MAGLEVEL,voc=2,range=CONST_ANI_SMALLICE}, -- DRUID [32389] = {id=SKILL_MAGLEVEL,voc=1,range=CONST_ANI_FIRE}, -- SORCERER [32124] = {id=SKILL_SWORD,voc=4}, -- KNIGHT [32125] = {id=SKILL_AXE,voc=4}, -- KNIGHT [32126] = {id=SKILL_CLUB,voc=4}, -- KNIGHT [32127] = {id=SKILL_DISTANCE,voc=3,range=CONST_ANI_SIMPLEARROW}, -- PALADIN [32128] = {id=SKILL_MAGLEVEL,voc=2,range=CONST_ANI_SMALLICE}, -- DRUID [32129] = {id=SKILL_MAGLEVEL,voc=1,range=CONST_ANI_FIRE} -- SORCERER } local houseDummies = {32143, 32144, 32145, 32146, 32147, 32148} local freeDummies = {32142, 32149} local skillRateDefault = configManager.getNumber(configKeys.RATE_SKILL) local magicRateDefault = configManager.getNumber(configKeys.RATE_MAGIC) local function removeExerciseWeapon(player, exercise) exercise:remove(1) player:sendTextMessage(MESSAGE_INFO_DESCR, "Your training weapon vanished.") stopEvent(training) player:setStorageValue(Storage.isTraining,0) end local function start_train(pid,start_pos,itemid,fpos, bonusDummy, dummyId) local player = Player(pid) if player ~= nil then if Tile(fpos):getItemById(dummyId) then local pos_n = player:getPosition() if start_pos:getDistance(pos_n) == 0 and getTilePzInfo(pos_n) then if player:getItemCount(itemid) >= 1 then local exercise = player:getItemById(itemid,true) if exercise:isItem() then if exercise:hasAttribute(ITEM_ATTRIBUTE_CHARGES) then local charges_n = exercise:getAttribute(ITEM_ATTRIBUTE_CHARGES) if charges_n >= 1 then exercise:setAttribute(ITEM_ATTRIBUTE_CHARGES,(charges_n-1)) local voc = player:getVocation() if skills[itemid].id == SKILL_MAGLEVEL then local magicRate = getRateFromTable(magicLevelStages, player:getMagicLevel(), magicRateDefault) if not bonusDummy then player:addManaSpent(math.ceil(500*magicRate)) else player:addManaSpent(math.ceil(500*magicRate)*1.1) -- 10% end else local skillRate = getRateFromTable(skillsStages, player:getEffectiveSkillLevel(skills[itemid].id), skillRateDefault) if not bonusDummy then player:addSkillTries(skills[itemid].id, 7*skillRate) else player:addSkillTries(skills[itemid].id, (7*skillRate)*1.1) -- 10% end end fpos:sendMagicEffect(CONST_ME_HITAREA) if skills[itemid].range then pos_n:sendDistanceEffect(fpos, skills[itemid].range) end if exercise:getAttribute(ITEM_ATTRIBUTE_CHARGES) == 0 then removeExerciseWeapon(player, exercise) else local training = addEvent(start_train, voc:getAttackSpeed(), pid,start_pos,itemid,fpos,bonusDummy,dummyId) player:setStorageValue(Storage.isTraining,1) end else removeExerciseWeapon(player, exercise) end end end end else player:sendTextMessage(MESSAGE_INFO_DESCR, "Your training has stopped.") stopEvent(training) player:setStorageValue(Storage.isTraining,0) end else stopEvent(training) player:sendTextMessage(MESSAGE_INFO_DESCR, "Your training has stopped.") player:setStorageValue(Storage.isTraining, 0) end else stopEvent(training) if player then player:sendTextMessage(MESSAGE_INFO_DESCR, "Your training has stopped.") player:setStorageValue(Storage.isTraining,0) end end return true end function onUse(player, item, fromPosition, target, toPosition, isHotkey) local start_pos = player:getPosition() if player:getStorageValue(Storage.isTraining) == 1 then player:sendTextMessage(MESSAGE_INFO_DESCR, "You are already training.") return false end if target:isItem() then if isInArray(houseDummies,target:getId()) then if not skills[item.itemid].range and (start_pos:getDistance(target:getPosition()) > 1) then player:sendTextMessage(MESSAGE_INFO_DESCR, "Get closer to the dummy.") stopEvent(training) return true end player:sendTextMessage(MESSAGE_INFO_DESCR, "You started training.") start_train(player:getId(),start_pos,item.itemid,target:getPosition(), true, target:getId()) elseif isInArray(freeDummies, target:getId()) then if not skills[item.itemid].range and (start_pos:getDistance(target:getPosition()) > 1) then player:sendTextMessage(MESSAGE_INFO_DESCR, "Get closer to the dummy.") stopEvent(training) return true end player:sendTextMessage(MESSAGE_INFO_DESCR, "You started training.") start_train(player:getId(),start_pos,item.itemid,target:getPosition(), false, target:getId()) end end return true end Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. sendo que ele não está treinando resolvido, em login lua na function onlogin adicionei player:setStorageValue(Storage.isTraining,0) e toda vez que ele loga ele seta o storage do trainer pra 0
-
failed to load external
rashid.lua 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 function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local player = Player(cid) if(msgcontains(msg, "mission")) then if(os.date("%A") == "Monday") then if(player:getStorageValue(Storage.TravellingTrader.Mission01) < 1) then npcHandler:say("Well, you could attempt the mission to become a recognised trader, but it requires a lot of travelling. Are you willing to try?", cid) npcHandler.topic[cid] = 1 elseif(player:getStorageValue(Storage.TravellingTrader.Mission01) == 1) then npcHandler:say("Have you managed to obtain a rare deer trophy for my customer?", cid) npcHandler.topic[cid] = 3 end elseif(os.date("%A") == "Tuesday") then if(player:getStorageValue(Storage.TravellingTrader.Mission01) == 2 and player:getStorageValue(Storage.TravellingTrader.Mission02) < 1 ) then npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", cid) npcHandler.topic[cid] = 4 elseif(player:getStorageValue(Storage.TravellingTrader.Mission02) == 4) then npcHandler:say("Did you bring me the package?", cid) npcHandler.topic[cid] = 6 end elseif(os.date("%A") == "Wednesday") then if(player:getStorageValue(Storage.TravellingTrader.Mission02) == 5 and player:getStorageValue(Storage.TravellingTrader.Mission03) < 1 ) then npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", cid) npcHandler.topic[cid] = 7 elseif(player:getStorageValue(Storage.TravellingTrader.Mission03) == 2) then npcHandler:say("Have you brought the cheese?", cid) npcHandler.topic[cid] = 9 end elseif(os.date("%A") == "Thursday") then if(player:getStorageValue(Storage.TravellingTrader.Mission03) == 3 and player:getStorageValue(Storage.TravellingTrader.Mission04) < 1) then npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", cid) npcHandler.topic[cid] = 10 elseif(player:getStorageValue(Storage.TravellingTrader.Mission04) == 2) then npcHandler:say("Have you brought the vase?", cid) npcHandler.topic[cid] = 12 end elseif(os.date("%A") == "Friday") then if(player:getStorageValue(Storage.TravellingTrader.Mission04) == 3 and player:getStorageValue(Storage.TravellingTrader.Mission05) < 1) then npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", cid) npcHandler.topic[cid] = 13 elseif(player:getStorageValue(Storage.TravellingTrader.Mission05) == 2) then npcHandler:say("Have you brought a cheap but good crimson sword?", cid) npcHandler.topic[cid] = 15 end elseif(os.date("%A") == "Saturday") then if(player:getStorageValue(Storage.TravellingTrader.Mission05) == 3 and player:getStorageValue(Storage.TravellingTrader.Mission06) < 1) then npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", cid) npcHandler.topic[cid] = 16 elseif(player:getStorageValue(Storage.TravellingTrader.Mission06) == 1) then npcHandler:say("Have you brought me a gold fish??", cid) npcHandler.topic[cid] = 18 end elseif(os.date("%A") == "Sunday") then if(player:getStorageValue(Storage.TravellingTrader.Mission06) == 2 and player:getStorageValue(Storage.TravellingTrader.Mission07) ~= 1) then npcHandler:say("Ah, right. <ahem> I hereby declare you - one of my recognised traders! Feel free to offer me your wares!", cid) player:setStorageValue(Storage.TravellingTrader.Mission07, 1) player:addAchievement('Recognised Trader') npcHandler.topic[cid] = 0 end end elseif(msgcontains(msg, "yes")) then if(npcHandler.topic[cid] == 1) then npcHandler:say({ "Very good! I need talented people who are able to handle my wares with care, find good offers and the like, so I'm going to test you. ...", "First, I'd like to see if you can dig up rare wares. Something like a ... mastermind shield! ...", "Haha, just kidding, fooled you there, didn't I? Always control your nerves, that's quite important during bargaining. ...", "Okay, all I want from you is one of these rare deer trophies. I have a customer here in Svargrond who ordered one, so I'd like you to deliver it tome while I'm in Svargrond. ...", "Everything clear and understood?" }, cid) npcHandler.topic[cid] = 2 elseif(npcHandler.topic[cid] == 2) then npcHandler:say("Fine. Then get a hold of that deer trophy and bring it to me while I'm in Svargrond. Just ask me about your mission.", cid) player:setStorageValue(Storage.TravellingTrader.Mission01, 1) npcHandler.topic[cid] = 0 elseif(npcHandler.topic[cid] == 3) then if player:removeItem(7397, 1) then npcHandler:say("Well done! I'll take that from you. <snags it> Come see me another day, I'll be busy for a while now. ", cid) player:setStorageValue(Storage.TravellingTrader.Mission01, 2) npcHandler.topic[cid] = 0 end elseif(npcHandler.topic[cid] == 4) then npcHandler:say({ "Alright, that's good to hear. From you as my trader and deliveryman, I expect more than finding rare items. ...", "You also need to be able to transport heavy wares, weaklings won't get far here. I have ordered a special package from Edron. ...", "Pick it up from Willard and bring it back to me while I'm in Liberty Bay. Everything clear and understood?" }, cid) npcHandler.topic[cid] = 5 elseif(npcHandler.topic[cid] == 5) then npcHandler:say("Fine. Then off you go, just ask Willard about the 'package for Rashid'.", cid) player:setStorageValue(Storage.TravellingTrader.Mission02, 1) npcHandler.topic[cid] = 0 elseif(npcHandler.topic[cid] == 6) then if player:removeItem(7503, 1) then npcHandler:say("Great. Just place it over there - yes, thanks, that's it. Come see me another day, I'll be busy for a while now. ", cid) player:setStorageValue(Storage.TravellingTrader.Mission02, 5) npcHandler.topic[cid] = 0 end elseif(npcHandler.topic[cid] == 7) then npcHandler:say({ "Well, that's good to hear. From you as my trader and deliveryman, I expect more than carrying heavy packages. ...", "You also need to be fast and deliver wares in time. I have ordered a very special cheese wheel made from Darashian milk. ...", "Unfortunately, the high temperature in the desert makes it rot really fast, so it must not stay in the sun for too long. ...", "I'm also afraid that you might not be able to use ships because of the smell of the cheese. ...", "Please get the cheese from Miraia and bring it to me while I'm in Port Hope. Everything clear and understood?" }, cid) npcHandler.topic[cid] = 8 elseif(npcHandler.topic[cid] == 8) then npcHandler:say("Okay, then please find Miraia in Darashia and ask her about the {'scarab cheese'}.", cid) player:setStorageValue(Storage.TravellingTrader.Mission03, 1) npcHandler.topic[cid] = 0 elseif(npcHandler.topic[cid] == 9) then if player:removeItem(8112, 1) then npcHandler:say("Mmmhh, the lovely odeur of scarab cheese! I really can't understand why most people can't stand it. Thanks, well done! ", cid) player:setStorageValue(Storage.TravellingTrader.Mission03, 3) npcHandler.topic[cid] = 0 end elseif(npcHandler.topic[cid] == 10) then npcHandler:say({ "Well, that's good to hear. From you as my trader and deliveryman, I expect more than bringing stinky cheese. ...", "I wonder if you are able to deliver goods so fragile they almost break when looked at. ...", "I have ordered a special elven vase from Briasol in Ab'Dendriel. Get it from him and don't even touch it, just bring it to me while I'm in Ankrahmun. Everything clear and understood?" }, cid) npcHandler.topic[cid] = 11 elseif(npcHandler.topic[cid] == 11) then npcHandler:say("Okay, then please find {Briasol} in {Ab'Dendriel} and ask for a {'fine vase'}.", cid) player:setStorageValue(Storage.TravellingTrader.Mission04, 1) player:addMoney(1000) npcHandler.topic[cid] = 0 elseif(npcHandler.topic[cid] == 12) then if player:removeItem(7582, 1) then npcHandler:say("I'm surprised that you managed to bring this vase without a single crack. That was what I needed to know, thank you. ", cid) player:setStorageValue(Storage.TravellingTrader.Mission04, 3) npcHandler.topic[cid] = 0 end elseif(npcHandler.topic[cid] == 13) then npcHandler:say({ "Fine! There's one more skill that I need to test and which is cruicial for a successful trader. ...", "Of course you must be able to haggle, else you won't survive long in this business. To make things as hard as possible for you, I have the perfect trade partner for you. ...", "Dwarves are said to be the most stubborn of all traders. Travel to {Kazordoon} and try to get the smith {Uzgod} to sell a {crimson sword} to you. ...", "Of course, it has to be cheap. Don't come back with anything more expensive than 400 gold. ...", "And the quality must not suffer, of course! Everything clear and understood?", "Dwarves are said to be the most stubborn of all traders. Travel to Kazordoon and try to get the smith Uzgod to sell a crimson sword to you. ..." }, cid) npcHandler.topic[cid] = 14 elseif(npcHandler.topic[cid] == 14) then npcHandler:say("Okay, I'm curious how you will do with {Uzgod}. Good luck!", cid) player:setStorageValue(Storage.TravellingTrader.Mission05, 1) npcHandler.topic[cid] = 0 elseif(npcHandler.topic[cid] == 15) then if player:removeItem(7385, 1) then npcHandler:say("Ha! You are clever indeed, well done! I'll take this from you. Come see me tomorrow, I think we two might get into business after all.", cid) player:setStorageValue(Storage.TravellingTrader.Mission05, 3) npcHandler.topic[cid] = 0 end elseif(npcHandler.topic[cid] == 16) then npcHandler:say({ "My friend, it seems you have already learnt a lot about the art of trading. I think you are more than worthy to become a recognised trader. ...", "There is just one little favour that I would ask from you... something personal, actually, forgive my boldness. ...", "I have always dreamed to have a small pet, one that I could take with me and which wouldn't cause problems. ...", "Could you - just maybe - bring me a small goldfish in a bowl? I know that you would be able to get one, wouldn't you?" }, cid) npcHandler.topic[cid] = 17 elseif(npcHandler.topic[cid] == 17) then npcHandler:say("Thanks so much! I'll be waiting eagerly for your return then.", cid) player:setStorageValue(Storage.TravellingTrader.Mission06, 1) npcHandler.topic[cid] = 0 elseif(npcHandler.topic[cid] == 18) then if player:removeItem(5929, 1) then npcHandler:say("Thank you!! Ah, this makes my day! I'll take the rest of the day off to get to know this little guy. Come see me tomorrow, if you like.", cid) player:setStorageValue(Storage.TravellingTrader.Mission06, 2) npcHandler.topic[cid] = 0 end end end return true end keywordHandler:addKeyword({"job"}, StdModule.say, {npcHandler = npcHandler, text = "I am a travelling trader. I don't buy everything, though. And not from everyone, for that matter."}) keywordHandler:addKeyword({"name"}, StdModule.say, {npcHandler = npcHandler, text = "I am Rashid, son of the desert."}) keywordHandler:addKeyword({"offers"}, StdModule.say, {npcHandler = npcHandler, text = "Of course, old friend. You can also browse only armor, legs, shields, helmets, boots, weapons, enchanted weapons, jewelry or miscellaneous stuff."}) keywordHandler:addKeyword({"ab'dendriel"}, StdModule.say, {npcHandler = npcHandler, text = "Elves... I don't really trust them. All this talk about nature and flowers and treehugging... I'm sure there's some wicked scheme behind all this."}) keywordHandler:addKeyword({"desert"}, StdModule.say, {npcHandler = npcHandler, text = "My beloved hometown! Ah, the sweet scent of the desert sands, the perfect shape of the pyramids... stunningly beautiful."}) keywordHandler:addKeyword({"carlin"}, StdModule.say, {npcHandler = npcHandler, text = "I have to go to Carlin once in a while, since the queen wishes to see my exclusive wares in regular intervals."}) keywordHandler:addKeyword({"cormaya"}, StdModule.say, {npcHandler = npcHandler, text = "Cormaya? Not a good place to make business, it's way too far and small."}) keywordHandler:addKeyword({"darashia"}, StdModule.say, {npcHandler = npcHandler, text = "It's not the real thing, but almost as good. The merchants there claim ridiculous prices, which is fine for my own business."}) keywordHandler:addKeyword({"edron"}, StdModule.say, {npcHandler = npcHandler, text = "Ah yes, Edron! Such a lovely and quiet island! I usually make some nice business there."}) keywordHandler:addKeyword({"fibula"}, StdModule.say, {npcHandler = npcHandler, text = "Too few customers there, it's not worth the trip."}) keywordHandler:addKeyword({"greenshore"}, StdModule.say, {npcHandler = npcHandler, text = "Um... I don't think so."}) keywordHandler:addKeyword({"kazordoon"}, StdModule.say, {npcHandler = npcHandler, text = "I don't like being underground much. I also tend to get lost in these labyrinthine dwarven tunnels, so I rather avoid them."}) keywordHandler:addKeyword({"liberty bay"}, StdModule.say, {npcHandler = npcHandler, text = "When you avoid the slums, it's a really pretty city. Almost as pretty as the governor's daughter."}) keywordHandler:addKeyword({"northport"}, StdModule.say, {npcHandler = npcHandler, text = "Um... I don't think so."}) keywordHandler:addKeyword({"port hope"}, StdModule.say, {npcHandler = npcHandler, text = "I like the settlement itself, but I don't set my foot into the jungle. Have you seen the size of these centipedes??"}) keywordHandler:addKeyword({"senja"}, StdModule.say, {npcHandler = npcHandler, text = "Um... I don't think so."}) keywordHandler:addKeyword({"svargrond"}, StdModule.say, {npcHandler = npcHandler, text = "I wish it was a little bit warmer there, but with a good mug of barbarian mead in your tummy everything gets a lot cosier."}) keywordHandler:addKeyword({"thais"}, StdModule.say, {npcHandler = npcHandler, text = "I feel uncomfortable and rather unsafe in Thais, so I don't really travel there."}) keywordHandler:addKeyword({"vega"}, StdModule.say, {npcHandler = npcHandler, text = "Um... I don't think so."}) keywordHandler:addKeyword({"venore"}, StdModule.say, {npcHandler = npcHandler, text = "Although it's the flourishing trade centre of Tibia, I don't like going there. Too much competition for my taste."}) keywordHandler:addKeyword({"time"}, StdModule.say, {npcHandler = npcHandler, text = "It's almost time to journey on."}) keywordHandler:addKeyword({"king"}, StdModule.say, {npcHandler = npcHandler, text = "Kings, queens, emperors and kaliphs... everyone claims to be different and unique, but actually it's the same thing everywhere."}) npcHandler:setMessage(MESSAGE_GREET, "Ah, a customer! Be greeted, |PLAYERNAME|!") npcHandler:setMessage(MESSAGE_FAREWELL, "Farewell, |PLAYERNAME|, may the winds guide your way.") npcHandler:setMessage(MESSAGE_WALKAWAY, "Come back soon!") npcHandler:setMessage(MESSAGE_SENDTRADE, "Take all the time you need to decide what you want!") npcHandler:setCallback(CALLBACK_ONTRADEREQUEST, onTradeRequest) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) fiona.lua 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 voices = { {text = 'The Edron academy is always in need of magical ingredients!'} } npcHandler:addModule(VoiceModule:new(voices)) keywordHandler:addKeyword({'magical ingredients'}, StdModule.say, {npcHandler = npcHandler, text = "Oof, there are too many to list. Magical ingredients can sometimes be found when you defeat a monster, for example bat wings. I buy many of these things if you don't want to use them for quests, just ask me for a {trade}."}) npcHandler:setMessage(MESSAGE_GREET, "Good day, |PLAYERNAME|. I hope you bring a lot of {magical ingredients} with you.") npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye and please come back soon.") npcHandler:setMessage(MESSAGE_WALKAWAY, "Good bye and please come back soon.") npcHandler:setMessage(MESSAGE_SENDTRADE, "Sure, take a look. Apart from those, I also buy some of the possessions from famous demonlords and bosses. Ask me about it if you found anything interesting.") npcHandler:addModule(FocusModule:new())
-
failed to load external
fiona.xml <?xml version="1.0" encoding="UTF-8"?> <npc name="Fiona" script="Fiona.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100" /> <look type="137" head="115" body="100" legs="95" feet="38" addons="0" /> <parameters> <parameter key="module_shop" value="1" /> <parameter key="shop_sellable" value=" basalt fetish, 20136, 130; basalt figurine, 20137, 110; bat wing, 5894, 50; behemoth claw, 5930, 2000; berserk potion, 7439, 500; blazing bone, 18425, 610; blood tincture in a vial, 21245, 360; bloody dwarven beard, 20107, 360; bola, 20089, 35; bone fetish, 20111, 150; bonelord eye, 5898, 80; bony tail, 11194, 210; brimstone fangs, 12658, 380; brimstone shell, 12659, 210; broken throwing axe, 20131, 160; bullseye potion, 7443, 500; carrion worm fang, 11192, 35; cheese cutter, 20097, 50; chicken feather, 5890, 30; deeptags, 15426, 290; demon dust, 5906, 300; demon horn, 5954, 1000; demonic skeletal hand, 10564, 80; dragon claw, 5919, 8000; dragon priests wandtip, 11361, 175; dragons tail, 12413, 100; draken sulphur, 12614, 550; elder bonelord tentacle, 11193, 150; elven astral observer, 12421, 90; elven scouting glass, 12420, 50; enchanted chicken wing, 5891, 20000; fiery heart, 10553, 375; fish fin, 5895, 150; flask of warriors sweat, 5885, 10000; frosty heart, 10578, 280; gauze bandage, 10566, 90; geomancers staff, 12419, 120; giant eye, 11197, 380; glob of acid slime, 9967, 25; glob of mercury, 9966, 20; glob of tar, 9968, 30; green dragon scale, 5920, 100; hardened bone, 5925, 70; heaven blossom, 5921, 50; hellspawn tail, 11221, 475; hideous chunk, 18434, 510; holy ash, 20130, 90; holy orchid, 5922, 90; honeycomb, 5902, 40; humongous chunk, 18433, 540; key to the drowned Library, 15422, 330; lizard scale, 5881, 120; lost bashers spike, 20106, 190; lost bracers, 20133, 140; lost hushers staff, 20128, 250; luminous or, 12410, 1000; mad froth, 20134, 80; magic sulphur, 5904, 8000; mastermind potion, 7440, 500; miraculum, 12430, 60; morgaroth's heart, 5943, 15000; mystical hourglass, 10577, 700; nose ring, 5804, 2000; orshabaal's brain, 5808, 12000; pair of hellflayer horns, 25385, 1300; perfect behemoth fang, 5893, 250; red dragon scale, 5882, 200; red hair dye, 20135, 40; scythe leg, 11229, 450; sea serpent scale, 10583, 520; skull shatterer, 20129, 170; small flask of eyedrops, 12468, 95; some grimeleech wings, 25386, 1200; spellsingers seal, 15421, 280; spider silk, 5879, 100; spirit container, 5884, 40000; spooky blue eye, 10559, 95; stone wing, 11195, 120; turtle shell, 5899, 90; vampire dust, 5905, 100; vexclaw talon, 25384, 1100; weaver's wandtip, 11314, 250; wimp tooth chain, 20127, 120; wyrm scale, 10582, 400; wyvern talisman, 10561, 265;" /> </parameters> </npc>
-
failed to load external
dentro da pasta data/npc crie um arquivo chamado rashid.xml e coloque este código <?xml version="1.0" encoding="UTF-8"?> <npc name="Rashid" script="Rashid.lua" walkinterval="2000" floorchange="0" walkradius="3"> <health now="100" max="100" /> <look type="146" head="100" body="100" legs="119" feet="115" addons="2" /> <parameters> <parameter key="module_shop" value="1" /> <parameter key="shop_sellable" value=" abyss hammer, 7414, 20000; albino plate, 21692, 1500; amber staff, 7426, 8000; ancient amulet, 2142, 200; assassin dagger, 7404, 20000; bandana, 5917, 150; beastslayer axe, 3962, 1500; beetle necklace, 11374, 1500; berserker, 7403, 40000; blacksteel sword, 7406, 6000; blessed sceptre, 7429, 40000; bone shield, 2541, 80; bonelord helmet, 3972, 7500; brutetamer's staff, 7379, 1500; buckle, 20109, 7000; castle shield, 2535, 5000; chain bolter, 8850, 40000; chaos mace, 7427, 9000; cobra crown, 12630, 50000; coconut shoes, 9931, 500; composite hornbow, 8855, 25000; cranial basher, 7415, 30000; crocodile boots, 3982, 1000; crystal crossbow, 18453, 35000; crystal mace, 2445, 12000; crystal necklace, 2125, 400; crystal ring, 6093, 250; crystal sword, 7449, 600; crystalline armor, 8878, 16000; daramian mace, 2439, 110; daramian waraxe, 2440, 1000; dark shield, 2521, 400; death ring, 6300, 1000; demon shield, 2520, 30000; demonbone amulet, 2136, 32000; demonrage sword, 7382, 36000; devil helmet, 2462, 1000; diamond sceptre, 7387, 3000; divine plate, 8885, 55000; djinn blade, 2451, 15000; doll, 2110, 200; dragon scale mail, 2492, 40000; dragon slayer, 7402, 15000; dragonbone staff, 7430, 3000; dreaded cleaver, 7419, 10000; dwarven armor, 2503, 30000; earth blacksteel sword, 7857, 6000; earth cranial basher, 7866, 30000; earth crystal mace, 7865, 12000; earth dragon slayer, 7858, 15000; earth headchopper, 7862, 6000; earth heroic axe, 7861, 30000; earth mystic blade, 7856, 30000; earth orcish maul, 7867, 6000; earth relic sword, 7855, 25000; earth war axe, 7863, 12000; elvish bow, 7438, 2000; emerald bangle, 2127, 800; energy blacksteel sword, 7872, 6000; energy cranial basher, 7881, 30000; energy crystal mace, 7880, 12000; energy dragon slayer, 7873, 15000; energy headchopper, 7877, 6000; energy heroic axe, 7876, 30000; energy mystic blade, 7871, 30000; energy orcish maul, 7882, 6000; energy relic sword, 7870, 25000; energy war axe, 7878, 12000; epee, 2438, 8000; fiery blacksteel sword, 7747, 6000; fiery cranial basher, 7756, 30000; fiery crystal mace, 7755, 12000; fiery dragon slayer, 7748, 15000; fiery headchopper, 7752, 6000; fiery heroic axe, 7751, 30000; fiery mystic blade, 7746, 30000; fiery orcish maul, 7757, 6000; fiery relic sword, 7745, 25000; fiery war axe, 7753, 12000; flower dress, 9929, 1000; flower wreath, 9927, 500; fur boots, 7457, 2000; furry club, 7432, 1000; glacier amulet, 7888, 1500; glacier kilt, 7896, 11000; glacier mask, 7902, 2500; glacier robe, 7897, 11000; glacier shoes, 7892, 2500; gold ring, 2179, 8000; golden armor, 2466, 20000; golden legs, 2470, 30000; goo shell, 21706, 4000; griffin shield, 2533, 3000; guardian halberd, 2427, 11000; hammer of wrath, 2444, 30000; headchopper, 7380, 6000; heavy mace, 2452, 50000; heavy machete, 2442, 90; heavy trident, 13838, 2000; helmet of the lost, 20132, 2000; heroic axe, 7389, 30000; hibiscus dress, 8873, 3000; hieroglyph banner, 13739, 500; horn (ring), 21693, 300; icy blacksteel sword, 7766, 6000; icy cranial basher, 7775, 30000; icy crystal mace, 7774, 12000; icy dragon slayer, 7767, 15000; icy headchopper, 7771, 6000; icy heroic axe, 7770, 30000; icy mystic blade, 7765, 30000; icy orcish maul, 7776, 6000; icy relic sword, 7764, 25000; icy war axe, 7772, 12000; jade hammer, 7422, 25000; krimhorn helmet, 7461, 200; lavos armor, 8877, 16000; leaf legs, 9928, 500; leopard armor, 3968, 1000; leviathan's amulet, 10220, 3000; light shovel, 5710, 300; lightning boots, 7893, 2500; lightning headband, 7901, 2500; lightning legs, 7895, 11000; lightning pendant, 7889, 1500; lightning robe, 7898, 11000; lunar staff, 7424, 5000; magic plate armor, 2472, 90000; magma amulet, 7890, 1500; magma boots, 7891, 2500; magma coat, 7899, 11000; magma legs, 7894, 11000; magma monocle, 7900, 2500; mammoth fur cape, 7463, 6000; mammoth fur shorts, 7464, 850; mammoth whopper, 7381, 300; mastermind shield, 2514, 50000; medusa shield, 2536, 9000; mercenary sword, 7386, 12000; model ship, 2113, 1000; mycological bow, 18454, 35000; mystic blade, 7384, 30000; naginata, 2426, 2000; nightmare blade, 7418, 35000; noble axe, 7456, 10000; norse shield, 7460, 1500; onyx pendant, 24851, 3500; orcish maul, 7392, 6000; oriental shoes, 24637, 15000; pair of iron fists, 20108, 4000; paladin armor, 8891, 15000; patched boots, 2641, 2000; pharaoh banner, 13472, 1000; pharaoh sword, 2446, 23000; pirate boots, 5462, 3000; pirate hat, 6096, 1000; pirate knee breeches, 5918, 200; pirate shirt, 6095, 500; pirate voodoo doll, 5810, 500; platinum amulet, 2171, 2500; ragnir helmet, 7462, 400; relic sword, 7383, 25000; rift bow, 25522, 45000; rift crossbow, 25523, 45000; rift lance, 25383, 30000; rift shield, 25382, 50000; ring of the sky, 2123, 30000; royal axe, 7434, 40000; ruby necklace, 2133, 2000; ruthless axe, 6553, 45000; sacred tree amulet, 10219, 3000; sapphire hammer, 7437, 7000; scarab amulet, 2135, 200; scarab shield, 2540, 2000; shockwave amulet, 10221, 3000; silver brooch, 2134, 150; silver dagger, 2402, 500; skull helmet, 5741, 40000; skullcracker armor, 8889, 18000; spiked squelcher, 7452, 5000; steel boots, 2645, 30000; swamplair armor, 8880, 16000; taurus mace, 7425, 500; tempest shield, 2542, 35000; terra amulet, 7887, 1500; terra boots, 7886, 2500; terra hood, 7903, 2500; terra legs, 7885, 11000; terra mantle, 7884, 11000; the justice seeker, 7390, 40000; tortoise shield, 6131, 150; vile axe, 7388, 30000; voodoo doll, 3955, 400; war axe, 2454, 12000; war horn, 2079, 8000; witch hat, 10570, 5000; wyvern fang, 7408, 1500 " /> </parameters> </npc>
-
Player não recebe item
qual versão do seu tfs? qual versão do otserver? tenta usar esse shop.lua aqui -- ### CONFIG ### -- time (in seconds) between connections to SQL database by shop script SQL_interval = 30 -- ### END OF CONFIG ### function onThink(interval, lastExecution) local result_plr = db.storeQuery('SELECT * FROM z_ots_comunication') if result_plr ~= false then repeat local id = tonumber(result.getDataInt(result_plr, 'id')) local action = tostring(result.getDataString(result_plr, 'action')) local delete = tonumber(result.getDataInt(result_plr, 'delete_it')) local player = Player(tostring(result.getDataString(result_plr, 'name'))) if player then local itemtogive_id = tonumber(result.getDataInt(result_plr, 'param1')) local itemtogive_count = tonumber(result.getDataInt(result_plr, 'param2')) local container_id = tonumber(result.getDataInt(result_plr, 'param3')) local container_count = tonumber(result.getDataInt(result_plr, 'param4')) local add_item_type = tostring(result.getDataString(result_plr, 'param5')) local add_item_name = tostring(result.getDataString(result_plr, 'param6')) local received_item = 0 local full_weight = 0 local itemType = ItemType(itemtogive_id) if add_item_type == 'container' then if itemType:isRune() then full_weight = container_count * itemType:getWeight() else full_weight = container_count * itemType:getWeight(itemtogive_count) end full_weight = full_weight + ItemType(container_id):getWeight() else if itemType:isRune() then full_weight = itemType:getWeight() else full_weight = itemType:getWeight(itemtogive_count) end end local free_cap = player:getFreeCapacity() if full_weight <= free_cap then if add_item_type == 'container' then local new_container = Game.createItem(container_id, 1) local iter = 0 while iter ~= container_count do new_container:addItem(itemtogive_id, itemtogive_count) iter = iter + 1 end received_item = player:addItemEx(new_container) else local new_item = Game.createItem(itemtogive_id, itemtogive_count) received_item = player:addItemEx(new_item) end if type(received_item) == 'number' and received_item == RETURNVALUE_NOERROR then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'You received >> ' .. add_item_name .. ' << from shop.') db.query('DELETE FROM `z_ots_comunication` WHERE `id` = ' .. id) db.query('UPDATE `z_shop_history_item` SET `trans_state` = \'realized\', `trans_real` = ' .. os.time() .. ' WHERE id = ' .. id) else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, '>> ' .. add_item_name .. ' << from shop is waiting for you. Please make place for this item in your backpack/hands and wait about ' .. SQL_interval .. ' seconds to get it.') end else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, '>> ' .. add_item_name .. ' << from shop is waiting for you. It weight is ' .. (full_weight / 100) .. ' oz., you have only ' .. (free_cap / 100) .. ' oz. free capacity. Put some items in depot and wait about ' .. SQL_interval .. ' seconds to get it.') end end until not result.next(result_plr) result.free(result_plr) end return true end
-
erro sendMainCraftWindow
.Qual servidor ou website você utiliza como base? tfs 1.3 Qual o motivo deste tópico? occore o seguinte erro ao clicar no item que tem a actionid Está surgindo algum erro? Se sim coloque-o aqui. Você tem o código disponível? Se tiver publique-o aqui: crafting.lua local config = { -- Window Config mainTitleMsg = "Crafting System", -- Main window title mainMsg = "Welcome to the crafting system. Please choose a vocation to begin.", -- Main window message craftTitle = "Crafting System: ", -- Title of the crafting screen after player picks of vocation craftMsg = "Here is a list of all items that can be crafted for the ", -- Message on the crafting screen after player picks of vocation -- End Window Config -- Player Notifications Config needItems = "You do not have all the required items to make ", -- This is the message the player recieves if he does not have all required items -- Crafting Config system = { [1] = {vocation = "Master Sorcerer", -- This is the category can be anything. items = { [1] = {item = "Shadow's Sceptre", -- item name (THIS MUST BE EXACT OR IT WILL NOT WORK!) itemID = 25249, -- item to be made reqItems = { -- items and the amounts in order to craft. [1] = {item = 25224, count = 50}, -- Silver Tokens [2] = {item = 9969, count = 1}, -- Black Skull [3] = {item = 5904, count = 30}, -- Magic Sulphur [4] = {item = 7451, count = 1}, -- Shadow Sceptre [5] = {item = 22396, count = 50}, -- Cluster of Solace }, }, [2] = {item = "Shadow's Book of Knowledge", itemID = 25250, reqItems = { [1] = {item = 25224, count = 30}, -- Silver Tokens [2] = {item = 8918, count = 1}, -- Spellbook of Dark mysteries [3] = {item = 22541, count = 5}, -- pool of chitinous glue [4] = {item = 10563, count = 20}, -- book of prayers [5] = {item = 11237, count = 20}, -- book of necromantic rituals }, }, [3] = {item = "Shadow's Hat", itemID = 25251, reqItems = { [1] = {item = 25224, count = 30}, -- Silver Tokens [2] = {item = 2662, count = 1}, -- Magician Hat [3] = {item = 2131, count = 1}, -- Star Amulet [4] = {item = 5911, count = 100}, -- Red Piece of cloth }, }, [4] = {item = "Shadow's Mantle", itemID = 25252, reqItems = { [1] = {item = 25224, count = 40}, -- Silver Tokens [2] = {item = 21725, count = 1}, -- Furious frock [3] = {item = 2125, count = 1}, -- Crystal Necklace [4] = {item = 9678, count = 1}, -- Piece of royal satin [5] = {item = 18420, count = 30}, -- red crystal fragment }, }, [5] = {item = "Shadow's Legs", itemID = 25253, reqItems = { [1] = {item = 25224, count = 25}, -- Silver Tokens [2] = {item = 7894, count = 1}, -- Magma legs [3] = {item = 2158, count = 1}, -- Blue gem [4] = {item = 10553, count = 20}, -- Fiery Heart }, }, [6] = {item = "Shadow's Slippers", itemID = 25254, reqItems = { [1] = {item = 25224, count = 25}, -- Silver Tokens [2] = {item = 7891, count = 1}, -- Magma Boots [3] = {item = 13757, count = 20}, -- Coal [4] = {item = 18420, count = 20}, -- red crystal fragments }, }, }, }, [2] = {vocation= "Elder Druid", items = { [1] = {item = "Mystic's Wand of Healing", itemID = 25244, reqItems = { [1] = {item = 25224, count = 50}, -- Silver Tokens [2] = {item = 5944, count = 20}, -- Soul orb [3] = {item = 5904, count = 30}, -- Magic Sulphur [4] = {item = 7387, count = 1}, -- Diamond Sceptre [5] = {item = 22396, count = 50}, -- Cluster of Solace }, }, [2] = {item = "Mystic's Primordial", itemID = 25245, reqItems = { [1] = {item = 25224, count = 30}, -- Silver Tokens [2] = {item = 2662, count = 1}, -- Magician Hat [3] = {item = 2131, count = 1}, -- Star Amulet [4] = {item = 5912, count = 100}, -- Blue piece of cloth }, }, [3] = {item = "Mystic's Coat", itemID = 25246, reqItems = { [1] = {item = 25224, count = 40}, -- Silver Tokens [2] = {item = 21725, count = 1}, -- Furious frock [3] = {item = 7290, count = 10}, -- Shard [4] = {item = 18418, count = 30}, -- Blue crystal splinter }, }, [4] = {item = "Mystic's Legs", itemID = 25247, reqItems = { [1] = {item = 25224, count = 25}, -- Silver Tokens [2] = {item = 7730, count = 1}, -- Blue legs [3] = {item = 10578, count = 20}, -- frosty heart [4] = {item = 2155, count = 1}, -- Green gem }, }, [5] = {item = "Mystic's Slippers", itemID = 25248, reqItems = { [1] = {item = 25224, count = 25}, -- Silver Tokens [2] = {item = 7892, count = 1}, -- Glacier Shoes [3] = {item = 10578, count = 20}, -- frosty heart [4] = {item = 18413, count = 20}, -- Blue crystal shard }, }, }, }, [3] = {vocation = "Royal Paladin", items = { [1] = {item = "Sacreds Holy Crossbow", itemID = 25243, reqItems = { [1] = {item = 25224, count = 60}, -- Silver Tokens [2] = {item = 2455, count = 1}, -- Crossbow [3] = {item = 5904, count = 30}, -- Magic Sulphur [4] = {item = 18427, count = 20}, -- Pulverized Ore [5] = {item = 22396, count = 50}, -- Cluster of Solace }, }, [2] = {item = "Sacreds Mask", itemID = 25239, reqItems = { [1] = {item = 25224, count = 35}, -- Silver Tokens [2] = {item = 5880, count = 100}, -- Iron Ore [3] = {item = 5954, count = 30}, -- Demon Horn [4] = {item = 2497, count = 1}, -- Crusader Helmet }, }, [3] = {item = "Sacreds Divine Armor", itemID = 25240, reqItems = { [1] = {item = 25224, count = 40}, -- Silver Tokens [2] = {item = 5912, count = 100}, -- Blue Cloth [3] = {item = 2472, count = 1}, -- Demon Horn }, }, [4] = {item = "Sacreds Legs", itemID = 25241, reqItems = { [1] = {item = 25224, count = 35}, -- Silver Tokens [2] = {item = 2504, count = 1}, -- Dwarven Legs [3] = {item = 5809, count = 1}, -- Soul Stone [4] = {item = 5905, count = 30}, -- Vampire Dust }, }, [5] = {item = "Sacreds Boots of Swiftness", itemID = 25242, reqItems = { [1] = {item = 25224, count = 30}, -- Silver Tokens [2] = {item = 22539, count = 20}, -- Goosebump Leather [3] = {item = 2645, count = 1}, -- Steel Boots }, }, }, }, [4] = {vocation = "Elite Knight", items = { [1] = {item = "Vangaurd Slicer", itemID = 25233, reqItems = { [1] = {item = 25224, count = 50}, -- Silver Tokens [2] = {item = 2376, count = 1}, -- Sword [3] = {item = 5887, count = 20}, -- Piece of royal steel [4] = {item = 18427, count = 20}, -- Pulverized ore [5] = {item = 22396, count = 50}, -- Cluster of Solace }, }, [2] = {item = "Vangaurd Defender", itemID = 25234, reqItems = { [1] = {item = 25224, count = 30}, -- Silver Tokens [2] = {item = 2533, count = 1}, -- Griffin Shield [3] = {item = 5889, count = 20}, -- piece of draconian steel }, }, [3] = {item = "Vangaurd Helmet", itemID = 25236, reqItems = { [1] = {item = 25224, count = 30}, -- Silver Tokens [2] = {item = 2498, count = 1}, -- Royal helmet [3] = {item = 5880, count = 100}, -- Iron ore [4] = {item = 11227, count = 30}, -- Shiny Stone }, }, [4] = {item = "Vangaurd Armor", itemID = 25237, reqItems = { [1] = {item = 25224, count = 40}, -- Silver Tokens [2] = {item = 2472, count = 1}, -- Magic plate armor [3] = {item = 5911, count = 100}, -- Red piece of cloth }, }, [5] = {item = "Vangaurd Legs", itemID = 25238, reqItems = { [1] = {item = 25224, count = 25}, -- Silver Tokens [2] = {item = 2504, count = 1}, -- Dwarven legs [3] = {item = 5809, count = 1}, -- Soul stone [4] = {item = 5906, count = 20}, -- Demon dust }, }, [6] = {item = "Vangaurd Stompers", itemID = 25235, reqItems = { [1] = {item = 25224, count = 25}, -- Silver Tokens [2] = {item = 2195, count = 1}, -- Boots of haste [3] = {item = 5888, count = 30}, -- piece of hell steel }, }, }, }, }, } function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey) player:sendMainCraftWindow(config) return true end Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.
-
Ajuda com para Liberar Acessos Script Login.lua Help
aqui tem meu login.lua da mesma base que a sua, aqui no meu ta funcionando, não estão todas as quests ai mas da pra vc ter uma noção function Player.sendTibiaTime(self, hours, minutes) -- TODO: Migrate to protocolgame.cpp local msg = NetworkMessage() msg:addByte(0xEF) msg:addByte(hours) msg:addByte(minutes) msg:sendToPlayer(self) msg:delete() return true end local function onMovementRemoveProtection(cid, oldPos, time) local player = Player(cid) if not player then return true end local playerPos = player:getPosition() if (playerPos.x ~= oldPos.x or playerPos.y ~= oldPos.y or playerPos.z ~= oldPos.z) or player:getTarget() then player:setStorageValue(Storage.combatProtectionStorage, 0) return true end addEvent(onMovementRemoveProtection, 1000, cid, oldPos, time - 1) end local playerLogin = CreatureEvent("PlayerLogin") function playerLogin.onLogin(player) local items = { {2120, 1}, {2148, 3} } if player:getLastLoginSaved() == 0 then local backpack = player:addItem(1988) if backpack then for i = 1, #items do backpack:addItem(items[i][1], items[i][2]) end end player:addItem(2050, 1, true, 1, CONST_SLOT_AMMO) else player:sendTextMessage(MESSAGE_STATUS_DEFAULT, string.format("Your last visit in ".. SERVER_NAME ..": %s.", os.date("%d. %b %Y %X", player:getLastLoginSaved()))) --In Service of Yalahar player:setStorageValue(Storage.InServiceofYalahar.Questline, 5) 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.InServiceofYalahar.Mission09, 2) player:setStorageValue(Storage.InServiceofYalahar.Mission10, 1) --ape player:setStorageValue(Storage.TheApeCity,1) --zao player:setStorageValue(Storage.TheNewFrontier.Questline, 1) 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.Mission09, 3) player:setStorageValue(Storage.TheNewFrontier.Mission10, 1) player:setStorageValue(Storage.TheNewFrontier.TomeofKnowledge, 12) --Feryst player:setStorageValue(Storage.ThreatenedDreams.Start, 1) player:setStorageValue(Storage.ThreatenedDreams.TroubledMission01, 17) player:setStorageValue(Storage.ThreatenedDreams.TroubledMission02, 1) --Rashid player:setStorageValue(Storage.TravellingTrader.Mission01, 1) 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) --Iquin player:setStorageValue(Storage.TheInquisition.Questline, 2) 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.TheInquisition.Mission05, 3) player:setStorageValue(Storage.TheInquisition.Mission06, 3) player:setStorageValue(Storage.TheInquisition.Mission07, 1) --WOTE player:setStorageValue(Storage.WrathoftheEmperor.Questline, 1) 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) player:setStorageValue(Storage.WrathoftheEmperor.Mission08, 2) player:setStorageValue(Storage.WrathoftheEmperor.Mission09, 2) player:setStorageValue(Storage.WrathoftheEmperor.Mission10, 6) --Imbuiment 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) --SearoutsYalahar player:setStorageValue(Storage.SearoutesAroundYalahar.Darashia, 1) player:setStorageValue(Storage.SearoutesAroundYalahar.AbDendriel, 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) end local playerId = player:getId() DailyReward.init(playerId) player:loadSpecialStorage() if player:getGroup():getId() >= 4 then player:setGhostMode(true) end -- Boosted creature player:sendTextMessage(MESSAGE_LOOT, "Today's boosted creature: " .. BoostedCreature.name .. " \ Boosted creatures yield more experience points, carry more loot than usual and respawn at a faster rate.") -- Bestiary tracker player:refreshBestiaryTracker() -- Stamina nextUseStaminaTime[playerId] = 1 -- EXP Stamina nextUseXpStamina[playerId] = 1 -- Prey Small Window for slot = CONST_PREY_SLOT_FIRST, CONST_PREY_SLOT_THIRD do player:sendPreyData(slot) end -- New prey nextPreyTime[playerId] = { [CONST_PREY_SLOT_FIRST] = 1, [CONST_PREY_SLOT_SECOND] = 1, [CONST_PREY_SLOT_THIRD] = 1 } if (player:getAccountType() == ACCOUNT_TYPE_TUTOR) then local msg = [[:: Tutor Rules 1 *> 3 Warnings you lose the job. 2 *> Without parallel conversations with players in Help, if the player starts offending, you simply mute it. 3 *> Be educated with the players in Help and especially in the Private, try to help as much as possible. 4 *> Always be on time, if you do not have a justification you will be removed from the staff. 5 *> Help is only allowed to ask questions related to tibia. 6 *> It is not allowed to divulge time up or to help in quest. 7 *> You are not allowed to sell items in the Help. 8 *> If the player encounters a bug, ask to go to the website to send a ticket and explain in detail. 9 *> Always keep the Tutors Chat open. (required). 10 *> You have finished your schedule, you have no tutor online, you communicate with some CM in-game or ts and stay in the help until someone logs in, if you can. 11 *> Always keep a good Portuguese in the Help, we want tutors who support, not that they speak a satanic ritual. 12 *> If you see a tutor doing something that violates the rules, take a print and send it to your superiors. " - Commands - Mute Player: /mute nick, 90 (90 seconds) Unmute Player: /unmute nick. - Commands -]] player:popupFYI(msg) end -- Open channels if table.contains({TOWNS_LIST.DAWNPORT, TOWNS_LIST.DAWNPORT_TUTORIAL}, player:getTown():getId())then player:openChannel(3) -- World chat else player:openChannel(3) -- World chat player:openChannel(5) -- Advertsing main end -- Rewards local rewards = #player:getRewardList() if(rewards > 0) then player:sendTextMessage(MESSAGE_INFO_DESCR, string.format("You have %d %s in your reward chest.", rewards, rewards > 1 and "rewards" or "reward")) end -- Update player id local stats = player:inBossFight() if stats then stats.playerId = player:getId() end if player:getStorageValue(Storage.combatProtectionStorage) < 1 then player:setStorageValue(Storage.combatProtectionStorage, 1) onMovementRemoveProtection(playerId, player:getPosition(), 10) end -- Set Client XP Gain Rate local baseExp = 100 if Game.getStorageValue(GlobalStorage.XpDisplayMode) > 0 then baseExp = getRateFromTable(experienceStages, player:getLevel(), configManager.getNumber(configKeys.RATE_EXP)) end local staminaMinutes = player:getStamina() local doubleExp = false --Can change to true if you have double exp on the server local staminaBonus = (staminaMinutes > 2400) and 150 or ((staminaMinutes < 840) and 50 or 100) if doubleExp then baseExp = baseExp * 2 end player:setStaminaXpBoost(staminaBonus) player:setBaseXpGain(baseExp) local worldTime = getWorldTime() local hours = math.floor(worldTime / 60) local minutes = worldTime % 60 player:sendTibiaTime(hours, minutes) if player:getStorageValue(Storage.isTraining) == 1 then --Reset exercise weapon storage player:setStorageValue(Storage.isTraining,0) end return true end playerLogin:register()
-
(Resolvido)Erro script trade OFF
16:45 Você somente pode sacar o total de 74. 16:45 Você tem que digitar um valor maior que 0. Muito agradecido, agora funcionou perfeito!
-
(Resolvido)Erro script trade OFF
joguei esse código, apareceu esse erro no console Lua Script Error: [TalkAction Interface] data/talkactions/scripts/auctionsystem.lua:onSay data/talkactions/scripts/auctionsystem.lua:158: attempt to compare string with number stack traceback: [C]: in function '__le' data/talkactions/scripts/auctionsystem.lua:158: in function <data/talkactions/scripts/auctionsystem.lua:7>
-
(Resolvido)Erro script trade OFF
Problema resolvido, muita gratidão! estou com outro problema, quando o player vai sacar o valor das vendas se ele saca o valor certo nao acontece nada, mas se ele bota um valor maior do que tem disponivel o cliente da debug e não consigo mais logar no char, preciso reiniciar o server para conseguir logar novamente
-
(Resolvido)Erro script trade OFF
.Qual servidor ou website você utiliza como base? tfs 1.3 Qual o motivo deste tópico? erro no script de trade off na parte de entregar o item ao player Está surgindo algum erro? Se sim coloque-o aqui. Você tem o código disponível? Se tiver publique-o aqui: local config = { level_add = 20, max_ofertas = 5, ofertas_pz = true, itens_bloqueados = {2165, 2152, 2148, 2160, 2166, 2167, 2168, 2169, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2343, 2433, 2640, 6132, 6300, 6301, 9932, 9933} } function onSay(player, words, param) if (param == 'saldo') then local consulta = db.storeQuery("SELECT * FROM `players` WHERE `id` = " .. player:getGuid() .. ";") local saldo = result.getNumber(consulta, "auction_balance") player:sendTextMessage(MESSAGE_INFO_DESCR, "Seu saldo é de " .. saldo .. " gps de suas vendas no mercado!") player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Seu saldo é de " .. saldo .. " gps de suas vendas no mercado!") return true end if(param == '') or (param == 'info') then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Comandos para utilizar este sistema:\n!oferta saldo\nUse este comando para verificar o saldo de suas vendas.\n!oferta add, nomedoitem, preço, qtd\nexemplo: !oferta add,plate armor,500,1\n\n\n!oferta comprar,id_da_compra\nexemplo: !oferta comprar,1943\n\n\n!oferta remover,id_da_compra\nexemplo: !oferta remover,1943\n\n\n!oferta sacar, qtd\nexemplo: !oferta sacar, 1000.\n") return true end local split = param:split(",") if split[2] == nil then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Parâmetros necessários. Use !oferta info para mais informações!") return false end split[2] = split[2]:gsub("^%s*(.-)$", "%1") _BUSCA_DB = db.storeQuery("SELECT * FROM `auction_system` WHERE `player` = " .. player:getGuid()) if(split[1] == "add") then if(not tonumber(split[3]) or (not tonumber(split[4]))) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Use somente números.") return true end if(string.len(split[3]) > 7 or (string.len(split[4]) > 3)) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Este preço ou a quantidade itens é muito alta.") return true end local itemType, item_s = ItemType(split[2]), ItemType(split[2]):getId() if(not item_s) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "O item "..itemType.." não existe!") return true end if(player:getLevel() < config.level_add) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas vcê precisa de level igual ou superior a (" .. config.level_add .. ") para continuar.") return true end if(isInArray(config.itens_bloqueados, item_s)) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode adicionar este item.") return true end if(player:getItemCount(item_s) < tonumber(split[4])) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você não tem este item.") return true end local amount, tmp_BUSCA_DB = 0, _BUSCA_DB while tmp_BUSCA_DB ~= false do tmp_BUSCA_DB = result.next(_BUSCA_DB) amount = amount + 1 end if _BUSCA_DB ~= false then local limit = amount >= config.max_ofertas if limit then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você atingiu o limite máximo(" .. config.max_ofertas .. ") de publicações de venda de itens.") return true end if(config.SendOffersOnlyInPZ) then if(not getTilePzInfo(player:getPosition())) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você só pode usar este comando estando em protection zone.") return true end end end if(tonumber(split[4]) < 1 or (tonumber(split[3]) < 1)) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você precisa informar um número maior que 0.") return true end local itemcount, costgp = math.floor(split[4]), math.floor(split[3]) player:removeItem(item_s, itemcount) db.query("INSERT INTO `auction_system` (`player`, `item_name`, `item_id`, `count`, `cost`, `date`) VALUES (" .. player:getGuid() .. ", \"" .. split[2] .. "\", " .. item_s .. ", " .. itemcount .. ", " .. costgp ..", " .. os.time() .. ")") player:sendTextMessage(MESSAGE_INFO_DESCR, "Parabéns! Você adicionou para à venda " .. itemcount .." " .. split[2] .." por " .. costgp .. " gps!") end if(split[1] == "comprar") then _BUSCA_DB = db.storeQuery("SELECT * FROM `auction_system` WHERE `id` = ".. tonumber(split[2])) local player_id, player_vendas, item_ids, costs, item_names, counts = player:getGuid(), result.getNumber(_BUSCA_DB, "player"), result.getNumber(_BUSCA_DB, "item_id"), result.getNumber(_BUSCA_DB, "cost"), result.getString(_BUSCA_DB, "item_name"), result.getNumber(_BUSCA_DB, "count") if(not tonumber(split[2])) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas somente números são aceitos.") return true end if(_BUSCA_DB ~= false) then local total_custo = costs - player:getMoney() if(player:getMoney() < costs) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você não possuí a quantia necessária para comprar. São necessários: "..costs.."gps para comprar o item: "..item_names..". Você tem: " .. player:getMoney() .. "gps. Você precisa de: "..total_custo.." gps.") return true end if(player_id == player_vendas) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você não pode comprar seu próprio item.") return true end if player:removeMoney(costs) then if(isItemStackable((item_ids))) then player:addItem(item_ids, counts) else for i = 1, count do player:addItem(item_ids, 1) end end db.query("DELETE FROM `auction_system` WHERE `id` = " .. split[2] .. ";") player:sendTextMessage(MESSAGE_INFO_DESCR, "Parabéns! Você comprou " .. counts .. " ".. item_names .. " por " .. costs .. " gps com sucesso!") db.query("UPDATE `players` SET `auction_balance` = `auction_balance` + " .. costs .. " WHERE `id` = " .. player_vendas .. ";") end else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas o ID "..split[2].." não existe!.") end end if(split[1] == "remover") then local _BUSCA_DB = db.storeQuery("SELECT * FROM `auction_system` WHERE `id` = ".. tonumber(split[2])) local player_id, player_vendas, item_ids, costs, item_names, counts = player:getGuid(), result.getNumber(_BUSCA_DB, "player"), result.getNumber(_BUSCA_DB, "item_id"), result.getNumber(_BUSCA_DB, "cost"), result.getString(_BUSCA_DB, "item_name"), result.getNumber(_BUSCA_DB, "count") if((not tonumber(split[2]))) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas somente números são aceitos.") return true end if(config.SendOffersOnlyInPZ) then if(not getTilePzInfo(player:getPosition())) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you remove offerts from database.") return true end end if(_BUSCA_DB ~= false) then if(player_id == player_vendas) then db.query("DELETE FROM `auction_system` WHERE `id` = " .. split[2] .. ";") if(isItemStackable(item_ids)) then player:addItem(item_ids, counts) else for i = 1, counts do player:addItem(item_ids, 1) end end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns! A oferta "..split[2].." foi removida com sucesso do mercado.\nVocê recebeu: "..counts.." "..item_names..".") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas essa oferta não é sua.") end result.free(resultado) else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas este ID não existe.") end end if(split[1] == "sacar") then if((not tonumber(split[2]))) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas somente números são aceitos.") return true end local balance = db.storeQuery("SELECT * FROM `players` WHERE `id` = " .. player:getGuid() .. ";") local auction_balance = result.getNumber(balance, "auction_balance") if(auction_balance < 1) then player:sendTextMessage(MESSAGE_INFO_DESCR, "Você não possuí saldo suficiente para sacar.") result.free(balance) return true end local tz = auction_balance - split[2] player:sendTextMessage(MESSAGE_INFO_DESCR, "Você sacou " .. split[2] .. " gps de suas vendas no mercado! Seu saldo é de: "..tz.."gps.") player:addMoney(tz) db.query("UPDATE `players` SET `auction_balance` = ".. tz .." WHERE `id` = " .. player:getGuid() .. ";") result.free(balance) end return true end Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.