Skip to content

Commit

Permalink
Update gossip handling to store data in database and add new features (
Browse files Browse the repository at this point in the history
  • Loading branch information
sogladev authored Nov 19, 2024
1 parent 41c13b6 commit bf9fe9b
Show file tree
Hide file tree
Showing 11 changed files with 4,791 additions and 3,967 deletions.
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,44 @@
# ![logo](https://raw.githubusercontent.com/azerothcore/azerothcore.github.io/master/images/logo-github.png) AzerothCore

## TemplateNPC-azerothcore
## mod-npc-talent-template

- Latest build status with azerothcore:

[![Build Status](https://github.com/azerothcore/mod-npc-talent-template/workflows/core-build/badge.svg?branch=master&event=push)](https://github.com/azerothcore/mod-npc-talent-template)

Template NPC for AzerothCore 3.3.5
## Description
This mod introduces an NPC that allows players to instantly apply pre-configured character templates that gear up, gem, set talents, and apply glyphs for any class. Ideal for quick character optimization for various roles and scenarios.

* templates for level 80 PvP S6 and level 70 PvE T6
* race-specific gear options (e.g., humans receive no PvP trinket)
* administrator command for creating custom templates. Templates are managed directly through the database and config. No C++ edits needed

![](https://i.ibb.co/27WPR5j/Wo-WScrn-Shot-021219-000220.jpg)

Video Showcase:
https://streamable.com/yxv1m

## Creating custom gear sets
This process can only be done by an administrator and is error-prone. Creating gear sets should be done on a local development server and exporting sets from the DB to a `.sql` is recommended.

1. Setup a character with the desired gear set, gems, enchants, talents and glyphs.
2. `.templatenpc create [TemplateName]` creates database entries for gear, talents, glyphs and an entry in the index table for your class. A template name needs to be unique for that class and is case-sensitive. For example, when creating a PvP set for a lvl80 Restoration Druid `.templatenpc create Restoration80PvPS8`.
3. export to `.sql`
4. some manual changes are needed

The following entries are created in the `acore_characters` db:
a. `mod_npc_talent_template_gear`: gear for your class, spec and race. When exporting, modify the raceMask as needed. When creating spec set for multiple races, create a template for one race, export to sql then create template for a new race. Modify the raceMask as needed
b. `mod_npc_talent_template_talents`: no modifying needed
c. `mod_npc_talent_template_glyphs`: no modifying needed
d. `mod_npc_talent_template_index`: modify gossipText, actionId needs to be unique per spec. Gossip options are displayed according to their ID with the lowest ID at the top. You can override a column to re-use talents or glyphs or gear from another template. For example, talents and glyphs from `Restoration80PvP` can be re-used

`.templatenpc reload` to reload changes. Test with dropping `acore_characters.mod_npc_talent_template*` tables and updates from character db as needed
```sql
DELETE FROM acore_characters.updates WHERE name='npc_talent_template_data_1_80_pvp_s6.sql';
DELETE FROM acore_characters.updates WHERE name='npc_talent_template_data_2_70_pve_t6.sql';
DELETE FROM acore_characters.updates WHERE name='npc_talent_template.sql';
DROP TABLE IF EXISTS acore_characters.mod_npc_talent_template_gear;
DROP TABLE IF EXISTS acore_characters.mod_npc_talent_template_glyphs;
DROP TABLE IF EXISTS acore_characters.mod_npc_talent_template_index;
DROP TABLE IF EXISTS acore_characters.mod_npc_talent_template_talents;
```
19 changes: 16 additions & 3 deletions conf/npc_talent_template.conf.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
#
# NpcTalentTemplate.EnableResetTalents
# Description: Enables Gossip Option to reset talents
# Default: 0 - Disabled
# 1 - Enabled
# Default: 1 - Enabled
# 0 - Disabled
#

NpcTalentTemplate.EnableResetTalents = 0
NpcTalentTemplate.EnableResetTalents = 1

#
# NpcTalentTemplate.EnableRemoveAllGlyphs
Expand All @@ -31,3 +31,16 @@ NpcTalentTemplate.EnableRemoveAllGlyphs = 1
#

NpcTalentTemplate.EnableDestroyEquippedGear = 1

#
# NpcTalentTemplate.AllianceMount
# NpcTalentTemplate.HordeMount
# Description:
# Default: 51412 - BigBattleBear
# 43688 - AmaniWarBear
# 19902 - SwiftZulianTiger
# 0 - Disable
#

NpcTalentTemplate.AllianceMount = 51412
NpcTalentTemplate.HordeMount = 51412
2,473 changes: 30 additions & 2,443 deletions data/sql/db-characters/base/npc_talent_template.sql

Large diffs are not rendered by default.

2,465 changes: 2,465 additions & 0 deletions data/sql/db-characters/base/npc_talent_template_data_1_80_pvp_s6.sql

Large diffs are not rendered by default.

1,473 changes: 1,473 additions & 0 deletions data/sql/db-characters/base/npc_talent_template_data_2_70_pve_t6.sql

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions data/sql/db-world/base/npc_talent_template_command.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-- COMMAND
DELETE FROM `command` WHERE `name`='templatenpc reload';
DELETE FROM `command` WHERE `name` IN ('templatenpc reload', 'templatenpc create');
INSERT INTO `command` (`name`, `security`, `help`) VALUES
('templatenpc reload', 3, 'Syntax: .templatenpc reload\nType .templatenpc reload to reload Template NPC database changes');
('templatenpc reload', 3, 'Syntax: .templatenpc reload\nType .templatenpc reload to reload Template NPC database changes'),
('templatenpc create', 3, 'Syntax: .templatenpc create\nType .templatenpc create [name] to create a Template for your class with the desired name. This name is case-sensitive');
27 changes: 25 additions & 2 deletions data/sql/db-world/base/npc_talent_template_data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,43 @@
SET @ENTRY := 55009;
SET @NAME := 'Pick a spec';
SET @SUBNAME := 'AzerothCore Template';
SET @TEXT := 'Here you can select a character template which will gear up, gem up, set talent specialization, and set glyphs for your character instantly.';
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');
(@ENTRY, @NAME , @SUBNAME, 'Speak', 0, 80, 80, 35, 1, 1, 1.14286, 1, 0, 1, 2, 7, 138936390, 1, 2, 'npc_talent_template');

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.');
(@ENTRY, @TEXT, @TEXT);

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);

-- module string
SET @MODULE_STRING := 'npc-talent-template';
DELETE FROM `module_string` WHERE `module` = @module_string;
INSERT INTO `module_string` (`module`, `id`, `string`) VALUES
(@MODULE_STRING, 1, 'You need to remove all your equipped items in order to use this feature!'),
(@MODULE_STRING, 2, 'You have already spent some talent points. You need to reset your talents first!'),
(@MODULE_STRING, 3, 'Successfully equipped {} {} template!'),
(@MODULE_STRING, 4, 'Your equipped gear has been destroyed.'),
(@MODULE_STRING, 5, 'Your glyphs have been removed.'),
(@MODULE_STRING, 6, 'NYI: Copied character {} successfully'),
(@MODULE_STRING, 7, 'You have unspent talent points. Please spend all your talent points and re-extract the template.'),
(@MODULE_STRING, 8, 'Get glyphs and re-extract the template!'),
(@MODULE_STRING, 9, 'Template successfully created!'),
(@MODULE_STRING, 10, 'Template skeleton successfully created! You can `.templatenpc reload` to test your template. WARNING: Templates need to be manually exported to `.sql`. See documentation for more info.'),
(@MODULE_STRING, 11, 'Reloading templates for Template NPC table...'),
(@MODULE_STRING, 12, 'Template NPC templates reloaded.');

-- 'deDE', 'ruRU', 'ruRU', 'koKR', 'frFR', 'zhCN', 'zhTW', 'esES', 'esMX',
DELETE FROM `module_string_locale` WHERE `module` = @MODULE_STRING;
-- INSERT INTO `module_string_locale` (`module`, `id`, `locale`, `string`) VALUES
-- (@MODULE_STRING, 0 , 'deDE', ''),
Loading

0 comments on commit bf9fe9b

Please sign in to comment.