mirror of
https://github.com/araxiaonline/RandomScriptsforAzerothCore.git
synced 2026-06-13 10:22:22 -04:00
Add files via upload
This commit is contained in:
@@ -1,12 +1,17 @@
|
||||
local ENABLED = true -- set to false to disable
|
||||
|
||||
local GAME_EVENT_ID = 17 -- Set the game event ID
|
||||
local MAX_NPC_SPAWN = 3 -- Set the maximum number of NPCs to spawn simultaneously. Extremely high numbers will hurt performance
|
||||
local ATTACK_CHANCE = 15 -- Set the likelihood of an attack here, in percent
|
||||
local DAZE_SPELL_ID = 100201 -- Set the spell ID for daze
|
||||
local MINIMUM_LEVEL = 15 -- Set min level to be active
|
||||
local EXCLUDED_MAP_ID = 530
|
||||
|
||||
local creatureEntries = {
|
||||
16423,
|
||||
16422,
|
||||
400011
|
||||
400011,
|
||||
400057
|
||||
} -- Add NPC entries above (CHANGE THESE OR IT WON'T WORK! I'M USING CUSTOM IDs)
|
||||
|
||||
local npcdialogue = {
|
||||
@@ -28,6 +33,12 @@ local function IsGameEventActive(eventId)
|
||||
end
|
||||
|
||||
local function SpawnAttacker(event, player)
|
||||
if not ENABLED then
|
||||
return
|
||||
end
|
||||
if player:GetLevel() < MINIMUM_LEVEL or player:GetMapId() == EXCLUDED_MAP_ID then
|
||||
return
|
||||
end
|
||||
if IsGameEventActive(GAME_EVENT_ID) then
|
||||
local chance = math.random(100)
|
||||
|
||||
@@ -39,10 +50,10 @@ local function SpawnAttacker(event, player)
|
||||
local npcCount = math.random(1, MAX_NPC_SPAWN)
|
||||
|
||||
-- Check if the player is mounted and not flying
|
||||
if player:IsMounted() and not player:IsFlying() then
|
||||
if player:IsMounted() and not player:IsFlying() then
|
||||
player:Dismount()
|
||||
player:CastSpell(player, DAZE_SPELL_ID, true)
|
||||
player:SendBroadcastMessage("You have been knocked off your mount!")
|
||||
player:CastSpell(player, DAZE_SPELL_ID, true)
|
||||
player:SendBroadcastMessage("You have been knocked off your mount!")
|
||||
end
|
||||
|
||||
for i = 1, npcCount do
|
||||
|
||||
Reference in New Issue
Block a user