Amigo este local não é para pedidos, este local é para scripts já prontas, existe um local para pedidos e dúvidas sobre scripts.
Movido.
Amigo este local não é para pedidos, este local é para scripts já prontas, existe um local para pedidos e dúvidas sobre scripts.
Movido.
info
Grupo: Infante
Registrado: 04/03/11
Posts: 1.6k
Reputação: +393
Char no Tibia: No Have

Passe os ids da balls de catch todos os ids.
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

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="none.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}},
Time = 30,
AddPokeballs = {11445,30},
Blocked_pokeballs = {2146, 2147, 11437, 11441},
Storages = {874547,874548},
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.."\nTime Limit: "..config.Time.." minutes\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.Storages[1]) >= 1 then
doTeleportThing(cid, config.Saffari_Pos.Exit)
setPlayerStorageValue(cid, config.Storages[1], -1)
setPlayerStorageValue(cid, config.Storages[2], -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.Storages[2]) <= os.time() and getPlayerStorageValue(on[i], config.Storages[1]) >= 1 then
doTeleportThing(on[i], config.Saffari_Pos.Exit)
setPlayerStorageValue(on[i], config.Storages[1], -1)
setPlayerStorageValue(on[i], config.Storages[2], -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.Storages[1]) >= 1 then
setPlayerStorageValue(cid, config.Storages[1], -1)
setPlayerStorageValue(cid, config.Storages[2], -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 by '..config.Time..' minutes, 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 and has "..config.Time.." minutes, if you want to leave enter {!saffari leave}.", cid)
doTeleportThing(cid, config.Saffari_Pos.Enter)
setPlayerStorageValue(cid, config.Storages[1], 1)
setPlayerStorageValue(cid, config.Storages[2], os.time()+config.Time*60)
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())
configurações
config = {
Price = 2000, -- qnto vai custar
Premium = false, -- se precisa ser premium
Level = 50, -- level minimo para entrar
Saffari_Pos = {Enter = {x=189,y=53,z=7}, Exit = {x=195,y=53,z=7}}, -- pos da safari, e pos pra onde ele vai dps que acaba o tempo
Time = 30, -- tempo maximo q ele pode ficar no saffari in minutes
AddPokeballs = {11445,30}, -- id da saffari ball e quantidade
Blocked_pokeballs = {2146, 2147, 11437, 11441}, -- pokeballs q ele n pode estar na bag
Storages = {874547,874548}, -- n mexa
levelandskills = false, -- se vai perder skills e exp ao morrer
loot = false -- se vai perder loot ao morrer
}
comandos extra:
!saffari info -- mostra em uma janela sobre o preço, lvl e o tempo que pode ficar lá
!saffari leave -- faz com que o player saia da saffari zone
Editado Junho 3 por Vodkart
info
Grupo: Campones
Registrado: 03/08/10
Posts: 45
Reputação: +8
Gênero: Masculino
Char no Tibia: Dee Bobs

@Vodkart
Irei Testar o script.
Obrigado Rep+.
@caotic
[2394] "normal"
[2391] "great"
[2393] "super"
[2392] "ultra"
[2395] "saffari"
A saffari ainda vou add no servidor mais o id dela sera (2395).
Editado Junho 3 por RolissoBomb
info
Grupo: Conde
Registrado: 30/04/11
Posts: 658
Reputação: +71
Gênero: Masculino
Char no Tibia: ExTibiano

testei aqui tá perfeito Vodkart! REP+
info
Grupo: Campones
Registrado: 24/05/12
Posts: 7
Reputação: 0

Vodkart Rep+ Obrigado.
info
Grupo: Lorde
Registrado: 05/06/12
Posts: 2.2k
Reputação: +215
Gênero: Masculino

Aki não funfo não da error
Editado Junho 8 por Yan18
info
Grupo: Campones
Registrado: 23/12/11
Posts: 93
Reputação: +52

Otimo sistema queria por no meu server mas sempre que ponho a parte mods ao tentar logar com o account manager e os outros chars da esse bug:
[13/06/2012 22:36:30] [Error - CreatureScript Interface]
[13/06/2012 22:36:30] buffer:onLogin
[13/06/2012 22:36:30] Description:
[13/06/2012 22:36:30] [string "loadBuffer"]:9: bad argument #1 to 'ipairs' (table expected, got nil)
[13/06/2012 22:36:30] stack traceback:
[13/06/2012 22:36:30] [C]: in function 'ipairs'
[13/06/2012 22:36:30] [string "loadBuffer"]:9: in function <[string "loadBuffer"]:3>
sabem o q pode ser?
info
Grupo: Campones
Registrado: 03/08/10
Posts: 45
Reputação: +8
Gênero: Masculino
Char no Tibia: Dee Bobs
(1) - Eu gostaria de um npc ( Saffari Zone) do "PXG" bom pra quem não sabe que o npc faz eu vo falar um pouco para que tenho uma noção.
Bom ele é um npc que você paga " 1k " e ele te teleporta para um " X " local e te da 30 " Saffari balls " e também que ele não teleporte a pessoa se ele estiver usando outras poke balls "Normal ball,great ball,super ball,ultra ball, nem a saffari ball (Da ultima caçada)".
Aproveitando eu também irei pedir se tem como fazer o seguinte script junto com esse npc.
(2) - Que quando acaba as 30 "Saffari balls" ele seja teleportado automático para fora.
(3) - E como eu faço para que quando a pessoa morrer la dentro ele não perda " exp " não perda.
Muito Obrigado se alguém puder me ajudar com isso , ficaria muito grato.
Editado Junho 2 por RolissoBomb