Postado Junho 3, 2012 13 anos Bom vó fala alguns detalhes: - Ao invés de tempo, seria assim uso as 30 Saffari Balls fosse jogado pra fora. - Se ele morrer não perdera as Saffari Balls. - Lá dentro não perdera Exp, nem loot , nada. (pra isso tem que adicionar alguma action,talkactions, no mapa?) Basicamente é só isso (malz demora pra responde). Já está configurado para não perder loot e nem exp. Mods: <?xml version="1.0" encoding="UTF-8"?> <mod name="Saffari" version="1.0" author="Vodkart" contact="tibiaking.com" enabled="yes"> <config name="saffari_func"><![CDATA[ config = { Price = 2000, Premium = false, Level = 50, Saffari_Pos = {Enter = {x=189,y=53,z=7}, Exit = {x=195,y=53,z=7}}, AddPokeballs = {11217,30}, Blocked_pokeballs = {2146, 2147, 11437, 11441}, Storage = 874547, levelandskills = false, loot = false } ]]></config> <event type="login" name="SaffariRegister" event="script"><![CDATA[ function onLogin(cid) registerCreatureEvent(cid, "SaffariDeath") return true end]]></event> <talkaction words="/saffari;!saffari" event="buffer"><![CDATA[ domodlib('saffari_func') param = string.lower(param) if (param == "") then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"invalid command, for more information enter !saffari info") elseif(param == "info") then doShowTextDialog(cid,2160,"Saffari Info:\n\nLevel Minimum: "..config.Level.."\nSaffari Cost: "..config.Price.."\n\nThe safari is home to rare creatures, some are dangerous and others not\n[*Warning*]\nis only allowed to enter with saffari balls.\n\nTo leave enter command:\n!saffari leave") elseif(param == "leave") then if getPlayerStorageValue(cid, config.Storage) >= 1 then doTeleportThing(cid, config.Saffari_Pos.Exit) setPlayerStorageValue(cid, config.Storage, -1) doPlayerSendTextMessage(cid,22,'you left the saffari zone.') else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"you are not in Saffari") end end return true ]]></talkaction> <globalevent name="SaffariCheck" interval="60" event="script"><![CDATA[ domodlib('saffari_func') function onThink(interval, lastExecution) local on = getPlayersOnline() if #on > 0 then for i = 1, #on do if getPlayerStorageValue(on[i], config.Storage) >= 1 and getPlayerItemCount(on[i], config.AddPokeballs[1]) <= 0 then doTeleportThing(on[i], config.Saffari_Pos.Exit) setPlayerStorageValue(on[i], config.Storage, -1) doPlayerSendTextMessage(on[i],22,'you left the saffari zone.') end end end return true end ]]></globalevent> <event type="death" name="SaffariDeath" event="script"><![CDATA[ domodlib('saffari_func') function onDeath(cid, corpse, deathList) if isPlayer(cid) and getPlayerStorageValue(cid, config.Storage) >= 1 then setPlayerStorageValue(cid, config.Storage, -1) if config.loot == false then doCreatureSetDropLoot(cid, false) end if config.levelandskills == false then doPlayerSetLossSkill(cid, 0) end end return true end ]]></event> </mod> NPC; domodlib('saffari_func') 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 function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local msg = string.lower(msg) if isInArray({"saffari","enter","entrar"}, msg) then npcHandler:say('you can stay in the Saffari zone, the price is '..config.Price..' gp(s), You want enter? {yes}', cid) talkState[talkUser] = 1 elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then for i = 1, #config.Blocked_pokeballs do if getPlayerItemCount(cid, config.Blocked_pokeballs[i]) >= 1 then npcHandler:say('Keep your PokeBalls!', cid) return true end end if config.Premium == true and not isPremium(cid) then npcHandler:say('Sorry, you need to be premium!', cid) return true elseif getPlayerLevel(cid) < config.Level then npcHandler:say('Sorry, you must be at least level '..config.Level..' to enter the Saffari zone!', cid) return true elseif not doPlayerRemoveMoney(cid, config.Price) then npcHandler:say('Sorry, you do not have enough money!', cid) return true end doPlayerAddItem(cid, config.AddPokeballs[1], config.AddPokeballs[2]) selfSay("Thanks, you've been teleported to the Saffari zone, if you want to leave enter {!saffari leave}.", cid) doTeleportThing(cid, config.Saffari_Pos.Enter) setPlayerStorageValue(cid, config.Storage, 1) elseif msg == "no" and talkState[talkUser] >= 1 then selfSay("tudo bem então.", cid) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Junho 3, 2012 13 anos Autor Vodkart funciono certinho o script só a Exp que ainda perde mais o resto ta tudo okay Editado Junho 3, 2012 13 anos por rolisso (veja o histórico de edições) - Novo Projeto !!! Em Breve ... -GOSTO DO MEU TRABALHO ? ENTÃO DA REP+
Postado Junho 3, 2012 13 anos Hmm sério cara? que estranho, mas tente trocar: if config.levelandskills == false then doPlayerSetLossSkill(cid, 0) end por if config.levelandskills == false then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0) end [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Junho 3, 2012 13 anos Autor Olha ainda perde , mais eu vi que quando o player morre da erro no exp.lua da 1 olhada: [03/06/2012 20:22:11] [Error - CreatureScript Interface] [03/06/2012 20:22:11] data/creaturescripts/scripts/exp.lua:onStatsChange [03/06/2012 20:22:11] Description: [03/06/2012 20:22:11] data/creaturescripts/scripts/exp.lua:313: attempt to index field '?' (a nil value) [03/06/2012 20:22:11] stack traceback: [03/06/2012 20:22:11] data/creaturescripts/scripts/exp.lua:313: in function <data/creaturescripts/scripts/exp.lua:131> e o player morre que da esse erro :X - Novo Projeto !!! Em Breve ... -GOSTO DO MEU TRABALHO ? ENTÃO DA REP+
Postado Junho 3, 2012 13 anos mas isso não é do meu script '-' esse erro é desse script aqui: data/creaturescripts/scripts/exp.lua [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
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.