From 33af0ca7a7caf07d2a329b4ee08f0b9ebff30f20 Mon Sep 17 00:00:00 2001 From: Dinkledork <118951051+Day36512@users.noreply.github.com> Date: Thu, 23 Mar 2023 02:54:59 -0600 Subject: [PATCH] Add files via upload --- Deadmines/CaptainRattlebones.lua | 31 ++++++------- HardcoreMode/Hardcore.lua | 21 ++++++--- MiscTools/GlidingHandler.lua | 79 ++++++++++++++++++++++++++++++++ 3 files changed, 109 insertions(+), 22 deletions(-) create mode 100644 MiscTools/GlidingHandler.lua diff --git a/Deadmines/CaptainRattlebones.lua b/Deadmines/CaptainRattlebones.lua index ee6fe61..5932a0f 100644 --- a/Deadmines/CaptainRattlebones.lua +++ b/Deadmines/CaptainRattlebones.lua @@ -1,4 +1,4 @@ -local NPC_CAPTAIN_RATTLEBONES = 400115 +local NPC_CAPTAIN_RATTLEBONES = 401116 local SPELL_SHADOW_BOLT = 20791 local SPELL_CURSE_OF_THE_PIRATE_KING = 70542 @@ -15,40 +15,39 @@ local YELL_AGGRO_DIALOGUE = { 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) +local function CastShadowBolt(eventId, delay, calls, creature) + creature:CastSpell(creature:GetVictim(), SPELL_SHADOW_BOLT, true) end -local function CastCurseOfThePirateKing(creature) - creature:CastSpell(creature:GetVictim(), SPELL_CURSE_OF_THE_PIRATE_KING, false) +local function CastCurseOfThePirateKing(eventId, delay, calls, creature) + creature:CastSpell(creature:GetVictim(), SPELL_CURSE_OF_THE_PIRATE_KING, true) end -local function CastPiratesCleave(creature) - creature:CastSpell(creature:GetVictim(), SPELL_PIRATES_CLEAVE, false) +local function CastPiratesCleave(eventId, delay, calls, creature) + creature:CastSpell(creature:GetVictim(), SPELL_PIRATES_CLEAVE, true) end -local function CastCannonballBarrage(creature) - creature:CastSpell(creature:GetVictim(), SPELL_CANNONBALL_BARRAGE, false) +local function CastCannonballBarrage(eventId, delay, calls, creature) + creature:CastSpell(creature:GetVictim(), SPELL_CANNONBALL_BARRAGE, true) 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) + creature:RegisterEvent(CastShadowBolt, 3000, 0) + creature:RegisterEvent(CastCurseOfThePirateKing, 12000, 0) + creature:RegisterEvent(CastPiratesCleave, 8000, 0) + creature:RegisterEvent(CastCannonballBarrage, 18000, 0) end local function CaptainRattlebones_OnLeaveCombat(event, creature) - creature:RemoveEvents() -- Remove events when leaving combat + creature:RemoveEvents() end local function CaptainRattlebones_OnDied(event, creature, killer) - creature:RemoveEvents() -- Remove events when died + creature:RemoveEvents() 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 index ccefa5a..bffd6cd 100644 --- a/HardcoreMode/Hardcore.lua +++ b/HardcoreMode/Hardcore.lua @@ -17,10 +17,11 @@ 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:GossipMenuAddItem(0, "What's with the wings?", 0, 4) player:GossipSendMenu(1, unit) else player:SendBroadcastMessage("You must be level 1 to access hardcore mode.") - player:PlayDistanceSound(20432) + player:PlayDistanceSound(20432) player:GossipComplete() end end @@ -28,10 +29,18 @@ 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) + -- (Previous code remains the same) + elseif intid == 4 then + player:GossipMenuAddItem(0, "Wings are a major feature of this server and provide a number of unique benefits aside from simply looking great. If you open your spellbook, you'll notice a few new spells and can probably guess at what some of those features might be.", 0, 5) + player:GossipSendMenu(4, unit) + elseif intid == 5 then + player:GossipMenuAddItem(0, "Where can I get wings?", 0, 6) + player:GossipSendMenu(5, unit) + elseif intid == 6 then + player:GossipMenuAddItem(0, "Wings have been scattered in various places throughout Azeroth and are primarily attached to tabards. That said not every tabard will provide wings and not all wings have been released in game. As time goes on I will add more wings with different sources of acquisition and different benefits. If you choose to do hardcore mode you may get lucky enough to acquire a pair for yourself if you make it to certain levels...", 0, 7) + player:GossipSendMenu(6, unit) + elseif intid == 7 then + player:GossipComplete() end end @@ -57,4 +66,4 @@ end RegisterCreatureGossipEvent(hcNPC, 1 , OnFirstTalk) RegisterCreatureGossipEvent(hcNPC, 2, OnSelect) RegisterCreatureGossipEvent(hcNPC, 2, OnHardCore) -RegisterPlayerEvent(8, PlayerDeath) +RegisterPlayerEvent(8, PlayerDeath) \ No newline at end of file diff --git a/MiscTools/GlidingHandler.lua b/MiscTools/GlidingHandler.lua new file mode 100644 index 0000000..b10b5a7 --- /dev/null +++ b/MiscTools/GlidingHandler.lua @@ -0,0 +1,79 @@ +local spellIds = {100209, 100211, 100210, 100213, 100214, 100215, 100216, 100217, 100218, 100219, 100220, 100180, 100221, 100222} +local requiredAuraRange = {200049, 200181} +local requiredLevel = 45 +local emoteId = 444 +local soundId = 53774 + +function OnSpellCast(event, player, spell, skipCheck) + for i, spellId in ipairs(spellIds) do + if (spell:GetEntry() == spellId) then + local hasRequiredAura = false + for j = requiredAuraRange[1], requiredAuraRange[2] do + if (player:HasAura(j)) then + hasRequiredAura = true + break + end + end + + local map = player:GetMap() + local mapId = map:GetMapId() + local restrictionMessage = "You cannot cast this spell in battlegrounds, dungeons, or raids." + + if (mapId == 530 and player:GetLevel() < 70) then + restrictionMessage = "You must be level 70 to cast this spell in Outland." + elseif (mapId == 571 and not player:HasSpell(54197)) then + restrictionMessage = "You must have Cold Weather Flying to cast this spell in Northrend." + end + + if (player:InBattleground() or map:IsDungeon() or map:IsRaid() or (mapId == 530 and player:GetLevel() < 70) or (mapId == 571 and not player:HasSpell(54197))) then + player:SendAreaTriggerMessage(restrictionMessage) + spell:Cancel() + return false + elseif (not hasRequiredAura and player:GetLevel() >= requiredLevel) then + player:SendAreaTriggerMessage("You must have wings equipped to cast this spell.") + spell:Cancel() + return false + elseif (hasRequiredAura and player:GetLevel() < requiredLevel) then + player:SendAreaTriggerMessage("You must be at least level 45 to cast this spell.") + spell:Cancel() + return false + elseif (not hasRequiredAura and player:GetLevel() < requiredLevel) then + player:SendAreaTriggerMessage("You must be at least level 45 and have wings equipped to cast this spell.") + spell:Cancel() + return false + elseif (spell:GetEntry() == 100210 or spell:GetEntry() == 100218 or spell:GetEntry() == 100219 or spell:GetEntry() == 100220) then + --player:PerformEmote(emoteId) + player:PlayDirectSound(soundId) + local maxHealth = player:GetMaxHealth() + local healthToReduce = maxHealth * 0.10 -- 10% of max health + local newHealth = player:GetHealth() - healthToReduce + local healthPct = (newHealth / maxHealth) * 100 + if healthPct <= 5 then + player:Kill(player) + else + player:SetHealth(newHealth) + end + elseif (spell:GetEntry() == 100209) then + player:CastSpell(player, 71495, true) + player:CastSpell(player, 34602, true) + player:CastSpell(player, 75459, true) + elseif (spell:GetEntry() == 100216) then + player:CastSpell(player, 75459, true) + player:CastSpell(player, 34602, true) + elseif (spell:GetEntry() == 100217) then + player:CastSpell(player, 71495, true) + player:CastSpell(player, 34602, true) + player:CastSpell(player, 75459, true) + elseif (spell:GetEntry() == 100221) then + player:CastSpell(player, 71495, true) + player:CastSpell(player, 34602, true) + + elseif (spell:GetEntry() == 100211 or spell:GetEntry() == 100213 or spell:GetEntry() == 100214 or spell:GetEntry() == 100215) then + player:CastSpell(player, 34602, true) +player:CastSpell(player, 75459, true) +end +end +end +end + +RegisterPlayerEvent(5, OnSpellCast)