Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rageExp.ProcessLatestKill = function(pid, refId)
- tes3mp.LogMessage(enumerations.log.INFO, "Running rageExp.ProcessLatestKill() for pid " .. pid .. ", refId " .. refId)
- if rageExp.IDsToPoints[refId] ~= nil then
- local basePoints = rageExp.IDsToPoints[refId].points
- local extraPoints = math.random(-basePoints / 10, basePoints / 10)
- local totalPoints = basePoints + extraPoints
- -- Add a bonus based on the player's current difficulty
- local difficulty = Players[pid].data.settings.difficulty
- if difficulty == "default" then
- difficulty = config.difficulty
- end
- totalPoints = totalPoints
- totalPoints = math.ceil(totalPoints)
- if totalPoints > 0 then
- Players[pid].data.customVariables.rageExp = Players[pid].data.customVariables.rageExp + totalPoints
- tes3mp.MessageBox(pid, -1, color.White .. "You have gained " .. color.LightGreen ..
- totalPoints .. color.White .. " experience")
- end
- end
- local currentRageLevel = Players[pid].data.customVariables.rageLevel
- local baseXp = 100
- local nextlevel = math.floor(baseXp *((currentRageLevel + 1) ^ 2.5) / 2)
- if Players[pid].data.customVariables.rageLevel == 0 and Players[pid].data.customVariables.rageExp >= nextlevel + 60 then
- Players[pid].data.customVariables.rageLevel = Players[pid].data.customVariables.rageLevel + 1
- Players[pid].data.customVariables.ragePoints = Players[pid].data.customVariables.ragePoints + 5
- logicHandler.RunConsoleCommandOnPlayer(pid, 'playsound "Conjuration Hit"')
- local levelMessage = Players[pid].data.customVariables.rageLevel
- tes3mp.MessageBox(pid,-1, color.White .. "You have gained a " .. color.Coral .. "RageLevel" .. color.White .. "!\n")
- tes3mp.SendMessage(pid, color.BlueViolet .. "Congratulations! You are now Rage Level " .. color.BlueViolet .. levelMessage .. "!\n" ..
- color.White .. "Type " .. color.Gold .. "/rage " .. color.White .. "to bring up the " .. color.Coral .. "Rage " .. color.White .. "menu.\n",false)
- elseif Players[pid].data.customVariables.rageExp >= nextlevel and Players[pid].data.customVariables.rageLevel >= 1 then
- Players[pid].data.customVariables.rageLevel = Players[pid].data.customVariables.rageLevel + 1
- Players[pid].data.customVariables.ragePoints = Players[pid].data.customVariables.ragePoints + 5
- logicHandler.RunConsoleCommandOnPlayer(pid, 'playsound "Conjuration Hit"')
- local levelMessage = Players[pid].data.customVariables.rageLevel
- tes3mp.MessageBox(pid,-1, color.White .. "You have gained a " .. color.Coral .. "RageLevel" .. color.White .. "!\n")
- tes3mp.SendMessage(pid, color.BlueViolet .. "Congratulations! You are now Rage Level " .. color.BlueViolet .. levelMessage .. "!\n",false)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement