From a6e881b9f35f57df88994b468177ac80d1d67e23 Mon Sep 17 00:00:00 2001 From: Ludwig Date: Sun, 2 Mar 2025 05:52:04 +0100 Subject: [PATCH] fix codestyle and sql for creature_template_model changes --- data/sql/db-world/npc_morph.sql | 9 +++++++-- src/npc_morph.cpp | 8 ++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/data/sql/db-world/npc_morph.sql b/data/sql/db-world/npc_morph.sql index dff11b6..6e03082 100644 --- a/data/sql/db-world/npc_morph.sql +++ b/data/sql/db-world/npc_morph.sql @@ -1,2 +1,7 @@ -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`, `scale`, `rank`, `dmgschool`, `DamageModifier`, `BaseAttackTime`, `RangeAttackTime`, `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`, `RacialLeader`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES -(55004, 0, 0, 0, 0, 0, 18, 0, 0, 0, 'Morph Master', 'AzerothCore', NULL, 0, 80, 80, 0, 35, 1, 1, 1.14286, 1, 1, 0, 1, 2000, 2000, 2, 0, 2048, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 50, 50, 1, 0, 0, 1, 0, 0, 'npc_morph', 12340); +INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `dmgschool`, `DamageModifier`, `BaseAttackTime`, `RangeAttackTime`, `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`, `RacialLeader`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES +(55004, 0, 0, 0, 0, 0, 'Morph Master', 'AzerothCore', NULL, 0, 80, 80, 0, 35, 1, 1, 1.14286, 1, 1, 0, 1, 2000, 2000, 2, 0, 2048, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 50, 50, 1, 0, 0, 1, 0, 0, 'npc_morph', 12340); + +-- NPC MODEL +DELETE FROM `creature_template_model` WHERE `CreatureID` = 55004; +INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES +(55004, 0, 18, 1, 1, 0); diff --git a/src/npc_morph.cpp b/src/npc_morph.cpp index 0b6ac86..c366033 100644 --- a/src/npc_morph.cpp +++ b/src/npc_morph.cpp @@ -1,6 +1,6 @@ -#include "ScriptMgr.h" -#include "ScriptedGossip.h" #include "Player.h" +#include "ScriptedGossip.h" +#include "ScriptMgr.h" #define MSG_GOSSIP_TEXT_GETTING_STARTED "Welcome to AzerothCore morph service!" @@ -20,7 +20,7 @@ class npc_morph : public CreatureScript public: npc_morph() : CreatureScript("npc_morph") { } - bool OnGossipHello(Player* player, Creature* creature) + bool OnGossipHello(Player* player, Creature* creature) override { ClearGossipMenuFor(player); AddGossipItemFor(player, GOSSIP_ICON_INTERACT_1, MSG_GOSSIP_TEXT_MORTH_GNOME_MALE, GOSSIP_SENDER_MAIN, 2); @@ -35,7 +35,7 @@ class npc_morph : public CreatureScript return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override { if (!player->getAttackers().empty()) {