Poderia informar as storages de cada clan, e a storage de rank 5?
- Fórum
- OTServ
- Suporte
- Tópicos Sem Resposta
- [Encerrado] Porta pra clan
[Encerrado] Porta pra clan
Por waata, 13 de nov. de 2013 em Tópicos Sem Resposta
Eu n manjo mto desse sist de clan então vou postar pra vc ver:
naturia
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
---------------------- Configs ---------------------------
local clanNpcs = {
["Seed Trainer"] = {
task1 = {
["Seed Trainer"] = {{"Graveler", 1}, {"Starmie", 1}, {"Onix", 1}},
},
task2 = {
["Seed Trainer"] = {{"Marowak", 1}, {"Blastoise", 1}, {"Golem", 1}},
},
itens = {{12163, 1}, {12202, 1}, {12183, 1}},
poke = "Tangela",
level = 90,
prevRank = 1,
nextRank = 2,
},
["Sprout Trainer"] = {
task1 = {
["Sprout Trainer"] = {{"Graveler", 1}, {"Starmie", 1}, {"Onix", 1}},
},
task2 = {
["Sprout Trainer"] = {{"Marowak", 1}, {"Blastoise", 1}, {"Golem", 1}},
},
itens = {{12163, 1}, {12202, 1}, {12183, 1}},
poke = "Pinsir",
level = 100,
prevRank = 2,
nextRank = 3,
},
["Webhead Trainer"] = {
task1 = {
["Webhead Trainer"] = {{"Graveler", 1}, {"Starmie", 1}, {"Onix", 1}},
},
task2 = {
["Webhead Trainer"] = {{"Marowak", 1}, {"Blastoise", 1}, {"Golem", 1}},
},
itens = {{12163, 1}, {12202, 1}, {12183, 1}},
poke = "Scyther",
level = 110,
prevRank = 3,
nextRank = 4,
},
["Woodtrunk Trainer"] = {
task1 = {
["Woodtrunk Trainer"] = {{"Graveler", 1}, {"Starmie", 1}, {"Onix", 1}},
},
task2 = {
["Woodtrunk Trainer"] = {{"Marowak", 1}, {"Blastoise", 1}, {"Golem", 1}},
},
itens = {{12163, 1}, {12202, 1}, {12183, 1}},
poke = "venusaur",
level = 120,
prevRank = 4,
nextRank = 5,
},
}
------------------------------------------------------------------------------
local npc = clanNpcs[getNpcName()]
if msgcontains(msg, 'help') or msgcontains(msg, 'Help') then
if getPlayerLevel(cid) < npc.level or getPlayerClanName(cid) ~= 'Naturia' or getPlayerClanRank(cid) ~= npc.prevRank then
selfSay("I don't need your help!", cid)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) <= -1 then
selfSay("So you want to move up of rank on our clan... So, you need to bring some items to me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 1 then
selfSay("So you brought to me the items what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 2 then
selfSay("The next step is you caught a pokemon to me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 3 then
selfSay("So you caught the pokemon what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 4 then
selfSay("Now you need to do some tasks for me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 5 then
selfSay("So you finished the first task what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 6 then
selfSay("And now comes the last task... Do you wanna to begin it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 7 then
selfSay("So you finished the last task what i asked for?", cid)
talkState[talkUser] = 1
return true
end
elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'Yes')) and talkState[talkUser] == 1 then
if getPlayerStorageValue(cid, 854789) <= -1 then
local str = "Ok then, you need bring to me: "
for a = 1, #npc.itens do
str = str..(a == #npc.itens and " and " or a ~= 1 and ", " or "{")..(npc.itens[a][2]).." "..(getItemNameById(npc.itens[a][1]))
end
str = str.."}, come back when you join those items!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 1)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 1 then
local check = checkItensForTask(cid, npc.itens)
if check == 0 then
selfSay("Ok then, you completed the mission, talk to me again when you want to continue!", cid)
setPlayerStorageValue(cid, 854789, 2)
talkState[talkUser] = 0
return true
else
selfSay(check, cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 2 then
selfSay("Ok then, you need to caught a {"..(npc.poke).."}, and bring it to me... Come back when you do that!", cid)
setPlayerStorageValue(cid, 854789, 3)
setPlayerStorageValue(cid, 854788, npc.poke)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 3 then
if getPlayerStorageValue(cid, 854788) == 'done' then
selfSay("Very well, talk to me again when you want to continue!", cid)
setPlayerStorageValue(cid, 854789, 4)
setPlayerStorageValue(cid, 854788, -1)
setPlayerStorageValue(cid, 854787, npc.poke)
talkState[talkUser] = 0
return true
else
selfSay("You didn't caught the pokemon what i asked for! Go do it!", cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 4 then
local sto = getFreeTaskStorage(cid)
local c = 0
if sto == -1 then
selfSay("You can't get more tasks! You are already with the maximum of "..(maxTasks).." tasks!", cid)
talkState[talkUser] = 0
return true
end
local str = "Ok then, now you need to kill: {"
for e, f in pairs(npc.task1) do
for a = 1, #f do
str = str..((a == #f and c ~= 0) and " and " or a ~= 1 and ", " or "")..f[a][2].." "..f[a][1]
c = c+1
end
end
str = str.."} with the {"..(npc.poke).."} which you caught!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 5)
setStorageArray(cid, sto, npc.task1)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 5 then
if isMyTaskComplete(cid, getNpcCid()) then
selfSay("Very well, you have done my first task... Talk to me again when you want to continue!", cid)
local sto = getMyTaskSto(cid, getNpcCid())
setPlayerStorageValue(cid, sto, -1)
setPlayerStorageValue(cid, 854789, 6)
talkState[talkUser] = 0
return true
else
selfSay("You didn't complete my task yet... Go end it!", cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 6 then
local sto = getFreeTaskStorage(cid)
local c = 0
if sto == -1 then
selfSay("You can't catch more tasks! You are already with the maximum of "..(maxTasks).." tasks!", cid)
talkState[talkUser] = 0
return true
end
local str = "Ok then, now for your last task you need to kill: {"
for e, f in pairs(npc.task2) do
for a = 1, #f do
str = str..((a == #f and c ~= 0) and " and " or a ~= 1 and ", " or "")..f[a][2].." "..f[a][1]
c = c+1
end
end
str = str.."} with the {"..(npc.poke).."} which you caught!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 7)
setStorageArray(cid, sto, npc.task2)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 7 then
if isMyTaskComplete(cid, getNpcCid()) then
---
local storages = {17000, 63215, 17001, 13008, 5700} --alterado v1.8
for s = 1, #storages do
if getPlayerStorageValue(cid, storages[s]) >= 1 then
selfSay("You can't do that while is Flying, Riding, Surfing, Diving or mount a bike!", cid)
talkState[talkUser] = 0
return true
end
end
if #getCreatureSummons(cid) >= 1 then --alterado v1.8
selfSay("Return your pokemon!", cid)
talkState[talkUser] = 0
return true
end
---
if checkPokemonForTask(cid, npc.poke) then
setPlayerClanRank(cid, npc.nextRank)
selfSay("So you complete my last task! Congradulations! Now you move up of rank and become {"..lookClans[getPlayerClanNum(cid)][getPlayerClanRank(cid)].."}!", cid)
setPlayerStorageValue(cid, 854789, -1)
setPlayerStorageValue(cid, 854787, -1)
local sto = getMyTaskSto(cid, getNpcCid())
setPlayerStorageValue(cid, sto, -1)
talkState[talkUser] = 0
return true
else
selfSay("You aren't with the "..(npc.poke).." which you caught before in your pokebag! Go get it!", cid)
talkState[talkUser] = 0
return true
end
else
selfSay("You didn't complete my task yet... Go end it!", cid)
talkState[talkUser] = 0
return true
end
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Gardestrike:
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
---------------------- Configs ---------------------------
local clanNpcs = {
["Fist Trainer"] = {
task1 = {
["Fist Trainer"] = {{"Graveler", 1}, {"Onix", 1}, {"Clefable", 1}},
},
task2 = {
["Fist Trainer"] = {{"Golem", 1}, {"Jynx", 1}, {"Kangaskhan", 1}},
},
itens = {{12173, 1}, {12179, 1}, {12192, 1}},
poke = "Primeape",
level = 90,
prevRank = 1,
nextRank = 2,
},
["Tamer Trainer"] = {
task1 = {
["Tamer Trainer"] = {{"Graveler", 1}, {"Onix", 1}, {"Clefable", 1}},
},
task2 = {
["Tamer Trainer"] = {{"Golem", 1}, {"Jynx", 1}, {"Kangaskhan", 1}},
},
itens = {{12173, 1}, {12179, 1}, {12192, 1}},
poke = "Clefable",
level = 100,
prevRank = 2,
nextRank = 3,
},
["Fighter Trainer"] = {
task1 = {
["Fighter Trainer"] = {{"Graveler", 1}, {"Onix", 1}, {"Clefable", 1}},
},
task2 = {
["Fighter Trainer"] = {{"Golem", 1}, {"Jynx", 1}, {"Kangaskhan", 1}},
},
itens = {{12173, 1}, {12179, 1}, {12192, 1}},
poke = "Machamp",
level = 110,
prevRank = 3,
nextRank = 4,
},
["DeathHand Trainer"] = {
task1 = {
["DeathHand Trainer"] = {{"Graveler", 1}, {"Onix", 1}, {"Clefable", 1}},
},
task2 = {
["DeathHand Trainer"] = {{"Golem", 1}, {"Jynx", 1}, {"Kangaskhan", 1}},
},
itens = {{12173, 1}, {12179, 1}, {12192, 1}},
poke = "Snorlax",
level = 120,
prevRank = 4,
nextRank = 5,
},
}
------------------------------------------------------------------------------
local npc = clanNpcs[getNpcName()]
if msgcontains(msg, 'help') or msgcontains(msg, 'Help') then
if getPlayerLevel(cid) < npc.level or getPlayerClanName(cid) ~= 'Gardestrike' or getPlayerClanRank(cid) ~= npc.prevRank then
selfSay("I don't need your help!", cid)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) <= -1 then
selfSay("So you want to move up of rank on our clan... So, you need to bring some items to me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 1 then
selfSay("So you brought to me the items what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 2 then
selfSay("The next step is you caught a pokemon to me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 3 then
selfSay("So you caught the pokemon what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 4 then
selfSay("Now you need to do some tasks for me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 5 then
selfSay("So you finished the first task what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 6 then
selfSay("And now comes the last task... Do you wanna to begin it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 7 then
selfSay("So you finished the last task what i asked for?", cid)
talkState[talkUser] = 1
return true
end
elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'Yes')) and talkState[talkUser] == 1 then
if getPlayerStorageValue(cid, 854789) <= -1 then
local str = "Ok then, you need bring to me: "
for a = 1, #npc.itens do
str = str..(a == #npc.itens and " and " or a ~= 1 and ", " or "{")..(npc.itens[a][2]).." "..(getItemNameById(npc.itens[a][1]))
end
str = str.."}, come back when you join those items!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 1)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 1 then
local check = checkItensForTask(cid, npc.itens)
if check == 0 then
selfSay("Ok then, you completed the mission, talk to me again when you want to continue!", cid)
setPlayerStorageValue(cid, 854789, 2)
talkState[talkUser] = 0
return true
else
selfSay(check, cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 2 then
selfSay("Ok then, you need to caught a {"..(npc.poke).."}, and bring it to me... Come back when you do that!", cid)
setPlayerStorageValue(cid, 854789, 3)
setPlayerStorageValue(cid, 854788, npc.poke)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 3 then
if getPlayerStorageValue(cid, 854788) == 'done' then
selfSay("Very well, talk to me again when you want to continue!", cid)
setPlayerStorageValue(cid, 854789, 4)
setPlayerStorageValue(cid, 854788, -1)
setPlayerStorageValue(cid, 854787, npc.poke)
talkState[talkUser] = 0
return true
else
selfSay("You didn't caught the pokemon what i asked for! Go do it!", cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 4 then
local sto = getFreeTaskStorage(cid)
local c = 0
if sto == -1 then
selfSay("You can't get more tasks! You are already with the maximum of "..(maxTasks).." tasks!", cid)
talkState[talkUser] = 0
return true
end
local str = "Ok then, now you need to kill: {"
for e, f in pairs(npc.task1) do
for a = 1, #f do
str = str..((a == #f and c ~= 0) and " and " or a ~= 1 and ", " or "")..f[a][2].." "..f[a][1]
c = c+1
end
end
str = str.."} with the {"..(npc.poke).."} which you caught!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 5)
setStorageArray(cid, sto, npc.task1)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 5 then
if isMyTaskComplete(cid, getNpcCid()) then
selfSay("Very well, you have done my first task... Talk to me again when you want to continue!", cid)
local sto = getMyTaskSto(cid, getNpcCid())
setPlayerStorageValue(cid, sto, -1)
setPlayerStorageValue(cid, 854789, 6)
talkState[talkUser] = 0
return true
else
selfSay("You didn't complete my task yet... Go end it!", cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 6 then
local sto = getFreeTaskStorage(cid)
local c = 0
if sto == -1 then
selfSay("You can't catch more tasks! You are already with the maximum of "..(maxTasks).." tasks!", cid)
talkState[talkUser] = 0
return true
end
local str = "Ok then, now for your last task you need to kill: {"
for e, f in pairs(npc.task2) do
for a = 1, #f do
str = str..((a == #f and c ~= 0) and " and " or a ~= 1 and ", " or "")..f[a][2].." "..f[a][1]
c = c+1
end
end
str = str.."} with the {"..(npc.poke).."} which you caught!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 7)
setStorageArray(cid, sto, npc.task2)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 7 then
if isMyTaskComplete(cid, getNpcCid()) then
---
local storages = {17000, 63215, 17001, 13008, 5700} --alterado v1.8
for s = 1, #storages do
if getPlayerStorageValue(cid, storages[s]) >= 1 then
selfSay("You can't do that while is Flying, Riding, Surfing, Diving or mount a bike!", cid)
talkState[talkUser] = 0
return true
end
end
if #getCreatureSummons(cid) >= 1 then --alterado v1.8
selfSay("Return your pokemon!", cid)
talkState[talkUser] = 0
return true
end
---
if checkPokemonForTask(cid, npc.poke) then
setPlayerClanRank(cid, npc.nextRank)
selfSay("So you complete my last task! Congradulations! Now you move up of rank and become {"..lookClans[getPlayerClanNum(cid)][getPlayerClanRank(cid)].."}!", cid)
setPlayerStorageValue(cid, 854789, -1)
setPlayerStorageValue(cid, 854787, -1)
local sto = getMyTaskSto(cid, getNpcCid())
setPlayerStorageValue(cid, sto, -1)
talkState[talkUser] = 0
return true
else
selfSay("You aren't with the "..(npc.poke).." which you caught before in your pokebag! Go get it!", cid)
talkState[talkUser] = 0
return true
end
else
selfSay("You didn't complete my task yet... Go end it!", cid)
talkState[talkUser] = 0
return true
end
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Malefic:
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
---------------------- Configs ---------------------------
local clanNpcs = {
["Troublemaker Trainer"] = {
task1 = {
["Troublemaker Trainer"] = {{"Haunter", 1}, {"Kadabra", 1}, {"Drowzee", 1}},
},
task2 = {
["Troublemaker Trainer"] = {{"Gengar", 1}, {"Alakazam", 1}, {"Nidoking", 1}},
},
itens = {{12165, 1}, {12202, 1}, {12204, 1}},
poke = "Weezing",
level = 90,
prevRank = 1,
nextRank = 2,
},
["Venomancer Trainer"] = {
task1 = {
["Venomancer Trainer"] = {{"Haunter", 1}, {"Kadabra", 1}, {"Drowzee", 1}},
},
task2 = {
["Venomancer Trainer"] = {{"Gengar", 1}, {"Alakazam", 1}, {"Nidoking", 1}},
},
itens = {{12165, 1}, {12202, 1}, {12204, 1}},
poke = "Haunter",
level = 100,
prevRank = 2,
nextRank = 3,
},
["Spectre Trainer"] = {
task1 = {
["Spectre Trainer"] = {{"Haunter", 1}, {"Kadabra", 1}, {"Drowzee", 1}},
},
task2 = {
["Spectre Trainer"] = {{"Gengar", 1}, {"Alakazam", 1}, {"Nidoking", 1}},
},
itens = {{12165, 1}, {12202, 1}, {12204, 1}},
poke = "Nidoking",
level = 110,
prevRank = 3,
nextRank = 4,
},
["Nightwalker Trainer"] = {
task1 = {
["Nightwalker Trainer"] = {{"Haunter", 1}, {"Kadabra", 1}, {"Drowzee", 1}},
},
task2 = {
["Nightwalker Trainer"] = {{"Gengar", 1}, {"Alakazam", 1}, {"Nidoking", 1}},
},
itens = {{12165, 1}, {12202, 1}, {12204, 1}},
poke = "Gengar",
level = 120,
prevRank = 4,
nextRank = 5,
},
}
------------------------------------------------------------------------------
local npc = clanNpcs[getNpcName()]
if msgcontains(msg, 'help') or msgcontains(msg, 'Help') then
if getPlayerLevel(cid) < npc.level or getPlayerClanName(cid) ~= 'Malefic' or getPlayerClanRank(cid) ~= npc.prevRank then
selfSay("I don't need your help!", cid)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) <= -1 then
selfSay("So you want to move up of rank on our clan... So, you need to bring some items to me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 1 then
selfSay("So you brought to me the items what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 2 then
selfSay("The next step is you caught a pokemon to me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 3 then
selfSay("So you caught the pokemon what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 4 then
selfSay("Now you need to do some tasks for me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 5 then
selfSay("So you finished the first task what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 6 then
selfSay("And now comes the last task... Do you wanna to begin it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 7 then
selfSay("So you finished the last task what i asked for?", cid)
talkState[talkUser] = 1
return true
end
elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'Yes')) and talkState[talkUser] == 1 then
if getPlayerStorageValue(cid, 854789) <= -1 then
local str = "Ok then, you need bring to me: "
for a = 1, #npc.itens do
str = str..(a == #npc.itens and " and " or a ~= 1 and ", " or "{")..(npc.itens[a][2]).." "..(getItemNameById(npc.itens[a][1]))
end
str = str.."}, come back when you join those items!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 1)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 1 then
local check = checkItensForTask(cid, npc.itens)
if check == 0 then
selfSay("Ok then, you completed the mission, talk to me again when you want to continue!", cid)
setPlayerStorageValue(cid, 854789, 2)
talkState[talkUser] = 0
return true
else
selfSay(check, cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 2 then
selfSay("Ok then, you need to caught a {"..(npc.poke).."}, and bring it to me... Come back when you do that!", cid)
setPlayerStorageValue(cid, 854789, 3)
setPlayerStorageValue(cid, 854788, npc.poke)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 3 then
if getPlayerStorageValue(cid, 854788) == 'done' then
selfSay("Very well, talk to me again when you want to continue!", cid)
setPlayerStorageValue(cid, 854789, 4)
setPlayerStorageValue(cid, 854788, -1)
setPlayerStorageValue(cid, 854787, npc.poke)
talkState[talkUser] = 0
return true
else
selfSay("You didn't caught the pokemon what i asked for! Go do it!", cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 4 then
local sto = getFreeTaskStorage(cid)
local c = 0
if sto == -1 then
selfSay("You can't get more tasks! You are already with the maximum of "..(maxTasks).." tasks!", cid)
talkState[talkUser] = 0
return true
end
local str = "Ok then, now you need to kill: {"
for e, f in pairs(npc.task1) do
for a = 1, #f do
str = str..((a == #f and c ~= 0) and " and " or a ~= 1 and ", " or "")..f[a][2].." "..f[a][1]
c = c+1
end
end
str = str.."} with the {"..(npc.poke).."} which you caught!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 5)
setStorageArray(cid, sto, npc.task1)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 5 then
if isMyTaskComplete(cid, getNpcCid()) then
selfSay("Very well, you have done my first task... Talk to me again when you want to continue!", cid)
local sto = getMyTaskSto(cid, getNpcCid())
setPlayerStorageValue(cid, sto, -1)
setPlayerStorageValue(cid, 854789, 6)
talkState[talkUser] = 0
return true
else
selfSay("You didn't complete my task yet... Go end it!", cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 6 then
local sto = getFreeTaskStorage(cid)
local c = 0
if sto == -1 then
selfSay("You can't catch more tasks! You are already with the maximum of "..(maxTasks).." tasks!", cid)
talkState[talkUser] = 0
return true
end
local str = "Ok then, now for your last task you need to kill: {"
for e, f in pairs(npc.task2) do
for a = 1, #f do
str = str..((a == #f and c ~= 0) and " and " or a ~= 1 and ", " or "")..f[a][2].." "..f[a][1]
c = c+1
end
end
str = str.."} with the {"..(npc.poke).."} which you caught!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 7)
setStorageArray(cid, sto, npc.task2)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 7 then
if isMyTaskComplete(cid, getNpcCid()) then
---
local storages = {17000, 63215, 17001, 13008, 5700} --alterado v1.8
for s = 1, #storages do
if getPlayerStorageValue(cid, storages[s]) >= 1 then
selfSay("You can't do that while is Flying, Riding, Surfing, Diving or mount a bike!", cid)
talkState[talkUser] = 0
return true
end
end
if #getCreatureSummons(cid) >= 1 then --alterado v1.8
selfSay("Return your pokemon!", cid)
talkState[talkUser] = 0
return true
end
---
if checkPokemonForTask(cid, npc.poke) then
setPlayerClanRank(cid, npc.nextRank)
selfSay("So you complete my last task! Congradulations! Now you move up of rank and become {"..lookClans[getPlayerClanNum(cid)][getPlayerClanRank(cid)].."}!", cid)
setPlayerStorageValue(cid, 854789, -1)
setPlayerStorageValue(cid, 854787, -1)
local sto = getMyTaskSto(cid, getNpcCid())
setPlayerStorageValue(cid, sto, -1)
talkState[talkUser] = 0
return true
else
selfSay("You aren't with the "..(npc.poke).." which you caught before in your pokebag! Go get it!", cid)
talkState[talkUser] = 0
return true
end
else
selfSay("You didn't complete my task yet... Go end it!", cid)
talkState[talkUser] = 0
return true
end
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Orebound:
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
---------------------- Configs ---------------------------
local clanNpcs = {
["Sand Trainer"] = {
task1 = {
["Sand Trainer"] = {{"Magneton", 1}, {"Charmeleon", 1}, {"Graveler", 1}},
},
task2 = {
["Sand Trainer"] = {{"Nidoqueen", 1}, {"Onix", 1}, {"Nidoking", 1}},
},
itens = {{12337, 1}, {12208, 1}, {12177, 1}},
poke = "Marowak",
level = 90,
prevRank = 1,
nextRank = 2,
},
["Rock Trainer"] = {
task1 = {
["Rock Trainer"] = {{"Graveler", 1}, {"Venomoth", 1}, {"Kadabra", 1}, {"Electrode", 1}},
},
task2 = {
["Rock Trainer"] = {{"Golem", 1}, {"Alakazam", 1}, {"Nidoking", 1}},
},
itens = {{12337, 1}, {12208, 1}, {12177, 1}},
poke = "Onix",
level = 100,
prevRank = 2,
nextRank = 3,
},
["Solid Trainer"] = {
task1 = {
["Solid Trainer"] = {{"Graveler", 1}, {"Venomoth", 1}, {"Kadabra", 1}, {"Electrode", 1}},
},
task2 = {
["Solid Trainer"] = {{"Golem", 1}, {"Alakazam", 1}, {"Nidoking", 1}},
},
itens = {{12337, 1}, {12208, 1}, {12177, 1}},
poke = "Sandslash",
level = 110,
prevRank = 3,
nextRank = 4,
},
["Hardskin Trainer"] = {
task1 = {
["Hardskin Trainer"] = {{"Graveler", 1}, {"Venomoth", 1}, {"Kadabra", 1}, {"Electrode", 1}},
},
task2 = {
["Hardskin Trainer"] = {{"Golem", 1}, {"Alakazam", 1}, {"Nidoking", 1}},
},
itens = {{12337, 1}, {12208, 1}, {12177, 1}},
poke = "Rhydon",
level = 120,
prevRank = 4,
nextRank = 5,
},
}
------------------------------------------------------------------------------
local npc = clanNpcs[getNpcName()]
if msgcontains(msg, 'help') or msgcontains(msg, 'Help') then
if getPlayerLevel(cid) < npc.level or getPlayerClanName(cid) ~= 'Orebound' or getPlayerClanRank(cid) ~= npc.prevRank then
selfSay("I don't need your help!", cid)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) <= -1 then
selfSay("So you want to move up of rank on our clan... So, you need to bring some items to me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 1 then
selfSay("So you brought to me the items what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 2 then
selfSay("The next step is you caught a pokemon to me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 3 then
selfSay("So you caught the pokemon what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 4 then
selfSay("Now you need to do some tasks for me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 5 then
selfSay("So you finished the first task what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 6 then
selfSay("And now comes the last task... Do you wanna to begin it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 7 then
selfSay("So you finished the last task what i asked for?", cid)
talkState[talkUser] = 1
return true
end
elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'Yes')) and talkState[talkUser] == 1 then
if getPlayerStorageValue(cid, 854789) <= -1 then
local str = "Ok then, you need bring to me: "
for a = 1, #npc.itens do
str = str..(a == #npc.itens and " and " or a ~= 1 and ", " or "{")..(npc.itens[a][2]).." "..(getItemNameById(npc.itens[a][1]))
end
str = str.."}, come back when you join those items!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 1)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 1 then
local check = checkItensForTask(cid, npc.itens)
if check == 0 then
selfSay("Ok then, you completed the mission, talk to me again when you want to continue!", cid)
setPlayerStorageValue(cid, 854789, 2)
talkState[talkUser] = 0
return true
else
selfSay(check, cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 2 then
selfSay("Ok then, you need to caught a {"..(npc.poke).."}, and bring it to me... Come back when you do that!", cid)
setPlayerStorageValue(cid, 854789, 3)
setPlayerStorageValue(cid, 854788, npc.poke)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 3 then
if getPlayerStorageValue(cid, 854788) == 'done' then
selfSay("Very well, talk to me again when you want to continue!", cid)
setPlayerStorageValue(cid, 854789, 4)
setPlayerStorageValue(cid, 854788, -1)
setPlayerStorageValue(cid, 854787, npc.poke)
talkState[talkUser] = 0
return true
else
selfSay("You didn't caught the pokemon what i asked for! Go do it!", cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 4 then
local sto = getFreeTaskStorage(cid)
local c = 0
if sto == -1 then
selfSay("You can't get more tasks! You are already with the maximum of "..(maxTasks).." tasks!", cid)
talkState[talkUser] = 0
return true
end
local str = "Ok then, now you need to kill: {"
for e, f in pairs(npc.task1) do
for a = 1, #f do
str = str..((a == #f and c ~= 0) and " and " or a ~= 1 and ", " or "")..f[a][2].." "..f[a][1]
c = c+1
end
end
str = str.."} with the {"..(npc.poke).."} which you caught!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 5)
setStorageArray(cid, sto, npc.task1)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 5 then
if isMyTaskComplete(cid, getNpcCid()) then
selfSay("Very well, you have done my first task... Talk to me again when you want to continue!", cid)
local sto = getMyTaskSto(cid, getNpcCid())
setPlayerStorageValue(cid, sto, -1)
setPlayerStorageValue(cid, 854789, 6)
talkState[talkUser] = 0
return true
else
selfSay("You didn't complete my task yet... Go end it!", cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 6 then
local sto = getFreeTaskStorage(cid)
local c = 0
if sto == -1 then
selfSay("You can't catch more tasks! You are already with the maximum of "..(maxTasks).." tasks!", cid)
talkState[talkUser] = 0
return true
end
local str = "Ok then, now for your last task you need to kill: {"
for e, f in pairs(npc.task2) do
for a = 1, #f do
str = str..((a == #f and c ~= 0) and " and " or a ~= 1 and ", " or "")..f[a][2].." "..f[a][1]
c = c+1
end
end
str = str.."} with the {"..(npc.poke).."} which you caught!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 7)
setStorageArray(cid, sto, npc.task2)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 7 then
if isMyTaskComplete(cid, getNpcCid()) then
---
local storages = {17000, 63215, 17001, 13008, 5700} --alterado v1.8
for s = 1, #storages do
if getPlayerStorageValue(cid, storages[s]) >= 1 then
selfSay("You can't do that while is Flying, Riding, Surfing, Diving or mount a bike!", cid)
talkState[talkUser] = 0
return true
end
end
if #getCreatureSummons(cid) >= 1 then --alterado v1.8
selfSay("Return your pokemon!", cid)
talkState[talkUser] = 0
return true
end
---
if checkPokemonForTask(cid, npc.poke) then
setPlayerClanRank(cid, npc.nextRank)
selfSay("So you complete my last task! Congradulations! Now you move up of rank and become {"..lookClans[getPlayerClanNum(cid)][getPlayerClanRank(cid)].."}!", cid)
setPlayerStorageValue(cid, 854789, -1)
setPlayerStorageValue(cid, 854787, -1)
local sto = getMyTaskSto(cid, getNpcCid())
setPlayerStorageValue(cid, sto, -1)
talkState[talkUser] = 0
return true
else
selfSay("You aren't with the "..(npc.poke).." which you caught before in your pokebag! Go get it!", cid)
talkState[talkUser] = 0
return true
end
else
selfSay("You didn't complete my task yet... Go end it!", cid)
talkState[talkUser] = 0
return true
end
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Psycraft:
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
---------------------- Configs ---------------------------
local clanNpcs = {
["Mind Trainer"] = {
task1 = {
["Mind Trainer"] = {{"Primeape", 1}, {"Machoke", 1}, {"Arbok", 1}},
},
task2 = {
["Mind Trainer"] = {{"Machamp", 1}, {"Venomoth", 1}, {"Nidoking", 1}},
},
itens = {{12194, 1}, {12193, 1}, {12166, 1}},
poke = "Kadabra",
level = 90,
prevRank = 1,
nextRank = 2,
},
["Brain Trainer"] = {
task1 = {
["Brain Trainer"] = {{"Primeape", 1}, {"Machoke", 1}, {"Arbok", 1}},
},
task2 = {
["Brain Trainer"] = {{"Machamp", 1}, {"Venomoth", 1}, {"Nidoking", 1}},
},
itens = {{12194, 1}, {12193, 1}, {12166, 1}},
poke = "Hypno",
level = 100,
prevRank = 2,
nextRank = 3,
},
["Scholar Trainer"] = {
task1 = {
["Scholar Trainer"] = {{"Primeape", 1}, {"Machoke", 1}, {"Arbok", 1}},
},
task2 = {
["Scholar Trainer"] = {{"Machamp", 1}, {"Venomoth", 1}, {"Nidoking", 1}},
},
itens = {{12194, 1}, {12193, 1}, {12166, 1}},
poke = "Mr. Mime",
level = 110,
prevRank = 3,
nextRank = 4,
},
["Telepath Trainer"] = {
task1 = {
["Telepath Trainer"] = {{"Primeape", 1}, {"Machoke", 1}, {"Arbok", 1}},
},
task2 = {
["Telepath Trainer"] = {{"Machamp", 1}, {"Venomoth", 1}, {"Nidoking", 1}},
},
itens = {{12194, 1}, {12193, 1}, {12166, 1}},
poke = "Alakazam",
level = 120,
prevRank = 4,
nextRank = 5,
},
}
------------------------------------------------------------------------------
local npc = clanNpcs[getNpcName()]
if msgcontains(msg, 'help') or msgcontains(msg, 'Help') then
if getPlayerLevel(cid) < npc.level or getPlayerClanName(cid) ~= 'Psycraft' or getPlayerClanRank(cid) ~= npc.prevRank then
selfSay("I don't need your help!", cid)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) <= -1 then
selfSay("So you want to move up of rank on our clan... So, you need to bring some items to me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 1 then
selfSay("So you brought to me the items what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 2 then
selfSay("The next step is you caught a pokemon to me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 3 then
selfSay("So you caught the pokemon what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 4 then
selfSay("Now you need to do some tasks for me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 5 then
selfSay("So you finished the first task what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 6 then
selfSay("And now comes the last task... Do you wanna to begin it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 7 then
selfSay("So you finished the last task what i asked for?", cid)
talkState[talkUser] = 1
return true
end
elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'Yes')) and talkState[talkUser] == 1 then
if getPlayerStorageValue(cid, 854789) <= -1 then
local str = "Ok then, you need bring to me: "
for a = 1, #npc.itens do
str = str..(a == #npc.itens and " and " or a ~= 1 and ", " or "{")..(npc.itens[a][2]).." "..(getItemNameById(npc.itens[a][1]))
end
str = str.."}, come back when you join those items!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 1)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 1 then
local check = checkItensForTask(cid, npc.itens)
if check == 0 then
selfSay("Ok then, you completed the mission, talk to me again when you want to continue!", cid)
setPlayerStorageValue(cid, 854789, 2)
talkState[talkUser] = 0
return true
else
selfSay(check, cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 2 then
selfSay("Ok then, you need to caught a {"..(npc.poke).."}, and bring it to me... Come back when you do that!", cid)
setPlayerStorageValue(cid, 854789, 3)
setPlayerStorageValue(cid, 854788, npc.poke)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 3 then
if getPlayerStorageValue(cid, 854788) == 'done' then
selfSay("Very well, talk to me again when you want to continue!", cid)
setPlayerStorageValue(cid, 854789, 4)
setPlayerStorageValue(cid, 854788, -1)
setPlayerStorageValue(cid, 854787, npc.poke)
talkState[talkUser] = 0
return true
else
selfSay("You didn't caught the pokemon what i asked for! Go do it!", cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 4 then
local sto = getFreeTaskStorage(cid)
local c = 0
if sto == -1 then
selfSay("You can't get more tasks! You are already with the maximum of "..(maxTasks).." tasks!", cid)
talkState[talkUser] = 0
return true
end
local str = "Ok then, now you need to kill: {"
for e, f in pairs(npc.task1) do
for a = 1, #f do
str = str..((a == #f and c ~= 0) and " and " or a ~= 1 and ", " or "")..f[a][2].." "..f[a][1]
c = c+1
end
end
str = str.."} with the {"..(npc.poke).."} which you caught!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 5)
setStorageArray(cid, sto, npc.task1)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 5 then
if isMyTaskComplete(cid, getNpcCid()) then
selfSay("Very well, you have done my first task... Talk to me again when you want to continue!", cid)
local sto = getMyTaskSto(cid, getNpcCid())
setPlayerStorageValue(cid, sto, -1)
setPlayerStorageValue(cid, 854789, 6)
talkState[talkUser] = 0
return true
else
selfSay("You didn't complete my task yet... Go end it!", cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 6 then
local sto = getFreeTaskStorage(cid)
local c = 0
if sto == -1 then
selfSay("You can't catch more tasks! You are already with the maximum of "..(maxTasks).." tasks!", cid)
talkState[talkUser] = 0
return true
end
local str = "Ok then, now for your last task you need to kill: {"
for e, f in pairs(npc.task2) do
for a = 1, #f do
str = str..((a == #f and c ~= 0) and " and " or a ~= 1 and ", " or "")..f[a][2].." "..f[a][1]
c = c+1
end
end
str = str.."} with the {"..(npc.poke).."} which you caught!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 7)
setStorageArray(cid, sto, npc.task2)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 7 then
if isMyTaskComplete(cid, getNpcCid()) then
---
local storages = {17000, 63215, 17001, 13008, 5700} --alterado v1.8
for s = 1, #storages do
if getPlayerStorageValue(cid, storages[s]) >= 1 then
selfSay("You can't do that while is Flying, Riding, Surfing, Diving or mount a bike!", cid)
talkState[talkUser] = 0
return true
end
end
if #getCreatureSummons(cid) >= 1 then --alterado v1.8
selfSay("Return your pokemon!", cid)
talkState[talkUser] = 0
return true
end
---
if checkPokemonForTask(cid, npc.poke) then
setPlayerClanRank(cid, npc.nextRank)
selfSay("So you complete my last task! Congradulations! Now you move up of rank and become {"..lookClans[getPlayerClanNum(cid)][getPlayerClanRank(cid)].."}!", cid)
setPlayerStorageValue(cid, 854789, -1)
setPlayerStorageValue(cid, 854787, -1)
local sto = getMyTaskSto(cid, getNpcCid())
setPlayerStorageValue(cid, sto, -1)
talkState[talkUser] = 0
return true
else
selfSay("You aren't with the "..(npc.poke).." which you caught before in your pokebag! Go get it!", cid)
talkState[talkUser] = 0
return true
end
else
selfSay("You didn't complete my task yet... Go end it!", cid)
talkState[talkUser] = 0
return true
end
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Raibolt:
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
---------------------- Configs ---------------------------
local clanNpcs = {
["Shock Trainer"] = {
task1 = {
["Shock Trainer"] = {{"Wartortle", 1}, {"Starmie", 1}, {"Kingler", 1}},
},
task2 = {
["Shock Trainer"] = {{"Blastoise", 1}, {"Pidgeot", 1}, {"Fearow", 1}},
},
itens = {{12164, 1}, {12198, 1}, {12176, 1}},
poke = "Electrode",
level = 90,
prevRank = 1,
nextRank = 2,
},
["Watt Trainer"] = {
task1 = {
["Watt Trainer"] = {{"Wartortle", 1}, {"Starmie", 1}, {"Kingler", 1}},
},
task2 = {
["Watt Trainer"] = {{"Blastoise", 1}, {"Pidgeot", 1}, {"Fearow", 1}},
},
itens = {{12164, 1}, {12198, 1}, {12176, 1}},
poke = "Magneton",
level = 100,
prevRank = 2,
nextRank = 3,
},
["Electrician Trainer"] = {
task1 = {
["Electrician Trainer"] = {{"Wartortle", 1}, {"Starmie", 1}, {"Kingler", 1}},
},
task2 = {
["Electrician Trainer"] = {{"Blastoise", 1}, {"Pidgeot", 1}, {"Fearow", 1}},
},
itens = {{12164, 1}, {12198, 1}, {12176, 1}},
poke = "Raichu",
level = 110,
prevRank = 3,
nextRank = 4,
},
["Overcharged Trainer"] = {
task1 = {
["Overcharged Trainer"] = {{"Wartortle", 1}, {"Starmie", 1}, {"Kingler", 1}},
},
task2 = {
["Overcharged Trainer"] = {{"Blastoise", 1}, {"Pidgeot", 1}, {"Fearow", 1}},
},
itens = {{12164, 1}, {12198, 1}, {12176, 1}},
poke = "Electabuzz",
level = 120,
prevRank = 4,
nextRank = 5,
},
}
------------------------------------------------------------------------------
local npc = clanNpcs[getNpcName()]
if msgcontains(msg, 'help') or msgcontains(msg, 'Help') then
if getPlayerLevel(cid) < npc.level or getPlayerClanName(cid) ~= 'Raibolt' or getPlayerClanRank(cid) ~= npc.prevRank then
selfSay("I don't need your help!", cid)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) <= -1 then
selfSay("So you want to move up of rank on our clan... So, you need to bring some items to me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 1 then
selfSay("So you brought to me the items what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 2 then
selfSay("The next step is you caught a pokemon to me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 3 then
selfSay("So you caught the pokemon what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 4 then
selfSay("Now you need to do some tasks for me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 5 then
selfSay("So you finished the first task what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 6 then
selfSay("And now comes the last task... Do you wanna to begin it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 7 then
selfSay("So you finished the last task what i asked for?", cid)
talkState[talkUser] = 1
return true
end
elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'Yes')) and talkState[talkUser] == 1 then
if getPlayerStorageValue(cid, 854789) <= -1 then
local str = "Ok then, you need bring to me: "
for a = 1, #npc.itens do
str = str..(a == #npc.itens and " and " or a ~= 1 and ", " or "{")..(npc.itens[a][2]).." "..(getItemNameById(npc.itens[a][1]))
end
str = str.."}, come back when you join those items!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 1)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 1 then
local check = checkItensForTask(cid, npc.itens)
if check == 0 then
selfSay("Ok then, you completed the mission, talk to me again when you want to continue!", cid)
setPlayerStorageValue(cid, 854789, 2)
talkState[talkUser] = 0
return true
else
selfSay(check, cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 2 then
selfSay("Ok then, you need to caught a {"..(npc.poke).."}, and bring it to me... Come back when you do that!", cid)
setPlayerStorageValue(cid, 854789, 3)
setPlayerStorageValue(cid, 854788, npc.poke)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 3 then
if getPlayerStorageValue(cid, 854788) == 'done' then
selfSay("Very well, talk to me again when you want to continue!", cid)
setPlayerStorageValue(cid, 854789, 4)
setPlayerStorageValue(cid, 854788, -1)
setPlayerStorageValue(cid, 854787, npc.poke)
talkState[talkUser] = 0
return true
else
selfSay("You didn't caught the pokemon what i asked for! Go do it!", cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 4 then
local sto = getFreeTaskStorage(cid)
local c = 0
if sto == -1 then
selfSay("You can't get more tasks! You are already with the maximum of "..(maxTasks).." tasks!", cid)
talkState[talkUser] = 0
return true
end
local str = "Ok then, now you need to kill: {"
for e, f in pairs(npc.task1) do
for a = 1, #f do
str = str..((a == #f and c ~= 0) and " and " or a ~= 1 and ", " or "")..f[a][2].." "..f[a][1]
c = c+1
end
end
str = str.."} with the {"..(npc.poke).."} which you caught!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 5)
setStorageArray(cid, sto, npc.task1)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 5 then
if isMyTaskComplete(cid, getNpcCid()) then
selfSay("Very well, you have done my first task... Talk to me again when you want to continue!", cid)
local sto = getMyTaskSto(cid, getNpcCid())
setPlayerStorageValue(cid, sto, -1)
setPlayerStorageValue(cid, 854789, 6)
talkState[talkUser] = 0
return true
else
selfSay("You didn't complete my task yet... Go end it!", cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 6 then
local sto = getFreeTaskStorage(cid)
local c = 0
if sto == -1 then
selfSay("You can't catch more tasks! You are already with the maximum of "..(maxTasks).." tasks!", cid)
talkState[talkUser] = 0
return true
end
local str = "Ok then, now for your last task you need to kill: {"
for e, f in pairs(npc.task2) do
for a = 1, #f do
str = str..((a == #f and c ~= 0) and " and " or a ~= 1 and ", " or "")..f[a][2].." "..f[a][1]
c = c+1
end
end
str = str.."} with the {"..(npc.poke).."} which you caught!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 7)
setStorageArray(cid, sto, npc.task2)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 7 then
if isMyTaskComplete(cid, getNpcCid()) then
---
local storages = {17000, 63215, 17001, 13008, 5700} --alterado v1.8
for s = 1, #storages do
if getPlayerStorageValue(cid, storages[s]) >= 1 then
selfSay("You can't do that while is Flying, Riding, Surfing, Diving or mount a bike!", cid)
talkState[talkUser] = 0
return true
end
end
if #getCreatureSummons(cid) >= 1 then --alterado v1.8
selfSay("Return your pokemon!", cid)
talkState[talkUser] = 0
return true
end
---
if checkPokemonForTask(cid, npc.poke) then
setPlayerClanRank(cid, npc.nextRank)
selfSay("So you complete my last task! Congradulations! Now you move up of rank and become {"..lookClans[getPlayerClanNum(cid)][getPlayerClanRank(cid)].."}!", cid)
setPlayerStorageValue(cid, 854789, -1)
setPlayerStorageValue(cid, 854787, -1)
local sto = getMyTaskSto(cid, getNpcCid())
setPlayerStorageValue(cid, sto, -1)
talkState[talkUser] = 0
return true
else
selfSay("You aren't with the "..(npc.poke).." which you caught before in your pokebag! Go get it!", cid)
talkState[talkUser] = 0
return true
end
else
selfSay("You didn't complete my task yet... Go end it!", cid)
talkState[talkUser] = 0
return true
end
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Seavell:
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
---------------------- Configs ---------------------------
local clanNpcs = {
["Drop Trainer"] = {
task1 = {
["Drop Trainer"] = {{"Pidgeot", 1}, {"Sandslash", 20}, {"Dratini", 25}},
},
task2 = {
["Drop Trainer"] = {{"Venusaur", 1}, {"Exeggutor", 1}, {"Dragonair", 1}},
},
itens = {{12161, 1}, {12170, 1}, {12201, 1}},
poke = "Dewgong",
level = 90,
prevRank = 1,
nextRank = 2,
},
["Icelake Trainer"] = {
task1 = {
["Icelake Trainer"] = {{"Pidgeot", 1}, {"Sandslash", 1}, {"Dratini", 1}},
},
task2 = {
["Icelake Trainer"] = {{"Venusaur", 1}, {"Exeggutor", 1}, {"Dragonair", 1}},
},
itens = {{12161, 1}, {12170, 1}, {12201, 1}},
poke = "Jynx",
level = 100,
prevRank = 2,
nextRank = 3,
},
["Waterfall Trainer"] = {
task1 = {
["Waterfall Trainer"] = {{"Pidgeot", 1}, {"Sandslash", 1}, {"Dratini", 1}},
},
task2 = {
["Waterfall Trainer"] = {{"Venusaur", 1}, {"Exeggutor", 1}, {"Dragonair", 1}},
},
itens = {{12161, 1}, {12170, 1}, {12201, 1}},
poke = "Lapras",
level = 110,
prevRank = 3,
nextRank = 4,
},
["Frost Trainer"] = {
task1 = {
["Frost Trainer"] = {{"Charmeleon", 1}, {"Arcanine", 1}, {"Charizard", 1}},
},
task2 = {
["Frost Trainer"] = {{"Venusaur", 1}, {"Exeggutor", 1}, {"Dragonair", 1}},
},
itens = {{12161, 1}, {12170, 1}, {12201, 1}},
poke = "Blastoise",
level = 120,
prevRank = 4,
nextRank = 5,
},
}
------------------------------------------------------------------------------
local npc = clanNpcs[getNpcName()]
if msgcontains(msg, 'help') or msgcontains(msg, 'Help') then
if getPlayerLevel(cid) < npc.level or getPlayerClanName(cid) ~= 'Seavell' or getPlayerClanRank(cid) ~= npc.prevRank then
selfSay("I don't need your help!", cid)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) <= -1 then
selfSay("So you want to move up of rank on our clan... So, you need to bring some items to me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 1 then
selfSay("So you brought to me the items what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 2 then
selfSay("The next step is you caught a pokemon to me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 3 then
selfSay("So you caught the pokemon what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 4 then
selfSay("Now you need to do some tasks for me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 5 then
selfSay("So you finished the first task what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 6 then
selfSay("And now comes the last task... Do you wanna to begin it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 7 then
selfSay("So you finished the last task what i asked for?", cid)
talkState[talkUser] = 1
return true
end
elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'Yes')) and talkState[talkUser] == 1 then
if getPlayerStorageValue(cid, 854789) <= -1 then
local str = "Ok then, you need bring to me: "
for a = 1, #npc.itens do
str = str..(a == #npc.itens and " and " or a ~= 1 and ", " or "{")..(npc.itens[a][2]).." "..(getItemNameById(npc.itens[a][1]))
end
str = str.."}, come back when you join those items!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 1)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 1 then
local check = checkItensForTask(cid, npc.itens)
if check == 0 then
selfSay("Ok then, you completed the mission, talk to me again when you want to continue!", cid)
setPlayerStorageValue(cid, 854789, 2)
talkState[talkUser] = 0
return true
else
selfSay(check, cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 2 then
selfSay("Ok then, you need to caught a {"..(npc.poke).."}, and bring it to me... Come back when you do that!", cid)
setPlayerStorageValue(cid, 854789, 3)
setPlayerStorageValue(cid, 854788, npc.poke)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 3 then
if getPlayerStorageValue(cid, 854788) == 'done' then
selfSay("Very well, talk to me again when you want to continue!", cid)
setPlayerStorageValue(cid, 854789, 4)
setPlayerStorageValue(cid, 854788, -1)
setPlayerStorageValue(cid, 854787, npc.poke)
talkState[talkUser] = 0
return true
else
selfSay("You didn't caught the pokemon what i asked for! Go do it!", cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 4 then
local sto = getFreeTaskStorage(cid)
local c = 0
if sto == -1 then
selfSay("You can't get more tasks! You are already with the maximum of "..(maxTasks).." tasks!", cid)
talkState[talkUser] = 0
return true
end
local str = "Ok then, now you need to kill: {"
for e, f in pairs(npc.task1) do
for a = 1, #f do
str = str..((a == #f and c ~= 0) and " and " or a ~= 1 and ", " or "")..f[a][2].." "..f[a][1]
c = c+1
end
end
str = str.."} with the {"..(npc.poke).."} which you caught!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 5)
setStorageArray(cid, sto, npc.task1)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 5 then
if isMyTaskComplete(cid, getNpcCid()) then
selfSay("Very well, you have done my first task... Talk to me again when you want to continue!", cid)
local sto = getMyTaskSto(cid, getNpcCid())
setPlayerStorageValue(cid, sto, -1)
setPlayerStorageValue(cid, 854789, 6)
talkState[talkUser] = 0
return true
else
selfSay("You didn't complete my task yet... Go end it!", cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 6 then
local sto = getFreeTaskStorage(cid)
local c = 0
if sto == -1 then
selfSay("You can't catch more tasks! You are already with the maximum of "..(maxTasks).." tasks!", cid)
talkState[talkUser] = 0
return true
end
local str = "Ok then, now for your last task you need to kill: {"
for e, f in pairs(npc.task2) do
for a = 1, #f do
str = str..((a == #f and c ~= 0) and " and " or a ~= 1 and ", " or "")..f[a][2].." "..f[a][1]
c = c+1
end
end
str = str.."} with the {"..(npc.poke).."} which you caught!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 7)
setStorageArray(cid, sto, npc.task2)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 7 then
if isMyTaskComplete(cid, getNpcCid()) then
---
local storages = {17000, 63215, 17001, 13008, 5700} --alterado v1.8
for s = 1, #storages do
if getPlayerStorageValue(cid, storages[s]) >= 1 then
selfSay("You can't do that while is Flying, Riding, Surfing, Diving or mount a bike!", cid)
talkState[talkUser] = 0
return true
end
end
if #getCreatureSummons(cid) >= 1 then --alterado v1.8
selfSay("Return your pokemon!", cid)
talkState[talkUser] = 0
return true
end
---
if checkPokemonForTask(cid, npc.poke) then
setPlayerClanRank(cid, npc.nextRank)
selfSay("So you complete my last task! Congradulations! Now you move up of rank and become {"..lookClans[getPlayerClanNum(cid)][getPlayerClanRank(cid)].."}!", cid)
setPlayerStorageValue(cid, 854789, -1)
setPlayerStorageValue(cid, 854787, -1)
local sto = getMyTaskSto(cid, getNpcCid())
setPlayerStorageValue(cid, sto, -1)
talkState[talkUser] = 0
return true
else
selfSay("You aren't with the "..(npc.poke).." which you caught before in your pokebag! Go get it!", cid)
talkState[talkUser] = 0
return true
end
else
selfSay("You didn't complete my task yet... Go end it!", cid)
talkState[talkUser] = 0
return true
end
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Volcanic:
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
---------------------- Configs ---------------------------
local clanNpcs = {
["Spark Trainer"] = {
task1 = {
["Spark Trainer"] = {{"Ivysaur", 1}, {"Butterfree", 1}, {"Tangela", 1}},
},
task2 = {
["Spark Trainer"] = {{"Jynx", 1}, {"Venusaur", 1}, {"Pinsir", 1}},
},
itens = {{12162, 1}, {12152, 1}, {12157, 1}},
poke = "Ninetales",
level = 90,
prevRank = 1,
nextRank = 2,
},
["Flame Trainer"] = {
task1 = {
["Flame Trainer"] = {{"Ivysaur", 1}, {"Butterfree", 1}, {"Tangela", 1}},
},
task2 = {
["Flame Trainer"] = {{"Jynx", 1}, {"Venusaur", 1}, {"Pinsir", 1}},
},
itens = {{12162, 1}, {12152, 1}, {12157, 1}},
poke = "Arcanine",
level = 100,
prevRank = 2,
nextRank = 3,
},
["Firetamer Trainer"] = {
task1 = {
["Firetamer Trainer"] = {{"Ivysaur", 1}, {"Butterfree", 1}, {"Tangela", 1}},
},
task2 = {
["Firetamer Trainer"] = {{"Jynx", 1}, {"Venusaur", 1}, {"Pinsir", 1}},
},
itens = {{12162, 1}, {12152, 1}, {12157, 1}},
poke = "Charizard",
level = 110,
prevRank = 3,
nextRank = 4,
},
["Pyromancer Trainer"] = {
task1 = {
["Pyromancer Trainer"] = {{"Ivysaur", 1}, {"Butterfree", 1}, {"Tangela", 1}},
},
task2 = {
["Pyromancer Trainer"] = {{"Jynx", 1}, {"Venusaur", 1}, {"Pinsir", 1}},
},
itens = {{12162, 1}, {12152, 1}, {12157, 1}},
poke = "Magmar",
level = 120,
prevRank = 4,
nextRank = 5,
},
}
------------------------------------------------------------------------------
local npc = clanNpcs[getNpcName()]
if msgcontains(msg, 'help') or msgcontains(msg, 'Help') then
if getPlayerLevel(cid) < npc.level or getPlayerClanName(cid) ~= 'Volcanic' or getPlayerClanRank(cid) ~= npc.prevRank then
selfSay("I don't need your help!", cid)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) <= -1 then
selfSay("So you want to move up of rank on our clan... So, you need to bring some items to me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 1 then
selfSay("So you brought to me the items what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 2 then
selfSay("The next step is you caught a pokemon to me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 3 then
selfSay("So you caught the pokemon what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 4 then
selfSay("Now you need to do some tasks for me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 5 then
selfSay("So you finished the first task what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 6 then
selfSay("And now comes the last task... Do you wanna to begin it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 7 then
selfSay("So you finished the last task what i asked for?", cid)
talkState[talkUser] = 1
return true
end
elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'Yes')) and talkState[talkUser] == 1 then
if getPlayerStorageValue(cid, 854789) <= -1 then
local str = "Ok then, you need bring to me: "
for a = 1, #npc.itens do
str = str..(a == #npc.itens and " and " or a ~= 1 and ", " or "{")..(npc.itens[a][2]).." "..(getItemNameById(npc.itens[a][1]))
end
str = str.."}, come back when you join those items!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 1)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 1 then
local check = checkItensForTask(cid, npc.itens)
if check == 0 then
selfSay("Ok then, you completed the mission, talk to me again when you want to continue!", cid)
setPlayerStorageValue(cid, 854789, 2)
talkState[talkUser] = 0
return true
else
selfSay(check, cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 2 then
selfSay("Ok then, you need to caught a {"..(npc.poke).."}, and bring it to me... Come back when you do that!", cid)
setPlayerStorageValue(cid, 854789, 3)
setPlayerStorageValue(cid, 854788, npc.poke)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 3 then
if getPlayerStorageValue(cid, 854788) == 'done' then
selfSay("Very well, talk to me again when you want to continue!", cid)
setPlayerStorageValue(cid, 854789, 4)
setPlayerStorageValue(cid, 854788, -1)
setPlayerStorageValue(cid, 854787, npc.poke)
talkState[talkUser] = 0
return true
else
selfSay("You didn't caught the pokemon what i asked for! Go do it!", cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 4 then
local sto = getFreeTaskStorage(cid)
local c = 0
if sto == -1 then
selfSay("You can't get more tasks! You are already with the maximum of "..(maxTasks).." tasks!", cid)
talkState[talkUser] = 0
return true
end
local str = "Ok then, now you need to kill: {"
for e, f in pairs(npc.task1) do
for a = 1, #f do
str = str..((a == #f and c ~= 0) and " and " or a ~= 1 and ", " or "")..f[a][2].." "..f[a][1]
c = c+1
end
end
str = str.."} with the {"..(npc.poke).."} which you caught!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 5)
setStorageArray(cid, sto, npc.task1)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 5 then
if isMyTaskComplete(cid, getNpcCid()) then
selfSay("Very well, you have done my first task... Talk to me again when you want to continue!", cid)
local sto = getMyTaskSto(cid, getNpcCid())
setPlayerStorageValue(cid, sto, -1)
setPlayerStorageValue(cid, 854789, 6)
talkState[talkUser] = 0
return true
else
selfSay("You didn't complete my task yet... Go end it!", cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 6 then
local sto = getFreeTaskStorage(cid)
local c = 0
if sto == -1 then
selfSay("You can't catch more tasks! You are already with the maximum of "..(maxTasks).." tasks!", cid)
talkState[talkUser] = 0
return true
end
local str = "Ok then, now for your last task you need to kill: {"
for e, f in pairs(npc.task2) do
for a = 1, #f do
str = str..((a == #f and c ~= 0) and " and " or a ~= 1 and ", " or "")..f[a][2].." "..f[a][1]
c = c+1
end
end
str = str.."} with the {"..(npc.poke).."} which you caught!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 7)
setStorageArray(cid, sto, npc.task2)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 7 then
if isMyTaskComplete(cid, getNpcCid()) then
---
local storages = {17000, 63215, 17001, 13008, 5700} --alterado v1.8
for s = 1, #storages do
if getPlayerStorageValue(cid, storages[s]) >= 1 then
selfSay("You can't do that while is Flying, Riding, Surfing, Diving or mount a bike!", cid)
talkState[talkUser] = 0
return true
end
end
if #getCreatureSummons(cid) >= 1 then --alterado v1.8
selfSay("Return your pokemon!", cid)
talkState[talkUser] = 0
return true
end
---
if checkPokemonForTask(cid, npc.poke) then
setPlayerClanRank(cid, npc.nextRank)
selfSay("So you complete my last task! Congradulations! Now you move up of rank and become {"..lookClans[getPlayerClanNum(cid)][getPlayerClanRank(cid)].."}!", cid)
setPlayerStorageValue(cid, 854789, -1)
setPlayerStorageValue(cid, 854787, -1)
local sto = getMyTaskSto(cid, getNpcCid())
setPlayerStorageValue(cid, sto, -1)
talkState[talkUser] = 0
return true
else
selfSay("You aren't with the "..(npc.poke).." which you caught before in your pokebag! Go get it!", cid)
talkState[talkUser] = 0
return true
end
else
selfSay("You didn't complete my task yet... Go end it!", cid)
talkState[talkUser] = 0
return true
end
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Wingeon:
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
---------------------- Configs ---------------------------
local clanNpcs = {
["Cloud Trainer"] = {
task1 = {
["Cloud Trainer"] = {{"Ivysaur", 1}, {"Tangela", 1}, {"Parasect", 1}},
},
task2 = {
["Cloud Trainer"] = {{"Pinsir", 1}, {"Venusaur", 1}, {"Farfetch'd", 1}},
},
itens = {{12172, 1}, {12199, 1}, {12200, 1}}, --n achei o id do straw
poke = "Farfetch'd",
level = 90,
prevRank = 1,
nextRank = 2,
},
["Wind Trainer"] = {
task1 = {
["Wind Trainer"] = {{"Ivysaur", 1}, {"Tangela", 1}, {"Parasect", 1}},
},
task2 = {
["Wind Trainer"] = {{"Pinsir", 1}, {"Venusaur", 1}, {"Farfetch'd", 1}},
},
itens = {{12172, 1}, {12199, 1}, {12200, 1}}, --n achei o id do straw
poke = "Fearow",
level = 100,
prevRank = 2,
nextRank = 3,
},
["Sky Trainer"] = {
task1 = {
["Sky Trainer"] = {{"Ivysaur", 1}, {"Tangela", 1}, {"Parasect", 1}},
},
task2 = {
["Sky Trainer"] = {{"Pinsir", 1}, {"Venusaur", 1}, {"Farfetch'd", 1}},
},
itens = {{12172, 1}, {12199, 1}, {12200, 1}}, --n achei o id do straw
poke = "Dragonair",
level = 110,
prevRank = 3,
nextRank = 4,
},
["Falcon Trainer"] = {
task1 = {
["Falcon Trainer"] = {{"Ivysaur", 1}, {"Tangela", 1}, {"Parasect", 1}},
},
task2 = {
["Falcon Trainer"] = {{"Dragonair", 1}, {"Venusaur", 1}, {"Dragonite", 1}},
},
itens = {{12172, 1}, {12199, 1}, {12200, 1}}, --n achei o id do straw
poke = "Dragonite",
level = 120,
prevRank = 4,
nextRank = 5,
},
}
------------------------------------------------------------------------------
local npc = clanNpcs[getNpcName()]
if msgcontains(msg, 'help') or msgcontains(msg, 'Help') then
if getPlayerLevel(cid) < npc.level or getPlayerClanName(cid) ~= 'Wingeon' or getPlayerClanRank(cid) ~= npc.prevRank then
selfSay("I don't need your help!", cid)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) <= -1 then
selfSay("So you want to move up of rank on our clan... So, you need to bring some items to me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 1 then
selfSay("So you brought to me the items what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 2 then
selfSay("The next step is you caught a pokemon to me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 3 then
selfSay("So you caught the pokemon what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 4 then
selfSay("Now you need to do some tasks for me... Do you wanna do it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 5 then
selfSay("So you finished the first task what i asked for?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 6 then
selfSay("And now comes the last task... Do you wanna to begin it?", cid)
talkState[talkUser] = 1
return true
elseif getPlayerStorageValue(cid, 854789) == 7 then
selfSay("So you finished the last task what i asked for?", cid)
talkState[talkUser] = 1
return true
end
elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'Yes')) and talkState[talkUser] == 1 then
if getPlayerStorageValue(cid, 854789) <= -1 then
local str = "Ok then, you need bring to me: "
for a = 1, #npc.itens do
str = str..(a == #npc.itens and " and " or a ~= 1 and ", " or "{")..(npc.itens[a][2]).." "..(getItemNameById(npc.itens[a][1]))
end
str = str.."}, come back when you join those items!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 1)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 1 then
local check = checkItensForTask(cid, npc.itens)
if check == 0 then
selfSay("Ok then, you completed the mission, talk to me again when you want to continue!", cid)
setPlayerStorageValue(cid, 854789, 2)
talkState[talkUser] = 0
return true
else
selfSay(check, cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 2 then
selfSay("Ok then, you need to caught a {"..(npc.poke).."}, and bring it to me... Come back when you do that!", cid)
setPlayerStorageValue(cid, 854789, 3)
setPlayerStorageValue(cid, 854788, npc.poke)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 3 then
if getPlayerStorageValue(cid, 854788) == 'done' then
selfSay("Very well, talk to me again when you want to continue!", cid)
setPlayerStorageValue(cid, 854789, 4)
setPlayerStorageValue(cid, 854788, -1)
setPlayerStorageValue(cid, 854787, npc.poke)
talkState[talkUser] = 0
return true
else
selfSay("You didn't caught the pokemon what i asked for! Go do it!", cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 4 then
local sto = getFreeTaskStorage(cid)
local c = 0
if sto == -1 then
selfSay("You can't get more tasks! You are already with the maximum of "..(maxTasks).." tasks!", cid)
talkState[talkUser] = 0
return true
end
local str = "Ok then, now you need to kill: {"
for e, f in pairs(npc.task1) do
for a = 1, #f do
str = str..((a == #f and c ~= 0) and " and " or a ~= 1 and ", " or "")..f[a][2].." "..f[a][1]
c = c+1
end
end
str = str.."} with the {"..(npc.poke).."} which you caught!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 5)
setStorageArray(cid, sto, npc.task1)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 5 then
if isMyTaskComplete(cid, getNpcCid()) then
selfSay("Very well, you have done my first task... Talk to me again when you want to continue!", cid)
local sto = getMyTaskSto(cid, getNpcCid())
setPlayerStorageValue(cid, sto, -1)
setPlayerStorageValue(cid, 854789, 6)
talkState[talkUser] = 0
return true
else
selfSay("You didn't complete my task yet... Go end it!", cid)
talkState[talkUser] = 0
return true
end
elseif getPlayerStorageValue(cid, 854789) == 6 then
local sto = getFreeTaskStorage(cid)
local c = 0
if sto == -1 then
selfSay("You can't catch more tasks! You are already with the maximum of "..(maxTasks).." tasks!", cid)
talkState[talkUser] = 0
return true
end
local str = "Ok then, now for your last task you need to kill: {"
for e, f in pairs(npc.task2) do
for a = 1, #f do
str = str..((a == #f and c ~= 0) and " and " or a ~= 1 and ", " or "")..f[a][2].." "..f[a][1]
c = c+1
end
end
str = str.."} with the {"..(npc.poke).."} which you caught!"
selfSay(str, cid)
setPlayerStorageValue(cid, 854789, 7)
setStorageArray(cid, sto, npc.task2)
talkState[talkUser] = 0
return true
elseif getPlayerStorageValue(cid, 854789) == 7 then
if isMyTaskComplete(cid, getNpcCid()) then
---
local storages = {17000, 63215, 17001, 13008, 5700} --alterado v1.8
for s = 1, #storages do
if getPlayerStorageValue(cid, storages[s]) >= 1 then
selfSay("You can't do that while is Flying, Riding, Surfing, Diving or mount a bike!", cid)
talkState[talkUser] = 0
return true
end
end
if #getCreatureSummons(cid) >= 1 then --alterado v1.8
selfSay("Return your pokemon!", cid)
talkState[talkUser] = 0
return true
end
---
if checkPokemonForTask(cid, npc.poke) then
setPlayerClanRank(cid, npc.nextRank)
selfSay("So you complete my last task! Congradulations! Now you move up of rank and become {"..lookClans[getPlayerClanNum(cid)][getPlayerClanRank(cid)].."}!", cid)
setPlayerStorageValue(cid, 854789, -1)
setPlayerStorageValue(cid, 854787, -1)
local sto = getMyTaskSto(cid, getNpcCid())
setPlayerStorageValue(cid, sto, -1)
talkState[talkUser] = 0
return true
else
selfSay("You aren't with the "..(npc.poke).." which you caught before in your pokebag! Go get it!", cid)
talkState[talkUser] = 0
return true
end
else
selfSay("You didn't complete my task yet... Go end it!", cid)
talkState[talkUser] = 0
return true
end
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Editado Novembro 13 por waata
[1] = Volcanic [2] = Seavell [3] = Orebound [4] = Wingeon [5] = Malefic [6] = Gardestrike [7] = Psycraft [8] = Naturia [9] = Raibolt
Storage do clã: 86228
Storage do rank do clã: 862281
Pra rank 5, logicamente, o storage é 5
Vou deixar essa pra você zipster, kkk ![]()
data/actions/scripts
function onUse(cid, item, frompos, item2, topos)
local t = {
Editado Novembro 13 por zipter98
n precisa de unique ID? e a tag no actions.xml como vai ficar?
Pensei que você soubesse fazer ;/
jaja edito com a tag.
<action actionid="xxx" event="script" value="arquivo.lua"/>
Troque xxx pelo actionid da porta.
Troque arquivo pelo nome do arquivo .lua com o conteúdo que passei acima.
Editado Novembro 13 por zipter98
ah, entendi.
axei q precisava de uniqueid dentro do script da porta, foi mal haha vou testar
action id nao deu certo, n seria unique id?
Suponho que não haja muita diferença, porém, melhor prevenir do que remediar. O script em si, pelo que vi, está funcionando direitinho. É só configurar corretamente no map editor.
no lugar do [1] eu coloco [Volcanic] ?
Não. Só é necessário mexer nas coordenadas. Esse [1] é o valor da storage. Se quiser se orientar melhor sobre qual número é qual clan, siga a tabela que o Akumah postou logo acima.
Editado Novembro 14 por zipter98
entendi, axei q era pra trocar o 1 por volcanic e 5 por malefic e porai vai rsrs
Deu certo!! Rep+ ! vlwss
info
Grupo: Herói
Registrado: 25/10/12
Posts: 2.4k
Reputação: +687
Gênero: Masculino
Char no Tibia: Nuncative

Tópico movido para a seção de dúvidas e pedidos resolvidos.
info
Grupo: Herói
Registrado: 28/11/10
Posts: 3.4k
Reputação: +585
Gênero: Masculino

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.






info
Grupo: Campones
Registrado: 13/11/13
Posts: 13
Reputação: 0
Olá Xtibianos, estou precisando de uma ajudinha.
Essa eh a porta que eu uso pra outland, onde o player precisa de level 499 pra passar.
Quero fazer uma porta pra cada clan level minimo 300(ex: uma porta só seavell rank5 lv300 pode entrar, outra só raibolt rank5 lv300, etc)
-- function onUse(cid, item, frompos, item2, topos) tele = {x=915, y=627, z=8} if item.uid ==2721 then vocation = getPlayerVocation(cid) if vocation == 1 and getPlayerLevel(cid) > 499 then doTeleportThing(cid,tele) doPlayerSendTextMessage(cid,22,"Bem-vindo a Outland.") elseif vocation == 1 and getPlayerLevel(cid) > 499 then doTeleportThing(cid,tele) doPlayerSendTextMessage(cid,22,"Bem-vindo a Outland.") elseif vocation == 1 and getPlayerLevel(cid) > 499 then doTeleportThing(cid,tele) doPlayerSendTextMessage(cid,22,"Bem-vindo a Outland.") elseif vocation == 1 and getPlayerLevel(cid) > 499 then doTeleportThing(cid,tele) doPlayerSendTextMessage(cid,22,"Bem-vindo a Outland.") else doPlayerSendTextMessage(cid,22,"Você Precisa estar level 500+ para entrar") end return 0 end return 1 endvalew!
Editado Novembro 13 por waata