Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jorge990125 committed Aug 29, 2024
1 parent a85c227 commit 579c184
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
17 changes: 7 additions & 10 deletions data/sql/db-world/base/npc_promotion_creature_template.sql
Original file line number Diff line number Diff line change
@@ -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);
9 changes: 5 additions & 4 deletions src/NpcPromotion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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())
{
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 579c184

Please sign in to comment.