本文整理汇总了C++中Slayer::getSlayerRecord方法的典型用法代码示例。如果您正苦于以下问题:C++ Slayer::getSlayerRecord方法的具体用法?C++ Slayer::getSlayerRecord怎么用?C++ Slayer::getSlayerRecord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Slayer
的用法示例。
在下文中一共展示了Slayer::getSlayerRecord方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: unaffect
void EffectChargingPower::unaffect(Creature* pCreature)
throw(Error)
{
__BEGIN_TRY
__BEGIN_DEBUG
//cout << "EffectChargingPower" << "unaffect BEGIN" << endl;
Assert(pCreature != NULL);
Assert(pCreature->isSlayer());
pCreature->removeFlag(Effect::EFFECT_CLASS_CHARGING_POWER);
Slayer* pSlayer = dynamic_cast<Slayer*>(pCreature);
SLAYER_RECORD prev;
pSlayer->getSlayerRecord(prev);
pSlayer->initAllStat();
pSlayer->sendRealWearingInfo();
pSlayer->sendModifyInfo(prev);
Zone* pZone = pSlayer->getZone();
Assert(pZone != NULL);
// 이펙트가 사라졌다고 알려준다.
GCRemoveEffect gcRemoveEffect;
gcRemoveEffect.setObjectID(pSlayer->getObjectID());
gcRemoveEffect.addEffectList(Effect::EFFECT_CLASS_CHARGING_POWER);
pZone->broadcastPacket(pSlayer->getX(), pSlayer->getY(), &gcRemoveEffect);
//cout << "EffectChargingPower" << "unaffect END" << endl;
__END_DEBUG
__END_CATCH
}
示例2: affect
void EffectExpansion::affect(Creature* pCreature)
throw(Error)
{
__BEGIN_TRY
Assert(pCreature != NULL);
Assert(pCreature->isSlayer());
Slayer* pSlayer = dynamic_cast<Slayer*>(pCreature);
SLAYER_RECORD prev;
pSlayer->getSlayerRecord(prev);
pSlayer->initAllStat();
pSlayer->sendRealWearingInfo();
pSlayer->sendModifyInfo(prev);
__END_CATCH
}
示例3: unaffect
void EffectExpansion::unaffect(Creature* pCreature)
throw(Error)
{
__BEGIN_TRY
__BEGIN_DEBUG
//cout << "EffectExpansion " << "unaffect BEGIN" << endl;
Assert(pCreature != NULL);
Assert(pCreature->isSlayer() == true);
Zone* pZone = pCreature->getZone();
Assert(pZone != NULL);
pCreature->removeFlag(Effect::EFFECT_CLASS_EXPANSION);
Slayer* pSlayer = dynamic_cast<Slayer*>(pCreature);
SLAYER_RECORD prev;
pSlayer->getSlayerRecord(prev);
pSlayer->initAllStat();
pSlayer->sendRealWearingInfo();
pSlayer->sendModifyInfo(prev);
// 이펙트가 사라졌다고 알려준다.
GCRemoveEffect gcRemoveEffect;
gcRemoveEffect.setObjectID(pSlayer->getObjectID());
gcRemoveEffect.addEffectList(Effect::EFFECT_CLASS_EXPANSION);
pZone->broadcastPacket(pSlayer->getX(), pSlayer->getY(), &gcRemoveEffect);
// 현재 남아있는 체력이 최대 체력보다 크다면, 줄여야 한다.
if (pSlayer->getHP(ATTR_CURRENT) > pSlayer->getHP(ATTR_MAX))
{
pSlayer->setHP(pSlayer->getHP(ATTR_MAX), ATTR_CURRENT);
}
GCOtherModifyInfo gcOtherModifyInfo;
makeGCOtherModifyInfo(&gcOtherModifyInfo, pSlayer, &prev);
pZone->broadcastPacket(pSlayer->getX(), pSlayer->getY(), &gcOtherModifyInfo, pSlayer);
//cout << "EffectExpansion " << "unaffect END" << endl;
__END_DEBUG
__END_CATCH
}
示例4: unaffect
void EffectObservingEye::unaffect(Creature* pCreature)
throw(Error)
{
__BEGIN_TRY
//cout << "EffectObservingEye" << "unaffect BEGIN" << endl;
Assert(pCreature != NULL);
Assert(pCreature->isSlayer()); // 슬레이어말고는 걸리지 않는다.
pCreature->removeFlag(Effect::EFFECT_CLASS_OBSERVING_EYE);
Slayer* pSlayer = dynamic_cast<Slayer*>(pCreature);
SLAYER_RECORD prev;
pSlayer->getSlayerRecord(prev);
pSlayer->initAllStat();
pSlayer->sendRealWearingInfo();
pSlayer->sendModifyInfo(prev);
Zone* pZone = pCreature->getZone();
Assert(pZone != NULL);
GCRemoveEffect gcRemoveEffect;
gcRemoveEffect.setObjectID(pCreature->getObjectID());
gcRemoveEffect.addEffectList(Effect::EFFECT_CLASS_OBSERVING_EYE);
pZone->broadcastPacket(pCreature->getX(), pCreature->getY(), &gcRemoveEffect);
// 이 이펙트로 보고 있었던 크리쳐들을 삭제한다.
pZone->updateInvisibleScan(pCreature);
GCOtherModifyInfo gcOtherModifyInfo;
makeGCOtherModifyInfo(&gcOtherModifyInfo, pSlayer, &prev);
pZone->broadcastPacket(pSlayer->getX(), pSlayer->getY(), &gcOtherModifyInfo, pSlayer);
//cout << "EffectObservingEye" << "unaffect END" << endl;
__END_CATCH
}
示例5: unaffect
void EffectPotentialExplosion::unaffect(Creature* pCreature)
throw(Error)
{
__BEGIN_TRY
__BEGIN_DEBUG
//cout << "EffectPotentialExplosion " << "unaffect BEGIN" << endl;
Assert(pCreature != NULL);
Assert(pCreature->isSlayer());
pCreature->removeFlag(Effect::EFFECT_CLASS_POTENTIAL_EXPLOSION);
Slayer* pSlayer = dynamic_cast<Slayer*>(pCreature);
SLAYER_RECORD prev;
pSlayer->getSlayerRecord(prev);
pSlayer->initAllStat();
pSlayer->sendRealWearingInfo();
pSlayer->sendModifyInfo(prev);
Zone* pZone = pSlayer->getZone();
Assert(pZone != NULL);
GCRemoveEffect gcRemoveEffect;
gcRemoveEffect.setObjectID(pSlayer->getObjectID());
gcRemoveEffect.addEffectList(Effect::EFFECT_CLASS_POTENTIAL_EXPLOSION);
pZone->broadcastPacket(pSlayer->getX(), pSlayer->getY(), &gcRemoveEffect);
GCOtherModifyInfo gcOtherModifyInfo;
makeGCOtherModifyInfo(&gcOtherModifyInfo, pSlayer, &prev);
pZone->broadcastPacket(pSlayer->getX(), pSlayer->getY(), &gcOtherModifyInfo, pSlayer);
//cout << "EffectPotentialExplosion " << "unaffect END" << endl;
__END_DEBUG
__END_CATCH
}
示例6: executeMonster
bool BloodDrain::executeMonster(Monster* pMonster, Creature* pEnemy)
throw(Error)
{
__BEGIN_TRY
bool isMaster = pMonster->isMaster()
#ifdef __UNDERWORLD__
|| pMonster->isUnderworld() || pMonster->getMonsterType() == 599
#endif
;
// 죽었으면 흡혈 못하고..
// 마스터는 아무나 다 빤다 - -;
// 대상이 죽었으면 못 빤다.
if (pMonster->isDead()
|| pMonster->isFlag(Effect::EFFECT_CLASS_COMA)
|| !pMonster->isEnemyToAttack(pEnemy) && !isMaster
|| pEnemy->isDead() || pEnemy->isFlag(Effect::EFFECT_CLASS_COMA))
{
return false;
}
Zone* pZone = pMonster->getZone();
Assert(pZone != NULL);
GCBloodDrainOK1 _GCBloodDrainOK1;
GCBloodDrainOK2 _GCBloodDrainOK2;
GCBloodDrainOK3 _GCBloodDrainOK3;
// 마스터는 체력 100% 라도 문다.
int HPMultiplier = (isMaster? 1 : 3); // 현재 HP가 1/1, 1/3
bool bHitRoll = HitRoll::isSuccessBloodDrain(pMonster, pEnemy, HPMultiplier);
bool bCanHit = canHit(pMonster, pEnemy, SKILL_BLOOD_DRAIN);
// 마스터는 거리에 관계없이 문다~
bool bRangeCheck = isMaster || verifyDistance(pMonster, pEnemy, 1);
// 흡혈 면역 상태. by sigi. 2002.9.13
bool bEffected = pEnemy->isFlag(Effect::EFFECT_CLASS_IMMUNE_TO_BLOOD_DRAIN);
if (bHitRoll && bCanHit && bRangeCheck && !bEffected)
{
if (pEnemy->isSlayer())
{
// Set EffectBloodDrain
// 마스터면 안건다.
if (!isMaster)
{
EffectBloodDrain* pEffectBloodDrain = new EffectBloodDrain(pEnemy);
pEffectBloodDrain->setLevel(pMonster->getLevel());
pEffectBloodDrain->setDeadline(BLOODDRAIN_DURATION); // 게임시간으로 3일 정도
pEnemy->addEffect(pEffectBloodDrain);
pEffectBloodDrain->create(pEnemy->getName());
_GCBloodDrainOK2.addShortData(MODIFY_EFFECT_STAT, Effect::EFFECT_CLASS_BLOOD_DRAIN);
pEnemy->setFlag(Effect::EFFECT_CLASS_BLOOD_DRAIN);
Slayer* pTargetSlayer = dynamic_cast<Slayer*>(pEnemy);
SLAYER_RECORD prev;
pTargetSlayer->getSlayerRecord(prev);
pTargetSlayer->initAllStat();
pTargetSlayer->sendRealWearingInfo();
pTargetSlayer->addModifyInfo(prev, _GCBloodDrainOK2);
}
// 로그를 남긴다.
//log(LOG_BLOODDRAINED, pEnemy->getName(), "게임 내의 몬스터");
}
// 아우스터즈의 경우엔..... -_-; 제한시간 없는 이펙트를 생성한다. 엄밀히 말해 제한시간이 없는 건 아니지만..
// else if (pEnemy->isOusters() && !isMaster )
// {
// EffectBloodDrain* pEffectBloodDrain = new EffectBloodDrain(pEnemy);
// pEffectBloodDrain->setLevel(pMonster->getLevel());
// pEnemy->addEffect(pEffectBloodDrain);
// pEffectBloodDrain->create(pEnemy->getName());
// _GCBloodDrainOK2.addShortData(MODIFY_EFFECT_STAT, Effect::EFFECT_CLASS_BLOOD_DRAIN);
//
// pEnemy->setFlag(Effect::EFFECT_CLASS_BLOOD_DRAIN);
//
// Sight_t oldSight = pEnemy->getSight();
// Sight_t newSight = pEnemy->getEffectedSight();
//
// if (oldSight != newSight )
// {
// pEnemy->setSight(newSight);
// pZone->updateScan(pEnemy, oldSight, pEnemy->getSight());
// _GCBloodDrainOK2.addShortData(MODIFY_VISION, pEnemy->getSight());
//
// GCChangeDarkLight gcChangeDarkLight;
// gcChangeDarkLight.setDarkLevel(15);
// gcChangeDarkLight.setLightLevel(newSight);
// pEnemy->getPlayer()->sendPacket(&gcChangeDarkLight);
// }
// }
_GCBloodDrainOK3.setObjectID(pMonster->getObjectID());
_GCBloodDrainOK3.setTargetObjectID (pEnemy->getObjectID());
// 타겟이 뭐든 플래그는 건다.
// 마스터면 안건다.
//.........这里部分代码省略.........
示例7: execute
//////////////////////////////////////////////////////////////////////////////
// 뱀파이어 오브젝트 핸들러
//////////////////////////////////////////////////////////////////////////////
void BloodDrain::execute(Vampire* pVampire, ObjectID_t TargetObjectID)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " Begin(vampire)" << endl;
Assert(pVampire != NULL);
try
{
Player* pPlayer = pVampire->getPlayer();
Zone* pZone = pVampire->getZone();
Assert(pPlayer != NULL);
Assert(pZone != NULL);
Creature* pTargetCreature = pZone->getCreature(TargetObjectID);
//Assert(pTargetCreature != NULL);
// NPC는 공격할 수가 없다.
// 면역 상태. by sigi. 2002.9.13
// 무적상태 체크. by sigi.2002.9.5
// 죽은 애는 피 빨 수 없다. by Sequoia.2003. 3. 20
if (pTargetCreature==NULL // NoSuch 제거. by sigi. 2002.5.2
|| pTargetCreature->isNPC()
|| pTargetCreature->isFlag(Effect::EFFECT_CLASS_IMMUNE_TO_BLOOD_DRAIN)
|| !canAttack(pVampire, pTargetCreature )
|| pTargetCreature->isFlag(Effect::EFFECT_CLASS_COMA)
|| pTargetCreature->isDead()
)
{
executeSkillFailException(pVampire, getSkillType());
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End(vampire)" << endl;
return;
}
GCBloodDrainOK1 _GCBloodDrainOK1;
GCBloodDrainOK2 _GCBloodDrainOK2;
GCBloodDrainOK3 _GCBloodDrainOK3;
Timeval CurrentTime;
getCurrentTime(CurrentTime);
bool bHitRoll = HitRoll::isSuccessBloodDrain(pVampire, pTargetCreature);
bool bCanHit = canHit(pVampire, pTargetCreature, SKILL_BLOOD_DRAIN);
bool bTimeCheck = CurrentTime.tv_sec > 1 ? true : false;
bool bRangeCheck = verifyDistance(pVampire, pTargetCreature, 2);
bool bPK = verifyPK(pVampire, pTargetCreature);
if (bHitRoll && bCanHit && bTimeCheck && bRangeCheck && bPK)
{
// 슬레이어일 경우에만 이펙트 오브젝트를 생성한다.
if (pTargetCreature->isSlayer())
{
EffectBloodDrain* pEffectBloodDrain = new EffectBloodDrain(pTargetCreature);
pEffectBloodDrain->setLevel(pVampire->getLevel());
pEffectBloodDrain->setDeadline(BLOODDRAIN_DURATION); // 3일??
pTargetCreature->addEffect(pEffectBloodDrain);
pEffectBloodDrain->create(pTargetCreature->getName());
_GCBloodDrainOK2.addShortData(MODIFY_EFFECT_STAT, Effect::EFFECT_CLASS_BLOOD_DRAIN);
// 타겟이 뭐든 플래그는 건다.
pTargetCreature->setFlag(Effect::EFFECT_CLASS_BLOOD_DRAIN);
Slayer* pTargetSlayer = dynamic_cast<Slayer*>(pTargetCreature);
SLAYER_RECORD prev;
pTargetSlayer->getSlayerRecord(prev);
pTargetSlayer->initAllStat();
pTargetSlayer->sendRealWearingInfo();
pTargetSlayer->addModifyInfo(prev, _GCBloodDrainOK2);
// 로그를 남긴다.
//log(LOG_BLOODDRAINED, pTargetCreature->getName(), pVampire->getName());
}
// 아우스터즈의 경우엔..... -_-; 제한시간 없는 이펙트를 생성한다. 엄밀히 말해 제한시간이 없는 건 아니지만..
// else if (pTargetCreature->isOusters() )
// {
// EffectBloodDrain* pEffectBloodDrain = new EffectBloodDrain(pTargetCreature);
// pEffectBloodDrain->setLevel(pVampire->getLevel());
// pTargetCreature->addEffect(pEffectBloodDrain);
// pEffectBloodDrain->create(pTargetCreature->getName());
// _GCBloodDrainOK2.addShortData(MODIFY_EFFECT_STAT, Effect::EFFECT_CLASS_BLOOD_DRAIN);
//
// // 타겟이 뭐든 플래그는 건다.
// pTargetCreature->setFlag(Effect::EFFECT_CLASS_BLOOD_DRAIN);
//
// Sight_t oldSight = pTargetCreature->getSight();
// Sight_t newSight = pTargetCreature->getEffectedSight();
//
// if (oldSight != newSight )
// {
// pTargetCreature->setSight(newSight);
// pZone->updateScan(pTargetCreature, oldSight, pTargetCreature->getSight());
// _GCBloodDrainOK2.addShortData(MODIFY_VISION, pTargetCreature->getSight());
//
// GCChangeDarkLight gcChangeDarkLight;
// gcChangeDarkLight.setDarkLevel(15);
//.........这里部分代码省略.........
示例8: 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);
//.........这里部分代码省略.........
示例9: execute
//.........这里部分代码省略.........
SkillInput input(pVampire);
SkillOutput output;
computeOutput(input, output);
// pTargetCreature가 저주마법을 반사하는 경우
if (CheckReflection(pVampire, pTargetCreature, getSkillType()))
{
pTargetCreature = (Creature*)pVampire;
TargetObjectID = pVampire->getObjectID();
}
Resist_t resist = pTargetCreature->getResist(MAGIC_DOMAIN_CURSE);
if ((resist*10/3) > output.Duration ) output.Duration=0;
else output.Duration -= resist*10/3;
if (output.Duration < 20 ) output.Duration = 20;
// 이펙트 오브젝트를 생성해 붙인다.
EffectDeath* pEffect = new EffectDeath(pTargetCreature);
pEffect->setDeadline(output.Duration);
pEffect->setLevel(pSkillInfo->getLevel()/2);
pEffect->setResistPenalty(output.Damage);
pTargetCreature->addEffect(pEffect);
pTargetCreature->setFlag(Effect::EFFECT_CLASS_DEATH);
// 능력치를 계산해서 보내준다.
if (pTargetCreature->isSlayer())
{
Slayer* pTargetSlayer = dynamic_cast<Slayer*>(pTargetCreature);
if (bCanSeeCaster)
{
SLAYER_RECORD prev;
pTargetSlayer->getSlayerRecord(prev);
pTargetSlayer->initAllStat();
pTargetSlayer->addModifyInfo(prev, _GCSkillToObjectOK2);
}
else
{
SLAYER_RECORD prev;
pTargetSlayer->getSlayerRecord(prev);
pTargetSlayer->initAllStat();
pTargetSlayer->addModifyInfo(prev, _GCSkillToObjectOK6);
}
}
else if (pTargetCreature->isVampire())
{
Vampire* pTargetVampire = dynamic_cast<Vampire*>(pTargetCreature);
VAMPIRE_RECORD prev;
pTargetVampire->getVampireRecord(prev);
pTargetVampire->initAllStat();
if (bCanSeeCaster)
{
pTargetVampire->addModifyInfo(prev, _GCSkillToObjectOK2);
}
else
{
pTargetVampire->addModifyInfo(prev, _GCSkillToObjectOK6);
}
}
else if (pTargetCreature->isOusters())
{
Ousters* pTargetOusters = dynamic_cast<Ousters*>(pTargetCreature);
OUSTERS_RECORD prev;
示例10: affect
void EffectCureCriticalWounds::affect(Creature* pCreature)
throw(Error)
{
__BEGIN_TRY
Zone* pZone = pCreature->getZone();
Assert(pZone != NULL);
GCSkillToSelfOK1 _GCSkillToSelfOK1;
GCSkillToSelfOK2 _GCSkillToSelfOK2;
int X = pCreature->getX();
int Y = pCreature->getY();
Exp_t ExpUp = 0;
bool bCured = false;
for(int oY = -2; oY <= 2; oY++)
for(int oX = -2; oX <= 2; oX++)
{
int tileX = X+oX;
int tileY = Y+oY;
if (isValidZoneCoord(pZone, tileX, tileY))
{
Tile& tile = pZone->getTile(tileX, tileY);
if (tile.hasCreature(Creature::MOVE_MODE_WALKING ) )
{
const list<Object*>& oList = tile.getObjectList();
for(list<Object*>::const_iterator itr = oList.begin(); itr != oList.end(); itr++)
{
Object* pTarget = *itr;
Creature* pTargetCreature = NULL;
if (pTarget->getObjectClass() == Object::OBJECT_CLASS_CREATURE
&& (pTargetCreature = dynamic_cast<Creature*>(pTarget))->isSlayer())
{
Assert(pTargetCreature != NULL);
HP_t RemainHP = 0;
if (pTargetCreature->isSlayer() && !pTargetCreature->isFlag(Effect::EFFECT_CLASS_COMA) )
{
Slayer* pSlayer = dynamic_cast<Slayer*>(pTargetCreature);
HP_t CurrentHP = pSlayer->getHP(ATTR_CURRENT);
HP_t MaxHP = pSlayer->getHP(ATTR_MAX);
if (pTargetCreature->isFlag(Effect::EFFECT_CLASS_BLOOD_DRAIN))
{
ExpUp++;
Effect* pEffect = pSlayer->findEffect(Effect::EFFECT_CLASS_BLOOD_DRAIN);
EffectBloodDrain * pEffectBloodDrain = dynamic_cast<EffectBloodDrain*>(pEffect);
Assert(pEffectBloodDrain != NULL);
if (pEffectBloodDrain->getLevel() < CriticalBloodDrainLevel ) {
// 흡혈 아르바이트를 방지하기 위한 후유증 이펙트를 붙여준다.
if (pSlayer->isFlag(Effect::EFFECT_CLASS_AFTERMATH))
{
Effect* pEffect = pSlayer->findEffect(Effect::EFFECT_CLASS_AFTERMATH);
EffectAftermath* pEffectAftermath = dynamic_cast<EffectAftermath*>(pEffect);
pEffectAftermath->setDeadline(5*600); // 5분 동안 지속된다.
}
else
{
EffectAftermath* pEffectAftermath = new EffectAftermath(pSlayer);
pEffectAftermath->setDeadline(5*600); // 5분 동안 지속된다.
pSlayer->addEffect(pEffectAftermath);
pSlayer->setFlag(Effect::EFFECT_CLASS_AFTERMATH);
pEffectAftermath->create(pSlayer->getName());
}
pEffectBloodDrain->destroy(pSlayer->getName());
pSlayer->deleteEffect(Effect::EFFECT_CLASS_BLOOD_DRAIN);
bCured = true;
SLAYER_RECORD prev;
pSlayer->getSlayerRecord(prev);
pSlayer->initAllStat();
pSlayer->sendRealWearingInfo();
pSlayer->sendModifyInfo(prev);
GCRemoveEffect gcRemoveEffect;
gcRemoveEffect.setObjectID(pSlayer->getObjectID());
gcRemoveEffect.addEffectList((EffectID_t)Effect::EFFECT_CLASS_BLOOD_DRAIN);
pZone->broadcastPacket(pSlayer->getX(), pSlayer->getY(), &gcRemoveEffect);
}
}
if(CurrentHP < MaxHP ) {
ExpUp++;
bCured = true;
RemainHP = min(CurrentHP + m_Point,(int)MaxHP);
pSlayer->setHP(RemainHP, ATTR_CURRENT);
GCModifyInformation gcMI;
gcMI.addShortData(MODIFY_CURRENT_HP, RemainHP);
pSlayer->getPlayer()->sendPacket(&gcMI);
//.........这里部分代码省略.........
示例11: execute
void ActionHeal::execute (Creature * pCreature1 , Creature * pCreature2)
throw(Error)
{
__BEGIN_TRY
Assert(pCreature1 != NULL);
Assert(pCreature2 != NULL);
Assert(pCreature1->isNPC());
Assert(pCreature2->isPC());
Player* pPlayer = pCreature2->getPlayer();
Zone* pZone = pCreature2->getZone();
Assert(pPlayer != NULL);
// 일단 클라이언트를 위해서 OK 패킷을 함 날린다.
GCNPCResponse okpkt;
okpkt.setCode(NPC_RESPONSE_HEAL);
pPlayer->sendPacket(&okpkt);
// 죽었거나 코마 걸려있으면 안 치료해준다.
if (pCreature2->isDead() || pCreature2->isFlag(Effect::EFFECT_CLASS_COMA ) )
{
return;
}
// 슬레이어라면...
if (pCreature2->isSlayer())
{
Slayer* pSlayer = dynamic_cast<Slayer*>(pCreature2);
EffectManager* pEffectManager = pSlayer->getEffectManager();
GCModifyInformation modifyPkt;
GCRemoveEffect removePkt;
GCStatusCurrentHP hpPkt;
// 먼저 HP랑 MP를 풀로 채워준다.
if (pSlayer->getHP(ATTR_CURRENT) < pSlayer->getHP(ATTR_MAX))
{
pSlayer->setHP(pSlayer->getHP(ATTR_MAX), ATTR_CURRENT);
modifyPkt.addShortData(MODIFY_CURRENT_HP, pSlayer->getHP(ATTR_CURRENT));
hpPkt.setObjectID(pSlayer->getObjectID());
hpPkt.setCurrentHP(pSlayer->getHP(ATTR_CURRENT));
}
if (pSlayer->getMP(ATTR_CURRENT) < pSlayer->getMP(ATTR_MAX))
{
pSlayer->setMP(pSlayer->getMP(ATTR_MAX), ATTR_CURRENT);
modifyPkt.addShortData(MODIFY_CURRENT_MP, pSlayer->getMP(ATTR_CURRENT));
}
// 흡혈 이펙트를 삭제한다.
Effect* pBloodDrainEffect = pEffectManager->findEffect(Effect::EFFECT_CLASS_BLOOD_DRAIN);
if (pBloodDrainEffect != NULL)
{
// DB에서 삭제하고, 이펙트 매니저에서 삭제한다.
pBloodDrainEffect->destroy(pSlayer->getName());
pEffectManager->deleteEffect(pSlayer, Effect::EFFECT_CLASS_BLOOD_DRAIN);
// 흡혈 아르바이트를 방지하기 위한 후유증 이펙트를 붙여준다.
if (pSlayer->isFlag(Effect::EFFECT_CLASS_AFTERMATH))
{
Effect* pEffect = pEffectManager->findEffect(Effect::EFFECT_CLASS_AFTERMATH);
EffectAftermath* pEffectAftermath = dynamic_cast<EffectAftermath*>(pEffect);
pEffectAftermath->setDeadline(5*600); // 5분 동안 지속된다.
}
else
{
EffectAftermath* pEffectAftermath = new EffectAftermath(pSlayer);
pEffectAftermath->setDeadline(5*600); // 5분 동안 지속된다.
pEffectManager->addEffect(pEffectAftermath);
pSlayer->setFlag(Effect::EFFECT_CLASS_AFTERMATH);
pEffectAftermath->create(pSlayer->getName());
}
// 패킷에다 정보를 더한다.
removePkt.addEffectList((EffectID_t)Effect::EFFECT_CLASS_BLOOD_DRAIN);
// 흡혈을 치료하면 능력치가 변화하게 된다.
SLAYER_RECORD prev;
pSlayer->getSlayerRecord(prev);
pSlayer->initAllStat();
pSlayer->sendModifyInfo(prev);
pSlayer->sendRealWearingInfo();
}
// 독 이펙트를 삭제한다.
Effect* pEffectPoison = pEffectManager->findEffect(Effect::EFFECT_CLASS_POISON);
if (pEffectPoison != NULL)
{
// 이펙트 매니저에서 삭제한다.
pEffectManager->deleteEffect(pSlayer, Effect::EFFECT_CLASS_POISON);
// 패킷에다 정보를 더한다.
removePkt.addEffectList((EffectID_t)Effect::EFFECT_CLASS_POISON);
}
// 다크블루 포이즌 이펙트를 삭제한다.
Effect* pEffectDarkBluePoison = pEffectManager->findEffect(Effect::EFFECT_CLASS_DARKBLUE_POISON);
if (pEffectDarkBluePoison != NULL)
{
//.........这里部分代码省略.........
示例12: unaffect
void EffectDoom::unaffect(Creature* pCreature)
throw(Error)
{
__BEGIN_TRY
__BEGIN_DEBUG
//cout << "EffectDoom" << "unaffect BEGIN" << endl;
Assert(pCreature != NULL);
// 능력치를 정상적으로 되돌리기 위해서는 플래그를 끄고,
// initAllStat을 불러야 한다.
pCreature->removeFlag(Effect::EFFECT_CLASS_DOOM);
if (pCreature->isVampire())
{
Vampire* pTargetVampire = dynamic_cast<Vampire*>(pCreature);
VAMPIRE_RECORD prev;
pTargetVampire->getVampireRecord(prev);
pTargetVampire->initAllStat();
pTargetVampire->sendRealWearingInfo();
pTargetVampire->sendModifyInfo(prev);
}
else if (pCreature->isMonster())
{
Monster* pMonster = dynamic_cast<Monster*>(pCreature);
pMonster->initAllStat();
}
else if (pCreature->isSlayer())
{
Slayer* pTargetSlayer = dynamic_cast<Slayer*>(pCreature);
SLAYER_RECORD prev;
pTargetSlayer->getSlayerRecord(prev);
pTargetSlayer->initAllStat();
pTargetSlayer->sendRealWearingInfo();
pTargetSlayer->sendModifyInfo(prev);
}
else if (pCreature->isOusters())
{
Ousters* pTargetOusters = dynamic_cast<Ousters*>(pCreature);
OUSTERS_RECORD prev;
pTargetOusters->getOustersRecord(prev);
pTargetOusters->initAllStat();
pTargetOusters->sendRealWearingInfo();
pTargetOusters->sendModifyInfo(prev);
}
else Assert(false);
Zone* pZone = pCreature->getZone();
Assert(pZone != NULL);
GCRemoveEffect gcRemoveEffect;
gcRemoveEffect.setObjectID(pCreature->getObjectID());
gcRemoveEffect.addEffectList(Effect::EFFECT_CLASS_DOOM);
pZone->broadcastPacket(pCreature->getX(), pCreature->getY(), &gcRemoveEffect);
//cout << "EffectDoom" << "unaffect END" << endl;
__END_DEBUG
__END_CATCH
}
示例13: execute
void SimpleCureSkill::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);
// 슬레이어 외에는 치료할 수가 없다.
// NoSuch제거. by sigi. 2002.5.2
if (pTargetCreature==NULL
|| pTargetCreature->isSlayer() == false)
{
executeSkillFailException(pSlayer, param.SkillType);
return;
}
GCSkillToObjectOK1 _GCSkillToObjectOK1;
GCSkillToObjectOK2 _GCSkillToObjectOK2;
GCSkillToObjectOK3 _GCSkillToObjectOK3;
GCSkillToObjectOK4 _GCSkillToObjectOK4;
GCSkillToObjectOK5 _GCSkillToObjectOK5;
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(param.SkillType);
SkillDomainType_t DomainType = pSkillInfo->getDomainType();
bool bHPCheck = false;
// 체력이 닳거나, 흡혈을 당한 상태여야 한다.
Slayer* pTargetSlayer = dynamic_cast<Slayer*>(pTargetCreature);
Assert(pTargetSlayer != NULL);
EffectBloodDrain* pEffectBloodDrain = NULL;
if (pTargetSlayer->getHP(ATTR_CURRENT) < pTargetSlayer->getHP(ATTR_MAX))
{
bHPCheck = true;
}
if (pTargetSlayer->isFlag(Effect::EFFECT_CLASS_BLOOD_DRAIN))
{
Effect* pEffect = pTargetSlayer->findEffect(Effect::EFFECT_CLASS_BLOOD_DRAIN);
pEffectBloodDrain = dynamic_cast<EffectBloodDrain*>(pEffect);
Assert(pEffectBloodDrain != NULL);
if (pEffectBloodDrain->getLevel() < param.Level) bHPCheck = true;
}
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);
if (bHPCheck && bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && pTargetCreature->isAlive())
{
decreaseMana(pSlayer, RequiredMP, _GCSkillToObjectOK1);
uint HealPoint = param.SkillDamage;
// 흡혈당한 상태라면 흡혈 상태를 날려준다.
if (pEffectBloodDrain != NULL && pEffectBloodDrain->getLevel() < param.Level)
{
// 흡혈 아르바이트를 방지하기 위한 후유증 이펙트를 붙여준다.
if (pTargetSlayer->isFlag(Effect::EFFECT_CLASS_AFTERMATH))
{
Effect* pEffect = pTargetSlayer->findEffect(Effect::EFFECT_CLASS_AFTERMATH);
EffectAftermath* pEffectAftermath = dynamic_cast<EffectAftermath*>(pEffect);
pEffectAftermath->setDeadline(5*600); // 5분 동안 지속된다.
}
else
{
EffectAftermath* pEffectAftermath = new EffectAftermath(pTargetSlayer);
pEffectAftermath->setDeadline(5*600); // 5분 동안 지속된다.
pTargetSlayer->addEffect(pEffectAftermath);
pTargetSlayer->setFlag(Effect::EFFECT_CLASS_AFTERMATH);
pEffectAftermath->create(pTargetSlayer->getName());
}
pEffectBloodDrain->destroy(pTargetSlayer->getName());
pTargetSlayer->deleteEffect(Effect::EFFECT_CLASS_BLOOD_DRAIN);
SLAYER_RECORD prev;
pTargetSlayer->getSlayerRecord(prev);
pTargetSlayer->initAllStat();
pTargetSlayer->sendRealWearingInfo();
pTargetSlayer->addModifyInfo(prev, _GCSkillToObjectOK2);
//.........这里部分代码省略.........