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

fix: Areatrigger fmt shows as "{} {}" #52

Merged
merged 3 commits into from
Dec 20, 2024
Merged
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
20 changes: 9 additions & 11 deletions src/npc_talent_template.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,12 @@ void sTemplateNPC::RemoveAllGlyphs(Player* player)
for (uint8 i = 0; i < MAX_GLYPH_SLOT_INDEX; ++i)
if (uint32 glyph = player->GetGlyph(i))
if (GlyphPropertiesEntry const* gp = sGlyphPropertiesStore.LookupEntry(glyph))
{
if (GlyphSlotEntry const* gs = sGlyphSlotStore.LookupEntry(player->GetGlyphSlot(i)))
if (sGlyphSlotStore.LookupEntry(player->GetGlyphSlot(i)))
{
player->RemoveAurasDueToSpell(gp->SpellId);
player->SetGlyph(i, 0, true);
player->SendTalentsInfoData(false); // this is somewhat an in-game glyph realtime update (apply/remove)
}
}
}

void sTemplateNPC::LearnTemplateTalents(Player* player, const std::string& sTalents)
Expand Down Expand Up @@ -304,7 +302,7 @@ void sTemplateNPC::ExtractTalentTemplateToDB(Player* player, const std::string&

if (player->GetFreeTalentPoints() > 0)
{
player->GetSession()->SendAreaTriggerMessage("%s", player->GetSession()->GetModuleString(MODULE_STRING, ERROR_NPC_TALENT_TEMPLATE_EXTRACT_MUST_SPEND_ALL_TALENT_POINTS)->c_str());
player->GetSession()->SendAreaTriggerMessage(player->GetSession()->GetModuleString(MODULE_STRING, ERROR_NPC_TALENT_TEMPLATE_EXTRACT_MUST_SPEND_ALL_TALENT_POINTS)->c_str());
ChatHandler(player->GetSession()).PSendModuleSysMessage(MODULE_STRING, ERROR_NPC_TALENT_TEMPLATE_EXTRACT_MUST_SPEND_ALL_TALENT_POINTS);
return;
}
Expand All @@ -324,7 +322,7 @@ void sTemplateNPC::ExtractGlyphsTemplateToDB(Player* player, const std::string&

if (!result)
{
player->GetSession()->SendAreaTriggerMessage("%s", player->GetSession()->GetModuleString(MODULE_STRING, ERROR_NPC_TALENT_TEMPLATE_EXTRACT_GET_GLYPHS)->c_str());
player->GetSession()->SendAreaTriggerMessage(player->GetSession()->GetModuleString(MODULE_STRING, ERROR_NPC_TALENT_TEMPLATE_EXTRACT_GET_GLYPHS)->c_str());
ChatHandler(player->GetSession()).PSendModuleSysMessage(MODULE_STRING, ERROR_NPC_TALENT_TEMPLATE_EXTRACT_GET_GLYPHS);
return;
}
Expand Down Expand Up @@ -408,13 +406,13 @@ void sTemplateNPC::ApplyTemplate(Player* player, IndexTemplate* indexTemplate)
bool canApply = true;
if ((flag & TEMPLATE_APPLY_GEAR) && sTemplateNpcMgr->IsWearingAnyGear(player))
{
player->GetSession()->SendAreaTriggerMessage("%s", player->GetSession()->GetModuleString(MODULE_STRING, ERROR_NPC_TALENT_TEMPLATE_MUST_REMOVE_EQUIPPED)->c_str());
player->GetSession()->SendAreaTriggerMessage(player->GetSession()->GetModuleString(MODULE_STRING, ERROR_NPC_TALENT_TEMPLATE_MUST_REMOVE_EQUIPPED)->c_str());
ChatHandler(player->GetSession()).PSendModuleSysMessage(MODULE_STRING, ERROR_NPC_TALENT_TEMPLATE_MUST_REMOVE_EQUIPPED);
canApply = false;
}
if ((flag & TEMPLATE_APPLY_TALENTS) && sTemplateNpcMgr->HasSpentTalentPoints(player))
{
player->GetSession()->SendAreaTriggerMessage("%s", player->GetSession()->GetModuleString(MODULE_STRING, ERROR_NPC_TALENT_TEMPLATE_MUST_RESET_TALENTS)->c_str());
player->GetSession()->SendAreaTriggerMessage(player->GetSession()->GetModuleString(MODULE_STRING, ERROR_NPC_TALENT_TEMPLATE_MUST_RESET_TALENTS)->c_str());
ChatHandler(player->GetSession()).PSendModuleSysMessage(MODULE_STRING, ERROR_NPC_TALENT_TEMPLATE_MUST_RESET_TALENTS);
canApply = false;
}
Expand Down Expand Up @@ -467,7 +465,7 @@ void sTemplateNPC::ApplyTemplate(Player* player, IndexTemplate* indexTemplate)
if (!player->HasSpell(SPELL_LEARN_A_SECOND_TALENT_SPECIALIZATION))
player->CastSpell(player, SPELL_LEARN_A_SECOND_TALENT_SPECIALIZATION, player->GetGUID());

player->GetSession()->SendAreaTriggerMessage(player->GetSession()->GetModuleString(MODULE_STRING, SUCCESS_NPC_TALENT_TEMPLATE_EQUIPPED_TEMPLATE)->c_str(), sTemplateNpcMgr->GetClassString(player).c_str(), indexTemplate->playerSpec.c_str());
player->GetSession()->SendAreaTriggerMessage(player->GetSession()->GetModuleString(MODULE_STRING, SUCCESS_NPC_TALENT_TEMPLATE_EQUIPPED_TEMPLATE)->c_str(), sTemplateNpcMgr->GetClassString(player), indexTemplate->playerSpec);
}

class npc_talent_template : public CreatureScript
Expand Down Expand Up @@ -527,7 +525,7 @@ class npc_talent_template : public CreatureScript

case GOSSIP_ACTION_RESET_REMOVE_GLYPHS:
sTemplateNpcMgr->RemoveAllGlyphs(player);
player->GetSession()->SendAreaTriggerMessage("%s", player->GetSession()->GetModuleString(MODULE_STRING, SUCCESS_NPC_TALENT_TEMPLATE_REMOVED_GLYPHS)->c_str());
player->GetSession()->SendAreaTriggerMessage(player->GetSession()->GetModuleString(MODULE_STRING, SUCCESS_NPC_TALENT_TEMPLATE_REMOVED_GLYPHS)->c_str());
CloseGossipMenuFor(player);
break;

Expand All @@ -554,7 +552,7 @@ class npc_talent_template : public CreatureScript
player->DestroyItem(INVENTORY_SLOT_BAG_0, i, true);
}
player->SaveToDB(false, false);
player->GetSession()->SendAreaTriggerMessage("%s", player->GetSession()->GetModuleString(MODULE_STRING, SUCCESS_NPC_TALENT_TEMPLATE_DESTROYED_EQUIPPED_GEAR)->c_str());
player->GetSession()->SendAreaTriggerMessage(player->GetSession()->GetModuleString(MODULE_STRING, SUCCESS_NPC_TALENT_TEMPLATE_DESTROYED_EQUIPPED_GEAR)->c_str());
CloseGossipMenuFor(player);
break;

Expand Down Expand Up @@ -601,7 +599,7 @@ class npc_talent_template_command : public CommandScript
sTemplateNpcMgr->ExtractTalentTemplateToDB(player, specName);
sTemplateNpcMgr->ExtractGlyphsTemplateToDB(player, specName);
sTemplateNpcMgr->InsertIndexEntryToDB(player, specName);
player->GetSession()->SendAreaTriggerMessage("%s", player->GetSession()->GetModuleString(MODULE_STRING, SUCCESS_NPC_TALENT_TEMPLATE_EXTRACT)->c_str());
player->GetSession()->SendAreaTriggerMessage(player->GetSession()->GetModuleString(MODULE_STRING, SUCCESS_NPC_TALENT_TEMPLATE_EXTRACT)->c_str());
ChatHandler(player->GetSession()).PSendModuleSysMessage(MODULE_STRING, SUCCESS_NPC_TALENT_TEMPLATE_EXTRACT_INFO);
return true;
}
Expand Down
Loading