本文整理汇总了C++中SkillInfo::getLevel方法的典型用法代码示例。如果您正苦于以下问题:C++ SkillInfo::getLevel方法的具体用法?C++ SkillInfo::getLevel怎么用?C++ SkillInfo::getLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkillInfo
的用法示例。
在下文中一共展示了SkillInfo::getLevel方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
//////////////////////////////////////////////////////////////////////////////
// 뱀파이어 오브젝트 핸들러
//////////////////////////////////////////////////////////////////////////////
void Death::execute(Vampire* pVampire, ObjectID_t TargetObjectID, VampireSkillSlot* pSkillSlot, CEffectID_t CEffectID)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << "begin " << endl;
Assert(pVampire != NULL);
Assert(pSkillSlot != NULL);
try
{
Player* pPlayer = pVampire->getPlayer();
Zone* pZone = pVampire->getZone();
Assert(pPlayer != NULL);
Assert(pZone != NULL);
Creature* pTargetCreature = pZone->getCreature(TargetObjectID);
//Assert(pTargetCreature != NULL);
// NPC는 공격할 수 없다.
// 저주 면역. by sigi. 2002.9.13
// NoSuch제거. by sigi. 2002.5.2
if (pTargetCreature==NULL
|| pTargetCreature->isFlag(Effect::EFFECT_CLASS_IMMUNE_TO_CURSE)
|| !canAttack(pVampire, pTargetCreature )
|| pTargetCreature->isNPC())
{
executeSkillFailException(pVampire, getSkillType());
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " end " << endl;
return;
}
GCSkillToObjectOK1 _GCSkillToObjectOK1;
GCSkillToObjectOK2 _GCSkillToObjectOK2;
GCSkillToObjectOK3 _GCSkillToObjectOK3;
GCSkillToObjectOK4 _GCSkillToObjectOK4;
GCSkillToObjectOK5 _GCSkillToObjectOK5;
GCSkillToObjectOK6 _GCSkillToObjectOK6;
SkillType_t SkillType = pSkillSlot->getSkillType();
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);
// Knowledge of Curse 가 있다면 hit bonus 10
int HitBonus = 0;
if (pVampire->hasRankBonus(RankBonus::RANK_BONUS_KNOWLEDGE_OF_CURSE ) )
{
RankBonus* pRankBonus = pVampire->getRankBonus(RankBonus::RANK_BONUS_KNOWLEDGE_OF_CURSE);
Assert(pRankBonus != NULL);
HitBonus = pRankBonus->getPoint();
}
int RequiredMP = decreaseConsumeMP(pVampire, pSkillInfo);
bool bManaCheck = hasEnoughMana(pVampire, RequiredMP);
bool bTimeCheck = verifyRunTime(pSkillSlot);
bool bRangeCheck = verifyDistance(pVampire, pTargetCreature, pSkillInfo->getRange());
bool bHitRoll = HitRoll::isSuccessVampireCurse(pSkillInfo->getLevel(), pTargetCreature->getResist(MAGIC_DOMAIN_CURSE));
bool bHitRoll2 = HitRoll::isSuccessMagic(pVampire, pSkillInfo, pSkillSlot, HitBonus);
bool bCanHit = canHit(pVampire, pTargetCreature, SkillType);
bool bEffected = pTargetCreature->isFlag(Effect::EFFECT_CLASS_DEATH);
bool bPK = verifyPK(pVampire, pTargetCreature);
ZoneCoord_t targetX = pTargetCreature->getX();
ZoneCoord_t targetY = pTargetCreature->getY();
ZoneCoord_t myX = pVampire->getX();
ZoneCoord_t myY = pVampire->getY();
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && bHitRoll2 && bCanHit && !bEffected && bPK)
{
decreaseMana(pVampire, RequiredMP, _GCSkillToObjectOK1);
bool bCanSeeCaster = canSee(pTargetCreature, pVampire);
SkillInput input(pVampire);
SkillOutput output;
computeOutput(input, output);
// pTargetCreature가 저주마법을 반사하는 경우
if (CheckReflection(pVampire, pTargetCreature, getSkillType()))
{
pTargetCreature = (Creature*)pVampire;
TargetObjectID = pVampire->getObjectID();
}
Resist_t resist = pTargetCreature->getResist(MAGIC_DOMAIN_CURSE);
if ((resist*10/3) > output.Duration ) output.Duration=0;
else output.Duration -= resist*10/3;
if (output.Duration < 20 ) output.Duration = 20;
// 이펙트 오브젝트를 생성해 붙인다.
EffectDeath* pEffect = new EffectDeath(pTargetCreature);
pEffect->setDeadline(output.Duration);
pEffect->setLevel(pSkillInfo->getLevel()/2);
pEffect->setResistPenalty(output.Damage);
pTargetCreature->addEffect(pEffect);
//.........这里部分代码省略.........
示例2: execute
//////////////////////////////////////////////////////////////////////////////
// 뱀파이어 오브젝트 핸들러
//////////////////////////////////////////////////////////////////////////////
void DarkBluePoison::execute(Vampire* pVampire, ObjectID_t TargetObjectID, VampireSkillSlot* pVampireSkillSlot, CEffectID_t CEffectID)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << "begin " << endl;
Assert(pVampire != NULL);
Assert(pVampireSkillSlot != NULL);
try
{
Player* pPlayer = pVampire->getPlayer();
Zone* pZone = pVampire->getZone();
Assert(pPlayer != NULL);
Assert(pZone != NULL);
Creature* pTargetCreature = pZone->getCreature(TargetObjectID);
//Assert(pTargetCreature != NULL);
// NPC는 공격할 수가 없다.
// NoSuch제거. by sigi. 2002.5.2
if (pTargetCreature==NULL
|| !canAttack(pVampire, pTargetCreature )
|| pTargetCreature->isNPC())
{
executeSkillFailException(pVampire, getSkillType());
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " end " << endl;
return;
}
GCSkillToObjectOK1 _GCSkillToObjectOK1;
GCSkillToObjectOK2 _GCSkillToObjectOK2;
GCSkillToObjectOK3 _GCSkillToObjectOK3;
GCSkillToObjectOK4 _GCSkillToObjectOK4;
GCSkillToObjectOK5 _GCSkillToObjectOK5;
GCSkillToObjectOK6 _GCSkillToObjectOK6;
SkillType_t SkillType = pVampireSkillSlot->getSkillType();
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);
// Knowledge of Poison 이 있다면 hit bonus 10
int HitBonus = 0;
if (pVampire->hasRankBonus(RankBonus::RANK_BONUS_KNOWLEDGE_OF_POISON ) )
{
RankBonus* pRankBonus = pVampire->getRankBonus(RankBonus::RANK_BONUS_KNOWLEDGE_OF_POISON);
Assert(pRankBonus != NULL);
HitBonus = pRankBonus->getPoint();
}
int RequiredMP = decreaseConsumeMP(pVampire, pSkillInfo);
bool bManaCheck = hasEnoughMana(pVampire, RequiredMP);
bool bTimeCheck = verifyRunTime(pVampireSkillSlot);
bool bRangeCheck = verifyDistance(pVampire, pTargetCreature, pSkillInfo->getRange());
bool bHitRoll = HitRoll::isSuccessMagic(pVampire, pSkillInfo, pVampireSkillSlot, HitBonus);
bool bEffected = pTargetCreature->isFlag(Effect::EFFECT_CLASS_DARKBLUE_POISON);
ZoneCoord_t vampX = pVampire->getX();
ZoneCoord_t vampY = pVampire->getY();
ZoneCoord_t targetX = pTargetCreature->getX();
ZoneCoord_t targetY = pTargetCreature->getY();
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && !bEffected)
{
decreaseMana(pVampire, RequiredMP, _GCSkillToObjectOK1);
bool bCanSeeCaster = canSee(pTargetCreature, pVampire);
SkillInput input(pVampire);
SkillOutput output;
computeOutput(input, output);
Damage_t Damage = computeMagicDamage(pTargetCreature, output.Damage, SkillType, true, pVampire);
// 아우스터즈는 절반의 시간만 받는다.
if (pTargetCreature->isOusters() ) output.Duration/=2;
// 이펙트 오브젝트를 생성해서 붙인다.
EffectDarkBluePoison* pEffectDarkBluePoison = new EffectDarkBluePoison(pTargetCreature);
pEffectDarkBluePoison->setDamage(Damage);
pEffectDarkBluePoison->setLevel(pSkillInfo->getLevel()/2);
pEffectDarkBluePoison->setDeadline(output.Duration);
pEffectDarkBluePoison->setTick(output.Tick);
pEffectDarkBluePoison->setNextTime(0);
pTargetCreature->addEffect(pEffectDarkBluePoison);
pTargetCreature->setFlag(Effect::EFFECT_CLASS_DARKBLUE_POISON);
// 이펙트가 붙었으니, 붙었다고 브로드캐스팅해준다.
GCAddEffect gcAddEffect;
gcAddEffect.setObjectID(pTargetCreature->getObjectID());
gcAddEffect.setEffectID(Effect::EFFECT_CLASS_DARKBLUE_POISON);
gcAddEffect.setDuration(output.Duration);
pZone->broadcastPacket(targetX, targetY, &gcAddEffect);
if (bCanSeeCaster)
{
//.........这里部分代码省略.........
示例3: execute
void Flare::execute(Slayer* pSlayer, ObjectID_t TargetObjectID, SkillSlot* pSkillSlot, CEffectID_t CEffectID)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " Begin" << endl;
Assert(pSlayer != NULL);
Assert(pSkillSlot != NULL);
try
{
Player* pPlayer = pSlayer->getPlayer();
Zone* pZone = pSlayer->getZone();
Assert(pPlayer != NULL);
Assert(pZone != NULL);
Creature* pTargetCreature = pZone->getCreature(TargetObjectID);
//Assert(pTargetCreature != NULL);
// NPC이거나, 슬레이어에게는 Flare를 쓸 수가 없다.
// NoSuch제거. by sigi. 2002.5.2
if (pTargetCreature==NULL
|| pTargetCreature->isNPC() || pTargetCreature->isSlayer())
{
executeSkillFailException(pSlayer, getSkillType());
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End" << endl;
return;
}
GCSkillToObjectOK1 _GCSkillToObjectOK1;
GCSkillToObjectOK2 _GCSkillToObjectOK2;
GCSkillToObjectOK3 _GCSkillToObjectOK3;
GCSkillToObjectOK4 _GCSkillToObjectOK4;
GCSkillToObjectOK5 _GCSkillToObjectOK5;
SkillType_t SkillType = pSkillSlot->getSkillType();
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);
SkillDomainType_t DomainType = pSkillInfo->getDomainType();
SkillLevel_t SkillLevel = pSkillSlot->getExpLevel();
int RequiredMP = (int)pSkillInfo->getConsumeMP();
bool bManaCheck = hasEnoughMana(pSlayer, RequiredMP);
bool bTimeCheck = verifyRunTime(pSkillSlot);
bool bRangeCheck = verifyDistance(pSlayer, pTargetCreature, pSkillInfo->getRange());
bool bHitRoll = HitRoll::isSuccessFlare(pTargetCreature, SkillLevel) && canAttack(pSlayer, pTargetCreature);
bool bEffected = pTargetCreature->isFlag(Effect::EFFECT_CLASS_FLARE);
//if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && !bEffected)
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && !bEffected && pTargetCreature->getCompetence() == 3)
{
decreaseMana(pSlayer, RequiredMP, _GCSkillToObjectOK1);
// 지속 시간을 계산한다.
SkillInput input(pSlayer, pSkillSlot);
SkillOutput output;
computeOutput(input, output);
// 이펙트 클래스를 만들어 붙인다.
EffectFlare* pEffect = new EffectFlare(pTargetCreature);
//pEffect->setOldSight(13);
pEffect->setOldSight(pTargetCreature->getSight());
// 제거할때 level체크하기 위햇서.by sigi. 2002.6.21
pEffect->setLevel(pSkillInfo->getLevel());
pEffect->setDeadline(output.Duration);
pTargetCreature->setFlag(Effect::EFFECT_CLASS_FLARE);
pTargetCreature->addEffect(pEffect);
// 이펙트를 적용시킨다.
pEffect->affect(pTargetCreature);
// 경험치를 올린다.
SkillGrade Grade = g_pSkillInfoManager->getGradeByDomainLevel(pSlayer->getSkillDomainLevel(DomainType));
Exp_t ExpUp = 10* (Grade + 1);
shareAttrExp(pSlayer, ExpUp, 1, 1, 8, _GCSkillToObjectOK1);
increaseDomainExp(pSlayer, DomainType, pSkillInfo->getPoint(), _GCSkillToObjectOK1);
increaseSkillExp(pSlayer, DomainType, pSkillSlot, pSkillInfo, _GCSkillToObjectOK1);
// 패킷을 준비한다.
ZoneCoord_t targetX = pTargetCreature->getX();
ZoneCoord_t targetY = pTargetCreature->getY();
ZoneCoord_t myX = pSlayer->getX();
ZoneCoord_t myY = pSlayer->getY();
_GCSkillToObjectOK1.setSkillType(SkillType);
_GCSkillToObjectOK1.setCEffectID(CEffectID);
_GCSkillToObjectOK1.setTargetObjectID(TargetObjectID);
_GCSkillToObjectOK1.setDuration(0);
_GCSkillToObjectOK2.setObjectID(pSlayer->getObjectID());
_GCSkillToObjectOK2.setSkillType(SkillType);
_GCSkillToObjectOK2.addShortData(MODIFY_VISION, FLARE_SIGHT);
_GCSkillToObjectOK2.setDuration(0);
_GCSkillToObjectOK3.setObjectID(pSlayer->getObjectID());
_GCSkillToObjectOK3.setSkillType(SkillType);
_GCSkillToObjectOK3.setTargetXY (targetX, targetY);
_GCSkillToObjectOK4.setSkillType(SkillType);
//.........这里部分代码省略.........
示例4: execute
//////////////////////////////////////////////////////////////////////////////
// 뱀파이어 오브젝트 핸들러
//////////////////////////////////////////////////////////////////////////////
void Paralyze::execute(Vampire* pVampire, ObjectID_t TargetObjectID, VampireSkillSlot* pVampireSkillSlot, CEffectID_t CEffectID)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << "begin " << endl;
Assert(pVampire != NULL);
Assert(pVampireSkillSlot != NULL);
try
{
Player* pPlayer = pVampire->getPlayer();
Zone* pZone = pVampire->getZone();
Assert(pPlayer != NULL);
Assert(pZone != NULL);
Creature* pTargetCreature = pZone->getCreature(TargetObjectID);
SkillType_t SkillType = pVampireSkillSlot->getSkillType();
// NPC는 공격할 수가 없다.
// 면역이거나. by sigi. 2002.9.13
// NoSuch제거. by sigi. 2002.5.2
if (pTargetCreature==NULL
|| pTargetCreature->isFlag(Effect::EFFECT_CLASS_IMMUNE_TO_PARALYZE)
|| !canAttack(pVampire, pTargetCreature )
|| pTargetCreature->isNPC())
{
executeSkillFailException(pVampire, getSkillType());
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " end " << endl;
return;
}
GCSkillToObjectOK1 _GCSkillToObjectOK1;
GCSkillToObjectOK2 _GCSkillToObjectOK2;
GCSkillToObjectOK3 _GCSkillToObjectOK3;
GCSkillToObjectOK4 _GCSkillToObjectOK4;
GCSkillToObjectOK5 _GCSkillToObjectOK5;
GCSkillToObjectOK6 _GCSkillToObjectOK6;
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);
// Knowledge of Curse 가 있다면 hit bonus 10
int HitBonus = 0;
if (pVampire->hasRankBonus(RankBonus::RANK_BONUS_KNOWLEDGE_OF_CURSE ) )
{
RankBonus* pRankBonus = pVampire->getRankBonus(RankBonus::RANK_BONUS_KNOWLEDGE_OF_CURSE);
Assert(pRankBonus != NULL);
HitBonus = pRankBonus->getPoint();
}
Tile& rTile = pZone->getTile(pTargetCreature->getX(), pTargetCreature->getY());
int RequiredMP = decreaseConsumeMP(pVampire, pSkillInfo);
bool bManaCheck = hasEnoughMana(pVampire, RequiredMP);
bool bTimeCheck = verifyRunTime(pVampireSkillSlot);
bool bRangeCheck = verifyDistance(pVampire, pTargetCreature, pSkillInfo->getRange());
bool bHitRoll = HitRoll::isSuccessVampireCurse(pSkillInfo->getLevel(), pTargetCreature->getResist(MAGIC_DOMAIN_CURSE));
bool bHitRoll2 = HitRoll::isSuccessMagic(pVampire, pSkillInfo, pVampireSkillSlot, HitBonus);
bool bCanHit = canHit(pVampire, pTargetCreature, SkillType);
bool bEffected = pTargetCreature->isFlag(Effect::EFFECT_CLASS_PARALYZE) || rTile.getEffect(Effect::EFFECT_CLASS_TRYING_POSITION)!=NULL;
bool bPK = verifyPK(pVampire, pTargetCreature);
ZoneCoord_t vampX = pVampire->getX();
ZoneCoord_t vampY = pVampire->getY();
ZoneCoord_t targetX = pTargetCreature->getX();
ZoneCoord_t targetY = pTargetCreature->getY();
//if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && bHitRoll2 && bCanHit && !bEffected && bPK)
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && bHitRoll2 && bCanHit && !bEffected && bPK && pTargetCreature->getCompetence() == 3)
{
decreaseMana(pVampire, RequiredMP, _GCSkillToObjectOK1);
bool bCanSeeCaster = canSee(pTargetCreature, pVampire);
SkillInput input(pVampire);
SkillOutput output;
computeOutput(input, output);
// Wisdom of Silence 이 있다면 지속시간 20% 증가
if (pVampire->hasRankBonus(RankBonus::RANK_BONUS_WISDOM_OF_SILENCE ) )
{
RankBonus* pRankBonus = pVampire->getRankBonus(RankBonus::RANK_BONUS_WISDOM_OF_SILENCE);
Assert(pRankBonus != NULL);
output.Duration += getPercentValue(output.Duration, pRankBonus->getPoint());
}
// pTargetCreature가 저주마법을 반사하는 경우
if (CheckReflection(pVampire, pTargetCreature, getSkillType()))
{
pTargetCreature = (Creature*)pVampire;
TargetObjectID = pVampire->getObjectID();
}
Resist_t resist = pTargetCreature->getResist(MAGIC_DOMAIN_CURSE);
//.........这里部分代码省略.........
示例5: execute
//////////////////////////////////////////////////////////////////////////////
// 뱀파이어 타일 핸들러
// 뱀파이어가 Energy Drop Skill을 Tile에 사용했을때 사용하는 Handler
//////////////////////////////////////////////////////////////////////////////
void EnergyDrop::execute(Slayer* pSlayer, ZoneCoord_t X, ZoneCoord_t Y, SkillSlot* pSkillSlot, CEffectID_t CEffectID)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << "begin " << endl;
EffectEnergyDrop * pEffect = NULL;
EffectEnergyDrop * pEffect2 = NULL;
try
{
Player* pPlayer = pSlayer->getPlayer();
Zone* pZone = pSlayer->getZone();
Assert(pPlayer != NULL);
Assert(pZone != NULL);
GCSkillToTileOK1 _GCSkillToTileOK1;
GCSkillToTileOK2 _GCSkillToTileOK2;
GCSkillToTileOK3 _GCSkillToTileOK3;
GCSkillToTileOK4 _GCSkillToTileOK4;
GCSkillToTileOK5 _GCSkillToTileOK5;
GCSkillToTileOK6 _GCSkillToTileOK6;
SkillType_t SkillType = pSkillSlot->getSkillType();
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);
SkillDomainType_t DomainType = pSkillInfo->getDomainType();
ZoneCoord_t myX = pSlayer->getX();
ZoneCoord_t myY = pSlayer->getY();
int RequiredMP = (int)pSkillInfo->getConsumeMP();
bool bManaCheck = hasEnoughMana(pSlayer, RequiredMP);
bool bTimeCheck = verifyRunTime(pSkillSlot);
bool bRangeCheck = verifyDistance(pSlayer, X, Y, pSkillInfo->getRange());
bool bHitRoll = HitRoll::isSuccessMagic(pSlayer, pSkillInfo, pSkillSlot);
bool bTileCheck = false;
VSRect rect(0, 0, pZone->getWidth()-1, pZone->getHeight()-1);
if(rect.ptInRect(X, Y))
{
Tile& tile = pZone->getTile(X, Y);
if (tile.canAddEffect()) bTileCheck = true;
}
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && bTileCheck)
{
decreaseMana(pSlayer, RequiredMP, _GCSkillToTileOK1);
// calculate damage and duration time
SkillInput input(pSlayer, pSkillSlot);
SkillOutput output;
computeOutput(input, output);
// Holy Smashing 이 있다면 데미지 10% 증가
if (pSlayer->hasRankBonus(RankBonus::RANK_BONUS_HOLY_SMASHING ) )
{
RankBonus* pRankBonus = pSlayer->getRankBonus(RankBonus::RANK_BONUS_HOLY_SMASHING);
Assert(pRankBonus != NULL);
output.Damage += pRankBonus->getPoint();
}
Range_t Range = 3;
// 기존에 같은 이펙트가 타일에 있다면 지우고 새로 설정한다.
Tile& tile = pZone->getTile(X, Y);
Effect* pOldEffect = tile.getEffect(Effect::EFFECT_CLASS_ENERGY_DROP);
if(pOldEffect != NULL)
{
ObjectID_t effectID = pOldEffect->getObjectID();
pZone->deleteEffect(effectID);
}
// 이펙트 오브젝트를 생성해서 타일에 붙인다.
//cout << "make EffectObject to Tile" << X << " " << Y << endl;
pEffect = new EffectEnergyDrop(pZone, X, Y);
pEffect->setUserObjectID(pSlayer->getObjectID());
// pEffect->setCasterName(pSlayer->getName());
// pEffect->setPartyID(pSlayer->getPartyID());
pEffect->setDeadline(output.Duration);
pEffect->setNextTime(0);
pEffect->setTick(output.Tick);
pEffect->setDamage(output.Damage);
pEffect->setLevel(pSkillInfo->getLevel()/2);
//
//ObjectRegistry& objectregister = pZone->getObjectRegistry();
//objectregister.registerObject(pEffect);
//.........这里部分代码省略.........
示例6: execute
//////////////////////////////////////////////////////////////////////////////
// 뱀파이어 오브젝트 핸들러
//////////////////////////////////////////////////////////////////////////////
void Hallucination::execute(Vampire* pVampire, ObjectID_t TargetObjectID, VampireSkillSlot* pSkillSlot, CEffectID_t CEffectID)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << "begin " << endl;
Assert(pVampire != NULL);
Assert(pSkillSlot != NULL);
try
{
Player* pPlayer = pVampire->getPlayer();
Zone* pZone = pVampire->getZone();
Assert(pPlayer != NULL);
Assert(pZone != NULL);
Creature* pTargetCreature = pZone->getCreature(TargetObjectID);
//Assert(pTargetCreature != NULL);
// NPC는 공격할 수 없다.
// NoSuch제거. by sigi. 2002.5.2
if (pTargetCreature==NULL
|| !canAttack(pVampire, pTargetCreature )
|| pTargetCreature->isFlag(Effect::EFFECT_CLASS_IMMUNE_TO_HALLUCINATION)
|| pTargetCreature->isNPC()
)
{
executeSkillFailException(pVampire, getSkillType());
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " end " << endl;
return;
}
GCSkillToObjectOK1 _GCSkillToObjectOK1;
GCSkillToObjectOK2 _GCSkillToObjectOK2;
GCSkillToObjectOK3 _GCSkillToObjectOK3;
GCSkillToObjectOK4 _GCSkillToObjectOK4;
GCSkillToObjectOK5 _GCSkillToObjectOK5;
GCSkillToObjectOK6 _GCSkillToObjectOK6;
SkillType_t SkillType = pSkillSlot->getSkillType();
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);
int RequiredMP = decreaseConsumeMP(pVampire, pSkillInfo);
bool bManaCheck = hasEnoughMana(pVampire, RequiredMP);
bool bTimeCheck = verifyRunTime(pSkillSlot);
bool bRangeCheck = verifyDistance(pVampire, pTargetCreature, pSkillInfo->getRange());
bool bHitRoll = HitRoll::isSuccessVampireCurse(pSkillInfo->getLevel(), pTargetCreature->getResist(MAGIC_DOMAIN_CURSE));
bool bHitRoll2 = HitRoll::isSuccessHallucination(pVampire, pTargetCreature);
bool bCanHit = canHit(pVampire, pTargetCreature, SkillType);
bool bEffected = pTargetCreature->isFlag(Effect::EFFECT_CLASS_HALLUCINATION);
bool bPK = verifyPK(pVampire, pTargetCreature);
ZoneCoord_t targetX = pTargetCreature->getX();
ZoneCoord_t targetY = pTargetCreature->getY();
ZoneCoord_t myX = pVampire->getX();
ZoneCoord_t myY = pVampire->getY();
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && bHitRoll2 && bCanHit && !bEffected && bPK)
{
decreaseMana(pVampire, RequiredMP, _GCSkillToObjectOK1);
bool bCanSeeCaster = canSee(pTargetCreature, pVampire);
SkillInput input(pVampire);
SkillOutput output;
computeOutput(input, output);
// pTargetCreature가 저주마법을 반사하는 경우
if (CheckReflection(pVampire, pTargetCreature, getSkillType()))
{
pTargetCreature = (Creature*)pVampire;
TargetObjectID = pVampire->getObjectID();
}
// 이펙트 오브젝트를 생성해 붙인다.
EffectHallucination* pEffect = new EffectHallucination(pTargetCreature);
pEffect->setDeadline(output.Duration);
pEffect->setLevel(pSkillInfo->getLevel()/2);
pTargetCreature->addEffect(pEffect);
pTargetCreature->setFlag(Effect::EFFECT_CLASS_HALLUCINATION);
_GCSkillToObjectOK1.setSkillType(SkillType);
_GCSkillToObjectOK1.setCEffectID(CEffectID);
_GCSkillToObjectOK1.setTargetObjectID(TargetObjectID);
_GCSkillToObjectOK1.setDuration(output.Duration);
_GCSkillToObjectOK2.setObjectID(pVampire->getObjectID());
_GCSkillToObjectOK2.setSkillType(SkillType);
_GCSkillToObjectOK2.setDuration(output.Duration);
_GCSkillToObjectOK3.setObjectID(pVampire->getObjectID());
_GCSkillToObjectOK3.setSkillType(SkillType);
_GCSkillToObjectOK3.setTargetXY (targetX, targetY);
_GCSkillToObjectOK4.setSkillType(SkillType);
_GCSkillToObjectOK4.setTargetObjectID(TargetObjectID);
//.........这里部分代码省略.........