diff --git a/AllianceMage.lua b/AllianceMage.lua index 680e4d6..e78cd67 100644 --- a/AllianceMage.lua +++ b/AllianceMage.lua @@ -3,8 +3,8 @@ local conjuredCinnamonRolls = 22895 local arcaneIntellect = 10157 local function OnGossipHello(event, player, creature) -player:GossipMenuAddItem(9, "|TInterface\\Icons\\inv_misc_food_73cinnamonroll:50:50:-43:0|tTake some Conjured Cinnamon Rolls", 0, 1, false, "", 0) -player:GossipMenuAddItem(9, "|TInterface\\Icons\\Spell_Holy_Magicalsentry:50:50:-43:0|tCast Arcane Intellect", 0, 2, false, "", 0) +player:GossipMenuAddItem(9, "|TInterface\\Icons\\inv_misc_food_73cinnamonroll:50:50:-13:0|tTake some Conjured Cinnamon Rolls", 0, 1, false, "", 0) +player:GossipMenuAddItem(9, "|TInterface\\Icons\\Spell_Holy_Magicalsentry:50:50:-13:0|tCast Arcane Intellect", 0, 2, false, "", 0) player:GossipSendMenu(1, creature) end diff --git a/AlliancePaladin.lua b/AlliancePaladin.lua index 60b003e..268bf4e 100644 --- a/AlliancePaladin.lua +++ b/AlliancePaladin.lua @@ -8,9 +8,9 @@ creature:CastSpell(creature, kingsSpell, true) end local function OnGossipHello(event, player, creature) -player:GossipMenuAddItem(9, "|TInterface\\Icons\\spell_magic_magearmor:50:50:-43:0|tGrant me a Blessing of Kings", 0, 1, false, "", 0) -player:GossipMenuAddItem(9, "|TInterface\\Icons\\spell_holy_sealofwisdom:50:50:-43:0|tGrant me a Blessing of Wisdom", 0, 2, false, "", 0) -player:GossipMenuAddItem(9, "|TInterface\\Icons\\spell_holy_fistofjustice:50:50:-43:0|tGrant me a Blessing of Might", 0, 3, false, "", 0) +player:GossipMenuAddItem(9, "|TInterface\\Icons\\spell_magic_magearmor:50:50:-13:0|tGrant me a Blessing of Kings", 0, 1, false, "", 0) +player:GossipMenuAddItem(9, "|TInterface\\Icons\\spell_holy_sealofwisdom:50:50:-13:0|tGrant me a Blessing of Wisdom", 0, 2, false, "", 0) +player:GossipMenuAddItem(9, "|TInterface\\Icons\\spell_holy_fistofjustice:50:50:-13:0|tGrant me a Blessing of Might", 0, 3, false, "", 0) player:GossipSendMenu(1, creature) end diff --git a/AlliancePaladin2.lua b/AlliancePaladin2.lua index 15fe59c..84a4a2f 100644 --- a/AlliancePaladin2.lua +++ b/AlliancePaladin2.lua @@ -29,7 +29,6 @@ creature:RegisterEvent(CastCS, 6000, 0) creature:RegisterEvent(CastCons, 8000, 0) creature:RegisterEvent(CastDS, 10000, 0) creature:RegisterEvent(CastJOL, 11000, 0) -creature:RegisterEvent(CastAvengingWrath, 1, 1) end local function OnLeaveCombat(event, creature) diff --git a/AlliancePriest.lua b/AlliancePriest.lua index 597a35a..38ed3a4 100644 --- a/AlliancePriest.lua +++ b/AlliancePriest.lua @@ -8,9 +8,9 @@ creature:CastSpell(creature, lightwellSpell, true) end local function OnGossipHello(event, player, creature) -player:GossipMenuAddItem(9, "|TInterface\\Icons\\Spell_Holy_SummonLightwell:50:50:-43:0|tCast Lightwell", 0, 1, false, "", 0) -player:GossipMenuAddItem(9, "|TInterface\\Icons\\Spell_Holy_WordFortitude:50:50:-43:0|tCast Power Word: Fortitude", 0, 2, false, "", 0) -player:GossipMenuAddItem(9, "|TInterface\\Icons\\Spell_Holy_DivineSpirit:50:50:-43:0|tCast Divine Spirit", 0, 3, false, "", 0) +player:GossipMenuAddItem(9, "|TInterface\\Icons\\Spell_Holy_SummonLightwell:50:50:-13:0|tCast Lightwell", 0, 1, false, "", 0) +player:GossipMenuAddItem(9, "|TInterface\\Icons\\Spell_Holy_WordFortitude:50:50:-13:0|tCast Power Word: Fortitude", 0, 2, false, "", 0) +player:GossipMenuAddItem(9, "|TInterface\\Icons\\Spell_Holy_DivineSpirit:50:50:-13:0|tCast Divine Spirit", 0, 3, false, "", 0) player:GossipSendMenu(1, creature) end diff --git a/BlisteringZombie.lua b/BlisteringZombie.lua index 76fcecd..6b3f10e 100644 --- a/BlisteringZombie.lua +++ b/BlisteringZombie.lua @@ -1,21 +1,31 @@ local BlisteringZombie = {}; +local function CastArmyOfTheDead(eventId, delay, calls, creature) +creature:CastSpell(creature, 42650, true) +end + local function CastSpit(eventId, delay, calls, creature) - creature:CastSpell(creature:GetVictim(), 25262, true) +creature:CastSpell(creature:GetVictim(), 25262, true) end local function OnEnterCombat(event, creature, target) - creature:RegisterEvent(CastSpit, 5000, 0) - end - +creature:RegisterEvent(CastArmyOfTheDead, 25000, 0) +creature:RegisterEvent(CastSpit, 5000, 0) +end + local function OnLeaveCombat(event, creature) - creature:RemoveEvents() +creature:RemoveEvents() +end + +local function OnSpawn(event, creature) +creature:RegisterEvent(CastArmyOfTheDead, 1000, 1) end local function OnDied(event, creature, killer) - creature:RemoveEvents() +creature:RemoveEvents() end RegisterCreatureEvent(400029, 1, OnEnterCombat) RegisterCreatureEvent(400029, 2, OnLeaveCombat) -RegisterCreatureEvent(400029, 4, OnDied) \ No newline at end of file +RegisterCreatureEvent(400029, 4, OnDied) +RegisterCreatureEvent(400029, 5, OnSpawn) \ No newline at end of file diff --git a/BoneSentinel.lua b/BoneSentinel.lua new file mode 100644 index 0000000..febddf8 --- /dev/null +++ b/BoneSentinel.lua @@ -0,0 +1,37 @@ +local BoneSentinel = {}; +BoneSentinel.npcId = 400036 + +local function CastShadowCleave(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 38226, true) +end + +local function CastEarthQuake(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 33919, true) +end + +local function CastBoneBarrier(eventId, delay, calls, creature) +creature:CastSpell(creature, 49222, true) +end + +function BoneSentinel:OnSpawn(event, creature) +creature:CastSpell(creature, 49222, true) +creature:RegisterEvent(CastBoneBarrier, 35000, 0) +end + +function BoneSentinel:OnEnterCombat(event, creature, target) +creature:RegisterEvent(CastShadowCleave, 7750, 0) +creature:RegisterEvent(CastEarthQuake, 35000, 0) +end + +function BoneSentinel:OnLeaveCombat(event, creature) +-- Do not remove events +end + +function BoneSentinel:OnDied(event, creature, killer) +creature:RemoveEvents() +end + +RegisterCreatureEvent(BoneSentinel.npcId, 5, function(event, creature) BoneSentinel:OnSpawn(event, creature) end) +RegisterCreatureEvent(BoneSentinel.npcId, 1, function(event, creature) BoneSentinel:OnEnterCombat(event, creature) end) +RegisterCreatureEvent(BoneSentinel.npcId, 2, function(event, creature) BoneSentinel:OnLeaveCombat(event, creature) end) +RegisterCreatureEvent(BoneSentinel.npcId, 4, function(event, creature) BoneSentinel:OnDied(event, creature) end) \ No newline at end of file diff --git a/Bonk.lua b/Bonk.lua new file mode 100644 index 0000000..9ed4f44 --- /dev/null +++ b/Bonk.lua @@ -0,0 +1,48 @@ +Bonk = {} + +-- Create the item you want to give to the player +Bonk.ITEM_ID = 60112 -- replace with the ID of the item you want to give +Bonk.ITEM_ID2 = 37500 -- replace with the ID of the new item you want to give + +-- Register the gossip event for the NPC +function Bonk.OnGossipHello(event, player, creature) +player:GossipMenuAddItem(0, "|TInterface\\Icons\\ability_druid_flightform:50:50:-13:0|tMech Wings for 25 silver.", 0, 1) +player:GossipMenuAddItem(0, "|TInterface\\Icons\\inv_misc_key_14:50:50:-13:0|tKeys to a Shredder for 45 silver.", 0, 2) +player:GossipSendMenu(1, creature) +end + +-- Handle the player's selection in the gossip menu +function Bonk.OnGossipSelect(event, player, creature, sender, action) +if action == 1 then +if player:GetCoinage() < 2500 then +player:SendBroadcastMessage("You do not have enough silver.") +player:GossipComplete() +else +player:SetCoinage(player:GetCoinage() - 2500) +player:AddItem(Bonk.ITEM_ID, 1) +player:SendBroadcastMessage("You have received Mech Wings.") +player:GossipComplete() +end +elseif action == 2 then +if player:GetCoinage() < 3500 then +player:SendBroadcastMessage("You have received keys to a Refurbished Shredder.") +player:GossipComplete() +else +player:SetCoinage(player:GetCoinage() - 4500) +player:AddItem(Bonk.ITEM_ID2, 1) +player:SendBroadcastMessage("You have received Mech Wings.") +player:GossipComplete() +end +end +end + +-- Send a unit yell when the NPC spawns +function Bonk.OnSpawn(event, creature) +creature:SendUnitYell("I've got Mech Wings and keys to Refurbished Shredders!", 0) +creature:CastSpell(creature, 20374) +end + +-- Register the gossip events with the NPC +RegisterCreatureGossipEvent(400043, 1, Bonk.OnGossipHello) +RegisterCreatureGossipEvent(400043, 2, Bonk.OnGossipSelect) +RegisterCreatureEvent(400043, 5, Bonk.OnSpawn) \ No newline at end of file diff --git a/DingMask.lua b/DingMask.lua index 508d235..d108fe9 100644 --- a/DingMask.lua +++ b/DingMask.lua @@ -16,7 +16,12 @@ local npcIds1 = { 400016, 300018, 400029, -400032 +400032, +16383, +16394, +16423, +16422, +400036, } -- Table to store NPC IDs for group 2 diff --git a/NPCBrave.lua b/NPCBrave.lua index 4d500f0..872e68e 100644 --- a/NPCBrave.lua +++ b/NPCBrave.lua @@ -1,4 +1,4 @@ -local BRAVE_IDS = {5412, 5511, 5512, 957, 7798, 11026, 5518, 5510, 5509, 1416, 5514, 29016, 29019} +local BRAVE_IDS = {5412, 5511, 5512, 957, 7798, 11026, 5518, 5510, 5509, 1416, 5514, 29016, 29019, 3518, 1472} local BRAVERY_DIALOGUE = { "I fear no enemy!", "I will fight to the bitter end!", diff --git a/NPCFreakout.lua b/NPCFreakout.lua index c127533..9d0dc5e 100644 --- a/NPCFreakout.lua +++ b/NPCFreakout.lua @@ -1,4 +1,4 @@ -local FREAKOUT_NPC = { 30217, 4981, 483, 5193, 1402, 70021, 1257, 1286, 1285, 3520, 3513, 1432, 1402, 1444, 7917, 1212, 6173, 5489, 4982, 5484, 14500, 14450, 14496, 14497, 6579, 5519, 6007, 29152, 9977 } +local FREAKOUT_NPC = { 30217, 4981, 483, 5193, 1402, 70021, 1257, 1286, 1285, 3520, 3513, 1432, 1402, 1444, 7917, 1212, 6173, 5489, 4982, 5484, 14500, 14450, 14496, 14497, 6579, 5519, 6007, 29152, 9977, 1395, 2795 } function OnEnterCombat(event, creature, target) creature:CastSpell(creature, 31358, true) -- fear spell diff --git a/OrgArcher.lua b/OrgArcher.lua new file mode 100644 index 0000000..5d9c6b4 --- /dev/null +++ b/OrgArcher.lua @@ -0,0 +1,31 @@ +local OrgArcher = {}; + +local function CastShoot(eventId, delay, calls, creature) + creature:CastSpell(creature:GetVictim(), 37770, true) +end + +local function CastSerpentSting(eventId, delay, calls, creature) + creature:CastSpell(creature:GetVictim(), 36984, true) +end + +local function CastMultiShot(eventId, delay, calls, creature) + creature:CastSpell(creature:GetVictim(), 30990, true) +end + +local function OnEnterCombat(event, creature, target) + creature:RegisterEvent(CastShoot, 750, 0) + creature:RegisterEvent(CastShoot, 15000, 0) + creature:RegisterEvent(CastMultiShot, 5000, 0) + end + +local function OnLeaveCombat(event, creature) + creature:RemoveEvents() +end + +local function OnDied(event, creature, killer) + creature:RemoveEvents() +end + +RegisterCreatureEvent(400041, 1, OnEnterCombat) +RegisterCreatureEvent(400041, 2, OnLeaveCombat) +RegisterCreatureEvent(400041, 4, OnDied) \ No newline at end of file diff --git a/OrgBerserker.lua b/OrgBerserker.lua new file mode 100644 index 0000000..0535090 --- /dev/null +++ b/OrgBerserker.lua @@ -0,0 +1,30 @@ +local OrgBerserker = {}; + +local function CastWhirlWind(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 53361, true) +end + +local function CastEnrage(eventId, delay, calls, creature) +creature:CastSpell(creature, 12880, true) +end + +local function OnEnterCombat(event, creature, target) +creature:RegisterEvent(CastWhirlWind, 7000, 0) +creature:RegisterEvent(CastEnrage, 10000, 0) +end + +local function OnLeaveCombat(event, creature) +creature:RemoveEvents() +end + +local function OnDied(event, creature, killer) +creature:RemoveEvents() +end + +RegisterCreatureEvent(400040, 1, OnEnterCombat) +RegisterCreatureEvent(400040, 2, OnLeaveCombat) +RegisterCreatureEvent(400040, 4, OnDied) + +RegisterCreatureEvent(400045, 1, OnEnterCombat) +RegisterCreatureEvent(400045, 2, OnLeaveCombat) +RegisterCreatureEvent(400045, 4, OnDied) \ No newline at end of file diff --git a/PallidHorror.lua b/PallidHorror.lua new file mode 100644 index 0000000..7b6f736 --- /dev/null +++ b/PallidHorror.lua @@ -0,0 +1,7 @@ +local PallidHorror = {} + +function PallidHorror.OnDied(event, creature, killer) +creature:CastSpell(creature, 28699, true) +end + +RegisterCreatureEvent(16394, 4, PallidHorror.OnDied) \ No newline at end of file diff --git a/Patchqwerk.lua b/Patchqwerk.lua index 784a2c2..ecbb246 100644 --- a/Patchqwerk.lua +++ b/Patchqwerk.lua @@ -4,8 +4,8 @@ local Patchqwerk = {} function Patchqwerk.OnSpawn(event, creature) -- Sends a yell message ("Patchqwerk make Lich King proud! You die now!") creature:SendUnitYell("Patchqwerk make Lich King proud! You die now!",0) --- Casts spell 41924 on itself -creature:CastSpell(creature, 41924, true) +-- Casts spell 46587 on itself +creature:CastSpell(creature, 46587, true) end -- This function is called repeatedly every 7 seconds when Patchqwerk is in combat. @@ -76,8 +76,8 @@ creature:SendUnitYell("Patchqwerk go berserk!", 0) creature:CastSpell(creature, 41305, true) -- If its health rises above 95%, elseif (creature:HealthAbovePct(95)) then --- Casts spell 41924 -creature:CastSpell(creature, 41924, true) +-- Casts spell 46587 +creature:CastSpell(creature, 46587, true) end end diff --git a/SW-GuardCleave.lua b/SW-GuardCleave.lua index 6f1e582..28db1d2 100644 --- a/SW-GuardCleave.lua +++ b/SW-GuardCleave.lua @@ -4,8 +4,13 @@ local function CastCleave(eventId, delay, calls, creature) creature:CastSpell(creature:GetVictim(), 20677, true) end +local function CastSunderArmor(eventId, delay, calls, creature) + creature:CastSpell(creature:GetVictim(), 8380, true) +end + local function OnEnterCombat(event, creature, target) creature:RegisterEvent(CastCleave, 5000, 0) + creature:RegisterEvent(CastSunderArmor, 7000, 0) end local function OnLeaveCombat(event, creature) @@ -18,4 +23,8 @@ end RegisterCreatureEvent(400013, 1, OnEnterCombat) RegisterCreatureEvent(400013, 2, OnLeaveCombat) -RegisterCreatureEvent(400013, 4, OnDied) \ No newline at end of file +RegisterCreatureEvent(400013, 4, OnDied) + +RegisterCreatureEvent(400039, 1, OnEnterCombat) +RegisterCreatureEvent(400039, 2, OnLeaveCombat) +RegisterCreatureEvent(400039, 4, OnDied) \ No newline at end of file diff --git a/SWGKillCred.lua b/SWGKillCred.lua index 7ad3981..287518c 100644 --- a/SWGKillCred.lua +++ b/SWGKillCred.lua @@ -1,23 +1,24 @@ -local SWG_IDS = {68, 400033, 4034} +local SWG_IDS = {68, 400013, 400033, 400014, 1976} local SPELL_ID = 100141 function OnSpellCast(event, caster, spell) -local target = spell:GetTarget() -if target and spell:GetEntry() == SPELL_ID then -local isValidTarget = false -for _, swgID in ipairs(SWG_IDS) do -if target:GetEntry() == swgID then -isValidTarget = true -break -end -end -if not isValidTarget then -caster:SendBroadcastMessage("Invalid target for this spell.") -spell:Cancel() -else -caster:KilledMonsterCredit(target:GetEntry()) -end -end + local target = spell:GetTarget() + if target and spell:GetEntry() == SPELL_ID then + local isValidTarget = false + for _, swgID in ipairs(SWG_IDS) do + if target:GetEntry() == swgID then + isValidTarget = true + break + end + end + if not isValidTarget then + caster:SendBroadcastMessage("Invalid target for this spell.") + spell:Cancel() + else + -- give kill credit to NPC ID 68 + caster:KilledMonsterCredit(68) + end + end end -RegisterPlayerEvent(5, OnSpellCast) \ No newline at end of file +RegisterPlayerEvent(5, OnSpellCast) diff --git a/SWVillager.lua b/SWVillager.lua index 7ebd24e..85195cf 100644 --- a/SWVillager.lua +++ b/SWVillager.lua @@ -16,7 +16,7 @@ player:GossipMenuAddItem(0, gossipText, 0, 1) player:GossipSendMenu(1, creature) else -- Send an error message to the player if they don't have the necessary item -player:SendBroadcastMessage("You do not have the necessary item to calm the citizen.") +player:SendBroadcastMessage("They aren't responding to anything...Maybe you should go ask Arch Bishop Benedictus for help in the Cathedral of Light.") end end diff --git a/ScourgeQuestsWorkAround.lua b/ScourgeQuestsWorkAround.lua new file mode 100644 index 0000000..d54a80e --- /dev/null +++ b/ScourgeQuestsWorkAround.lua @@ -0,0 +1,22 @@ +local questIds = {9265, 9264, 9263, 9262, 9261, 9260} +local itemId = 22892 +local itemCount = 3 +local totalLooted = {} + +local function OnLootItem(event, player, item, count) + if item:GetEntry() == itemId then + for _, questId in pairs(questIds) do + if player:HasQuest(questId) then + if not totalLooted[questId] then + totalLooted[questId] = 0 + end + totalLooted[questId] = totalLooted[questId] + count + if totalLooted[questId] >= itemCount then + player:CompleteQuest(questId) + end + end + end + end +end + +RegisterPlayerEvent(32, OnLootItem) diff --git a/Sever.lua b/Sever.lua new file mode 100644 index 0000000..d22c5b2 --- /dev/null +++ b/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) + diff --git a/Skalathrax.lua b/Skalathrax.lua new file mode 100644 index 0000000..48ca2aa --- /dev/null +++ b/Skalathrax.lua @@ -0,0 +1,49 @@ +local undeadDragon = {} + +function undeadDragon.OnSpawn(event, creature) +creature:CanFly(true) +creature:SetDisableGravity(true) +creature:SetReactState(0) +creature:IsRegeneratingHealth(false) +creature:SendUnitYell("Your warm flesh will freeze under the shadow of my wings!", 0) +creature:PlayDirectSound(20429) +creature:CastSpell(creature, 100151, true) + +creature:RegisterEvent(undeadDragon.CastSpell, 60000, 0) +creature:RegisterEvent(undeadDragon.CastSpell2, 20000, 0) +creature:RegisterEvent(undeadDragon.CastSpell3, 25000, 0) +creature:RegisterEvent(undeadDragon.CastSpell4, 30000, 0) +creature:RegisterEvent(undeadDragon.CastSpell5, 35000, 0) +end + +function undeadDragon.OnLeaveCombat(event, creature) +creature:IsRegeneratingHealth(false) +end + +function undeadDragon.CastSpell(event, delay, pCall, creature) +creature:CastSpell(creature, 100156, true) +end + +function undeadDragon.CastSpell2(event, delay, pCall, creature) +creature:CastSpell(creature:GetVictim(), 200002, true) +end + +function undeadDragon.CastSpell3(event, delay, pCall, creature) +creature:CastSpell(creature:GetVictim(), 200003, true) +end + +function undeadDragon.CastSpell4(event, delay, pCall, creature) +creature:CastSpell(creature:GetRandomUnit(10), 200004, true) +end + +function undeadDragon.CastSpell5(event, delay, pCall, creature) +creature:CastSpell(creature, 200005, true) +end + +function undeadDragon.OnDeath(event, creature, killer) +creature:RemoveEvents() +end + +RegisterCreatureEvent(400035, 5, undeadDragon.OnSpawn) +RegisterCreatureEvent(400035, 2, undeadDragon.OnLeaveCombat) +RegisterCreatureEvent(400035, 4, undeadDragon.OnDeath) \ No newline at end of file diff --git a/SmolderingEmberRestrict.lua b/SmolderingEmberRestrict.lua new file mode 100644 index 0000000..fb4b4e4 --- /dev/null +++ b/SmolderingEmberRestrict.lua @@ -0,0 +1,33 @@ +local ALLOWED_MAPS = { +0, +1, +} + +local ALLOWED_SPELLS = {100150, 100160} + +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 cannot use that mount here.") + else + if spellId == 100150 then + player:PlayDirectSound(20428) + end + end +end +end + +RegisterPlayerEvent(5, OnPlayerCastSpell) \ No newline at end of file diff --git a/Startstop.lua b/Startstop.lua new file mode 100644 index 0000000..1f1e42a --- /dev/null +++ b/Startstop.lua @@ -0,0 +1,20 @@ +--DO NOT DELETE ME! FIXES AN ANNOYING AF BUG + +local holidayEventIds = {17, 91} + +local function OnPlayerLogin(event, player) + if not player:IsInWorld() then + return + end + + for _, eventId in ipairs(holidayEventIds) do + local isHolidayActive = IsGameEventActive(eventId) + + if isHolidayActive then + StopGameEvent(eventId) + StartGameEvent(eventId) + end + end +end + +RegisterPlayerEvent(3, OnPlayerLogin) diff --git a/TempMount.lua b/TempMount.lua new file mode 100644 index 0000000..3fa45e5 --- /dev/null +++ b/TempMount.lua @@ -0,0 +1,36 @@ +Thunderhoof = {} + +-- Create the item you want to give to the player +Thunderhoof.ITEM_ID = 60111 -- replace with the ID of the item you want to give + +-- Register the gossip event for the NPC +function Thunderhoof.OnGossipHello(event, player, creature) +player:GossipMenuAddItem(0, "|TInterface\\Icons\\ability_mount_tawnywindrider:50:50:-13:0|tLoan me a Wind Rider for 25 silver.", 0, 1) +player:GossipSendMenu(1, creature) +end + +-- Handle the player's selection in the gossip menu +function Thunderhoof.OnGossipSelect(event, player, creature, sender, action) +if action == 1 then +if player:GetCoinage() < 2500 then +player:SendBroadcastMessage("You do not have enough silver.") +player:GossipComplete() +else +player:SetCoinage(player:GetCoinage() - 2500) +player:AddItem(Thunderhoof.ITEM_ID, 1) +player:SendBroadcastMessage("You have received a Wind Rider.") +player:GossipComplete() +end +end +end + +-- Send a unit yell when the NPC spawns +function Thunderhoof.OnSpawn(event, creature) +creature:SendUnitYell("Lend yourself a Wind Rider for 25 silver! You won't want to fight the Scourge without one!", 0) +creature:CastSpell(creature, 20374) +end + +-- Register the gossip events with the NPC +RegisterCreatureGossipEvent(400042, 1, Thunderhoof.OnGossipHello) +RegisterCreatureGossipEvent(400042, 2, Thunderhoof.OnGossipSelect) +RegisterCreatureEvent(400042, 5, Thunderhoof.OnSpawn) \ No newline at end of file diff --git a/TrapCredit.lua b/TrapCredit.lua new file mode 100644 index 0000000..5530870 --- /dev/null +++ b/TrapCredit.lua @@ -0,0 +1,43 @@ +local NPC_ID = 400034 -- The ID of the NPC you want players to get kill credit for + +-- List of allowed zones (use zone ID) +local ALLOWED_ZONES = { + 1519, -- SW City + 12, +} + +-- List of allowed spell IDs +local ALLOWED_SPELLS = { + 100144, -- Spell 1 + 100142, + 100143, + 100145, + -- Add more spells here as needed +} + +-- Define the indexOf function for tables +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 zoneId = player:GetZoneId() + + if table.indexOf(ALLOWED_SPELLS, spellId) ~= -1 then + if table.indexOf(ALLOWED_ZONES, zoneId) == -1 then + spell:Cancel() + player:SendBroadcastMessage("You cannot cast this spell in this area.") + else + player:KilledMonsterCredit(NPC_ID) + player:SendBroadcastMessage("You have successfuly placed a trap!") + end + end +end + +RegisterPlayerEvent(5, OnPlayerCastSpell) diff --git a/TrapQuestA.lua b/TrapQuestA.lua new file mode 100644 index 0000000..3392199 --- /dev/null +++ b/TrapQuestA.lua @@ -0,0 +1,19 @@ +-- Quest ID for the quest that should trigger the sound +local QUEST_ID = 30004 + +-- Creature ID for the creature that gives the quest +local CREATURE_ID = 12480 + +-- Sound ID for the sound that should play when the quest is accepted +local SOUND_ID = 20426 + +-- Emote ID for the emote that should play when the quest is accepted +local EMOTE_ID = 113 + +-- Register the event for quest acceptance +RegisterCreatureEvent(CREATURE_ID, 31, function(event, player, creature, quest) + if quest:GetId() == QUEST_ID then + creature:PlayDistanceSound(SOUND_ID) + creature:PerformEmote(EMOTE_ID) + end +end) diff --git a/TrapQuestR.lua b/TrapQuestR.lua new file mode 100644 index 0000000..8acb15c --- /dev/null +++ b/TrapQuestR.lua @@ -0,0 +1,19 @@ +-- Quest ID for the quest that should trigger the sound +local QUEST_ID = 30004 + +-- Creature ID for the creature that gives the quest +local CREATURE_ID = 12480 + +-- Sound ID for the sound that should play when the quest is rewarded +local SOUND_ID = 20427 + +-- Emote ID for the emote that should play when the quest is rewarded +local EMOTE_ID = 113 + +-- Register the event for quest reward +RegisterCreatureEvent(CREATURE_ID, 34, function(event, player, creature, quest) + if quest:GetId() == QUEST_ID then + creature:PlayDistanceSound(SOUND_ID) + creature:PerformEmote(EMOTE_ID) + end +end) diff --git a/Turalyon1.lua b/Turalyon1.lua index 8438526..dc9c0ec 100644 --- a/Turalyon1.lua +++ b/Turalyon1.lua @@ -4,7 +4,7 @@ local spellid2 = 69930 local spellid3 = 52386 local yelltext = { "Defenders, forward! We end this beast here and now!", -"We fight for Home, for Family...I only hope we are not too late.", +"We fight the Scourge to protect our homes, our families...I only hope we are not too late.", "", "Alleria...perfect timing as always.", }