本文整理汇总了C++中PlayerCreature::initAllStatAndSend方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerCreature::initAllStatAndSend方法的具体用法?C++ PlayerCreature::initAllStatAndSend怎么用?C++ PlayerCreature::initAllStatAndSend使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerCreature
的用法示例。
在下文中一共展示了PlayerCreature::initAllStatAndSend方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: unaffect
void EffectIntimateGrail::unaffect(Creature* pCreature)
throw(Error)
{
__BEGIN_TRY
//cout << "EffectIntimateGrail" << "unaffect BEGIN" << endl;
Assert(pCreature != NULL);
pCreature->removeFlag(Effect::EFFECT_CLASS_INTIMATE_GRAIL);
if (pCreature->isPC() )
{
PlayerCreature* pPC = dynamic_cast<PlayerCreature*>(pCreature);
pPC->initAllStatAndSend();
}
// pSlayer->initAllStatAndSend();
Zone* pZone = pCreature->getZone();
Assert(pZone != NULL);
GCRemoveEffect gcRemoveEffect;
gcRemoveEffect.setObjectID(pCreature->getObjectID());
gcRemoveEffect.addEffectList(Effect::EFFECT_CLASS_INTIMATE_GRAIL);
pZone->broadcastPacket(pCreature->getX(), pCreature->getY(), &gcRemoveEffect);
//cout << "EffectIntimateGrail" << "unaffect END" << endl;
__END_CATCH
}
示例2: executeNormal
//.........这里部分代码省略.........
// 걸어다니는 크리쳐를 검색
if (tile.hasCreature(Creature::MOVE_MODE_WALKING))
{
pNearCreature = tile.getCreature(Creature::MOVE_MODE_WALKING);
if (pNearCreature == NULL) continue;
// 방금 물건을 판 플레이어라면 생략
if (pNearCreature->getObjectID() == pPC->getObjectID()) continue;
// 만약 플레이어라면 패킷을 보내준다.
if (pNearCreature->isPC())
{
pNearPlayer = pNearCreature->getPlayer();
if (pNearPlayer == NULL) continue;
pNearPlayer->sendPacket(&boughtpkt);
}
}
// 날아다니는 크리쳐를 검색
if (tile.hasCreature(Creature::MOVE_MODE_FLYING))
{
pNearCreature = tile.getCreature(Creature::MOVE_MODE_FLYING);
if (pNearCreature == NULL) continue;
// 방금 물건을 판 플레이어라면 생략
if (pNearCreature->getObjectID() == pPC->getObjectID()) continue;
// 만약 플레이어라면 패킷을 보내준다.
if (pNearCreature->isPC())
{
pNearPlayer = pNearCreature->getPlayer();
if (pNearPlayer == NULL) continue;
pNearPlayer->sendPacket(&boughtpkt);
}
}
} // end of for (ZoneCoord_t zy=CenterY-5; zy<=CenterY+5; zy++)
} // end of for (ZoneCoord_t zx=CenterX-5; zx<=CenterX+5; zx++)
}
catch (Throwable & t)
{
filelog("shopbug_packet.log", "%s", t.toString().c_str());
}
} // if (index < SHOP_RACK_INDEX_MAX)
else
{
SAFE_DELETE(pItem);
}
} // if (pItem->getOptionType() != 0)
else
{
bSpecialItem = false;
SAFE_DELETE(pItem);
}
// 물건을 산 플레이어에게 GCShopSellOK를...보낸다.
GCShopSellOK okpkt;
okpkt.setObjectID(NPCID);
if (bSpecialItem) okpkt.setShopVersion(pNPC->getShopVersion(SHOP_RACK_SPECIAL));
else okpkt.setShopVersion(pNPC->getShopVersion(SHOP_RACK_NORMAL));
okpkt.setItemObjectID(ITEMOID);
//okpkt.setPrice(playerMoney+itemPrice);
// playerMoney + itemPrice 가 MAX_MONEY를 넘어갈 수 있다.
// 2003.1.8 by bezz
okpkt.setPrice(pPC->getGold());
pPlayer->sendPacket(&okpkt);
if (bClearDefaultOptionTypes )
{
pPC->clearDefaultOptionTypes();
pPC->initAllStatAndSend();
if (pPC->isSlayer() )
{
Slayer* pSlayer = dynamic_cast<Slayer*>(pPC);
Assert(pSlayer != NULL);
pSlayer->sendRealWearingInfo();
}
else if (pPC->isVampire() )
{
Vampire* pVampire = dynamic_cast<Vampire*>(pPC);
Assert(pVampire != NULL);
pVampire->sendRealWearingInfo();
}
else if (pPC->isOusters() )
{
Ousters* pOusters = dynamic_cast<Ousters*>(pPC);
Assert(pOusters != NULL);
pOusters->sendRealWearingInfo();
}
}
#endif
__END_DEBUG_EX __END_CATCH
}