Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor, fix minor issues, add config #50

Merged
merged 18 commits into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added conf/.gitkeep
Empty file.
33 changes: 33 additions & 0 deletions conf/npc_talent_template.conf.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#

[worldserver]

##########################################
# Npc Talent Template module configuration
##########################################
#
# NpcTalentTemplate.EnableResetTalents
# Description: Enables Gossip Option to reset talents
# Default: 0 - Disabled
# 1 - Enabled
#

NpcTalentTemplate.EnableResetTalents = 0

#
# NpcTalentTemplate.EnableRemoveAllGlyphs
# Description: Enables Gossip Option to Remove All Glyphs
# Default: 1 - Enabled
# 0 - Disabled
#

NpcTalentTemplate.EnableRemoveAllGlyphs = 1

#
# NpcTalentTemplate.EnableDestroyEquippedGear
# Description: Enables Gossip Option to Destroy Equipped Gear
# Default: 1 - Enabled
# 0 - Disabled
#

NpcTalentTemplate.EnableDestroyEquippedGear = 1

Large diffs are not rendered by default.

22 changes: 0 additions & 22 deletions data/sql/db-world/base/development.sql

This file was deleted.

21 changes: 21 additions & 0 deletions data/sql/db-world/base/npc_talent_template_data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-- DATA
SET @ENTRY := 55009;
SET @NAME := 'Pick a spec';
SET @SUBNAME := 'AzerothCore Template';
SET @DISPLAY_ID := 24877;

DELETE FROM `creature_template` WHERE `entry` = @ENTRY;
INSERT INTO `creature_template` (`entry`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `unit_class`, `unit_flags`, `type`, `type_flags`, `RegenHealth`, `flags_extra`, `ScriptName`) VALUES
(@ENTRY, @NAME , @SUBNAME, 'Speak', 0, 80, 80, 35, 1, 1, 1.14286, 1, 0, 1, 2, 7, 138936390, 1, 2, 'TemplateNPC');

DELETE FROM `creature_template_model` WHERE `CreatureID` = @ENTRY;
INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES
(@ENTRY, 0, @DISPLAY_ID, 1, 1, 0);

DELETE FROM `npc_text` WHERE `ID` = @ENTRY;
INSERT INTO `npc_text` (`ID`, `text0_0`, `text0_1`) VALUES
(@ENTRY, 'Here you can select a character template which will gear up, gem up, set talent specialization, and set glyphs for your character instantly.', 'Here you can select a character template which will gear up, gem up, set talent specialization, and set glyphs for your character instantly.');

DELETE FROM `creature_template_movement` WHERE `CreatureId` = @ENTRY;
INSERT INTO `creature_template_movement` (`CreatureId`, `Ground`, `Swim`, `Flight`, `Rooted`, `Chase`, `Random`, `InteractionPauseTimer`) VALUES
(@ENTRY, 1, 1, 0, 0, 0, 0, NULL);
125 changes: 37 additions & 88 deletions src/TemplateNPC.cpp

Large diffs are not rendered by default.

10 changes: 4 additions & 6 deletions src/TemplateNPC.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,8 @@
#include "Define.h"
#include "Player.h"
#include "Item.h"
#include "DBCStores.h"
#include "Log.h"
#include "DatabaseEnv.h"
#include "WorldSession.h"
#include "ScriptedGossip.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "GossipDef.h"
#include "Creature.h"
#include "ObjectMgr.h"

Expand Down Expand Up @@ -273,6 +267,10 @@ class sTemplateNPC
HumanGearContainer m_HumanGearContainer;
AllianceGearContainer m_AllianceGearContainer;
HordeGearContainer m_HordeGearContainer;

bool enableResetTalents;
bool enableRemoveAllGlyphs;
bool enableDestroyEquippedGear;
};

#define sTemplateNpcMgr sTemplateNPC::instance()
Expand Down
Loading