本文整理汇总了C++中Guild::GetBankMoney方法的典型用法代码示例。如果您正苦于以下问题:C++ Guild::GetBankMoney方法的具体用法?C++ Guild::GetBankMoney怎么用?C++ Guild::GetBankMoney使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Guild
的用法示例。
在下文中一共展示了Guild::GetBankMoney方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleGuildInfoCommand
static bool HandleGuildInfoCommand(ChatHandler* handler, char const* args)
{
Player* target;
uint32 guildId;
std::string guildName;
std::string guildMasterName;
Guild* guild;
if (!*args)
{
if (target = handler->getSelectedPlayer())
guild = target->GetGuild();
else
return false;
}
else if (guildId = atoi(args))
guild = sGuildMgr->GetGuildById(guildId);
else
{
char* tailStr = *args != '"' ? strtok(NULL, "") : (char*)args;
if (!tailStr)
return false;
char* guildStr = handler->extractQuotedArg((char*)args);
if (!guildStr)
return false;
guildName = guildStr;
guild = sGuildMgr->GetGuildByName(guildName);
}
if (!guild)
return false;
handler->PSendSysMessage(LANG_GUILD_INFO_NAME, guild->GetName().c_str(), guild->GetId());
if (sObjectMgr->GetPlayerNameByGUID(guild->GetLeaderGUID(), guildMasterName))
handler->PSendSysMessage(LANG_GUILD_INFO_GUILD_MASTER, guildMasterName.c_str(), guild->GetLeaderGUID());
char createdDateStr[20];
time_t createdDate = guild->GetCreatedDate();
strftime(createdDateStr, 20, "%Y-%m-%d %H:%M:%S", localtime(&createdDate));
handler->PSendSysMessage(LANG_GUILD_INFO_CREATION_DATE, createdDateStr);
handler->PSendSysMessage(LANG_GUILD_INFO_MEMBER_COUNT, guild->GetMemberCount());
handler->PSendSysMessage(LANG_GUILD_INFO_BANK_GOLD, guild->GetBankMoney() / 100 / 100);
handler->PSendSysMessage(LANG_GUILD_INFO_MOTD, guild->GetMOTD().c_str());
handler->PSendSysMessage(LANG_GUILD_INFO_EXTRA_INFO, guild->GetInfo().c_str());
return true;
}
示例2: HandleGuildInfoCommand
static bool HandleGuildInfoCommand(ChatHandler* handler, char const* args)
{
Guild* guild = nullptr;
if (args && args[0] != '\0')
{
if (isNumeric(args))
{
uint32 guildId = uint32(atoi(args));
guild = sGuildMgr->GetGuildById(guildId);
}
else
{
std::string guildName = args;
guild = sGuildMgr->GetGuildByName(guildName);
}
}
else if (Player* target = handler->getSelectedPlayerOrSelf())
guild = target->GetGuild();
if (!guild)
return false;
// Display Guild Information
handler->PSendSysMessage(LANG_GUILD_INFO_NAME, guild->GetName().c_str(), guild->GetId()); // Guild Id + Name
std::string guildMasterName;
if (sCharacterCache->GetCharacterNameByGuid(guild->GetLeaderGUID(), guildMasterName))
handler->PSendSysMessage(LANG_GUILD_INFO_GUILD_MASTER, guildMasterName.c_str(), guild->GetLeaderGUID().GetCounter()); // Guild Master
// Format creation date
char createdDateStr[20];
time_t createdDate = guild->GetCreatedDate();
tm localTm;
strftime(createdDateStr, 20, "%Y-%m-%d %H:%M:%S", localtime_r(&createdDate, &localTm));
handler->PSendSysMessage(LANG_GUILD_INFO_CREATION_DATE, createdDateStr); // Creation Date
handler->PSendSysMessage(LANG_GUILD_INFO_MEMBER_COUNT, guild->GetMemberCount()); // Number of Members
handler->PSendSysMessage(LANG_GUILD_INFO_BANK_GOLD, guild->GetBankMoney() / 100 / 100); // Bank Gold (in gold coins)
handler->PSendSysMessage(LANG_GUILD_INFO_MOTD, guild->GetMOTD().c_str()); // Message of the Day
handler->PSendSysMessage(LANG_GUILD_INFO_EXTRA_INFO, guild->GetInfo().c_str()); // Extra Information
return true;
}