Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- THESNAPPER_POSITION = {x=2482, y=1196, z=10}
- HIDE_POSITION = {x=1009, y=797, z=8}
- THEBLOODTUSK_POSITION = {x=1144, y=676, z=5}
- SHARDHEAD_POSITION = {x=1058, y=576, z=5}
- THUL_POSITION = {x=843, y=872, z=8}
- ESMERALDA_POSITION = {x=1027, y=748, z=11}
- THEOLDWIDOW_POSITION = {x=1048, y=746, z=3}
- THEMANY_POSITION = {x=1116, y=980, z=4}
- LEVIATHAN_POSITION = {x=851, y=866, z=9}
- STONECRACKER_POSITION = {x=1066, y=790, z=14}
- THENOXIUSSPAWN_POSITION = {x=1050, y=905, z=10}
- MERIKHTHESLAUGHTERER_POSITION = {x=1208, y=795, z=2}
- FAHIMTHEWISE_POSITION = {x=1209, y=837, z=2}
- RANDOMPIRATEBOSS_POSITION = {{x=1134, y=889, z=5} or {x=1134, y=881, z=5} or {x=1152, y=881, z=5} or {x=1152, y=889, z=5}}
- THEHORNEDFOX_POSITION = {x=1244, y=904, z=5}
- NECROPHARUS_POSITION = {x=819, y=977, z=8}
- local tasks =
- {
- [1] = {questStarted = 1510, questStorage = 65000, killsRequired = 100, raceName = "Trolls", rewards = {{enable = true, type = "exp", values = 20000}, {enable = true, type = "money", values = 2000}}},
- [2] = {questStarted = 1511, questStorage = 65001, killsRequired = 150, raceName = "Goblins", rewards = {{enable = true, type = "exp", values = 30000}, {enable = true, type = "money", values = 2500}}},
- [3] = {questStarted = 1512, questStorage = 65002, killsRequired = 300, raceName = "Rotworms", rewards = {{enable = true, type = "exp", values = 40000}, {enable = true, type = "money", values = 4000}}},
- [4] = {questStarted = 1513, questStorage = 65003, killsRequired = 500, raceName = "Cyclops", rewards = {{enable = true, type = "exp", values = 50000}, {enable = true, type = "money", values = 8000}}},
- [5] = {questStarted = 1514, questStorage = 65004, killsRequired = 300, raceName = "Crocodiles", rewards = {{enable = true, type = "exp", values = 60000}, {enable = true, type = "boss", values = THESNAPPER_POSITION}, {enable = true, type = "points", values = 2}}},
- [6] = {questStarted = 1515, questStorage = 65005, killsRequired = 300, raceName = "Tarantulas", rewards = {{enable = true, type = "money", values = 15000}, {enable = true, type = "boss", values = HIDE_POSITION}, {enable = true, type = "points", values = 2}}},
- [7] = {questStarted = 1516, questStorage = 65006, killsRequired = 150, raceName = "Carniphilas", rewards = {{enable = true, type = "exp", values = 70000}, {enable = true, type = "points", values = 1}}},
- [8] = {questStarted = 1517, questStorage = 65007, killsRequired = 200, raceName = "Stone Golems", rewards = {{enable = true, type = "exp", values = 80000}, {enable = true, type = "points", values = 1}}},
- [9] = {questStarted = 1518, questStorage = 65008, killsRequired = 300, raceName = "Mammoths", rewards = {{enable = true, type = "exp", values = 90000}, {enable = true, type = "boss", values = THEBLOODTUSK_POSITION}, {enable = true, type = "points", values = 2}}},
- [10] = {questStarted = 1519, questStorage = 65009, killsRequired = 300, raceName = "Ice Golems", rewards = {{enable = true, type = "exp", values = 100000}, {enable = true, type = "boss", values = SHARDHEAD_POSITION}, {enable = true, type = "points", values = 2}}},
- [11] = {questStarted = 1520, questStorage = 65010, killsRequired = 300, raceName = "Quaras Scout", rewards = {{enable = true, type = "exp", values = 200000}, {enable = true, type = "points", values = 1}}},
- [12] = {questStarted = 1521, questStorage = 65011, killsRequired = 300, raceName = "Quaras", rewards = {{enable = true, type = "exp", values = 300000}, {enable = true, type = "boss", values = THUL_POSITION}, {enable = true, type = "points", values = 2}}},
- [13] = {questStarted = 1522, questStorage = 65012, killsRequired = 70, raceName = "Water Elementals", rewards = {{enable = true, type = "exp", values = 400000}, {enable = true, type = "points", values = 1}}},
- [14] = {questStarted = 1523, questStorage = 65013, killsRequired = 70, raceName = "Earth Elementals", rewards = {{enable = true, type = "exp", values = 500000}, {enable = true, type = "points", values = 1}}},
- [15] = {questStarted = 1524, questStorage = 65014, killsRequired = 70, raceName = "Energy Elementals", rewards = {{enable = true, type = "exp", values = 600000}, {enable = true, type = "points", values = 1}}},
- [16] = {questStarted = 1525, questStorage = 65015, killsRequired = 70, raceName = "Fire Elementals", rewards = {{enable = true, type = "exp", values = 700000}, {enable = true, type = "points", values = 1}}},
- [17] = {questStarted = 1526, questStorage = 65016, killsRequired = 200, raceName = "Mutated Rats", rewards = {{enable = true, type = "exp", values = 800000}, {enable = true, type = "boss", values = ESMERALDA_POSITION}, {enable = true, type = "points", values = 2}}},
- [18] = {questStarted = 1527, questStorage = 65017, killsRequired = 500, raceName = "Giant Spiders", rewards = {{enable = true, type = "exp", values = 900000}, {enable = true, type = "boss", values = THEOLDWIDOW_POSITION}, {enable = true, type = "points", values = 2}}},
- [19] = {questStarted = 1528, questStorage = 65018, killsRequired = 1000, raceName = "Hydras", rewards = {{enable = true, type = "boss", values = THEMANY_POSITION}, {enable = true, type = "points", values = 4}}},
- [20] = {questStarted = 1529, questStorage = 65019, killsRequired = 500, raceName = "Sea Serpents", rewards = {{enable = true, type = "boss", values = LEVIATHAN_POSITION}, {enable = true, type = "points", values = 4}}},
- [21] = {questStarted = 1530, questStorage = 65020, killsRequired = 500, raceName = "Behemoths", rewards = {{enable = true, type = "boss", values = STONECRACKER_POSITION}, {enable = true, type = "points", values = 4}}},
- [22] = {questStarted = 1531, questStorage = 65021, killsRequired = 500, raceName = "Serpents Spawn", rewards = {{enable = true, type = "teleport", values = THENOXIUSSPAWN_POSITION}, {enable = true, type = "points", values = 4}}},
- [23] = {questStarted = 1532, questStorage = 65022, killsRequired = 250, raceName = "Green Djinns", rewards = {{enable = true, type = "exp", values = 1000000}, {enable = true, type = "money", values = 5000}, {enable = true, type = "boss", values = MERIKHTHESLAUGHTERER_POSITION}}},
- [24] = {questStarted = 1533, questStorage = 65023, killsRequired = 250, raceName = "Blue Djinns", rewards = {{enable = true, type = "exp", values = 2000000}, {enable = true, type = "money", values = 5000}, {enable = true, type = "boss", values = FAHIMTHEWISE_POSITION}}},
- [25] = {questStarted = 1534, questStorage = 65024, killsRequired = 1500, raceName = "Pirates", rewards = {{enable = true, type = "exp", values = 3000000}, {enable = true, type = "money", values = 5000000}, {enable = true, type = "boss", values = RANDOMPIRATEBOSS_POSITION}}},
- [26] = {questStarted = 1535, questStorage = 65025, killsRequired = 1500, raceName = "Pirates", rewards = {{enable = true, type = "exp", values = 4000000}, {enable = true, type = "money", values = 5000000}}},
- [27] = {questStarted = 1536, questStorage = 65026, killsRequired = 5000, raceName = "Minotaurs", rewards = {{enable = true, type = "boss", values = THEHORNEDFOX_POSITION}}},
- [28] = {questStarted = 1537, questStorage = 65027, killsRequired = 200, raceName = "Magicians", rewards = {{enable = true, type = "boss", values = NECROPHARUS_POSITION}}},
- [29] = {questStarted = 1538, questStorage = 65028, killsRequired = 500, raceName = "Magicians", rewards = {{enable = true, type = "exp", values = 5000000}}},
- [30] = {questStarted = 1539, questStorage = 65029, killsRequired = 6666, raceName = "Demons", rewards = {{enable = true, type = "storage", values = {65535, 1}}}}
- }
- 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 = getPlayerStorageValue(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
- setPlayerStorageValue(cid, storage, 1)
- s = getPlayerStorageValue(cid, storage)
- end
- if(getPlayerStorageValue(cid, rankStorage) < 1) then
- setPlayerStorageValue(cid, rankStorage, 0)
- end
- if tasks[s] then
- if(getPlayerStorageValue(cid, tasks[s].questStarted) < 1) then
- if(getPlayerStorageValue(cid, tasks[s].creatureStorage) < 0) then
- setPlayerStorageValue(cid, tasks[s].creatureStorage, 0)
- end
- if(getPlayerStorageValue(cid, tasks[s].questStorage) < 0) then
- setPlayerStorageValue(cid, tasks[s].questStorage, 0)
- end
- setPlayerStorageValue(cid, tasks[s].questStarted, 1)
- selfSay("You have started the task number " .. getPlayerStorageValue(cid, storage) .. ", in this task you need to kill " .. tasks[s].killsRequired .. " " .. tasks[s].raceName .. ".", cid)
- else
- selfSay("You are currently making the task about " .. tasks[s].raceName .. ", task number " .. getPlayerStorageValue(cid, storage) .. ".", cid)
- end
- else
- print("[Warning - Error::Killing in the name of::Tasks config] Something is wrong.")
- end
- elseif msgcontains(msg, "report") then
- if tasks[s] and tasks[s].questStarted > 0 then
- if(getPlayerStorageValue(cid, tasks[s].creatureStorage) < 0) then
- setPlayerStorageValue(cid, tasks[s].creatureStorage, 0)
- end
- if(getPlayerStorageValue(cid, tasks[s].questStorage) < 0) then
- setPlayerStorageValue(cid, tasks[s].questStorage, 0)
- end
- if(getPlayerStorageValue(cid, tasks[s].questStorage) >= tasks[s].killsRequired) then
- for i = 1, table.maxn(tasks[s].rewards) do
- if(tasks[s].rewards[i].enable) then
- if isInArray({"boss", "teleport", 1}, tasks[s].rewards[i].type) then
- doTeleportThing(cid, tasks[s].rewards[i].values)
- elseif isInArray({"exp", "experience", 2}, tasks[s].rewards[i].type) then
- doPlayerAddExperience(cid, tasks[s].rewards[i].values)
- elseif isInArray({"item", 3}, tasks[s].rewards[i].type) then
- doPlayerAddItem(cid, tasks[s].rewards[i].values[1], tasks[s].rewards[i].values[2])
- elseif isInArray({"money", 4}, tasks[s].rewards[i].type) then
- doPlayerAddMoney(cid, tasks[s].rewards[i].values)
- elseif isInArray({"storage", "stor", 5}, tasks[s].rewards[i].type) then
- setPlayerStorageValue(cid, tasks[s].rewards[i].values[1], tasks[s].rewards[i].values[2])
- elseif isInArray({"points", "rank", 2}, tasks[s].rewards[i].type) then
- setPlayerStorageValue(cid, rankStorage, getPlayerStorageValue(cid, rankStorage) + tasks[s].rewards[i].values)
- else
- print("[Warning - Error::Killing in the name of::Tasks config] Bad reward type: " .. tasks[s].rewards[i].type .. ", reward could not be loaded.")
- end
- end
- end
- local rank = getPlayerStorageValue(cid, rankStorage)
- selfSay("Great!... you have finished the task number " .. 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)
- setPlayerStorageValue(cid, storage, s + 1)
- else
- selfSay("Current " .. getPlayerStorageValue(cid, tasks[s].questStorage) .. " " .. tasks[s].raceName .. " killed, you need to kill " .. tasks[s].killsRequired .. ".", cid)
- end
- else
- selfSay("You do not have started any task.", cid)
- end
- end
- return true
- end
- npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
- npcHandler:addModule(FocusModule:new())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement