jlskelin
New Member
- Joined
- Mar 28, 2009
- Messages
- 198
- Reaction score
- 1
Hello i have a npc daily quest i want him to give point to you account not item i use znote aac.What do i need to change in the script sorry im still learning
Lua:
local daily1 = { --1-2000
{["name"] = "Dragon", ["storage"] = 5, ["count"] = 50, ["exp"] = 2000, ["item"] = 9971, ["icount"] = 1, ["chance"] = 100},
{["name"] = "Demon", ["storage"] = 6, ["count"] = 100, ["exp"] = 3000, ["item"] = 9971, ["icount"] = 1, ["chance"] = 100},
{["name"] = "Ferumbras", ["storage"] = 7, ["count"] = 125, ["exp"] = 3000, ["item"] =9971, ["icount"] = 1, ["chance"] = 100}
}
local daily2 = { --2001-10000
{["name"] = "Evul Frog", ["storage"] = 10, ["count"] = 150, ["exp"] = 75000, ["item"] = 9971, ["icount"] = 5,["chance"] = 100},
{["name"] = "Headcutter", ["storage"] = 11, ["count"] = 175, ["exp"] = 95000, ["item"] = 9971, ["icount"] = 5,["chance"] = 100},
{["name"] = "Deadeye Devinous", ["storage"] = 12, ["count"] = 190, ["exp"] = 95000, ["item"] = 9971, ["icount"] = 5, ["chance"] = 100}
}
local daily3 = { --10k-30k
{["name"] = "Betrayed Wraith", ["storage"] = 17, ["count"] = 200, ["exp"] = 350000, ["item"] = 9971, ["icount"] = 10,["chance"] = 100},
{["name"] = "Mind Freak",["storage"] = 18, ["count"] = 275, ["exp"] = 350000, ["item"] = 9971, ["icount"] = 10,["chance"] = 100},
{["name"] = "Egyptian Mummy", ["storage"] = 19, ["count"] = 300, ["exp"] = 650000, ["item"] = 9971, ["icount"] = 10, ["chance"] = 100}
}
local daily4 = { --30k-60k
{["name"] = "Shorty ", ["storage"] = 22, ["count"] = 350, ["exp"] = 550000, ["item"] = 9971, ["icount"] = 20,["chance"] = 100},
{["name"] = "Strong Freak", ["storage"] = 23, ["count"] = 375, ["exp"] = 650000, ["item"] = 9971, ["icount"] = 20,["chance"] = 100},
{["name"] = "King Kong", ["storage"] = 24, ["count"] = 400, ["exp"] = 650000, ["item"] = 9971, ["icount"] = 20, ["chance"] = 100}
}
local daily5 = { --60k-90k
{["name"] = "Dark Sorcerer", ["storage"] = 26, ["count"] = 450, ["exp"] = 1100000, ["item"] = 9971, ["icount"] = 30,["chance"] = 100},
{["name"] = "Medusa", ["storage"] = 27, ["count"] = 475, ["exp"] = 1500000, ["item"] = 9971, ["icount"] = 30,["chance"] = 100},
{["name"] = "Flamingo", ["storage"] = 28, ["count"] = 525, ["exp"] = 1500000, ["item"] = 9971, ["icount"] = 30, ["chance"] = 100}
}
local daily6 = { --90k-120k
{["name"] = "Warwick", ["storage"] = 30, ["count"] = 700, ["exp"] = 2000000, ["item"] = 9971, ["icount"] = 40, ["chance"] = 100},
--{["name"] = "Akatsuki Memember", ["storage"] = 31, ["count"] = 40, ["exp"] = 3000000, ["item"] = 9971, ["icount"] = 6, ["chance"] = 73}
}
local daily7 = { --120k-150k
{["name"] = "Bat Digga", ["storage"] = 34, ["count"] = 5, ["exp"] = 6000000, ["item"] = 9971, ["icount"] = 10, ["chance"] = 100},
{["name"] = "Sacred Ratzor", ["storage"] = 35, ["count"] = 5, ["exp"] = 4000000, ["item"] = 9970, ["icount"] = 5, ["chance"] = 100}
}
local daily8 = { --150k-170k
{["name"] = "The Mighty Lord", ["storage"] = 38, ["count"] = 10, ["exp"] = 8000000, ["item"] = 9971, ["icount"] = 12, ["chance"] = 100},
{["name"] = "Dark Kriminal", ["storage"] = 39, ["count"] = 10, ["exp"] = 7000000, ["item"] = 9970, ["icount"] = 8, ["chance"] = 100}
}
local daily11 = { --170k-190k
{["name"] = "Macruffin", ["storage"] = 61, ["count"] = 15, ["exp"] = 8000000, ["item"] = 9971, ["icount"] = 15, ["chance"] = 100},
{["name"] = "King Scorpion", ["storage"] = 62, ["count"] = 20, ["exp"] = 8500000, ["item"] = 9970, ["icount"] = 10, ["chance"] = 100}
}
local daily9 = { --190k-200k
{["name"] = "Bones Breaker", ["storage"] = 41, ["count"] = 20, ["exp"] = 9000000, ["item"] = 9971, ["icount"] = 20, ["chance"] = 100},
{["name"] = "Ghost Rider", ["storage"] = 42, ["count"] = 20, ["exp"] = 11000000, ["item"] = 9970, ["icount"] = 12, ["chance"] = 100}
}
local daily10 = { --200kl +
{["name"] = "Frozen Druid", ["storage"] = 46, ["count"] = 25, ["exp"] = 13000000, ["item"] = 9971, ["icount"] = 25, ["chance"] = 100},
{["name"] = "Metallica", ["storage"] = 47, ["count"] = 25, ["exp"] = 15000000, ["item"] = 9970, ["icount"] = 15, ["chance"] = 100}
--{["name"] = "Bug", ["storage"] = 52, ["count"] = 100, ["exp"] = 10000000, ["item"] = 1691, ["icount"] = 1, ["chance"] = 100}
}
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
--Branie Daily
if(msgcontains(msg, 'mission') or msgcontains(msg, 'daily')) then
if getPlayerStorageValue(cid,2423) <= 1 then
if getPlayerLevel(cid) <= 2000 then
rand = math.random(1, #daily1)
for i = 1, #daily1 do
if rand == i then
selfSay('Your mission today is to kill ' .. daily1[i].count .. ' ' .. daily1[i].name .. '\'s. Come back when you are done.', cid)
setPlayerStorageValue(cid,2423,daily1[i].storage)
setPlayerStorageValue(cid,2425,0)
talkState[talkUser] = 0
end
end
elseif getPlayerLevel(cid) > 2000 and getPlayerLevel(cid) <= 10000 then
rand = math.random(1, #daily2)
for i = 1, #daily2 do
if rand == i then
selfSay('Your mission today is to kill ' .. daily2[i].count .. ' ' .. daily2[i].name .. '\'s. Come back when you are done.', cid)
setPlayerStorageValue(cid,2423,daily2[i].storage)
setPlayerStorageValue(cid,2425,0)
talkState[talkUser] = 0
end
end
elseif getPlayerLevel(cid) > 10000 and getPlayerLevel(cid) <= 30000 then
rand = math.random(1, #daily3)
for i = 1, #daily3 do
if rand == i then
selfSay('Your mission today is to kill ' .. daily3[i].count .. ' ' .. daily3[i].name .. '\'s. Come back when you are done.', cid)
setPlayerStorageValue(cid,2423,daily3[i].storage)
setPlayerStorageValue(cid,2425,0)
talkState[talkUser] = 0
end
end
elseif getPlayerLevel(cid) > 30000 and getPlayerLevel(cid) <= 60000 then
rand = math.random(1, #daily4)
for i = 1, #daily4 do
if rand == i then
selfSay('Your mission today is to kill ' .. daily4[i].count .. ' ' .. daily4[i].name .. '\'s. Come back when you are done.', cid)
setPlayerStorageValue(cid,2423,daily4[i].storage)
setPlayerStorageValue(cid,2425,0)
talkState[talkUser] = 0
end
end
elseif getPlayerLevel(cid) > 60000 and getPlayerLevel(cid) <= 90000 then
rand = math.random(1, #daily5)
for i = 1, #daily5 do
if rand == i then
selfSay('Your mission today is to kill ' .. daily5[i].count .. ' ' .. daily5[i].name .. '\'s. Come back when you are done.', cid)
setPlayerStorageValue(cid,2423,daily5[i].storage)
setPlayerStorageValue(cid,2425,0)
talkState[talkUser] = 0
end
end
elseif getPlayerLevel(cid) > 90000 and getPlayerLevel(cid) <= 120000 then
rand = math.random(1, #daily6)
for i = 1, #daily6 do
if rand == i then
selfSay('Your mission today is to kill ' .. daily6[i].count .. ' ' .. daily6[i].name .. '\'s. Come back when you are done.', cid)
setPlayerStorageValue(cid,2423,daily6[i].storage)
setPlayerStorageValue(cid,2425,0)
talkState[talkUser] = 0
end
end
elseif getPlayerLevel(cid) > 120000 and getPlayerLevel(cid) <= 150000 then
rand = math.random(1, #daily7)
for i = 1, #daily7 do
if rand == i then
selfSay('Your mission today is to kill ' .. daily7[i].count .. ' ' .. daily7[i].name .. '\'s. Come back when you are done.', cid)
setPlayerStorageValue(cid,2423,daily7[i].storage)
setPlayerStorageValue(cid,2425,0)
talkState[talkUser] = 0
end
end
elseif getPlayerLevel(cid) > 150000 and getPlayerLevel(cid) <= 170000 then
rand = math.random(1, #daily8)
for i = 1, #daily8 do
if rand == i then
selfSay('Your mission today is to kill ' .. daily8[i].count .. ' ' .. daily8[i].name .. '\'s. Come back when you are done.', cid)
setPlayerStorageValue(cid,2423,daily8[i].storage)
setPlayerStorageValue(cid,2425,0)
talkState[talkUser] = 0
end
end
elseif getPlayerLevel(cid) > 170000 and getPlayerLevel(cid) <= 190000 then
rand = math.random(1, #daily11)
for i = 1, #daily11 do
if rand == i then
selfSay('Your mission today is to kill ' .. daily11[i].count .. ' ' .. daily11[i].name .. '\'s. Come back when you are done.', cid)
setPlayerStorageValue(cid,2423,daily11[i].storage)
setPlayerStorageValue(cid,2425,0)
talkState[talkUser] = 0
end
end
elseif getPlayerLevel(cid) > 190000 and getPlayerLevel(cid) <= 200000 then
rand = math.random(1, #daily9)
for i = 1, #daily9 do
if rand == i then
selfSay('Your mission today is to kill ' .. daily9[i].count .. ' ' .. daily9[i].name .. '\'s. Come back when you are done.', cid)
setPlayerStorageValue(cid,2423,daily9[i].storage)
setPlayerStorageValue(cid,2425,0)
talkState[talkUser] = 0
end
end
elseif getPlayerLevel(cid) > 200000 then
rand = math.random(1, #daily10)
for i = 1, #daily10 do
if rand == i then
selfSay('Your mission today is to kill ' .. daily10[i].count .. 'x ' .. daily10[i].name .. '\'s. Come back when you are done.', cid)
setPlayerStorageValue(cid,2423,daily10[i].storage)
setPlayerStorageValue(cid,2425,0)
talkState[talkUser] = 0
end
end
end
end
if getPlayerStorageValue(cid,2423) == 100 then
selfSay('You have completed todays mission! Come back tomorrow for another mission!', cid)
talkState[talkUser] = 0
end
--Oddanie Daily Questa
for i = 1, #daily1 do
if getPlayerStorageValue(cid,2423) == daily1[i].storage then
if getPlayerStorageValue(cid,2425) >= daily1[i].count then
selfSay('Excellent! You have completed todays mission.', cid)
doPlayerAddExp(cid,daily1[i].exp)
setPlayerStorageValue(cid,2423,100)
if math.random(1,100) <= daily1[i].chance then
doPlayerAddItem(cid,daily1[i].item,daily1[i].icount)
end
talkState[talkUser] = 0
else
selfSay('You havent killed enough ' .. daily1[i].name .. '\'s.', cid)
talkState[talkUser] = 0
end
end
end
for i = 1, #daily2 do
if getPlayerStorageValue(cid,2423) == daily2[i].storage then
if getPlayerStorageValue(cid,2425) >= daily2[i].count then
selfSay('Excellent! You have completed todays mission.', cid)
doPlayerAddExp(cid,daily2[i].exp)
setPlayerStorageValue(cid,2423,100)
if math.random(1,100) <= daily2[i].chance then
doPlayerAddItem(cid,daily2[i].item,daily2[i].icount)
end
talkState[talkUser] = 0
else
selfSay('You havent killed enough ' .. daily2[i].name .. '\'s.', cid)
talkState[talkUser] = 0
end
end
end
for i = 1, #daily3 do
if getPlayerStorageValue(cid,2423) == daily3[i].storage then
if getPlayerStorageValue(cid,2425) >= daily3[i].count then
selfSay('Excellent! You have completed todays mission.', cid)
doPlayerAddExp(cid,daily3[i].exp)
setPlayerStorageValue(cid,2423,100)
if math.random(1,100) <= daily3[i].chance then
doPlayerAddItem(cid,daily3[i].item,daily3[i].icount)
end
talkState[talkUser] = 0
else
selfSay('You havent killed enough ' .. daily3[i].name .. '\'s.', cid)
talkState[talkUser] = 0
end
end
end
for i = 1, #daily4 do
if getPlayerStorageValue(cid,2423) == daily4[i].storage then
if getPlayerStorageValue(cid,2425) >= daily4[i].count then
selfSay('Excellent! You have completed todays mission.', cid)
doPlayerAddExp(cid,daily4[i].exp)
setPlayerStorageValue(cid,2423,100)
if math.random(1,100) <= daily4[i].chance then
doPlayerAddItem(cid,daily4[i].item,daily4[i].icount)
end
talkState[talkUser] = 0
else
selfSay('You havent killed enough ' .. daily4[i].name .. '\'s.', cid)
talkState[talkUser] = 0
end
end
end
for i = 1, #daily5 do
if getPlayerStorageValue(cid,2423) == daily5[i].storage then
if getPlayerStorageValue(cid,2425) >= daily5[i].count then
selfSay('Excellent! You completed todays mission.', cid)
doPlayerAddExp(cid,daily5[i].exp)
setPlayerStorageValue(cid,2423,100)
if math.random(1,100) <= daily5[i].chance then
doPlayerAddItem(cid,daily5[i].item,daily5[i].icount)
end
talkState[talkUser] = 0
else
selfSay('You havent killed enough ' .. daily5[i].name .. '\'s.', cid)
talkState[talkUser] = 0
end
end
end
for i = 1, #daily6 do
if getPlayerStorageValue(cid,2423) == daily6[i].storage then
if getPlayerStorageValue(cid,2425) >= daily6[i].count then
selfSay('Excellent! You have completed todays mission.', cid)
doPlayerAddExp(cid,daily6[i].exp)
setPlayerStorageValue(cid,2423,100)
if math.random(1,100) <= daily6[i].chance then
doPlayerAddItem(cid,daily6[i].item,daily6[i].icount)
end
talkState[talkUser] = 0
else
selfSay('You havent killed enough ' .. daily6[i].name .. '\'s.', cid)
talkState[talkUser] = 0
end
end
end
for i = 1, #daily7 do
if getPlayerStorageValue(cid,2423) == daily7[i].storage then
if getPlayerStorageValue(cid,2425) >= daily7[i].count then
selfSay('Excellent! You have completed todays mission.', cid)
doPlayerAddExp(cid,daily7[i].exp)
setPlayerStorageValue(cid,2423,100)
if math.random(1,100) <= daily7[i].chance then
doPlayerAddItem(cid,daily7[i].item,daily7[i].icount)
end
talkState[talkUser] = 0
else
selfSay('You havent killed enough ' .. daily7[i].name .. '\'s.', cid)
talkState[talkUser] = 0
end
end
end
for i = 1, #daily8 do
if getPlayerStorageValue(cid,2423) == daily8[i].storage then
if getPlayerStorageValue(cid,2425) >= daily8[i].count then
selfSay('Excellent! You have completed todays mission.', cid)
doPlayerAddExp(cid,daily8[i].exp)
setPlayerStorageValue(cid,2423,100)
if math.random(1,100) <= daily8[i].chance then
doPlayerAddItem(cid,daily8[i].item,daily8[i].icount)
end
talkState[talkUser] = 0
else
selfSay('You havent killed enough ' .. daily8[i].name .. '\'s.', cid)
talkState[talkUser] = 0
end
end
end
for i = 1, #daily9 do
if getPlayerStorageValue(cid,2423) == daily9[i].storage then
if getPlayerStorageValue(cid,2425) >= daily9[i].count then
selfSay('Excellent! You have completed todays mission.', cid)
doPlayerAddExp(cid,daily9[i].exp)
setPlayerStorageValue(cid,2423,100)
if math.random(1,100) <= daily9[i].chance then
doPlayerAddItem(cid,daily9[i].item,daily9[i].icount)
end
talkState[talkUser] = 0
else
selfSay('You havent killed enough ' .. daily9[i].name .. '\'s.', cid)
talkState[talkUser] = 0
end
end
end
for i = 1, #daily10 do
if getPlayerStorageValue(cid,2423) == daily10[i].storage then
if getPlayerStorageValue(cid,2425) >= daily10[i].count then
selfSay('Excellent! You have completed todays mission.', cid)
doPlayerAddExp(cid,daily10[i].exp)
setPlayerStorageValue(cid,2423,100)
if math.random(1,100) <= daily10[i].chance then
doPlayerAddItem(cid,daily10[i].item,daily10[i].icount)
end
talkState[talkUser] = 0
else
selfSay('You havent killed enough ' .. daily10[i].name .. '\'s.', cid)
talkState[talkUser] = 0
end
end
end
for i = 1, #daily11 do
if getPlayerStorageValue(cid,2423) == daily11[i].storage then
if getPlayerStorageValue(cid,2425) >= daily11[i].count then
selfSay('Excellent! You have completed todays mission.', cid)
doPlayerAddExp(cid,daily11[i].exp)
setPlayerStorageValue(cid,2423,100)
if math.random(1,100) <= daily11[i].chance then
doPlayerAddItem(cid,daily11[i].item,daily11[i].icount)
end
talkState[talkUser] = 0
else
selfSay('You havent killed enough ' .. daily11[i].name .. '\'s.', cid)
talkState[talkUser] = 0
end
end
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())