mirror of
https://github.com/araxiaonline/RandomScriptsforAzerothCore.git
synced 2026-06-13 02:22:19 -04:00
Add files via upload
This commit is contained in:
38
LowCreatureXP.lua
Normal file
38
LowCreatureXP.lua
Normal file
@@ -0,0 +1,38 @@
|
||||
--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 = true --change to true or false depending on whether or not you want the script enabled.
|
||||
local XP_MODIFIER = 0.25 --change me to be whatever you want
|
||||
local BASE_XP = 45
|
||||
|
||||
--You don't need to modify anything below.
|
||||
|
||||
-- Function to be called when a player kills a creature
|
||||
local function 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 OnKillCreature function for the player event 7
|
||||
RegisterPlayerEvent(7, OnKillCreature)
|
||||
17
LowQuestXP.lua
Normal file
17
LowQuestXP.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
local g_CustomDiffFactor = 3
|
||||
|
||||
local function OnGossipHello(event, player, object)
|
||||
for i = 1, 10 do
|
||||
player:GossipMenuAddItem(0, "Set difficulty factor to " .. i, 0, i)
|
||||
end
|
||||
player:GossipSendMenu(1, object)
|
||||
end
|
||||
|
||||
local function OnGossipSelect(event, player, object, sender, intid, code, menu_id)
|
||||
SetGlobalVariable("g_CustomDiffFactor", intid)
|
||||
player:SendBroadcastMessage("Difficulty factor set to " .. intid)
|
||||
player:GossipComplete()
|
||||
end
|
||||
|
||||
RegisterCreatureGossipEvent(400031, 1, OnGossipHello)
|
||||
RegisterCreatureGossipEvent(400031, 2, OnGossipSelect)
|
||||
@@ -1,9 +1,3 @@
|
||||
-- Name: Reload Scripts
|
||||
-- Details: Reloads lua scripts for faster development.
|
||||
-- Usage: Type "reload scripts" in the mangosd console or in-game.
|
||||
-- Website: https://github.com/RStijn
|
||||
|
||||
-- Functions
|
||||
function reloadElunaEngine(event, player, command)
|
||||
if command == "reload scripts" or command == "reloadscripts" then
|
||||
if player == nil or player:IsGM() then -- console or gm
|
||||
|
||||
Reference in New Issue
Block a user