Advertisement
Guest User

Untitled

a guest
Apr 10th, 2020
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.57 KB | None | 0 0
  1. local bosses = {
  2.     ['deathstrike'] = {status = 2, storage = Storage.BigfootBurden.Warzone1Reward},
  3.     ['gnomevil'] = {status = 3, storage = Storage.BigfootBurden.Warzone2Reward},
  4.     ['abyssador'] = {status = 4, storage = Storage.BigfootBurden.Warzone3Reward},
  5. }
  6.  
  7. function onKill(cid, target, lastHit)
  8.     doLogScript2(3005, SCRIPT_TYPE_SPELL)
  9.  
  10.     local targetMonster = Monster(target)
  11.     if not targetMonster then
  12.         return true
  13.     end
  14.  
  15.     local bossConfig = bosses[targetMonster:getName():lower()]
  16.     if not bossConfig then
  17.         return true
  18.     end
  19.  
  20.     for pid, _ in pairs(targetMonster:getDamageMap()) do
  21.         local attackerPlayer = Player(pid)
  22.         if attackerPlayer then
  23.             if attackerPlayer:getStorageValue(Storage.BigfootBurden.WarzoneStatus) < bossConfig.status then
  24.                 attackerPlayer:setStorageValue(Storage.BigfootBurden.WarzoneStatus, bossConfig.status)
  25.             end
  26.  
  27.             attackerPlayer:setStorageValue(bossConfig.storage, 1)
  28.         end
  29.     end
  30. end
  31.  
  32. function onDeath(cid, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified)
  33.  
  34.     local boss = Monster(cid)
  35.     if not boss then
  36.         return true
  37.     end
  38.  
  39.     local bossConfig = bosses[boss:getName():lower()]
  40.     if not bossConfig then
  41.         return true
  42.     end
  43.  
  44.     for pid, _ in pairs(boss:getDamageMap()) do
  45.         local attackerPlayer = Player(pid)
  46.         if attackerPlayer then
  47.             if attackerPlayer:getStorageValue(Storage.BigfootBurden.WarzoneStatus) < bossConfig.status then
  48.                 attackerPlayer:setStorageValue(Storage.BigfootBurden.WarzoneStatus, bossConfig.status)
  49.             end
  50.  
  51.             attackerPlayer:setStorageValue(bossConfig.storage, 1)
  52.         end
  53.     end
  54. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement