forked from ornfelt/azerothcore_lua_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLowCreatureXP.lua
More file actions
41 lines (35 loc) · 1.63 KB
/
LowCreatureXP.lua
File metadata and controls
41 lines (35 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--[[
--Credits go to Dinkledork
--This script was made for someone who wanted to receive xp for low level mobs.
--The Calculations are based on these results online, but they're probably too high so change them to whatever you want.:
--XP = (Char Level * 5) + 45, where Char Level = Mob Level, for mobs in Azeroth
--XP = (Char Level * 5) + 235, where Char Level = Mob Level, for mobs in Outland
--XP = (Char Level * 5) + 580, where Char Level = Mob Level, for mobs in Northrend
--XP = (Char Level * 5) + 1878, where Char Level = Mob Level, for mobs in Cataclysm
local ENABLED = false --change to true or false depending on whether or not you want the script enabled.
local XP_MODIFIER = 0.05 --change me to be whatever you want
local BASE_XP = 15
--You don't need to modify anything below.
-- Function to be called when a player kills a creature
local function LOW_OnKillCreature(event, player, creature)
-- Check if the experience calculation and award is enabled
if ENABLED then
-- Check if the creature's level is not equal to 1
if creature:GetLevel() ~= 1 then
-- Check if the creature's level is 5 levels or lower than the player's level
if creature:GetLevel() <= player:GetLevel() - 5 then
-- Calculate the experience value
local xp = (player:GetLevel() * XP_MODIFIER) + BASE_XP
-- Give the player the experience
player:GiveXP(xp, creature)
end
end
end
end
-- Function to enable or disable the experience calculation and award
function EnableXPAward(enable)
ENABLED = enable
end
-- Register the LOW_OnKillCreature function for the player event 7
RegisterPlayerEvent(7, LOW_OnKillCreature)
]]