本文整理汇总了C++中SkillInfo::getElementalDomain方法的典型用法代码示例。如果您正苦于以下问题:C++ SkillInfo::getElementalDomain方法的具体用法?C++ SkillInfo::getElementalDomain怎么用?C++ SkillInfo::getElementalDomain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkillInfo
的用法示例。
在下文中一共展示了SkillInfo::getElementalDomain方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
void CGDownSkillHandler::execute (CGDownSkill* pPacket , Player* pPlayer)
throw(ProtocolException, 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);
SkillType_t targetSkillType = pPacket->getSkillType();
GCDownSkillFailed failpkt;
failpkt.setSkillType(targetSkillType);
if (!pPC->isOusters() )
{
failpkt.setDesc(NOT_OUSTERS);
pPlayer->sendPacket(&failpkt);
return;
}
Ousters* pOusters = dynamic_cast<Ousters*>(pPC);
Assert(pOusters != NULL);
OustersSkillSlot* pTargetSkillSlot = pOusters->getSkill(targetSkillType);
if (pTargetSkillSlot == NULL )
{
failpkt.setDesc(HAVE_NOT_SKILL);
pPlayer->sendPacket(&failpkt);
return;
}
SkillInfo* pTargetSkillInfo = NULL;
try
{
pTargetSkillInfo = g_pSkillInfoManager->getSkillInfo(targetSkillType);
}
catch(Exception& e)
{
failpkt.setDesc(INVALID_SKILL);
pPlayer->sendPacket(&failpkt);
return;
}
if (pTargetSkillSlot->getExpLevel() <= 1 )
{
if (!pTargetSkillInfo->canDelete() )
{
failpkt.setDesc(TOO_LOW);
pPlayer->sendPacket(&failpkt);
return;
}
list<SkillType_t>& rRequiredSkills = pTargetSkillInfo->getRequiredSkills();
list<SkillType_t>::iterator itr = rRequiredSkills.begin();
for (; itr != rRequiredSkills.end(); ++itr )
{
if (pOusters->hasSkill(*itr) != NULL )
{
bool canDrop = false;
SkillInfo* pFollowingSkillInfo = g_pSkillInfoManager->getSkillInfo(*itr);
list<SkillType_t>& rRequireSkills = pFollowingSkillInfo->getRequireSkills();
list<SkillType_t>::iterator itr2 = rRequireSkills.begin();
for (; itr2 != rRequireSkills.end(); ++itr2 )
{
if ((*itr2) != targetSkillType && pOusters->hasSkill(*itr2) != NULL )
{
SkillInfo* pAlternativeSkillInfo = g_pSkillInfoManager->getSkillInfo(*itr2);
if (getSkillMapID((ElementalDomain)pAlternativeSkillInfo->getElementalDomain()) == getSkillMapID((ElementalDomain)pTargetSkillInfo->getElementalDomain()) )
canDrop = true;
}
}
if (!canDrop )
{
failpkt.setDesc(CANNOT_DROP_SKILL);
pPlayer->sendPacket(&failpkt);
return;
}
}
}
}
/* if (pTargetSkillSlot->getExpLevel() >= 30 )
{
failpkt.setDesc(TOO_HIGH);
pPlayer->sendPacket(&failpkt);
return;
}*/
//.........这里部分代码省略.........