本文整理汇总了C++中GCAddEffect::setObjectID方法的典型用法代码示例。如果您正苦于以下问题:C++ GCAddEffect::setObjectID方法的具体用法?C++ GCAddEffect::setObjectID怎么用?C++ GCAddEffect::setObjectID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GCAddEffect
的用法示例。
在下文中一共展示了GCAddEffect::setObjectID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
//////////////////////////////////////////////////////////////////////////////
// 슬레이어 셀프 핸들러
//////////////////////////////////////////////////////////////////////////////
void PotentialExplosion::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);
SkillType_t SkillType = pSkillSlot->getSkillType();
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());
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End" << endl;
return;
}
GCSkillToSelfOK1 _GCSkillToSelfOK1;
GCSkillToSelfOK2 _GCSkillToSelfOK2;
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_POTENTIAL_EXPLOSION);
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && !bEffected)
{
decreaseMana(pSlayer, RequiredMP, _GCSkillToSelfOK1);
SkillInput input(pSlayer, pSkillSlot);
SkillOutput output;
computeOutput(input, output);
// HP가 반보다 작을 때는 약간 더 올라간다.
// by sigi. 2002.12.3
if (pSlayer->getHP(ATTR_CURRENT) < (pSlayer->getHP(ATTR_MAX)/2))
{
//output.Damage += 4;
output.Damage = 8 + input.SkillLevel/15;
}
else
{
output.Damage = 3 + input.SkillLevel/20;
}
int diffSTR = output.Damage;
int diffDEX = output.Damage;
EffectPotentialExplosion* pEffect = new EffectPotentialExplosion(pSlayer);
pEffect->setDeadline(output.Duration);
pEffect->setDiffSTR(diffSTR);
pEffect->setDiffDEX(diffDEX);
pSlayer->addEffect(pEffect);
pSlayer->setFlag(Effect::EFFECT_CLASS_POTENTIAL_EXPLOSION);
// 이로 인하여 바뀌는 능력치를 보낸다.
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, 8, 1, 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);
//.........这里部分代码省略.........
示例2: execute
//////////////////////////////////////////////////////////////////////////////
// 슬레이어 오브젝트 핸들러
//////////////////////////////////////////////////////////////////////////////
void ProtectionFromAcid::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);
// NoSuch제거. by sigi. 2002.5.2
if (pTargetCreature==NULL
|| !pTargetCreature->isSlayer()
)
{
executeSkillFailException(pSlayer, getSkillType());
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " end " << endl;
return;
}
GCSkillToObjectOK1 _GCSkillToObjectOK1;
GCSkillToObjectOK2 _GCSkillToObjectOK2;
GCSkillToObjectOK5 _GCSkillToObjectOK5;
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 = verifyDistance(pSlayer, pTargetCreature, pSkillInfo->getRange());
bool bHitRoll = HitRoll::isSuccessMagic(pSlayer, pSkillInfo, pSkillSlot);
bool bEffected = pTargetCreature->isFlag(Effect::EFFECT_CLASS_PROTECTION_FROM_ACID);
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && !bEffected)
{
// 마나를 줄인다.
decreaseMana(pSlayer, RequiredMP, _GCSkillToObjectOK1);
// 경험치를 올려준다.
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);
// 이펙트의 효과와 지속시간을 계산한다.
SkillInput input(pSlayer, pSkillSlot);
SkillOutput output;
input.TargetType = SkillInput::TARGET_OTHER;
computeOutput(input, output);
// 이펙트를 생성해서 붙인다.
EffectProtectionFromAcid* pEPFP = new EffectProtectionFromAcid (pTargetCreature);
Assert(pEPFP != NULL);
pEPFP->setDeadline(output.Duration);
pEPFP->setResist(output.Damage);
pTargetCreature->addEffect(pEPFP);
pTargetCreature->setFlag(Effect::EFFECT_CLASS_PROTECTION_FROM_ACID);
if (pTargetCreature->isSlayer())
{
Slayer* pTargetSlayer = dynamic_cast<Slayer*>(pTargetCreature);
SLAYER_RECORD prev;
pTargetSlayer->getSlayerRecord(prev);
pTargetSlayer->initAllStat();
pTargetSlayer->addModifyInfo(prev, _GCSkillToObjectOK1);
}
else
{
Assert(false);
}
// 패킷을 준비해서 보낸다.
_GCSkillToObjectOK1.setSkillType(SkillType);
_GCSkillToObjectOK1.setCEffectID(CEffectID);
_GCSkillToObjectOK1.setTargetObjectID(TargetObjectID);
_GCSkillToObjectOK1.setDuration(output.Duration);
_GCSkillToObjectOK2.setObjectID(pSlayer->getObjectID());
_GCSkillToObjectOK2.setSkillType(SkillType);
_GCSkillToObjectOK2.setDuration (output.Duration);
_GCSkillToObjectOK5.setObjectID(pSlayer->getObjectID());
_GCSkillToObjectOK5.setSkillType(SkillType);
//.........这里部分代码省略.........
示例3: 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
}
示例4: 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
}
示例5: execute
//////////////////////////////////////////////////////////////////////////////
// 슬레이어 셀프
//////////////////////////////////////////////////////////////////////////////
void InstallTurret::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 || !isArmsWeapon(pWeapon) || pSlayer->hasRelicItem())
{
executeSkillFailException(pSlayer, getSkillType());
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End" << endl;
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();
ZoneCoord_t X = pSlayer->getX();
ZoneCoord_t Y = pSlayer->getY();
Tile& rTile = pZone->getTile(X,Y);
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_INSTALL_TURRET);
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && !bEffected)
{
decreaseMana(pSlayer, RequiredMP, _GCSkillToSelfOK1);
SkillInput input(pSlayer, pSkillSlot);
SkillOutput output;
computeOutput(input, output);
EffectInstallTurret* pEffect = new EffectInstallTurret(pSlayer);
pEffect->setDeadline(output.Duration);
pEffect->setDamage(output.Damage);
pEffect->setDefense(output.ToHit);
//cout << "Turret Duration : " << output.Duration << endl;
//cout << "Turret Delay : " << output.Delay << endl;
pSlayer->setFlag(pEffect->getEffectClass());
pSlayer->addEffect(pEffect);
GCAddEffect gcAE;
gcAE.setObjectID(pSlayer->getObjectID());
gcAE.setDuration(output.Duration);
gcAE.setEffectID(pEffect->getSendEffectClass());
pZone->broadcastPacket(pSlayer->getX(), pSlayer->getY(), &gcAE);
SLAYER_RECORD prev;
pSlayer->getSlayerRecord(prev);
pSlayer->initAllStat();
pSlayer->sendRealWearingInfo();
pSlayer->addModifyInfo(prev, _GCSkillToSelfOK1);
// 패킷을 만들어 보낸다.
_GCSkillToSelfOK1.setSkillType(SkillType);
_GCSkillToSelfOK1.setCEffectID(CEffectID);
_GCSkillToSelfOK1.setDuration(output.Duration);
_GCSkillToSelfOK2.setObjectID(pSlayer->getObjectID());
_GCSkillToSelfOK2.setSkillType(SkillType);
_GCSkillToSelfOK2.setDuration(output.Duration);
// Send Packet
pPlayer->sendPacket(&_GCSkillToSelfOK1);
pZone->broadcastPacket(X, Y, &_GCSkillToSelfOK2, pSlayer);
pSkillSlot->setRunTime(output.Delay);
}
else
{
executeSkillFailNormal(pSlayer, getSkillType(), NULL);
}
//.........这里部分代码省略.........
示例6: execute
//////////////////////////////////////////////////////////////////////////////
// 슬레이어 셀프 핸들러
//////////////////////////////////////////////////////////////////////////////
void MindControl::execute(Slayer* pSlayer, SkillSlot* pSkillSlot, CEffectID_t CEffectID)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " Begin(slayerself)" << 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 myX = pSlayer->getX();
ZoneCoord_t myY = 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_MIND_CONTROL);
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && !bEffected)
{
decreaseMana(pSlayer, RequiredMP, _GCSkillToSelfOK1);
SkillInput input(pSlayer, pSkillSlot);
SkillOutput output;
computeOutput(input, output);
// 이펙트를 만들어 붙인다.
EffectMindControl* pEffect = new EffectMindControl(pSlayer);
pEffect->setDeadline(output.Duration);
pEffect->setDefenseBonus(output.Damage);
pEffect->setToHitBonus(output.Damage);
pSlayer->setFlag(Effect::EFFECT_CLASS_MIND_CONTROL);
pSlayer->addEffect(pEffect);
// 이펙트를 붙였으니, 능력치를 재계산한다.
SLAYER_RECORD prev;
pSlayer->getSlayerRecord(prev);
pSlayer->initAllStat();
pSlayer->sendRealWearingInfo();
pSlayer->addModifyInfo(prev, _GCSkillToSelfOK1);
// 경험치를 올려준다.
SkillGrade Grade = g_pSkillInfoManager->getGradeByDomainLevel(pSlayer->getSkillDomainLevel(DomainType));
Exp_t ExpUp = 10* (Grade + 1);
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(myX, myY, &_GCSkillToSelfOK2, pSlayer);
GCAddEffect gcAddEffect;
gcAddEffect.setObjectID(pSlayer->getObjectID());
gcAddEffect.setEffectID(Effect::EFFECT_CLASS_MIND_CONTROL);
gcAddEffect.setDuration(output.Duration);
pZone->broadcastPacket(myX, myY, &gcAddEffect);
pSkillSlot->setRunTime(output.Delay);
}
else
{
executeSkillFailNormal(pSlayer, getSkillType(), NULL);
}
}
catch (Throwable & t)
{
executeSkillFailException(pSlayer, getSkillType());
}
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End(slayerself)" << endl;
__END_CATCH
}
示例7: execute
//////////////////////////////////////////////////////////////////////////////
// 슬레이어 셀프 핸들러
//////////////////////////////////////////////////////////////////////////////
void ChargingPower::execute(Slayer* pSlayer, SkillSlot* pSkillSlot, CEffectID_t CEffectID)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " Begin(slayerself)" << 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());
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End(slayerself)" << endl;
return;
}
bool bIncreaseExp = 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();
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_CHARGING_POWER) || pSlayer->isFlag(Effect::EFFECT_CLASS_BERSERKER);
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && !bEffected)
{
decreaseMana(pSlayer, RequiredMP, _GCSkillToSelfOK1);
// 스킬 레벨에 따라 데미지 보너스가 달라진다.
SkillInput input(pSlayer, pSkillSlot);
SkillOutput output;
computeOutput(input, output);
// 이펙트 클래스를 만들어 붙인다.
EffectChargingPower* pEffect = new EffectChargingPower(pSlayer);
pEffect->setDeadline(output.Duration);
pEffect->setDamageBonus(output.Damage);
pSlayer->addEffect(pEffect);
pSlayer->setFlag(Effect::EFFECT_CLASS_CHARGING_POWER);
// 이로 인하여 바뀌는 능력치를 보낸다.
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);
if (bIncreaseExp )
{
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(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_CHARGING_POWER);
gcAddEffect.setDuration(output.Duration);
pZone->broadcastPacket(pSlayer->getX(), pSlayer->getY(), &gcAddEffect);
//.........这里部分代码省略.........
示例8: 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)
{
//.........这里部分代码省略.........
示例9: execute
//////////////////////////////////////////////////////////////////////////////
// 슬레이어 셀프 핸들러
//////////////////////////////////////////////////////////////////////////////
void Light::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);
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_LIGHT);
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && !bEffected)
{
decreaseMana(pSlayer, RequiredMP, _GCSkillToSelfOK1);
// 기술이 유지되는 시간은 숙련도에 따라서 달라진다.
SkillInput input(pSlayer, pSkillSlot);
SkillOutput output;
computeOutput(input, output);
Sight_t CurrentSight = pSlayer->getSight();
Sight_t oldSight = CurrentSight;
// 혹시라도 옛날 이펙트가 남아있다면 삭제한다.
if (pSlayer->isEffect(Effect::EFFECT_CLASS_LIGHT))
{
EffectLight* pOldEffectLight = (EffectLight*)pSlayer->findEffect(Effect::EFFECT_CLASS_LIGHT);
CurrentSight = pOldEffectLight->getOldSight();
pSlayer->deleteEffect(Effect::EFFECT_CLASS_LIGHT);
}
// 이펙트를 만들어 붙인다.
EffectLight* pEffectLight = new EffectLight (pSlayer);
pEffectLight->setDeadline(output.Duration);
pEffectLight->setOldSight(CurrentSight);
pSlayer->setFlag(Effect::EFFECT_CLASS_LIGHT);
pSlayer->addEffect(pEffectLight);
//pEffectLight->create(pSlayer->getName());
// 시야처리..
Sight_t MinSight = pSkillInfo->getMinDamage();
Sight_t MaxSight = pSkillInfo->getMaxDamage();
Sight_t NewSight = MinSight + (MaxSight - MinSight)* SkillLevel / 100;
// 시야 변경에 따른 오브젝트 가감 패킷을 보낸다.
pZone->updateScan(pSlayer, oldSight, NewSight);
pSlayer->setSight(NewSight);
if (NewSight != oldSight) _GCSkillToSelfOK1.addShortData(MODIFY_VISION, NewSight);
_GCSkillToSelfOK1.setSkillType(SkillType);
_GCSkillToSelfOK1.setCEffectID(CEffectID);
_GCSkillToSelfOK1.setDuration(output.Duration);
_GCSkillToSelfOK2.setObjectID(pSlayer->getObjectID());
_GCSkillToSelfOK2.setSkillType(SkillType);
_GCSkillToSelfOK2.setDuration(output.Duration);
// EXP UP!
SkillDomainType_t DomainType = pSkillInfo->getDomainType();
SkillGrade Grade = g_pSkillInfoManager->getGradeByDomainLevel(pSlayer->getSkillDomainLevel(DomainType));
Exp_t ExpUp = 10* (Grade + 1)* 2;
shareAttrExp(pSlayer, ExpUp, 1, 1, 8, _GCSkillToSelfOK1);
increaseDomainExp(pSlayer, DomainType, pSkillInfo->getPoint(), _GCSkillToSelfOK1);
increaseSkillExp(pSlayer, DomainType, pSkillSlot, pSkillInfo, _GCSkillToSelfOK1);
// Send Packet
pPlayer->sendPacket(&_GCSkillToSelfOK1);
pZone->broadcastPacket(pSlayer->getX(), pSlayer->getY(), &_GCSkillToSelfOK2 , pSlayer);
// 이펙트가 붙었다고 알려준다.
GCAddEffect gcAddEffect;
//.........这里部分代码省略.........
示例10: execute
//.........这里部分代码省略.........
if (pTargetCreature->isFlag(Effect::EFFECT_CLASS_BURNING_SOL_CHARGE_1 ) )
{
Effect* pEffect = pTargetCreature->findEffect(Effect::EFFECT_CLASS_BURNING_SOL_CHARGE_1);
if (pEffect != NULL ) pEffect->setDeadline(0);
}
// 저주에 걸리면 디펜스가 떨어진다.
// 디펜스 페널티가 없어짐. 2002.05.09 - by bezz
/* if (pTargetCreature->isSlayer())
{
Slayer* pTargetSlayer = dynamic_cast<Slayer*>(pTargetCreature);
SLAYER_RECORD prev;
pTargetSlayer->getSlayerRecord(prev);
pTargetSlayer->initAllStat();
pTargetSlayer->addModifyInfo(prev, _GCSkillToObjectOK2);
}
else if (pTargetCreature->isVampire())
{
Vampire* pTargetVampire = dynamic_cast<Vampire*>(pTargetCreature);
VAMPIRE_RECORD prev;
pTargetVampire->getVampireRecord(prev);
pTargetVampire->initAllStat();
pTargetVampire->addModifyInfo(prev, _GCSkillToObjectOK2);
}
else if (pTargetCreature->isMonster())
{
Monster* pTargetMonster = dynamic_cast<Monster*>(pTargetCreature);
pTargetMonster->initAllStat();
}
else Assert(false);
*/
// 이펙트가 붙었다는 것을 브로드캐스팅해준다.
GCAddEffect gcAddEffect;
gcAddEffect.setObjectID(pTargetCreature->getObjectID());
gcAddEffect.setEffectID(Effect::EFFECT_CLASS_PARALYZE);
gcAddEffect.setDuration(output.Duration);
pZone->broadcastPacket(targetX, targetY, &gcAddEffect);
_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);
_GCSkillToObjectOK5.setObjectID(pVampire->getObjectID());
_GCSkillToObjectOK5.setTargetObjectID(TargetObjectID);
_GCSkillToObjectOK5.setSkillType(SkillType);
_GCSkillToObjectOK5.setDuration(output.Duration);
_GCSkillToObjectOK6.setXY(vampX, vampY);
_GCSkillToObjectOK6.setSkillType(SkillType);
_GCSkillToObjectOK6.setDuration(output.Duration);
if (bCanSeeCaster) // 10은 땜빵 수치다.
{
computeAlignmentChange(pTargetCreature, 10, pVampire, &_GCSkillToObjectOK2, &_GCSkillToObjectOK1);
示例11: execute
void Mephisto::execute(Vampire* pVampire)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " Begin(slayerself)" << endl;
Assert(pVampire != NULL);
if(!pVampire->hasSkill(SKILL_MEPHISTO) ) return;
try
{
Player* pPlayer = pVampire->getPlayer();
Zone* pZone = pVampire->getZone();
Assert(pPlayer != NULL);
Assert(pZone != NULL);
GCSkillToObjectOK1 _GCSkillToObjectOK1;
GCSkillToObjectOK2 _GCSkillToObjectOK2;
GCSkillToObjectOK3 _GCSkillToObjectOK3;
ZoneCoord_t myX = pVampire->getX();
ZoneCoord_t myY = pVampire->getY();
int oX, oY;
VSRect rect(0, 0, pZone->getWidth()-1, pZone->getHeight()-1);
for(oX = -4; oX <= 4; oX++)
for(oY = -4; oY <= 4; oY++)
{
int tileX = myX+oX;
int tileY = myY+oY;
if (!rect.ptInRect(tileX, tileY)) continue;
// 타일 위에! 뱀파이어가 있는지 본다!
Tile& tile = pZone->getTile(tileX, tileY);
Creature * pTargetCreature = NULL;
if(tile.hasCreature(Creature::MOVE_MODE_WALKING)) pTargetCreature = tile.getCreature(Creature::MOVE_MODE_WALKING);
if(pTargetCreature != NULL && pTargetCreature != pVampire && pTargetCreature->isVampire() ) {
bool bEffected = pTargetCreature->isFlag(Effect::EFFECT_CLASS_MEPHISTO);
if(bEffected ) continue;
Vampire* pTargetVampire= dynamic_cast<Vampire*>(pTargetCreature);
// 스킬 레벨에 따라 데미지 보너스가 달라진다.
SkillInput input(pVampire);
SkillOutput output;
input.SkillLevel = pVampire->getSTR()+pVampire->getDEX()+pVampire->getINT();
input.DomainLevel = pVampire->getLevel();
computeOutput(input, output);
// 이펙트 클래스를 만들어 붙인다.
EffectMephisto* pEffect = new EffectMephisto(pTargetVampire);
pEffect->setDeadline(output.Duration);
pEffect->setBonus(output.Damage);
pTargetVampire->addEffect(pEffect);
pTargetVampire->setFlag(Effect::EFFECT_CLASS_MEPHISTO);
// 이로 인하여 바뀌는 능력치를 보낸다.
VAMPIRE_RECORD prev;
pTargetVampire->getVampireRecord(prev);
pTargetVampire->initAllStat();
pTargetVampire->sendRealWearingInfo();
pTargetVampire->sendModifyInfo(prev);
if (pTargetCreature->isPC())
{
Player* pTargetPlayer = pTargetCreature->getPlayer();
Assert(pTargetPlayer != NULL);
pTargetPlayer->sendPacket(&_GCSkillToObjectOK2);
}
else
{
Assert(false);
}
// 이펙트가 붙었다고 알려준다.
GCAddEffect gcAddEffect;
gcAddEffect.setObjectID(pTargetVampire->getObjectID());
gcAddEffect.setEffectID(Effect::EFFECT_CLASS_MEPHISTO);
gcAddEffect.setDuration(output.Duration);
pZone->broadcastPacket(pTargetVampire->getX(), pTargetVampire->getY(), &gcAddEffect);
}
}
}
catch (Throwable & t)
{
executeSkillFailException(pVampire, getSkillType());
}
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End(slayerself)" << endl;
__END_CATCH
//.........这里部分代码省略.........
示例12: execute
//////////////////////////////////////////////////////////////////////////////
// 슬레이어 셀프 핸들러
//////////////////////////////////////////////////////////////////////////////
void WillOfLife::execute(Vampire* pVampire, VampireSkillSlot* pVampireSkillSlot, CEffectID_t CEffectID)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " Begin(slayerself)" << endl;
Assert(pVampire != NULL);
Assert(pVampireSkillSlot != NULL);
try
{
Player* pPlayer = pVampire->getPlayer();
Zone* pZone = pVampire->getZone();
Assert(pPlayer != NULL);
Assert(pZone != NULL);
GCSkillToSelfOK1 _GCSkillToSelfOK1;
GCSkillToSelfOK2 _GCSkillToSelfOK2;
SkillType_t SkillType = pVampireSkillSlot->getSkillType();
//SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);
// 스킬 레벨에 따라 데미지 보너스가 달라진다.
SkillInput input(pVampire);
SkillOutput output;
computeOutput(input, output);
int RequiredMP = output.Damage;
bool bManaCheck = hasEnoughMana(pVampire, RequiredMP);
bool bTimeCheck = verifyRunTime(pVampireSkillSlot);
bool bRangeCheck = checkZoneLevelToUseSkill(pVampire);
bool bHitRoll = HitRoll::isSuccessWillOfLife(pVampire);
bool bEffected = pVampire->isFlag(Effect::EFFECT_CLASS_WILL_OF_LIFE);
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && !bEffected)
{
decreaseMana(pVampire, RequiredMP, _GCSkillToSelfOK1);
// 이펙트 클래스를 만들어 붙인다.
EffectWillOfLife* pEffect = new EffectWillOfLife(pVampire);
pEffect->setDeadline(output.Duration);
pEffect->setBonus(output.Damage);
pEffect->setNextTime(0);
pVampire->addEffect(pEffect);
pVampire->setFlag(Effect::EFFECT_CLASS_WILL_OF_LIFE);
// 패킷을 만들어 보낸다.
_GCSkillToSelfOK1.setSkillType(SkillType);
_GCSkillToSelfOK1.setCEffectID(CEffectID);
_GCSkillToSelfOK1.setDuration(output.Duration);
_GCSkillToSelfOK2.setObjectID(pVampire->getObjectID());
_GCSkillToSelfOK2.setSkillType(SkillType);
_GCSkillToSelfOK2.setDuration(output.Duration);
pPlayer->sendPacket(&_GCSkillToSelfOK1);
GCStatusCurrentHP gcStatusCurrentHP;
gcStatusCurrentHP.setObjectID(pVampire->getObjectID());
gcStatusCurrentHP.setCurrentHP(pVampire->getHP());
pZone->broadcastPacket(pVampire->getX(), pVampire->getY(), &_GCSkillToSelfOK2, pVampire);
pZone->broadcastPacket(pVampire->getX(), pVampire->getY(), &gcStatusCurrentHP);
// 이펙트가 붙었다고 알려준다.
GCAddEffect gcAddEffect;
gcAddEffect.setObjectID(pVampire->getObjectID());
gcAddEffect.setEffectID(Effect::EFFECT_CLASS_WILL_OF_LIFE);
gcAddEffect.setDuration(output.Duration);
pZone->broadcastPacket(pVampire->getX(), pVampire->getY(), &gcAddEffect);
}
else
{
executeSkillFailNormal(pVampire, getSkillType(), NULL);
}
// set Next Run Time
if (bTimeCheck ) pVampireSkillSlot->setRunTime(output.Delay);
}
catch (Throwable & t)
{
executeSkillFailException(pVampire, getSkillType());
}
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End(slayerself)" << endl;
__END_CATCH
}
示例13: execute
//.........这里部分代码省略.........
SIMPLE_SKILL_INPUT param;
param.SkillType = getSkillType();
param.SkillDamage = output.Damage;
param.Delay = output.Delay;
param.ItemClass = Item::ITEM_CLASS_OUSTERS_CHAKRAM;
param.STRMultiplier = 0;
param.DEXMultiplier = 0;
param.INTMultiplier = 0;
param.bMagicHitRoll = false;
param.bMagicDamage = false;
param.bAdd = true;
SIMPLE_SKILL_OUTPUT result;
int offset = 0;
OustersSkillSlot* pMastery = pOusters->hasSkill(SKILL_DESTRUCTION_SPEAR_MASTERY);
if (pMastery != NULL )
{
offset = 1;
if (pMastery->getExpLevel() <= 15 )
param.SkillDamage = min(70,param.SkillDamage + 10 + pMastery->getExpLevel()/3);
else
param.SkillDamage = min(90,param.SkillDamage + 10 + pMastery->getExpLevel()/2);
param.Grade=4;
}
for (int i=-offset; i<=offset; ++i )
for (int j=-offset; j<=offset; ++j )
param.addMask(i, j, 100);
g_SimpleTileMissileSkill.execute(pOusters, X, Y, pOustersSkillSlot, param, result, CEffectID);
list<Creature*>::iterator itr = result.targetCreatures.begin();
for (; itr != result.targetCreatures.end() ; ++itr )
{
Creature* pTargetCreature = *itr;
if (pTargetCreature->getX() == X && pTargetCreature->getY() == Y )
{
GCModifyInformation gcMI, gcAttackerMI;
Damage_t damage = computeElementalCombatSkill(pOusters, pTargetCreature, gcAttackerMI);
if (damage != 0 )
{
::setDamage(pTargetCreature, damage, pOusters, SKILL_DESTRUCTION_SPEAR, &gcMI, &gcAttackerMI);
if (pTargetCreature->isPC() ) pTargetCreature->getPlayer()->sendPacket(&gcMI);
if (pTargetCreature->isDead())
{
int exp = computeCreatureExp(pTargetCreature, 70, pOusters);
shareOustersExp(pOusters, exp, gcAttackerMI);
}
pOusters->getPlayer()->sendPacket(&gcAttackerMI);
}
}
if (!pTargetCreature->isFlag(Effect::EFFECT_CLASS_DESTRUCTION_SPEAR ) && result.bSuccess )
{
int targetLevel = pTargetCreature->getLevel();
int ratio = 0;
if (input.SkillLevel <= 15 )
{
ratio = max(20, min(80, (int)(pOusters->getLevel() + (input.SkillLevel * 8.0 / 3.0) - targetLevel ) ));
}
else
{
ratio = max(20, min(80, (int)(pOusters->getLevel() + 20.0 + (input.SkillLevel * 4.0 / 3.0) - targetLevel ) ));
}
if (rand() % 100 < ratio )
{
EffectDestructionSpear* pEffect = new EffectDestructionSpear(pTargetCreature);
Assert(pEffect != NULL);
pEffect->setDamage(2 + (input.SkillLevel/3 ));
pEffect->setNextTime(20);
pEffect->setCasterID(pOusters->getObjectID());
pEffect->setDeadline(output.Duration);
if (pTargetCreature->getX() == X && pTargetCreature->getY() == Y )
pEffect->setSteal(true);
pTargetCreature->setFlag(Effect::EFFECT_CLASS_DESTRUCTION_SPEAR);
pTargetCreature->addEffect(pEffect);
GCAddEffect gcAddEffect;
gcAddEffect.setObjectID(pTargetCreature->getObjectID());
gcAddEffect.setEffectID(pEffect->getSendEffectClass());
gcAddEffect.setDuration(output.Duration);
pZone->broadcastPacket(pTargetCreature->getX(), pTargetCreature->getY(), &gcAddEffect);
}
}
}
__END_CATCH
}
示例14: affectCreature
bool EffectEnergyDrop::affectCreature(Creature* pTargetCreature, bool bAffectByMove)
throw(Error)
{
__BEGIN_TRY
//cout << "EffectEnergyDrop " << "affectCreature Begin " << endl;
Assert(pTargetCreature != NULL);
// 상대에게 이미 poison 이펙트가 걸려져 있는 경우에는 걸리지 않는다.
if (pTargetCreature->isFlag(Effect::EFFECT_CLASS_ENERGY_DROP_TO_CREATURE))
{
//cout << "EffectEnergyDrop " << "affectCreature End(Already Effected) " << endl;
return false;
}
// 안전지대 체크
// 2003.1.10 by bezz, Sequoia
if (!checkZoneLevelToHitTarget(pTargetCreature) )
{
return false;
}
Zone* pZone = pTargetCreature->getZone();
// 상대방에게 미칠 독 데미지를 계산한다.
int DropDamage = computeMagicDamage(pTargetCreature, m_Damage, SKILL_ENERGY_DROP);
//cout << "EffectEnergyDrop(Damage:" << DropDamage << ") Affected" << endl;
if (DropDamage > 0)
{
// 포이즌 이펙트를 생성해서, 타겟 크리쳐에 붙이고, 플래그를 켜준다.
// 현제는 EnergyDrop Effect를 지속적으로 운영하지 않는다. 다른 Effeect기술의
// 경우 시전자의 레벨이 올라갈수록 Duration이 증가하게 되고 이에 대한 Effect를 붙이게
// 되지만, --Drop, --Storm류의 기술은 일단 성공이 되면 해당 구역의 모든 사람이
// 기술을 당하게 되고, 각각 시간으로 데미지를 주는 것이 아니라 일정량의 데미지를
// 3등분해서 주게 된다. 몇번의 데미지를 주는 함수는 아직 개발되지 않은 단계라서
// Deadline과 tick을 사용해서 임의로 구현을 하였다.
// 1.6초 동안에 0.5초 간격으로 데미지를 주게 되면, 3번의 데미지를 줄 수 있게 된다.
// 여기서는 하드코딩이 되어 있는데, 이는 다른 방법으로 교체되어야 할 거 같다.
// EffectEnergyDrop Class에 member variable로
// m_Tick
// m_Count
// 를 두어서 이를 바탕으로 deadline을 계산해서 적용한다면 더욱 더 편할 것이다.
EffectEnergyDropToCreature* pEffectEnergyDropToCreature = new EffectEnergyDropToCreature(pTargetCreature);
// 우선권 시스템을 위하여 이름과 파티 아이디를 넣는다.
// pEffectEnergyDropToCreature->setCasterName(m_CasterName);
// pEffectEnergyDropToCreature->setPartyID(m_PartyID);
pEffectEnergyDropToCreature->setUserObjectID(m_UserObjectID);
pEffectEnergyDropToCreature->setLevel(m_Level);
pEffectEnergyDropToCreature->setPoint(DropDamage/3);
pEffectEnergyDropToCreature->setDeadline(16); // 이부분 바꿔야 한다.
pEffectEnergyDropToCreature->setTick(5); // 이부분도 바꿔야 한다.
pEffectEnergyDropToCreature->affect(pTargetCreature);
pTargetCreature->addEffect(pEffectEnergyDropToCreature);
pTargetCreature->setFlag(Effect::EFFECT_CLASS_ENERGY_DROP_TO_CREATURE);
// 이펙트가 붙었다고 주변에 알려준다.
GCAddEffect gcAddEffect;
gcAddEffect.setObjectID(pTargetCreature->getObjectID());
gcAddEffect.setEffectID(Effect::EFFECT_CLASS_ENERGY_DROP_TO_CREATURE);
gcAddEffect.setDuration(m_Duration);
pZone->broadcastPacket(pTargetCreature->getX(), pTargetCreature->getY(), &gcAddEffect);
}
//cout << "EffectEnergyDrop " << "affectCreature End " << endl;
return true;
__END_CATCH
}
示例15: execute
//.........这里部分代码省略.........
Blood Resistance = 50%
Regen = 1 HP per 1 sec
*/
Monster* pGroundElemental = new Monster(GROUND_ELEMENTAL_TYPE);
pGroundElemental->setName("대지 정령");
pGroundElemental->setHP(1000 + input.SkillLevel * 100);
pGroundElemental->setHP(1000 + input.SkillLevel * 100, ATTR_MAX);
pGroundElemental->setDefense(0);
pGroundElemental->setProtection(0);
pGroundElemental->setResist(MAGIC_DOMAIN_POISON, 0);
pGroundElemental->setResist(MAGIC_DOMAIN_ACID, 0);
pGroundElemental->setResist(MAGIC_DOMAIN_CURSE, 0);
pGroundElemental->setResist(MAGIC_DOMAIN_BLOOD, 0);
pGroundElemental->setFlag(Effect::EFFECT_CLASS_IMMUNE_TO_CURSE);
pGroundElemental->removeFlag(Effect::EFFECT_CLASS_HIDE);
pGroundElemental->setMoveMode(Creature::MOVE_MODE_WALKING);
// 무뇌정령
pGroundElemental->setBrain(NULL);
pZone->addCreature(pGroundElemental, X, Y, 2);
X = pGroundElemental->getX();
Y = pGroundElemental->getY();
//cout << pGroundElemental->toString() << " 을 " << X << ", " << Y << " 에 불러냈습니다." << endl;
EffectGroundElemental* pCreatureEffect = new EffectGroundElemental(pGroundElemental);
pCreatureEffect->setDeadline(output.Duration);
pGroundElemental->setFlag(pCreatureEffect->getEffectClass());
pGroundElemental->addEffect(pCreatureEffect);
GCAddEffect gcAddEffect;
gcAddEffect.setObjectID(pGroundElemental->getObjectID());
gcAddEffect.setEffectID(pCreatureEffect->getSendEffectClass());
pZone->broadcastPacket(X, Y, &gcAddEffect);
// addSimpleCreatureEffect(pGroundElemental, Effect::EFFECT_CLASS_GROUND_ELEMENTAL_CENTER);
// for (int i = 0; i < m_MaskIndex[Grade]; ++i )
for (oX = X - 2 ; oX <= X + 2 ; ++oX )
for (oY = Y - 2 ; oY <= Y + 2 ; ++oY )
{
// oX = m_ElementalMask[Grade][i].x;
// oY = m_ElementalMask[Grade][i].y;
if (!rect.ptInRect(oX, oY)) continue;
if (oX == X && oY == Y ) continue;
Tile& tile = pZone->getTile(oX, oY);
if (!tile.canAddEffect()) continue;
if (tile.getEffect(Effect::EFFECT_CLASS_TRYING_POSITION) ) continue;
// 같은 이펙트가 이미 존재한다면 삭제한다.
Effect* pOldEffect = tile.getEffect(Effect::EFFECT_CLASS_GROUND_ELEMENTAL_AURA);
if (pOldEffect != NULL)
{
ObjectID_t effectID = pOldEffect->getObjectID();
pZone->deleteEffect(effectID);
}
// 이펙트 오브젝트를 생성한다.
EffectSummonGroundElemental* pEffect = new EffectSummonGroundElemental(pZone, oX, oY);
pEffect->setDeadline(output.Duration);