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

CreatureTemplate/GameObjectTemplate ID's are partially hardcoded #44

Open
dedmen opened this issue Oct 31, 2023 · 0 comments · May be fixed by #45
Open

CreatureTemplate/GameObjectTemplate ID's are partially hardcoded #44

dedmen opened this issue Oct 31, 2023 · 0 comments · May be fixed by #45

Comments

@dedmen
Copy link

dedmen commented Oct 31, 2023

First up, thank you for putting down this note
https://github.com/azerothcore/mod-guildhouse/blob/master/sql/world/creatures_objects.sql#L16C26-L16C26

I indeed would have a conflict in my database.
But while there is a note and its easy to fix the database ID's.
The ID's are still hardcoded on C++ side

if (player->GetTeamId() == TEAM_ALLIANCE)
{
// Portal to Stormwind
entry = 500000;
}
else
{
// Portal to Orgrimmar
entry = 500004;
}

uint32 entry = 500031;

AddGossipItemFor(player, GOSSIP_ICON_TALK, "Spawn Innkeeper", GOSSIP_SENDER_MAIN, 500032, "Add an Innkeeper?", GuildHouseInnKeeper, false);

if (player->GetTeamId() == TEAM_ALLIANCE)
{
// ALLIANCE players get these options
AddGossipItemFor(player, GOSSIP_ICON_TAXI, "Portal: Ironforge", GOSSIP_SENDER_MAIN, 500003, "Add Ironforge Portal?", GuildHousePortal, false);
AddGossipItemFor(player, GOSSIP_ICON_TAXI, "Portal: Darnassus", GOSSIP_SENDER_MAIN, 500001, "Add Darnassus Portal?", GuildHousePortal, false);
AddGossipItemFor(player, GOSSIP_ICON_TAXI, "Portal: Exodar", GOSSIP_SENDER_MAIN, 500002, "Add Exodar Portal?", GuildHousePortal, false);
}
else
{
// HORDE players get these options
AddGossipItemFor(player, GOSSIP_ICON_TAXI, "Portal: Undercity", GOSSIP_SENDER_MAIN, 500007, "Add Undercity Portal?", GuildHousePortal, false);
AddGossipItemFor(player, GOSSIP_ICON_TAXI, "Portal: Thunderbluff", GOSSIP_SENDER_MAIN, 500006, "Add Thunderbuff Portal?", GuildHousePortal, false);
AddGossipItemFor(player, GOSSIP_ICON_TAXI, "Portal: Silvermoon", GOSSIP_SENDER_MAIN, 500005, "Add Silvermoon Portal?", GuildHousePortal, false);
}
// These two portals work for either Team
AddGossipItemFor(player, GOSSIP_ICON_TAXI, "Portal: Shattrath", GOSSIP_SENDER_MAIN, 500008, "Add Shattrath Portal?", GuildHousePortal, false);
AddGossipItemFor(player, GOSSIP_ICON_TAXI, "Portal: Dalaran", GOSSIP_SENDER_MAIN, 500009, "Add Dalaran Portal?", GuildHousePortal, false);

case 500032: // Innkeeper

case 500001: // Darnassus Portal
case 500002: // Exodar Portal
case 500003: // Ironforge Portal
case 500005: // Silvermoon Portal
case 500006: // Thunder Bluff Portal
case 500007: // Undercity Portal
case 500008: // Shattrath Portal
case 500009: // Dalaran Portal

There should be a config option for the Base ID so when it needs to be changed, you don't need to make over a dozen small edits in multiple c++ files.
Or atleast a #define/constant in C++ so that only one place needs to be changed

@pangolp pangolp linked a pull request Apr 8, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant