Nerevr back
Member
- Joined
- Nov 7, 2014
- Messages
- 269
- Reaction score
- 7
im use limos mission npc everything work oki but when start first mission i took all mission
example when start dragon mission and go kill dragon lord i fount it count :S i want fix it to no count if i don't start mission from npc
i started first mission collect items but when kill dragon
16:49 Task message: 1 of 2 Dragons killed.
sorry for bad english
npc
http://pastebin.com/frSUfSrp
creaturescript
example when start dragon mission and go kill dragon lord i fount it count :S i want fix it to no count if i don't start mission from npc
i started first mission collect items but when kill dragon
16:49 Task message: 1 of 2 Dragons killed.
sorry for bad english
npc
http://pastebin.com/frSUfSrp
creaturescript
Code:
local config = {
['dragon'] = {amount = 2, storage = 21900, startstorage = 45551, startvalue = 1},
['dragon lord'] = {amount = 3, storage = 21901, startstorage = 45551, startvalue = 1}
}
function onKill(cid, target)
local monster = config[getCreatureName(target):lower()]
if isPlayer(target) or not monster or isSummon(target) then
return true
end
if (getPlayerStorageValue(cid, monster.storage)+1) < monster.amount and getPlayerStorageValue(cid, monster.startstorage) >= monster.startvalue then
setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Task message: '..(getPlayerStorageValue(cid, monster.storage)+1)..' of '..monster.amount..' '..getCreatureName(target)..'s killed.')
end
if (getPlayerStorageValue(cid, monster.storage)+1) == monster.amount then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Congratulations, you have killed '..(getPlayerStorageValue(cid, monster.storage)+1)..' '..getCreatureName(target)..'s and completed the '..getCreatureName(target)..'s mission.')
setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1)
end
return true
end
Last edited: