本文整理汇总了C++中PlayerCreature::getZoneID方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerCreature::getZoneID方法的具体用法?C++ PlayerCreature::getZoneID怎么用?C++ PlayerCreature::getZoneID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerCreature
的用法示例。
在下文中一共展示了PlayerCreature::getZoneID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
void CGModifyTaxRatioHandler::execute (CGModifyTaxRatio* pPacket , Player* pPlayer)
throw(Error)
{
__BEGIN_TRY __BEGIN_DEBUG_EX
#ifdef __GAME_SERVER__
Assert(pPacket != NULL);
Assert(pPlayer != NULL);
GamePlayer* pGamePlayer = dynamic_cast<GamePlayer*>(pPlayer);
Assert(pGamePlayer != NULL);
PlayerCreature* pPC = dynamic_cast<PlayerCreature*>(pGamePlayer->getCreature());
Assert(pPC != NULL);
#ifdef __OLD_GUILD_WAR__
GCSystemMessage gcSM;
gcSM.setMessage("아직 지원되지 않는 기능입니다.");
pGamePlayer->sendPacket(&gcSM);
return;
#endif
GuildID_t guildID = pPC->getGuildID();
list<CastleInfo*> pCastleInfoList = g_pCastleInfoManager->getGuildCastleInfos(guildID);
if (pCastleInfoList.empty() )
{
GCNPCResponse fail;
fail.setCode(NPC_RESPONSE_MODIFY_TAX_RATIO_FAIL);
pGamePlayer->sendPacket(&fail);
return;
}
bool bOwner = false;
list<CastleInfo*>::iterator itr = pCastleInfoList.begin();
CastleInfo* pCastleInfo = NULL;
for (; itr != pCastleInfoList.end() ; itr++ )
{
if ((*itr)->getZoneID() == pPC->getZoneID() )
{
pCastleInfo = (*itr);
bOwner = true;
break;
}
}
if (!g_pGuildManager->isGuildMaster(guildID, pPC ) // 길드 마스터가 아니다.
|| !bOwner // 이 플레이어의 길드가 점령한 성이 아니다.
|| pPacket->getRatio() > 10
)
{
GCNPCResponse fail;
fail.setCode(NPC_RESPONSE_MODIFY_TAX_RATIO_FAIL);
pGamePlayer->sendPacket(&fail);
return;
}
g_pCastleInfoManager->setItemTaxRatio(pPC->getZone(), pPacket->getRatio()+100);
GCNPCResponse ok;
ok.setCode(NPC_RESPONSE_MODIFY_TAX_RATIO_OK);
pGamePlayer->sendPacket(&ok);
#endif // __GAME_SERVER__
__END_DEBUG_EX __END_CATCH
}