Ir para conteúdo

Featured Replies

Postado

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 :D (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()) 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

  • Respostas 19
  • Visualizações 4.4k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • fiz rapidinho, vê se é isso que vc quer: MODS: Saffari.xml <?xml version="1.0" encoding="UTF-8"?> <mod name="Saffari" version="1.0" author="Vodkart" contact="tibiaking.co

  • 2 - usando globalevents + storage ou colocas tiles espalhado pelo mapa para checar se já acabou as pokeball e teleportar 3 - usando onDeath + storage '-'

  • 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"

Postado

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

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Postado
  • 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

PCj2qBE.jpg


- Novo Projeto !!! Em Breve ... -

GOSTO DO MEU TRABALHO ? ENTÃO DA 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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo