Skrypty & Kody taks system.

Status
Zamknięty.

CunAus

Active User
Zarejestrowany
Dołączył
Wrzesień 30, 2015
Posty
74
Liczba reakcji
1
witam, mam problem z task system po prostu mi nie liczy ( nie wiem czy dobry temat.)
Wszystko dziala dobrze, tylko mi nie liczy ile zabilem.


[LUA]<?xml version="1.0" encoding="UTF-8"?>
<mod name="Advance Tasks System" version="1.0" author="Oskar" contact="http://tibia.net.pl/members/oskar.html" enabled="yes">
<config name="advanceTasks_conf"><![CDATA[
task = {
--each monsters
--['monsterName'] = {storage = storage, beginStorageValue = startingStorageValue, finishStorageValue = finishingStorageValue, count = countOfMonster}
['crocodile'] = {storage = 9960, beginStorageValue = 39, finishStorageValue = 40, count = 300},
['tarantula'] = {storage = 9959, beginStorageValue = 41, finishStorageValue = 42, count = 300},
['carniphila'] = {storage = 9958, beginStorageValue = 43, finishStorageValue = 44, count = 250},
['stone golem'] = {storage = 9957, beginStorageValue = 45, finishStorageValue = 46, count = 200},
['mutated rat'] = {storage = 9956, beginStorageValue = 47, finishStorageValue = 48, count = 200},
['giant spider'] = {storage = 9955, beginStorageValue = 49, finishStorageValue = 50, count = 500},
['hydra'] = {storage = 9954, beginStorageValue = 51, finishStorageValue = 52, count = 650},
['behemoth'] = {storage = 9953, beginStorageValue = 53, finishStorageValue = 54, count = 700},
['serpent spawn'] = {storage = 9952, beginStorageValue = 55, finishStorageValue = 56, count = 550},
['demon'] = {storage = 9951, beginStorageValue = 57, finishStorageValue = 58, count = 350},

--mass monsters
--['race name'] = {monsterTypes = {['name1'] = storage1, ['name2'] = storage2 ...},
-- beginStorageValue = startingStorageValue, finishStorageValue = finishingStorageValue, count = countOfMonster}
['trolls'] = {monsterTypes = {['troll']=9950,['swamp troll']=9949,['island troll']=9948,['frost troll']=9947,['troll champion']=9946},
beginStorageValue = 1, finishStorageValue = 2, count = 150},
['goblins'] = {monsterTypes = {['goblin']=9945,['goblin assassin']=9944,['goblin scavenger']=9943},
beginStorageValue = 3, finishStorageValue = 4, count = 150},
['rotworms'] = {monsterTypes = {['rotworm']=9942,['carrion worm']=9941},
beginStorageValue = 5, finishStorageValue = 6, count = 300},
['cyclops'] = {monsterTypes = {['cyclops']=9940,['cyclops drone']=9939,['cyclops smith']=9938},
beginStorageValue = 7, finishStorageValue = 8, count = 500},
['quaras'] = {monsterTypes = {['quara predator']=9937,['quara constrictor']=9936,['quara hydromancer']=9935,['quara mantassin']=9934,['quara pincher']=9933},
beginStorageValue = 9, finishStorageValue = 10, count = 300},
['water'] = {monsterTypes = {['water elemental']=9932,['massive water elemental']=9931},
beginStorageValue = 11, finishStorageValue = 12, count = 70},
['fire'] = {monsterTypes = {['fire elemental']=9930,['massive fire elemental']=9929},
beginStorageValue = 13, finishStorageValue = 14, count = 70},
['earth'] = {monsterTypes = {['earth elemental']=9928,['massive earth elemental']=9927},
beginStorageValue = 15, finishStorageValue = 16, count = 70},
['energy'] = {monsterTypes = {['energy elemental']=9926,['massive energy elemental']=9925},
beginStorageValue = 17, finishStorageValue = 18, count = 70},
['sea serpents'] = {monsterTypes = {['sea serpent']=9924,['young sea serpent']=9923},
beginStorageValue = 19, finishStorageValue = 20, count = 700},
['green djinns'] = {monsterTypes = {['green djinn']=9922,['efreet']=9921},
beginStorageValue = 21, finishStorageValue = 22, count = 500},
['blue djinns'] = {monsterTypes = {['blue djinn']=9920,['marid']=9919},
beginStorageValue = 23, finishStorageValue = 24, count = 500},
['pirates'] = {monsterTypes = {['pirate buccaneer']=9918,['pirate corsair']=9917,['pirate ghost']=9916,['pirate marauder']=9915,['pirate cutthroat']=9914,['pirate skeleton']=9913},
beginStorageValue = 25, finishStorageValue = 26, count = 1500},
['minotaurs'] = {monsterTypes = {['minotaur']=9912,['minotaur archer']=9911,['minotaur guard']=9910,['minotaur mage']=9909},
beginStorageValue = 27, finishStorageValue = 28, count = 5000},
['necromancers'] = {monsterTypes = {['necromancer']=9908,['priestess']=9907},
beginStorageValue = 29, finishStorageValue = 30, count = 2000},
['high class lizards'] = {monsterTypes = {['lizard zaogun']=9906,['lizard noble']=9905,['lizard magistratus']=9904,['lizard legionnaire']=9903,['lizard high guard']=9902,['lizard dragon priest']=9901,['lizard chosen']=9900},
beginStorageValue = 31, finishStorageValue = 32, count = 800},
['dragons'] = {monsterTypes = {['dragon']=9899,['dragon lord']=9898,['frost dragon']=9897,['wyrm']=9896},
beginStorageValue = 33, finishStorageValue = 34, count = 500},
['dragon hatchlings'] = {monsterTypes = {['dragon hatchling']=9895,['dragon lord hatchling']=9894,['frost dragon hatchling']=9893},
beginStorageValue = 35, finishStorageValue = 36, count = 750},
['undead dragons'] = {monsterTypes = {['undead dragon']=9892,['ghastly dragon']=9891},
beginStorageValue = 37, finishStorageValue = 38, count = 350},
}
specialTask = {
--bosses
-- ['boss name'] = {beginStorageValue = startingStorageValue, finishStorageValue = finishingStorageValue
-- [itemUid] = {effect = effectOnPlayerSpawn, centerRoomPosition = playerSpawnAndCenterRoomPosition,
-- bossSummonPlace = whereSummonBoss, bossEffect = effectOnBossSpawn,
-- sizeRoom = roomSize{cordinateX, cordinateY}}
['the snapper'] = {beginBossStorageValue = 1, finishedBossStorageValue = 2,
[5302] = {effect = CONST_ME_CARNIPHILA, centerRoomPosition = {x=1000,y=1000,z=7},
bossSummonPlace = {x=1000,y=1000,z=7}, bossEffect = CONST_ME_CARNIPHILA,
sizeRoom = {5,5}}},
['hide'] = {beginBossStorageValue = 3, finishedBossStorageValue = 4,
[5303] = {effect = CONST_ME_STONES, centerRoomPosition = {x=1000,y=1000,z=7},
bossSummonPlace = {x=1000,y=1000,z=7}, bossEffect = CONST_ME_STONES,
sizeRoom = {5,5}}},
['deathbine'] = {beginBossStorageValue = 5, finishedBossStorageValue = 6,
[5304] = {effect = CONST_ME_CARNIPHILA, centerRoomPosition = {x=1000,y=1000,z=7},
bossSummonPlace = {x=1000,y=1000,z=7}, bossEffect = CONST_ME_CARNIPHILA,
sizeRoom = {5,5}}},
['the bloodtusk'] = {beginBossStorageValue = 7, finishedBossStorageValue = 8,
[5305] = {effect = CONST_ME_ICEAREA, centerRoomPosition = {x=1000,y=1000,z=7},
bossSummonPlace = {x=1000,y=1000,z=7}, bossEffect = CONST_ME_ICEAREA,
sizeRoom = {5,5}}},
['shardhead'] = {beginBossStorageValue = 9, finishedBossStorageValue = 10,
[5306] = {effect = CONST_ME_ICEATTACK, centerRoomPosition = {x=1000,y=1000,z=7},
bossSummonPlace = {x=1000,y=1000,z=7}, bossEffect = CONST_ME_ICEATTACK,
sizeRoom = {5,5}}},
['esmeralda'] = {beginBossStorageValue = 11, finishedBossStorageValue = 12,
[5307] = {effect = CONST_ME_HITBYPOISON, centerRoomPosition = {x=1000,y=1000,z=7},
bossSummonPlace = {x=1000,y=1000,z=7}, bossEffect = CONST_ME_HITBYPOISON,
sizeRoom = {5,5}}},
['bloodweb'] = {beginBossStorageValue = 13, finishedBossStorageValue = 14,
[5308] = {effect = CONST_ME_ICEATTACK, centerRoomPosition = {x=1000,y=1000,z=7},
bossSummonPlace = {x=1000,y=1000,z=7}, bossEffect = CONST_ME_ICEATTACK,
sizeRoom = {5,5}}},
['fleshcrawler'] = {beginBossStorageValue = 15, finishedBossStorageValue = 16,
[5309] = {effect = CONST_ME_SMALLPLANTS, centerRoomPosition = {x=1000,y=1000,z=7},
bossSummonPlace = {x=1000,y=1000,z=7}, bossEffect = CONST_ME_SMALLPLANTS,
sizeRoom = {5,5}}},
['ribstride'] = {beginBossStorageValue = 17, finishedBossStorageValue = 18,
[5310] = {effect = CONST_ME_SMALLCLOUDS, centerRoomPosition = {x=1000,y=1000,z=7},
bossSummonPlace = {x=1000,y=1000,z=7}, bossEffect = CONST_ME_SMALLCLOUDS,
sizeRoom = {5,5}}},
['the old widow'] = {beginBossStorageValue = 19, finishedBossStorageValue = 20,
[5311] = {effect = CONST_ME_SMALLPLANTS, centerRoomPosition = {x=1000,y=1000,z=7},
bossSummonPlace = {x=1000,y=1000,z=7}, bossEffect = CONST_ME_SMALLPLANTS,
sizeRoom = {5,5}}},
['thul'] = {beginBossStorageValue = 21, finishedBossStorageValue = 22,
[5312] = {effect = CONST_ME_WATERSPLASH, centerRoomPosition = {x=1000,y=1000,z=7},
bossSummonPlace = {x=1000,y=1000,z=7}, bossEffect = CONST_ME_WATERSPLASH,
sizeRoom = {5,5}}},
['flameborn'] = {beginBossStorageValue = 23, finishedBossStorageValue = 24,
[5313] = {effect = CONST_ME_HITBYFIRE, centerRoomPosition = {x=1000,y=1000,z=7},
bossSummonPlace = {x=1000,y=1000,z=7}, bossEffect = CONST_ME_HITBYFIRE,
sizeRoom = {5,5}}},
['sulphur scuttler'] = {beginBossStorageValue = 25, finishedBossStorageValue = 26,
[5314] = {effect = CONST_ME_SMALLPLANTS, centerRoomPosition = {x=1000,y=1000,z=7},
bossSummonPlace = {x=1000,y=1000,z=7}, bossEffect = CONST_ME_SMALLPLANTS,
sizeRoom = {5,5}}},
['the many'] = {beginBossStorageValue = 27, finishedBossStorageValue = 28,
[5315] = {effect = CONST_ME_SMALLPLANTS, centerRoomPosition = {x=1000,y=1000,z=7},
bossSummonPlace = {x=1000,y=1000,z=7}, bossEffect = CONST_ME_SMALLPLANTS,
sizeRoom = {5,5}}},
['leviathan'] = {beginBossStorageValue = 29, finishedBossStorageValue = 30,
[5316] = {effect = CONST_ME_ICEATTACK, centerRoomPosition = {x=1000,y=1000,z=7},
bossSummonPlace = {x=1000,y=1000,z=7}, bossEffect = CONST_ME_ICEATTACK,
sizeRoom = {5,5}}},
['stonecracker'] = {beginBossStorageValue = 31, finishedBossStorageValue = 32,
[5317] = {effect = CONST_ME_POFF, centerRoomPosition = {x=1000,y=1000,z=7},
bossSummonPlace = {x=1000,y=1000,z=7}, bossEffect = CONST_ME_POFF,
sizeRoom = {5,5}}},
['the noxious spawn'] = {beginBossStorageValue = 33, finishedBossStorageValue = 34,
[5318] = {effect = CONST_ME_YELLOW_RINGS, centerRoomPosition = {x=1000,y=1000,z=7},
bossSummonPlace = {x=1000,y=1000,z=7}, bossEffect = CONST_ME_YELLOW_RINGS,
sizeRoom = {5,5}}},
['gorgo'] = {beginBossStorageValue = 35, finishedBossStorageValue = 36,
[5319] = {effect = CONST_ME_GROUNDSHAKER, centerRoomPosition = {x=1000,y=1000,z=7},
bossSummonPlace = {x=1000,y=1000,z=7}, bossEffect = CONST_ME_GROUNDSHAKER,
sizeRoom = {5,5}}},
['kerberos'] = {beginBossStorageValue = 37, finishedBossStorageValue = 38,
[5320] = {effect = CONST_ME_FIREAREA, centerRoomPosition = {x=1000,y=1000,z=7},
bossSummonPlace = {x=1000,y=1000,z=7}, bossEffect = CONST_ME_FIREAREA,
sizeRoom = {5,5}}},
['ethershrek'] = {beginBossStorageValue = 39, finishedBossStorageValue = 40,
[5321] = {effect = CONST_ME_MORTAREA, centerRoomPosition = {x=1000,y=1000,z=7},
bossSummonPlace = {x=1000,y=1000,z=7}, bossEffect = CONST_ME_MORTAREA,
sizeRoom = {5,5}}}
}
mainStorage = 10001
bossesStorage = 10002

function isSummon(cid)
if(not isCreature(cid)) then
return false
end
return getCreatureMaster(cid) ~= cid
end
}
]]>
</config>


<talkaction words="!task" log="yes" event="script">
<![CDATA[
domodlib('task_config')

function onSay(cid, words, param)
local currentTask, tasks = '', {}
for k, v in pairs(taskMonsters) do
if getCreatureStorage(cid, taskConfig.taskStorage) == k then
currentTask = k
end
table.insert(tasks, k)
end

param = param:lower()

if param == '' then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, '[TASK]\n"!task info" - check your current task\n"!task TaskName" - start new task\n"!task off" - stop current task')
elseif param == 'info' then
if currentTask ~= '' then
local task, text,t = taskMonsters[currentTask], '',taskMonsters[currentTask]
--if getCreatureStorage(cid, t.doneStorage) == 0 and getCreatureStorage(cid, t.storage) >= 0 then
-- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, '[TASK INFO] You are doing potion task and you have used them '..getCreatureStorage(cid, t.storage)..' of '..t.uses..'.')
--end
doPlayerPopupFYI(cid, " =>] INFO ABOUT YOUR TASK [<= \n\nCURRENT TASK: "..currentTask.."s\nKILLED: ".. getCreatureStorage(cid, task.storage) .. "\nOBJECTIVE: "..task.kills)
--doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, '[TASK INFO] You are doing '..currentTask..' task. You killed '..getCreatureStorage(cid, task.storage)..' of '..task.kills..' this kind of monsters.'..text)
else
doPlayerSendCancel(cid, 'You are not in any task.')
end
elseif param == 'off' then
if currentTask ~= '' then
local task = taskMonsters[currentTask]
doCreatureSetStorage(cid, taskConfig.taskStorage, '')
doCreatureSetStorage(cid, task.storage, 0)
doCreatureSetStorage(cid, task.doneStorage, 0)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, '[TASK] You stopped currently '..currentTask..' task. You can now start other task.')
else
doPlayerSendCancel(cid, 'You are not in any task.')
end
--[[elseif param == 'potion' then
local p = (getPlayerVocation(cid) - 4 > 0) and taskConfig.potion[getPlayerVocation(cid)-4] or taskConfig.potion[getPlayerVocation(cid)]
if getCreatureStorage(cid, p.doneStorage) ~= 1 then
if getCreatureStorage(cid, p.storage) < 0 then
if p.minLevel <= getPlayerLevel(cid) then
doCreatureSetStorage(cid, p.storage, 0)
doCreatureSetStorage(cid, p.doneStorage, 0)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, '[TASK] You have started potion task. You have to use '..p.uses..' potions. Good luck!')
else
doPlayerSendCancel(cid, 'You don\'t have enough level.')
end
else
doCreatureSetStorage(cid, p.storage, -1)
doPlayerSendCancel(cid, 'Currently you are doing this task.')
end
else
doPlayerSendCancel(cid, 'You arleady done this kind of tasks.')
end]]--
elseif isInArray(tasks, param) then
if currentTask == '' then
if getCreatureStorage(cid, taskMonsters[param].doneStorage) < 1 then
doCreatureSetStorage(cid, taskConfig.taskStorage, param)
doCreatureSetStorage(cid, taskMonsters[param].storage, 0)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, '[TASK] You have started '..param..' task. You have to kill '..taskMonsters[param].kills..' '..param..'s. Good luck!')
else
doPlayerSendCancel(cid, 'You arleady done task with '..param..'s.')
end
else
doPlayerSendCancel(cid, 'Currently you are doing '..currentTask..' task. You can stop it typing "!task off".')
end
else
doPlayerSendCancel(cid, 'Type your param propely or type: "!task".')
end
return true
end
]]>
</talkaction>

<event type="kill" name="task_kill" event="script">
<![CDATA[
domodlib('task_config')

function onKill(cid, target, damage, flags)
if bit.band(flags, 1) == 1 and isMonster(target) then
if isPlayer(cid) then
if getCreatureStorage(cid, taskConfig.taskStorage) == getCreatureName(target):lower() then
local task = taskMonsters[getCreatureName(target):lower()]
if getCreatureStorage(cid, task.storage) + 1 >= task.kills then
doCreatureSetStorage(cid, taskConfig.taskStorage, '')
doCreatureSetStorage(cid, task.storage, task.kills)
doCreatureSetStorage(cid, task.doneStorage, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, '[TASK] You have finished task. You have killed enough '..getCreatureName(target):lower()..'s and you got a reward.')

doPlayerAddExperience(cid, task.exp)
local backpack = doPlayerAddItem(cid, 10521, 1)
for k, v in ipairs(task.items) do
doAddContainerItem(backpack, v[1], v[2])
end
else
doCreatureSetStorage(cid, task.storage, math.max(0, getCreatureStorage(cid, task.storage)) + 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, '[TASK] You killed '..getCreatureStorage(cid, task.storage)..'/'..task.kills..' '..getCreatureName(target):lower()..'s.')
end
end
end
end
return true
end
]]>
</event>

<event type="login" name="task_login" event="buffer">
<![CDATA[
registerCreatureEvent(cid, 'task_kill')
]]>
</event>
</mod>[/LUA]

---------- Tre?? dodana o 18:33 ----------

ReFrEsH
 
Odp: taks system.

Usu?:
PHP:
bit.band(flags, 1) == 1 and
Nie wiem sk?d to si? tam wzi??o, skoro w onKill nie ma takiego parametru :P
 
Odp: taks system.

Jak to usun??em to Server mi wywali?o i nie wiem o co chodzi :(
 
Status
Zamknięty.
Back
Do góry