本文整理汇总了C++中Slayer::getPlayer方法的典型用法代码示例。如果您正苦于以下问题:C++ Slayer::getPlayer方法的具体用法?C++ Slayer::getPlayer怎么用?C++ Slayer::getPlayer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Slayer
的用法示例。
在下文中一共展示了Slayer::getPlayer方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkCondition
GQuestElement::ResultType GQuestGiveDomainExpElement::checkCondition(PlayerCreature* pPC ) const
{
if (!pPC->isSlayer() ) return FAIL;
GCModifyInformation gcMI;
Slayer* pSlayer = dynamic_cast<Slayer*>(pPC);
increaseDomainExp(pSlayer, pSlayer->getHighestSkillDomain(), m_Amount, gcMI);
pSlayer->getPlayer()->sendPacket(&gcMI);
GCSystemMessage gcSM;
gcSM.setMessage("도메인 경험치를 획득했습니다.");
pSlayer->getPlayer()->sendPacket(&gcSM);
return OK;
}
示例2: giveMemberReward
void giveMemberReward(PlayerCreature* pPC, uint type )
{
Exp_t exp = ExpRewardTable[pPC->getRace()][pPC->getLevel()];
Gold_t gold = GoldRewardTable[pPC->getRace()][type];
pPC->increaseGoldEx(gold);
GCModifyInformation gcMI;
gcMI.addLongData(MODIFY_GOLD, pPC->getGold());
if (pPC->isSlayer() )
{
Slayer* pSlayer = dynamic_cast<Slayer*>(pPC);
increaseDomainExp(pSlayer, pSlayer->getHighestSkillDomain(), exp, gcMI);
pSlayer->getPlayer()->sendPacket(&gcMI);
}
else if (pPC->isVampire() )
{
Vampire* pVampire = dynamic_cast<Vampire*>(pPC);
increaseVampExp(pVampire, exp, gcMI);
pVampire->getPlayer()->sendPacket(&gcMI);
}
else if (pPC->isOusters() )
{
GCModifyInformation gcMI;
Ousters* pOusters = dynamic_cast<Ousters*>(pPC);
increaseOustersExp(pOusters, exp, gcMI);
}
}
示例3: unaffect
void EffectDecreaseHP::unaffect(Creature* pCreature)
throw(Error)
{
__BEGIN_TRY
__BEGIN_DEBUG
Assert(pCreature != NULL);
Zone* pZone = pCreature->getZone();
Assert(pZone != NULL);
pCreature->removeFlag(Effect::EFFECT_CLASS_DECREASE_HP);
Damage_t decreaseHP = m_Point;
if (!(pZone->getZoneLevel() & COMPLETE_SAFE_ZONE)
&& !pCreature->isDead()
&& !pCreature->isFlag(Effect::EFFECT_CLASS_COMA)
// 무적상태 체크. by sigi. 2002.9.5
&& canAttack(NULL, pCreature )
)
{
if (pCreature->isSlayer())
{
Slayer* pSlayer = dynamic_cast<Slayer*>(pCreature);
HP_t CurrentHP = pSlayer->getHP(ATTR_CURRENT);
if (CurrentHP > 0)
{
HP_t RemainHP = max(0, CurrentHP -(int)decreaseHP);
pSlayer->setHP(RemainHP, ATTR_CURRENT);
GCModifyInformation gcMI;
gcMI.addShortData(MODIFY_CURRENT_HP, RemainHP);
pSlayer->getPlayer()->sendPacket(&gcMI);
// 변한 HP를 브로드캐스팅해준다.
GCStatusCurrentHP pkt;
pkt.setObjectID(pSlayer->getObjectID());
pkt.setCurrentHP(RemainHP);
pZone->broadcastPacket(pSlayer->getX(), pSlayer->getY(), &pkt);
}
}
else if (pCreature->isVampire())
{
Vampire* pVampire = dynamic_cast<Vampire*>(pCreature);
HP_t CurrentHP = pVampire->getHP(ATTR_CURRENT);
if (CurrentHP > 0)
{
HP_t RemainHP = max(0, CurrentHP -(int)decreaseHP);
pVampire->setHP(RemainHP, ATTR_CURRENT);
GCModifyInformation gcMI;
gcMI.addShortData(MODIFY_CURRENT_HP, RemainHP);
pVampire->getPlayer()->sendPacket(&gcMI);
// 공격(흡혈) 당하는 경우에는 공격자의 성향이 바뀜 by sigi. 2002.12.27
Creature* pAttacker = pZone->getCreature(m_UserObjectID);
if (pAttacker!=NULL && pAttacker->isVampire())
{
Vampire* pAttackVampire = dynamic_cast<Vampire*>(pAttacker);
GCModifyInformation gcAttackerMI;
computeAlignmentChange(pVampire, decreaseHP, pAttackVampire, NULL, &gcAttackerMI);
// 뭔가 변한 정보가 있다면 보내준다.
if (gcAttackerMI.getShortCount()+gcAttackerMI.getLongCount() > 0)
{
pAttackVampire->getPlayer()->sendPacket(&gcAttackerMI);
}
}
// 변한 HP를 브로드캐스팅해준다.
GCStatusCurrentHP pkt;
pkt.setObjectID(pVampire->getObjectID());
pkt.setCurrentHP(RemainHP);
pZone->broadcastPacket(pVampire->getX(), pVampire->getY(), &pkt);
}
}
else if (pCreature->isOusters())
{
Ousters* pOusters = dynamic_cast<Ousters*>(pCreature);
HP_t CurrentHP = pOusters->getHP(ATTR_CURRENT);
if (CurrentHP > 0)
{
HP_t RemainHP = max(0, CurrentHP -(int)decreaseHP);
pOusters->setHP(RemainHP, ATTR_CURRENT);
GCModifyInformation gcMI;
gcMI.addShortData(MODIFY_CURRENT_HP, RemainHP);
pOusters->getPlayer()->sendPacket(&gcMI);
//.........这里部分代码省略.........
示例4: affect
void EffectAlignmentRecovery::affect(Creature* pCreature)
throw(Error)
{
__BEGIN_TRY
Assert(pCreature != NULL);
Assert(pCreature->isPC());
Timeval CurrentTime;
getCurrentTime(CurrentTime);
GCModifyInformation gcModifyInformation;
Alignment_t CurrentAlignment = 0;
Alignment_t NewAlignment = 0;
if (pCreature->isSlayer())
{
Slayer* pSlayer = dynamic_cast<Slayer*>(pCreature);
Assert(pSlayer != NULL);
if (m_Period != 0)
{
// 플레그 걸귀
pSlayer->setFlag(Effect::EFFECT_CLASS_ALIGNMENT_RECOVERY);
// 한 턴에 얼마나 회복 시킬 것인가.
CurrentAlignment = pSlayer->getAlignment();
NewAlignment = min(10000, (int)(CurrentAlignment + m_AlignmentQuantity));
pSlayer->setAlignment(NewAlignment);
gcModifyInformation.addLongData(MODIFY_ALIGNMENT, NewAlignment);
pSlayer->getPlayer()->sendPacket(&gcModifyInformation);
WORD AlignmentSaveCount = pSlayer->getAlignmentSaveCount();
if (AlignmentSaveCount > ALIGNMENT_SAVE_PERIOD)
{
StringStream msg;
msg << "Alignment = " << NewAlignment;
pSlayer->tinysave(msg.toString());
AlignmentSaveCount = 0;
}
else AlignmentSaveCount++;
pSlayer->setAlignmentSaveCount(AlignmentSaveCount);
}
else
{
// unaffect하면서 패킷이 날아갈 테니까....
setDeadline(0);
}
m_Period--;
}
else if (pCreature->isVampire())
{
Vampire* pVampire = dynamic_cast<Vampire*>(pCreature);
Assert(pVampire != NULL);
if (m_Period != 0)
{
// 플레그 걸귀
pVampire->setFlag(Effect::EFFECT_CLASS_ALIGNMENT_RECOVERY);
// 한 턴에 얼마나 회복 시킬 것인가.
CurrentAlignment = pVampire->getAlignment();
NewAlignment = min(10000, CurrentAlignment + m_AlignmentQuantity);
pVampire->setAlignment(NewAlignment);
gcModifyInformation.addLongData(MODIFY_ALIGNMENT, NewAlignment);
pVampire->getPlayer()->sendPacket(&gcModifyInformation);
WORD AlignmentSaveCount = pVampire->getAlignmentSaveCount();
if (AlignmentSaveCount > ALIGNMENT_SAVE_PERIOD)
{
StringStream msg;
msg << "Alignment = " << NewAlignment;
pVampire->tinysave(msg.toString());
AlignmentSaveCount = 0;
}
else AlignmentSaveCount++;
pVampire->setAlignmentSaveCount(AlignmentSaveCount);
}
else
{
// unaffect하면서 패킷이 날아갈 테니까....
setDeadline(0);
}
m_Period--;
}
else if (pCreature->isOusters())
{
Ousters* pOusters = dynamic_cast<Ousters*>(pCreature);
Assert(pOusters != NULL);
if (m_Period != 0)
//.........这里部分代码省略.........
示例5: unaffect
void EffectAlignmentRecovery::unaffect(Creature* pCreature)
throw(Error)
{
__BEGIN_TRY
Assert(pCreature != NULL);
if (pCreature->isSlayer())
{
Slayer* pSlayer = dynamic_cast<Slayer*>(pCreature);
Assert(pSlayer != NULL);
Zone* pZone = pSlayer->getZone();
Assert(pZone != NULL);
if (m_Period != 0)
{
// 한 턴에 얼마나 회복 시킬 것인가.
Alignment_t CurrentAlignment = pSlayer->getAlignment();
Alignment_t NewAlignment = min(10000, (int)(CurrentAlignment + m_AlignmentQuantity* m_Period));
pSlayer->setAlignment(NewAlignment);
WORD AlignmentSaveCount = pSlayer->getAlignmentSaveCount();
if (AlignmentSaveCount == 10)
{
StringStream msg;
msg << "Alignment = " << NewAlignment;
pSlayer->tinysave(msg.toString());
AlignmentSaveCount = 0;
}
else AlignmentSaveCount++;
pSlayer->setAlignmentSaveCount(AlignmentSaveCount);
}
// 현재 Alignment를 브로드캐스팅한다.
// 이제 회복이 끝났나는 것을 알리도록 한다.
// 자신에게 먼저
GCModifyInformation gcModifyInformation;
gcModifyInformation.addLongData(MODIFY_ALIGNMENT, pSlayer->getAlignment());
pSlayer->getPlayer()->sendPacket(&gcModifyInformation);
// 주변사람에게도 무언가를 날려줘야 한다.
// 패킷을 새로 만들어야겠지..
pSlayer->removeFlag(Effect::EFFECT_CLASS_ALIGNMENT_RECOVERY);
}
else if (pCreature->isVampire())
{
Vampire* pVampire = dynamic_cast<Vampire*>(pCreature);
//Zone* pZone = pVampire->getZone();
if (m_Period != 0)
{
// 한 턴에 얼마나 회복 시킬 것인가.
Alignment_t CurrentAlignment = pVampire->getAlignment();
Alignment_t NewAlignment = min(10000, (int)(CurrentAlignment + m_AlignmentQuantity* m_Period));
WORD AlignmentSaveCount = pVampire->getAlignmentSaveCount();
if (AlignmentSaveCount == 10)
{
StringStream msg;
msg << "Alignment = " << NewAlignment;
pVampire->tinysave(msg.toString());
AlignmentSaveCount = 0;
}
else AlignmentSaveCount++;
pVampire->setAlignmentSaveCount(AlignmentSaveCount);
}
// 현재 Alignment를 브로드캐스팅한다.
// 이제 회복이 끝났나는 것을 알리도록 한다.
// 자신에게 먼저
GCModifyInformation gcModifyInformation;
gcModifyInformation.addLongData(MODIFY_ALIGNMENT, pVampire->getAlignment());
pVampire->getPlayer()->sendPacket(&gcModifyInformation);
// 주변사람에게도..
pVampire->removeFlag(Effect::EFFECT_CLASS_ALIGNMENT_RECOVERY);
}
else if (pCreature->isOusters())
{
Ousters* pOusters = dynamic_cast<Ousters*>(pCreature);
//Zone* pZone = pOusters->getZone();
if (m_Period != 0)
{
// 한 턴에 얼마나 회복 시킬 것인가.
Alignment_t CurrentAlignment = pOusters->getAlignment();
Alignment_t NewAlignment = min(10000, (int)(CurrentAlignment + m_AlignmentQuantity* m_Period));
WORD AlignmentSaveCount = pOusters->getAlignmentSaveCount();
if (AlignmentSaveCount == 10)
{
StringStream msg;
msg << "Alignment = " << NewAlignment;
pOusters->tinysave(msg.toString());
//.........这里部分代码省略.........
示例6: affect
void EffectPoison::affect(Creature* pCreature)
throw(Error)
{
__BEGIN_TRY
//cout << "EffectPoison " << "begin" << endl;
Assert(pCreature != NULL);
Zone* pZone = pCreature->getZone();
Assert(pZone != NULL);
// 스킬 사용자를 가져온다.
// !! 이미 존을 나갔을 수 있으므로 NULL이 될 수 있다.
// by bezz. 2003.1.4
Creature* pCastCreature = pZone->getCreature(m_UserObjectID);
// EffectPoison이 크리쳐에게 걸리게 되는 경우에는 현재로서는
// GreenPoison에 의해 타일 위에 생긴
// EffectGreenPoison 위를 플레이어가 지나갈 때 뿐이다.
// EffectGreenPoison 내부에서 저항을 고려해서 데미지를 세팅한 다음
// EffectPoison을 붙이므로, 내부에서 한번 더 계산하면 안된다.
//Damage_t PoisonDamage = computeMagicDamage(pCreature, m_Point, MAGIC_DOMAIN_POISON, m_Level);
Damage_t PoisonDamage = m_Point;
if (!(pZone->getZoneLevel() & COMPLETE_SAFE_ZONE)
// 무적상태 체크. by sigi. 2002.9.5
&& canAttack(pCastCreature, pCreature )
)
{
if (pCreature->isSlayer())
{
Slayer* pSlayer = dynamic_cast<Slayer*>(pCreature);
GCModifyInformation gcMI;
::setDamage(pSlayer, PoisonDamage, pCastCreature, SKILL_GREEN_POISON, &gcMI);
pSlayer->getPlayer()->sendPacket(&gcMI);
}
else if (pCreature->isVampire())
{
Vampire* pVampire = dynamic_cast<Vampire*>(pCreature);
GCModifyInformation gcMI;
::setDamage(pVampire, PoisonDamage, pCastCreature, SKILL_GREEN_POISON, &gcMI);
pVampire->getPlayer()->sendPacket(&gcMI);
}
else if (pCreature->isOusters())
{
Ousters* pOusters = dynamic_cast<Ousters*>(pCreature);
GCModifyInformation gcMI;
::setDamage(pOusters, PoisonDamage, pCastCreature, SKILL_GREEN_POISON, &gcMI);
pOusters->getPlayer()->sendPacket(&gcMI);
}
else if (pCreature->isMonster())
{
Monster* pMonster = dynamic_cast<Monster*>(pCreature);
::setDamage(pMonster, PoisonDamage, pCastCreature, SKILL_GREEN_POISON);
}
// m_CasterName이 pCreature를 죽인 경우의 KillCount 처리
// by sigi. 2002.9.9
/* if (pCreature->isDead())
{
Creature* pAttacker = pZone->getCreature(m_UserObjectID);
if (pAttacker!=NULL)
{
affectKillCount(pAttacker, pCreature);
}
}*/
}
setNextTime(m_Tick);
//cout << "EffectPoison " << "end" << endl;
__END_CATCH
}
示例7: affect
void EffectStormPoison::affect(Creature* pCreature)
throw(Error)
{
__BEGIN_TRY
//cout << "EffectStormPoison " << "begin" << endl;
Assert(pCreature != NULL);
Zone* pZone = pCreature->getZone();
Assert(pZone != NULL);
// 사용자를 가져온다.
// !! 이미 존을 나갔을 수 있으므로 NULL이 될 수 있다.
// by bezz. 2003.3.13
Creature* pCastCreature = pZone->getCreature(m_UserObjectID);
// 캐스터가 없으면 무시한다.
if (pCastCreature == NULL )
return;
// EffectStormPoison은 AcidStorm, PoisonStorm, BloodyStorm위를 지나갈때 붙는다.
// 이는 3번의 연속 데미지를 주고 사라진다.
Damage_t StormDamage = m_Point;
GCModifyInformation GCAttackerMI;
if (!(pZone->getZoneLevel() & COMPLETE_SAFE_ZONE)
// 무적상태 체크. by sigi. 2002.9.5
&& canAttack(pCastCreature, pCreature )
)
{
if (pCreature->isSlayer())
{
Slayer* pSlayer = dynamic_cast<Slayer*>(pCreature);
GCModifyInformation gcMI;
setDamage(pSlayer, StormDamage, pCastCreature, SKILL_POISON_STORM, &gcMI, &GCAttackerMI);
pSlayer->getPlayer()->sendPacket(&gcMI);
}
else if (pCreature->isVampire())
{
Vampire* pVampire = dynamic_cast<Vampire*>(pCreature);
GCModifyInformation gcMI;
setDamage(pVampire, StormDamage, pCastCreature, SKILL_POISON_STORM, &gcMI, &GCAttackerMI);
pVampire->getPlayer()->sendPacket(&gcMI);
}
else if (pCreature->isOusters())
{
Ousters* pOusters = dynamic_cast<Ousters*>(pCreature);
GCModifyInformation gcMI;
setDamage(pOusters, StormDamage, pCastCreature, SKILL_POISON_STORM, &gcMI, &GCAttackerMI);
pOusters->getPlayer()->sendPacket(&gcMI);
}
else if (pCreature->isMonster())
{
Monster* pMonster = dynamic_cast<Monster*>(pCreature);
setDamage(pMonster, StormDamage, pCastCreature, SKILL_POISON_STORM, NULL, &GCAttackerMI);
}
if (pCastCreature->isVampire() && pCreature->isDead() )
{
Vampire* pVampire = dynamic_cast<Vampire*>(pCastCreature);
int exp = computeCreatureExp(pCreature, KILL_EXP);
shareVampExp(pVampire, exp, GCAttackerMI);
pVampire->getPlayer()->sendPacket(&GCAttackerMI);
}
// m_CasterName이 pCreature를 죽인 경우의 KillCount 처리
// by sigi. 2002.9.9
// set damage 를 불러서 처리한다. 주석 처리
// by bezz. 2002.12.31
/* if (pCreature->isDead())
{
Creature* pAttacker = pZone->getCreature(m_UserObjectID);
if (pAttacker!=NULL)
{
affectKillCount(pAttacker, pCreature);
}
}*/
}
setNextTime(m_Tick);
//cout << "EffectStormPoison " << "end" << endl;
__END_CATCH
}
示例8: 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);
//.........这里部分代码省略.........
示例9: affect
void EffectBloodyWallBlocked::affect()
throw(Error)
{
__BEGIN_TRY
//cout << "EffectBloodyWallBlocked" << "affect BEGIN" << endl;
Assert(m_pZone != NULL);
// 현재 이펙트가 붙어있는 타일을 받아온다.
Tile& tile = m_pZone->getTile(m_X, m_Y);
HP_t CurrentHP = 0;
HP_t RemainHP = 0;
// 타일 안에 존재하는 오브젝트들을 검색한다.
const list<Object*>& oList = tile.getObjectList();
list<Object*>::const_iterator itr = oList.begin();
for (; itr != oList.end(); itr++)
{
Assert(*itr != NULL);
Object* pObject = *itr;
Assert(pObject != NULL);
if (pObject->getObjectClass() == Object::OBJECT_CLASS_CREATURE)
{
Creature* pCreature = dynamic_cast<Creature*>(pObject);
Assert(pCreature != NULL);
// 무적상태 체크. by sigi. 2002.9.5
// 산 면역. by sigi. 2002.9.13
if (!canAttack(NULL, pCreature )
|| pCreature->isFlag(Effect::EFFECT_CLASS_IMMUNE_TO_BLOOD_DRAIN)
|| pCreature->isFlag(Effect::EFFECT_CLASS_COMA)
|| pCreature->isDead())
{
continue;
}
int AcidDamage = computeMagicDamage(pCreature, m_Damage, SKILL_BLOODY_WALL);
if (pCreature->getMoveMode() != Creature::MOVE_MODE_FLYING)
{
if (pCreature->isSlayer())
{
Slayer* pSlayer = dynamic_cast<Slayer*>(pCreature);
CurrentHP = pSlayer->getHP(ATTR_CURRENT);
RemainHP = max(0, CurrentHP -(int)AcidDamage);
pSlayer->setHP(RemainHP, ATTR_CURRENT);
GCModifyInformation gcMI;
gcMI.addShortData(MODIFY_CURRENT_HP, pSlayer->getHP(ATTR_CURRENT));
Player* pPlayer = pSlayer->getPlayer();
Assert(pPlayer != NULL);
pPlayer->sendPacket(&gcMI);
// 변한 HP를 브로드캐스팅해준다.
GCStatusCurrentHP pkt;
pkt.setObjectID(pSlayer->getObjectID());
pkt.setCurrentHP(RemainHP);
m_pZone->broadcastPacket(pSlayer->getX(), pSlayer->getY(), &pkt);
}
/* else if (pCreature->isVampire())
{
Vampire* pVampire = dynamic_cast<Vampire*>(pCreature);
CurrentHP = pVampire->getHP(ATTR_CURRENT);
RemainHP = max(0, CurrentHP -(int)AcidDamage);
pVampire->setHP(RemainHP, ATTR_CURRENT);
GCModifyInformation gcMI;
gcMI.addShortData(MODIFY_CURRENT_HP, pVampire->getHP(ATTR_CURRENT));
Player* pPlayer = pVampire->getPlayer();
Assert(pPlayer != NULL);
pPlayer->sendPacket(&gcMI);
// 변한 HP를 브로드캐스팅해준다.
GCStatusCurrentHP pkt;
pkt.setObjectID(pVampire->getObjectID());
pkt.setCurrentHP(RemainHP);
m_pZone->broadcastPacket(pVampire->getX(), pVampire->getY(), &pkt);
}
*/
else if (pCreature->isOusters())
{
Ousters* pOusters = dynamic_cast<Ousters*>(pCreature);
CurrentHP = pOusters->getHP(ATTR_CURRENT);
RemainHP = max(0, CurrentHP -(int)AcidDamage);
pOusters->setHP(RemainHP, ATTR_CURRENT);
GCModifyInformation gcMI;
gcMI.addShortData(MODIFY_CURRENT_HP, pOusters->getHP(ATTR_CURRENT));
//.........这里部分代码省略.........
示例10: affect
void EffectVigorDropToCreature::affect(Creature* pCreature)
throw(Error)
{
__BEGIN_TRY
//cout << "EffectVigorDropToCreature " << "begin" << endl;
Assert(pCreature != NULL);
Zone* pZone = pCreature->getZone();
Assert(pZone != NULL);
// 스킬 사용자를 가져온다.
// !! 이미 존을 나갔을 수 있으므로 NULL이 될 수 있다.
// by bezz. 2003.1.4
Creature* pCastCreature = pZone->getCreature(m_UserObjectID);
// EffectVigorDropToCreature은 AcidStorm, PoisonStorm, BloodyStorm위를 지나갈때 붙는다.
// 이는 3번의 연속 데미지를 주고 사라진다.
Damage_t DropDamage = m_Point;
if (!(pZone->getZoneLevel() & COMPLETE_SAFE_ZONE)
// 무적상태 체크. by sigi. 2002.9.5
&& canAttack(pCastCreature, pCreature )
&& !pCreature->isFlag(Effect::EFFECT_CLASS_COMA)
)
{
if (pCreature->isSlayer())
{
Slayer* pSlayer = dynamic_cast<Slayer*>(pCreature);
GCModifyInformation gcMI;
setDamage(pSlayer, DropDamage, pCastCreature, SKILL_VIGOR_DROP, &gcMI);
pSlayer->getPlayer()->sendPacket(&gcMI);
}
else if (pCreature->isVampire())
{
Vampire* pVampire = dynamic_cast<Vampire*>(pCreature);
GCModifyInformation gcMI;
setDamage(pVampire, DropDamage, pCastCreature, SKILL_VIGOR_DROP, &gcMI);
pVampire->getPlayer()->sendPacket(&gcMI);
}
else if (pCreature->isOusters())
{
Ousters* pOusters = dynamic_cast<Ousters*>(pCreature);
GCModifyInformation gcMI;
setDamage(pOusters, DropDamage, pCastCreature, SKILL_VIGOR_DROP, &gcMI);
pOusters->getPlayer()->sendPacket(&gcMI);
}
else if (pCreature->isMonster())
{
Monster* pMonster = dynamic_cast<Monster*>(pCreature);
setDamage(pMonster, DropDamage, pCastCreature, SKILL_VIGOR_DROP);
}
// m_CasterName이 pCreature를 죽인 경우의 KillCount 처리
// by sigi. 2002.9.9
// setDamage 를 불러서 처리한다. 주석처리
// by bezz. 2002.12.31
/* if (pCreature->isDead())
{
Creature* pAttacker = pZone->getCreature(m_CasterName);
if (pAttacker!=NULL)
{
affectKillCount(pAttacker, pCreature);
}
}*/
}
setNextTime(m_Tick);
//cout << "EffectVigorDropToCreature " << "end" << endl;
__END_CATCH
}