本文整理汇总了C++中GCAddEffect类的典型用法代码示例。如果您正苦于以下问题:C++ GCAddEffect类的具体用法?C++ GCAddEffect怎么用?C++ GCAddEffect使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GCAddEffect类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: throw
void EffectVampireRelic::affect(Creature* pCreature)
throw(Error)
{
__BEGIN_TRY
//Timeval nextTime = getNextTime();
//Timeval deadLine = getDeadline();
//Turn_t RemainTime = deadLine.tv_sec - nextTime.tv_sec;
/*
StringStream msg;
if (pCreature->isSlayer())
{
Slayer* pSlayer = dynamic_cast<Slayer*>(pCreature);
msg << pSlayer->getName();
}
else
{
Vampire* pVampire = dynamic_cast<Vampire*>(pCreature);
msg << pVampire->getName();
}
msg << " 님이 뱀파이어 성물을 가졌습니다.";
*/
char msg[50];
sprintf(msg, g_pStringPool->c_str(STRID_TAKE_VAMPIRE_RELIC ),
pCreature->getName().c_str());
string sMsg(msg);
GCSystemMessage gcSystemMessage;
gcSystemMessage.setType(SYSTEM_MESSAGE_COMBAT);
gcSystemMessage.setMessage(sMsg);
g_pZoneGroupManager->broadcast(&gcSystemMessage);
// Effect붙인다.
GCAddEffect gcAddEffect;
gcAddEffect.setObjectID(pCreature->getObjectID());
gcAddEffect.setEffectID(getSendEffectClass());
gcAddEffect.setDuration(65000);
pCreature->getZone()->broadcastPacket(pCreature->getX(), pCreature->getY(), &gcAddEffect);
setNextTime(m_Tick);
__END_CATCH
}
示例2: throw
void EffectDonation200501::affect(Creature* pCreature)
throw(Error)
{
__BEGIN_TRY
pCreature->setFlag(Effect::EFFECT_CLASS_DONATION_200501);
// 주위에 뿌려준다.
GCAddEffect gcAddEffect;
gcAddEffect.setObjectID(pCreature->getObjectID());
gcAddEffect.setEffectID(getSendEffectClass());
gcAddEffect.setDuration(999999);
pCreature->getZone()->broadcastPacket(pCreature->getX(), pCreature->getY(), &gcAddEffect);
__END_CATCH
}
示例3: throw
void EffectPKZoneResurrection::unaffect(Creature* pCreature)
throw(Error)
{
__BEGIN_TRY
GCAddEffect gcAddEffect;
gcAddEffect.setObjectID(pCreature->getObjectID());
gcAddEffect.setEffectID(getSendEffectClass());
gcAddEffect.setDuration(28);
Zone* pZone = pCreature->getZone();
if (pZone != NULL )
pZone->broadcastPacket(pCreature->getX(), pCreature->getY(), &gcAddEffect);
pCreature->removeFlag(getEffectClass());
__END_CATCH
}
示例4: throw
//.........这里部分代码省略.........
pPlayer->sendPacket(&_GCSkillToSelfOK1);
pZone->broadcastPacket(x, y, &_GCSkillToSelfOK3, pVampire);
//---------------------------------------------------------------
// 기존의 지속 마법 효과를 제거한다.
//---------------------------------------------------------------
EffectManager* pEffectManager = pVampire->getEffectManager();
Assert(pEffectManager!=NULL);
Effect* pCheckEffect = NULL;
// 사용자의 level을 구한다.
int userLevel = pVampire->getLevel();
Effect::EffectClass effectClass;
// EFFECT_CLASS_FLARE
effectClass = Effect::EFFECT_CLASS_FLARE;
pCheckEffect = pEffectManager->findEffect(effectClass);
if (pCheckEffect!=NULL)
{
int level = (dynamic_cast<EffectFlare*>(pCheckEffect))->getLevel();
if (level < userLevel)
{
pEffectManager->deleteEffect(effectClass);
pVampire->removeFlag(effectClass);
}
}
// EFFECT_CLASS_DOOM
effectClass = Effect::EFFECT_CLASS_DOOM;
pCheckEffect = pEffectManager->findEffect(effectClass);
if (pCheckEffect!=NULL)
{
int level = (dynamic_cast<EffectDoom*>(pCheckEffect))->getLevel();
if (level < userLevel)
{
pEffectManager->deleteEffect(effectClass);
pVampire->removeFlag(effectClass);
}
}
// EFFECT_CLASS_SEDUCTION
effectClass = Effect::EFFECT_CLASS_SEDUCTION;
pCheckEffect = pEffectManager->findEffect(effectClass);
if (pCheckEffect!=NULL)
{
int level = (dynamic_cast<EffectSeduction*>(pCheckEffect))->getLevel();
if (level < userLevel)
pEffectManager->deleteEffect(effectClass);
pVampire->removeFlag(effectClass);
}
//---------------------------------------------------------------
// 이펙트 오브젝트를 생성해 붙인다.
//---------------------------------------------------------------
EffectSummonCasket* pEffect = new EffectSummonCasket(pVampire);
pEffect->setDeadline(99999999);
pEffect->setType(0);
pVampire->addEffect(pEffect);
pVampire->setFlag(Effect::EFFECT_CLASS_CASKET);
// SUMMON CASKET 에 의해 변하는 능력치가 변한다.. 2002.12.13 by bezz.
VAMPIRE_RECORD prev;
pVampire->getVampireRecord(prev);
pVampire->initAllStat();
pVampire->sendRealWearingInfo();
pVampire->sendModifyInfo(prev);
GCAddEffect gcAddEffect;
gcAddEffect.setObjectID(pVampire->getObjectID());
gcAddEffect.setEffectID(Effect::EFFECT_CLASS_CASKET);
gcAddEffect.setDuration(output.Duration);
pZone->broadcastPacket(pVampire->getX(), pVampire->getY(), &gcAddEffect, pVampire);
pSkillSlot->setRunTime();
}
else
{
//cout << "SummonCasket Failed" << endl;
executeSkillFailNormal(pVampire, getSkillType(), NULL);
}
}
catch(Throwable & t)
{
//cout << "SummonCasket Failed2" << endl;
executeSkillFailException(pVampire, getSkillType());
}
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End" << endl;
__END_CATCH
}
示例5: throw
//.........这里部分代码省略.........
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은 땜빵 수치다.
{
示例6: throw
//////////////////////////////////////////////////////////////////////////////
// 슬레이어 셀프 핸들러
//////////////////////////////////////////////////////////////////////////////
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());
//.........这里部分代码省略.........
示例7: throw
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
//.........这里部分代码省略.........
示例8: throw
//////////////////////////////////////////////////////////////////////////////
// 슬레이어 셀프
//////////////////////////////////////////////////////////////////////////////
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);
//.........这里部分代码省略.........
示例9: throw
//////////////////////////////////////////////////////////////////////////////
// 슬레이어 셀프 핸들러
//////////////////////////////////////////////////////////////////////////////
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
}
示例10: throw
//.........这里部分代码省略.........
SkillInput input(pOusters, pSkillSlot);
SkillOutput output;
computeOutput(input, output);
int RequiredMP = (int)pSkillInfo->getConsumeMP() + pSkillSlot->getExpLevel()/2;
bool bManaCheck = hasEnoughMana(pOusters, RequiredMP);
bool bTimeCheck = verifyRunTime(pSkillSlot);
bool bRangeCheck = verifyDistance(pOusters, pTargetCreature, pSkillInfo->getRange());
bool bHitRoll = HitRoll::isSuccessMagic(pOusters, pSkillInfo, pSkillSlot);
bool bEffected = pTargetCreature->isFlag(Effect::EFFECT_CLASS_GROUND_BLESS);
bool bSatisfyRequire = pOusters->satisfySkillRequire(pSkillInfo);
ZoneCoord_t targetX = pTargetCreature->getX();
ZoneCoord_t targetY = pTargetCreature->getY();
ZoneCoord_t myX = pOusters->getX();
ZoneCoord_t myY = pOusters->getY();
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && !bEffected && bSatisfyRequire)
{
decreaseMana(pOusters, RequiredMP, _GCSkillToObjectOK1);
bool bCanSeeCaster = canSee(pTargetCreature, pOusters);
// 이펙트 오브젝트를 생성해 붙인다.
EffectGroundBless* pEffect = new EffectGroundBless(pTargetCreature);
pEffect->setDeadline(output.Duration);
pEffect->setBonus(output.Damage);
pTargetCreature->addEffect(pEffect);
pTargetCreature->setFlag(Effect::EFFECT_CLASS_GROUND_BLESS);
Ousters* pTargetOusters = dynamic_cast<Ousters*>(pTargetCreature);
if (pTargetOusters != NULL ) pTargetOusters->initAllStatAndSend();
_GCSkillToObjectOK1.setSkillType(SkillType);
_GCSkillToObjectOK1.setCEffectID(CEffectID);
_GCSkillToObjectOK1.setTargetObjectID(TargetObjectID);
_GCSkillToObjectOK1.setDuration(output.Duration);
_GCSkillToObjectOK2.setObjectID(pOusters->getObjectID());
_GCSkillToObjectOK2.setSkillType(SkillType);
_GCSkillToObjectOK2.setDuration(output.Duration);
_GCSkillToObjectOK3.setObjectID(pOusters->getObjectID());
_GCSkillToObjectOK3.setSkillType(SkillType);
_GCSkillToObjectOK3.setTargetXY (targetX, targetY);
_GCSkillToObjectOK4.setSkillType(SkillType);
_GCSkillToObjectOK4.setTargetObjectID(TargetObjectID);
_GCSkillToObjectOK4.setDuration(output.Duration);
_GCSkillToObjectOK5.setObjectID(pOusters->getObjectID());
_GCSkillToObjectOK5.setSkillType(SkillType);
_GCSkillToObjectOK5.setTargetObjectID (TargetObjectID);
_GCSkillToObjectOK5.setDuration(output.Duration);
_GCSkillToObjectOK6.setXY(myX, myY);
_GCSkillToObjectOK6.setSkillType(SkillType);
_GCSkillToObjectOK6.setDuration(output.Duration);
list<Creature *> cList;
cList.push_back(pTargetCreature);
cList.push_back(pOusters);
cList = pZone->broadcastSkillPacket(myX, myY, targetX, targetY, &_GCSkillToObjectOK5, cList);
pZone->broadcastPacket(myX, myY, &_GCSkillToObjectOK3, cList);
pZone->broadcastPacket(targetX, targetY, &_GCSkillToObjectOK4, cList);
// Send Packet
pPlayer->sendPacket(&_GCSkillToObjectOK1);
Player* pTargetPlayer = pTargetCreature->getPlayer();
if (pTargetPlayer != NULL )
{
if (bCanSeeCaster) pTargetPlayer->sendPacket(&_GCSkillToObjectOK2);
else pTargetPlayer->sendPacket(&_GCSkillToObjectOK6);
}
GCAddEffect gcAddEffect;
gcAddEffect.setObjectID(TargetObjectID);
gcAddEffect.setEffectID(Effect::EFFECT_CLASS_GROUND_BLESS);
gcAddEffect.setDuration(output.Duration);
pZone->broadcastPacket(targetX, targetY, &gcAddEffect);
pSkillSlot->setRunTime(output.Delay);
}
else
{
executeSkillFailNormal(pOusters, getSkillType(), pTargetCreature);
}
}
catch (Throwable & t)
{
executeSkillFailException(pOusters, getSkillType());
}
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " end " << endl;
__END_CATCH
}
示例11: throw
//////////////////////////////////////////////////////////////////////////////
// 뱀파이어 오브젝트 핸들러
//////////////////////////////////////////////////////////////////////////////
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)
{
//.........这里部分代码省略.........
示例12: throw
//.........这里部分代码省略.........
_GCAttackArmsOK5.setSkillSuccess(true);
_GCAttackArmsOK1.setSkillSuccess(true);
bool bCriticalHit = false;
// 데미지를 계산하고, quickfire 페널티를 가한다.
// output.Damage가 음수이기 때문에, %값을 구해 더하면 결국 빼는 것이 된다.
int Damage = computeDamage(pSlayer, pTargetCreature, SkillLevel/5, bCriticalHit);
Damage += getPercentValue(Damage, output.Damage);
Damage = max(0, Damage);
//cout << "JabbingVeinDamage:" << Damage << endl;
// 데미지를 세팅한다.
setDamage(pTargetCreature, Damage, pSlayer, SkillType, &_GCAttackArmsOK2, &_GCAttackArmsOK1);
computeAlignmentChange(pTargetCreature, Damage, pSlayer, &_GCAttackArmsOK2, &_GCAttackArmsOK1);
bool bAffect = true;
if (pTargetCreature->isMonster())
{
Monster* pMonster = dynamic_cast<Monster*>(pTargetCreature);
if (pMonster->isMaster() ) bAffect = false;
}
if (bAffect && !pTargetCreature->isFlag(Effect::EFFECT_CLASS_JABBING_VEIN) && rand()%100 < output.Range )
{
EffectJabbingVein* pEffect = new EffectJabbingVein(pTargetCreature);
pEffect->setDeadline(output.Duration);
pTargetCreature->addEffect(pEffect);
pTargetCreature->setFlag(pEffect->getEffectClass());
GCAddEffect gcAddEffect;
gcAddEffect.setObjectID(pTargetCreature->getObjectID());
gcAddEffect.setEffectID(pEffect->getSendEffectClass());
gcAddEffect.setDuration(output.Duration);
pZone->broadcastPacket(pTargetCreature->getX(), pTargetCreature->getY(), &gcAddEffect);
}
// 크리티컬 히트라면 상대방을 뒤로 물러나게 한다.
if (bCriticalHit)
{
knockbackCreature(pZone, pTargetCreature, pSlayer->getX(), pSlayer->getY());
}
if(!pTargetCreature->isSlayer() )
{
if (bIncreaseExp)
{
shareAttrExp(pSlayer, Damage , 1, 8, 1, _GCAttackArmsOK1);
increaseDomainExp(pSlayer, DomainType, pSkillInfo->getPoint(), _GCAttackArmsOK1, pTargetCreature->getLevel());
increaseSkillExp(pSlayer, DomainType, pSkillSlot, pSkillInfo, _GCAttackArmsOK1);
}
increaseAlignment(pSlayer, pTargetCreature, _GCAttackArmsOK1);
}
//}
if (pTargetCreature->isPC())
{
Player* pTargetPlayer = pTargetCreature->getPlayer();
if (pTargetPlayer != NULL)
{
_GCAttackArmsOK2.setObjectID(getSkillType());
示例13: throw
//////////////////////////////////////////////////////////////////////////////
// 뱀파이어 오브젝트 핸들러
//////////////////////////////////////////////////////////////////////////////
void BackStab::execute(Ousters* pOusters, ObjectID_t TargetObjectID, OustersSkillSlot* pOustersSkillSlot, CEffectID_t CEffectID)
throw(Error)
{
__BEGIN_TRY
SkillInput input(pOusters, pOustersSkillSlot);
SkillOutput output;
computeOutput(input, output);
Item* pWeapon = pOusters->getWearItem(Ousters::WEAR_RIGHTHAND);
if (pWeapon == NULL )
{
executeSkillFailException(pOusters, getSkillType());
return;
}
SIMPLE_SKILL_INPUT param;
param.SkillType = getSkillType();
// param.SkillDamage = output.Damage;
bool bCritical = false;
if (HitRoll::isSuccessBackStab(pOusters ) )
{
double ratio = (1.0 + (2 * input.SkillLevel / 30.0 ));
param.SkillDamage = (short unsigned int)(max(1, Random(pWeapon->getMinDamage(), pWeapon->getMaxDamage() ) ) * ratio);
if (input.SkillLevel == 30 ) param.SkillDamage = (short unsigned int)(param.SkillDamage * 1.1);
bCritical = true;
}
else
{
param.SkillDamage = 0;
}
param.Delay = 0;
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;
if (input.SkillLevel < 15 ) param.Grade = 0;
else if (input.SkillLevel < 30 ) param.Grade = 1;
else param.Grade = 2;
SIMPLE_SKILL_OUTPUT result;
g_SimpleMeleeSkill.execute(pOusters, TargetObjectID, pOustersSkillSlot, param, result, CEffectID);
if (bCritical && result.bSuccess )
{
GCAddEffect gcAddEffect;
gcAddEffect.setObjectID(TargetObjectID);
if (param.Grade == 0 ) gcAddEffect.setEffectID(Effect::EFFECT_CLASS_BACK_STAB);
else if (param.Grade == 1 ) gcAddEffect.setEffectID(Effect::EFFECT_CLASS_BACK_STAB_2);
else gcAddEffect.setEffectID(Effect::EFFECT_CLASS_BACK_STAB_3);
gcAddEffect.setDuration(0);
Zone* pZone = pOusters->getZone();
if (pZone != NULL )
{
Creature* pCreature = pZone->getCreature(TargetObjectID);
if (pCreature != NULL )
{
pZone->broadcastPacket(pCreature->getX(), pCreature->getY(), &gcAddEffect);
}
}
}
__END_CATCH
}
示例14: throw
//.........这里部分代码省略.........
Curse Resistance = 100%
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);
示例15: throw
//.........这里部分代码省略.........
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
}