Advertisement
Guest User

Untitled

a guest
Sep 20th, 2014
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.23 KB | None | 0 0
  1. huntingParty = getPartyMembers(cid)
  2. huntingMemberGotExp = getNumberValue(creature.experience)
  3.  
  4.     if creature then   
  5.         if (huntingParty ~= nil) then
  6.             for i, cid in pairs(huntingParty) do
  7.             if (huntingMemberGotExp ~= nil) then
  8.        
  9.                 --This register the amount of killed creatures--
  10.                 setGlobalStorageValue(creature.counterid, getGlobalStorageValue(creature.counterid)+1)
  11.        
  12.                 --For task system, adds storage when task creature is killed--
  13.                 setPlayerStorageValue(cid, creature.creatureStorage, getPlayerStorageValue(cid, creature.creatureStorage)+1)
  14.  
  15.                 local currentTask = getPlayerStorageValue(cid, taskStorage)
  16.                 if (currentTask > 0 and creature.creatureStorage == currentTask) then
  17.                     local amount = getPlayerStorageValue(cid, currentTask)
  18.                     local task = getTaskByStorage(cid)
  19.  
  20.                     if (amount == task.amount) then
  21.                         doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have killed all the " .. task.task .. " you needed to kill. Please report back to Huntsman Chris for your reward.")
  22.                     elseif (amount > 0 and amount < task.amount) then
  23.                         doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have currently killed " .. amount .. "/" .. task.amount .. " " .. task.task .. ".")
  24.                     end
  25.                 end
  26.             end
  27.             end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement