本文整理汇总了C++中SkillInfo::getConsumeMP方法的典型用法代码示例。如果您正苦于以下问题:C++ SkillInfo::getConsumeMP方法的具体用法?C++ SkillInfo::getConsumeMP怎么用?C++ SkillInfo::getConsumeMP使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkillInfo
的用法示例。
在下文中一共展示了SkillInfo::getConsumeMP方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
//////////////////////////////////////////////////////////////////////////////
// 아우스터즈 오브젝트 핸들러
//////////////////////////////////////////////////////////////////////////////
void MagnumSpear::execute(Ousters* pOusters, ObjectID_t TargetObjectID, OustersSkillSlot* pOustersSkillSlot, CEffectID_t CEffectID)
throw(Error)
{
__BEGIN_TRY
Assert(pOusters != NULL);
Assert(pOustersSkillSlot != NULL);
try
{
Player* pPlayer = pOusters->getPlayer();
Zone* pZone = pOusters->getZone();
Assert(pPlayer != NULL);
Assert(pZone != NULL);
Item* pWeapon = pOusters->getWearItem(Ousters::WEAR_RIGHTHAND);
if (pWeapon == NULL || pWeapon->getItemClass() != Item::ITEM_CLASS_OUSTERS_WRISTLET || !pOusters->isRealWearingEx(Ousters::WEAR_RIGHTHAND))
{
executeSkillFailException(pOusters, pOustersSkillSlot->getSkillType());
return;
}
Creature* pTargetCreature = pZone->getCreature(TargetObjectID);
SkillType_t SkillType = pOustersSkillSlot->getSkillType();
// NPC는 공격할 수가 없다.
if (pTargetCreature==NULL
|| !canAttack(pOusters, pTargetCreature )
|| pTargetCreature->isNPC())
{
executeSkillFailException(pOusters, SkillType);
return;
}
GCSkillToObjectOK1 _GCSkillToObjectOK1;
GCSkillToObjectOK2 _GCSkillToObjectOK2;
GCSkillToObjectOK3 _GCSkillToObjectOK3;
GCSkillToObjectOK4 _GCSkillToObjectOK4;
GCSkillToObjectOK5 _GCSkillToObjectOK5;
GCSkillToObjectOK6 _GCSkillToObjectOK6;
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);
int HitBonus = 0;
/*
if (pOusters->hasRankBonus(RankBonus::RANK_BONUS_KNOWLEDGE_OF_ACID ) )
{
RankBonus* pRankBonus = pOusters->getRankBonus(RankBonus::RANK_BONUS_KNOWLEDGE_OF_ACID);
Assert(pRankBonus != NULL);
HitBonus = pRankBonus->getPoint();
}
*/
int RequiredMP = (int)(pSkillInfo->getConsumeMP() + pOustersSkillSlot->getExpLevel()/3);
bool bManaCheck = hasEnoughMana(pOusters, RequiredMP);
bool bTimeCheck = verifyRunTime(pOustersSkillSlot);
bool bRangeCheck = verifyDistance(pOusters, pTargetCreature, pSkillInfo->getRange());
bool bHitRoll = HitRoll::isSuccessMagic(pOusters, pSkillInfo, pOustersSkillSlot, HitBonus);
bool bCanHit = canHit(pOusters, pTargetCreature, SkillType);
bool bPK = verifyPK(pOusters, pTargetCreature);
bool bEffect = pTargetCreature->isFlag(Effect::EFFECT_CLASS_MAGNUM_SPEAR);
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && bCanHit && bPK && !bEffect)
{
ZoneCoord_t oustX = pOusters->getX();
ZoneCoord_t oustY = pOusters->getY();
ZoneCoord_t targetX = pTargetCreature->getX();
ZoneCoord_t targetY = pTargetCreature->getY();
decreaseMana(pOusters, RequiredMP, _GCSkillToObjectOK1);
bool bCanSeeCaster = canSee(pTargetCreature, pOusters);
SkillInput input(pOusters, pOustersSkillSlot);
SkillOutput output;
computeOutput(input, output);
Damage_t Damage = output.Damage;
OustersSkillSlot* pMastery = pOusters->hasSkill(SKILL_MAGNUM_SPEAR_MASTERY);
if (pMastery != NULL )
{
Damage += (pMastery->getExpLevel() * 5 / 3 ) + 15;
}
else
{
bool dummy;
computeCriticalBonus(pOusters, getSkillType(), Damage, dummy);
}
EffectMagnumSpear* pEffect = new EffectMagnumSpear(pTargetCreature);
pEffect->setDamage(computeOustersMagicDamage(pOusters, pTargetCreature, Damage, SKILL_MAGNUM_SPEAR ));
int spearNum = 2;
//.........这里部分代码省略.........
示例2: execute
//////////////////////////////////////////////////////////////////////////////
// 슬레이어 셀프 핸들러
//////////////////////////////////////////////////////////////////////////////
void Sacrifice::execute(Slayer* pSlayer, 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);
GCSkillToSelfOK1 _GCSkillToSelfOK1;
GCSkillToSelfOK2 _GCSkillToSelfOK2;
SkillType_t SkillType = pSkillSlot->getSkillType();
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);
SkillDomainType_t DomainType = pSkillInfo->getDomainType();
ZoneCoord_t X = pSlayer->getX();
ZoneCoord_t Y = pSlayer->getY();
int RequiredMP = (int)pSkillInfo->getConsumeMP();
bool bManaCheck = hasEnoughMana(pSlayer, RequiredMP);
bool bTimeCheck = verifyRunTime(pSkillSlot);
bool bRangeCheck = checkZoneLevelToUseSkill(pSlayer);
bool bHitRoll = HitRoll::isSuccessMagic(pSlayer, pSkillInfo, pSkillSlot);
bool bEffected = pSlayer->isFlag(Effect::EFFECT_CLASS_SACRIFICE);
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && !bEffected)
{
decreaseMana(pSlayer, RequiredMP, _GCSkillToSelfOK1);
SkillInput input(pSlayer, pSkillSlot);
SkillOutput output;
computeOutput(input, output);
// 이펙트 클래스를 만들어 붙인다.
EffectSacrifice* pEffect = new EffectSacrifice(pSlayer);
pEffect->setDeadline(output.Duration);
pSlayer->addEffect(pEffect);
pSlayer->setFlag(Effect::EFFECT_CLASS_SACRIFICE);
// 경험치를 올린다.
SkillGrade Grade = g_pSkillInfoManager->getGradeByDomainLevel(pSlayer->getSkillDomainLevel(DomainType));
Exp_t ExpUp = 10*(Grade+1);
shareAttrExp(pSlayer, ExpUp , 1, 1, 8, _GCSkillToSelfOK1);
increaseDomainExp(pSlayer, DomainType, pSkillInfo->getPoint(), _GCSkillToSelfOK1);
increaseSkillExp(pSlayer, DomainType, pSkillSlot, pSkillInfo, _GCSkillToSelfOK1);
_GCSkillToSelfOK1.setSkillType(SkillType);
_GCSkillToSelfOK1.setCEffectID(CEffectID);
_GCSkillToSelfOK1.setDuration(0);
_GCSkillToSelfOK2.setObjectID(pSlayer->getObjectID());
_GCSkillToSelfOK2.setSkillType(SkillType);
_GCSkillToSelfOK2.setDuration(0);
pPlayer->sendPacket(&_GCSkillToSelfOK1);
pZone->broadcastPacket(X, Y, &_GCSkillToSelfOK2, pSlayer);
GCAddEffect gcAddEffect;
gcAddEffect.setObjectID(pSlayer->getObjectID());
gcAddEffect.setEffectID(Effect::EFFECT_CLASS_SACRIFICE);
gcAddEffect.setDuration(output.Duration);
pZone->broadcastPacket(pSlayer->getX(), pSlayer->getY(), &gcAddEffect);
pSkillSlot->setRunTime(output.Delay);
}
else
{
executeSkillFailNormal(pSlayer, getSkillType(), NULL);
}
}
catch (Throwable & t)
{
executeSkillFailException(pSlayer, getSkillType());
}
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End" << endl;
__END_CATCH
}
示例3: execute
//////////////////////////////////////////////////////////////////////////////
// 슬레이어 셀프 핸들러
//////////////////////////////////////////////////////////////////////////////
void AirShield::execute(Slayer* pSlayer, SkillSlot* pSkillSlot, CEffectID_t CEffectID)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " Begin(slayer)" << endl;
Assert(pSlayer != NULL);
Assert(pSkillSlot != NULL);
try
{
Player* pPlayer = pSlayer->getPlayer();
Zone* pZone = pSlayer->getZone();
Assert(pPlayer != NULL);
Assert(pZone != NULL);
// 무장하고 있는 무기가 널이거나, 도가 아니라면 사용할 수 없다.
Item* pItem = pSlayer->getWearItem(Slayer::WEAR_RIGHTHAND);
if (pItem == NULL || pItem->getItemClass() != Item::ITEM_CLASS_BLADE)
{
executeSkillFailException(pSlayer, getSkillType());
return;
}
bool bIncreaseDomainExp = pSlayer->isRealWearingEx(Slayer::WEAR_RIGHTHAND);
GCSkillToSelfOK1 _GCSkillToSelfOK1;
GCSkillToSelfOK2 _GCSkillToSelfOK2;
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 = checkZoneLevelToUseSkill(pSlayer);
bool bHitRoll = HitRoll::isSuccessMagic(pSlayer, pSkillInfo, pSkillSlot);
bool bEffected = pSlayer->isFlag(Effect::EFFECT_CLASS_AIR_SHIELD_1);
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && !bEffected)
{
decreaseMana(pSlayer, RequiredMP, _GCSkillToSelfOK1);
// 지속 시간을 계산한다.
SkillInput input(pSlayer, pSkillSlot);
SkillOutput output;
computeOutput(input, output);
// 이팩트 클래스를 만들어 붙인다.
EffectAirShield* pEffect = new EffectAirShield(pSlayer);
pEffect->setDeadline(output.Duration);
pEffect->setLevel(SkillLevel);
pEffect->setDamage(output.Damage);
pSlayer->addEffect(pEffect);
pSlayer->setFlag(Effect::EFFECT_CLASS_AIR_SHIELD_1);
// 경험치를 올린다.
SkillGrade Grade = g_pSkillInfoManager->getGradeByDomainLevel(pSlayer->getSkillDomainLevel(DomainType));
Exp_t ExpUp = 10* (Grade + 1);
if (bIncreaseDomainExp )
{
shareAttrExp(pSlayer, ExpUp, 8, 1, 1, _GCSkillToSelfOK1);
increaseDomainExp(pSlayer, DomainType, pSkillInfo->getPoint(), _GCSkillToSelfOK1);
// increaseSkillExp(pSlayer, DomainType, pSkillSlot, pSkillInfo, _GCSkillToSelfOK1);
}
_GCSkillToSelfOK1.setSkillType(SkillType);
_GCSkillToSelfOK1.setCEffectID(CEffectID);
_GCSkillToSelfOK1.setDuration(0);
_GCSkillToSelfOK2.setObjectID(pSlayer->getObjectID());
_GCSkillToSelfOK2.setSkillType(SkillType);
_GCSkillToSelfOK2.setDuration(0);
pPlayer->sendPacket(&_GCSkillToSelfOK1);
pZone->broadcastPacket(pSlayer->getX(), pSlayer->getY(), &_GCSkillToSelfOK2, pSlayer);
GCAddEffect gcAddEffect;
gcAddEffect.setObjectID(pSlayer->getObjectID());
gcAddEffect.setEffectID(pEffect->getClientEffectClass());
gcAddEffect.setDuration(output.Duration);
pZone->broadcastPacket(pSlayer->getX(), pSlayer->getY(), &gcAddEffect);
pSkillSlot->setRunTime(output.Delay);
}
else
{
executeSkillFailNormal(pSlayer, getSkillType(), NULL);
}
}
catch (Throwable & t)
{
executeSkillFailException(pSlayer, getSkillType());
//.........这里部分代码省略.........
示例4: execute
void SimpleMissileSkill::execute(
Slayer* pSlayer, ObjectID_t TargetObjectID, SkillSlot* pSkillSlot,
const SIMPLE_SKILL_INPUT& param, SIMPLE_SKILL_OUTPUT& result,
CEffectID_t CEffectID)
throw(Error)
{
__BEGIN_TRY
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는 공격할 수가 없다.
// NoSuch제거. by sigi. 2002.5.2
if (pTargetCreature==NULL
|| !canAttack(pSlayer, pTargetCreature )
|| pTargetCreature->isNPC())
{
executeSkillFailException(pSlayer, param.SkillType);
return;
}
result.pTargetCreature = pTargetCreature;
GCSkillToObjectOK1 _GCSkillToObjectOK1;
GCSkillToObjectOK2 _GCSkillToObjectOK2;
GCSkillToObjectOK3 _GCSkillToObjectOK3;
GCSkillToObjectOK4 _GCSkillToObjectOK4;
GCSkillToObjectOK5 _GCSkillToObjectOK5;
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(param.SkillType);
SkillDomainType_t DomainType = pSkillInfo->getDomainType();
SkillLevel_t SkillLevel = pSkillSlot->getExpLevel();
bool bCriticalHit = false;
Damage_t Damage = 0;
if (param.bAdd)
{
// 파라미터로 전달된 데미지 값이 더해지는 데미지라면,
// 일반 데미지를 계산 후, 데미지를 더해야 한다.
// 파라미터로 전달된 데미지 값이 직접적으로 쓰이는 데미지라면,
// 이 부분까지 들어오지 않으므로, 밑의 부분까지 0으로 전달된다.
Damage += computeDamage(pSlayer, pTargetCreature, SkillLevel/5, bCriticalHit);
}
if (param.bMagicDamage)
{
// 만일 스킬 데미지가 마법 데미지라면, 마법 데미지 계산 함수를 이용해 계산을 해준다.
Damage += computeMagicDamage(pTargetCreature, param.SkillDamage, param.SkillType);
}
else
{
Damage += param.SkillDamage;
}
ZoneCoord_t myX = pSlayer->getX();
ZoneCoord_t myY = pSlayer->getY();
ZoneCoord_t targetX = pTargetCreature->getX();
ZoneCoord_t targetY = pTargetCreature->getY();
int RequiredMP = (int)pSkillInfo->getConsumeMP();
bool bManaCheck = hasEnoughMana(pSlayer, RequiredMP);
bool bTimeCheck = verifyRunTime(pSkillSlot);
bool bRangeCheck = verifyDistance(pSlayer, pTargetCreature, pSkillInfo->getRange());
bool bHitRoll = false;
bool bPK = verifyPK(pSlayer, pTargetCreature);
if (param.bMagicHitRoll)
{
bHitRoll = HitRoll::isSuccessMagic(pSlayer, pSkillInfo, pSkillSlot);
}
else
{
bHitRoll = HitRoll::isSuccess(pSlayer, pTargetCreature, SkillLevel/2);
}
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && bPK)
{
decreaseMana(pSlayer, RequiredMP, _GCSkillToObjectOK1);
// 데미지를 가하고, 내구도를 떨어뜨린다.
setDamage(pTargetCreature, Damage, pSlayer, param.SkillType, &_GCSkillToObjectOK2, &_GCSkillToObjectOK1);
computeAlignmentChange(pTargetCreature, Damage, pSlayer, &_GCSkillToObjectOK2, &_GCSkillToObjectOK1);
decreaseDurability(pSlayer, pTargetCreature, NULL, &_GCSkillToObjectOK1, &_GCSkillToObjectOK2);
// 타겟이 슬레이어가 아닌 경우에만 경험치를 올려준다.
if (!pTargetCreature->isSlayer())
{
shareAttrExp(pSlayer, Damage , param.STRMultiplier, param.DEXMultiplier, param.INTMultiplier, _GCSkillToObjectOK1);
increaseDomainExp(pSlayer, DomainType, pSkillInfo->getPoint(), _GCSkillToObjectOK1, pTargetCreature->getLevel());
//.........这里部分代码省略.........
示例5: execute
//////////////////////////////////////////////////////////////////////////////
// 슬레이어 셀프 핸들러
//////////////////////////////////////////////////////////////////////////////
void DivineSpirits::execute(Ousters* pOusters, OustersSkillSlot* pOustersSkillSlot, CEffectID_t CEffectID)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " Begin(slayer)" << endl;
Assert(pOusters != NULL);
Assert(pOustersSkillSlot != NULL);
try
{
Player* pPlayer = pOusters->getPlayer();
Zone* pZone = pOusters->getZone();
Assert(pPlayer != NULL);
Assert(pZone != NULL);
GCSkillToSelfOK1 _GCSkillToSelfOK1;
GCSkillToSelfOK2 _GCSkillToSelfOK2;
SkillType_t SkillType = pOustersSkillSlot->getSkillType();
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);
//SkillDomainType_t DomainType = pSkillInfo->getDomainType();
//SkillLevel_t SkillLevel = pOustersSkillSlot->getExpLevel();
int RequiredMP = pSkillInfo->getConsumeMP();
bool bManaCheck = hasEnoughMana(pOusters, RequiredMP);
bool bTimeCheck = verifyRunTime(pOustersSkillSlot);
bool bRangeCheck = checkZoneLevelToUseSkill(pOusters);
bool bHitRoll = HitRoll::isSuccessMagic(pOusters, pSkillInfo, pOustersSkillSlot);
bool bEffected = pOusters->isFlag(Effect::EFFECT_CLASS_DIVINE_SPIRITS);
bool bSatisfyRequire = pOusters->satisfySkillRequire(pSkillInfo);
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && !bEffected && bSatisfyRequire)
{
decreaseMana(pOusters, RequiredMP, _GCSkillToSelfOK1);
// 지속 시간을 계산한다.
SkillInput input(pOusters, pOustersSkillSlot);
SkillOutput output;
computeOutput(input, output);
// 이팩트 클래스를 만들어 붙인다.
EffectDivineSpirits* pEffect = new EffectDivineSpirits(pOusters);
pEffect->setDeadline(output.Duration);
pEffect->setBonus(output.Damage);
pOusters->addEffect(pEffect);
pOusters->setFlag(Effect::EFFECT_CLASS_DIVINE_SPIRITS);
// OUSTERS_RECORD prev;
// pOusters->getOustersRecord(prev);
// pOusters->initAllStat();
// pOusters->addModifyInfo(prev, _GCSkillToSelfOK1);
_GCSkillToSelfOK1.setSkillType(SkillType);
_GCSkillToSelfOK1.setCEffectID(CEffectID);
_GCSkillToSelfOK1.setDuration(output.Duration);
_GCSkillToSelfOK2.setObjectID(pOusters->getObjectID());
_GCSkillToSelfOK2.setSkillType(SkillType);
_GCSkillToSelfOK2.setDuration(output.Duration);
pPlayer->sendPacket(&_GCSkillToSelfOK1);
pZone->broadcastPacket(pOusters->getX(), pOusters->getY(), &_GCSkillToSelfOK2, pOusters);
GCAddEffect gcAddEffect;
gcAddEffect.setObjectID(pOusters->getObjectID());
gcAddEffect.setEffectID(pEffect->getEffectClass());
gcAddEffect.setDuration(output.Duration);
pZone->broadcastPacket(pOusters->getX(), pOusters->getY(), &gcAddEffect, pOusters);
pOustersSkillSlot->setRunTime(output.Delay);
}
else
{
executeSkillFailNormal(pOusters, getSkillType(), NULL);
}
}
catch (Throwable & t)
{
executeSkillFailException(pOusters, getSkillType());
}
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End(slayer)" << endl;
__END_CATCH
}
示例6: execute
//.........这里部分代码省略.........
{
pEffectParalyze = (EffectParalyze*)pTargetCreature->findEffect(Effect::EFFECT_CLASS_PARALYZE);
Assert(pEffectParalyze != NULL);
bParalyze = HitRoll::isSuccessRemoveCurse(45, SkillLevel, 10, pEffectParalyze->getLevel()/4);
bEffected = true;
}
if (pTargetCreature->isEffect(Effect::EFFECT_CLASS_SEDUCTION))
{
pEffectSeduction = (EffectSeduction*)pTargetCreature->findEffect(Effect::EFFECT_CLASS_SEDUCTION);
Assert(pEffectSeduction != NULL);
bSeduction = HitRoll::isSuccessRemoveCurse(45, SkillLevel, 30, pEffectSeduction->getLevel()/4);
bEffected = true;
}
// by sigi. 2002.12.3
// if (pTargetCreature->isEffect(Effect::EFFECT_CLASS_HALLUCINATION))
// {
// pEffectHallucination = (EffectHallucination*)pTargetCreature->findEffect(Effect::EFFECT_CLASS_HALLUCINATION);
//// Assert(pEffectHallucination != NULL);
//
// bHallucination = HitRoll::isSuccessRemoveCurse(45, SkillLevel, 40, pEffectHallucination->getLevel()/4);
// bEffected = true;
// }
if (pTargetCreature->isEffect(Effect::EFFECT_CLASS_DEATH))
{
pEffectDeath = (EffectDeath*)pTargetCreature->findEffect(Effect::EFFECT_CLASS_DEATH);
Assert(pEffectDeath != NULL);
bDeath = HitRoll::isSuccessRemoveCurse(45, SkillLevel, 50, pEffectDeath->getLevel()/4);
bEffected = true;
}
int RequiredMP = (int)pSkillInfo->getConsumeMP();
bool bManaCheck = hasEnoughMana(pSlayer, RequiredMP);
bool bTimeCheck = verifyRunTime(pSkillSlot);
bool bRangeCheck = verifyDistance(pSlayer, pTargetCreature, pSkillInfo->getRange());
// 마나가 있고, 시간이 됐고, 거리가 적당하며,
// 저주가 하나라도 걸려있어야 한다.
if (bManaCheck && bTimeCheck && bRangeCheck && bEffected)
{
decreaseMana(pSlayer, RequiredMP, _GCSkillToObjectOK1);
SkillInput input(pSlayer, pSkillSlot);
SkillOutput output;
computeOutput(input, output);
// 각각의 저주를 삭제하고,
// 패킷에다 이펙트 삭제하라고 더한다.
GCRemoveEffect gcRemoveEffect;
gcRemoveEffect.setObjectID(pTargetCreature->getObjectID());
if (bDoom)
{
pEffectDoom->setDeadline(0);
pTargetCreature->removeFlag(Effect::EFFECT_CLASS_DOOM);
gcRemoveEffect.addEffectList(Effect::EFFECT_CLASS_DOOM);
}
if (bParalyze)
{
pEffectParalyze->setDeadline(0);
pTargetCreature->removeFlag(Effect::EFFECT_CLASS_PARALYZE);
gcRemoveEffect.addEffectList(Effect::EFFECT_CLASS_PARALYZE);
}
if (bSeduction)
示例7: execute
//////////////////////////////////////////////////////////////////////////////
// 슬레이어 셀프
//////////////////////////////////////////////////////////////////////////////
void HolyArmor::execute(Slayer * pSlayer, 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);
// 무장하고 있는 무기가 널이거나, 검이 아니라면 기술을 쓸 수 없다.
/* Item* pWeapon = pSlayer->getWearItem(Slayer::WEAR_RIGHTHAND);
if (pWeapon == NULL || pWeapon->getItemClass() != Item::ITEM_CLASS_SWORD)
{
executeSkillFailException(pSlayer, getSkillType());
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End" << endl;
return;
}*/
GCSkillToSelfOK1 _GCSkillToSelfOK1;
GCSkillToSelfOK2 _GCSkillToSelfOK2;
SkillType_t SkillType = pSkillSlot->getSkillType();
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);
SkillDomainType_t DomainType = pSkillInfo->getDomainType();
ZoneCoord_t X = pSlayer->getX();
ZoneCoord_t Y = pSlayer->getY();
int RequiredMP = (int)pSkillInfo->getConsumeMP();
bool bManaCheck = hasEnoughMana(pSlayer, RequiredMP) && pSlayer->getHP() > 100;
bool bTimeCheck = verifyRunTime(pSkillSlot);
bool bRangeCheck = checkZoneLevelToUseSkill(pSlayer);
bool bHitRoll = HitRoll::isSuccessMagic(pSlayer, pSkillInfo, pSkillSlot);
bool bEffected = pSlayer->isFlag(Effect::EFFECT_CLASS_HOLY_ARMOR);
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && !bEffected)
{
decreaseMana(pSlayer, RequiredMP, _GCSkillToSelfOK1);
pSlayer->setHP(pSlayer->getHP()-100);
_GCSkillToSelfOK1.addShortData(MODIFY_CURRENT_HP, pSlayer->getHP());
SkillInput input(pSlayer, pSkillSlot);
SkillOutput output;
computeOutput(input, output);
// 이펙트 클래스를 만들어 붙인다.
EffectHolyArmor* pEffect = new EffectHolyArmor(pSlayer);
pEffect->setDeadline(output.Duration);
pEffect->setDefBonus(output.Damage);
pSlayer->addEffect(pEffect);
pSlayer->setFlag(Effect::EFFECT_CLASS_HOLY_ARMOR);
// 이로 인하여 바뀌는 능력치를 보낸다.
SLAYER_RECORD prev;
pSlayer->getSlayerRecord(prev);
pSlayer->initAllStat();
pSlayer->sendRealWearingInfo();
pSlayer->sendModifyInfo(prev);
// 경험치를 올린다.
SkillGrade Grade = g_pSkillInfoManager->getGradeByDomainLevel(pSlayer->getSkillDomainLevel(DomainType));
Exp_t ExpUp = 10*(Grade+1);
shareAttrExp(pSlayer, ExpUp, 1, 1, 8, _GCSkillToSelfOK1);
increaseDomainExp(pSlayer, DomainType, pSkillInfo->getPoint(), _GCSkillToSelfOK1);
increaseSkillExp(pSlayer, DomainType, pSkillSlot, pSkillInfo, _GCSkillToSelfOK1);
// 패킷을 만들어 보낸다.
_GCSkillToSelfOK1.setSkillType(SkillType);
_GCSkillToSelfOK1.setCEffectID(CEffectID);
_GCSkillToSelfOK1.setDuration(output.Duration);
_GCSkillToSelfOK2.setObjectID(pSlayer->getObjectID());
_GCSkillToSelfOK2.setSkillType(SkillType);
_GCSkillToSelfOK2.setDuration(output.Duration);
GCAddEffect gcAddEffect;
gcAddEffect.setObjectID(pSlayer->getObjectID());
gcAddEffect.setEffectID(Effect::EFFECT_CLASS_HOLY_ARMOR);
gcAddEffect.setDuration(output.Duration);
pZone->broadcastPacket(X, Y, &gcAddEffect);
// Send Packet
pPlayer->sendPacket(&_GCSkillToSelfOK1);
pZone->broadcastPacket(X, Y, &_GCSkillToSelfOK2, pSlayer);
pSkillSlot->setRunTime(output.Delay);
//.........这里部分代码省略.........
示例8: 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);
//.........这里部分代码省略.........
示例9: execute
//////////////////////////////////////////////////////////////////////////////
// 슬레이어 오브젝트 핸들러
//////////////////////////////////////////////////////////////////////////////
void Liberty::execute(Ousters* pOusters, ObjectID_t TargetObjectID, OustersSkillSlot* pOustersSkillSlot, CEffectID_t CEffectID)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << "begin " << endl;
Assert(pOusters != NULL);
Assert(pOustersSkillSlot != NULL);
try
{
Player* pPlayer = pOusters->getPlayer();
Zone* pZone = pOusters->getZone();
Assert(pPlayer != NULL);
Assert(pZone != NULL);
Item* pWeapon = pOusters->getWearItem(Ousters::WEAR_RIGHTHAND);
if (pWeapon == NULL || pWeapon->getItemClass() != Item::ITEM_CLASS_OUSTERS_WRISTLET || !pOusters->isRealWearingEx(Ousters::WEAR_RIGHTHAND))
{
executeSkillFailException(pOusters, pOustersSkillSlot->getSkillType());
return;
}
Creature* pTargetCreature = pZone->getCreature(TargetObjectID);
//Assert(pTargetCreature != NULL);
// NoSuch제거. by sigi. 2002.5.2
if (pTargetCreature==NULL
|| !pTargetCreature->isOusters())
{
executeSkillFailException(pOusters, getSkillType());
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " end " << endl;
return;
}
Ousters* pTargetOusters = dynamic_cast<Ousters*>(pTargetCreature);
GCSkillToObjectOK1 _GCSkillToObjectOK1;
GCSkillToObjectOK2 _GCSkillToObjectOK2;
GCSkillToObjectOK5 _GCSkillToObjectOK5;
SkillType_t SkillType = pOustersSkillSlot->getSkillType();
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);
int RequiredMP = (int)pSkillInfo->getConsumeMP() + pOustersSkillSlot->getExpLevel()/3;
bool bManaCheck = hasEnoughMana(pOusters, RequiredMP);
bool bTimeCheck = verifyRunTime(pOustersSkillSlot);
bool bRangeCheck = verifyDistance(pOusters, pTargetCreature, pSkillInfo->getRange()) && canHit(pOusters, pTargetCreature, SkillType, pOustersSkillSlot->getExpLevel());
bool bHitRoll = HitRoll::isSuccessMagic(pOusters, pSkillInfo, pOustersSkillSlot);
bool bSatisfyRequire = pOusters->satisfySkillRequire(pSkillInfo);
bool bHPCheck = pTargetOusters->isFlag(Effect::EFFECT_CLASS_PARALYZE);
int Ratio = 0;
EffectParalyze* pEffect = dynamic_cast<EffectParalyze*>(pTargetOusters->findEffect(Effect::EFFECT_CLASS_PARALYZE ));
if (pEffect != NULL )
{
if (pOustersSkillSlot->getExpLevel() <= 15 )
{
Ratio = (int)((pOusters->getLevel() + (pOustersSkillSlot->getExpLevel() * 8.0 / 3.0 ) ) - pEffect->getLevel());
}
else
{
Ratio = (int)((pOusters->getLevel() + 20 + (pOustersSkillSlot->getExpLevel() * 4.0 / 3.0 ) ) - pEffect->getLevel());
if (pOustersSkillSlot->getExpLevel() == 30 ) Ratio = (int)(Ratio * 1.1);
}
}
bool bHitRoll2 = (rand()%100) < Ratio;
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && bHitRoll2 && bSatisfyRequire && bHPCheck)
{
// 마나를 줄인다.
decreaseMana(pOusters, RequiredMP, _GCSkillToObjectOK1);
// 이펙트의 효과와 지속시간을 계산한다.
SkillInput input(pOusters, pOustersSkillSlot);
SkillOutput output;
input.TargetType = SkillInput::TARGET_OTHER;
computeOutput(input, output);
pEffect->setDeadline(0);
// 패킷을 준비해서 보낸다.
_GCSkillToObjectOK1.setSkillType(SkillType);
_GCSkillToObjectOK1.setCEffectID(CEffectID);
_GCSkillToObjectOK1.setTargetObjectID(TargetObjectID);
_GCSkillToObjectOK2.setObjectID(pOusters->getObjectID());
_GCSkillToObjectOK2.setSkillType(SkillType);
_GCSkillToObjectOK5.setObjectID(pOusters->getObjectID());
_GCSkillToObjectOK5.setSkillType(SkillType);
_GCSkillToObjectOK5.setTargetObjectID (TargetObjectID);
// Send Packet
pPlayer->sendPacket(&_GCSkillToObjectOK1);
//.........这里部分代码省略.........
示例10: execute
//////////////////////////////////////////////////////////////////////////////
// 슬레이어 셀프 핸들러
//////////////////////////////////////////////////////////////////////////////
void Revealer::execute(Slayer* pSlayer, 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);
GCSkillToSelfOK1 _GCSkillToSelfOK1;
GCSkillToSelfOK2 _GCSkillToSelfOK2;
SkillType_t SkillType = pSkillSlot->getSkillType();
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);
SkillDomainType_t DomainType = pSkillInfo->getDomainType();
int RequiredMP = (int)pSkillInfo->getConsumeMP();
bool bManaCheck = hasEnoughMana(pSlayer, RequiredMP);
bool bTimeCheck = verifyRunTime(pSkillSlot);
bool bRangeCheck = checkZoneLevelToUseSkill(pSlayer);
bool bHitRoll = HitRoll::isSuccessMagic(pSlayer, pSkillInfo, pSkillSlot);
bool bEffected = pSlayer->isFlag(Effect::EFFECT_CLASS_REVEALER);
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && !bEffected)
{
decreaseMana(pSlayer, RequiredMP, _GCSkillToSelfOK1);
// 기술이 유지되는 시간은 숙련도에 따라서 달라진다.
SkillInput input(pSlayer, pSkillSlot);
SkillOutput output;
computeOutput(input, output);
// 이펙트 오브젝트를 생성해서 붙인다.
EffectRevealer* pEffectRevealer = new EffectRevealer (pSlayer);
pEffectRevealer->setSkillLevel(pSkillSlot->getExpLevel());
pEffectRevealer->setDeadline(output.Duration);
pSlayer->addEffect(pEffectRevealer);
pSlayer->setFlag(Effect::EFFECT_CLASS_REVEALER);
// 이 이펙트가 붙음으로써, 안 보이던 것이 보인다.
pZone->updateMineScan(pSlayer);
//pZone->updateInvisibleScan(pSlayer);
pZone->updateHiddenScan(pSlayer);
// 경험치를 올린다.
SkillGrade Grade = g_pSkillInfoManager->getGradeByDomainLevel(pSlayer->getSkillDomainLevel(DomainType));
Exp_t ExpUp = 10* (Grade + 1)* 2;
shareAttrExp(pSlayer, ExpUp, 1, 8, 1, _GCSkillToSelfOK1);
increaseDomainExp(pSlayer, DomainType, pSkillInfo->getPoint(), _GCSkillToSelfOK1);
// increaseSkillExp(pSlayer, DomainType, pSkillSlot, pSkillInfo, _GCSkillToSelfOK1);
_GCSkillToSelfOK1.setSkillType(SkillType);
_GCSkillToSelfOK1.setCEffectID(CEffectID);
_GCSkillToSelfOK1.setDuration(output.Duration);
_GCSkillToSelfOK2.setObjectID(pSlayer->getObjectID());
_GCSkillToSelfOK2.setSkillType(SkillType);
_GCSkillToSelfOK2.setDuration(output.Duration);
pPlayer->sendPacket(&_GCSkillToSelfOK1);
pZone->broadcastPacket(pSlayer->getX(), pSlayer->getY(), &_GCSkillToSelfOK2, pSlayer);
// 이펙트가 붙었다고 알려준다.
GCAddEffect gcAddEffect;
gcAddEffect.setObjectID(pSlayer->getObjectID());
gcAddEffect.setEffectID(Effect::EFFECT_CLASS_REVEALER);
gcAddEffect.setDuration(output.Duration);
pZone->broadcastPacket(pSlayer->getX(), pSlayer->getY(), &gcAddEffect);
pSkillSlot->setRunTime(output.Delay);
uint PartyID = pSlayer->getPartyID();
if (PartyID != 0)
{
LocalPartyManager* pLPM = pZone->getLocalPartyManager();
pLPM->shareRevealer(PartyID, pSlayer, output.Duration);
}
}
else
{
executeSkillFailNormal(pSlayer, getSkillType(), NULL);
}
}
catch(Throwable & t)
{
executeSkillFailException(pSlayer, getSkillType());
}
//.........这里部分代码省略.........
示例11: execute
//////////////////////////////////////////////////////////////////////////////
// 슬레이어 타일 핸들러
//////////////////////////////////////////////////////////////////////////////
void MagicElusion::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;
Assert(pSlayer != NULL);
Assert(pSkillSlot != 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);
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()) && checkZoneLevelToUseSkill(pSlayer);
bool bHitRoll = HitRoll::isSuccessMagicElusion(pSlayer);
bool bTileCheck = false;
VSRect rect(0, 0, pZone->getWidth()-1, pZone->getHeight()-1);
if (rect.ptInRect(X, Y)) bTileCheck = true;
// 이펙트의 지속시간을 계산한다.
SkillInput input(pSlayer, pSkillSlot);
SkillOutput output;
computeOutput(input, output);
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && bTileCheck)
{
decreaseMana(pSlayer, RequiredMP, _GCSkillToTileOK1);
Range_t Range = 2;
int oX, oY;
list<Creature*> cList; // denier list
ObjectRegistry & objectregister = pZone->getObjectRegistry();
// 일단 이미 sanctuary가 있는지 검색한다.
for(oY = -1; oY <= 1; oY++)
for(oX = -1; oX <= 1; oX++)
{
int tileX = X+oX;
int tileY = Y+oY;
if (rect.ptInRect(tileX, tileY))
{
Tile& tile = pZone->getTile(tileX, tileY);
if (tile.canAddEffect())
{
Effect* pOldEffect = tile.getEffect(Effect::EFFECT_CLASS_MAGIC_ELUSION);
// 이미 있다면
// 기술 실패다.
if (pOldEffect != NULL)
{
executeSkillFailNormal(pSlayer, getSkillType(), NULL);
return;
}
}
else
{
executeSkillFailNormal(pSlayer, getSkillType(), NULL);
return;
}
}
}
for(oY = -1; oY <= 1; oY++)
for(oX = -1; oX <= 1; oX++)
{
int tileX = X+oX;
int tileY = Y+oY;
if (rect.ptInRect(tileX, tileY))
{
//.........这里部分代码省略.........
示例12: ARSMGexecute
//////////////////////////////////////////////////////////////////////////////
// 슬레이어 타일 핸들러 - AR이나 SMG를 들고 있을 경우
//////////////////////////////////////////////////////////////////////////////
void MoleShot::ARSMGexecute(Slayer* pSlayer, ZoneCoord_t X, ZoneCoord_t Y, SkillSlot* pSkillSlot, CEffectID_t CEffectID)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " SGexecute Begin" << endl;
Assert(pSlayer != NULL);
Assert(pSkillSlot != 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;
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(getSkillType());
SkillDomainType_t DomainType = pSkillInfo->getDomainType();
Level_t SkillLevel = pSkillSlot->getExpLevel();
Item* pWeapon = pSlayer->getWearItem(Slayer::WEAR_RIGHTHAND);
Assert(pWeapon != NULL);
bool bIncreaseExp = pSlayer->isRealWearingEx(Slayer::WEAR_RIGHTHAND);
int RequiredMP = (int)pSkillInfo->getConsumeMP();
bool bManaCheck = hasEnoughMana(pSlayer, RequiredMP);
bool bTimeCheck = verifyRunTime(pSkillSlot);
bool bRangeCheck = verifyDistance(pSlayer, X, Y, pWeapon->getRange());
bool bBulletCheck = (getRemainBullet(pWeapon) > 0) ? true : false;
// 총알 숫자는 무조건 떨어뜨린다.
Bullet_t RemainBullet = 0;
if (bBulletCheck)
{
decreaseBullet(pWeapon);
// 한발쓸때마다 저장할 필요 없다. by sigi. 2002.5.9
// pWeapon->save(pSlayer->getName(), STORAGE_GEAR, 0, Slayer::WEAR_RIGHTHAND, 0);
RemainBullet = getRemainBullet(pWeapon);
}
// 데미지, 투힛 보너스, 좌표와 방향을 구한다.
int ToHitBonus = 0;
int DamageBonus = 0;
int ToHitPenalty = 0;
int DamagePenalty = 0;
ZoneCoord_t myX = pSlayer->getX();
ZoneCoord_t myY = pSlayer->getY();
Dir_t dir = calcDirection(myX, myY, X, Y);
bool bHit = false; // 한번이라도 맞았는가를 저장하기 위한 변수
Damage_t Damage = 0; // 마지막으로 입힌 데미지를 저장하기 위한 변수
// AR이나 SMG일 경우에는 2부터 시작해서 4까지의 splash 데미지를 입힌다.
int Splash = 1 + pSkillSlot->getExpLevel()/30 + 1;
if (bManaCheck && bTimeCheck && bRangeCheck && bBulletCheck)
{
decreaseMana(pSlayer, RequiredMP, _GCSkillToTileOK1);
SkillInput input(pSlayer, pSkillSlot);
SkillOutput output;
computeOutput(input, output);
// 음수 값이 돌아온다.
ToHitPenalty = getPercentValue(pSlayer->getToHit(), output.ToHit);
list<Creature*> cList;
list<Creature*> creatureList;
getSplashVictims(pZone, X, Y, Creature::CREATURE_CLASS_MAX, creatureList, Splash);
Level_t maxEnemyLevel = 0;
uint EnemyNum = 0;
list<Creature*>::iterator itr = creatureList.begin();
for (; itr != creatureList.end(); itr++)
{
Creature* pTargetCreature = (*itr);
Assert(pTargetCreature != NULL);
ToHitBonus = computeArmsWeaponToHitBonus(pWeapon, myX, myY, pTargetCreature->getX(), pTargetCreature->getY());
DamageBonus = computeArmsWeaponDamageBonus(pWeapon, myX, myY, pTargetCreature->getX(), pTargetCreature->getY());
bool bInvokerCheck = (pTargetCreature->getObjectID() == pSlayer->getObjectID()) ? true : false;
bool bRaceCheck = pTargetCreature->isSlayer() || pTargetCreature->isNPC();
bool bHitRoll = HitRoll::isSuccess(pSlayer, pTargetCreature, ToHitPenalty + ToHitBonus);
bool bPK = verifyPK(pSlayer, pTargetCreature);
bool bZoneLevelCheck = checkZoneLevelToHitTarget(pTargetCreature);
if (pTargetCreature->isFlag(Effect::EFFECT_CLASS_NO_DAMAGE )
|| pTargetCreature->isFlag(Effect::EFFECT_CLASS_COMA )
//.........这里部分代码省略.........
示例13: execute
//////////////////////////////////////////////////////////////////////////////
// 슬레이어 오브젝트
//////////////////////////////////////////////////////////////////////////////
void JabbingVein::execute (Slayer* pSlayer, ObjectID_t TargetObjectID, SkillSlot* pSkillSlot, CEffectID_t CEffectID)
throw(Error)
{
__BEGIN_TRY __BEGIN_DEBUG
//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);
// NoSuch제거. by sigi. 2002.5.2
if (pTargetCreature==NULL
|| !canAttack(pSlayer, pTargetCreature )
|| pTargetCreature->isNPC())
{
executeSkillFailException(pSlayer, getSkillType());
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End" << endl;
return;
}
GCAttackArmsOK1 _GCAttackArmsOK1;
GCAttackArmsOK2 _GCAttackArmsOK2;
GCAttackArmsOK3 _GCAttackArmsOK3;
GCAttackArmsOK4 _GCAttackArmsOK4;
GCAttackArmsOK5 _GCAttackArmsOK5;
// 들고 있는 무기가 없거나, 총 계열 무기가 아니라면 기술을 쓸 수 없다.
// 총 계열 무기 중에서도 SG나 SR은 JabbingVein를 쓸 수가 없다.
// SG, SR 도 이제 쓸 수 있다.
// 2003. 1. 14 by bezz
Item* pWeapon = pSlayer->getWearItem(Slayer::WEAR_RIGHTHAND);
if (pWeapon == NULL || isArmsWeapon(pWeapon) == false )
// pWeapon->getItemClass() == Item::ITEM_CLASS_SG ||
// pWeapon->getItemClass() == Item::ITEM_CLASS_SR)
{
executeSkillFailException(pSlayer, getSkillType());
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End" << endl;
return;
}
bool bIncreaseExp = pSlayer->isRealWearingEx(Slayer::WEAR_RIGHTHAND);
SkillType_t SkillType = pSkillSlot->getSkillType();
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);
SkillDomainType_t DomainType = pSkillInfo->getDomainType();
SkillLevel_t SkillLevel = pSkillSlot->getExpLevel();
SkillInput input(pSlayer, pSkillSlot);
SkillOutput output;
if (pTargetCreature->isPC() )
{
input.TargetType = SkillInput::TARGET_PC;
}
else
{
input.TargetType = SkillInput::TARGET_MONSTER;
}
computeOutput(input, output);
// 페널티 값을 계산한다.
int ToHitPenalty = getPercentValue(pSlayer->getToHit(), output.ToHit);
int RequiredMP = (int)pSkillInfo->getConsumeMP();
bool bManaCheck = hasEnoughMana(pSlayer, RequiredMP);
bool bTimeCheck = verifyRunTime(pSkillSlot);
bool bRangeCheck = verifyDistance(pSlayer, pTargetCreature, pWeapon->getRange());
bool bBulletCheck = (getRemainBullet(pWeapon) > 0) ? true : false;
bool bHitRoll = HitRoll::isSuccess(pSlayer, pTargetCreature, ToHitPenalty);
bool bPK = verifyPK(pSlayer, pTargetCreature);
// 총알 숫자는 무조건 떨어뜨린다.
Bullet_t RemainBullet = 0;
if (bBulletCheck)
{
// 총알 숫자를 떨어뜨리고, 저장하고, 남은 총알 숫자를 받아온다.
decreaseBullet(pWeapon);
// 한발쓸때마다 저장할 필요 없다. by sigi. 2002.5.9
//pWeapon->save(pSlayer->getName(), STORAGE_GEAR, 0, Slayer::WEAR_RIGHTHAND, 0);
RemainBullet = getRemainBullet(pWeapon);
}
if (bManaCheck && bTimeCheck && bRangeCheck && bBulletCheck && bHitRoll && bPK)
{
//cout << pSlayer->getName().c_str() << " Attack OK" << endl;
decreaseMana(pSlayer, RequiredMP, _GCAttackArmsOK1);
//.........这里部分代码省略.........
示例14: execute
//////////////////////////////////////////////////////////////////////////////
// 아우스터즈 타일 핸들러
//////////////////////////////////////////////////////////////////////////////
void SummonGroundElemental::execute(Ousters* pOusters, ZoneCoord_t X, ZoneCoord_t Y, OustersSkillSlot* pOustersSkillSlot, CEffectID_t CEffectID)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << "begin " << endl;
Assert(pOusters != NULL);
Assert(pOustersSkillSlot != NULL);
BYTE Grade = 0;
if (pOustersSkillSlot->getExpLevel() < 15 ) Grade = 0;
else if (pOustersSkillSlot->getExpLevel() < 30 ) Grade = 1;
else Grade = 2;
try
{
Player* pPlayer = pOusters->getPlayer();
Zone* pZone = pOusters->getZone();
Assert(pPlayer != NULL);
Assert(pZone != NULL);
Item* pWeapon = pOusters->getWearItem(Ousters::WEAR_RIGHTHAND);
if (pWeapon == NULL || pWeapon->getItemClass() != Item::ITEM_CLASS_OUSTERS_WRISTLET || !pOusters->isRealWearingEx(Ousters::WEAR_RIGHTHAND))
{
executeSkillFailException(pOusters, pOustersSkillSlot->getSkillType(), Grade);
return;
}
GCSkillToTileOK1 _GCSkillToTileOK1;
GCSkillToTileOK2 _GCSkillToTileOK2;
GCSkillToTileOK3 _GCSkillToTileOK3;
GCSkillToTileOK4 _GCSkillToTileOK4;
GCSkillToTileOK5 _GCSkillToTileOK5;
GCSkillToTileOK6 _GCSkillToTileOK6;
SkillType_t SkillType = pOustersSkillSlot->getSkillType();
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);
// 데미지와 지속 시간을 계산한다.
SkillInput input(pOusters, pOustersSkillSlot);
SkillOutput output;
computeOutput(input, output);
int RequiredMP = (int)pSkillInfo->getConsumeMP() + pOustersSkillSlot->getExpLevel()/3;
bool bManaCheck = hasEnoughMana(pOusters, RequiredMP);
bool bTimeCheck = verifyRunTime(pOustersSkillSlot);
bool bRangeCheck = verifyDistance(pOusters, X, Y, pSkillInfo->getRange());
bool bHitRoll = HitRoll::isSuccessMagic(pOusters, pSkillInfo, pOustersSkillSlot);
bool bSatisfyRequire = pOusters->satisfySkillRequire(pSkillInfo);
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;
// }
TPOINT pt = findSuitablePosition(pZone, X, Y, Creature::MOVE_MODE_WALKING);
if (pt.x == -1 )
{
bTileCheck = false;
}
else
{
bTileCheck = true;
for (int oX = pt.x - 2 ; oX <= pt.x + 2 ; ++oX )
for (int oY = pt.y - 2 ; oY <= pt.y + 2 ; ++oY )
{
if (!rect.ptInRect(oX, oY ) ) continue;
if (pZone->getTile(oX, oY).getEffect(Effect::EFFECT_CLASS_GROUND_ELEMENTAL_AURA ) != NULL )
{
bTileCheck = false;
break;
}
}
}
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && bTileCheck && bSatisfyRequire)
{
decreaseMana(pOusters, RequiredMP, _GCSkillToTileOK1);
int oX, oY;
/*
HP = 200 + (S_level * 10)
Defense = 50 + (S_level * 2)
Protection = 20 + (S_level * 2)
Poison Resistance = 70%
Acid Resistance = 60%
Curse Resistance = 100%
Blood Resistance = 50%
Regen = 1 HP per 1 sec
//.........这里部分代码省略.........
示例15: execute
//////////////////////////////////////////////////////////////////////////////
// 슬레이어 셀프 핸들러
//////////////////////////////////////////////////////////////////////////////
void GroundBless::execute(Ousters* pOusters, OustersSkillSlot* pOustersSkillSlot, CEffectID_t CEffectID)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " Begin(slayer)" << endl;
Assert(pOusters != NULL);
Assert(pOustersSkillSlot != NULL);
try
{
Player* pPlayer = pOusters->getPlayer();
Zone* pZone = pOusters->getZone();
Assert(pPlayer != NULL);
Assert(pZone != NULL);
Item* pWeapon = pOusters->getWearItem(Ousters::WEAR_RIGHTHAND);
if (pWeapon == NULL || pWeapon->getItemClass() != Item::ITEM_CLASS_OUSTERS_WRISTLET || !pOusters->isRealWearingEx(Ousters::WEAR_RIGHTHAND))
{
executeSkillFailException(pOusters, pOustersSkillSlot->getSkillType());
return;
}
GCSkillToSelfOK1 _GCSkillToSelfOK1;
GCSkillToSelfOK2 _GCSkillToSelfOK2;
SkillType_t SkillType = pOustersSkillSlot->getSkillType();
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);
//SkillDomainType_t DomainType = pSkillInfo->getDomainType();
//SkillLevel_t SkillLevel = pOustersSkillSlot->getExpLevel();
int RequiredMP = (int)pSkillInfo->getConsumeMP() + pOustersSkillSlot->getExpLevel()/2;
bool bManaCheck = hasEnoughMana(pOusters, RequiredMP);
bool bTimeCheck = verifyRunTime(pOustersSkillSlot);
bool bRangeCheck = checkZoneLevelToUseSkill(pOusters);
bool bHitRoll = HitRoll::isSuccessMagic(pOusters, pSkillInfo, pOustersSkillSlot);
bool bEffected = pOusters->isFlag(Effect::EFFECT_CLASS_GROUND_BLESS);
bool bSatisfyRequire = pOusters->satisfySkillRequire(pSkillInfo);
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && !bEffected && bSatisfyRequire)
{
decreaseMana(pOusters, RequiredMP, _GCSkillToSelfOK1);
// 지속 시간을 계산한다.
SkillInput input(pOusters, pOustersSkillSlot);
SkillOutput output;
input.STR = pOusters->getSTR(ATTR_BASIC);
input.DEX = pOusters->getDEX(ATTR_BASIC);
input.INTE = pOusters->getINT(ATTR_BASIC);
computeOutput(input, output);
// 이팩트 클래스를 만들어 붙인다.
EffectGroundBless* pEffect = new EffectGroundBless(pOusters);
pEffect->setDeadline(output.Duration);
pEffect->setBonus(output.Damage);
pOusters->addEffect(pEffect);
pOusters->setFlag(Effect::EFFECT_CLASS_GROUND_BLESS);
pOusters->initAllStatAndSend();
_GCSkillToSelfOK1.setSkillType(SkillType);
_GCSkillToSelfOK1.setCEffectID(CEffectID);
_GCSkillToSelfOK1.setDuration(output.Duration);
_GCSkillToSelfOK2.setObjectID(pOusters->getObjectID());
_GCSkillToSelfOK2.setSkillType(SkillType);
_GCSkillToSelfOK2.setDuration(output.Duration);
pPlayer->sendPacket(&_GCSkillToSelfOK1);
pZone->broadcastPacket(pOusters->getX(), pOusters->getY(), &_GCSkillToSelfOK2, pOusters);
GCAddEffect gcAddEffect;
gcAddEffect.setObjectID(pOusters->getObjectID());
gcAddEffect.setEffectID(pEffect->getEffectClass());
gcAddEffect.setDuration(output.Duration);
pZone->broadcastPacket(pOusters->getX(), pOusters->getY(), &gcAddEffect);
pOustersSkillSlot->setRunTime(output.Delay);
}
else
{
executeSkillFailNormal(pOusters, getSkillType(), NULL);
}
}
catch (Throwable & t)
{
executeSkillFailException(pOusters, getSkillType());
}
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End(slayer)" << endl;
__END_CATCH
}