Ir para conteúdo
  • Cadastre-se

(Resolvido)Npc que da storage


Ir para solução Resolvido por Danihcv,

Posts Recomendados

preciso de um modelo de npc que pede 100 itens e da um storagem pro player se poder me ajudar agradeço

 

Link para o post
Compartilhar em outros sites

Explique o npc quer 100 itens? o player da e ganha um storage/

Scripter: |||||||||| 10%

 

 

Te ajudei?? REP + e ficamos quites...  ;D

 

Atenciosamente,

                   Lucas.

Abraços!

Link para o post
Compartilhar em outros sites

tipw quero que npc pessa 150  "11231" name="Major Crystalline Token"> e quando vc dar essas 150 ele ti da um storagem 4000 digamos vlw conto com sua ajuda

 

se poder fazer com ele pedindo 1500 tbm pra min ver como funciona agradeço


é isso q vc falo basicamente

Link para o post
Compartilhar em outros sites

Tenta ae amigo(modifiquei o script do viiting publicou antes em outro tópico).

 

trocar.lua

 

local id1 = 9533  --id do item a ser trocado
local stor = 34444 -- storage que o npc vai adr pelo item
local quantidade = 150 -- quantos itens player deve ter para trocar por storage 
local palavra = "trocar" --palavra chave pra falar com o npc pra trocar a storage
local mensagem = "Vc precisa de tal item para conseguir tal storage." -- a mensagem que deve ser dita se ele não tiver o item
 
 
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 playerHaveItems(cid, itemid)
local items = type(itemid) == "table" and itemid or {itemid}
for i = 1, #items do
if getPlayerItemCount(cid, items) <= 0 then
return false
end
end
return true
end
 
function doPlayerRemoveItems(cid, itemid, count)
local items = type(itemid) == "table" and itemid or {itemid}
for i = 1, #items do
doPlayerRemoveItem(cid, items, count ~= nil and count or 1)
end
return nil
end
 
function creatureSayCallback(cid, type, msg)
 
if(not npcHandler:isFocused(cid)) then
return false
end
 
if msgcontains(msg, palavra) then
if playerHaveItems(cid, {id1}) then
doPlayerRemoveItems(cid, {id1}, quantidade)
setPlayerStorageValue(cid, stor, 1)
else
selfSay(mensagem)
end
end 
return true
 
endnpcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

 

Npc

 


<?xml version="1.0" encoding="UTF-8"?>
<npc name="Osvaldo" script="trocar.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="146" head="123" body="74" legs="123" feet="0" addons="2"/>
<parameters>
<parameter key="message_greet" value="Olá,fale {trocar} para trocar items por comigo."/>
</parameters>
</npc>

 

Só modifique as falas , os nomes, os word keys a seu gosto (deixei uns comentário na parte que vc deve mecher no script) No caso o player vai trocar 1 vez tal items por tal storage e vai ter  o storage pra sempre!.

Editado por llucas75 (veja o histórico de edições)

Scripter: |||||||||| 10%

 

 

Te ajudei?? REP + e ficamos quites...  ;D

 

Atenciosamente,

                   Lucas.

Abraços!

Link para o post
Compartilhar em outros sites

Se aparecer qualquer erro da um tok que resolvo pra ti :)

Scripter: |||||||||| 10%

 

 

Te ajudei?? REP + e ficamos quites...  ;D

 

Atenciosamente,

                   Lucas.

Abraços!

Link para o post
Compartilhar em outros sites

opa amigo testei e dei esse errono distrito

[18/5/2014 21:54:25] [Error - LuaInterface::loadFile] data/npc/scripts/Commanderstone.lua:53: 'end' expected (to close 'function' at line 37) near 'endnpcHandler'
[18/5/2014 21:54:25] [Warning - NpcEvents::NpcEvents] Cannot load script: data/npc/scripts/Commanderstone.lua
[18/5/2014 21:54:25] data/npc/scripts/Commanderstone.lua:53: 'end' expected (to close 'function' at line 37) near 'endnpcHandler'

eu usei assim

 

Commanderstone.lua

local id1 = 12468  --id do item a ser trocado

local stor = 4150 -- storage que o npc vai adr pelo item
local quantidade = 150 -- quantos itens player deve ter para trocar por storage 
local palavra = "battle" --palavra chave pra falar com o npc pra trocar a storage
local mensagem = "You need to be prepared for this fight, bring more {Minor Crystalline Token}." -- a mensagem que deve ser dita se ele não tiver o item
 
 
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 playerHaveItems(cid, itemid)
local items = type(itemid) == "table" and itemid or {itemid}
for i = 1, #items do
if getPlayerItemCount(cid, items[i]) <= 0 then
return false
end
end
return true
end
 
function doPlayerRemoveItems(cid, itemid, count)
local items = type(itemid) == "table" and itemid or {itemid}
for i = 1, #items do
doPlayerRemoveItem(cid, items[i], count ~= nil and count or 1)
end
return nil
end
 
function creatureSayCallback(cid, type, msg)
 
if(not npcHandler:isFocused(cid)) then
return false
end
 
if msgcontains(msg, palavra) then
if playerHaveItems(cid, {id1}) then
doPlayerRemoveItems(cid, {id1}, quantidade)
setPlayerStorageValue(cid, stor, 1)
else
selfSay(mensagem)
end
end 
return true
 
endnpcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

 eno npc

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Commander Stone" script="Commanderstone.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="146" head="123" body="74" legs="123" feet="0" addons="2"/>
<parameters>
<parameter key="message_greet" value="Hi ,Say {join} spoke to join our army!."/>
</parameters>
</npc>
Editado por Skullphoenyx (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • Solução
local id1 = 12468  --id do item a ser trocado

local stor = 4150 -- storage que o npc vai adr pelo item
local quantidade = 150 -- quantos itens player deve ter para trocar por storage
local palavra = "battle" --palavra chave pra falar com o npc pra trocar a storage
local mensagem = "You need to be prepared for this fight, bring more {Minor Crystalline Token}." -- a mensagem que deve ser dita se ele não tiver o item
 
 
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 playerHaveItems(cid, itemid)
local items = type(itemid) == "table" and itemid or {itemid}
for i = 1, #items do
if getPlayerItemCount(cid, items[i]) <= 0 then
return false
end
end
return true
end
 
function doPlayerRemoveItems(cid, itemid, count)
local items = type(itemid) == "table" and itemid or {itemid}
for i = 1, #items do
doPlayerRemoveItem(cid, items[i], count ~= nil and count or 1)
end
return nil
end
 
function creatureSayCallback(cid, type, msg)
 
if(not npcHandler:isFocused(cid)) then
return false
end
 
if msgcontains(msg, palavra) then
if playerHaveItems(cid, {id1}) then
doPlayerRemoveItems(cid, {id1}, quantidade)
setPlayerStorageValue(cid, stor, 1)
else
selfSay(mensagem)
end
end
return true
 
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

Vê aí.

Te ajudei?? REP + e ficamos quites... <ahttp://www.tibiaking.com/forum/uploads/emoticons/default_happyy.png' alt=';D'>

Atenciosamente,

Daniel.

Abraços!

Link para o post
Compartilhar em outros sites

vlw ajudo muito

amanhã ja ti do um gostei

 

vo aproveita e pedi outro npc, um npc de task!

 

preciso de um npc que pessa pro player matar 666 demon ai depois da pessoal mata 666 demon ela ganha uma storagem e um axe ,

é pra demon oak quest vlw  essa eu do gostie por 1 semana

Link para o post
Compartilhar em outros sites

Te passo um sistema de task se vc quiser configura-lo só pra uma quest faça... (vou deixar ele todo caso vc mude de ideia, mas é bem facil de configura-lo)

 

killinginthenameof.lua

 

local questCreatures =


{
["rotworm"] = {questStarted = 1530, questStorage = 65029, creatureStorage = 15075, killsRequired = 100, raceName = "rotworm"},
["Rotworm Queen"] = {questStarted = 1530, questStorage = 65029, creatureStorage = 15076, killsRequired = 100, raceName = "rotworm"},
["Carrion Worm"] = {questStarted = 1530, questStorage = 65029, creatureStorage = 15077, killsRequired = 100, raceName = "rotworm"},
["cyclops"] = {questStarted = 1531, questStorage = 65030, creatureStorage = 15078, killsRequired = 300, raceName = "cyclops"},
["dragon"] = {questStarted = 1532, questStorage = 65031, creatureStorage = 15079, killsRequired = 500, raceName = "dragon"},
["dragon lord"] = {questStarted = 1532, questStorage = 65031, creatureStorage = 15080, killsRequired = 500, raceName = "dragon"},
["dragon lord vip"] = {questStarted = 1532, questStorage = 65031, creatureStorage = 15080, killsRequired = 500, raceName = "dragon"},
["dragon lord vip II"] = {questStarted = 1532, questStorage = 65031, creatureStorage = 15108, killsRequired = 500, raceName = "dragon"},
["vampire"] = {questStarted = 1534, questStorage = 65033, creatureStorage = 15081, killsRequired = 500, raceName = "vampire"},
["giant spider"] = {questStarted = 1535, questStorage = 65034, creatureStorage = 15082, killsRequired = 100, raceName = "giant spider"},
["behemoth"] = {questStarted = 1536, questStorage = 65035, creatureStorage = 15083, killsRequired = 550, raceName = "bsehemoth"},
["warlock"] = {questStarted = 1537, questStorage = 65036, creatureStorage = 15084, killsRequired = 1000, raceName = "warlock"},
["warlock vip"] = {questStarted = 1537, questStorage = 65036, creatureStorage = 15085, killsRequired = 1000, raceName = "warlock"},
["hydra"] = {questStarted = 1538, questStorage = 65037, creatureStorage = 15086, killsRequired = 1500, raceName = "hydra"},
["hydra vip"] = {questStarted = 1538, questStorage = 65037, creatureStorage = 15087, killsRequired = 1500, raceName = "hydra"},
["hydra vip II"] = {questStarted = 1538, questStorage = 65037, creatureStorage = 15109, killsRequired = 1500, raceName = "hydra"},
["frost dragon"] = {questStarted = 1539, questStorage = 65038, creatureStorage = 15088, killsRequired = 5000, raceName = "frost dragon"},
["frost dragon vip"] = {questStarted = 1539, questStorage = 65038, creatureStorage = 15089, killsRequired = 5000, raceName = "frost dragon"},
["frost dragon vip II"] = {questStarted = 1539, questStorage = 65038, creatureStorage = 15110, killsRequired = 5000, raceName = "frost dragon"},
["fury"] = {questStarted = 1540, questStorage = 65039, creatureStorage = 15090, killsRequired = 2000, raceName = "fury"},
["medusa"] = {questStarted = 1541, questStorage = 65040, creatureStorage = 15091, killsRequired = 3000, raceName = "medusa"},
["medusa vip"] = {questStarted = 1541, questStorage = 65040, creatureStorage = 15092, killsRequired = 3000, raceName = "medusa"},
["medusa vip II"] = {questStarted = 1541, questStorage = 65040, creatureStorage = 15111, killsRequired = 3000, raceName = "medusa"},
["ghastly dragon"] = {questStarted = 1542, questStorage = 65041, creatureStorage = 15093, killsRequired = 1500, raceName = "ghastly dragon"},
["lizard chosen"] = {questStarted = 1543, questStorage = 65042, creatureStorage = 15094, killsRequired = 1850, raceName = "lizard chosen"},
["draken warmaster"] = {questStarted = 1544, questStorage = 65043, creatureStorage = 15095, killsRequired = 4200, raceName = "draken"},
["draken spellweaver"] = {questStarted = 1544, questStorage = 65043, creatureStorage = 15096, killsRequired = 4200, raceName = "draken"},
["demon"] = {questStarted = 1545, questStorage = 65044, creatureStorage = 15097, killsRequired = 6666, raceName = "demon"},
["demon vip"] = {questStarted = 1545, questStorage = 65044, creatureStorage = 15098, killsRequired = 6666, raceName = "demon"},
["grim reaper vip II"] = {questStarted = 1546, questStorage = 65032, creatureStorage = 15112, killsRequired = 5000, raceName = "Grim reaper"},
["Grim reper"] = {questStarted = 1546, questStorage = 65032, creatureStorage = 15113, killsRequired = 5000, raceName = "Grim reaper"},
["Grim reaper vip"] = {questStarted = 1546, questStorage = 65032, creatureStorage = 15114, killsRequired = 5000, raceName = "Grim reaper"},
["Lord Of Demon"] = {questStarted = 1547, questStorage = 65053, creatureStorage = 15115, killsRequired = 6666, raceName = "lord of demon"},
["hellgorak"] = {questStarted = 1548, questStorage = 65045, creatureStorage = 15099, killsRequired = 1000, raceName = "hellgorak"},
["abominator"] = {questStarted = 1549, questStorage = 65046, creatureStorage = 15100, killsRequired = 1700, raceName = "abominator"},
["infernatil"] = {questStarted = 1550, questStorage = 65047, creatureStorage = 15101, killsRequired = 170, raceName = "Infernatil"},
["war golem"] = {questStarted = 1551, questStorage = 65048, creatureStorage = 15102, killsRequired = 2399, raceName = "war golem"},
["Apocalypse"] = {questStarted = 1552, questStorage = 65049, creatureStorage = 15103, killsRequired = 1000, raceName = "Apocalypse"},
["black sheep"] = {questStarted = 1553, questStorage = 65050, creatureStorage = 15104, killsRequired = 2199, raceName = "black sheep"},
["rift blood"] = {questStarted = 1554, questStorage = 65051, creatureStorage = 15105, killsRequired = 200, raceName = "Rift"},
["rift brood"] = {questStarted = 1554, questStorage = 65051, creatureStorage = 15106, killsRequired = 200, raceName = "Rift"},
["ajudante"] = {questStarted = 1555, questStorage = 65052, creatureStorage = 15107, killsRequired = 10, raceName = "Ajudante"}
}

local msgType = MESSAGE_STATUS_CONSOLE_ORANGE

function onKill(cid, target, lastHit)

local creature = questCreatures[getCreatureName(target):lower()]

if creature then
if isPlayer(target) then return true end

if getCreatureStorage(cid, creature.questStarted) > 0 then
if getCreatureStorage(cid, creature.questStorage) < creature.killsRequired then
if getCreatureStorage(cid, creature.questStorage) < 0 then
doCreatureSetStorage(cid, creature.questStorage, 0)
end

if getCreatureStorage(cid, creature.creatureStorage) < 0 then
doCreatureSetStorage(cid, creature.creatureStorage, 0)
end
doCreatureSetStorage(cid, creature.questStorage, getCreatureStorage(cid, creature.questStorage) + 1)
doCreatureSetStorage(cid, creature.creatureStorage, getCreatureStorage(cid, creature.creatureStorage) + 1)
doPlayerSendTextMessage(cid, msgType, getCreatureStorage(cid, creature.creatureStorage) .. " " .. getCreatureName(target) .. " defeated. Total [" .. getCreatureStorage(cid, creature.questStorage) .. "/" .. creature.killsRequired .. "] " .. creature.raceName .. ".")
end
end
end
return true
end

 

creaturescript.xml

 

    <event type="kill" name="KillingInTheNameOf" event="script" value="killinginthenameof.lua"/>

 

 

npc

 

Grizzly Adams.xml

 

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Task man" script="data/npc/scripts/killinginthenameof.lua" access="3" walkinterval="2000" lookdir="2">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="144" head="97" body="97" legs="94" feet="97" addons="3"/>
</npc>

 

killinginthenameof.lua

 

 

local stor1 = -- coloque aqui caso queira adicionar na recompensa,

local stor2 = --coloque aqui caso queira adicionar numa recompensa.

local tasks =

{
[1] = {questStarted = 1530, questStorage = 65029, killsRequired = 100, raceName = "Rotworm", rewards = {{enable = true, type = "exp", values = 100000}, {enable = true, type = "item", values = {2159,1}}}},

[2] = {questStarted = 1531, questStorage = 65030, killsRequired = 300, raceName = "cyclops", rewards = {{enable = true, type = "exp", values = 200000}, {enable = true, type = "item", values = {2159,1}}}},

[3] = {questStarted = 1532, questStorage = 65031, killsRequired = 500, raceName = "dragon", rewards = {{enable = true, type = "exp", values = 300000}, {enable = true, type = "item", values = {2159,1}}}},

[4] = {questStarted = 1534, questStorage = 65033, killsRequired = 500, raceName = "vampire", rewards = {{enable = true, type = "exp", values = 1000000}, {enable = true, type = "item", values = {2159,2}}}},

[5] = {questStarted = 1535, questStorage = 65034, killsRequired = 100, raceName = "giant spider", rewards = {{enable = true, type = "exp", values = 5000000}, {enable = true, type = "item", values = {2159,2}}}},

[6] = {questStarted = 1536, questStorage = 65035, killsRequired = 550, raceName = "behemoth", rewards = {{enable = true, type = "exp", values = 10000000}, {enable = true, type = "item", values = {2159,2}}}},

[7] = {questStarted = 1537, questStorage = 65036, killsRequired = 1000, raceName = "warlock", rewards = {{enable = true, type = "exp", values = 15000000}, {enable = true, type = "item", values = {2159,2}}}},

[8] = {questStarted = 1538, questStorage = 65037, killsRequired = 1500, raceName = "hydra", rewards = {{enable = true, type = "exp", values = 20000000}, {enable = true, type = "item", values = {2159,2}}}},

[9] = {questStarted = 1539, questStorage = 65038, killsRequired = 5000, raceName = "frost dragon", rewards = {{enable = true, type = "exp", values = 30000000}, {enable = true, type = "item", values = {2159,2}}}},

[10] = {questStarted = 1540, questStorage = 65039, killsRequired = 2000, raceName = "fury", rewards = {{enable = true, type = "exp", values = 40000000}, {enable = true, type = "item", values = {2159,2}}}},

[11] = {questStarted = 1541, questStorage = 65040, killsRequired = 3000, raceName = "medusa", rewards = {{enable = true, type = "exp", values = 50000000}, {enable = true, type = "item", values = {2159,2}}}},

[12] = {questStarted = 1542, questStorage = 65041, killsRequired = 1500, raceName = "ghastly dragon", rewards = {{enable = true, type = "exp", values = 1000000000}, {enable = true, type = "item", values = {2159,2}}}},

[13] = {questStarted = 1543, questStorage = 65042, killsRequired = 1850, raceName = "lizard chosen", rewards = {{enable = true, type = "exp", values = 130000000}, {enable = true, type = "item", values = {2159,2}}}},

[14] = {questStarted = 1544, questStorage = 65043, killsRequired = 4200, raceName = "draken", rewards = {{enable = true, type = "exp", values = 160000000}, {enable = true, type = "item", values = {2159,2}}}},

[15] = {questStarted = 1545, questStorage = 65044, killsRequired = 6666, raceName = "demon", rewards = {{enable = true, type = "exp", values = 200000000}, {enable = true, type = "item", values = {2159,4}}}},

[16] = {questStarted = 1546, questStorage = 65032, killsRequired = 5000, raceName = "Grim reaper", rewards = {{enable = true, type = "exp", values = 300000000}, {enable = true, type = "item", values = {2159,8}}}},

[17] = {questStarted = 1547, questStorage = 65053, killsRequired = 6666, raceName = "Lord of demon", rewards = {{enable = true, type = "exp", values = 350000000}, {enable = true, type = "item", values = {2159,8}}}},

[18] = {questStarted = 1548, questStorage = 65047, killsRequired = 1000, raceName = "hellgorak", rewards = {{enable = true, type = "exp", values = 400000000}, {enable = true, type = "item", values = {2159,10}}}},

[19] = {questStarted = 1549, questStorage = 65048, killsRequired = 300, raceName = "abominator", rewards = {{enable = true, type = "exp", values = 450000000}, {enable = true, type = "item", values = {2159,12}}}},

[20] = {questStarted = 1550, questStorage = 65049, killsRequired = 170, raceName = "infernatil", rewards = {{enable = true, type = "exp", values = 500000000}, {enable = true, type = "item", values = {2159,14}}}},

[21] = {questStarted = 1551, questStorage = 65050, killsRequired = 2399, raceName = "war golem", rewards = {{enable = true, type = "exp", values = 550000000}, {enable = true, type = "item", values = {2159,16}}}},

[22] = {questStarted = 1552, questStorage = 65051, killsRequired = 1000, raceName = "Apocalypse", rewards = {{enable = true, type = "exp", values = 600000000}, {enable = true, type = "item", values = {2159,18}}}},

[23] = {questStarted = 1553, questStorage = 65051, killsRequired = 2199, raceName = "black sheep", rewards = {{enable = true, type = "exp", values = 700000000}, {enable = true, type = "item", values = {2159,20}}}},

[24] = {questStarted = 1554, questStorage = 65051, killsRequired = 200, raceName = "Rift", rewards = {{enable = true, type = "exp", values = 800000000}, {enable = true, type = "item", values = {2159,20}}}},

[25] = {questStarted = 1555, questStorage = 65052, killsRequired = 10, raceName = "Ajudante", rewards = {{enable = true, type = "exp", values = 1000000000},{enable = true, type = "item", values = {2157,1}}, {enable = true, type = "item", values = {2159,30}}}},
}

local rankStorage = 32150
local storage = 64521

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
local voc = {}

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)

local s = getCreatureStorage(cid, storage)

if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_PRIVATE and 0 or cid
if msgcontains(msg, "task") then

if(s < 1) then
doCreatureSetStorage(cid, storage, 1)
s = getCreatureStorage(cid, storage)
end

if(getCreatureStorage(cid, rankStorage) < 1) then
doCreatureSetStorage(cid, rankStorage, 0)
end

if tasks then
if(getCreatureStorage(cid, tasks.questStarted) < 1) then
if(getCreatureStorage(cid, tasks.creatureStorage) < 0) then
doCreatureSetStorage(cid, tasks.creatureStorage, 0)
end

if(getCreatureStorage(cid, tasks.questStorage) < 0) then
doCreatureSetStorage(cid, tasks.questStorage, 0)
end

doCreatureSetStorage(cid, tasks.questStarted, 1)
selfSay("Voce comecou a task numero " .. getPlayerStorageValue(cid, storage) .. ", nessa task voce precisa matar " .. tasks.killsRequired .. " " .. tasks.raceName .. ".", cid)
else
selfSay("Atualmente voce esta fazendo uma task sobre " .. tasks.raceName .. ", numero da task " .. getPlayerStorageValue(cid, storage) .. ". Ou se voce terminou sua task fale {reportar} para terminar sua task!", cid)
end
else
print("[Warning - Error::Killing in the name of::Tasks config] Something is wrong.")
end

elseif msgcontains(msg, "reportar") then
if tasks and tasks.questStarted > 0 then
if(getCreatureStorage(cid, tasks.creatureStorage) < 0) then
doCreatureSetStorage(cid, tasks.creatureStorage, 0)
end

if(getCreatureStorage(cid, tasks.questStorage) < 0) then
doCreatureSetStorage(cid, tasks.questStorage, 0)
end

if(getCreatureStorage(cid, tasks.questStorage) >= tasks.killsRequired) then
for i = 1, table.maxn(tasks.rewards) do
if(tasks.rewards.enable) then
if isInArray({"boss", "teleport", 1}, tasks.rewards.type) then
doTeleportThing(cid, tasks.rewards.values)
elseif isInArray({"exp", "experience", 2}, tasks.rewards.type) then
doPlayerAddExperience(cid, tasks.rewards.values)
elseif isInArray({"item", 3}, tasks.rewards.type) then
doPlayerAddItem(cid, tasks.rewards.values[1], tasks.rewards.values[2])
elseif isInArray({"money", 4}, tasks.rewards.type) then
doPlayerAddMoney(cid, tasks.rewards.values)
elseif isInArray({"storage", "stor", 5}, tasks.rewards.type) then
doCreatureSetStorage(cid, tasks.rewards.values[1], tasks.rewards.values[2])
elseif isInArray({"points", "rank", 2}, tasks.rewards.type) then
doCreatureSetStorage(cid, rankStorage, getCreatureStorage(cid, rankStorage) + tasks.rewards.values)
else
print("[Warning - Error::Killing in the name of::Tasks config] Bad reward type: " .. tasks.rewards.type .. ", reward could not be loaded.")
end
end
end
local rank = getCreatureStorage(cid, rankStorage)
selfSay("BOAA!... voce terminou a task numero " .. s .. "" .. (rank > 4 and ", you are a " or "") .. "" .. (((rank > 4 and rank < 10) and ("Huntsman") or (rank > 9 and rank < 20) and ("Ranger") or (rank > 19 and rank < 30) and ("Big Game Hunter") or (rank > 29 and rank < 50) and ("Trophy Hunter") or (rank > 49) and ("Elite Hunter")) or "") .. ". Good job.", cid)
doCreatureSetStorage(cid, storage, s + 1)
else
selfSay("Atualmente " .. getCreatureStorage(cid, tasks.questStorage) .. " " .. tasks.raceName .. " mortos, voce precisa matar " .. tasks.killsRequired .. ".", cid)
end
else
selfSay("voce não tem nenhuma task iniciada.", cid)
end
end
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

 

Caso só queira dos demon msm exclua o resto só deixando [1] sendo a dos demons, faça msm coisa no script do creature script...

 

[25] = {questStarted = 1555, questStorage = 65052, killsRequired = 10, raceName = "Ajudante", rewards = {{enable = true, type = "exp", values = 1000000000},{enable = true, type = "item", values = {2157,1}}, {enable = true, type = "item", values = {2159,30}}}},

 

Para adicionar uma storage deixe assim enable = true, type = "stor1", values = 1 e configure o stor1 lá em cima :)...(teste e diga se esta totalmente funcional)(como testar coloque pra 1 demon )

 

A quase ia esquecendo adicione essa tag: em login.lua

registerCreatureEvent(cid, "KillingInTheNameOf")

 

e  essa tag nos monstros <event name="KillingInTheNameOf"/>(vou deixar o demon.xml de exemplo VV)

 

<?xml version="1.0" encoding="UTF-8"?>
<monster name="Demon" nameDescription="a demon" race="fire" experience="6000" speed="275" manacost="10000">
  <health now="8200" max="8200"/>
  <look type="35" corpse="5995"/>
  <targetchange interval="5000" chance="8"/>
  <strategy attack="90" defense="10"/>
  <flags>
    <flag summonable="0"/>
    <flag attackable="1"/>
    <flag hostile="1"/>
    <flag illusionable="0"/>
    <flag convinceable="0"/>
    <flag pushable="0"/>
    <flag canpushitems="1"/>
    <flag canpushcreatures="1"/>
    <flag targetdistance="1"/>
    <flag staticattack="90"/>
    <flag runonhealth="0"/>
  </flags>
  <attacks>
    <attack name="melee" interval="2000" skill="100" attack="110"/>
    <attack name="manadrain" interval="2000" chance="13" range="7" min="0" max="-120"/>
    <attack name="fire" interval="2000" chance="30" range="7" radius="7" target="1" min="-150" max="-250">
<attribute key="shootEffect" value="fire"/>
<attribute key="areaEffect" value="firearea"/>
</attack>
    <attack name="fire" interval="2000" chance="12" range="7" radius="1" target="1">
<attribute key="shootEffect" value="fire"/>
</attack>
    <attack name="lifedrain" interval="1000" chance="12" length="8" spread="0" min="-300" max="-467">
<attribute key="areaEffect" value="purpleenergy"/>
</attack>
<attack name="speed" interval="2000" chance="15" target="1" speedchange="-750" duration="30000">
<attribute key="shootEffect" value="suddendeath"/>
</attack>
<attack name="energy" interval="3000" chance="10" range="1" target="1" min="-210" max="-300">
<attribute key="areaEffect" value="purpleenergy"/>
</attack>
  </attacks>
  <defenses armor="55" defense="55">
    <defense name="healing" interval="2000" chance="15" min="130" max="240">
      <attribute key="areaEffect" value="blueshimmer"/>
    </defense>
<defense name="speed" interval="1000" chance="8" speedchange="290" duration="5000">
      <attribute key="areaEffect" value="redshimmer"/>
    </defense>
  </defenses>
<elements>
<element physicalPercent="30"/>
<element energyPercent="50"/>
<element earthPercent="20"/>
<element icePercent="-15"/>
<element holyPercent="-15"/>
<element deathPercent="20"/>
</elements>
  <immunities>
    <immunity fire="1"/>
    <immunity drown="1"/>
    <immunity paralyze="1"/>
    <immunity invisible="1"/>
  </immunities>
  <summons maxSummons="1">
    <summon name="fire elemental" interval="1000" chance="12"/>
  </summons>
  <voices interval="5000" chance="10">
    <voice sentence="MUHAHAHAHA!" yell="1"/>
    <voice sentence="I SMELL FEEEEEAAAR!" yell="1"/>
    <voice sentence="CHAMEK ATH UTHUL ARAK!" yell="1"/>
    <voice sentence="Your resistance is futile!"/>
    <voice sentence="Your soul will be mine!" yell="0"/>
  </voices>
<script>
<event name="KillingInTheNameOf"/>
</script>  
  <loot>
  <item id="2148" countmax="100" chance1="100000" chancemax="0"/>
  <item id="2148" countmax="100" chance1="100000" chancemax="0"/>
<item id="2152" countmax="3" chance1="33333" chancemax="2000"/>
  <item id="2514" chance="1900"/>
  <item id="2472" chance="200"/>
<item id="2795" countmax="6" chance1="7500"/>
  <item id="5906" countmax="1" chance="2000"/>
<item id="5954" countmax="1" chance="2345"/>
    <item id="2164" chance="2100"/>
    <item id="2176" chance="3500"/>
<item id="1982" chance="1300"/>
    <item id="2165" chance="2300"/>
<item id="7591" chance="4500"/>
  <item id="1987" chance="100000">
<inside>
<item id="2393" chance="3800"/> 
<item id="2432" chance="3800"/> 
       <item id="2112" chance="4100"/> 
<item id="2396" chance="2600"/> 
<item id="2795" countmax="6" chance1="13000"/> 
<item id="2678" countmax="3" chance1="10000" chancemax="0"/> 
<item id="2148" countmax="100" chance1="100000" chancemax="0"/> 
<item id="2151" countmax="4" chance1="5500" chancemax="0"/>
<item id="2462" chance="3200"/> 
<item id="2149" countmax="3" chance1="11000" chancemax="0"/>
<item id="2171" chance="2200"/> 
<item id="2387" chance="32000"/>
<item id="2470" chance="1350"/>
<item id="7382" chance="300"/> 
<item id="7393" chance="1700"/> 
<item id="2520" chance="3100"/> 
<item id="2418" chance="1500"/> 
<item id="2377" chance="6666"/> 
</inside>
  </item>
</loot>
</monster>

Scripter: |||||||||| 10%

 

 

Te ajudei?? REP + e ficamos quites...  ;D

 

Atenciosamente,

                   Lucas.

Abraços!

Link para o post
Compartilhar em outros sites

Se n conseguir nos comunique, e ja eh! ^^

Te ajudei?? REP + e ficamos quites... <ahttp://www.tibiaking.com/forum/uploads/emoticons/default_happyy.png' alt=';D'>

Atenciosamente,

Daniel.

Abraços!

Link para o post
Compartilhar em outros sites
  • 2 weeks later...

pow manow formatei pc hj e nao to conseguindo passa um ot q tava em mysql para sql alguem pode me ajudar ?


	accountManager = true
	namelockManager = true
	newPlayerChooseVoc = true
	newPlayerSpawnPosX = 32369	
	newPlayerSpawnPosY = 32241
	newPlayerSpawnPosZ = 7
	newPlayerTownId = 5
	newPlayerLevel = 8
	newPlayerMagicLevel = 0

	accountManager = true
	namelockManager = true
	newPlayerChooseVoc = true
	newPlayerSpawnPosX = 32369	
	newPlayerSpawnPosY = 32241
	newPlayerSpawnPosZ = 7
	newPlayerTownId = 5
	newPlayerLevel = 8
	newPlayerMagicLevel = 0
	generateAccountNumber = false
	generateAccountSalt = false

       
	useFragHandler = true
	redSkullLength =  1 * 36 * 60 * 60
	blackSkullLength =  2 * 24 * 60 * 60
	dailyFragsToRedSkull = 9
	weeklyFragsToRedSkull = 30
	monthlyFragsToRedSkull = 100
	dailyFragsToBlackSkull = 11
	weeklyFragsToBlackSkull = 40
	monthlyFragsToBlackSkull = 200
	dailyFragsToBanishment = dailyFragsToRedSkull
	weeklyFragsToBanishment = weeklyFragsToRedSkull
	monthlyFragsToBanishment = monthlyFragsToRedSkull
	blackSkulledDeathHealth = 40
	blackSkulledDeathMana = 0
	useBlackSkull = true
	advancedfragList = false

	notationsToBan = 3
	warningsToFinalBan = 4
	warningsToDeletion = 5
	banLength = 7 * 24 * 60 * 60
	killsBanLength = 7 * 24 * 60 * 60
	finalBanLength = 30 * 24 * 60 * 60
	ipBanishmentLength = 1 * 24 * 60 * 60
	broadcastBanishments = false
	maxViolationCommentSize = 200
	violationNameReportActionType = 2
	autoBanishUnknownBytes = false

	worldType = "open"
	protectionLevel = 50
	pvpTileIgnoreLevelAndVocationProtection = true
	pzLocked = 60 * 1000
	huntingDuration = 60 * 1000
	criticalHitChance = 7
	criticalHitMultiplier = 1
	displayCriticalHitNotify = true
	removeWeaponAmmunition = true
	removeWeaponCharges = true
	removeRuneCharges = true
	whiteSkullTime = 10 * 60 * 1000
	noDamageToSameLookfeet = false
	showHealingDamage = true
	showHealingDamageForMonsters = false
	fieldOwnershipDuration = 5 * 1000
	stopAttackingAtExit = false
	loginProtectionPeriod = 10 * 1000
	deathLostPercent = 7
	stairhopDelay = false
	pushCreatureDelay = 1 * 100
	deathContainerId = 1987
	gainExperienceColor = 215
	addManaSpentInPvPZone = true
	squareColor = 0
	allowFightback = true
	fistBaseAttack = 7

	worldId = 0
	ip = "192.99.34.15"
	bindOnlyGlobalAddress = false
	loginPort = 7171
	gamePort = 7172
	loginTries = 10
	retryTimeout = 5 * 1000
	loginTimeout = 60 * 1000
	maxPlayers = 1000
	motd = "Os free lembrese o Captain Bluebear leva para para gengia,kyra e ethno"
	displayOnOrOffAtCharlist = false
	onePlayerOnlinePerAccount = true
	allowClones = false
	serverName = "Tibia Avenger"
	loginMessage = "Welcome to Tibia Avenger!"
	statusTimeout = 5 * 60 * 1000
	replaceKickOnLogin = true
	forceSlowConnectionsToDisconnect = false
	loginOnlyWithLoginServer = false
	premiumPlayerSkipWaitList = false

	sqlType = "sqlite"
	sqlHost = "127.0.0.1"
	sqlPort = 3306
	sqlUser = "root"
	sqlPass = ""
	sqlDatabase = ""
	sqlFile = "schemas/sqlite.s3db"
	sqlKeepAlive = 0
	mysqlReadTimeout = 10
	mysqlWriteTimeout = 10
	encryptionType = "sha1"

	deathListEnabled = true
	deathListRequiredTime = 1 * 60 * 1000
	deathAssistCount = 19
	maxDeathRecords = 5

	ingameGuildManagement = false
	levelToFormGuild = 8
	premiumDaysToFormGuild = 0
	guildNameMinLength = 4
	guildNameMaxLength = 20

	highscoreDisplayPlayers = 15
	updateHighscoresAfterMinutes = 60

	buyableAndSellableHouses = true
	houseNeedPremium = false
	bedsRequirePremium = false
	levelToBuyHouse = 100
	housesPerAccount = 1
	houseRentAsPrice = true
	housePriceAsRent = true
	housePriceEachSquare = 8000
	houseRentPeriod = "weekly"
	houseCleanOld = 0
	guildHalls = false

	timeBetweenActions = 300
	timeBetweenExActions = 1200
	hotkeyAimbotEnabled = true

	mapName = "realmap.otbm"
	mapAuthor = "Kromys"
	randomizeTiles = true
	storeTrash = true
	cleanProtectedZones = true
	mailboxDisabledTowns = ""

	defaultPriority = "high"
	niceLevel = 5
	coresUsed = "-1"

	startupDatabaseOptimization = true
	updatePremiumStateAtStartup = true
	confirmOutdatedVersion = false

	formulaLevel = 5.0
	formulaMagic = 1.0
	bufferMutedOnSpellFailure = false
	spellNameInsteadOfWords = false
	emoteSpells = false

	allowChangeOutfit = true
	allowChangeColors = true
	allowChangeAddons = true
	disableOutfitsForPrivilegedPlayers = false
	addonsOnlyPremium = false

	dataDirectory = "data/"
	logsDirectory = "data/logs/"
	bankSystem = true
	displaySkillLevelOnAdvance = false
	promptExceptionTracerErrorBox = true
	maximumDoorLevel = 500
	maxMessageBuffer = 4

	separateVipListPerCharacter = false
	vipListDefaultLimit = 20
	vipListDefaultPremiumLimit = 100

	saveGlobalStorage = true
	useHouseDataStorage = false
	storePlayerDirection = false

	checkCorpseOwner = true
	monsterLootMessage = 3
	monsterLootMessageType = 25

	ghostModeInvisibleEffect = true
	ghostModeSpellEffects = true

	idleWarningTime = 14 * 60 * 1000
	idleKickTime = 15 * 60 * 1000
	reportsExpirationAfterReads = 1
	playerQueryDeepness = 2
	tileLimit = 0
	protectionTileLimit = 0
	houseTileLimit = 0

	freePremium = true
	premiumForPromotion = true

    blessings = true                                                                 
    blessingOnlyPremium = false
    blessingReductionBase = 100
    blessingReductionDecrement = 5
    eachBlessReduction = 20  

	experienceStages = true
	rateExperience = 30.0
	rateExperienceFromPlayers = 0
	rateSkill = 15.0
	rateMagic = 7.0
	rateLoot = 4.0
	rateSpawn = 2

	rateMonsterHealth = 1.0
	rateMonsterMana = 1.0
	rateMonsterAttack = 1.0
	rateMonsterDefense = 1.0

	minLevelThresholdForKilledPlayer = 0.9
	maxLevelThresholdForKilledPlayer = 1.2

	rateStaminaLoss = 1
	rateStaminaGain = 3
	rateStaminaThresholdGain = 12
	staminaRatingLimitTop = 40 * 60
	staminaRatingLimitBottom = 14 * 60
	staminaLootLimit = 14 * 60
	rateStaminaAboveNormal = 1.5
	rateStaminaUnderNormal = 0.5
	staminaThresholdOnlyPremium = true

	experienceShareRadiusX = 30
	experienceShareRadiusY = 30
	experienceShareRadiusZ = 1
	experienceShareLevelDifference = 2 / 3
	extraPartyExperienceLimit = 20
	extraPartyExperiencePercent = 5
	experienceShareActivity = 2 * 60 * 1000

	globalSaveEnabled = false
	globalSaveHour = 5
	globalSaveMinute = 0
	shutdownAtGlobalSave = true
	cleanMapAtGlobalSave = false

	deSpawnRange = 2
	deSpawnRadius = 50

	maxPlayerSummons = 2
	teleportAllSummons = false
	teleportPlayerSummons = false

	statusPort = 7171
	ownerName = ""
	ownerEmail = "@otland.net"
	url = "http://otland.net/"
	location = "Europe"
	displayGamemastersWithOnlineCommand = false

	displayPlayersLogging = true
	prefixChannelLogs = ""
	runFile = ""
	outputLog = ""
	truncateLogOnStartup = false

	managerPort = 7171
	managerLogs = true
	managerPassword = ""
	managerLocalhostOnly = true
	managerConnectionsLimit = 1

	adminPort = 7171
	adminLogs = true
	adminPassword = ""
	adminLocalhostOnly = true
	adminConnectionsLimit = 1
	adminRequireLogin = true
	adminEncryption = ""
	adminEncryptionData = ""

Editado por Skullphoenyx (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Erros na distro ao abrir?

Scripter: |||||||||| 10%

 

 

Te ajudei?? REP + e ficamos quites...  ;D

 

Atenciosamente,

                   Lucas.

Abraços!

Link para o post
Compartilhar em outros sites

é so apertar print scrn (esta acima de insert e do lado de f12  e scroll lock) cole no paint e mande o erro em imagem anexada pelo tk msm :). estou no aguardo...

Scripter: |||||||||| 10%

 

 

Te ajudei?? REP + e ficamos quites...  ;D

 

Atenciosamente,

                   Lucas.

Abraços!

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo