From 4be4e5d502a95c6d7fe2307c56c42de80af07c56 Mon Sep 17 00:00:00 2001 From: Manmadedrummer <140130825+Manmadedrummer@users.noreply.github.com> Date: Tue, 18 Jun 2024 10:17:17 -0400 Subject: [PATCH] Added NPC SQL and the Lua script for him --- Creature_Template_Insert.sql | 3 ++ Lua Script/Arena-Fight.lua | 62 ++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 Creature_Template_Insert.sql create mode 100644 Lua Script/Arena-Fight.lua diff --git a/Creature_Template_Insert.sql b/Creature_Template_Insert.sql new file mode 100644 index 0000000..0bde86e --- /dev/null +++ b/Creature_Template_Insert.sql @@ -0,0 +1,3 @@ +DELETE FROM `creature_template` WHERE (`entry` = 800799); +INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `speed_swim`, `speed_flight`, `detection_range`, `scale`, `rank`, `dmgschool`, `DamageModifier`, `BaseAttackTime`, `RangeAttackTime`, `BaseVariance`, `RangeVariance`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `ExperienceModifier`, `RacialLeader`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `spell_school_immune_mask`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES +(800799, 0, 0, 0, 0, 0, 1233, 0, 0, 0, 'Reed Zither', 'Arena Master', NULL, 2555, 80, 80, 0, 12, 1, 1, 1.14286, 1, 1, 18, 1.3, 1, 0, 1, 2000, 2000, 1, 1, 1, 768, 2048, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, '', 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 2, '', 12340); diff --git a/Lua Script/Arena-Fight.lua b/Lua Script/Arena-Fight.lua new file mode 100644 index 0000000..319b619 --- /dev/null +++ b/Lua Script/Arena-Fight.lua @@ -0,0 +1,62 @@ +--[[ +Custom Arena Fighting Teleport NPC for Araxia - by Manmadedrummer +THis script is to a set area and spawns a custom boss to fight. +]] + +-- Variables +local NPC_ID = 800799 +local ZoneID = 33 +local X = -13200.41 +local Y = 279.175 +local Z = 21.857 +local O = 1.18 +local Faction = 14 -- Hostile faction for both Alliance and Horde +local Duration = 600000 -- 10 minutes, adjust as needed +local ParticipationCost = 10000 -- How much gold it cost + +-- On Triggers +function ArenaFightingGossipOnTalk(Unit, Event, player) + Unit:GossipCreateMenu(100, player, 0) + Unit:GossipMenuAddItem(0, "I want to fight Patchwerk (Level 83)", 1, 0) + Unit:GossipMenuAddItem(0, "I'd like to fight Festergut! (Level 83)", 2, 0) + Unit:GossipMenuAddItem(0, "I'd like to fight Lord Jaraxxus! (Level 83)", 3, 0) + Unit:GossipMenuAddItem(0, "I'd like to fight Deathbringer Saurfang! (Level 83)", 4, 0) + Unit:GossipMenuAddItem(0, "Maybe next time.", 500, 0) + Unit:GossipSendMenu(player) +end + +function ArenaFightingGossipOnSelect(Unit, Event, player, id, intid, code, pMisc) + if (intid == 500) then + player:GossipComplete() + return + end + + if player:GetCoinage() < ParticipationCost then + player:SendBroadcastMessage("You do not have enough gold to participate.") + player:GossipComplete() + return + end + + player:ModifyMoney(-ParticipationCost) + player:SendBroadcastMessage("You're being teleported to the ring, get ready to fight!") + + if (intid == 1) then + player:Teleport(ZoneID, X, Y, Z, O) + Unit:SpawnCreature(16028, X, Y, Z, O, Faction, Duration) + elseif (intid == 2) then + player:Teleport(ZoneID, X, Y, Z, O) + Unit:SpawnCreature(36626, X, Y, Z, O, Faction, Duration) + elseif (intid == 3) then + player:Teleport(ZoneID, X, Y, Z, O) + Unit:SpawnCreature(34780, X, Y, Z, O, Faction, Duration) + elseif (intid == 4) then + player:Teleport(ZoneID, X, Y, Z, O) + Unit:SpawnCreature(37813, X, Y, Z, O, Faction, Duration) + end + + player:GossipComplete() +end + +RegisterUnitGossipEvent(2555, 1, "ArenaFightingGossipOnTalk") +RegisterUnitGossipEvent(2555, 2, "ArenaFightingGossipOnSelect") +