diff --git a/data/sql/db-world/base/npc_promotion_creature_template.sql b/data/sql/db-world/base/npc_promotion_creature_template.sql index 16a56c6..0172ec7 100644 --- a/data/sql/db-world/base/npc_promotion_creature_template.sql +++ b/data/sql/db-world/base/npc_promotion_creature_template.sql @@ -1,13 +1,10 @@ -SET @ENTRY:=100000; -SET @NAME:="AzerothCore"; -SET @SUBNAME:="Promotion"; -SET @GOSSIP:=62000; -SET @MODELID1:=22234; - -DELETE FROM `creature_template` WHERE `entry`=@ENTRY; -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 -(@ENTRY, 0, 0, 0, 0, 0, @MODELID1, 0, 0, 0, @NAME, @SUBNAME, NULL, @GOSSIP, 83, 83, 0, 35, 1, 1, 1, 0, 0, 20, 2, 0, 0, 0, 0, 0, 1, 1, 1, 768, 2048, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 'npc_promocion', 12340); +DELETE FROM `creature_template` WHERE (`entry` = 100002); +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`,`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 +(100002, 0, 0, 0, 0, 0, 'AzerothCore', 'Promotion', NULL, 62000, 80, 80, 0, 35, 1, 1, 1.14286, 1, 1, 20, 1.5, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 'npc_promocion', NULL); +DELETE FROM `creature_template_model` WHERE (`CreatureID` = 100002); +INSERT INTO `creature_template_model`(`CreatureID`,`Idx`,`CreatureDisplayID`,`DisplayScale`,`Probability`,`VerifiedBuild`) values +(100002,0,22234,1,1,0); DELETE FROM `creature_template_locale` WHERE `entry`=@ENTRY; INSERT INTO `creature_template_locale` (`entry`, `locale`, `Name`, `Title`, `VerifiedBuild`) VALUES -(@ENTRY, "zhCN", "新人伴手礼", "直升服务", 18019); +(@ENTRY, "zhCN", "新人伴手礼", "直升服务", 18019); \ No newline at end of file diff --git a/src/NpcPromotion.cpp b/src/NpcPromotion.cpp index 92edff8..bac5f74 100644 --- a/src/NpcPromotion.cpp +++ b/src/NpcPromotion.cpp @@ -11,6 +11,7 @@ #include "NpcPromotion.h" #include "GossipDef.h" #include "ScriptedGossip.h" +#include "SpellMgr.h" #if AC_COMPILER == AC_COMPILER_GNU #pragma GCC diagnostic ignored "-Wdeprecated-declarations" @@ -228,7 +229,7 @@ class npc_promocion : public CreatureScript countAccount = -1; } - if ((player->getLevel() < npcPromotion.LEVEL) && (((countAccount < npcPromotion.COUNT)) || (countIp < npcPromotion.IP_COUNT))) + if ((player->GetLevel() < npcPromotion.LEVEL) && (((countAccount < npcPromotion.COUNT)) || (countIp < npcPromotion.IP_COUNT))) { switch (player->getClass()) { @@ -284,7 +285,7 @@ class npc_promocion : public CreatureScript AddGossipItemFor(player, GOSSIP_MENU_PROMOTION, GOSSIP_MENU_CLOSE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21); - if (player->getLevel() >= npcPromotion.LEVEL) + if (player->GetLevel() >= npcPromotion.LEVEL) { AddGossipItemFor(player, GOSSIP_MENU_PROMOTION, GOSSIP_MENU_TP_DALARAN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22); } @@ -498,12 +499,12 @@ class NpcPromotionCommand : public CommandScript { static ChatCommandTable promotionSetCommandTable = { - { "view", SEC_MODERATOR, false, &HandleViewNpcPromotionCommand, "" } + { "view", HandleViewNpcPromotionCommand, SEC_MODERATOR, Console::No } }; static ChatCommandTable commandTable = { - { "promotion", SEC_MODERATOR, false, nullptr, "", promotionSetCommandTable} + { "promotion", promotionSetCommandTable } }; return commandTable;