Code:
case GOSSIP_ACTION_INFO_DEF+18: //Dungeons
gGossipText = 80407;
if (pPlayerLevel >=10)
{
gGossipText = 80403;
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_BATTLE, GOSSIP_ITEM_90, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+90); // Azeroth Dungeons
}
if (pPlayerLevel >=58)
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_BATTLE, GOSSIP_ITEM_95, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+95); // Outland Dungeons
}
if (pPlayerLevel >=68)
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_BATTLE, GOSSIP_ITEM_100, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+90); // Northrend Dungeons
}
if (pPlayerLevel >=60)
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_BATTLE, GOSSIP_ITEM_105, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+105); // Raid Dungeons
}
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, GOSSIP_ITEM_998, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+10); // Previous Menu
pPlayer->PlayerTalkClass->SendGossipMenu(gGossipText, pCreature->GetGUID());
break;
I have been fighting with this section all day and cant figure it out. My code compiles with 0 errors.
When a player is level 10 or higher and chooses 'Dungeons' from the gossip menu, a new menu comes up with the correct selections and the correct npc greeting text is displayed. This part works as intended.
When a player is level 9 or lower and chooses 'Dungeons' the menu doesnt change. What is it supposed to do is go to a new menu with the (database npc_text entry 80407 = "You must reach level 10 before you can port to any dungeons") greeting and then only the 'Previous Menu" gossip item option.
This is not happening. I have tried adding brackets to the entire case, pPlayerLevel < 10, else if statements, and have ran cmake again.
This is an all-in-one npc script and is pretty big. I have several if's in the other case statements and they all work flawless except for this one.
I understand It is possible to do this in the database and I know there are other All-In-One NPC's that I can download but those choices wont help me learn the code.
EDIT _ _ _ _
I discovered that you have to have add at least 2 gossip items to the menu or it wont show up. To solve this I just added an additional option to return to the main menu and now it works.
This topic can be closed.