本文整理汇总了C++中GossipMenu::GetItem方法的典型用法代码示例。如果您正苦于以下问题:C++ GossipMenu::GetItem方法的具体用法?C++ GossipMenu::GetItem怎么用?C++ GossipMenu::GetItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GossipMenu
的用法示例。
在下文中一共展示了GossipMenu::GetItem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnGossipSelect
void Creature::OnGossipSelect(Player* player, uint32 option)
{
GossipMenu* gossipmenu = player->PlayerTalkClass->GetGossipMenu();
uint32 action=gossipmenu->GetItem(option).m_gAction;
uint32 zoneid=GetZoneId();
uint64 guid=GetGUID();
GossipOption const *gossip=GetGossipOption( action );
uint32 textid;
if(!gossip)
{
zoneid=0;
gossip=GetGossipOption( action );
if(!gossip)
return;
}
textid=GetGossipTextId( action, zoneid);
if(textid==0)
textid=GetNpcTextId();
switch (gossip->Action)
{
case GOSSIP_OPTION_GOSSIP:
player->PlayerTalkClass->SendTalking( textid );
break;
case GOSSIP_OPTION_SPIRITHEALER:
if( player->isDead() )
player->GetSession()->SendSpiritResurrect();
break;
case GOSSIP_OPTION_QUESTGIVER:
player->PrepareQuestMenu( guid );
player->SendPreparedQuest( guid );
break;
case GOSSIP_OPTION_VENDOR:
case GOSSIP_OPTION_ARMORER:
player->GetSession()->SendListInventory(guid);
break;
case GOSSIP_OPTION_STABLEPET:
player->GetSession()->SendStablePet(guid);
break;
case GOSSIP_OPTION_TRAINER:
player->GetSession()->SendTrainerList(guid);
break;
case GOSSIP_OPTION_UNLEARNTALENTS:
player->PlayerTalkClass->CloseGossip();
player->SendTalentWipeConfirm(guid);
break;
case GOSSIP_OPTION_TAXIVENDOR:
player->GetSession()->SendTaxiMenu(guid);
break;
case GOSSIP_OPTION_INNKEEPER:
player->PlayerTalkClass->CloseGossip();
player->SetBindPoint( guid );
break;
case GOSSIP_OPTION_BANKER:
player->GetSession()->SendShowBank( guid );
break;
case GOSSIP_OPTION_PETITIONER:
case GOSSIP_OPTION_TABARDVENDOR:
player->GetSession()->SendTabardVendorActivate( guid );
break;
case GOSSIP_OPTION_AUCTIONEER:
player->GetSession()->SendAuctionHello( guid, this );
break;
case GOSSIP_OPTION_GUARD:
case GOSSIP_GUARD_SPELLTRAINER:
case GOSSIP_GUARD_SKILLTRAINER:
prepareGossipMenu( player,gossip->Id );
sendPreparedGossip( player );
break;
default:
OnPoiSelect( player, gossip );
break;
}
}