Sassin
Forum friend
- Joined
- Jun 13, 2009
- Messages
- 1,281
- Reaction score
- 107
Cze??! ?eby?cie nie musieli szuka?, wklejam Wam skrypt Oskar'a, kt?ry "przez przypadek" zosta? usuni?ty. http://tibia.net.pl/npc/338799-grizzly-adams-rl-wersja.html
~Creatureevents/scripts:
~NPC
1/2
~Creatureevents/scripts:
PHP:
tasks_system.lua
PHP:
function onKill(cid, target)
local config = {
["troll"] = {storage = 9999, begin_storage_value = 1, finished_storage_value = 2, count = 300},
["swamp troll"] = {storage = 9999, begin_storage_value = 1, finished_storage_value = 2, count = 300},
["lizard high guard"] = {storage = 9998, begin_storage_value = 3, finished_storage_value = 4, count = 500},
["lizard dragon priest"] = {storage = 9998, begin_storage_value = 3, finished_storage_value = 4, count = 500},
["lizard chosen"] = {storage = 9998, begin_storage_value = 3, finished_storage_value = 4, count = 500},
["witch"] = {storage = 9997, begin_storage_value = 5, finished_storage_value = 6, count = 450},
["dragon"] = {storage = 9996, begin_storage_value = 7, finished_storage_value = 8, count = 150},
["dragon lord"] = {storage = 9996, begin_storage_value = 7, finished_storage_value = 8, count = 150},
["frost dragon"] = {storage = 9996, begin_storage_value = 7, finished_storage_value = 8, count = 150},
["undead dragon"] = {storage = 9995, begin_storage_value = 9, finished_storage_value = 10, count = 300},
["ghastly dragon"] = {storage = 9995, begin_storage_value = 9, finished_storage_value = 10, count = 300},
--bosses--
["trolls boss"] = {storage = 19999, begin_storage_value = 1, finished_storage_value = 2, count = 1},
["lizards boss"] = {storage = 19998, begin_storage_value = 3, finished_storage_value = 4, count = 1},
["dragons boss"] = {storage = 19997, begin_storage_value = 7, finished_storage_value = 8, count = 1}
}
local mob = config[string.lower(getCreatureName(target))]
if(not mob) then
return true
end
local main_storage = 10001
local bosses_storage = 10002
if(isPlayer(target) ~= TRUE) then
local count_monsters = getPlayerStorageValue(cid, mob.storage)
if getPlayerStorageValue(cid, main_storage) == mob.begin_storage_value and count_monsters <= mob.count then
doPlayerSetStorageValue(cid, mob.storage, count_monsters + 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You killed ".. getPlayerStorageValue(cid, mob.storage) .." of "..mob.count.." "..getCreatureName(target).."s.")
if getPlayerStorageValue(cid, mob.storage) == mob.count then
doPlayerSetStorageValue(cid, main_storage, mob.finished_storage_value)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed enough "..getCreatureName(target).."s.")
end
elseif getPlayerStorageValue(cid, bosses_storage) == mob.begin_storage_value and getPlayerStorageValue(cid, mob.storage) == mob.count then
doPlayerSetStorageValue(cid, main_storage, mob.finished_storage_value)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed "..getCreatureName(target)..".")
end
end
return true
end
PHP:
do login.lua przed return true
PHP:
registerCreatureEvent(cid, "Tasks_System")
PHP:
i plik .xml
PHP:
<event type="kill" name="Tasks_System" event="script" value="tasks_system.lua"/>
~NPC
PHP:
tasks_system.lua
1/2