本文整理汇总了C++中Slayer类的典型用法代码示例。如果您正苦于以下问题:C++ Slayer类的具体用法?C++ Slayer怎么用?C++ Slayer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Slayer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
}
示例2: throw
void EffectComa::unaffect(Creature* pDeadCreature)
throw(Error)
{
__BEGIN_TRY
Assert(pDeadCreature != NULL);
//Assert(pDeadCreature->isDead());
// 이펙트 플래그를 삭제해준다.
pDeadCreature->removeFlag(Effect::EFFECT_CLASS_COMA);
// 날아오면 강제로 죽이는 코드를 집어넣는다.
if (pDeadCreature->isSlayer()) {
Slayer* pSlayer = dynamic_cast<Slayer*>(pDeadCreature);
pSlayer->setHP(0, ATTR_CURRENT);
}
else if (pDeadCreature->isVampire()) {
Vampire* pVampire = dynamic_cast<Vampire*>(pDeadCreature);
pVampire->setHP(0, ATTR_CURRENT);
}
else if (pDeadCreature->isOusters())
{
Ousters* pOusters = dynamic_cast<Ousters*>(pDeadCreature);
pOusters->setHP(0, ATTR_CURRENT);
}
__END_CATCH
}
示例3: throw
void ActionStashOpen::execute (Creature * pCreature1 , Creature * pCreature2)
throw(Error)
{
__BEGIN_TRY
Assert(pCreature1 != NULL);
Assert(pCreature2 != NULL);
Assert(pCreature1->isNPC());
Assert(pCreature2->isPC());
// 만일 플레이어가 아직 이 존에서 보관함에 관련된 OID를
// 할당받지 않았다면 여기서 할당해 준다.
if (pCreature2->isSlayer())
{
Slayer* pSlayer = dynamic_cast<Slayer*>(pCreature2);
if (!pSlayer->getStashStatus()) pSlayer->registerStash();
}
else if (pCreature2->isVampire())
{
Vampire* pVampire = dynamic_cast<Vampire*>(pCreature2);
if (!pVampire->getStashStatus()) pVampire->registerStash();
}
else if (pCreature2->isOusters())
{
Ousters* pOusters = dynamic_cast<Ousters*>(pCreature2);
if (!pOusters->getStashStatus()) pOusters->registerStash();
}
GCNPCResponse okpkt;
okpkt.setCode(NPC_RESPONSE_INTERFACE_STASHOPEN);
pCreature2->getPlayer()->sendPacket(&okpkt);
__END_CATCH
}
示例4: throw
////////////////////////////////////////////////////////////////////////////////
// 액션을 실행한다.
////////////////////////////////////////////////////////////////////////////////
void ActionCallHelicopter::execute (Creature * pCreature1, Creature * pCreature2)
throw(Error)
{
__BEGIN_TRY
Assert(pCreature1 != NULL);
Assert(pCreature2 != NULL);
Assert(pCreature1->isNPC());
Assert(pCreature2->isPC());
// 슬레이어만이 이 액션의 대상이 된다.
if (!pCreature2->isSlayer()) return;
if (pCreature2->isFlag(Effect::EFFECT_CLASS_HAS_FLAG) || pCreature2->isFlag(Effect::EFFECT_CLASS_HAS_SWEEPER)) return;
Slayer* pSlayer = dynamic_cast<Slayer*>(pCreature2);
Assert(pSlayer != NULL);
// 슬레이어에게 이펙트를 걸어준다.
if (!pSlayer->isFlag(Effect::EFFECT_CLASS_SLAYER_PORTAL))
pSlayer->setFlag(Effect::EFFECT_CLASS_SLAYER_PORTAL);
Player* pPlayer = pCreature2->getPlayer();
Assert(pPlayer != NULL);
GCNPCResponse gcNPCResponse;
gcNPCResponse.setCode(NPC_RESPONSE_INTERFACE_HELICOPTER);
pPlayer->sendPacket(&gcNPCResponse);
__END_CATCH
}
示例5: getMysteriousPrice
// Mysterious Item 가격
// itemClass와 pCreature의 능력치에 따라서 가격이 달라진다.
Price_t PriceManager::getMysteriousPrice(Item::ItemClass itemClass, Creature* pCreature) const
{
int multiplier = 1;
if (pCreature->isSlayer())
{
Slayer* pSlayer = dynamic_cast<Slayer*>(pCreature);
Attr_t CSTR = pSlayer->getSTR(ATTR_BASIC);
Attr_t CDEX = pSlayer->getDEX(ATTR_BASIC);
Attr_t CINT = pSlayer->getINT(ATTR_BASIC);
Attr_t CSUM = CSTR + CDEX + CINT;
// 0~20 사이
multiplier = CSUM / 15;
}
else if (pCreature->isVampire())
{
Vampire* pVampire = dynamic_cast<Vampire*>(pCreature);
Level_t CLevel = pVampire->getLevel();
// 0~20 사이
multiplier = CLevel / 5;
}
else if (pCreature->isOusters())
{
Ousters* pOusters = dynamic_cast<Ousters*>(pCreature);
Level_t CLevel = pOusters->getLevel();
// 0~20 사이
multiplier = CLevel / 5;
}
// 1~20사이
multiplier = max(1, multiplier);
// 가격 평균을 알아온다.
InfoClassManager* pInfoClass = g_pItemInfoManager->getInfoManager(itemClass);
Assert(pInfoClass!=NULL);
// 가격 평균 * 능력치 비율?
int finalPrice = (int)pInfoClass->getAveragePrice() * multiplier;
// Blood Bible 보너스 적용
if (pCreature->isPC() )
{
PlayerCreature* pPC = dynamic_cast<PlayerCreature*>(pCreature);
int ratio = pPC->getGamblePriceRatio();
if (ratio != 0 )
{
// ratio 값은 마이너스 값이다.
finalPrice += getPercentValue(finalPrice, ratio);
}
}
return finalPrice;
}
示例6: throw
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
}
示例7: isTargetMonster
bool EventQuestLootingInfo::isTargetMonster(PlayerCreature* pPC, Monster* pMonster ) const
{
if (pPC->getRace() == m_Race )
{
QuestID_t qID;
if (!pPC->getQuestManager()->hasEventQuest(m_QuestLevel, qID ) ) return false;
QuestGrade_t qGrade;
if (pPC->isSlayer() )
{
Slayer* pSlayer = dynamic_cast<Slayer*>(pPC);
qGrade = pSlayer->getQuestGrade();
}
else if (pPC->isVampire() )
{
Vampire* pVampire = dynamic_cast<Vampire*>(pPC);
qGrade = pVampire->getLevel();
}
else if (pPC->isOusters() )
{
Ousters* pOusters = dynamic_cast<Ousters*>(pPC);
qGrade = pOusters->getLevel();
}
else
{
//cout << "³Í¹¹³Ä!" << endl;
qGrade = 0;
}
if (qGrade < m_MinGrade || qGrade > m_MaxGrade ) return false;
if (m_Type == LOOTING_ZONE || m_Type == LOOTING_BOTH )
{
if (pMonster->getZoneID() != m_LootingZoneID ) return false;
}
if (m_Type == LOOTING_MONSTER || m_Type == LOOTING_BOTH )
{
if (pMonster->getMonsterType() != m_LootingMonsterType ) return false;
}
return true;
}
else
{
return false;
}
}
示例8: increaseDomainExp
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;
}
示例9: OnUpdate
void Vampire::OnUpdate(sf::Time interval) {
Damagable::OnUpdate(interval);
Level* level = static_cast<Level*>(m_scene);
Slayer* slayer = level->GetSlayer();
m_targetTime-=interval.asSeconds();
engine::util::RandomFloat r(0, 1);
if (m_targetTime <= 0) {
m_targetTime = static_cast<float>(0.4f * (r()+1));
m_targetPoint = (slayer->GetGlobalPosition());
}
auto delta = m_targetPoint-GetGlobalPosition();
if (abs(delta.y) < 300 && abs(delta.x) < 500 && abs(delta.x) > 10) {
const float v = 2 * interval.asSeconds() ;
m_body->ApplyLinearImpulse(b2Vec2(v * (delta.x > 0?1:-1), r() < 0.005?-5:0), m_body->GetWorldCenter(), true);
}
}
示例10: throw
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
}
示例11: checkCondition
GQuestElement::ResultType GQuestAdvanceClassElement::checkCondition(PlayerCreature* pPC ) const
{
if (pPC->getLevel() != 150 ) return FAIL;
Exp_t advExp = 0;
if (pPC->isSlayer() )
{
Slayer* pSlayer = dynamic_cast<Slayer*>(pPC);
SkillDomainType_t domain = pSlayer->getHighestSkillDomain();
DomainInfo* pDomainInfo = g_pSkillDomainInfoManager->getDomainInfo((SkillDomain)domain, pPC->getLevel());
if (pDomainInfo == NULL ) return FAIL;
Exp_t goalExp = pDomainInfo->getGoalExp();
Exp_t currentExp = goalExp - pSlayer->getGoalExp(domain);
advExp = (Exp_t)(currentExp * 0.0688933574);
}
else if (pPC->isVampire() )
{
Vampire* pVampire = dynamic_cast<Vampire*>(pPC);
VampEXPInfo* pExpInfo = g_pVampEXPInfoManager->getVampEXPInfo(pVampire->getLevel());
if (pExpInfo == NULL ) return FAIL;
Exp_t goalExp = pExpInfo->getGoalExp();
Exp_t currentExp = goalExp - pVampire->getGoalExp();
advExp = currentExp / 100;
}
else if (pPC->isOusters() )
{
Ousters* pOusters = dynamic_cast<Ousters*>(pPC);
OustersEXPInfo* pExpInfo = g_pOustersEXPInfoManager->getOustersEXPInfo(pOusters->getLevel());
if (pExpInfo == NULL ) return FAIL;
Exp_t goalExp = pExpInfo->getGoalExp();
Exp_t currentExp = goalExp - pOusters->getGoalExp();
advExp = currentExp / 100;
}
advExp = min((int)advExp, 18496191);
// ÇϵåÄÚµù -_-
pPC->increaseAdvancementClassExp(advExp, false);
return OK;
}
示例12: Assert
void DynamicZoneSlayerMirrorOfAbyss::killPC()
{
Assert(m_pZone != NULL);
// PC 를 죽인다.
map<ObjectID_t, Creature*>::const_iterator itr = m_pZone->getPCManager()->getCreatures().begin();
map<ObjectID_t, Creature*>::const_iterator endItr = m_pZone->getPCManager()->getCreatures().end();
for (; itr != endItr; ++itr )
{
Assert(itr->second != NULL);
if (itr->second->isPC() )
{
PlayerCreature* pPC = dynamic_cast<PlayerCreature*>(itr->second);
Assert(pPC != NULL);
if (pPC->isSlayer() )
{
Slayer* pSlayer = dynamic_cast<Slayer*>(pPC);
Assert(pSlayer != NULL);
pSlayer->setHP(0);
}
else if (pPC->isVampire() )
{
Vampire* pVampire = dynamic_cast<Vampire*>(pPC);
Assert(pVampire != NULL);
pVampire->setHP(0);
}
else if (pPC->isOusters() )
{
Ousters* pOusters = dynamic_cast<Ousters*>(pPC);
Assert(pOusters != NULL);
pOusters->setHP(0);
}
}
}
}
示例13: throw
////////////////////////////////////////////////////////////////////////////////
// 액션을 실행한다.
////////////////////////////////////////////////////////////////////////////////
void ActionSetResurrectZone::execute (Creature * pCreature1 , Creature * pCreature2)
throw(Error)
{
__BEGIN_TRY
Assert(pCreature1 != NULL);
Assert(pCreature2 != NULL);
Assert(pCreature1->isNPC());
Assert(pCreature2->isPC());
// 일단 클라이언트를 위해서 OK 패킷을 함 날린다.
GCNPCResponse okpkt;
Player* pPlayer = pCreature2->getPlayer();
Assert(pPlayer != NULL);
pPlayer->sendPacket(&okpkt);
if (pCreature2->isSlayer())
{
Slayer* pSlayer = dynamic_cast<Slayer*>(pCreature2);
pSlayer->setResurrectZoneIDEx(m_ZoneID);
}
else if (pCreature2->isVampire())
{
Vampire* pVampire = dynamic_cast<Vampire*>(pCreature2);
pVampire->setResurrectZoneIDEx(m_ZoneID);
}
else if (pCreature2->isOusters())
{
Ousters* pOusters = dynamic_cast<Ousters*>(pCreature2);
pOusters->setResurrectZoneIDEx(m_ZoneID);
}
GCSystemMessage msg;
msg.setMessage(g_pStringPool->getString(STRID_SET_RESURRECTION_POSITION ));
pPlayer->sendPacket(&msg);
__END_CATCH
}
示例14: throw
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
}
示例15: throw
void EffectSpiritGuard::affect(Creature* pCastCreature)
throw(Error)
{
__BEGIN_TRY
Assert(pCastCreature != NULL);
if (!pCastCreature->isSlayer() )
return;
Player* pPlayer = dynamic_cast<Player*>(pCastCreature->getPlayer());
Assert(pPlayer != NULL);
Slayer* pSlayer = dynamic_cast<Slayer*>(pCastCreature);
Assert(pSlayer != NULL);
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SKILL_SPIRIT_GUARD);
if (pSkillInfo == NULL )
{
return;
}
GCModifyInformation gcAttackerMI;
Zone* pZone = pCastCreature->getZone();
Assert(pZone != NULL);
VSRect rect(0, 0, pZone->getWidth()-1, pZone->getHeight()-1);
ZoneCoord_t Cx = pCastCreature->getX();
ZoneCoord_t Cy = pCastCreature->getY();
bool isHit = false;
Level_t maxEnemyLevel = 0;
uint EnemyNum = 0;
for (int x=-1; x<=1; x++ )
{
for (int y=-1; y<=1; y++ )
{
if (x == 0 && y == 0 ) continue;
int X = Cx + x;
int Y = Cy + y;
if (!rect.ptInRect(X, Y ) ) continue;
// 타일안에 존재하는 오브젝트를 가져온다.
Tile& tile = pZone->getTile(X, Y);
if(tile.hasCreature(Creature::MOVE_MODE_WALKING) )
{
Creature* pCreature = tile.getCreature(Creature::MOVE_MODE_WALKING);
Assert(pCreature != NULL);
// 자신은 맞지 않는다. 무적도 안 맞는다. 슬레이어도 안 맞느다.
// 안전지대 체크
// 2003.1.10 by bezz, Sequoia
if (pCreature == m_pTarget
|| !canAttack(pCastCreature, pCreature )
|| pCreature->isFlag(Effect::EFFECT_CLASS_COMA )
|| pCreature->isSlayer()
|| pCreature->isNPC()
|| !checkZoneLevelToHitTarget(pCreature)
)
{
continue;
}
isHit = true;
if (maxEnemyLevel < pCreature->getLevel() ) maxEnemyLevel = pCreature->getLevel();
EnemyNum++;
if (pCreature->isVampire() || pCreature->isOusters() )
{
// Vampire* pVampire = dynamic_cast<Vampire*>(pCreature);
GCModifyInformation gcMI;
::setDamage(pCreature, m_Damage, pCastCreature, SKILL_SPIRIT_GUARD, &gcMI, &gcAttackerMI);
pCreature->getPlayer()->sendPacket(&gcMI);
// 맞는 동작을 보여준다.
GCSkillToObjectOK2 gcSkillToObjectOK2;
gcSkillToObjectOK2.setObjectID(1); // 의미 없다.
gcSkillToObjectOK2.setSkillType(SKILL_ATTACK_MELEE);
gcSkillToObjectOK2.setDuration(0);
pCreature->getPlayer()->sendPacket(&gcSkillToObjectOK2);
}
else if (pCreature->isMonster() )
{
Monster* pMonster = dynamic_cast<Monster*>(pCreature);
::setDamage(pMonster, m_Damage, pCastCreature, SKILL_SPIRIT_GUARD, NULL, &gcAttackerMI);
pMonster->addEnemy(pCastCreature);
}
//.........这里部分代码省略.........