本文整理汇总了C++中PlayerCreature::isAdvanced方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerCreature::isAdvanced方法的具体用法?C++ PlayerCreature::isAdvanced怎么用?C++ PlayerCreature::isAdvanced使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerCreature
的用法示例。
在下文中一共展示了PlayerCreature::isAdvanced方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: executeOpSwapAdvancementItem
void CGShopRequestSellHandler::executeOpSwapAdvancementItem(CGShopRequestSell* pPacket, Player* pPlayer)
throw(ProtocolException, Error)
{
__BEGIN_TRY
#ifdef __GAME_SERVER__
ObjectID_t NPCID = pPacket->getObjectID();
ObjectID_t ITEMOID = pPacket->getItemObjectID();
GamePlayer* pGamePlayer = dynamic_cast<GamePlayer*>(pPlayer);
Creature* pCreature = pGamePlayer->getCreature();
PlayerCreature* pPC = dynamic_cast<PlayerCreature*>(pCreature);
if (!pPC->isAdvanced() )
{
return sendFailPacket(pPacket, pPlayer);
}
Zone* pZone = pPC->getZone();
if (pZone == NULL) return sendFailPacket(pPacket, pPlayer);
Creature* pNPCBase = pZone->getCreature(NPCID);
if (pNPCBase == NULL || !pNPCBase->isNPC()) return sendFailPacket(pPacket, pPlayer);
NPC* pNPC = dynamic_cast<NPC*>(pNPCBase);
Inventory* pInventory = pPC->getInventory();
Item* pItem = pInventory->getItemWithObjectID(ITEMOID);
if (pItem == NULL || pItem->isTimeLimitItem() )
{
return sendFailPacket(pPacket, pPlayer);
}
Item::ItemClass iClass = Item::ITEM_CLASS_MAX;
ItemType_t iType = 0;
Grade_t iGrade = 0;
FlagSetType fType = FLAGSET_MAX;
ItemInfo* pItemInfo = g_pItemInfoManager->getItemInfo(pItem->getItemClass(), pItem->getItemType());
Assert(pItemInfo!=NULL);
switch (pItem->getItemClass() )
{
case Item::ITEM_CLASS_SWORD:
case Item::ITEM_CLASS_BLADE:
case Item::ITEM_CLASS_AR:
case Item::ITEM_CLASS_SR:
case Item::ITEM_CLASS_SG:
case Item::ITEM_CLASS_SMG:
{
switch (pItem->getItemType() )
{
case 9:
{
iClass = pItem->getItemClass();
iType = 14;
iGrade = 2;
break;
}
case 11:
{
iClass = pItem->getItemClass();
iType = 14;
iGrade = 4;
break;
}
case 12:
{
iClass = pItem->getItemClass();
iType = 14;
iGrade = 6;
break;
}
case 13:
{
iClass = pItem->getItemClass();
iType = 14;
iGrade = 8;
break;
}
default:
break;
}
if (iClass == Item::ITEM_CLASS_SG ) iClass = Item::ITEM_CLASS_SR;
if (iClass == Item::ITEM_CLASS_SMG ) iClass = Item::ITEM_CLASS_AR;
break;
}
case Item::ITEM_CLASS_CROSS:
case Item::ITEM_CLASS_MACE:
{
switch (pItem->getItemType() )
{
case 7:
{
iClass = pItem->getItemClass();
iType = 12;
iGrade = 2;
break;
}
case 9:
//.........这里部分代码省略.........