From bd7b2fd4bba07498eee43118bd1dca0bb8e80371 Mon Sep 17 00:00:00 2001 From: Dinkledork <118951051+Day36512@users.noreply.github.com> Date: Tue, 21 Mar 2023 02:26:56 -0600 Subject: [PATCH] Add files via upload --- Deadmines/CaptainRattlebones.lua | 54 + HardcoreMode/Hardcore.lua | 60 + HardcoreMode/HardcoreItemRemoval.lua | 39 + Holliday/CustomGreench.lua | 38 + Kara/PrinceTenris.lua | 57 + MiscTools/ChromieEventScripts.lua | 2037 +++++++++++++++++++++++++ MiscTools/DinkleStone1.lua | 102 ++ MiscTools/Dinklestone2.lua | 51 + MiscTools/FelRushSoundFix.lua | 12 + MiscTools/FlyableWaypoints.lua | 8 + MiscTools/Murky.lua | 28 + MiscTools/SmolderingEmberRestrict.lua | 46 + MiscTools/SoL.lua | 12 + MiscTools/reload_scripts.lua | 7 + MoltenCore/CoreRager.lua | 43 + MoltenCore/Gehennas.lua | 50 + MoltenCore/GemVendor.lua | 185 +++ MoltenCore/Golemagg.lua | 49 + MoltenCore/Hazzrash.lua | 59 + MoltenCore/Lucifron.lua | 53 + MoltenCore/Magmadar.lua | 66 + MoltenCore/Magmakin.lua | 45 + MoltenCore/Smolder.lua | 103 ++ MoltenCore/SocketeerV1 .lua | 39 + VanillaDungeonScourge/Scorn.lua | 76 + VanillaDungeonScourge/Sever.lua | 35 + 26 files changed, 3354 insertions(+) create mode 100644 Deadmines/CaptainRattlebones.lua create mode 100644 HardcoreMode/Hardcore.lua create mode 100644 HardcoreMode/HardcoreItemRemoval.lua create mode 100644 Holliday/CustomGreench.lua create mode 100644 Kara/PrinceTenris.lua create mode 100644 MiscTools/ChromieEventScripts.lua create mode 100644 MiscTools/DinkleStone1.lua create mode 100644 MiscTools/Dinklestone2.lua create mode 100644 MiscTools/FelRushSoundFix.lua create mode 100644 MiscTools/FlyableWaypoints.lua create mode 100644 MiscTools/Murky.lua create mode 100644 MiscTools/SmolderingEmberRestrict.lua create mode 100644 MiscTools/SoL.lua create mode 100644 MiscTools/reload_scripts.lua create mode 100644 MoltenCore/CoreRager.lua create mode 100644 MoltenCore/Gehennas.lua create mode 100644 MoltenCore/GemVendor.lua create mode 100644 MoltenCore/Golemagg.lua create mode 100644 MoltenCore/Hazzrash.lua create mode 100644 MoltenCore/Lucifron.lua create mode 100644 MoltenCore/Magmadar.lua create mode 100644 MoltenCore/Magmakin.lua create mode 100644 MoltenCore/Smolder.lua create mode 100644 MoltenCore/SocketeerV1 .lua create mode 100644 VanillaDungeonScourge/Scorn.lua create mode 100644 VanillaDungeonScourge/Sever.lua diff --git a/Deadmines/CaptainRattlebones.lua b/Deadmines/CaptainRattlebones.lua new file mode 100644 index 0000000..ee6fe61 --- /dev/null +++ b/Deadmines/CaptainRattlebones.lua @@ -0,0 +1,54 @@ +local NPC_CAPTAIN_RATTLEBONES = 400115 + +local SPELL_SHADOW_BOLT = 20791 +local SPELL_CURSE_OF_THE_PIRATE_KING = 70542 +local SPELL_PIRATES_CLEAVE = 40505 +local SPELL_CANNONBALL_BARRAGE = 6251 + +local YELL_AGGRO_DIALOGUE = { + "Ye be treadin' on dangerous waters!", + "Yarr, ye landlubbers be meetin' yer doom!", + "Arrr, ye won't leave me ship alive!", + "I be sendin' ye to the depths of the sea!", + "Ye be facin' the wrath of Captain Rattlebones!" +} + +local YELL_DEATH_DIALOGUE = "Me ship...me crew...I be joinin' ye soon..." + +local function CastShadowBolt(creature) + creature:CastSpell(creature:GetVictim(), SPELL_SHADOW_BOLT, false) +end + +local function CastCurseOfThePirateKing(creature) + creature:CastSpell(creature:GetVictim(), SPELL_CURSE_OF_THE_PIRATE_KING, false) +end + +local function CastPiratesCleave(creature) + creature:CastSpell(creature:GetVictim(), SPELL_PIRATES_CLEAVE, false) +end + +local function CastCannonballBarrage(creature) + creature:CastSpell(creature:GetVictim(), SPELL_CANNONBALL_BARRAGE, false) +end + +local function CaptainRattlebones_OnEnterCombat(event, creature, target) + creature:SendUnitYell(YELL_AGGRO_DIALOGUE[math.random(1, #YELL_AGGRO_DIALOGUE)], 0) + creature:RegisterEvent(CastShadowBolt, math.random(2000, 4000), 0) + creature:RegisterEvent(CastCurseOfThePirateKing, math.random(10000, 15000), 0) + creature:RegisterEvent(CastPiratesCleave, math.random(6000, 10000), 0) + creature:RegisterEvent(CastCannonballBarrage, math.random(15000, 20000), 0) +end + +local function CaptainRattlebones_OnLeaveCombat(event, creature) + creature:RemoveEvents() -- Remove events when leaving combat +end + +local function CaptainRattlebones_OnDied(event, creature, killer) + creature:RemoveEvents() -- Remove events when died + creature:SendUnitSay(YELL_DEATH_DIALOGUE, 0) +end + +RegisterCreatureEvent(NPC_CAPTAIN_RATTLEBONES, 1, CaptainRattlebones_OnEnterCombat) +RegisterCreatureEvent(NPC_CAPTAIN_RATTLEBONES, 2, CaptainRattlebones_OnLeaveCombat) +RegisterCreatureEvent(NPC_CAPTAIN_RATTLEBONES, 4, CaptainRattlebones_OnDied) + diff --git a/HardcoreMode/Hardcore.lua b/HardcoreMode/Hardcore.lua new file mode 100644 index 0000000..ccefa5a --- /dev/null +++ b/HardcoreMode/Hardcore.lua @@ -0,0 +1,60 @@ +--NPC id +local hcNPC = 90000 +--This is how long the character is locked for - default is 32 years. +local banTimer = 999999999 + +--on death function - checks if player has token and bans character if it does. +local function PlayerDeath(event, killer, killed) + if killed:HasItem(90000,1) and killed:GetLevel() == 1 then + print(killed:GetName() .. " was killed by " .. killer:GetName()) + SendWorldMessage(killed:GetName() .. " was killed by " .. killer:GetName()) + Ban(1,killed:GetName(),banTimer) + end +end + +--First Gossip Screen for NPC +function OnFirstTalk(event, player, unit) + if player:GetLevel() == 1 then + player:PlayDistanceSound(20431) + player:GossipMenuAddItem(0, "Looking for a challenge? Click here to try hardcore mode!", 0, 1) + player:GossipSendMenu(1, unit) + else + player:SendBroadcastMessage("You must be level 1 to access hardcore mode.") + player:PlayDistanceSound(20432) + player:GossipComplete() + end +end + +--Selection for NPC gossip +function OnSelect(event, player, unit, sender, intid, code) + if intid == 1 then + player:PlayDistanceSound(20433) + player:GossipMenuAddItem(0, "Just double checking to make sure that you want to turn on hardcore mode. This will lock the character after death to be no longer playable, remove all your current gold, remove bonus starter items and Murky will no longer be with you! I will likely be adding rewards for reaching certain stages of the game later...", 0, 2) + player:GossipMenuAddItem(0, "NO TAKE ME BACK!", 0, 3) + player:GossipSendMenu(2, unit) + end +end + +--if player chooses to do hardcore they receive the token and have custom items and Murky removed +function OnHardCore(event, player, unit, sender, intid, code) + if intid == 2 then + player:PlayDistanceSound(20434) + player:AddItem(90000, 1) + player:SetCoinage(0) + player:RemoveItem(60002, player:GetItemCount(60002)) + player:RemoveItem(10594, player:GetItemCount(10594)) + player:RemoveItem(65000, player:GetItemCount(65000)) + player:RemoveSpell(24939) + player:RemoveSpell(100117) + player:RemoveSpell(100118) + --else gossip ends + else + player:GossipComplete() + player:PlayDistanceSound(20434) + end +end + +RegisterCreatureGossipEvent(hcNPC, 1 , OnFirstTalk) +RegisterCreatureGossipEvent(hcNPC, 2, OnSelect) +RegisterCreatureGossipEvent(hcNPC, 2, OnHardCore) +RegisterPlayerEvent(8, PlayerDeath) diff --git a/HardcoreMode/HardcoreItemRemoval.lua b/HardcoreMode/HardcoreItemRemoval.lua new file mode 100644 index 0000000..6547bab --- /dev/null +++ b/HardcoreMode/HardcoreItemRemoval.lua @@ -0,0 +1,39 @@ +local function hasItem90000(player) +return player:GetItemCount(90000) > 0 +end + +-- Remove custom starter items +local function removeItems(player) +local removed = false +local items = {60002, 10594, 65000} +for _, entry in ipairs(items) do +local itemCount = player:GetItemCount(entry) +if itemCount > 0 then +for i = 0, itemCount - 1 do +player:RemoveItem(entry, 1) +end +removed = true +end +end +return removed +end + +-- Remove Murky +local function removeSpell(player) + player:RemoveSpell(24939) + player:RemoveSpell(100117) + player:RemoveSpell(100118) +end + +-- Script body +local function onLogin(event, player) +if hasItem90000(player) then +if removeItems(player) then +player:SendBroadcastMessage("Welcome to Hardcore Mode. Please watch your step!") +end +removeSpell(player) +end +end + +-- Register the script to be triggered on player login +RegisterPlayerEvent(3, onLogin) \ No newline at end of file diff --git a/Holliday/CustomGreench.lua b/Holliday/CustomGreench.lua new file mode 100644 index 0000000..7aefd29 --- /dev/null +++ b/Holliday/CustomGreench.lua @@ -0,0 +1,38 @@ +--Needs lots and lots of work. Register health check to event 9. +--Add true false statements to check if he's reached below 50. +--Don't remove events unnecessarily + +local AbominableGreench = {}; + +function AbominableGreench.OnDie(event, creature) +creature:SendUnitYell("Argh... I'll be back!", 0) +end + +function AbominableGreench.Enrage(event, delay, calls, creature) +if (creature:GetHealthPct() <= 50) then +creature:RemoveEvents() +creature:CastSpell(creature, 61369, true) +creature:RegisterEvent(AbominableGreench.FrostAttack, 4000, 0) +end +end + +function AbominableGreench.FrostAttack(event, delay, calls, creature) +local TARGET = creature:GetAITarget(1, true, 0, 45) +creature:CastSpell(TARGET, 35263, true) +end + +function AbominableGreench.OnEnterCombat(event, creature, target) +local TARGET = creature:GetAITarget(1, true, 0, 45) +creature:CastSpell(TARGET, 33547, true) +creature:SendUnitYell("You can try to stop me, but it's just a waste of time. I'm the king of Winter Veil crime!", 0) +creature:RegisterEvent(AbominableGreench.Enrage, 1000, 0) +end + +function AbominableGreench.OnLeaveCombat(event, creature) +creature:SendUnitYell("What's the matter? Don't you like my holiday spirit?", 0) +creature:RemoveEvents() +end + +RegisterCreatureEvent(13602, 1, AbominableGreench.OnEnterCombat) +RegisterCreatureEvent(13602, 2, AbominableGreench.OnLeaveCombat) +RegisterCreatureEvent(13602, 4, AbominableGreench.OnDie) \ No newline at end of file diff --git a/Kara/PrinceTenris.lua b/Kara/PrinceTenris.lua new file mode 100644 index 0000000..023da66 --- /dev/null +++ b/Kara/PrinceTenris.lua @@ -0,0 +1,57 @@ +local PRINCE_TENRIS_MIRKBLOOD = 28194 -- The id of Prince Tenris Mirkblood +local BLOOD_MIRROR = 70838 +local SUMMON_SANGUINE_SPIRIT = 51280 +local SANGUINE_STRIKE = 51285 +local BLOOD_SWOOP = 50923 + +local function CastBloodMirror(eventId, delay, calls, creature) +local raidMembers = creature:GetAITargets(10) -- Get up to 10 raid members +if #raidMembers > 0 then +local targetIndex = math.random(1, #raidMembers) +local randomTarget = raidMembers[targetIndex] +if randomTarget then +creature:CastSpell(randomTarget, BLOOD_MIRROR) +end +end +end + +local function CastSanguineSpirit(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), SUMMON_SANGUINE_SPIRIT, true) +end + +local function CastSanguineStrike(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), SANGUINE_STRIKE) +end + +local function CastBloodSwoop(eventId, delay, calls, creature) +local raidMembers = creature:GetAITargets(10) -- Get up to 10 raid members +if #raidMembers > 0 then +local targetIndex = math.random(1, #raidMembers) +local randomTarget = raidMembers[targetIndex] +if randomTarget then +creature:CastSpell(randomTarget, BLOOD_SWOOP) +end +end +end + +local function OnEnterCombat(event, creature, target) +creature:RegisterEvent(CastBloodMirror, math.random(26000, 42000), 0) +creature:RegisterEvent(CastSanguineSpirit, math.random(3000, 6000), 0) +creature:RegisterEvent(CastSanguineStrike, math.random(11000, 19000), 0) +creature:RegisterEvent(CastBloodSwoop, 23000, 0) +end + +local function OnLeaveCombat(event, creature) +creature:RemoveEvents() +end + +local function OnDied(event, creature, killer) +creature:RemoveEvents() +end + +RegisterCreatureEvent(PRINCE_TENRIS_MIRKBLOOD, 1, OnEnterCombat) +RegisterCreatureEvent(PRINCE_TENRIS_MIRKBLOOD, 2, OnLeaveCombat) +RegisterCreatureEvent(PRINCE_TENRIS_MIRKBLOOD, 4, OnDied) + + + diff --git a/MiscTools/ChromieEventScripts.lua b/MiscTools/ChromieEventScripts.lua new file mode 100644 index 0000000..941bfa4 --- /dev/null +++ b/MiscTools/ChromieEventScripts.lua @@ -0,0 +1,2037 @@ +--Copyright (C) 2022 https://github.com/55Honey +-- +--This program is free software: you can redistribute it and/or modify +--it under the terms of the GNU Affero General Public License as published by +--the Free Software Foundation, either version 3 of the License, or +--(at your option) any later version. +-- +--This program is distributed in the hope that it will be useful, +--but WITHOUT ANY WARRANTY; without even the implied warranty of +--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +--GNU Affero General Public License for more details. +-- +--You should have received a copy of the GNU Affero General Public License +--along with this program. If not, see . +-- +-- +-- +-- +-- Created by IntelliJ IDEA. +-- User: Silvia +-- Date: 17/05/2021 +-- Time: 19:50 +-- To change this template use File | Settings | File Templates. +-- Originally created by Honey for Azerothcore +-- requires ElunaLua module + + +-- This module spawns (custom) NPCs and grants them scripted combat abilities +------------------------------------------------------------------------------------------------ +-- ADMIN GUIDE: - compile the core with ElunaLua module +-- - adjust config in this file +-- - add this script to ../lua_scripts/ +-- - adjust the IDs and config flags in case of conflicts and run the associated SQL to add the required NPCs +-- - the acore_cms module assumes that 1112001 is the boss of encounter 1 and adding +10 for each subsequent encounter +-- (1112011 = boss for encounter 2 / 1112021 = boss for encounter 3, etc.) +------------------------------------------------------------------------------------------------ +-- GM GUIDE: - use .startevent $event $difficulty to start and spawn +-- - maybe offer teleports +-- - use .stopevent to end the event and despawn the NPC +------------------------------------------------------------------------------------------------ +local Config = {} --general config flags + +local Config_npcEntry = {} --db entry of the NPC creature to summon the boss +local Config_npcText = {} --gossip in npc_text to be told by the summoning NPC +local Config_bossEntry = {} --db entry of the boss creature +local Config_addEntry = {} --db entry of the add creature + +local Config_bossSpell1 = {} --directly applied to the tank +local Config_bossSpell2 = {} --randomly applied to a player in 35m(configurable) range +local Config_bossSpell2MaxRange = {} --max range im m to check for targets for boss spell 2 (default 35) +local Config_bossSpell3 = {} --on the 2nd nearest player within 30m (only when adds are dead) +local Config_bossSpell4 = {} --on a random player within 40m (only when adds are dead) +local Config_bossSpell4Counter = {} --amount of casts to perform for spell 4. defaults to 1 +local Config_bossSpell4MaxRange = {} --max range im m to check for targets for boss spell 4 (default 40) +local Config_bossSpell5 = {} --directly applied to the tank with adds alive +local Config_bossSpell6 = {} --directly applied to the tank when adds are dead +local Config_bossSpell7 = {} --directly applied to the tank +local Config_bossSpell8 = {} --directly applied to the tank x seconds after spell 7 +local Config_bossSpell8delay = {} --delay between spell 7 and 8. Must be smaller than timer7 / 2 +local Config_bossSpellSelf = {} --cast on boss while adds are still alive +local Config_bossSpellEnrage = {} --cast on boss once after Config_bossSpellEnrageTimer ms have passed + +local Config_bossSpellTimer1 = {} -- This timer applies to Config_bossSpell1 (in ms) +local Config_bossSpellTimer2 = {} -- This timer applies to Config_bossSpell2 (in ms) +local Config_bossSpellTimer3 = {} -- This timer applies to Config_bossSpellSelf in phase 1 and Config_bossSpell3+4 randomly later (in ms) +-- local Config_bossSpellTimer4 = {} -- Not used. Timer3 covers BossSpells 3+4 +local Config_bossSpellTimer5 = {} -- This timer applies to Config_bossSpell5+6 (in ms) +-- local Config_bossSpellTimer6 = {} -- Not used. Timer5 covers BossSpells 5+6 +local Config_bossSpellTimer7 = {} -- This timer applies to Config_bossSpell7+8 (in ms) +-- local Config_bossSpellTimer8 = {} -- Not used. Timer7 covers BossSpells 7+8 +local Config_bossSpellEnrageTimer = {} -- Time in ms until Config_bossSpellEnrage is cast +local Config_minPhaseForTimer7 = {} -- From this phase on the boss will use Timer 7 to cast Spell 7+8 + +local Config_bossSpellModifier1bp0 = {} -- Custom base value of the spell 1s effect #1. Default if left out. +local Config_bossSpellModifier1bp1 = {} -- Custom base value of the spell 1s effect #2. Default if left out. +local Config_bossSpellModifier2bp0 = {} -- Custom base value of the spell 2s effect #1. Default if left out. +local Config_bossSpellModifier2bp1 = {} -- Custom base value of the spell 2s effect #2. Default if left out. +local Config_bossSpellModifier3bp0 = {} -- Custom base value of the spell 3s effect #1. Default if left out. +local Config_bossSpellModifier3bp1 = {} -- Custom base value of the spell 3s effect #2. Default if left out. +local Config_bossSpellModifier4bp0 = {} -- Custom base value of the spell 4s effect #1. Default if left out. +local Config_bossSpellModifier4bp1 = {} -- Custom base value of the spell 4s effect #2. Default if left out. +local Config_bossSpellModifier5bp0 = {} -- Custom base value of the spell 5s effect #1. Default if left out. +local Config_bossSpellModifier5bp1 = {} -- Custom base value of the spell 5s effect #2. Default if left out. +local Config_bossSpellModifier6bp0 = {} -- Custom base value of the spell 6s effect #1. Default if left out. +local Config_bossSpellModifier6bp1 = {} -- Custom base value of the spell 6s effect #2. Default if left out. +local Config_bossSpellModifier7bp0 = {} -- Custom base value of the spell 6s effect #1. Default if left out. +local Config_bossSpellModifier7bp1 = {} -- Custom base value of the spell 6s effect #2. Default if left out. +local Config_bossSpellModifier8bp0 = {} -- Custom base value of the spell 6s effect #1. Default if left out. +local Config_bossSpellModifier8bp1 = {} -- Custom base value of the spell 6s effect #2. Default if left out. + +local Config_addHealthModifierParty = {} -- modifier to change health for party encounter. Value in the SQL applies for raid +local Config_addsAmount = {} -- how many adds will spawn + +local Config_addSpell1 = {} -- min range 30m, 1-3rd farthest target within 30m +local Config_addSpell2 = {} -- min range 45m, cast on tank +local Config_addSpell3 = {} -- min range 0m, cast on Self +local Config_addSpell4 = {} -- cast on the boss + +local Config_addSpellEnrage = {} -- This spell will be cast on the add in 5man mode only after 300 seconds +local Config_addSpellTimer1 = {} -- This timer applies to Config_addSpell1 (in ms) +local Config_addSpellTimer2 = {} -- This timer applies to Config_addSpell2 (in ms) +local Config_addSpellTimer3 = {} -- This timer applies to Config_addSpell3 (in ms) +local Config_addSpellTimer4 = {} -- This timer applies to Config_addSpell4 (in ms) + +local Config_addSpellModifier1bp0 = {} -- Custom base value of the spell 1s effect #1. Default if left out. +local Config_addSpellModifier1bp1 = {} -- Custom base value of the spell 1s effect #2. Default if left out. +local Config_addSpellModifier2bp0 = {} -- Custom base value of the spell 2s effect #1. Default if left out. +local Config_addSpellModifier2bp1 = {} -- Custom base value of the spell 2s effect #2. Default if left out. +local Config_addSpellModifier3bp0 = {} -- Custom base value of the spell 3s effect #1. Default if left out. +local Config_addSpellModifier3bp1 = {} -- Custom base value of the spell 3s effect #2. Default if left out. + +local Config_aura1Add1 = {} -- an aura to add to the 1st add +local Config_aura2Add1 = {} -- another aura to add to the 1st add +local Config_aura1Add2 = {} -- an aura to add to the 2nd add +local Config_aura2Add2 = {} -- another aura to add to the 2nd add +local Config_aura1Add3 = {} -- an aura to add to all adds from the 3rd on +local Config_aura2Add3 = {} -- another aura to add to all adds from the 3rd on + +local Config_addSpell3Yell = {} -- yell for the adds when Spell 3 is cast +local Config_addEnoughYell = {} -- yell for the add at 33% and 66% hp +local Config_addEnoughSound = {} -- sound to play when the add is at 33% and 66% +local Config_addSpell2Sound = {} -- sound to play when add casts spell 2 +local Config_bossYellPhase2 = {} -- yell for the boss when phase 2 starts +local Config_bossSpellSelfYell = {} -- yell for the boss when they cast on themself + +local Config_fireworks = {} -- these are the fireworks to be cast randomly for 20s when an encounter was beaten + +------------------------------------------ +-- Begin of config section +------------------------------------------ + +-- Name of Eluna dB scheme +Config.customDbName = "ac_eluna" +-- Min GM rank to start an event +Config.GMRankForEventStart = 2 +-- Min GM rank to add NPCs to the db +Config.GMRankForUpdateDB = 3 +-- set to 1 to print error messages to the console. Any other value including nil turns it off. +Config.printErrorsToConsole = 1 +-- time in ms before adds enrage in 5man mode +Config.addEnrageTimer = 300000 +-- spell to cast at 33 and 66%hp in party mode (charge with a knockback = 19471) +Config.addEnoughSpell = 19471 +-- base score per encounter +Config.baseScore = 40 +-- additional score per difficulty level +Config.additionalScore = 10 +-- set to award score for beating raids. Any other value including nil turns it off. +Config.rewardRaid = 1 +-- set to 1 to store succesful raid attempts in the db. Any other value including nil turns it off. +Config.storeRaid = 1 +-- set to award score for beating party encounter. Any other value including nil turns it off. +Config.rewardParty = 0 +-- set to 1 to store succesful party attempts in the db. Any other value including nil turns it off. +Config.storeParty = 1 +-- npc entry for party-only mode +Config.partySelectNpc = 1112999 +-- generic welcome text1 +Config.defaultNpcText1 = 91101 +-- generic welcome text2 +Config.defaultNpcText2 = 91102 +-- activate permanent 5man only NPC +Config.partySelectNpcActive = 0 +-- Map where to spawn the exchange NPC +Config.InstanceId = 0 +Config.MapId = 1 +-- Pos where to spawn the exchange NPC +Config.NpcX = -7168.4 +Config.NpcY = -3961.6 +Config.NpcZ = 9.403 +Config.NpcO = 6.24 +Config.PartyNpcYellText = 'Come to the Gadgetzan graveyard, if you dare. Try and prove yourself to Chromie!' +Config.PartyNpcSayText = 'What are you waiting for? Bring a party of five and step up against the enemies of time!' + +------------------------------------------ +-- List of encounters: +-- 1: Level 50, Glorifrir Flintshoulder / Zombie Captain +-- 2: Level 40, Pondulum of Deem / Seawitch +-- 3: Level 50, Crocolisk Dundee / Aligator Minion +-- 4: Level 50, Crocolisk Bunbee / Aligator Pet +-- 5: Level 60, Crocolisk Rundee / Aligator Guard +-- 6: Level 60: One-Three-Three-Seven / Ragnarosqt +-- 7: Level 60: Big Bad Bug / Bug's Bunny +------------------------------------------ + +------------------------------------------ +-- Begin of encounter 1 config +------------------------------------------ + +-- Database NPC entries. Must match the associated .sql file +Config_bossEntry[1] = 1112001 --db entry of the boss creature +Config_npcEntry[1] = 1112002 --db entry of the NPC creature to summon the boss +Config_addEntry[1] = 1112003 --db entry of the add creature +Config_npcText[1] = 91111 --gossip in npc_text to be told by the summoning NPC + +-- list of spells: +Config_bossSpell1[1] = 38846 --directly applied to the tank-- Forceful Cleave (Target + nearest ally) +Config_bossSpell2[1] = 45108 --randomly applied to a player in 35m range-- CKs Fireball +Config_bossSpell2MaxRange[1] = 35 --max range im m/y to check for targets for boss spell 2 (default 35) +Config_bossSpell3[1] = 53721 --on the 2nd nearest player within 30m-- Death and decay (10% hp per second) +Config_bossSpell4[1] = 37279 --on a random player within 40m-- Rain of Fire +Config_bossSpell4Counter[1] = 1 --amount of casts to perform for spell 4. defaults to 1 +Config_bossSpell4MaxRange[1] = 40 --max range im m to check for targets for boss spell 4 (default 40) +Config_bossSpell5[1] = nil --this line is not neccesary. If a spell is missing it will just be skipped +Config_bossSpell6[1] = nil --this line is not neccesary. If a spell is missing it will just be skipped +Config_bossSpellSelf[1] = 69898 --cast on boss while adds are still alive-- Hot +Config_bossSpellEnrage[1] = 69166 --cast on boss once after Config_bossSpellEnrageTimer ms have passed-- Soft Enrage + +Config_bossSpellTimer1[1] = 19000 -- This timer applies to Config_bossSpell1 +Config_bossSpellTimer2[1] = 23000 -- This timer applies to Config_bossSpell2 +Config_bossSpellTimer3[1] = 11000 -- This timer applies to Config_bossSpellSelf in phase 1 and Config_bossSpell3+4 randomly later +Config_bossSpellTimer5[1] = nil -- This timer applies to Config_bossSpell5+6 +Config_bossSpellEnrageTimer[1] = 180000 + +Config_bossSpellModifier1bp0[1] = nil -- base damage of the Cleave +Config_bossSpellModifier1bp1[1] = nil -- not required if nil +Config_bossSpellModifier2bp0[1] = 2000 -- Fireball modifier hit +Config_bossSpellModifier2bp1[1] = 2000 -- Fireball modifier tick +Config_bossSpellModifier3bp0[1] = 10 -- base damage of the D&D +Config_bossSpellModifier3bp1[1] = nil -- not required if nil +Config_bossSpellModifier4bp0[1] = 1200 -- tick damage of fire rain +Config_bossSpellModifier4bp1[1] = nil -- not required if nil +Config_bossSpellModifier5bp0[1] = nil -- not required if nil +Config_bossSpellModifier5bp1[1] = nil -- not required if nil +Config_bossSpellModifier6bp0[1] = nil -- not required if nil +Config_bossSpellModifier6bp1[1] = nil -- not required if nil + + +Config_addHealthModifierParty[1] = 1 -- modifier to change health for party encounter. Value in the SQL applies for raid +Config_addsAmount[1] = 3 -- how many adds will spawn + +Config_addSpell1[1] = 12421 -- min range 30m, 1-3rd farthest target within 30m -- Mithril Frag Bomb 8y 149-201 damage + stun +Config_addSpell2[1] = 60488 -- min range 45m, cast on tank -- Shadow Bolt (30) +Config_addSpell3[1] = 24326 -- min range 0m -- HIGH knockback (ZulFarrak beast) +Config_addSpell4[1] = 69898 -- cast on boss - Hot +Config_addSpellEnrage[1] = 69166 -- Enrage after 300 seconds + +Config_addSpellTimer1[1] = 13000 -- This timer applies to Config_addSpell1 +Config_addSpellTimer2[1] = 11000 -- This timer applies to Config_addSpell2 +Config_addSpellTimer3[1] = 37000 -- This timer applies to Config_addSpell3 +Config_addSpellTimer4[1] = 12000 -- This timer applies to Config_addSpell4 + +Config_addSpellModifier1bp0[1] = 500 -- not required if nil +Config_addSpellModifier1bp1[1] = nil -- not required if nil +Config_addSpellModifier2bp0[1] = 2000 -- not required if nil +Config_addSpellModifier2bp1[1] = nil -- not required if nil +Config_addSpellModifier3bp0[1] = nil -- not required if nil +Config_addSpellModifier3bp1[1] = nil -- not required if nil + +Config_aura1Add1[1] = 34184 -- an aura to add to the 1st add-- Arcane +Config_aura2Add1[1] = 7941 -- another aura to add to the 1st add-- Nature +Config_aura1Add2[1] = 7942 -- an aura to add to the 2nd add-- Fire +Config_aura2Add2[1] = 7940 -- another aura to add to the 2nd add-- Frost +Config_aura1Add3[1] = 34182 -- an aura to add to the 3rd add-- Holy +Config_aura2Add3[1] = 34309 -- another aura to add to the 3rd add-- Shadow + +Config_addSpell3Yell[1] = "Me smash." -- yell for the adds when Spell 3 is cast +Config_addEnoughYell[1] = "ENOUGH" -- yell for the add at 33% and 66% hp +Config_addEnoughSound[1] = 412 -- sound to play when the add is at 33% and 66% +Config_addSpell2Sound[1] = 6436 -- sound to play when add casts spell 2 +--yell for the boss when all adds are dead +Config_bossYellPhase2[1] = "You might have handled these creatures. But now I WILL handle YOU!" +-- yell for the boss when they cast on themself +Config_bossSpellSelfYell[1] = nil + +------------------------------------------ +-- Begin of encounter 2 config +------------------------------------------ + +-- Database NPC entries. Must match the associated .sql file +Config_bossEntry[2] = 1112011 --db entry of the boss creature +Config_npcEntry[2] = 1112012 --db entry of the NPC creature to summon the boss +Config_addEntry[2] = 1112013 --db entry of the add creature +Config_npcText[2] = 91112 --gossip in npc_text to be told by the summoning NPC + +-- list of spells: +Config_bossSpell1[2] = 33661 --directly applied to the tank-- Crush Armor: 10% reduction, stacks +Config_bossSpell2[2] = 51503 --randomly applied to a player in 35m range-- Domination +Config_bossSpell2MaxRange[2] = 35 --max range im m/y to check for targets for boss spell 2 (default 35) +Config_bossSpell3[2] = 35198 --on the 2nd nearest player within 30m-- AE fear +Config_bossSpell4[2] = 35198 --on a random player within 40m-- AE Fear +Config_bossSpell4Counter[2] = 1 --amount of casts to perform for spell 4. defaults to 1 +Config_bossSpell4MaxRange[2] = 40 --max range im m to check for targets for boss spell 4 (default 40) +Config_bossSpell5[2] = nil --this line is not neccesary. If a spell is missing it will just be skipped +Config_bossSpell6[2] = 31436 --directly applied to the tank when adds are dead +Config_bossSpellSelf[2] = nil --cast on boss while adds are still alive +Config_bossSpellEnrage[2] = 54356 --cast on boss once after Config_bossSpellEnrageTimer ms have passed-- Soft Enrage + +Config_bossSpellTimer1[2] = 10000 -- This timer applies to Config_bossSpell1 +Config_bossSpellTimer2[2] = 23000 -- This timer applies to Config_bossSpell2 +Config_bossSpellTimer3[2] = 29000 -- This timer applies to Config_bossSpellSelf in phase 1 and Config_bossSpell3+4 randomly later +Config_bossSpellTimer5[2] = 19000 -- This timer applies to Config_bossSpell5+6 +Config_bossSpellEnrageTimer[2] = 300000 + +Config_addHealthModifierParty[2] = 1 -- modifier to change health for party encounter. Value in the SQL applies for raid +Config_addsAmount[2] = 2 -- how many adds will spawn + +Config_addSpell1[2] = 10150 -- min range 30m, 1-3rd farthest target within 30m +Config_addSpell2[2] = 37704 -- min range 45m, cast on tank +Config_addSpell3[2] = 68958 -- min range 0m -- Blast Nova +Config_addSpell4[2] = 69389 -- cast on the boss +Config_addSpellEnrage[2] = nil -- Enrage after 300 seconds + +Config_addSpellTimer1[2] = 13000 -- This timer applies to Config_addSpell1 +Config_addSpellTimer2[2] = 11000 -- This timer applies to Config_addSpell2 +Config_addSpellTimer3[2] = 37000 -- This timer applies to Config_addSpell3 +Config_addSpellTimer4[2] = 23000 -- This timer applies to Config_addSpell4 + +Config_aura1Add1[2] = nil -- an aura to add to the 1st add-- +Config_aura2Add1[2] = nil -- another aura to add to the 1st add-- +Config_aura1Add2[2] = nil -- an aura to add to the 2nd add-- +Config_aura2Add2[2] = nil -- another aura to add to the 2nd add-- +Config_aura1Add3[2] = nil -- an aura to add to all ads from the 3rd on-- +Config_aura2Add3[2] = nil -- another aura to add to all add from the 3rd on-- + +Config_addSpell3Yell[2] = "Thissss." -- yell for the adds when Spell 3 is cast +Config_addEnoughYell[2] = "Ssssssuffer!"-- yell for the add at 33% and 66% hp +Config_addEnoughSound[2] = 412 -- sound to play when the add is at 33% and 66% +Config_addSpell2Sound[2] = 6436 -- sound to play when add casts spell 2 +--yell for the boss when all adds are dead +Config_bossYellPhase2[2] = "Now. You. Die." +-- yell for the boss when they cast on themself +Config_bossSpellSelfYell[2] = nil + +------------------------------------------ +-- Begin of encounter 3 config +------------------------------------------ + +-- Database NPC entries. Must match the associated .sql file +Config_bossEntry[3] = 1112021 --db entry of the boss creature +Config_npcEntry[3] = 1112022 --db entry of the NPC creature to summon the boss +Config_addEntry[3] = 1112023 --db entry of the add creature +Config_npcText[3] = 91113 --gossip in npc_text to be told by the summoning NPC + +-- list of spells: +Config_bossSpell1[3] = nil --directly applied to the tank-- +Config_bossSpell2[3] = 56909 --randomly applied to a player in 35m range-- Cleave, up to 10 targets +Config_bossSpell2MaxRange[3] = 5 --max range im m/y to check for targets for boss spell 2 (default 35) +Config_bossSpell3[3] = nil --on the 2nd nearest player within 30m-- +Config_bossSpell4[3] = 11446 --on a random player within 40m-- 5min domination +Config_bossSpell4Counter[3] = 1 --amount of casts to perform for spell 4. defaults to 1 +Config_bossSpell4MaxRange[3] = 40 --max range im m to check for targets for boss spell 4 (default 40) +Config_bossSpell5[3] = 22643 --directly applied to the tank with adds alive --volley +Config_bossSpell6[3] = 22643 --directly applied to the tank when adds are dead --volley +Config_bossSpellSelf[3] = 55948 --cast on boss while adds are still alive +Config_bossSpellEnrage[3] = 54356 --cast on boss once after Config_bossSpellEnrageTimer ms have passed-- Soft Enrage + +Config_bossSpellTimer1[3] = 10000 -- This timer applies to Config_bossSpell1 +Config_bossSpellTimer2[3] = 23000 -- This timer applies to Config_bossSpell2 +Config_bossSpellTimer3[3] = 29000 -- This timer applies to Config_bossSpellSelf in phase 1 and Config_bossSpell3+4 randomly later +Config_bossSpellTimer5[3] = 19000 -- This timer applies to Config_bossSpell5+6 +Config_bossSpellEnrageTimer[3] = 300000 + +Config_addHealthModifierParty[3] = 3 -- modifier to change health for party encounter. Value in the SQL applies for raid +Config_addsAmount[3] = 8 -- how many adds will spawn + +Config_addSpell1[3] = 29320 -- min range 30m, 1-3rd farthest target within 30m -- charge +Config_addSpell2[3] = nil -- min range 45m, cast on tank +Config_addSpell3[3] = 23105 -- min range 0m -- Lightning cloud +Config_addSpell4[3] = nil -- cast on the boss +Config_addSpellEnrage[3] = nil -- Enrage after 300 seconds + +Config_addSpellTimer1[3] = 37000 -- This timer applies to Config_addSpell1 +Config_addSpellTimer2[3] = nil -- This timer applies to Config_addSpell2 +Config_addSpellTimer3[3] = 37000 -- This timer applies to Config_addSpell3 +Config_addSpellTimer4[3] = nil -- This timer applies to Config_addSpell4 + +Config_aura1Add1[3] = nil -- an aura to add to the 1st add-- +Config_aura2Add1[3] = nil -- another aura to add to the 1st add-- +Config_aura1Add2[3] = nil -- an aura to add to the 2nd add-- +Config_aura2Add2[3] = nil -- another aura to add to the 2nd add-- +Config_aura1Add3[3] = nil -- an aura to add to all ads from the 3rd on-- +Config_aura2Add3[3] = nil -- another aura to add to all add from the 3rd on-- + +Config_addSpell3Yell[3] = "Mmmrrrrrrrr."-- yell for the adds when Spell 3 is cast +Config_addEnoughYell[3] = "Rooooaaar" -- yell for the add at 33% and 66% hp +Config_addEnoughSound[3] = 412 -- sound to play when the add is at 33% and 66% +Config_addSpell2Sound[3] = 6436 -- sound to play when add casts spell 2 +--yell for the boss when all adds are dead +Config_bossYellPhase2[3] = " I'll git ye!" +-- yell for the boss when they cast on themself +Config_bossSpellSelfYell[3] = "Yous Minions be feeding me all ya Strength!" + +------------------------------------------ +-- Begin of encounter 4 config +------------------------------------------ + +-- Database NPC entries. Must match the associated .sql file +Config_bossEntry[4] = 1112031 --db entry of the boss creature +Config_npcEntry[4] = 1112032 --db entry of the NPC creature to summon the boss +Config_addEntry[4] = 1112033 --db entry of the add creature +Config_npcText[4] = 91114 --gossip in npc_text to be told by the summoning NPC + +-- list of spells: +Config_bossSpell1[4] = nil --directly applied to the tank-- +Config_bossSpell2[4] = 56909 --randomly applied to a player in [Config_bossSpell2MaxRange] meters-- Cleave, up to 10 targets +Config_bossSpell2MaxRange[4] = 5 --max range im m/y to check for targets for boss spell 2 (default 35) +Config_bossSpell3[4] = 19717 --on the 2nd nearest player within 30m-- fire rain +Config_bossSpell4[4] = 11446 --on a random player within 40m-- 5min domination +Config_bossSpell4Counter[4] = 1 --amount of casts to perform for spell 4. defaults to 1 +Config_bossSpell4MaxRange[4] = 40 --max range im m to check for targets for boss spell 4 (default 40) +Config_bossSpell5[4] = 22643 --directly applied to the tank with adds alive --volley +Config_bossSpell6[4] = 22643 --directly applied to the tank when adds are dead --volley +Config_bossSpell7[4] = nil --directly applied to the tank +Config_bossSpell8[4] = nil --directly applied to the tank x seconds after spell 7 +Config_bossSpellSelf[4] = 55948 --cast on boss while adds are still alive +Config_bossSpellEnrage[4] = 54356 --cast on boss once after Config_bossSpellEnrageTimer ms have passed-- Soft Enrage + +Config_bossSpellTimer1[4] = 10000 -- This timer applies to Config_bossSpell1 +Config_bossSpellTimer2[4] = 23000 -- This timer applies to Config_bossSpell2 +Config_bossSpellTimer3[4] = 29000 -- This timer applies to Config_bossSpellSelf in phase 1 and Config_bossSpell3+4 randomly later +Config_bossSpellTimer5[4] = 19000 -- This timer applies to Config_bossSpell5+6 +Config_bossSpellTimer7[4] = nil -- This timer applies to Config_bossSpell7+8 +Config_bossSpell8delay[4] = nil -- Delay between spell 7 and 8. Must be smaller than timer7 / 2 +Config_bossSpellEnrageTimer[4] = 300000 + +Config_bossSpellModifier1bp0[4] = 35 -- base damage of the Cleave +Config_bossSpellModifier1bp1[4] = nil -- not required if nil +Config_bossSpellModifier2bp0[4] = nil -- not required if nil +Config_bossSpellModifier2bp1[4] = nil -- not required if nil +Config_bossSpellModifier3bp0[4] = 800 -- base damage of the fire rain +Config_bossSpellModifier3bp1[4] = nil -- not required if nil +Config_bossSpellModifier4bp0[4] = nil -- not required if nil +Config_bossSpellModifier4bp1[4] = nil -- not required if nil +Config_bossSpellModifier5bp0[4] = 250 -- base damage for the Frostbolt Volley in P1 +Config_bossSpellModifier5bp1[4] = nil -- not required if nil +Config_bossSpellModifier6bp0[4] = 400 -- base damage for the Frostbolt Volley in P2 +Config_bossSpellModifier6bp1[4] = nil -- not required if nil +Config_bossSpellModifier7bp0[4] = nil -- not required if nil +Config_bossSpellModifier7bp1[4] = nil -- not required if nil +Config_bossSpellModifier8bp0[4] = nil -- not required if nil +Config_bossSpellModifier8bp1[4] = nil -- not required if nil + +Config_addHealthModifierParty[4] = 3 -- modifier to change health for party encounter. Value in the SQL applies for raid +Config_addsAmount[4] = 8 -- how many adds will spawn + +Config_addSpell1[4] = 29320 -- min range 30m, 1-3rd farthest target within 30m --charge +Config_addSpell2[4] = nil -- min range 45m, cast on tank +Config_addSpell3[4] = 23105 -- min range 0m -- lightning cloud +Config_addSpell4[4] = 69898 -- cast on the boss -- hot +Config_addSpellEnrage[4] = nil -- Enrage after 300 seconds + +Config_addSpellTimer1[4] = 37000 -- This timer applies to Config_addSpell1 +Config_addSpellTimer2[4] = nil -- This timer applies to Config_addSpell2 +Config_addSpellTimer3[4] = 37000 -- This timer applies to Config_addSpell3 +Config_addSpellTimer4[4] = 12000 -- This timer applies to Config_addSpell4 + +Config_addSpellModifier1bp0[4] = nil -- not required if nil +Config_addSpellModifier1bp1[4] = nil -- not required if nil +Config_addSpellModifier2bp0[4] = nil -- not required if nil +Config_addSpellModifier2bp1[4] = nil -- not required if nil +Config_addSpellModifier3bp0[4] = 500 -- Initial damage of Lightning Cloud +Config_addSpellModifier3bp1[4] = 1000 -- Tick damage of Lightning Cloud + +Config_aura1Add1[4] = 42375 -- an aura to add to the 1st add-- AE heal +Config_aura2Add1[4] = nil -- another aura to add to the 1st add-- +Config_aura1Add2[4] = 42375 -- an aura to add to the 2nd add-- AE heal +Config_aura2Add2[4] = nil -- another aura to add to the 2nd add-- +Config_aura1Add3[4] = 42375 -- an aura to add to all ads from the 3rd on-- AE heal +Config_aura2Add3[4] = nil -- another aura to add to all add from the 3rd on-- + +Config_addSpell3Yell[4] = "Mmmrrrrrrrr."-- yell for the adds when Spell 3 is cast +Config_addEnoughYell[4] = "Rooooaaar" -- yell for the add at 33% and 66% hp +Config_addEnoughSound[4] = 412 -- sound to play when the add is at 33% and 66% +Config_addSpell2Sound[4] = 6436 -- sound to play when add casts spell 2 +--yell for the boss when all adds are dead +Config_bossYellPhase2[4] = " I'll git ye!" +-- yell for the boss when they cast on themself +Config_bossSpellSelfYell[4] = "Yous Minions be feeding me all ya Strength!" + +------------------------------------------ +-- Begin of encounter 5 config +------------------------------------------ + +-- Database NPC entries. Must match the associated .sql file +Config_bossEntry[5] = 1112041 --db entry of the boss creature +Config_npcEntry[5] = 1112042 --db entry of the NPC creature to summon the boss +Config_addEntry[5] = 1112043 --db entry of the add creature +Config_npcText[5] = 91115 --gossip in npc_text to be told by the summoning NPC + +-- list of spells: +Config_bossSpell1[5] = nil --directly applied to the tank-- +Config_bossSpell2[5] = 56909 --randomly applied to a player in 35m range-- Cleave, up to 10 targets +Config_bossSpell2MaxRange[5] = 5 --max range im m/y to check for targets for boss spell 2 (default 35) +Config_bossSpell3[5] = 19717 --on the 2nd nearest player within 30m-- +Config_bossSpell4[5] = 11446 --on a random player within 40m-- 5min domination +Config_bossSpell4Counter[5] = 1 --amount of casts to perform for spell 4. defaults to 1 +Config_bossSpell4MaxRange[5] = 40 --max range im m to check for targets for boss spell 4 (default 40) +Config_bossSpell5[5] = 22643 --directly applied to the tank with adds alive --volley +Config_bossSpell6[5] = 22643 --directly applied to the tank when adds are dead --volley +Config_bossSpell7[5] = 16805 --directly applied to the tank +Config_bossSpell8[5] = 16805 --directly applied to the tank x seconds after spell 7 +Config_bossSpell8delay[5] = 6000 --delay between spell 7 and 8. Must be smaller than timer7 / 2 +Config_bossSpellSelf[5] = 55948 --cast on boss while adds are still alive +Config_bossSpellEnrage[5] = 54356 --cast on boss once after Config_bossSpellEnrageTimer ms have passed-- Soft Enrage + +Config_bossSpellTimer1[5] = 10000 -- This timer applies to Config_bossSpell1 +Config_bossSpellTimer2[5] = 23000 -- This timer applies to Config_bossSpell2 +Config_bossSpellTimer3[5] = 29000 -- This timer applies to Config_bossSpellSelf in phase 1 and Config_bossSpell3+4 randomly later +Config_bossSpellTimer5[5] = 19000 -- This timer applies to Config_bossSpell5+6 +Config_bossSpellTimer7[5] = 18000 -- This timer applies to Config_bossSpell7+8 (in ms) +Config_bossSpellEnrageTimer[5] = 300000 + +Config_bossSpellModifier1bp0[5] = 35 -- base damage of the Cleave +Config_bossSpellModifier1bp1[5] = nil -- not required if nil +Config_bossSpellModifier2bp0[5] = nil -- not required if nil +Config_bossSpellModifier2bp1[5] = nil -- not required if nil +Config_bossSpellModifier3bp0[5] = 800 -- base damage of the fire rain +Config_bossSpellModifier3bp1[5] = nil -- not required if nil +Config_bossSpellModifier4bp0[5] = nil -- not required if nil +Config_bossSpellModifier4bp1[5] = nil -- not required if nil +Config_bossSpellModifier5bp0[5] = 250 -- base damage for the Frostbolt Volley in P1 +Config_bossSpellModifier5bp1[5] = nil -- not required if nil +Config_bossSpellModifier6bp0[5] = 400 -- base damage for the Frostbolt Volley in P2 +Config_bossSpellModifier6bp1[5] = nil -- not required if nil +Config_bossSpellModifier7bp0[5] = nil -- not required if nil +Config_bossSpellModifier7bp1[5] = nil -- not required if nil +Config_bossSpellModifier8bp0[5] = nil -- not required if nil +Config_bossSpellModifier8bp1[5] = nil -- not required if nil + +Config_addHealthModifierParty[5] = 2 -- modifier to change health for party encounter. Value in the SQL applies for raid +Config_addsAmount[5] = 6 -- how many adds will spawn + +Config_addSpell1[5] = 29320 -- min range 30m, 1-3rd farthest target within 30m -- charge +Config_addSpell2[5] = nil -- min range 45m, cast on tank +Config_addSpell3[5] = 23105 -- min range 0m -- Lightning cloud +Config_addSpell4[5] = 69898 -- cast on the boss +Config_addSpellEnrage[5] = nil -- Enrage after 300 seconds + +Config_addSpellTimer1[5] = 37000 -- This timer applies to Config_addSpell1 +Config_addSpellTimer2[5] = nil -- This timer applies to Config_addSpell2 +Config_addSpellTimer3[5] = 37000 -- This timer applies to Config_addSpell3 +Config_addSpellTimer4[5] = 12000 -- This timer applies to Config_addSpell4 + +Config_addSpellModifier1bp0[5] = nil -- not required if nil +Config_addSpellModifier1bp1[5] = nil -- not required if nil +Config_addSpellModifier2bp0[5] = nil -- not required if nil +Config_addSpellModifier2bp1[5] = nil -- not required if nil +Config_addSpellModifier3bp0[5] = 400 -- Initial damage of Lightning Cloud +Config_addSpellModifier3bp1[5] = 1200 -- Tick damage of Lightning Cloud + +Config_aura1Add1[5] = 42375 -- an aura to add to the 1st add-- AE heal +Config_aura2Add1[5] = nil -- another aura to add to the 1st add-- +Config_aura1Add2[5] = 42375 -- an aura to add to the 2nd add-- AE heal +Config_aura2Add2[5] = nil -- another aura to add to the 2nd add-- +Config_aura1Add3[5] = 42375 -- an aura to add to all ads from the 3rd on-- AE heal +Config_aura2Add3[5] = nil -- another aura to add to all add from the 3rd on-- + +Config_addSpell3Yell[5] = "Mmmrrrrrrrr."-- yell for the adds when Spell 3 is cast +Config_addEnoughYell[5] = "Rooooaaar" -- yell for the add at 33% and 66% hp +Config_addEnoughSound[5] = 412 -- sound to play when the add is at 33% and 66% +Config_addSpell2Sound[5] = 6436 -- sound to play when add casts spell 2 +--yell for the boss when all adds are dead +Config_bossYellPhase2[5] = " I'll git ye!" +-- yell for the boss when they cast on themself +Config_bossSpellSelfYell[5] = "Yous Minions be feeding me all ya Strength!" + +------------------------------------------ +-- Begin of encounter 6 config +------------------------------------------ + +-- Database NPC entries. Must match the associated .sql file +Config_bossEntry[6] = 1112051 --db entry of the boss creature +Config_npcEntry[6] = 1112052 --db entry of the NPC creature to summon the boss +Config_addEntry[6] = 1112053 --db entry of the add creature +Config_npcText[6] = 91116 --gossip in npc_text to be told by the summoning NPC + +-- list of spells: +Config_bossSpell1[6] = 15283 --directly applied to the tank-- 8second stun +Config_bossSpell2[6] = 25034 --randomly applied to a player in 35m range-- Forked Lightning +Config_bossSpell2MaxRange[6] = 30 --max range im m/y to check for targets for boss spell 2 (default 35) +Config_bossSpell3[6] = 25021 --on the 2nd nearest player within 30m-- Chain Lightning +Config_bossSpell4[6] = 11446 --on a random player within 40m-- 5min domination +Config_bossSpell4Counter[6] = 1 --amount of casts to perform for spell 4. defaults to 1 +Config_bossSpell4MaxRange[6] = 40 --max range im m to check for targets for boss spell 4 (default 40) +Config_bossSpell5[6] = nil --directly applied to the tank with adds alive --volley +Config_bossSpell6[6] = nil --directly applied to the tank when adds are dead --volley +Config_bossSpell7[6] = 37106 --directly applied to the tank - Charged Arcane Explosion +Config_bossSpell8[6] = 43648 --directly applied to the tank x seconds after spell 7 - Electrical Storm +Config_bossSpell8delay[6] = 8000 --delay between spell 7 and 8. Must be smaller than timer7 / 2 +Config_bossSpellSelf[6] = 67973 --cast on boss while adds are still alive (Rejuvenation) +Config_bossSpellEnrage[6] = 54356 --cast on boss once after Config_bossSpellEnrageTimer ms have passed-- Soft Enrage + +Config_bossSpellTimer1[6] = 10000 -- This timer applies to Config_bossSpell1 +Config_bossSpellTimer2[6] = 23000 -- This timer applies to Config_bossSpell2 +Config_bossSpellTimer3[6] = 29000 -- This timer applies to Config_bossSpellSelf in phase 1 and Config_bossSpell3+4 randomly later +Config_bossSpellTimer5[6] = 19000 -- This timer applies to Config_bossSpell5+6 +Config_bossSpellTimer7[6] = 22000 -- This timer applies to Config_bossSpell7+8 (in ms) +Config_bossSpellEnrageTimer[6] = 300000 +Config_minPhaseForTimer7[6] = 2 -- From this phase on the boss will use Timer 7 to cast Spell 7+8. Will ignore it before. + +Config_bossSpellModifier1bp0[6] = nil -- not required if nil +Config_bossSpellModifier1bp1[6] = nil -- not required if nil +Config_bossSpellModifier2bp0[6] = 1000 -- base damage of the forked lightning +Config_bossSpellModifier2bp1[6] = nil -- not required if nil +Config_bossSpellModifier3bp0[6] = 800 -- base damage of the Chain Lightning +Config_bossSpellModifier3bp1[6] = nil -- not required if nil +Config_bossSpellModifier4bp0[6] = nil -- not required if nil +Config_bossSpellModifier4bp1[6] = nil -- not required if nil +Config_bossSpellModifier5bp0[6] = nil -- not required if nil +Config_bossSpellModifier5bp1[6] = nil -- not required if nil +Config_bossSpellModifier6bp0[6] = nil -- not required if nil +Config_bossSpellModifier6bp1[6] = nil -- not required if nil +Config_bossSpellModifier7bp0[6] = 500 -- base damage for Charged Arcane Explosion +Config_bossSpellModifier7bp1[6] = nil -- not required if nil +Config_bossSpellModifier8bp0[6] = nil -- not required if nil +Config_bossSpellModifier8bp1[6] = nil -- not required if nil + +Config_addHealthModifierParty[6] = 0.2 -- modifier to change health for party encounter. Value in the SQL applies for raid +Config_addsAmount[6] = 2 -- how many adds will spawn + +Config_addSpell1[6] = 28884 -- min range 30m, 1-3rd farthest target within 30m -- Meteor +Config_addSpell2[6] = 19630 -- min range 45m, cast on tank -- Cone of Fire +Config_addSpell3[6] = 13808 -- min range 0m -- Grenade +Config_addSpell4[6] = 67973 -- cast on the boss (Rejuvenation) +Config_addSpellEnrage[6] = nil -- Enrage after 300 seconds + +Config_addSpellTimer1[6] = 37000 -- This timer applies to Config_addSpell1 +Config_addSpellTimer2[6] = 13000 -- This timer applies to Config_addSpell2 +Config_addSpellTimer3[6] = 7000 -- This timer applies to Config_addSpell3 +Config_addSpellTimer4[6] = 12000 -- This timer applies to Config_addSpell4 + +Config_addSpellModifier1bp0[6] = nil -- not required if nil +Config_addSpellModifier1bp1[6] = nil -- not required if nil +Config_addSpellModifier2bp0[6] = nil -- not required if nil +Config_addSpellModifier2bp1[6] = nil -- not required if nil +Config_addSpellModifier3bp0[6] = 1000 -- not required if nil +Config_addSpellModifier3bp1[6] = nil -- not required if nil + +Config_aura1Add1[6] = 13022 -- an aura to add to the 1st add-- Fire and Arcane Reflect +Config_aura2Add1[6] = 19595 -- another aura to add to the 1st add-- Shadow and Frost Reflect +Config_aura1Add2[6] = 25777 -- an aura to add to the 2nd add-- Thorns +Config_aura2Add2[6] = nil -- another aura to add to the 2nd add-- +Config_aura1Add3[6] = nil -- an aura to add to all ads from the 3rd on-- Fiery Aura +Config_aura2Add3[6] = nil -- another aura to add to all add from the 3rd on-- + +Config_addSpell3Yell[6] = "Die, Insect."-- yell for the adds when Spell 3 is cast +Config_addEnoughYell[6] = "Feel my Wrath!" -- yell for the add at 33% and 66% hp +Config_addEnoughSound[6] = 412 -- sound to play when the add is at 33% and 66% +Config_addSpell2Sound[6] = 6436 -- sound to play when add casts spell 2 +--yell for the boss when all adds are dead +Config_bossYellPhase2[6] = "Bee bop. Reconfiguring!" +-- yell for the boss when they cast on themself +Config_bossSpellSelfYell[6] = "Adjusting Defenses. Stand back." + +------------------------------------------ +-- Begin of encounter 7 config +------------------------------------------ + +-- Database NPC entries. Must match the associated .sql file +Config_bossEntry[7] = 1112061 --db entry of the boss creature +Config_npcEntry[7] = 1112062 --db entry of the NPC creature to summon the boss +Config_addEntry[7] = 1112063 --db entry of the add creature +Config_npcText[7] = 91117 --gossip in npc_text to be told by the summoning NPC + +-- list of spells: +Config_bossSpell1[7] = 15283 --directly applied to the tank-- 8second stun +Config_bossSpell2[7] = nil --on a random player within Config_bossSpell2MaxRange +Config_bossSpell2MaxRange[7] = 50 --max range im m/y to check for targets for boss spell 2 (default 35) +Config_bossSpell3[7] = 29484 --on the 2nd nearest player within 30m -- Web Spray +Config_bossSpell4[7] = 59108 --on a random player within Config_bossSpell4MaxRange -- Glutinous Poison +Config_bossSpell4Counter[7] = 10 --amount of casts to perform for spell 4. defaults to 1 +Config_bossSpell4MaxRange[7] = 30 --max range im m to check for targets for boss spell 4 (default 40) +Config_bossSpell5[7] = 28741 --directly applied to the tank with adds alive --poison cone +Config_bossSpell6[7] = 28741 --directly applied to the tank when adds are dead --poison cone +Config_bossSpell7[7] = nil --directly applied to the tank - +Config_bossSpell8[7] = nil --directly applied to the tank x seconds after spell 7 - +Config_bossSpell8delay[7] = nil --delay between spell 7 and 8. Must be smaller than timer7 / 2 +Config_bossSpellSelf[7] = 19712 --cast on boss while adds are still alive (Arcane Explosion) +Config_bossSpellEnrage[7] = 54356 --cast on boss once after Config_bossSpellEnrageTimer ms have passed-- Soft Enrage + +Config_bossSpellTimer1[7] = 10000 -- This timer applies to Config_bossSpell1 +Config_bossSpellTimer2[7] = 37000 -- This timer applies to Config_bossSpell2 +Config_bossSpellTimer3[7] = 29000 -- This timer applies to Config_bossSpellSelf in phase 1 and Config_bossSpell3+4 randomly later +Config_bossSpellTimer5[7] = 19000 -- This timer applies to Config_bossSpell5+6 +Config_bossSpellTimer7[7] = 22000 -- This timer applies to Config_bossSpell7+8 (in ms) +Config_bossSpellEnrageTimer[7] = 90000 +Config_minPhaseForTimer7[7] = 3 -- From this phase on the boss will use Timer 7 to cast Spell 7+8. Will ignore it before. + +Config_bossSpellModifier1bp0[7] = nil -- not required if nil +Config_bossSpellModifier1bp1[7] = nil -- not required if nil +Config_bossSpellModifier2bp0[7] = nil -- not required if nil +Config_bossSpellModifier2bp1[7] = nil -- not required if nil +Config_bossSpellModifier3bp0[7] = nil -- not required if nil +Config_bossSpellModifier3bp1[7] = 250 -- web spray damage +Config_bossSpellModifier4bp0[7] = 1000 -- base damage of Glutinous Poison +Config_bossSpellModifier4bp1[7] = nil -- not required if nil +Config_bossSpellModifier5bp0[7] = 750 -- base damage of poison cone +Config_bossSpellModifier5bp1[7] = nil -- not required if nil +Config_bossSpellModifier6bp0[7] = 1500 -- base damage of poison cone +Config_bossSpellModifier6bp1[7] = nil -- not required if nil +Config_bossSpellModifier7bp0[7] = nil -- not required if nil +Config_bossSpellModifier7bp1[7] = nil -- not required if nil +Config_bossSpellModifier8bp0[7] = nil -- not required if nil +Config_bossSpellModifier8bp1[7] = nil -- not required if nil + +Config_addHealthModifierParty[7] = 0.2 -- modifier to change health for party encounter. Value in the SQL applies for raid +Config_addsAmount[7] = 4 -- how many adds will spawn + +Config_addSpell1[7] = 12421 -- min range 30m, 1-3rd farthest target within 30m -- Mithril Grenade +Config_addSpell2[7] = 23105 -- min range 45m, cast on tank +Config_addSpell3[7] = nil -- min range 0m +Config_addSpell4[7] = 67891 -- cast on the boss (Direct full heal) +Config_addSpellEnrage[7] = nil -- Enrage after 300 seconds + +Config_addSpellTimer1[7] = 23000 -- This timer applies to Config_addSpell1 +Config_addSpellTimer2[7] = 13000 -- This timer applies to Config_addSpell2 +Config_addSpellTimer3[7] = 7000 -- This timer applies to Config_addSpell3 +Config_addSpellTimer4[7] = 12000 -- This timer applies to Config_addSpell4 + +Config_addSpellModifier1bp0[7] = 714 -- not required if nil +Config_addSpellModifier1bp1[7] = nil -- not required if nil +Config_addSpellModifier2bp0[7] = 500 -- not required if nil +Config_addSpellModifier2bp1[7] = 1000 -- not required if nil +Config_addSpellModifier3bp0[7] = 1000 -- not required if nil +Config_addSpellModifier3bp1[7] = nil -- not required if nil + +Config_aura1Add1[7] = 13022 -- an aura to add to the 1st add-- Fire and Arcane Reflect +Config_aura2Add1[7] = 19595 -- another aura to add to the 1st add-- Shadow and Frost Reflect +Config_aura1Add2[7] = 25777 -- an aura to add to the 2nd add-- Fire and Arcane Reflect +Config_aura2Add2[7] = 19595 -- another aura to add to the 2nd add -- Shadow and Frost Reflect +Config_aura1Add3[7] = 25777 -- an aura to add to all ads from the 3rd on-- Thorns +Config_aura2Add3[7] = nil -- another aura to add to all add from the 3rd on-- + +Config_addSpell3Yell[7] = "Bow to your gods!"-- yell for the adds when Spell 3 is cast +Config_addEnoughYell[7] = "Feel my Wrath!" -- yell for the add at 33% and 66% hp +Config_addEnoughSound[7] = 6763 -- sound to play when the add is at 33% and 66% +Config_addSpell2Sound[7] = 721 -- sound to play when add casts spell 2 +--yell for the boss when all adds are dead +Config_bossYellPhase2[7] = "Sssssszzzzzzzzz!" +-- yell for the boss when they cast on themself +Config_bossSpellSelfYell[7] = "SSSSSSSUFfffrrrrr!" + + +------------------------------------------ +-- End of encounter 7 +------------------------------------------ + +-- these are the fireworks to be cast randomly for 20s when an encounter was beaten +Config_fireworks[1] = 66400 +Config_fireworks[2] = 66402 +Config_fireworks[3] = 46847 +Config_fireworks[4] = 46829 +Config_fireworks[5] = 46830 +Config_fireworks[6] = 62074 +Config_fireworks[7] = 62075 +Config_fireworks[8] = 62077 +Config_fireworks[9] = 55420 + +------------------------------------------ +-- NO ADJUSTMENTS REQUIRED BELOW THIS LINE +------------------------------------------ + +--constants +local PLAYER_EVENT_ON_LOGOUT = 4 -- (event, player) +local PLAYER_EVENT_ON_REPOP = 35 -- (event, player) +local PLAYER_EVENT_ON_COMMAND = 42 -- (event, player, command) - player is nil if command used from console. Can return false +local TEMPSUMMON_MANUAL_DESPAWN = 8 -- despawns when UnSummon() is called +local GOSSIP_EVENT_ON_HELLO = 1 -- (event, player, object) - Object is the Creature/GameObject/Item. Can return false to do default action. For item gossip can return false to stop spell casting. +local GOSSIP_EVENT_ON_SELECT = 2 -- (event, player, object, sender, intid, code, menu_id) +local OPTION_ICON_CHAT = 0 +local OPTION_ICON_BATTLE = 9 + +local SELECT_TARGET_RANDOM = 0 -- Just selects a random target +local SELECT_TARGET_TOPAGGRO = 1 -- Selects targets from top aggro to bottom +local SELECT_TARGET_BOTTOMAGGRO = 2 -- Selects targets from bottom aggro to top +local SELECT_TARGET_NEAREST = 3 +local SELECT_TARGET_FARTHEST = 4 + +local PARTY_IN_PROGRESS = 1 +local RAID_IN_PROGRESS = 2 + +local ELUNA_EVENT_ON_LUA_STATE_CLOSE = 16 + +--local variables +local cancelGossipEvent +local eventInProgress +local bossfightInProgress +local difficulty -- difficulty is set when using .startevent and it is meant for a range of 1-10 +local addsDownCounter +local phase +local addphase +local x +local y +local z +local o +local spawnedBossGuid +local spawnedNPCGuid +local encounterStartTime +local mapEventStart +local npcObjectGuid +local partyNpcSayCounter = 0 +local lastBossSpell1 +local lastBossSpell2 +local lastBossSpell3 +local lastBossSpell5 +local lastBossSpell7 +local nextBossSpell8Delay +local lastBossSpellSelf +local lastAddSpell1 = {} +local lastAddSpell2 = {} +local lastAddSpell3 = {} +local lastAddSpell4 = {} +local partyEvent = {} -- selected boss per [accountId] for party only mode + +--local arrays +local cancelEventIdHello = {} +local cancelEventIdStart = {} +local addNPC = {} +local bossNPC = {} +local playersInRaid = {} +local groupPlayers = {} +local playersForFireworks = {} +local spawnedCreatureGuid = {} +local scoreEarned = {} +local scoreTotal = {} + +if Config.addEnoughSpell == nil then PrintError("customWorldboss.lua: Missing flag Config.addEnoughSpell.") end +if Config.customDbName == nil then PrintError("customWorldboss.lua: Missing flag Config.customDbName.") end +if Config.GMRankForEventStart == nil then PrintError("customWorldboss.lua: Missing flag Config.GMRankForEventStart.") end +if Config.GMRankForUpdateDB == nil then PrintError("customWorldboss.lua: Missing flag Config.GMRankForUpdateDB.") end +if Config.printErrorsToConsole == nil then PrintError("customWorldboss.lua: Missing flag Config.printErrorsToConsole.") end +if Config.addEnrageTimer == nil then PrintError("customWorldboss.lua: Missing flag Config.addEnrageTimer.") end + +local function eS_has_value (tab, val) + for index, value in ipairs(tab) do + if value == val then + return true + end + end + return false +end + +local function eS_returnIndex (tab, val) + for index, value in ipairs(tab) do + if value == val then + return index + end + end + return false +end + +local function newAutotable(dim) + local MT = {}; + for i=1, dim do + MT[i] = {__index = function(t, k) + if i < dim then + t[k] = setmetatable({}, MT[i+1]) + return t[k]; + end + end} + end + + return setmetatable({}, MT[1]); +end + +local function eS_castFireworks(eventId, delay, repeats) + local player + for n, v in pairs(playersForFireworks) do + player = GetPlayerByGUID(v) + if player ~= nil then + player:CastSpell(player, Config_fireworks[math.random(1, #Config_fireworks)]) + end + end + if repeats == 1 then + playersForFireworks = {} + end +end + +local function eS_resetPlayers(event, player) + if eS_has_value(playersInRaid, player:GetGUID()) and player:GetPhaseMask() ~= 1 then + if player ~= nil then + if player:GetCorpse() ~= nil then + player:GetCorpse():SetPhaseMask(1) + end + player:SetPhaseMask(1) + player:SendBroadcastMessage("You left the event.") + end + end +end + +local function eS_getSize(difficulty) + local value + if difficulty == 1 then + value = 1 + else + value = 1 + (difficulty - 1) / 4 + end + return value +end + +local function eS_splitString(inputstr, seperator) + if seperator == nil then + seperator = "%s" + end + local t={} + for str in string.gmatch(inputstr, "([^"..seperator.."]+)") do + table.insert(t, str) + end + return t +end + +local function eS_checkInCombat() + --check if all players are in combat + local player + for _, v in pairs(playersInRaid) do + player = GetPlayerByGUID(v) + if player ~= nil then + if player:IsInCombat() == false and player:GetPhaseMask() == 2 then + if player:GetCorpse() ~= nil then + player:GetCorpse():SetPhaseMask(1) + end + player:SetPhaseMask(1) + player:SendBroadcastMessage("You were returned to the real time because you did not participate.") + end + end + end +end + +local function eS_getEncounterDuration() + local dt = GetTimeDiff(encounterStartTime) + return string.format("%.2d:%.2d", (dt / 1000 / 60) % 60, (dt / 1000) % 60) +end + +local function eS_getTimeSince(time) + if time then + return GetTimeDiff(time) + end + return 0 +end + +local function eS_getDifficultyTimer(rawTimer) + if difficulty == 1 then + return rawTimer + else + local timer = rawTimer / (1 + ((difficulty - 1) / 9)) + return timer + end +end + +local function eS_getDifficultyModifier(base) + if difficulty == 1 then + return base + else + local modifier = base * (1 + ((difficulty - 1) / 9)) + return modifier + end +end + +local function eS_onHello(event, player, creature) + if player == nil then return end + if bossfightInProgress ~= nil then + player:SendBroadcastMessage("Some heroes are still fighting the enemies of time since "..eS_getEncounterDuration()) + player:GossipMenuAddItem(OPTION_ICON_CHAT, "What's my score?", Config_npcEntry[eventInProgress], 0) + player:GossipSendMenu(Config_npcText[eventInProgress], creature, 0) + return + end + + player:GossipMenuAddItem(OPTION_ICON_CHAT, "What's my score?", Config_npcEntry[eventInProgress], 0) + player:GossipMenuAddItem(OPTION_ICON_CHAT, "We are ready to fight a servant!", Config_npcEntry[eventInProgress], 1) + player:GossipMenuAddItem(OPTION_ICON_CHAT, "We brought the best there is and we're ready for anything.", Config_npcEntry[eventInProgress], 2) + player:GossipSendMenu(Config_npcText[eventInProgress], creature, 0) +end + +local function eS_onPartyOnlyHello(event, player, creature) + if player == nil then return end + if bossfightInProgress ~= nil then + player:SendBroadcastMessage("Some heroes are still fighting the enemies of time since "..eS_getEncounterDuration()) + player:GossipMenuAddItem(OPTION_ICON_CHAT, "What's my score?", Config.partySelectNpc, 0) + player:GossipSendMenu(Config.defaultNpcText1, creature, 0) + return + end + + player:GossipMenuAddItem(OPTION_ICON_CHAT, "What's my score?", Config.partySelectNpc, 0) + player:GossipMenuAddItem(OPTION_ICON_CHAT, "Let us fight a servant! (Difficulty 1)", Config.partySelectNpc, 1) + player:GossipMenuAddItem(OPTION_ICON_CHAT, "Let us fight a servant! (Difficulty 2)", Config.partySelectNpc, 2) + player:GossipMenuAddItem(OPTION_ICON_CHAT, "Let us fight a servant! (Difficulty 3)", Config.partySelectNpc, 3) + player:GossipMenuAddItem(OPTION_ICON_CHAT, "Let us fight a servant! (Difficulty 4)", Config.partySelectNpc, 4) + player:GossipMenuAddItem(OPTION_ICON_CHAT, "Let us fight a servant! (Difficulty 5)", Config.partySelectNpc, 5) + player:GossipMenuAddItem(OPTION_ICON_CHAT, "Let us fight a servant! (Difficulty 6)", Config.partySelectNpc, 6) + player:GossipMenuAddItem(OPTION_ICON_CHAT, "Let us fight a servant! (Difficulty 7)", Config.partySelectNpc, 7) + player:GossipMenuAddItem(OPTION_ICON_CHAT, "Let us fight a servant! (Difficulty 8)", Config.partySelectNpc, 8) + player:GossipMenuAddItem(OPTION_ICON_CHAT, "Let us fight a servant! (Difficulty 9)", Config.partySelectNpc, 9) + player:GossipMenuAddItem(OPTION_ICON_CHAT, "Let us fight a servant! (Difficulty 10)", Config.partySelectNpc, 10) + player:GossipSendMenu(Config.defaultNpcText1, creature, 0) +end + +local function awardScore() + local score = Config.baseScore + (Config.additionalScore * difficulty) + for _, playerGuid in pairs(playersInRaid) do + if GetPlayerByGUID(playerGuid) ~= nil then + local accountId = GetPlayerByGUID(playerGuid):GetAccountId() + if scoreEarned[accountId] == nil then scoreEarned[accountId] = 0 end + if scoreTotal[accountId] == nil then scoreTotal[accountId] = 0 end + scoreEarned[accountId] = scoreEarned[accountId] + score + scoreTotal[accountId] = scoreTotal[accountId] + score + CharDBExecute('REPLACE INTO `'..Config.customDbName..'`.`eventscript_score` VALUES ('..accountId..', '..scoreEarned[accountId]..', '..scoreTotal[accountId]..');'); + local gameTime = (tonumber(tostring(GetGameTime()))) + local playerLowGuid = GetGUIDLow(playerGuid) + CharDBExecute('INSERT IGNORE INTO `'..Config.customDbName..'`.`eventscript_encounters` VALUES ('..gameTime..', '..playerLowGuid..', '..eventInProgress..', '..difficulty..', '..bossfightInProgress..', '..eS_getTimeSince(encounterStartTime)..');'); + end + end + bossfightInProgress = nil +end + +local function storeEncounter() + for _, playerGuid in pairs(playersInRaid) do + if GetPlayerByGUID(playerGuid) ~= nil then + local accountId = GetPlayerByGUID(playerGuid):GetAccountId() + local gameTime = (tonumber(tostring(GetGameTime()))) + local playerLowGuid = GetGUIDLow(playerGuid) + CharDBExecute('INSERT IGNORE INTO `'..Config.customDbName..'`.`eventscript_encounters` VALUES ('..gameTime..', '..playerLowGuid..', '..eventInProgress..', '..difficulty..', '..bossfightInProgress..', '..eS_getTimeSince(encounterStartTime)..');'); + end + end + bossfightInProgress = nil +end + +local function eS_chromieGossip(event, player, object, sender, intid, code, menu_id) + local spawnedBoss + local spawnedCreature = {} + + if player == nil then return end + + local group = player:GetGroup() + + if intid == 0 then + local accountId = player:GetAccountId() + if scoreEarned[accountId] == nil then scoreEarned[accountId] = 0 end + if scoreTotal[accountId] == nil then scoreTotal[accountId] = 0 end + player:SendBroadcastMessage("Your current event score is: "..scoreEarned[accountId].." and your all-time event score is: "..scoreTotal[accountId]) + player:GossipComplete() + elseif intid == 1 then + + if bossfightInProgress ~= nil then + player:SendBroadcastMessage("There is already a fight in progress.") + player:GossipComplete() + return + end + + if player:IsInGroup() == false then + player:SendBroadcastMessage("You need to be in a party.") + player:GossipComplete() + return + end + + if group:IsRaidGroup() == true then + player:SendBroadcastMessage("You can not accept that task while in a raid group.") + player:GossipComplete() + return + end + if not group:IsLeader(player:GetGUID()) then + player:SendBroadcastMessage("You are not the leader of your group.") + player:GossipComplete() + return + end + groupPlayers = group:GetMembers() + for n, v in pairs(groupPlayers) do + if eS_has_value(playersForFireworks, v:GetGUID()) then + object:SendUnitSay("Please, just a little break. I need to breathe, "..player:GetName()..". How about watching the fireworks?", 0 ) + player:GossipComplete() + return + end + end + --start 5man encounter + bossfightInProgress = PARTY_IN_PROGRESS + spawnedCreature[1]= player:SpawnCreature(Config_addEntry[eventInProgress], x, y, z, o) + spawnedCreature[1]:SetPhaseMask(2) + spawnedCreature[1]:SetScale(spawnedCreature[1]:GetScale() * eS_getSize(difficulty)) + + local maxHealth = Config_addHealthModifierParty[eventInProgress] * spawnedCreature[1]:GetMaxHealth() + local health = Config_addHealthModifierParty[eventInProgress] * spawnedCreature[1]:GetHealth() + spawnedCreature[1]:SetMaxHealth(maxHealth) + spawnedCreature[1]:SetHealth(health) + + encounterStartTime = GetCurrTime() + + for n, v in pairs(groupPlayers) do + if v:GetDistance(player) ~= nil then + if v:GetDistance(player) < 80 then + v:SetPhaseMask(2) + playersInRaid[n] = v:GetGUID() + spawnedCreature[1]:SetInCombatWith(v) + v:SetInCombatWith(spawnedCreature[1]) + spawnedCreature[1]:AddThreat(v, 1) + end + else + v:SendBroadcastMessage("You were too far away to join the fight.") + end + end + + elseif intid == 2 then + + if bossfightInProgress ~= nil then + player:SendBroadcastMessage("There is already a fight in progress.") + player:GossipComplete() + return + end + + if player:IsInGroup() == false then + player:SendBroadcastMessage("You need to be in a party.") + player:GossipComplete() + return + end + + if group:IsRaidGroup() == false then + player:SendBroadcastMessage("You can not accept that task without being in a raid group.") + player:GossipComplete() + return + end + if not group:IsLeader(player:GetGUID()) then + player:SendBroadcastMessage("You are not the leader of your group.") + player:GossipComplete() + return + end + groupPlayers = group:GetMembers() + + --prevent starting the next raid while fireworks are running + for n, v in pairs(groupPlayers) do + if eS_has_value(playersForFireworks, v:GetGUID()) then + object:SendUnitSay("Please, just a little break. I need to breathe, "..player:GetName()..". How about watching the fireworks?", 0 ) + player:GossipComplete() + return + end + end + + --start raid encounter + bossfightInProgress = RAID_IN_PROGRESS + + spawnedBoss = player:SpawnCreature(Config_bossEntry[eventInProgress], x, y, z+2, o) + spawnedBoss:SetPhaseMask(2) + spawnedBoss:SetScale(spawnedBoss:GetScale() * eS_getSize(difficulty)) + spawnedBossGuid = spawnedBoss:GetGUID() + + if Config_addsAmount[eventInProgress] == nil then Config_addsAmount[eventInProgress] = 1 end + + for c = 1, Config_addsAmount[eventInProgress] do + local randomX = (math.sin(math.random(1,360)) * 15) + local randomY = (math.sin(math.random(1,360)) * 15) + spawnedCreature[c] = player:SpawnCreature(Config_addEntry[eventInProgress], x + randomX, y + randomY, z+2, o) + spawnedCreature[c]:SetPhaseMask(2) + spawnedCreature[c]:SetScale(spawnedCreature[c]:GetScale() * eS_getSize(difficulty)) + spawnedCreatureGuid[c] = spawnedCreature[c]:GetGUID() + end + encounterStartTime = GetCurrTime() + + for n, v in pairs(groupPlayers) do + if v:GetDistance(player) ~= nil then + if v:GetDistance(player) < 80 then + v:SetPhaseMask(2) + playersInRaid[n] = v:GetGUID() + spawnedBoss:SetInCombatWith(v) + v:SetInCombatWith(spawnedBoss) + spawnedBoss:AddThreat(v, 1) + for c = 1, Config_addsAmount[eventInProgress] do + spawnedCreature[c]:SetInCombatWith(v) + v:SetInCombatWith(spawnedCreature[c]) + spawnedCreature[c]:AddThreat(v, 1) + end + end + else + v:SendBroadcastMessage("You were too far away to join the fight.") + end + end + + --apply auras to adds + if spawnedCreature[1] ~= nil then + if Config_aura1Add1[1] ~= nil then + spawnedCreature[1]:AddAura(Config_aura1Add1[1], spawnedCreature[1]) + end + if Config_aura2Add1[1] ~= nil then + spawnedCreature[1]:AddAura(Config_aura2Add1[1], spawnedCreature[1]) + end + end + + if spawnedCreature[2] ~= nil then + if Config_aura1Add2[2] ~= nil then + spawnedCreature[2]:AddAura(Config_aura1Add2[2], spawnedCreature[2]) + end + if Config_aura2Add2[2] ~= nil then + spawnedCreature[2]:AddAura(Config_aura2Add2[2], spawnedCreature[2]) + end + end + if #spawnedCreature > 2 then + for c = 3, #spawnedCreature do + if spawnedCreature[c] ~= nil then + if Config_aura1Add3[c] ~= nil then + spawnedCreature[c]:AddAura(Config_aura1Add3[c], spawnedCreature[c]) + end + if Config_aura2Add3[c] ~= nil then + spawnedCreature[c]:AddAura(Config_aura2Add3[c], spawnedCreature[c]) + end + end + end + end + end + player:GossipComplete() +end + +local function eS_chromiePartyOnlyGossip(event, player, object, sender, intid, code, menu_id) + local spawnedBoss + local spawnedCreature = {} + + if player == nil then return end + + local group = player:GetGroup() + local accountId = player:GetAccountId() + + if intid == 0 then + if scoreEarned[accountId] == nil then scoreEarned[accountId] = 0 end + if scoreTotal[accountId] == nil then scoreTotal[accountId] = 0 end + player:SendBroadcastMessage("Your current event score is: "..scoreEarned[accountId].." and your all-time event score is: "..scoreTotal[accountId]) + player:GossipComplete() + + elseif intid <= 100 then + partyEvent[accountId] = intid + + player:GossipMenuAddItem(OPTION_ICON_CHAT, "Zombie Captain (Level 50)", Config.partySelectNpc, 101) + player:GossipMenuAddItem(OPTION_ICON_CHAT, "Seawitch (Level 40)", Config.partySelectNpc, 102) + player:GossipMenuAddItem(OPTION_ICON_CHAT, "Aligator Pet (Level 50)", Config.partySelectNpc, 104) + player:GossipMenuAddItem(OPTION_ICON_CHAT, "Aligator Guard (Level 60)", Config.partySelectNpc, 105) + player:GossipMenuAddItem(OPTION_ICON_CHAT, "Ragnarix Qt (Level 60)", Config.partySelectNpc, 106) + player:GossipSendMenu(Config.defaultNpcText2, object, 0) + + else + difficulty = partyEvent[accountId] + partyEvent[accountId] = intid - 100 + if bossfightInProgress ~= nil then + player:SendBroadcastMessage("There is already a fight in progress.") + player:GossipComplete() + return + end + + if player:IsInGroup() == false then + player:SendBroadcastMessage("You need to be in a party.") + player:GossipComplete() + return + end + + if group:IsRaidGroup() == true then + player:SendBroadcastMessage("You can not accept that task while in a raid group.") + player:GossipComplete() + return + end + if not group:IsLeader(player:GetGUID()) then + player:SendBroadcastMessage("You are not the leader of your group.") + player:GossipComplete() + return + end + groupPlayers = group:GetMembers() + for n, v in pairs(groupPlayers) do + if eS_has_value(playersForFireworks, v:GetGUID()) then + object:SendUnitSay("Please, just a little break. I need to breathe, "..player:GetName()..". How about watching the fireworks?", 0 ) + player:GossipComplete() + return + end + end + eventInProgress = partyEvent[accountId] + local x = player:GetX() + local y = player:GetY() + local z = player:GetZ() + local o = player:GetO() + + --start 5man encounter + bossfightInProgress = PARTY_IN_PROGRESS + spawnedCreature[1]= player:SpawnCreature(Config_addEntry[eventInProgress], x, y, z, o) + spawnedCreature[1]:SetPhaseMask(2) + spawnedCreature[1]:SetScale(spawnedCreature[1]:GetScale() * eS_getSize(difficulty)) + + local maxHealth = Config_addHealthModifierParty[eventInProgress] * spawnedCreature[1]:GetMaxHealth() + local health = Config_addHealthModifierParty[eventInProgress] * spawnedCreature[1]:GetHealth() + spawnedCreature[1]:SetMaxHealth(maxHealth) + spawnedCreature[1]:SetHealth(health) + + encounterStartTime = GetCurrTime() + + for n, v in pairs(groupPlayers) do + if v:GetDistance(player) ~= nil then + if v:GetDistance(player) < 80 then + v:SetPhaseMask(2) + playersInRaid[n] = v:GetGUID() + spawnedCreature[1]:SetInCombatWith(v) + v:SetInCombatWith(spawnedCreature[1]) + spawnedCreature[1]:AddThreat(v, 1) + end + else + v:SendBroadcastMessage("You were too far away to join the fight.") + end + end + + end +end + +local function eS_summonEventNPC(playerGuid) + local player + -- tempSummon an NPC with a dialogue option to start the encounter, store the guid for later unsummon + player = GetPlayerByGUID(playerGuid) + if player == nil then return end + x = player:GetX() + y = player:GetY() + z = player:GetZ() + o = player:GetO() + local spawnedNPC = player:SpawnCreature(Config_npcEntry[eventInProgress], x, y, z, o) + spawnedNPCGuid = spawnedNPC:GetGUID() + + -- add an event to spawn the Boss in a phase when gossip is clicked + cancelEventIdHello[eventInProgress] = RegisterCreatureGossipEvent(Config_npcEntry[eventInProgress], GOSSIP_EVENT_ON_HELLO, eS_onHello) + cancelEventIdStart[eventInProgress] = RegisterCreatureGossipEvent(Config_npcEntry[eventInProgress], GOSSIP_EVENT_ON_SELECT, eS_chromieGossip) +end + +local function eS_command(event, player, command, chatHandler) + local commandArray = {} + local eventNPC + + --prevent players from using this + if not chatHandler:IsAvailable(Config.GMRankForEventStart) then + return + end + + -- split the command variable into several strings which can be compared individually + commandArray = eS_splitString(command) + + if commandArray[2] ~= nil then + commandArray[2] = commandArray[2]:gsub("[';\\, ]", "") + if commandArray[3] ~= nil then + commandArray[3] = commandArray[3]:gsub("[';\\, ]", "") + end + end + + if commandArray[2] == nil then commandArray[2] = 1 end + if commandArray[3] == nil then commandArray[3] = 1 end + + if commandArray[1] == "startevent" then + if player == nil then + chatHandler:SendSysMessage("Can not start an event from the console.") + return false + end + eventNPC = tonumber(commandArray[2]) + difficulty = tonumber(commandArray[3]) + + if Config_npcEntry[eventNPC] == nil or Config_bossEntry == nil or Config_addEntry == nil or Config_npcText == nil then + chatHandler:SendSysMessage("Event "..eventNPC.." is not properly configured. Aborting") + return false + end + + mapEventStart = player:GetMap():GetMapId() + + if difficulty <= 0 then difficulty = 1 end + if difficulty > 10 then difficulty = 10 end + + if eventInProgress == nil then + eventInProgress = eventNPC + eS_summonEventNPC(player:GetGUID()) + chatHandler:SendSysMessage("Starting event "..eventInProgress.." with difficulty "..difficulty..".") + return false + else + chatHandler:SendSysMessage("Event "..eventInProgress.." is already active.") + return false + end + elseif commandArray[1] == "stopevent" then + if player == nil then + chatHandler:SendSysMessage("Must be used from inside the game.") + return false + end + if eventInProgress == nil then + chatHandler:SendSysMessage("There is no event in progress.") + return false + end + local map = player:GetMap() + local mapId = map:GetMapId() + if mapId ~= mapEventStart then + chatHandler:SendSysMessage("You must be in the same map to stop an event.") + return false + end + chatHandler:SendSysMessage("Stopping event "..eventInProgress..".") + ClearCreatureGossipEvents(Config_npcEntry[eventInProgress]) + local spawnedNPC = map:GetWorldObject(spawnedNPCGuid):ToCreature() + spawnedNPC:DespawnOrUnsummon(0) + eventInProgress = nil + return false + end + + --prevent non-Admins from using the rest + if not chatHandler:IsAvailable(Config.GMRankForUpdateDB) then + return + end + + --nothing here yet + return +end + +function bossNPC.onEnterCombat(event, creature, target) + creature:RegisterEvent(bossNPC.Event, 100, 0) + creature:CallAssistance() + creature:SendUnitYell("You will NOT interrupt this mission!", 0 ) + phase = 1 + addsDownCounter = 0 + creature:CallForHelp(200) + creature:PlayDirectSound(8645) + + lastBossSpell1 = encounterStartTime + lastBossSpell2 = encounterStartTime + lastBossSpell3 = encounterStartTime + lastBossSpell5 = encounterStartTime + lastBossSpell7 = encounterStartTime + nextBossSpell8Delay = nil + lastBossSpellSelf = encounterStartTime +end + +function bossNPC.reset(event, creature) + local player + eS_checkInCombat() + creature:RemoveEvents() + if creature:IsDead() == true then + creature:SendUnitYell("Master, save me!", 0 ) + creature:PlayDirectSound(8865) + local playerListString + for _, v in pairs(playersInRaid) do + player = GetPlayerByGUID(v) + if player ~= nil then + if player:GetCorpse() ~= nil then + player:GetCorpse():SetPhaseMask(1) + end + player:SetPhaseMask(1) + if playerListString == nil then + playerListString = player:GetName() + else + playerListString = playerListString..", "..player:GetName() + end + end + end + if Config.rewardRaid == 1 then + awardScore() + elseif Config.storeRaid == 1 then + storeEncounter() + else + bossfightInProgress = nil + end + SendWorldMessage("The raid encounter "..creature:GetName().." was completed on difficulty "..difficulty.." in "..eS_getEncounterDuration().." by: "..playerListString..". Congratulations!") + CreateLuaEvent(eS_castFireworks, 1000, 20) + playersForFireworks = playersInRaid + playersInRaid = {} + else + creature:SendUnitYell("You never had a chance.", 0 ) + for _, v in pairs(playersInRaid) do + player = GetPlayerByGUID(v) + if player ~= nil then + if player:GetCorpse() ~= nil then + player:GetCorpse():SetPhaseMask(1) + end + player:SetPhaseMask(1) + end + end + playersInRaid = {} + bossfightInProgress = nil + end + creature:DespawnOrUnsummon(0) + addsDownCounter = nil +end + +function bossNPC.Event(event, delay, pCall, creature) + if creature:IsCasting() == true then return end + + if Config_bossSpellEnrageTimer[eventInProgress] ~= nil and Config_bossSpellEnrage[eventInProgress] ~= nil then + if eS_getDifficultyTimer(Config_bossSpellEnrageTimer[eventInProgress]) < eS_getTimeSince(encounterStartTime) then + if phase == 2 and eS_getTimeSince(encounterStartTime) > Config_bossSpellEnrageTimer[eventInProgress] then + phase = 3 + creature:SendUnitYell("FEEL MY WRATH!", 0 ) + creature:CastSpell(creature, Config_bossSpellEnrage[eventInProgress]) + return + end + end + end + + if Config_bossSpellTimer3[eventInProgress] ~= nil then + if eS_getDifficultyTimer(Config_bossSpellTimer3[eventInProgress]) < eS_getTimeSince(lastBossSpell3) then + if addsDownCounter < Config_addsAmount[eventInProgress] then + if Config_bossSpellSelf[eventInProgress] ~= nil then + if Config_bossSpellSelfYell[eventInProgress] ~= nil then + creature:SendUnitYell(Config_bossSpellSelfYell[eventInProgress], 0 ) + end + creature:CastSpell(creature, Config_bossSpellSelf[eventInProgress]) + lastBossSpell3 = GetCurrTime() + return + end + elseif phase == 1 then + if Config_bossYellPhase2[eventInProgress] ~= nil then + creature:SendUnitYell(Config_bossYellPhase2[eventInProgress], 0 ) + end + phase = 2 + end + end + end + + if Config_bossSpellTimer1[eventInProgress] ~= nil then + if eS_getDifficultyTimer(Config_bossSpellTimer1[eventInProgress]) < eS_getTimeSince(lastBossSpell1) then + if Config_bossSpell1[eventInProgress] ~= nil then + if Config_bossSpellModifier1bp0[eventInProgress] ~= nil and Config_bossSpellModifier1bp1[eventInProgress] ~= nil then + local base1 = eS_getDifficultyModifier(Config_bossSpellModifier1bp0[eventInProgress]) + local base2 = eS_getDifficultyModifier(Config_bossSpellModifier1bp1[eventInProgress]) + creature:CastCustomSpell(creature:GetVictim(), Config_bossSpell1[eventInProgress], false, base1, base2) + elseif Config_bossSpellModifier1bp0[eventInProgress] ~= nil then + local base1 = eS_getDifficultyModifier(Config_bossSpellModifier1bp0[eventInProgress]) + creature:CastCustomSpell(creature:GetVictim(), Config_bossSpell1[eventInProgress], false, base1) + elseif Config_bossSpellModifier1bp1[eventInProgress] ~= nil then + local base2 = eS_getDifficultyModifier(Config_bossSpellModifier1bp1[eventInProgress]) + creature:CastCustomSpell(creature:GetVictim(), Config_bossSpell1[eventInProgress], false, nil, base2) + else + creature:CastSpell(creature:GetVictim(), Config_bossSpell1[eventInProgress]) + end + lastBossSpell1 = GetCurrTime() + return + end + end + end + + if Config_bossSpellTimer2[eventInProgress] ~= nil then + if eS_getDifficultyTimer(Config_bossSpellTimer2[eventInProgress]) < eS_getTimeSince(lastBossSpell2) then + if Config_bossSpell2[eventInProgress] ~= nil then + if (math.random(1, 100) <= 50) then + if Config_bossSpell2MaxRange[eventInProgress] == nil then + Config_bossSpell2MaxRange[eventInProgress] = 35 + end + local players = creature:GetPlayersInRange(Config_bossSpell2MaxRange[eventInProgress]) + local targetPlayer = players[math.random(1, #players)] + creature:SendUnitYell("You die now, "..targetPlayer:GetName().."!", 0 ) + if Config_bossSpellModifier2bp0[eventInProgress] ~= nil and Config_bossSpellModifier2bp1[eventInProgress] ~= nil then + local base1 = eS_getDifficultyModifier(Config_bossSpellModifier2bp0[eventInProgress]) + local base2 = eS_getDifficultyModifier(Config_bossSpellModifier2bp1[eventInProgress]) + creature:CastCustomSpell(targetPlayer, Config_bossSpell2[eventInProgress], false, base1, base2) + elseif Config_bossSpellModifier2bp0[eventInProgress] ~= nil then + local base1 = eS_getDifficultyModifier(Config_bossSpellModifier2bp0[eventInProgress]) + creature:CastCustomSpell(targetPlayer, Config_bossSpell2[eventInProgress], false, base1) + elseif Config_bossSpellModifier2bp1[eventInProgress] ~= nil then + local base2 = eS_getDifficultyModifier(Config_bossSpellModifier2bp1[eventInProgress]) + creature:CastCustomSpell(targetPlayer, Config_bossSpell2[eventInProgress], false, nil, base2) + else + creature:CastSpell(targetPlayer, Config_bossSpell2[eventInProgress]) + end + lastBossSpell2 = GetCurrTime() + return + end + end + end + end + + if Config_bossSpellTimer3[eventInProgress] ~= nil then + if eS_getDifficultyTimer(Config_bossSpellTimer3[eventInProgress]) < eS_getTimeSince(lastBossSpell3) then + if phase > 1 then + local players = creature:GetPlayersInRange(30) + if #players > 1 then + if (math.random(1, 100) <= 50) then + if Config_bossSpell3[eventInProgress] ~= nil then + if Config_bossSpellModifier3bp0[eventInProgress] ~= nil and Config_bossSpellModifier3bp1[eventInProgress] ~= nil then + local base1 = eS_getDifficultyModifier(Config_bossSpellModifier3bp0[eventInProgress]) + local base2 = eS_getDifficultyModifier(Config_bossSpellModifier3bp1[eventInProgress]) + creature:CastCustomSpell(creature:GetAITarget(SELECT_TARGET_NEAREST, true, 1, 30), Config_bossSpell3[eventInProgress], false, base1, base2) + elseif Config_bossSpellModifier3bp0[eventInProgress] ~= nil then + local base1 = eS_getDifficultyModifier(Config_bossSpellModifier3bp0[eventInProgress]) + creature:CastCustomSpell(creature:GetAITarget(SELECT_TARGET_NEAREST, true, 1, 30), Config_bossSpell3[eventInProgress], false, base1) + elseif Config_bossSpellModifier3bp1[eventInProgress] ~= nil then + local base2 = eS_getDifficultyModifier(Config_bossSpellModifier3bp1[eventInProgress]) + creature:CastCustomSpell(creature:GetAITarget(SELECT_TARGET_NEAREST, true, 1, 30), Config_bossSpell3[eventInProgress], false, nil, base2) + else + creature:CastSpell(creature:GetAITarget(SELECT_TARGET_NEAREST, true, 1, 30), Config_bossSpell3[eventInProgress]) + end + lastBossSpell3 = GetCurrTime() + return + end + elseif phase > 1 then + if Config_bossSpell4[eventInProgress] ~= nil then + if Config_bossSpell4MaxRange[eventInProgress] == nil then + Config_bossSpell4MaxRange[eventInProgress] = 40 + end + local players = creature:GetPlayersInRange(Config_bossSpell4MaxRange[eventInProgress]) + local nextPlayerIndex = math.random(1, #players) + if Config_bossSpell4Counter[eventInProgress] == nil then + Config_bossSpell4Counter[eventInProgress] = 1 + end + for m = 1, Config_bossSpell4Counter[eventInProgress] do + local targetPlayer = players[nextPlayerIndex] + if targetPlayer then + if Config_bossSpellModifier4bp0[eventInProgress] ~= nil and Config_bossSpellModifier4bp1[eventInProgress] ~= nil then + local base1 = eS_getDifficultyModifier(Config_bossSpellModifier4bp0[eventInProgress]) + local base2 = eS_getDifficultyModifier(Config_bossSpellModifier4bp1[eventInProgress]) + creature:CastCustomSpell(targetPlayer, Config_bossSpell4[eventInProgress], false, base1, base2) + elseif Config_bossSpellModifier4bp0[eventInProgress] ~= nil then + local base1 = eS_getDifficultyModifier(Config_bossSpellModifier4bp0[eventInProgress]) + creature:CastCustomSpell(targetPlayer, Config_bossSpell4[eventInProgress], false, base1) + elseif Config_bossSpellModifier4bp1[eventInProgress] ~= nil then + local base2 = eS_getDifficultyModifier(Config_bossSpellModifier4bp1[eventInProgress]) + creature:CastCustomSpell(targetPlayer, Config_bossSpell4[eventInProgress], false, nil, base2) + else + creature:CastSpell(targetPlayer, Config_bossSpell4[eventInProgress]) + end + if nextPlayerIndex >= #players then + nextPlayerIndex = 1 + else + nextPlayerIndex = nextPlayerIndex + 1 + end + end + end + lastBossSpell3 = GetCurrTime() + return + end + end + else + if Config_bossSpell3[eventInProgress] ~= nil then + if Config_bossSpellModifier3bp0[eventInProgress] ~= nil and Config_bossSpellModifier3bp1[eventInProgress] ~= nil then + local base1 = eS_getDifficultyModifier(Config_bossSpellModifier3bp0[eventInProgress]) + local base2 = eS_getDifficultyModifier(Config_bossSpellModifier3bp1[eventInProgress]) + creature:CastCustomSpell(creature:GetVictim(), Config_bossSpell3[eventInProgress], false, base1, base2) + elseif Config_bossSpellModifier3bp0[eventInProgress] ~= nil then + local base1 = eS_getDifficultyModifier(Config_bossSpellModifier3bp0[eventInProgress]) + creature:CastCustomSpell(creature:GetVictim(), Config_bossSpell3[eventInProgress], false, base1) + elseif Config_bossSpellModifier3bp1[eventInProgress] ~= nil then + local base2 = eS_getDifficultyModifier(Config_bossSpellModifier3bp1[eventInProgress]) + creature:CastCustomSpell(creature:GetVictim(), Config_bossSpell3[eventInProgress], false, nil, base2) + else + creature:CastSpell(creature:GetVictim(), Config_bossSpell3[eventInProgress]) + end + lastBossSpell3 = GetCurrTime() + return + end + end + end + end + end + + if Config_bossSpellTimer5[eventInProgress] ~= nil then + if eS_getDifficultyTimer(Config_bossSpellTimer5[eventInProgress]) < eS_getTimeSince(lastBossSpell5) then + if phase == 1 then + if Config_bossSpell5[eventInProgress] ~= nil then + if Config_bossSpellModifier5bp0[eventInProgress] ~= nil and Config_bossSpellModifier5bp1[eventInProgress] ~= nil then + local base1 = eS_getDifficultyModifier(Config_bossSpellModifier5bp0[eventInProgress]) + local base2 = eS_getDifficultyModifier(Config_bossSpellModifier5bp1[eventInProgress]) + creature:CastCustomSpell(creature:GetVictim(), Config_bossSpell5[eventInProgress], false, base1, base2) + elseif Config_bossSpellModifier5bp0[eventInProgress] ~= nil then + local base1 = eS_getDifficultyModifier(Config_bossSpellModifier5bp0[eventInProgress]) + creature:CastCustomSpell(creature:GetVictim(), Config_bossSpell5[eventInProgress], false, base1) + elseif Config_bossSpellModifier5bp1[eventInProgress] ~= nil then + local base2 = eS_getDifficultyModifier(Config_bossSpellModifier5bp1[eventInProgress]) + creature:CastCustomSpell(creature:GetVictim(), Config_bossSpell5[eventInProgress], false, nil, base2) + else + creature:CastSpell(creature:GetVictim(), Config_bossSpell5[eventInProgress]) + end + lastBossSpell5 = GetCurrTime() + return + end + else + if Config_bossSpell6[eventInProgress] ~= nil then + if Config_bossSpellModifier6bp0[eventInProgress] ~= nil and Config_bossSpellModifier6bp1[eventInProgress] ~= nil then + local base1 = eS_getDifficultyModifier(Config_bossSpellModifier6bp0[eventInProgress]) + local base2 = eS_getDifficultyModifier(Config_bossSpellModifier6bp1[eventInProgress]) + creature:CastCustomSpell(creature:GetVictim(), Config_bossSpell6[eventInProgress], false, base1, base2) + elseif Config_bossSpellModifier6bp0[eventInProgress] ~= nil then + local base1 = eS_getDifficultyModifier(Config_bossSpellModifier6bp0[eventInProgress]) + creature:CastCustomSpell(creature:GetVictim(), Config_bossSpell6[eventInProgress], false, base1) + elseif Config_bossSpellModifier6bp1[eventInProgress] ~= nil then + local base2 = eS_getDifficultyModifier(Config_bossSpellModifier6bp1[eventInProgress]) + creature:CastCustomSpell(creature:GetVictim(), Config_bossSpell6[eventInProgress], false, nil, base2) + else + creature:CastSpell(creature:GetVictim(), Config_bossSpell6[eventInProgress]) + end + lastBossSpell5 = GetCurrTime() + return + end + end + end + end + + if Config_minPhaseForTimer7[eventInProgress] == nil then + Config_minPhaseForTimer7[eventInProgress] = 1 + end + if Config_bossSpellTimer7[eventInProgress] ~= nil and phase >= Config_minPhaseForTimer7[eventInProgress] then + if nextBossSpell8Delay ~= nil then + if Config_bossSpell8[eventInProgress] ~= nil then + if Config_bossSpell8delay[eventInProgress] < eS_getTimeSince(nextBossSpell8Delay) then + if Config_bossSpellModifier8bp0[eventInProgress] ~= nil and Config_bossSpellModifier8bp1[eventInProgress] ~= nil then + local base1 = eS_getDifficultyModifier(Config_bossSpellModifier8bp0[eventInProgress]) + local base2 = eS_getDifficultyModifier(Config_bossSpellModifier8bp1[eventInProgress]) + creature:CastCustomSpell(creature:GetVictim(), Config_bossSpell8[eventInProgress], false, base1, base2) + elseif Config_bossSpellModifier8bp0[eventInProgress] ~= nil then + local base1 = eS_getDifficultyModifier(Config_bossSpellModifier8bp0[eventInProgress]) + creature:CastCustomSpell(creature:GetVictim(), Config_bossSpell8[eventInProgress], false, base1) + elseif Config_bossSpellModifier8bp1[eventInProgress] ~= nil then + local base2 = eS_getDifficultyModifier(Config_bossSpellModifier8bp1[eventInProgress]) + creature:CastCustomSpell(creature:GetVictim(), Config_bossSpell8[eventInProgress], false, nil, base2) + else + creature:CastSpell(creature:GetVictim(), Config_bossSpell8[eventInProgress]) + end + nextBossSpell8Delay = nil + return + end + end + end + + if eS_getDifficultyTimer(Config_bossSpellTimer7[eventInProgress]) < eS_getTimeSince(lastBossSpell7) then + if Config_bossSpell7[eventInProgress] ~= nil then + if Config_bossSpellModifier7bp0[eventInProgress] ~= nil and Config_bossSpellModifier7bp1[eventInProgress] ~= nil then + local base1 = eS_getDifficultyModifier(Config_bossSpellModifier7bp0[eventInProgress]) + local base2 = eS_getDifficultyModifier(Config_bossSpellModifier7bp1[eventInProgress]) + creature:CastCustomSpell(creature:GetVictim(), Config_bossSpell7[eventInProgress], false, base1, base2) + elseif Config_bossSpellModifier7bp0[eventInProgress] ~= nil then + local base1 = eS_getDifficultyModifier(Config_bossSpellModifier7bp0[eventInProgress]) + creature:CastCustomSpell(creature:GetVictim(), Config_bossSpell7[eventInProgress], false, base1) + elseif Config_bossSpellModifier7bp1[eventInProgress] ~= nil then + local base2 = eS_getDifficultyModifier(Config_bossSpellModifier7bp1[eventInProgress]) + creature:CastCustomSpell(creature:GetVictim(), Config_bossSpell7[eventInProgress], false, nil, base2) + else + creature:CastSpell(creature:GetVictim(), Config_bossSpell7[eventInProgress]) + end + lastBossSpell7 = GetCurrTime() + nextBossSpell8Delay = lastBossSpell7 + return + end + end + end +end + +function addNPC.onEnterCombat(event, creature, target) + local player + + + creature:RegisterEvent(addNPC.Event, math.random(100,150), 0) + + creature:CallAssistance() + creature:CallForHelp(200) + for _, v in pairs(playersInRaid) do + player = GetPlayerByGUID(v) + if player ~= nil then + creature:AddThreat(player, 1) + end + end + addphase = 1 + + if bossfightInProgress == PARTY_IN_PROGRESS then + lastAddSpell1[1] = encounterStartTime + lastAddSpell2[1] = encounterStartTime + lastAddSpell3[1] = encounterStartTime + lastAddSpell4[1] = encounterStartTime + else + for n, _ in pairs(spawnedCreatureGuid) do + lastAddSpell1[n] = encounterStartTime + lastAddSpell2[n] = encounterStartTime + lastAddSpell3[n] = encounterStartTime + lastAddSpell4[n] = encounterStartTime + end + end +end + +function addNPC.Event(event, delay, pCall, creature) + if creature:IsCasting() == true then return end + + if bossfightInProgress == PARTY_IN_PROGRESS and Config_addSpell1[eventInProgress] ~= nil then -- only for the party version + if addphase == 1 and creature:GetHealthPct() < 67 then + addphase = 2 + elseif addphase == 2 and creature:GetHealthPct() < 34 then + addphase = 3 + end + if addphase == 1 and creature:GetHealthPct() < 67 or addphase == 2 and creature:GetHealthPct() < 34 then + if Config_addEnoughYell[eventInProgress] ~= nil then + creature:SendUnitYell(Config_addEnoughYell[eventInProgress], 0 ) + end + if Config_addEnoughSound[eventInProgress] ~= nil then + creature:PlayDirectSound(Config_addEnoughSound[eventInProgress]) + end + local players = creature:GetPlayersInRange(30) + if #players > 1 then + creature:CastSpell(creature:GetAITarget(SELECT_TARGET_FARTHEST, true, 0, 30), Config.addEnoughSpell) + return + else + creature:CastSpell(creature:GetAITarget(SELECT_TARGET_FARTHEST, true, 0, 30), Config_addSpell1[eventInProgress]) + return + end + end + end + + local n = eS_returnIndex(spawnedCreatureGuid, creature:GetGUID()) -- tell multiple adds apart in raid mode + if n == false then n = 1 end -- no need to set this in party mode + + + if Config_addSpellEnrage[eventInProgress] ~= nil then + if eS_getDifficultyTimer(Config.addEnrageTimer) < eS_getTimeSince(encounterStartTime)then + if phase == 2 and eS_getTimeSince(encounterStartTime) > Config_addSpellEnrage[eventInProgress] then + phase = 3 + creature:SendUnitYell("FEEL MY WRATH!", 0 ) + creature:CastSpell(creature, Config_addSpellEnrage[eventInProgress]) + return + end + end + end + + local randomTimer = math.random(0,1000) + + if Config_addSpellTimer1[eventInProgress] ~= nil and Config_addSpell1[eventInProgress] ~= nil then + if eS_getDifficultyTimer(Config_addSpellTimer1[eventInProgress]) < randomTimer + eS_getTimeSince(lastAddSpell1[n]) then + local random = math.random(0, 2) + local players = creature:GetPlayersInRange(30) + if #players > 1 then + if Config_addSpellModifier1bp0[eventInProgress] ~= nil and Config_addSpellModifier1bp1[eventInProgress] ~= nil then + local base1 = eS_getDifficultyModifier(Config_addSpellModifier1bp0[eventInProgress]) + local base2 = eS_getDifficultyModifier(Config_addSpellModifier1bp1[eventInProgress]) + creature:CastCustomSpell(creature:GetAITarget(SELECT_TARGET_FARTHEST, true, random, 30), Config_addSpell1[eventInProgress], false, base1, base2) + elseif Config_addSpellModifier1bp0[eventInProgress] ~= nil then + local base1 = eS_getDifficultyModifier(Config_addSpellModifier1bp0[eventInProgress]) + creature:CastCustomSpell(creature:GetAITarget(SELECT_TARGET_FARTHEST, true, random, 30), Config_addSpell1[eventInProgress], false, base1) + elseif Config_addSpellModifier1bp1[eventInProgress] ~= nil then + local base2 = eS_getDifficultyModifier(Config_addSpellModifier1bp1[eventInProgress]) + creature:CastCustomSpell(creature:GetAITarget(SELECT_TARGET_FARTHEST, true, random, 30), Config_addSpell1[eventInProgress], false, nil, base2) + else + creature:CastSpell(creature:GetAITarget(SELECT_TARGET_FARTHEST, true, random, 30), Config_addSpell1[eventInProgress]) + end + lastAddSpell1[n] = GetCurrTime() + return + else + if Config_addSpellModifier1bp0[eventInProgress] ~= nil and Config_addSpellModifier1bp1[eventInProgress] ~= nil then + local base1 = eS_getDifficultyModifier(Config_addSpellModifier1bp0[eventInProgress]) + local base2 = eS_getDifficultyModifier(Config_addSpellModifier1bp1[eventInProgress]) + creature:CastCustomSpell(creature:GetVictim(), Config_addSpell1[eventInProgress], false, base1, base2) + elseif Config_addSpellModifier1bp0[eventInProgress] ~= nil then + local base1 = eS_getDifficultyModifier(Config_addSpellModifier1bp0[eventInProgress]) + creature:CastCustomSpell(creature:GetVictim(), Config_addSpell1[eventInProgress], false, base1) + elseif Config_addSpellModifier1bp1[eventInProgress] ~= nil then + local base2 = eS_getDifficultyModifier(Config_addSpellModifier1bp1[eventInProgress]) + creature:CastCustomSpell(creature:GetVictim(), Config_addSpell1[eventInProgress], false, nil, base2) + else + creature:CastSpell(creature:GetVictim(),Config_addSpell1[eventInProgress]) + end + lastAddSpell1[n] = GetCurrTime() + return + end + end + end + + if Config_addSpellTimer2[eventInProgress] ~= nil and Config_addSpell2[eventInProgress] ~= nil then + if eS_getDifficultyTimer(Config_addSpellTimer2[eventInProgress]) < randomTimer + (eS_getTimeSince(lastAddSpell2[n])) then + if Config_addSpell2Sound[eventInProgress] ~= nil then + creature:PlayDirectSound(Config_addSpell2Sound[eventInProgress]) + end + if Config_addSpellModifier2bp0[eventInProgress] ~= nil and Config_addSpellModifier2bp1[eventInProgress] ~= nil then + local base1 = eS_getDifficultyModifier(Config_addSpellModifier2bp0[eventInProgress]) + local base2 = eS_getDifficultyModifier(Config_addSpellModifier2bp1[eventInProgress]) + creature:CastCustomSpell(creature:GetVictim(), Config_addSpell2[eventInProgress], false, base1, base2) + elseif Config_addSpellModifier2bp0[eventInProgress] ~= nil then + local base1 = eS_getDifficultyModifier(Config_addSpellModifier2bp0[eventInProgress]) + creature:CastCustomSpell(creature:GetVictim(), Config_addSpell2[eventInProgress], false, base1) + elseif Config_addSpellModifier2bp1[eventInProgress] ~= nil then + local base2 = eS_getDifficultyModifier(Config_addSpellModifier2bp1[eventInProgress]) + creature:CastCustomSpell(creature:GetVictim(), Config_addSpell2[eventInProgress], false, nil, base2) + else + creature:CastSpell(creature:GetVictim(), Config_addSpell2[eventInProgress]) + end + lastAddSpell2[n] = GetCurrTime() + return + end + end + + if Config_addSpellTimer3[eventInProgress] ~= nil and Config_addSpell3[eventInProgress] ~= nil then + if eS_getDifficultyTimer(Config_addSpellTimer3[eventInProgress]) < randomTimer + eS_getTimeSince(lastAddSpell3[n]) then + if Config_addSpell3Yell[eventInProgress] ~= nil then + creature:SendUnitYell(Config_addSpell3Yell[eventInProgress], 0 ) + end + if Config_addSpellModifier3bp0[eventInProgress] ~= nil and Config_addSpellModifier3bp1[eventInProgress] ~= nil then + local base1 = eS_getDifficultyModifier(Config_addSpellModifier3bp0[eventInProgress]) + local base2 = eS_getDifficultyModifier(Config_addSpellModifier3bp1[eventInProgress]) + creature:CastCustomSpell(creature, Config_addSpell3[eventInProgress], false, base1, base2) + elseif Config_addSpellModifier3bp0[eventInProgress] ~= nil then + local base1 = eS_getDifficultyModifier(Config_addSpellModifier3bp0[eventInProgress]) + creature:CastCustomSpell(creature, Config_addSpell3[eventInProgress], false, base1) + elseif Config_addSpellModifier3bp1[eventInProgress] ~= nil then + local base2 = eS_getDifficultyModifier(Config_addSpellModifier3bp1[eventInProgress]) + creature:CastCustomSpell(creature, Config_addSpell3[eventInProgress], false, nil, base2) + else + creature:CastSpell(creature, Config_addSpell3[eventInProgress]) + end + lastAddSpell3[n] = GetCurrTime() + return + end + end + + if bossfightInProgress == RAID_IN_PROGRESS then + if Config_addSpellTimer4[eventInProgress] ~= nil and Config_addSpell4[eventInProgress] ~= nil then + if eS_getDifficultyTimer(Config_addSpellTimer4[eventInProgress]) < randomTimer + eS_getTimeSince(lastAddSpell4[n]) then + local map = creature:GetMap() + if map ~= nil then + if map:GetWorldObject(spawnedBossGuid) ~= nil then + local bossNPC = map:GetWorldObject(spawnedBossGuid):ToCreature() + creature:CastSpell(bossNPC, Config_addSpell4[eventInProgress]) + lastAddSpell4[n] = GetCurrTime() + return + end + end + end + end + end +end + +function addNPC.reset(event, creature) + local player + if bossfightInProgress == PARTY_IN_PROGRESS then + eS_checkInCombat() + end + creature:RemoveEvents() + if bossfightInProgress == PARTY_IN_PROGRESS then + if creature:IsDead() == true then + local playerListString + CreateLuaEvent(eS_castFireworks, 1000, 20) + creature:PlayDirectSound(8803) + for _, v in pairs(playersInRaid) do + player = GetPlayerByGUID(v) + if player ~= nil then + if player:GetCorpse() ~= nil then + player:GetCorpse():SetPhaseMask(1) + end + player:SetPhaseMask(1) + if playerListString == nil then + playerListString = player:GetName() + else + playerListString = playerListString..", "..player:GetName() + end + end + end + if Config.rewardParty == 1 then + awardScore() + elseif Config.storeParty == 1 then + storeEncounter() + else + bossfightInProgress = nil + end + SendWorldMessage("The party encounter "..creature:GetName().." was completed on difficulty "..difficulty.." in "..eS_getEncounterDuration().." by: "..playerListString..". Congratulations!") + playersForFireworks = playersInRaid + playersInRaid = {} + else + creature:SendUnitYell("Hahahaha!", 0 ) + for _, v in pairs(playersInRaid) do + player = GetPlayerByGUID(v) + if player ~= nil then + if player:GetCorpse() ~= nil then + player:GetCorpse():SetPhaseMask(1) + end + player:SetPhaseMask(1) + end + end + playersInRaid = {} + bossfightInProgress = nil + end + else + if creature:IsDead() == true then + if addsDownCounter == nil then + addsDownCounter = 1 + else + addsDownCounter = addsDownCounter + 1 + end + end + end + creature:DespawnOrUnsummon(0) +end + +local function initBossEvents() + for n = Config_bossEntry[1], Config_bossEntry[1] + 990, 10 do + if eS_has_value(Config_bossEntry,n) then + RegisterCreatureEvent(n, 1, bossNPC.onEnterCombat) + RegisterCreatureEvent(n, 2, bossNPC.reset) -- OnLeaveCombat + RegisterCreatureEvent(n, 4, bossNPC.reset) -- OnDied + else + return + end + end +end + +local function initAddEvents() + for n = Config_addEntry[1], Config_addEntry[1] + 990, 10 do + if eS_has_value(Config_addEntry,n) then + RegisterCreatureEvent(n, 1, addNPC.onEnterCombat) + RegisterCreatureEvent(n, 2, addNPC.reset) -- OnLeaveCombat + RegisterCreatureEvent(n, 4, addNPC.reset) -- OnDied + else + return + end + end +end + +local function eS_partyNpcYell(eventid, delay, repeats, worldobject) + if partyNpcSayCounter == 10 then + worldobject:SendUnitYell(Config.PartyNpcYellText, 0) + partyNpcSayCounter = 0 + else + worldobject:SendUnitSay(Config.PartyNpcSayText, 0) + partyNpcSayCounter = partyNpcSayCounter + 1 + end +end + +local function eS_CloseLua(eI_CloseLua) + if npcObjectGuid ~= nil then + local npcObject + local map + map = GetMapById(Config.MapId) + if not map then + return + end + npcObject = map:GetWorldObject(npcObjectGuid):ToCreature() + if not npcObject then + return + end + npcObject:DespawnOrUnsummon(0) + end +end + +--on ReloadEluna / Startup +RegisterPlayerEvent(PLAYER_EVENT_ON_COMMAND, eS_command) +RegisterPlayerEvent(PLAYER_EVENT_ON_REPOP, eS_resetPlayers) + +initBossEvents() +initAddEvents() + +CharDBQuery('CREATE DATABASE IF NOT EXISTS `'..Config.customDbName..'`;'); +CharDBQuery('CREATE TABLE IF NOT EXISTS `'..Config.customDbName..'`.`eventscript_encounters` (`time_stamp` INT NOT NULL, `playerGuid` INT NOT NULL, `encounter` INT DEFAULT 0, `difficulty` TINYINT DEFAULT 0, `group_type` TINYINT DEFAULT 0, `duration` INT NOT NULL, PRIMARY KEY (`time_stamp`, `playerGuid`));'); +CharDBQuery('CREATE TABLE IF NOT EXISTS `'..Config.customDbName..'`.`eventscript_score` (`account_id` INT NOT NULL, `score_earned_current` INT DEFAULT 0, `score_earned_total` INT DEFAULT 0, PRIMARY KEY (`account_id`));') + +local Data_SQL = CharDBQuery('SELECT * FROM `'..Config.customDbName..'`.`eventscript_score`;') +if Data_SQL ~= nil then + local account + repeat + account = Data_SQL:GetUInt32(0) + scoreEarned[account] = Data_SQL:GetUInt32(1) + scoreTotal[account] = Data_SQL:GetUInt32(2) + until not Data_SQL:NextRow() +end + +if Config.partySelectNpcActive == 1 then + RegisterServerEvent(ELUNA_EVENT_ON_LUA_STATE_CLOSE, eS_CloseLua, 0) + RegisterCreatureGossipEvent(Config.partySelectNpc, GOSSIP_EVENT_ON_HELLO, eS_onPartyOnlyHello) + RegisterCreatureGossipEvent(Config.partySelectNpc, GOSSIP_EVENT_ON_SELECT, eS_chromiePartyOnlyGossip) + local npcObject = PerformIngameSpawn(1, Config.partySelectNpc, Config.MapId, Config.InstanceId, Config.NpcX, Config.NpcY, Config.NpcZ, Config.NpcO) + npcObjectGuid = npcObject:GetGUID() + npcObject:RegisterEvent(eS_partyNpcYell, 60000, 0) +end \ No newline at end of file diff --git a/MiscTools/DinkleStone1.lua b/MiscTools/DinkleStone1.lua new file mode 100644 index 0000000..74179b9 --- /dev/null +++ b/MiscTools/DinkleStone1.lua @@ -0,0 +1,102 @@ +local ItemEntry = 65000 -- Hearthstone. You can change this item ID to whatever. + +local T = { + [1] = { "|TInterface\\icons\\achievement_pvp_h_h:37:37:-23|t|cff610B0BHorde Cities|r", 1, + {"|TInterface\\icons\\achievement_zone_durotar:37:37:-23|t|cff610B0BOrgrimmar|r", 1, 1503, -4415.5, 22, 0}, + {"|TInterface\\icons\\achievement_zone_tirisfalglades_01:37:37:-23|t|cff610B0BUndercity|r", 0, 1831, 238.5, 61.6, 0}, + {"|TInterface\\icons\\achievement_zone_mulgore_01:37:37:-23|t|cff610B0BThunderbluff|r", 1, -1278, 122, 132, 0}, + {"|TInterface\\icons\\achievement_zone_bloodmystisle_01:37:37:-23|t|cff610B0BSilvermoon|r", 530, 9487.69, -7279.2, 14.2866, 0}, + {"|TInterface\\icons\\achievement_reputation_wyrmresttemple:37:37:-23|t|cff642EFEShattrath|r", 530, -1838.16, 5301.79, -12.428, 0}, + {"|TInterface\\icons\\achievement_reputation_kirintor:37:37:-23|t|cff642EFEDalaran|r", 571, 5804.15, 624.771, 647.767, 0}, + }, + [2] = {"|TInterface\\icons\\achievement_pvp_a_a:37:37:-23|t|cff0101DFAlliance Cities|r", 0, + {"|TInterface\\icons\\achievement_zone_elwynnforest:37:37:-23|t|cff0101DFStormwind|r", 0, -8905, 560, 94, 0.62}, + {"|TInterface\\icons\\achievement_zone_dunmorogh:37:37:-23|t|cff0101DFIronforge|r", 0, -4795, -1117, 499, 0}, + {"|TInterface\\icons\\achievement_zone_ashenvale_01:37:37:-23|t|cff0101DFDarnassus|r", 1, 9952, 2280.5, 1342, 1.6}, + {"|TInterface\\icons\\achievement_zone_zangarmarsh:37:37:-23|t|cff0101DFThe Exodar|r", 530, -3965.7, -11653.6, -138.844, 0}, + {"|TInterface\\icons\\achievement_reputation_wyrmresttemple:37:37:-23|t|cff642EFEShattrath|r", 530, -1838.16, 5301.79, -12.428, 0}, + {"|TInterface\\icons\\achievement_reputation_kirintor:37:37:-23|t|cff642EFEDalaran|r", 571, 5804.15, 624.771, 647.767, 0}, + }, + [3] = { "|TInterface\\icons\\achievement_bg_winwsg:37:37:-23|t|cffC41F3BPvP Locations|r", 2, + {"Gurubashi Arena", 0, -13229, 226, 33, 1}, + {"Dire Maul Arena", 1, -3669, 1094, 160, 3}, + {"Nagrand Arena", 530, -1983, 6562, 12, 2}, + {"Blade's Edge Arena", 530, 2910, 5976, 2, 4}, + }, + [4] = {"|TInterface\\icons\\achievement_zone_elwynnforest:37:37:-23|t|cff0101DFAlliance Starter Areas|r", 0, + {"Northshire Valley", 0, -8921.09, -119.13, 82.2, 6}, + {"Coldridge", 0, -6231.77, 333, 383.17, 0}, + {"Shadowglen", 1, 10322.26, 831.4, 1326.37, 0}, + {"Ammen Vale", 530, -3961.64, -13931.2, 100.615, 0}, + }, + [5] = { "|TInterface\\icons\\achievement_zone_durotar:37:37:-23|t|cff610B0BHorde Starter Areas|r", 1, + {"Valley of Trials", 1, -618.518, -4251.67, 38.718, 0}, + {"Camp Narache", 1, -2917.58, -257.98, 52.9968, 0}, + {"Death Knell", 0, 1676.71, 1678.31, 121.67, 0}, + {"Sunstrider Isle", 530, 10349.6, -6357.29, 33.4026, 0}, + }, + [6] = {"|TInterface\\icons\\achievement_boss_ragnaros:37:37:-23|t|cff0101DFRaids|r", 2, + {"Molten Core", 230, 1126.64, -459.94, -102.535, 3.46095}, + {"Onyxia's Lair", 1, -4708.27, -3727.64, 54.5589, 3.72786}, + {"Blackwing Lair", 469, -7664.76, -1100.87,399.679, 0}, + {"Zul'Gurub", 309, -11916.9, -1248.36, 92.5334, 4.72417}, + {"Ahn'Qiraj", 1, -8253.067, 1538.91, -4.797, 3.065894}, + {"Naxx 40", 0, 3082.924316, -3746.725830, 133.52, 0}, + {"Karazhan", 0, -11118.9, -2010.33,47.0819, 0.649895}, + {"Magtheridon's Lair", 530, -312.7, 3087.26, -116.52, 5.19026}, + {"Gruul's Lair", 530, 3530.06, 5104.08, 3.50861, 5.51117}, + {"Zul'Aman", 530, 6851.78, -7972.57, 179.242, 4.64691}, + {"Serpentshrine Caverns", 530, 748.984436, 6870.443359, -68, 6.246}, + {"Tempest Keep", 530, 3088.49, 1381.57, 184.863, 4.61973}, + {"Hyjal Summit", 1, -8177.5, -4183, -168, 1}, + {"Black Temple", 530, -3649.92, 317.469, 35.2827, 2.94285}, + {"Sunwell Plateau", 530, 12574.1, -6774.81, 15.0904, 3.13788}, + {"Naxx Wotlk", 571, 3670.268066, -1263.276367, 243.52, 4.61}, + {"Obsidian Sanctum", 571, 3457.11, 262.394, -113.819, 3.28258}, + {"Eye of Eternity", 571, 3859.44, 6989.85, 152.041, 5.79635}, + {"Vault of Archavon", 571, 5453.72, 2840.79, 421.28, 0}, + {"Ulduar", 571, 9251.101562, -1112.424072, 1216.115479, 6.26}, + {"Trial of the Crusader", 571, 8515.68, 716.982, 558.248, 1.57315}, + {"Icecrown Citadel", 571, 5873.82, 2110.98, 636.011, 3.5523}, + {"Ruby Sanctum", 571, 3600.5, 197.34, -113.76, 5.29905}, + }, +} + +local function OnGossipHello(event, player, item) + -- Show main menu + for i, v in ipairs(T) do + if (v[2] == 2 or v[2] == player:GetTeam()) then + player:GossipMenuAddItem(0, v[1], i, 0) + end + end + player:GossipSendMenu(1, item) +end + +local function OnGossipSelect(event, player, item, sender, intid, code) + if (sender == 0) then + -- return to main menu + OnGossipHello(event, player, item) + return + end + + if (intid == 0) then + -- Show teleport menu + for i, v in ipairs(T[sender]) do + if (i > 2) then + player:GossipMenuAddItem(0, v[1], sender, i) + end + end + player:GossipMenuAddItem(0, "Back", 0, 0) + player:GossipSendMenu(1, item) + return + else + -- teleport + local name, map, x, y, z, o = table.unpack(T[sender][intid]) + player:Teleport(map, x, y, z, o) + end + + player:GossipComplete() +end + +RegisterItemGossipEvent(ItemEntry, 1, OnGossipHello) +RegisterItemGossipEvent(ItemEntry, 2, OnGossipSelect) \ No newline at end of file diff --git a/MiscTools/Dinklestone2.lua b/MiscTools/Dinklestone2.lua new file mode 100644 index 0000000..f8bf7e3 --- /dev/null +++ b/MiscTools/Dinklestone2.lua @@ -0,0 +1,51 @@ +function OnGossipHello(event, player, item) +if player:GetLevel() < 15 then +player:SendBroadcastMessage("You need to be level 15 or higher to use this item.") +return +end +player:GossipMenuAddItem(0, "|TInterface\\icons\\achievement_boss_lichking:37:37:-23|t|cff007d45Scourge Event|r", 150, 0) +player:GossipSendMenu(1, item) +end + +local function OnGossipSelect(event, player, item, sender, intid, code) +if (sender == 150) then +-- Show Scourge Event menu +player:GossipMenuAddItem(0, "|TInterface\\icons\\spell_misc_emotionhappy:37:37:-23|t|cff007d45Start Event for Bonus Lich Runes|r", 100, 0) +player:GossipMenuAddItem(0, "|TInterface\\icons\\spell_misc_emotionsad:37:37:-23|t|cffC41F3BStop Event but Suffer|r", 101, 0) +player:GossipMenuAddItem(0, "Back", 0, 0) +player:GossipSendMenu(1, item) +return +elseif (sender == 100) then +-- Start the event +if IsGameEventActive(17) then +player:SendBroadcastMessage("The Scourge event is already active.") +else +player:AddItem(43949, 2) +StartGameEvent(17, true) +player:PlayDirectSound(14797) +end +player:GossipComplete() +elseif (sender == 101) then +-- Stop the event +if not IsGameEventActive(17) then +player:SendBroadcastMessage("The Scourge event is not currently active.") +else +StopGameEvent(17, true) +player:CastSpell(player, 15007, true) +player:RemoveItem(43949, 2) +player:SetLevel(player:GetLevel()) +player:SendBroadcastMessage("2 Lich Runes have been removed, you've been given Resurrection Sickness and have lost your current level's experience progress. So sad :(") +player:PlayDirectSound(14776) +end +player:GossipComplete() +elseif (sender == 0) then +-- return to main menu +OnGossipHello(event, player, item) +return +end + +player:GossipComplete() +end + +RegisterItemGossipEvent(65001, 1, OnGossipHello) +RegisterItemGossipEvent(65001, 2, OnGossipSelect) \ No newline at end of file diff --git a/MiscTools/FelRushSoundFix.lua b/MiscTools/FelRushSoundFix.lua new file mode 100644 index 0000000..3dd7029 --- /dev/null +++ b/MiscTools/FelRushSoundFix.lua @@ -0,0 +1,12 @@ +local SPELL_ID = 100207 +local SOUND_ID = 53774 +local ADDITIONAL_SPELL_ID = 200181 + +function OnSpellCast(event, player, spell) + if spell:GetEntry() == SPELL_ID then + player:PlayDirectSound(SOUND_ID, player) + player:CastSpell(player, ADDITIONAL_SPELL_ID, true) + end +end + +RegisterPlayerEvent(5, OnSpellCast) \ No newline at end of file diff --git a/MiscTools/FlyableWaypoints.lua b/MiscTools/FlyableWaypoints.lua new file mode 100644 index 0000000..eb31f0d --- /dev/null +++ b/MiscTools/FlyableWaypoints.lua @@ -0,0 +1,8 @@ +local Waypoint = {}; + +function Waypoint.OnSpawn(event, creature) +creature:CanFly(true) +creature:SetDisableGravity(true) +end + +RegisterCreatureEvent(1, 5, Waypoint.OnSpawn) diff --git a/MiscTools/Murky.lua b/MiscTools/Murky.lua new file mode 100644 index 0000000..8a33dc9 --- /dev/null +++ b/MiscTools/Murky.lua @@ -0,0 +1,28 @@ +function MurkyOnSpawn(event, creature) + local playerName = creature:GetOwner():GetName() + local dialogue = { + "Mrglglglgl! Murky here, reporting for duty!", + "Mrrrrrrrglglglgl! Murky happy to serve you, " .. playerName .. "!", + "Mrglgl! Murloc Murky at your service! Let's conquer Azeroth together!", + "Mrrrglglgl! Murky ready to take on any challenge with you, " .. playerName .. "!", + "Mrglglglglgl! Reporting for duty! Let's make some waves, " .. playerName .. "!", + "Mrrglglgl! Murky is excited to join your team, " .. playerName .. "! Let's show everyone what we're made of!", + "Mrglglgl! Murloc warrior Murky at your command, " .. playerName .. "! Let's make our enemies quake with fear!", + "Mrrrglglgl! Murky is eager to prove his worth to you, " .. playerName .. "! Let's take on the world together!", + "Mrglglglgl! This Murloc is ready to make some noise with you, " .. playerName .. "! Let's show them who's boss!", + "Mrrrglgl! Murky honored to be your loyal companion, " .. playerName .. "! Let's take on any challenge that comes our way!", + "Greetings, adventurer! The one and only Murky has arrived to join you on your quest!", + "Mrglgl! Murky is here to lend a fin and help you conquer the land, " .. playerName .. "!", + "Mrrglgl! Murky is thrilled to serve such a worthy leader as yourself, " .. playerName .. "!", + "Mrglglglgl! Murky reporting for duty! Let's make some mischief and have some fun, " .. playerName .. "!", + "Mrrglgl! Murky is honored to be fighting by your side, " .. playerName .. "! Let's take on our foes with all we've got!", + "Mrglglgl! Murky is eager to explore the land and see what adventures await us, " .. playerName .. "!", + "Mrrrglglgl! Murky is always up for a challenge, " .. playerName .. "! Let's go forth and conquer!", + "Mrglglglgl! Murky is ready to make some waves and take on the world, " .. playerName .. "! Let's do this!", + "Mrrrglgl! Murky will be your trusty sidekick on this journey, " .. playerName .. "! Let's make some memories!", + "Mrglglglgl! Murky is thrilled to be part of your team, " .. playerName .. "! Let's show them what we're made of and come out on top!" + } + creature:SendUnitSay(dialogue[math.random(#dialogue)], 0) +end + +RegisterCreatureEvent(15186, 5, MurkyOnSpawn) -- register the function to be called on Murky's spawn diff --git a/MiscTools/SmolderingEmberRestrict.lua b/MiscTools/SmolderingEmberRestrict.lua new file mode 100644 index 0000000..2b1e313 --- /dev/null +++ b/MiscTools/SmolderingEmberRestrict.lua @@ -0,0 +1,46 @@ +local ALLOWED_MAPS = { +0, +1, +} + +local ALLOWED_SPELLS = {100150, 100160, 100161, 100177, 100186, 100168,} + +function table.indexOf(t, value) +for k, v in ipairs(t) do +if v == value then +return k +end +end +return -1 +end + +function OnPlayerCastSpell(event, player, spell) +local spellId = spell:GetEntry() +local mapId = player:GetMapId() + +if table.indexOf(ALLOWED_SPELLS, spellId) ~= -1 then +if table.indexOf(ALLOWED_MAPS, mapId) == -1 then +spell:Cancel() +player:SendBroadcastMessage("You can't use that here.") +else +if spellId == 100150 then +player:PlayDirectSound(20428) +end +end +end +end + +function OnPlayerZoneChange(event, player, newZone, newArea) +local mapId = player:GetMapId() +if table.indexOf(ALLOWED_MAPS, mapId) == -1 then +for i, allowedSpell in ipairs(ALLOWED_SPELLS) do +local aura = player:GetAura(allowedSpell) +if aura then +player:RemoveAura(allowedSpell) +end +end +end +end + +RegisterPlayerEvent(27, OnPlayerZoneChange) +RegisterPlayerEvent(5, OnPlayerCastSpell) \ No newline at end of file diff --git a/MiscTools/SoL.lua b/MiscTools/SoL.lua new file mode 100644 index 0000000..2e7b65f --- /dev/null +++ b/MiscTools/SoL.lua @@ -0,0 +1,12 @@ +-- AzerothCore Eluna script by Dinkledork +local SPELL_SURGE_OF_LIGHT_1 = 33151 +local SPELL_CUSTOM = 100205 + +local function OnSpellCast(event, player, spell, skipCheck) + local spellId = spell:GetEntry() + if spellId == SPELL_SURGE_OF_LIGHT_1 then + player:CastSpell(player, SPELL_CUSTOM, true) + end +end + +RegisterPlayerEvent(5, OnSpellCast) diff --git a/MiscTools/reload_scripts.lua b/MiscTools/reload_scripts.lua new file mode 100644 index 0000000..216102a --- /dev/null +++ b/MiscTools/reload_scripts.lua @@ -0,0 +1,7 @@ +function reloadElunaEngine(event, player, command) +if command == "reload scripts" or command == "reloadscripts" then +ReloadEluna() +end +end + +RegisterPlayerEvent(42, reloadElunaEngine) \ No newline at end of file diff --git a/MoltenCore/CoreRager.lua b/MoltenCore/CoreRager.lua new file mode 100644 index 0000000..2be1c43 --- /dev/null +++ b/MoltenCore/CoreRager.lua @@ -0,0 +1,43 @@ +CoreRager = {} + +function CoreRager.CastMangle(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 19820, true) +end + +function CoreRager.OnDamageTaken(event, creature, attacker, damage) +if creature:GetHealthPct() < 50 then +creature:CastSpell(creature, 17683, true) +creature:SendUnitEmote("Core Rager refuses to die while its master is in trouble.", 0) +end +end + +function CoreRager.OnEnterCombat(event, creature, target) +creature:RegisterEvent(CoreRager.CastMangle, 7000, 0) +end + +function CoreRager.OnLeaveCombat(event, creature) +creature:RemoveEvents() +end + +function CoreRager.OnDied(event, creature, killer) +creature:RemoveEvents() +end + +function CoreRager.OnSpawn(event, creature) +creature:SetMaxHealth(200000) +end + +function CoreRager.OnGolemaggDeath(event, creature, boss) +local coreRagers = creature:GetCreaturesInRange(100, 11672) +for _, coreRager in pairs(coreRagers) do +coreRager:CastSpell(coreRager, 13520, true) +end +end + +RegisterCreatureEvent(11672, 1, CoreRager.OnEnterCombat) +RegisterCreatureEvent(11672, 2, CoreRager.OnLeaveCombat) +RegisterCreatureEvent(11672, 4, CoreRager.OnDied) +RegisterCreatureEvent(11672, 5, CoreRager.OnSpawn) +RegisterCreatureEvent(11672, 9, CoreRager.OnDamageTaken) + +RegisterCreatureEvent(11988, 4, CoreRager.OnGolemaggDeath) \ No newline at end of file diff --git a/MoltenCore/Gehennas.lua b/MoltenCore/Gehennas.lua new file mode 100644 index 0000000..3248d8a --- /dev/null +++ b/MoltenCore/Gehennas.lua @@ -0,0 +1,50 @@ +Gehennas = {} + +function Gehennas.CastGehennasCurse(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 19716, true) +end + +function Gehennas.CastRainOfFire(eventId, delay, calls, creature) +local targets = creature:GetAITargets(10) +local target = targets[math.random(#targets)] +creature:CastSpell(target, 19717, true) +end + +function Gehennas.CastShadowBolt(eventId, delay, calls, creature) +local random = math.random(0,1) +if random == 0 then +creature:CastSpell(creature:GetVictim(), 19729, true) +else +local targets = creature:GetAITargets(10) +local target = targets[math.random(#targets)] +creature:CastSpell(target, 19728, true) +end +end + +function Gehennas.CastShadowboltVolley(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 36275, true) +end + +function Gehennas.OnEnterCombat(event, creature, target) +creature:RegisterEvent(Gehennas.CastGehennasCurse, math.random(25000, 30000), 0) +creature:RegisterEvent(Gehennas.CastRainOfFire, 6000, 0) +creature:RegisterEvent(Gehennas.CastShadowBolt, 5000, 0) +creature:RegisterEvent(Gehennas.CastShadowboltVolley, 15000, 0) +end + +function Gehennas.OnLeaveCombat(event, creature) +creature:RemoveEvents() +end + +function Gehennas.OnDied(event, creature, killer) +creature:RemoveEvents() +end + +function Gehennas.OnSpawn(event, creature) +creature:SetMaxHealth(648000) +end + +RegisterCreatureEvent(12259, 1, Gehennas.OnEnterCombat) +RegisterCreatureEvent(12259, 2, Gehennas.OnLeaveCombat) +RegisterCreatureEvent(12259, 4, Gehennas.OnDied) +RegisterCreatureEvent(12259, 5, Gehennas.OnSpawn) \ No newline at end of file diff --git a/MoltenCore/GemVendor.lua b/MoltenCore/GemVendor.lua new file mode 100644 index 0000000..a08c21c --- /dev/null +++ b/MoltenCore/GemVendor.lua @@ -0,0 +1,185 @@ +local npcid = 190016 +local lavacore = 17011 +local Red = {28458, 28459, 28461, 28462} +local Blue = {28464, 28465, 28466} +local Yellow = {28467, 28468, 28470} + +local function PurchaseRedGem(event, player, creature, sender, intid, code, menu_id) +if (intid == 1) then +if (player:GetItemCount(lavacore) >= 3) then +player:RemoveItem(lavacore, 3) +player:AddItem(Red[1], 1) +creature:SendUnitSay("Your +4 Strength Gem has been added to your inventory.", 0) +else +creature:SendUnitSay("You do not have enough Lava Cores.", 0) +end +end +if (intid == 2) then +if (player:GetItemCount(lavacore) >= 3) then +player:RemoveItem(lavacore, 3) +player:AddItem(Red[2], 1) +creature:SendUnitSay("Your +4 Agility Gem has been added to your inventory.", 0) +else +creature:SendUnitSay("You do not have enough Lava Cores.", 0) +end +end +if (intid == 3) then +if (player:GetItemCount(lavacore) >= 3) then +player:RemoveItem(lavacore, 3) +player:AddItem(Red[3], 1) +creature:SendUnitSay("Your +5 Spell Power Gem has been added to your inventory.", 0) +else +creature:SendUnitSay("You do not have enough Lava Cores.", 0) +end +end +if (intid == 4) then +if (player:GetItemCount(lavacore) >= 3) then +player:RemoveItem(lavacore, 3) +player:AddItem(Red[4], 1) +creature:SendUnitSay("Your +8 Attack Power Gem has been added to your inventory.", 0) +else +creature:SendUnitSay("You do not have enough Lava Cores.", 0) +end +end +end + +local function PurchaseBlueGem(event, player, creature, sender, intid, code, menu_id) +if (intid == 1) then +if (player:GetItemCount(lavacore) >= 3) then +player:RemoveItem(lavacore, 3) +player:AddItem(Blue[1], 1) +creature:SendUnitSay("Your +6 Stamina Gem has been added to your inventory.", 0) +else +creature:SendUnitSay("You do not have enough Lava Cores.", 0) +end +end +if (intid == 2) then +if (player:GetItemCount(lavacore) >= 3) then +player:RemoveItem(lavacore, 3) +player:AddItem(Blue[2], 1) +creature:SendUnitSay("Your +4 Spirit Gem has been added to your inventory.", 0) +else +creature:SendUnitSay("You do not have enough Lava Cores.", 0) +end +end +if (intid == 3) then +if (player:GetItemCount(lavacore) >= 3) then +player:RemoveItem(lavacore, 3) +player:AddItem(Blue[3], 1) +creature:SendUnitSay("Your +2 Mp5 Gem has been added to your inventory.", 0) +else +creature:SendUnitSay("You do not have enough Lava Cores.", 0) +end +end +end + +local function PurchaseYellowGem(event, player, creature, sender, intid, code, menu_id) +if (intid == 1) then +if (player:GetItemCount(lavacore) >= 3) then +player:RemoveItem(lavacore, 3) +player:AddItem(Yellow[1], 1) +creature:SendUnitSay("Your +4 Intellect Gem has been added to your inventory.", 0) +else +creature:SendUnitSay("You do not have enough Lava Cores.", 0) +end +end +if (intid == 2) then +if (player:GetItemCount(lavacore) >= 3) then +player:RemoveItem(lavacore, 3) +player:AddItem(Yellow[2], 1) +creature:SendUnitSay("Your +4 Crit Rating Gem has been added to your inventory.", 0) +else +creature:SendUnitSay("You do not have enough Lava Cores.", 0) +end +end +if (intid == 3) then +if (player:GetItemCount(lavacore) >= 3) then +player:RemoveItem(lavacore, 3) +player:AddItem(Yellow[3], 1) +creature:SendUnitSay("Your +4 Hit Rating Gem has been added to your inventory.", 0) +else +creature:SendUnitSay("You do not have enough Lava Cores.", 0) +end +end +if (intid == 4) then +if (player:GetItemCount(lavacore) >= 3) then +player:RemoveItem(lavacore, 3) +player:AddItem(Yellow[4], 1) +creature:SendUnitSay("Your +4 Defense Rating Gem has been added to your inventory.", 0) +else +creature:SendUnitSay("You do not have enough Lava Cores.", 0) +end +end +end + + + + + + +local function OnGossipHello(event, player, creature) +creature:SendUnitSay("Greetings " .. player:GetName() .. ", For 3 Lava Cores you can have any gem of your choosing.", 0) +player:GossipMenuAddItem(1, "|TInterface\\Icons\\inv_misc_gem_ruby_03:50:50:-43:0|tPurchase Red Gems", 0, 1) +player:GossipMenuAddItem(1, "|TInterface\\Icons\\inv_misc_gem_crystal_03:50:50:-43:0|tPurchase Blue Gems", 0, 2) +player:GossipMenuAddItem(1, "|TInterface\\Icons\\inv_misc_gem_topaz_03:50:50:-43:0|tPurchase Yellow Gems", 0, 3) +player:GossipSendMenu(1, creature) +end + +function OnGossipSelect(event, player, creature, sender, intid, code, menu_id) +if (intid == 1) then +player:GossipMenuAddItem(0, "+4 Strength Gem", 0, 11) +player:GossipMenuAddItem(0, "+4 Agility Gem", 0, 12) +player:GossipMenuAddItem(0, "+5 Spell Power Gem", 0, 13) +player:GossipMenuAddItem(0, "+8 Attack Power Gem", 0, 14) +player:GossipSendMenu(1, creature) +end +if (intid == 2) then +player:GossipMenuAddItem(0, "+6 Stamina Gem", 0, 21) +player:GossipMenuAddItem(0, "+4 Spirit Gem", 0, 22) +player:GossipMenuAddItem(0, "+2 Mp5 Gem", 0, 23) +player:GossipSendMenu(1, creature) +end +if (intid == 3) then +player:GossipMenuAddItem(0, "+4 Intellect Gem", 0, 31) +player:GossipMenuAddItem(0, "+4 Crit Rating Gem", 0, 32) +player:GossipMenuAddItem(0, "+4 Hit Rating Gem", 0, 33) +player:GossipMenuAddItem(0, "+4 Defense Rating Gem", 0, 34) +player:GossipSendMenu(1, creature) +end +if (intid == 11) then +PurchaseRedGem(event, player, creature, sender, 1, code, menu_id) +end +if (intid == 12) then +PurchaseRedGem(event, player, creature, sender, 2, code, menu_id) +end +if (intid == 13) then +PurchaseRedGem(event, player, creature, sender, 3, code, menu_id) +end +if (intid == 14) then +PurchaseRedGem(event, player, creature, sender, 4, code, menu_id) +end +if (intid == 21) then +PurchaseBlueGem(event, player, creature, sender, 1, code, menu_id) +end +if (intid == 22) then +PurchaseBlueGem(event, player, creature, sender, 2, code, menu_id) +end +if (intid == 23) then +PurchaseBlueGem(event, player, creature, sender, 3, code, menu_id) +end +if (intid == 31) then +PurchaseYellowGem(event, player, creature, sender, 1, code, menu_id) +end +if (intid == 32) then +PurchaseYellowGem(event, player, creature, sender, 2, code, menu_id) +end +if (intid == 33) then +PurchaseYellowGem(event, player, creature, sender, 3, code, menu_id) +end +if (intid == 34) then +PurchaseYellowGem(event, player, creature, sender, 4, code, menu_id) +end +end + +RegisterCreatureGossipEvent(npcid, 1, OnGossipHello) +RegisterCreatureGossipEvent(npcid, 2, OnGossipSelect) diff --git a/MoltenCore/Golemagg.lua b/MoltenCore/Golemagg.lua new file mode 100644 index 0000000..c082533 --- /dev/null +++ b/MoltenCore/Golemagg.lua @@ -0,0 +1,49 @@ +Golemagg = {} +Golemagg.enraged = {} + +function Golemagg.CastPyroblast(eventId, delay, calls, creature) +local targets = creature:GetAITargets() +local target = targets[math.random(#targets)] +creature:CastSpell(target, 20228, true) +end + +function Golemagg.CastEarthquake(eventId, delay, calls, creature) +creature:CastSpell(creature, 19798, false) +creature:RegisterEvent(Golemagg.CastEarthquake, 17000, 0) +end + +function Golemagg.DamageTaken(event, creature, attacker, damage) +if not Golemagg.enraged[creature:GetGUID()] and creature:GetHealthPct() < 10 then +creature:CastSpell(creature, 20544, true) +creature:CastSpell(creature, 19798, true) +creature:RegisterEvent(Golemagg.CastEarthquake, 5300, 1) +Golemagg.enraged[creature:GetGUID()] = true +end +end + +function Golemagg.OnEnterCombat(event, creature, target) +creature:RegisterEvent(Golemagg.CastPyroblast, math.random(3000, 7000), 0) +creature:CastSpell(creature, 13879, true) +creature:CastSpell(creature, 20556, true) +creature:CastSpell(creature, 18943, true) +end + +function Golemagg.OnLeaveCombat(event, creature) +creature:RemoveEvents() +end + +function Golemagg.OnDied(event, creature, killer) +creature:RemoveEvents() +Golemagg.enraged[creature:GetGUID()] = nil +end + +function Golemagg.OnSpawn(event, creature) +creature:SetMaxHealth(1652176) +Golemagg.enraged[creature:GetGUID()] = false +end + +RegisterCreatureEvent(11988, 1, Golemagg.OnEnterCombat) +RegisterCreatureEvent(11988, 2, Golemagg.OnLeaveCombat) +RegisterCreatureEvent(11988, 4, Golemagg.OnDied) +RegisterCreatureEvent(11988, 5, Golemagg.OnSpawn) +RegisterCreatureEvent(11988, 9, Golemagg.DamageTaken) \ No newline at end of file diff --git a/MoltenCore/Hazzrash.lua b/MoltenCore/Hazzrash.lua new file mode 100644 index 0000000..dbc616c --- /dev/null +++ b/MoltenCore/Hazzrash.lua @@ -0,0 +1,59 @@ +Hazzrash = {}; + +function Hazzrash.CastArcaneBarage(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 44425, false) +end + +function Hazzrash.CastArcaneBlast(eventId, delay, calls, creature) +local targets = creature:GetAITargets(10) +local target = targets[math.random(#targets)] +creature:CastSpell(target, 30451, false) +end + +function Hazzrash.CastChainBurn(eventId, delay, calls, creature) +local targets = creature:GetAITargets(10) +local target = targets[math.random(#targets)] +creature:CastSpell(target, 8211, false) +end + +function Hazzrash.CastCrystalFlash(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 5106, false) +end + +function Hazzrash.CastEvocation(eventId, delay, calls, creature) +creature:CastSpell(creature, 30254, true) +creature:RemoveEvents() +creature:RegisterEvent(Hazzrash.ResumeCasts, 20000, 1) +end + +function Hazzrash.ResumeCasts(eventId, delay, calls, creature) +creature:RegisterEvent(Hazzrash.CastArcaneBarage, 6000, 0) +creature:RegisterEvent(Hazzrash.CastArcaneBlast, 16000, 0) +creature:RegisterEvent(Hazzrash.CastCrystalFlash, 25000, 0) +creature:RegisterEvent(Hazzrash.CastChainBurn, 29000, 0) +end + +function Hazzrash.OnEnterCombat(event, creature, target) +creature:RegisterEvent(Hazzrash.CastArcaneBarage, 6000, 0) +creature:RegisterEvent(Hazzrash.CastArcaneBlast, 18000, 0) +creature:RegisterEvent(Hazzrash.CastCrystalFlash, 25000, 0) +creature:RegisterEvent(Hazzrash.CastChainBurn, 44000, 0) +creature:RegisterEvent(Hazzrash.CastEvocation, 60000, 1) +end + +function Hazzrash.OnLeaveCombat(event, creature) +creature:RemoveEvents() +end + +function Hazzrash.OnDied(event, creature, killer) +creature:RemoveEvents() +end + +function Hazzrash.OnSpawn(event, creature) +creature:SetMaxHealth(563000) +end + +RegisterCreatureEvent(83000, 1, Hazzrash.OnEnterCombat) +RegisterCreatureEvent(83000, 2, Hazzrash.OnLeaveCombat) +RegisterCreatureEvent(83000, 4, Hazzrash.OnDied) +RegisterCreatureEvent(83000, 5, Hazzrash.OnSpawn) \ No newline at end of file diff --git a/MoltenCore/Lucifron.lua b/MoltenCore/Lucifron.lua new file mode 100644 index 0000000..14dccb2 --- /dev/null +++ b/MoltenCore/Lucifron.lua @@ -0,0 +1,53 @@ +local Lucifron = {} +Lucifron.enrageCasted = false + +function Lucifron.CastImpendingDoom(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 19702, false) +end + +function Lucifron.CastLucifronCurse(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 19703, false) +end + +function Lucifron.CastShadowShock(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 20603, false) +end + +function Lucifron.CastFlamestrike(eventId, delay, calls, creature) +local targets = creature:GetAITargets() +local targetCount = creature:GetAITargetsCount() +local randomTarget = targets[math.random(1, targetCount)] +creature:CastSpell(randomTarget, 10216, true) +end + +function Lucifron.OnEnterCombat(event, creature, target) +creature:RegisterEvent(Lucifron.CastImpendingDoom, math.random(6000, 11000), 0) +creature:RegisterEvent(Lucifron.CastLucifronCurse, math.random(11000, 14000), 0) +creature:RegisterEvent(Lucifron.CastShadowShock, 5000, 0) +creature:RegisterEvent(Lucifron.CastFlamestrike, 15000, 0) +end + +function Lucifron.OnLeaveCombat(event, creature) +creature:RemoveEvents() +end + +function Lucifron.OnDied(event, creature, killer) +creature:RemoveEvents() +end + +function Lucifron.OnDamageTaken(event, creature, attacker, damage) +if(not Lucifron.enrageCasted and creature:HealthBelowPct(20)) then +creature:CastSpell(creature, 38166, true) +Lucifron.enrageCasted = true +end +end + +function Lucifron.OnSpawn(event, creature) +creature:SetMaxHealth(748000) +end + +RegisterCreatureEvent(12118, 1, Lucifron.OnEnterCombat) +RegisterCreatureEvent(12118, 2, Lucifron.OnLeaveCombat) +RegisterCreatureEvent(12118, 4, Lucifron.OnDied) +RegisterCreatureEvent(12118, 9, Lucifron.OnDamageTaken) +RegisterCreatureEvent(12118, 5, Lucifron.OnSpawn) \ No newline at end of file diff --git a/MoltenCore/Magmadar.lua b/MoltenCore/Magmadar.lua new file mode 100644 index 0000000..f1ce7a6 --- /dev/null +++ b/MoltenCore/Magmadar.lua @@ -0,0 +1,66 @@ +--fixed stupidity + +local Magmadar = {}; + +local SPELL_FRENZY = 19451 +local SPELL_PANIC = 19408 +local SPELL_LAVA_BOMB = 19411 +local SPELL_LAVA_BOMB_RANGED = 20474 +local SPELL_SUMMON_CORE_HOUND = 364726 + +local MELEE_TARGET_LOOKUP_DIST = 10.0 + +function Magmadar.OnEnterCombat(event, creature, target) +creature:RegisterEvent(Magmadar.Frenzy, math.random(14000, 18000), 0) +creature:RegisterEvent(Magmadar.Panic, math.random(28000, 35000), 0) +creature:RegisterEvent(Magmadar.LavaBomb, math.random(10000, 12000), 0) +creature:RegisterEvent(Magmadar.LavaBombRanged, math.random(9000, 15000), 0) +creature:RegisterEvent(Magmadar.CastSummonCoreHound, 45000, 0) +end + +function Magmadar.OnLeaveCombat(event, creature) +creature:RemoveEvents() +end + +function Magmadar.OnDied(event, creature, killer) +creature:RemoveEvents() +end + +function Magmadar.Frenzy(event, delay, calls, creature) +creature:CastSpell(creature, SPELL_FRENZY, false) +creature:SendUnitEmote("Magmadar goes into a killing Frenzy!") +end + +function Magmadar.Panic(event, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), SPELL_PANIC, false) +end + +function Magmadar.LavaBomb(event, delay, calls, creature) +local targets = creature:GetAITargets() +local targetCount = creature:GetAITargetsCount() +if targetCount > 0 then +local targetIndex = math.random(1, targetCount) +local target = targets[targetIndex] +if target:GetDistance(creature) <= MELEE_TARGET_LOOKUP_DIST then +creature:CastSpell(target, SPELL_LAVA_BOMB, false) +end +end +end + +function Magmadar.LavaBombRanged(event, delay, calls, creature) +local targets = creature:GetPlayersInRange(100.0) +for _, target in pairs(targets) do +if target:GetDistance(creature) > MELEE_TARGET_LOOKUP_DIST then +creature:CastSpell(target, SPELL_LAVA_BOMB_RANGED, false) +break +end +end +end + +function Magmadar.CastSummonCoreHound(event, delay, calls, creature) +creature:CastSpell(creature, SPELL_SUMMON_CORE_HOUND, true) +end + +RegisterCreatureEvent(11982, 1, Magmadar.OnEnterCombat) +RegisterCreatureEvent(11982, 2, Magmadar.OnLeaveCombat) +RegisterCreatureEvent(11982, 4, Magmadar.OnDied) \ No newline at end of file diff --git a/MoltenCore/Magmakin.lua b/MoltenCore/Magmakin.lua new file mode 100644 index 0000000..741981b --- /dev/null +++ b/MoltenCore/Magmakin.lua @@ -0,0 +1,45 @@ +Magmakin = {} + +function Magmakin.CastFlameBuffet(eventId, delay, calls, creature) +if not creature:IsCasting() then +creature:CastSpell(creature:GetVictim(), 23341, false) +end +end + +function Magmakin.CastMagmaBlast(eventId, delay, calls, creature) +if not creature:IsCasting() then +local targets = creature:GetAITargets(10) +local target = targets[math.random(#targets)] +creature:CastSpell(target, 20565, false) +end +end + +function Magmakin.CastLavaBurst(eventId, delay, calls, creature) +if not creature:IsCasting() then +creature:CastSpell(creature:GetVictim(), 11678, false) +end +end + +function Magmakin.OnEnterCombat(event, creature, target) +creature:RegisterEvent(Magmakin.CastFlameBuffet, 18000, 0) +creature:RegisterEvent(Magmakin.CastMagmaBlast, 16000, 0) +creature:RegisterEvent(Magmakin.CastLavaBurst, 8000, 0) +end + +function Magmakin.OnLeaveCombat(event, creature) +creature:RemoveEvents() +end + +function Magmakin.OnDied(event, creature, killer) +creature:RemoveEvents() +end + +function Magmakin.OnSpawn(event, creature) +creature:SetMaxPower(0, 10000000) +creature:SetMaxHealth(349000) +end + +RegisterCreatureEvent(12806, 1, Magmakin.OnEnterCombat) +RegisterCreatureEvent(12806, 2, Magmakin.OnLeaveCombat) +RegisterCreatureEvent(12806, 4, Magmakin.OnDied) +RegisterCreatureEvent(12806, 5, Magmakin.OnSpawn) \ No newline at end of file diff --git a/MoltenCore/Smolder.lua b/MoltenCore/Smolder.lua new file mode 100644 index 0000000..2ce841f --- /dev/null +++ b/MoltenCore/Smolder.lua @@ -0,0 +1,103 @@ +local Smolder = {}; +local healthCheck = false; +local isCastingSummonElemental = false; + +local function CastFlameBreath(eventId, delay, calls, creature) +if isCastingSummonElemental then return end +if creature:HealthBelowPct(15) and not creature:IsCasting() then +creature:CastSpell(creature:GetVictim(), 23341, false) +end +end + +local function CastCharredEarth(eventId, delay, calls, creature) +if isCastingSummonElemental then return end +local targetCount = creature:GetAITargetsCount() +local randomTarget = math.random(1, targetCount) +local target = creature:GetAITargets() +creature:CastSpell(target[randomTarget], 100148, false) +end + +local function CastPyroblast(eventId, delay, calls, creature) +if isCastingSummonElemental then return end +local targets = {} +for i = 1, 3 do +local targetCount = creature:GetAITargetsCount() +local randomTarget = math.random(1, targetCount) +local target = creature:GetAITargets() +table.insert(targets, target[randomTarget]) +end +for k, v in pairs(targets) do +creature:CastSpell(v, 27132, true) +end +end + +local function CastSummonElemental(eventId, delay, calls, creature) +isCastingSummonElemental = true +creature:SendUnitYell("Minions of fire, rise and serve your master!", 0) +creature:PlayDirectSound(20422) +creature:CastSpell(creature, 364728, true) +isCastingSummonElemental = false +end + +local function CastTailSweep(eventId, delay, calls, creature) +if isCastingSummonElemental then return end +creature:CastSpell(creature:GetVictim(), 52144, true) +end + +local function CastScorch(eventId, delay, calls, creature) +if isCastingSummonElemental then return end +if not creature:IsCasting() then +creature:CastSpell(creature:GetVictim(), 42858, false) +end +end + +local function CastBellowingRoar(eventId, delay, calls, creature) +if isCastingSummonElemental then return end +creature:SendUnitYell("Feel the power of my roar!", 0) +creature:PlayDirectSound(20421) +creature:CastSpell(creature, 22686, false) +end + +local function OnEnterCombat(event, creature, target) +creature:SendUnitYell("Feel the heat of my flame and know your end is near!", 0) +creature:PlayDirectSound(20419) +creature:RegisterEvent(CastScorch, 6000, 0) +creature:RegisterEvent(CastFlameBreath, 13000, 0) +creature:RegisterEvent(CastCharredEarth, 12000, 0) +creature:RegisterEvent(CastPyroblast, 10000, 0) +creature:RegisterEvent(CastSummonElemental, 63500, 0) +creature:RegisterEvent(CastTailSweep, 8000, 0) +creature:RegisterEvent(CastBellowingRoar, 33000, 0) +end + +local function OnLeaveCombat(event, creature) +healthCheck = false +creature:RemoveEvents() +end + +local function OnDied(event, creature, killer) +creature:SendUnitYell("My fire...extinguished...", 0) +creature:PlayDirectSound(20420) +creature:RemoveEvents() +end + +local function OnDamageTaken(event, creature, attacker, damage) +if (creature:HealthBelowPct(15) and not healthCheck) then +creature:SendUnitYell("My power is waning, but I will fight until my last flame burnsout!", 0) +creature:PlayDirectSound(20423) +healthCheck = true +end +end + +function OnSpawn(event, creature) +creature:SetMaxPower(0, 14379003) +end + +RegisterCreatureEvent(83001, 1, OnEnterCombat) +RegisterCreatureEvent(83001, 2, OnLeaveCombat) +RegisterCreatureEvent(83001, 4, OnDied) +RegisterCreatureEvent(83001, 9, OnDamageTaken) +RegisterCreatureEvent(83001, 5, OnSpawn) + + + diff --git a/MoltenCore/SocketeerV1 .lua b/MoltenCore/SocketeerV1 .lua new file mode 100644 index 0000000..0ec72f5 --- /dev/null +++ b/MoltenCore/SocketeerV1 .lua @@ -0,0 +1,39 @@ +local SocketEnchant = 37430 -- Socket Enchant Item ID +local RequiredItem = 17010 -- Fiery Cores ID. Can set this to whatever Item ID. +local RequiredAmount = 10 -- Example required Item amount +local ExchangeCount = 0 -- Keep track of the number of successful exchanges + +local function OnGossipHello(event, player, creature) +player:GossipMenuAddItem(0, "|TInterface\\Icons\\inv_misc_gem_variety_01:50:50:-43:0|tPurchase gem sockets for your gear?", 0, 1) --can change "Fiery Cores" to whatever if you change requireditemid. Same with the dialogue below. +player:GossipSendMenu(1, creature) +end + +local function OnGossipSelect(event, player, creature, sender, intid, code, menuid) +if (intid == 1) then +local requiredAmount = RequiredAmount +creature:SendUnitSay("Exchanging " .. requiredAmount .. " Fiery Cores for a socket enchant. Are you sure, " .. player:GetName() .. "?", 0) +player:GossipMenuAddItem(0, "Yes", 0, 2) +player:GossipMenuAddItem(0, "No", 0, 3) +player:GossipSendMenu(1, creature) +elseif (intid == 2) then +if (player:GetItemCount(RequiredItem) >= RequiredAmount) then +player:RemoveItem(RequiredItem, RequiredAmount) +player:AddItem(SocketEnchant, 1) +creature:SendUnitSay("The socket enchant has been added to your inventory.", 0) +ExchangeCount = ExchangeCount + 1 -- Increase the number of successful exchanges +if (ExchangeCount >= 3) then -- If the number of successful exchanges is 3 or more +creature:SendUnitSay("Thanks a bunch! See you next week!", 0) +creature:DespawnOrUnsummon(1000) -- Despawn the creature with a 1 second delay +end +player:GossipComplete() +else +creature:SendUnitSay("You do not have enough Fiery Cores.", 0) +player:GossipComplete() +end +elseif (intid == 3) then +player:GossipComplete() +end +end + +RegisterCreatureGossipEvent(190015, 1, OnGossipHello) +RegisterCreatureGossipEvent(190015, 2, OnGossipSelect) \ No newline at end of file diff --git a/VanillaDungeonScourge/Scorn.lua b/VanillaDungeonScourge/Scorn.lua new file mode 100644 index 0000000..9bc9d85 --- /dev/null +++ b/VanillaDungeonScourge/Scorn.lua @@ -0,0 +1,76 @@ +local Scorn = {}; + +local function LichSlap(eventId, delay, calls, creature) +if not creature:IsCasting() then +creature:CastSpell(creature:GetVictim(), 28873, true) +end +end + +local function Enrage(eventId, delay, calls, creature) +if not creature:IsCasting() then +creature:CastSpell(creature, 15716, true) +end +end + +local function FrostboltVolley(eventId, delay, calls, creature) +if not creature:IsCasting() then +creature:CastSpell(creature, 22643, true) +end +end + +local function FrostNova(eventId, delay, calls, creature) +if not creature:IsCasting() then +creature:CastSpell(creature, 15531, true) +end +end + +function MindFlay(eventId, delay, calls, creature) +if not creature:IsCasting() then +local targets = creature:GetAITargets(5) +if #targets == 0 then +return +end +local target = targets[math.random(#targets)] +creature:CastSpell(target, 17318, true) +end +end + +function ManaBurn(eventId, delay, calls, creature) +if not creature:IsCasting() then +local targets = creature:GetAITargets(5) +if #targets == 0 then +return +end +local target = targets[math.random(#targets)] +creature:CastSpell(target, 8129, true) +end +end + +local function OnEnterCombat(event, creature, target) +creature:RegisterEvent(LichSlap, math.random(8000,12000), 0) +creature:RegisterEvent(MindFlay, math.random(14000,18000), 0) +creature:RegisterEvent(FrostboltVolley, math.random(7000,11000), 0) +creature:RegisterEvent(FrostNova, 1000, 1) +creature:RegisterEvent(FrostNova, math.random(6000,9000), 0) +creature:RegisterEvent(ManaBurn, math.random(17000,24000), 0) +end + +local function OnHealthUpdate(event, creature, value) +if (creature:GetHealthPct() <= 20) then +creature:RemoveEvents() +creature:RegisterEvent(Enrage, 100, 1) +end +end + +local function OnLeaveCombat(event, creature) +creature:RemoveEvents() +end + +local function OnDied(event, creature, killer) +creature:RemoveEvents() +end + +RegisterCreatureEvent(400075, 1, OnEnterCombat) +RegisterCreatureEvent(400075, 9, OnHealthUpdate) +RegisterCreatureEvent(400075, 2, OnLeaveCombat) +RegisterCreatureEvent(400075, 4, OnDied) \ No newline at end of file diff --git a/VanillaDungeonScourge/Sever.lua b/VanillaDungeonScourge/Sever.lua new file mode 100644 index 0000000..d22c5b2 --- /dev/null +++ b/VanillaDungeonScourge/Sever.lua @@ -0,0 +1,35 @@ +local Sever = {} + +function Sever.CastDiseasedSpit(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 17745, true) +end + +function Sever.CastIntimidatingRoar(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 16508, true) +end + +function Sever.OnEnterCombat(event, creature, target) +creature:RegisterEvent(Sever.CastDiseasedSpit, 10000, 0) +creature:RegisterEvent(Sever.CastIntimidatingRoar, 30000, 0) +end + +function Sever.OnLeaveCombat(event, creature) +creature:RemoveEvents() +end + +function Sever.OnDied(event, creature, killer) +creature:RemoveEvents() +end + +function Sever.OnDamageTaken(event, creature, attacker, damage) +if (creature:HealthBelowPct(50) and not creature:HasAura(41305)) then +creature:CastSpell(creature, 41305, true) +creature:SendUnitYell("", 0) +end +end + +RegisterCreatureEvent(14682, 1, Sever.OnEnterCombat) +RegisterCreatureEvent(14682, 2, Sever.OnLeaveCombat) +RegisterCreatureEvent(14682, 4, Sever.OnDied) +RegisterCreatureEvent(14682, 9, Sever.OnDamageTaken) +