本文整理汇总了C++中ArenaTeam::GetStats方法的典型用法代码示例。如果您正苦于以下问题:C++ ArenaTeam::GetStats方法的具体用法?C++ ArenaTeam::GetStats怎么用?C++ ArenaTeam::GetStats使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArenaTeam
的用法示例。
在下文中一共展示了ArenaTeam::GetStats方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnGossipSelect
bool OnGossipSelect(Player* player, Creature* me, uint32 /*uiSender*/, uint32 uiAction)
{
if(!player || !me)
return true;
player->PlayerTalkClass->ClearMenus();
switch (uiAction)
{
case 1: // Create new Arenateam
{
// if(sWorld->getIntConfig(CONFIG_ARENA_1V1_MIN_LEVEL) <= player->getLevel())
{
// if(player->GetMoney() >= sWorld->getIntConfig(CONFIG_ARENA_1V1_COSTS) && CreateArenateam(player, me))
// player->ModifyMoney(sWorld->getIntConfig(CONFIG_ARENA_1V1_COSTS) * -1);
}
// else
{
// ChatHandler(player->GetSession()).PSendSysMessage("You need level %u+ to create an 1v1 arenateam.", sWorld->getIntConfig(CONFIG_ARENA_1V1_MIN_LEVEL));
player->CLOSE_GOSSIP_MENU();
return true;
}
}
break;
case 2: // Join Queue Arena (rated)
{
// if(Arena1v1CheckTalents(player) && JoinQueueArena(player, me, true) == false)
ChatHandler(player->GetSession()).SendSysMessage("Something went wrong while join queue.");
player->CLOSE_GOSSIP_MENU();
return true;
}
break;
case 20: // Join Queue Arena (unrated)
{
if(Arena1v1CheckTalents(player) && JoinQueueArena(player, me, false) == false)
ChatHandler(player->GetSession()).SendSysMessage("Something went wrong while join queue.");
player->CLOSE_GOSSIP_MENU();
return true;
}
break;
case 3: // Leave Queue
{
WorldPacket Data;
Data << (uint8)0x1 << (uint8)0x0 << (uint32)BATTLEGROUND_AA << (uint16)0x0 << (uint8)0x0;
player->GetSession()->HandleBattleFieldPortOpcode(Data);
player->CLOSE_GOSSIP_MENU();
return true;
}
break;
case 4: // get statistics
{
ArenaTeam* at = sArenaTeamMgr->GetArenaTeamById(player->GetArenaTeamId(ArenaTeam::GetSlotByType(ARENA_TEAM_5v5)));
if(at)
{
std::stringstream s;
s << "Rating: " << at->GetStats().Rating;
s << "\nRank: " << at->GetStats().Rank;
s << "\nSeason Games: " << at->GetStats().SeasonGames;
s << "\nSeason Wins: " << at->GetStats().SeasonWins;
s << "\nWeek Games: " << at->GetStats().WeekGames;
s << "\nWeek Wins: " << at->GetStats().WeekWins;
ChatHandler(player->GetSession()).PSendSysMessage(s.str().c_str());
}
}
break;
case 5: // Disband arenateam
{
WorldPacket Data;
Data << (uint32)player->GetArenaTeamId(ArenaTeam::GetSlotByType(ARENA_TEAM_5v5));
player->GetSession()->HandleArenaTeamLeaveOpcode(Data);
ChatHandler(player->GetSession()).SendSysMessage("Arenateam deleted!");
player->CLOSE_GOSSIP_MENU();
return true;
}
break;
}
OnGossipHello(player, me);
return true;
}
示例2: OnGossipSelect
bool OnGossipSelect(Player* player, Creature* me, uint32 /*uiSender*/, uint32 uiAction)
{
player->PlayerTalkClass->ClearMenus();
switch (uiAction)
{
case 1: // Create new Arenateam
{
if(ARENA_1V1_MIN_LEVEL <= player->getLevel())
{
if(player->GetMoney() >= ARENA_1V1_COST && CreateArenateam(player, me))
player->ModifyMoney(-(int32)ARENA_1V1_COST);
}
else
{
ChatHandler(player->GetSession()).PSendSysMessage("You need level %u+ to create an 1v1 Arena Team.", ARENA_1V1_MIN_LEVEL);
player->CLOSE_GOSSIP_MENU();
return true;
}
}
break;
case 2: // Join Queue Arena
{
if(JoinQueueArena(player, me) == false)
ChatHandler(player->GetSession()).SendSysMessage("Something went wrong while join queue.");
player->CLOSE_GOSSIP_MENU();
return true;
}
break;
case 3: // Leave Queue
{
WorldPacket Data;
Data << (uint8)0x1 << (uint8)0x0 << (uint32)BATTLEGROUND_AA << (uint16)0x0 << (uint8)0x0;
player->GetSession()->HandleBattleFieldPortOpcode(Data);
player->CLOSE_GOSSIP_MENU();
return true;
}
break;
case 4: // get statistics
{
ArenaTeam* at = sArenaTeamMgr->GetArenaTeamById(player->GetArenaTeamId(ArenaTeam::GetSlotByType(ARENA_TEAM_1v1)));
if(at)
{
std::stringstream s;
s << "Rating: " << at->GetStats().Rating;
s << "\nRank: " << at->GetStats().Rank;
s << "\nSeason Games: " << at->GetStats().SeasonGames;
s << "\nSeason Wins: " << at->GetStats().SeasonWins;
s << "\nWeek Games: " << at->GetStats().WeekGames;
s << "\nWeek Wins: " << at->GetStats().WeekWins;
ChatHandler(player->GetSession()).PSendSysMessage(s.str().c_str());
}
}
break;
case 5: // Disband arenateam
{
WorldPacket Data;
Data << (uint32)player->GetArenaTeamId(ArenaTeam::GetSlotByType(ARENA_TEAM_1v1));
player->GetSession()->HandleArenaTeamLeaveOpcode(Data);
ChatHandler(player->GetSession()).PSendSysMessage("Arena team deleted!");
player->CLOSE_GOSSIP_MENU();
return true;
}
break;
case 8: // Script Info
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Click on Create new 1v1 Arena team", GOSSIP_SENDER_MAIN, uiAction);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Join 1v1 Arena and ready!", GOSSIP_SENDER_MAIN, uiAction);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Enjoy!", GOSSIP_SENDER_MAIN, uiAction);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "<- Back", GOSSIP_SENDER_MAIN, 7);
player->SEND_GOSSIP_MENU(68, me->GetGUID());
return true;
}
break;
}
OnGossipHello(player, me);
return true;
}