Add files via upload

This commit is contained in:
Dinkledork
2023-03-23 02:54:59 -06:00
committed by GitHub
parent 4a9aec8175
commit 33af0ca7a7
3 changed files with 109 additions and 22 deletions

View File

@@ -1,4 +1,4 @@
local NPC_CAPTAIN_RATTLEBONES = 400115 local NPC_CAPTAIN_RATTLEBONES = 401116
local SPELL_SHADOW_BOLT = 20791 local SPELL_SHADOW_BOLT = 20791
local SPELL_CURSE_OF_THE_PIRATE_KING = 70542 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 YELL_DEATH_DIALOGUE = "Me ship...me crew...I be joinin' ye soon..."
local function CastShadowBolt(creature) local function CastShadowBolt(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), SPELL_SHADOW_BOLT, false) creature:CastSpell(creature:GetVictim(), SPELL_SHADOW_BOLT, true)
end end
local function CastCurseOfThePirateKing(creature) local function CastCurseOfThePirateKing(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), SPELL_CURSE_OF_THE_PIRATE_KING, false) creature:CastSpell(creature:GetVictim(), SPELL_CURSE_OF_THE_PIRATE_KING, true)
end end
local function CastPiratesCleave(creature) local function CastPiratesCleave(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), SPELL_PIRATES_CLEAVE, false) creature:CastSpell(creature:GetVictim(), SPELL_PIRATES_CLEAVE, true)
end end
local function CastCannonballBarrage(creature) local function CastCannonballBarrage(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), SPELL_CANNONBALL_BARRAGE, false) creature:CastSpell(creature:GetVictim(), SPELL_CANNONBALL_BARRAGE, true)
end end
local function CaptainRattlebones_OnEnterCombat(event, creature, target) local function CaptainRattlebones_OnEnterCombat(event, creature, target)
creature:SendUnitYell(YELL_AGGRO_DIALOGUE[math.random(1, #YELL_AGGRO_DIALOGUE)], 0) creature:SendUnitYell(YELL_AGGRO_DIALOGUE[math.random(1, #YELL_AGGRO_DIALOGUE)], 0)
creature:RegisterEvent(CastShadowBolt, math.random(2000, 4000), 0) creature:RegisterEvent(CastShadowBolt, 3000, 0)
creature:RegisterEvent(CastCurseOfThePirateKing, math.random(10000, 15000), 0) creature:RegisterEvent(CastCurseOfThePirateKing, 12000, 0)
creature:RegisterEvent(CastPiratesCleave, math.random(6000, 10000), 0) creature:RegisterEvent(CastPiratesCleave, 8000, 0)
creature:RegisterEvent(CastCannonballBarrage, math.random(15000, 20000), 0) creature:RegisterEvent(CastCannonballBarrage, 18000, 0)
end end
local function CaptainRattlebones_OnLeaveCombat(event, creature) local function CaptainRattlebones_OnLeaveCombat(event, creature)
creature:RemoveEvents() -- Remove events when leaving combat creature:RemoveEvents()
end end
local function CaptainRattlebones_OnDied(event, creature, killer) local function CaptainRattlebones_OnDied(event, creature, killer)
creature:RemoveEvents() -- Remove events when died creature:RemoveEvents()
creature:SendUnitSay(YELL_DEATH_DIALOGUE, 0) creature:SendUnitSay(YELL_DEATH_DIALOGUE, 0)
end end
RegisterCreatureEvent(NPC_CAPTAIN_RATTLEBONES, 1, CaptainRattlebones_OnEnterCombat) RegisterCreatureEvent(NPC_CAPTAIN_RATTLEBONES, 1, CaptainRattlebones_OnEnterCombat)
RegisterCreatureEvent(NPC_CAPTAIN_RATTLEBONES, 2, CaptainRattlebones_OnLeaveCombat) RegisterCreatureEvent(NPC_CAPTAIN_RATTLEBONES, 2, CaptainRattlebones_OnLeaveCombat)
RegisterCreatureEvent(NPC_CAPTAIN_RATTLEBONES, 4, CaptainRattlebones_OnDied) RegisterCreatureEvent(NPC_CAPTAIN_RATTLEBONES, 4, CaptainRattlebones_OnDied)

View File

@@ -17,10 +17,11 @@ function OnFirstTalk(event, player, unit)
if player:GetLevel() == 1 then if player:GetLevel() == 1 then
player:PlayDistanceSound(20431) player:PlayDistanceSound(20431)
player:GossipMenuAddItem(0, "Looking for a challenge? Click here to try hardcore mode!", 0, 1) 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) player:GossipSendMenu(1, unit)
else else
player:SendBroadcastMessage("You must be level 1 to access hardcore mode.") player:SendBroadcastMessage("You must be level 1 to access hardcore mode.")
player:PlayDistanceSound(20432) player:PlayDistanceSound(20432)
player:GossipComplete() player:GossipComplete()
end end
end end
@@ -28,10 +29,18 @@ end
--Selection for NPC gossip --Selection for NPC gossip
function OnSelect(event, player, unit, sender, intid, code) function OnSelect(event, player, unit, sender, intid, code)
if intid == 1 then if intid == 1 then
player:PlayDistanceSound(20433) -- (Previous code remains the same)
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) elseif intid == 4 then
player:GossipMenuAddItem(0, "NO TAKE ME BACK!", 0, 3) 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(2, unit) 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
end end
@@ -57,4 +66,4 @@ end
RegisterCreatureGossipEvent(hcNPC, 1 , OnFirstTalk) RegisterCreatureGossipEvent(hcNPC, 1 , OnFirstTalk)
RegisterCreatureGossipEvent(hcNPC, 2, OnSelect) RegisterCreatureGossipEvent(hcNPC, 2, OnSelect)
RegisterCreatureGossipEvent(hcNPC, 2, OnHardCore) RegisterCreatureGossipEvent(hcNPC, 2, OnHardCore)
RegisterPlayerEvent(8, PlayerDeath) RegisterPlayerEvent(8, PlayerDeath)

View File

@@ -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)