Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <mod name="Gaiden System" version="0.4.0" author="Oskar" contact="[email protected]" enabled="yes">
- <config name="gaidens_conf"><![CDATA[
- TYPE_ITEMBACK = 0 -- taski na itemki
- TYPE_KILL = 1 -- taski na zabojstwa
- REWARD_ITEM = 0
- REWARD_EXP = 1
- REWARD_MONEY = 2
- REWARD_ADDON = 3
- REWARD_SKILL = 4
- REWARD_STORAGE = 5
- REWARD_LEVEL = 6
- CHECKING_STORAGE_DO_NOT_CHANGE = 4999
- --[[
- Naruto Gaiden - Protection All na stale + 10% -- DONE
- Kimimaro Gaiden - Skill x 2 -- DONE
- Sasuke Gaiden - Dmg ze spelli + 20% -- DONE
- Obito Gaiden - +50 000 HP i many -- DONE
- Itachi Gaiden - +25 000 HP i many i 5% protection all -- DONE
- Hospital Missions - Potiony leczÄ? +10% HP/mana wiÄ?cej -- DONE
- Minato Gaiden - Drop x 2 -- DONE
- Lee Gaiden - Dmg z Ĺ?apy 20% -- DONE
- Gaara Gaiden - +10% dmg z Ĺ?apy i spelli + 5% protection all -- DONE
- Sakura Gaiden - ZwiÄ?kszenie leczenia ze spelli [ mam procentowe ] o 10% -- DONE
- Kakashi Gaiden - Exp x 2 -- DONE
- ]]
- superUberDuperTaskList = {
- ['Naruto Gaiden'] = {
- id = 1,
- storage = 5000,
- [1] = { var = TYPE_KILL,
- details = {'[Gaiden] Mizuki', 1},
- rewards = {REWARD_EXP, 0, 2500} },
- [2] = { var = TYPE_KILL,
- details = {'[Gaiden] Kakashi Sensei', 1},
- rewards = {REWARD_EXP, 0, 5000} },
- },
- ['Sasuke Gaiden'] = {
- id = 2,
- storage = 5001,
- [1] = { var = TYPE_KILL,
- details = {'bear', 20},
- rewards = {REWARD_EXP, 0, 2500} },
- [2] = { var = TYPE_KILL,
- details = {'[Gaiden] Naruto', 1},
- rewards = {REWARD_EXP, 0, 5000} },
- },
- ['Sakura Gaiden'] = {
- id = 3,
- storage = 5002,
- [1] = { var = TYPE_ITEMBACK,
- details = {5881, 20}, -- Leaf
- rewards = {REWARD_EXP, 0, 10000} },
- [2] = { var = TYPE_KILL,
- details = {'[Gaiden] Kakashi Sensei', 1},
- rewards = {REWARD_EXP, 0, 5000} },
- [3] = { var = TYPE_ITEMBACK,
- details = {5809, 1}, -- Kakashi Training Bell
- rewards = {REWARD_EXP, 0, 10000} },
- },
- ['Kakashi Gaiden'] = {
- id = 4,
- storage = 5003,
- [1] = { var = TYPE_KILL,
- details = {'bear', 20},
- rewards = {REWARD_EXP, 0, 2500} },
- [2] = { var = TYPE_KILL,
- details = {'bandit', 50},
- rewards = {REWARD_EXP, 0, 5000} },
- [3] = { var = TYPE_KILL,
- details = {'shinobazu', 100},
- rewards = {REWARD_EXP, 0, 10000} },
- },
- ['Kimimaro Gaiden'] = {
- id = 5,
- storage = 5004,
- [1] = { var = TYPE_KILL,
- details = {'prisoner', 50},
- rewards = {REWARD_EXP, 0, 25000} },
- [2] = { var = TYPE_KILL,
- details = {'sound shinobi', 100},
- rewards = {REWARD_EXP, 0, 50000} },
- },
- ['Obito Gaiden'] = {
- id = 6,
- storage = 5005,
- [1] = { var = TYPE_KILL,
- details = {'bear', 2},
- rewards = {REWARD_EXP, 0, 2500} },
- [2] = { var = TYPE_KILL,
- details = {'bandit', 5},
- rewards = {REWARD_EXP, 0, 5000} },
- [3] = { var = TYPE_KILL,
- details = {'shinobazu', 10},
- rewards = {REWARD_EXP, 0, 10000} },
- },
- ['Minato Gaiden'] = {
- id = 7,
- storage = 5006,
- [1] = { var = TYPE_KILL,
- details = {'wolf', 50},
- rewards = {REWARD_EXP, 0, 2500} },
- [2] = { var = TYPE_KILL,
- details = {'farmer', 100},
- rewards = {REWARD_EXP, 0, 5000} },
- [3] = { var = TYPE_KILL,
- details = {'bandit', 200},
- rewards = {REWARD_EXP, 0, 10000} },
- },
- ['Gaara Gaiden'] = {
- id = 8,
- storage = 5007,
- [1] = { var = TYPE_KILL,
- details = {'bandit', 25},
- rewards = {REWARD_EXP, 0, 5000} },
- [2] = { var = TYPE_KILL,
- details = {'sand shinobi', 50},
- rewards = {REWARD_EXP, 0, 10000} },
- [3] = { var = TYPE_ITEMBACK,
- details = {2515, 1}, -- Benihisago
- rewards = {REWARD_EXP, 0, 20000} },
- },
- ['Lee Gaiden'] = {
- id = 9,
- storage = 5008,
- [1] = { var = TYPE_KILL,
- details = {'[Gaiden] Trainer', 1},
- rewards = {REWARD_EXP, 0, 10000} },
- [2] = { var = TYPE_KILL,
- details = {'[Gaiden] Neji', 1},
- rewards = {REWARD_EXP, 0, 20000} },
- },
- ['Itachi Gaiden'] = {
- id = 10,
- storage = 5009,
- [1] = { var = TYPE_KILL,
- details = {'wolf', 25},
- rewards = {REWARD_EXP, 0, 2500} },
- [2] = { var = TYPE_KILL,
- details = {'bandit', 50},
- rewards = {REWARD_EXP, 0, 5000} },
- [3] = { var = TYPE_KILL,
- details = {'[Gaiden] Trainer', 5},
- rewards = {REWARD_EXP, 0, 10000} },
- },
- ['Hospital Missions'] = {
- id = 11,
- storage = 5010,
- [1] = { var = TYPE_ITEMBACK,
- details = {5881, 10}, -- Leaf
- rewards = {REWARD_LEVEL, 0, 5} },
- [2] = { var = TYPE_ITEMBACK,
- details = {5877, 15}, -- Rotten Animal Leather
- rewards = {REWARD_LEVEL, 0, 5} },
- }
- }
- CHECKING_LAST_ID = 0
- for _, v in pairs(superUberDuperTaskList) do
- CHECKING_LAST_ID = math.max(CHECKING_LAST_ID, v.id)
- end
- function getVariable(cid, variable)
- local var = tonumber(getCreatureStorage(cid, CHECKING_STORAGE_DO_NOT_CHANGE))
- if var < 2 ^ variable then
- return true
- end
- for i = CHECKING_LAST_ID, variable, -1 do
- if var >= 2 ^ i then
- if i == variable then
- return false
- end
- var = var - (2 ^ i)
- end
- end
- return true
- end
- function updateRewards(cid, v)
- local storage = getCreatureStorage(cid, v.storage)
- if storage > #v then
- doCreatureSetStorage(cid, CHECKING_STORAGE_DO_NOT_CHANGE, math.max(0, getCreatureStorage(cid, CHECKING_STORAGE_DO_NOT_CHANGE)) + (2 ^ (v.id - 1)))
- if v.id == 6 then
- setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 50000)
- setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 50000)
- elseif v.id == 7 then
- setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 25000)
- setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 25000)
- end
- end
- end
- function getDetails(cid, status, storage, basicCount)
- local count, detail, complete = #status.details / 2, '', true
- local killsCount = {}
- if status.var == TYPE_KILL then
- local subStorage = getCreatureStorage(cid, storage)
- if subStorage == -1 then
- for i = 1, #status.details / 2 do
- killsCount[i + 1] = 0
- end
- else
- killsCount = tostring(subStorage):explode('_')
- end
- end
- for i = 1, count do
- if status.var == TYPE_KILL and (not killsCount or ((tonumber(killsCount[i + 1]) or 0) < status.details[i * 2])) then
- complete = false
- elseif status.var == TYPE_ITEMBACK and getPlayerItemCount(cid, status.details[i * 2 - 1]) < status.details[i * 2] then
- complete = false
- end
- if status.var == TYPE_KILL then
- detail = detail .. math.max(0, (basicCount and status.details[i * 2] or tonumber(killsCount[i + 1]))) .. 'x of ' .. status.details[i * 2 - 1]
- elseif status.var == TYPE_ITEMBACK then
- detail = detail .. status.details[i * 2] .. 'x of ' .. getItemNameById(status.details[i * 2 - 1])
- end
- if i < count - 1 and count > 2 then
- detail = detail .. ', '
- elseif i == count - 1 and count > 1 then
- detail = detail .. ' and '
- end
- end
- return detail, complete
- end
- function getDescription(status, killsCount, target)
- local killedMessage, detail = '', ''
- local count = #status.details / 2
- local complete = true
- local total = {0, 0}
- local found = false
- for i = 1, count do
- if target and getCreatureName(target):lower() == status.details[i * 2 - 1]:lower() then
- killsCount[i + 1] = (tonumber(killsCount[i + 1]) or 0) + 1
- found = true
- end
- total[1] = total[1] + status.details[i * 2]
- total[2] = total[2] + tonumber(killsCount[i + 1])
- detail = detail .. '_' .. killsCount[i + 1]
- killedMessage = killedMessage .. killsCount[i + 1] .. 'x of ' .. status.details[i * 2 - 1]
- if i < count - 1 and count > 2 then
- killedMessage = killedMessage .. ', '
- elseif i == count - 1 and count > 1 then
- killedMessage = killedMessage .. ' and '
- end
- if complete and tonumber(killsCount[i + 1]) < status.details[i * 2] then
- complete = false
- end
- end
- return killedMessage, total, detail, complete, found
- end
- ]]></config>
- <event type="kill" name="newTasksKilling" event="script"><![CDATA[
- domodlib('gaidens_conf')
- function onKill(cid, target)
- if isMonster(target) and isPlayer(cid) then
- for _, v in pairs(superUberDuperTaskList) do
- local value = tonumber(getCreatureStorage(cid, v.storage))
- local status = v[value]
- if status and status.var == TYPE_KILL then
- local subStorage, killsCount = getCreatureStorage(cid, v.storage + 100), {}
- if subStorage == -1 then
- for i = 1, #status.details / 2 do
- killsCount[i + 1] = 0
- end
- else
- killsCount = tostring(subStorage):explode('_')
- end
- local killedMessage, total, detail, complete, found = getDescription(status, killsCount, target)
- if detail ~= '' and found then
- doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You killed ' .. killedMessage .. ' [' .. total[2] .. ' / ' .. total[1] .. '].')
- if complete then
- status = v[value + 1]
- doCreatureSetStorage(cid, v.storage + 100, -1)
- doCreatureSetStorage(cid, v.storage, value + 1)
- updateRewards(cid, v)
- if status then
- local detail, complete = getDetails(cid, status, v.storage + 100, true)
- if status.var == TYPE_KILL then
- doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have already started a mission where you must kill ' .. detail .. '.')
- elseif status.var == TYPE_ITEMBACK then
- doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have already started a mission where you must gather ' .. detail .. '. Come back to ' .. _ .. ' when you get it all.')
- end
- end
- else
- doCreatureSetStorage(cid, v.storage + 100, detail)
- end
- end
- end
- end
- end
- return true
- end
- ]]></event>
- <talkaction words='!mission' event='script'><![CDATA[
- domodlib('gaidens_conf')
- function onSay(cid, words, param, channel)
- local message = ''
- for name, v in pairs(superUberDuperTaskList) do
- local value = tonumber(getCreatureStorage(cid, v.storage))
- local status = v[value]
- local started = true
- local finished = false
- if not status then
- if value > 0 then
- finished = true
- else
- status = v[1]
- started = false
- end
- end
- if message ~= '' then
- message = message .. '\n\n'
- end
- message = message .. name .. ' [' .. math.min(#v, (started and value or 0)) .. ' / ' .. #v .. ']\n'
- if finished then
- message = message .. 'Finished.'
- elseif status.var == TYPE_KILL then
- local subStorage, killsCount = getCreatureStorage(cid, v.storage + 100), {}
- if subStorage == -1 then
- for i = 1, #status.details / 2 do
- killsCount[i + 1] = 0
- end
- else
- killsCount = tostring(subStorage):explode('_')
- end
- local killedMessage, total, description, complete, found = getDescription(status, killsCount)
- if complete then
- message = message .. 'You finished ' .. name .. '.'
- else
- message = message .. 'You killed ' .. killedMessage .. ' [' .. total[2] .. ' / ' .. total[1] .. ']'
- end
- elseif status.var == TYPE_ITEMBACK then
- local detail, complete = getDetails(cid, status)
- message = message .. 'Bring ' .. detail
- end
- message = message .. '.'
- if not started then
- message = message .. ' [not started yet]'
- end
- end
- doPlayerPopupFYI(cid, message)
- return true
- end
- ]]></talkaction>
- <event type="login" name="newtaskLogin" event="script"><![CDATA[
- function onLogin(cid)
- registerCreatureEvent(cid, 'newTasksKilling')
- return true
- end
- ]]></event>
- </mod>
Add Comment
Please, Sign In to add comment