SHARE
TWEET

Untitled

a guest Feb 16th, 2019 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. rageExp.ProcessLatestKill = function(pid, refId)
  2.    
  3.     tes3mp.LogMessage(enumerations.log.INFO, "Running rageExp.ProcessLatestKill() for pid " .. pid .. ", refId " .. refId)
  4.  
  5.     if rageExp.IDsToPoints[refId] ~= nil then
  6.        
  7.         local basePoints = rageExp.IDsToPoints[refId].points
  8.         local extraPoints = math.random(-basePoints / 10, basePoints / 10)
  9.         local totalPoints = basePoints + extraPoints
  10.  
  11.         -- Add a bonus based on the player's current difficulty
  12.         local difficulty = Players[pid].data.settings.difficulty
  13.  
  14.         if difficulty == "default" then
  15.         difficulty = config.difficulty
  16.         end
  17.  
  18.         totalPoints = totalPoints
  19.         totalPoints = math.ceil(totalPoints)
  20.  
  21.         if totalPoints > 0 then
  22.             Players[pid].data.customVariables.rageExp = Players[pid].data.customVariables.rageExp + totalPoints
  23.             tes3mp.MessageBox(pid, -1, color.White .. "You have gained " .. color.LightGreen ..
  24.                 totalPoints .. color.White .. " experience")
  25.         end
  26.     end
  27.    
  28.     local currentRageLevel = Players[pid].data.customVariables.rageLevel
  29.     local baseXp = 100
  30.     local nextlevel = math.floor(baseXp *((currentRageLevel + 1) ^ 2.5) / 2)
  31.    
  32.     if Players[pid].data.customVariables.rageLevel == 0 and Players[pid].data.customVariables.rageExp >= nextlevel + 60 then
  33.         Players[pid].data.customVariables.rageLevel = Players[pid].data.customVariables.rageLevel + 1
  34.         Players[pid].data.customVariables.ragePoints = Players[pid].data.customVariables.ragePoints + 5
  35.         logicHandler.RunConsoleCommandOnPlayer(pid, 'playsound "Conjuration Hit"')
  36.         local levelMessage = Players[pid].data.customVariables.rageLevel
  37.         tes3mp.MessageBox(pid,-1, color.White .. "You have gained a " .. color.Coral .. "RageLevel" .. color.White .. "!\n")
  38.         tes3mp.SendMessage(pid, color.BlueViolet .. "Congratulations! You are now Rage Level " .. color.BlueViolet .. levelMessage  .. "!\n" ..
  39.                                 color.White .. "Type " .. color.Gold .. "/rage " .. color.White .. "to bring up the " .. color.Coral .. "Rage " .. color.White .. "menu.\n",false)
  40.     elseif Players[pid].data.customVariables.rageExp >= nextlevel and Players[pid].data.customVariables.rageLevel >= 1 then
  41.         Players[pid].data.customVariables.rageLevel = Players[pid].data.customVariables.rageLevel + 1
  42.         Players[pid].data.customVariables.ragePoints = Players[pid].data.customVariables.ragePoints + 5
  43.         logicHandler.RunConsoleCommandOnPlayer(pid, 'playsound "Conjuration Hit"')
  44.         local levelMessage = Players[pid].data.customVariables.rageLevel
  45.         tes3mp.MessageBox(pid,-1, color.White .. "You have gained a " .. color.Coral .. "RageLevel" .. color.White .. "!\n")
  46.         tes3mp.SendMessage(pid, color.BlueViolet .. "Congratulations! You are now Rage Level " .. color.BlueViolet .. levelMessage  .. "!\n",false)
  47.     end
  48. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top