本文整理汇总了C++中Zone::getWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ Zone::getWidth方法的具体用法?C++ Zone::getWidth怎么用?C++ Zone::getWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zone
的用法示例。
在下文中一共展示了Zone::getWidth方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: findAreaUnits
void Start::findAreaUnits() {
areaUnits.clear();
Area* area = player->getArea();
for (unsigned int i = 0; i < area->getNumZones(); i++) {
Zone* zone = area->getZone(i);
if (zone->isFilled()) {
for (int k = 0; k < zone->getHeight(); k++) {
for (int j = 0; j < zone->getWidth(); j++) {
Location* loc = zone->getLocationAt(Coord(j, k));
if (loc->hasUnit()) {
areaUnits.insert(std::pair<Unit*, Zone*>(loc->unit, zone));
}
}
}
}
}
}
示例2: execute
//////////////////////////////////////////////////////////////////////////////
// 몬스터 셀프 핸들러
//////////////////////////////////////////////////////////////////////////////
void BloodyWall::execute(Monster* pMonster, ZoneCoord_t X, ZoneCoord_t Y)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " Begin" << endl;
Assert(pMonster != NULL);
try
{
Zone* pZone = pMonster->getZone();
Assert(pZone != NULL);
GCSkillToTileOK2 _GCSkillToTileOK2;
GCSkillToTileOK3 _GCSkillToTileOK3;
GCSkillToTileOK4 _GCSkillToTileOK4;
GCSkillToTileOK5 _GCSkillToTileOK5;
GCSkillToTileOK6 _GCSkillToTileOK6;
SkillType_t SkillType = SKILL_BLOODY_WALL;
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);
ZoneCoord_t myX = pMonster->getX();
ZoneCoord_t myY = pMonster->getY();
// 마스터는 무조건~~
bool bRangeCheck = pMonster->isMaster()
#ifdef __UNDERWORLD__
|| pMonster->isUnderworld() || pMonster->getMonsterType() == 599
#endif
|| verifyDistance(pMonster, X, Y, pSkillInfo->getRange());
bool bHitRoll = pMonster->isMaster()
#ifdef __UNDERWORLD__
|| pMonster->isUnderworld() || pMonster->getMonsterType() == 599
#endif
|| HitRoll::isSuccessMagic(pMonster, pSkillInfo);
bool bTileCheck = false;
VSRect rect(0, 0, pZone->getWidth()-1, pZone->getHeight()-1);
if (rect.ptInRect(X, Y)) bTileCheck = true;
if (bRangeCheck && bHitRoll && bTileCheck)
{
// 이펙트의 지속시간을 계산한다.
SkillInput input(pMonster);
SkillOutput output;
computeOutput(input, output);
//Range_t Range = 3;
Dir_t Dir = getDirectionToPosition(myX, myY, X, Y);
list<Creature*> cList; // denier list
for (int i=0; i<5; i++)
{
POINT& pt = m_BloodyWallMask[Dir][i];
int tileX = X+pt.x;
int tileY = Y+pt.y;
if (rect.ptInRect(tileX, tileY))
{
Tile& tile = pZone->getTile(tileX, tileY);
// 현재 타일에다 이펙트를 추가할 수 있다면...
if (tile.canAddEffect())
{
// 같은 effect가 있으면 지운다.
Effect* pOldEffect = tile.getEffect(Effect::EFFECT_CLASS_BLOODY_WALL);
if (pOldEffect != NULL)
{
ObjectID_t effectID = pOldEffect->getObjectID();
pZone->deleteEffect(effectID);// fix me
}
// 이펙트 클래스를 생성한다.
EffectBloodyWall* pEffect = new EffectBloodyWall(pZone , tileX, tileY);
pEffect->setCasterName(pMonster->getName());
pEffect->setCasterID(pMonster->getObjectID());
pEffect->setClan(Creature::CREATURE_CLASS_MONSTER, pMonster->getClanType());
pEffect->setDamage(output.Damage);
pEffect->setDeadline(output.Duration);
pEffect->setLevel(pMonster->getINT());
pEffect->setNextTime(0);
pEffect->setTick(output.Tick);
// Tile에 붙이는 Effect는 ObjectID를 등록받아야 한다.
ObjectRegistry & objectregister = pZone->getObjectRegistry();
objectregister.registerObject(pEffect);
pZone->addEffect(pEffect);
tile.addEffect(pEffect);
GCAddEffectToTile gcAE;
//.........这里部分代码省略.........
示例3: execute
//////////////////////////////////////////////////////////////////////////////
// 슬레이어 오브젝트 핸들러
//////////////////////////////////////////////////////////////////////////////
void TurnUndead::execute(Slayer * pSlayer, SkillSlot * pSkillSlot, CEffectID_t CEffectID)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << "begin " << endl;
// Slayer Object Assertion
Assert(pSlayer != NULL);
Assert(pSkillSlot != NULL);
try
{
Zone* pZone = pSlayer->getZone();
Assert(pZone != NULL);
Player* pPlayer = pSlayer->getPlayer();
Assert(pPlayer != NULL);
GCSkillToSelfOK1 _GCSkillToSelfOK1;
GCSkillToSelfOK2 _GCSkillToSelfOK2;
SkillType_t SkillType = pSkillSlot->getSkillType();
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);
SkillDomainType_t DomainType = pSkillInfo->getDomainType();
ZoneCoord_t X = pSlayer->getX();
ZoneCoord_t Y = pSlayer->getY();
int RequiredMP = (int)pSkillInfo->getConsumeMP();
bool bManaCheck = hasEnoughMana(pSlayer, RequiredMP);
bool bTimeCheck = verifyRunTime(pSkillSlot);
bool bRangeCheck = verifyDistance(pSlayer, X, Y, pSkillInfo->getRange()) && checkZoneLevelToUseSkill(pSlayer);
bool bHitRoll = HitRoll::isSuccessMagic(pSlayer, pSkillInfo, pSkillSlot);
VSRect rect(0, 0, pZone->getWidth()-1, pZone->getHeight()-1);
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll)
{
decreaseMana(pSlayer, RequiredMP, _GCSkillToSelfOK1);
// calculate damage and duration time
SkillInput input(pSlayer, pSkillSlot);
SkillOutput output;
computeOutput(input, output);
bool bHit = false;
Level_t maxEnemyLevel = 0;
uint EnemyNum = 0;
int oX, oY;
for(oX = -2; oX <= 2; oX++)
for(oY = -2; oY <= 2; oY++)
{
int tileX = X+oX;
int tileY = Y+oY;
if (oX == 0 && oY == 0 ) continue;
if (!rect.ptInRect(tileX, tileY)) continue;
Tile& tile = pZone->getTile(tileX, tileY);
// 타일에 있는 크리처들을 리스트로 만든다.
list<Creature*> targetList;
if(tile.hasCreature(Creature::MOVE_MODE_WALKING))
{
Creature* pCreature = tile.getCreature(Creature::MOVE_MODE_WALKING);
targetList.push_back(pCreature);
}
if(tile.hasCreature(Creature::MOVE_MODE_FLYING))
{
Creature* pCreature = tile.getCreature(Creature::MOVE_MODE_FLYING);
targetList.push_back(pCreature);
}
if(tile.hasCreature(Creature::MOVE_MODE_BURROWING))
{
Creature* pCreature = tile.getCreature(Creature::MOVE_MODE_BURROWING);
targetList.push_back(pCreature);
}
list<Creature*>::iterator itr = targetList.begin();
for (; itr != targetList.end(); itr++ )
{
Creature* pTargetCreature = (*itr);
Assert(pTargetCreature != NULL);
if(checkZoneLevelToHitTarget(pTargetCreature ) && !pTargetCreature->isSlayer()
&& !pTargetCreature->isFlag(Effect::EFFECT_CLASS_COMA)
&& canAttack(pSlayer, pTargetCreature )
)
{
if(pTargetCreature->isVampire() || pTargetCreature->isOusters())
{
Player* pTargetPlayer = pTargetCreature->getPlayer();
//.........这里部分代码省略.........
示例4: execute
//////////////////////////////////////////////////////////////////////////////
// 뱀파이어 타일 핸들러
//////////////////////////////////////////////////////////////////////////////
void BloodyBreaker::execute(Vampire* pVampire, ZoneCoord_t X, ZoneCoord_t Y, VampireSkillSlot* pVampireSkillSlot, CEffectID_t CEffectID)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << "begin " << endl;
SkillType_t SkillType = getSkillType();
// Knowledge of Blood 가 있다면 hit bonus 10
int HitBonus = 0;
if (pVampire->hasRankBonus(RankBonus::RANK_BONUS_KNOWLEDGE_OF_BLOOD ) )
{
RankBonus* pRankBonus = pVampire->getRankBonus(RankBonus::RANK_BONUS_KNOWLEDGE_OF_BLOOD);
Assert(pRankBonus != NULL);
HitBonus = pRankBonus->getPoint();
}
try
{
SkillInput input(pVampire);
SkillOutput output;
computeOutput(input, output);
Dir_t Dir = getDirectionToPosition(pVampire->getX(), pVampire->getY(), X, Y);
// 강제로 knockback시킬 확률
// bool bForceKnockback = rand()%100 < output.ToHit;
Player* pPlayer = pVampire->getPlayer();
Zone* pZone = pVampire->getZone();
Assert(pPlayer != NULL);
Assert(pZone != NULL);
VSRect rect(1, 1, pZone->getWidth()-2, pZone->getHeight()-2);
if (!rect.ptInRect(X, Y ))
{
executeSkillFailException(pVampire, SkillType);
return;
}
GCSkillToTileOK1 _GCSkillToTileOK1;
GCSkillToTileOK2 _GCSkillToTileOK2;
// GCSkillToTileOK3 _GCSkillToTileOK3;
// GCSkillToTileOK4 _GCSkillToTileOK4;
GCSkillToTileOK5 _GCSkillToTileOK5;
// GCSkillToTileOK6 _GCSkillToTileOK6;
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);
int RequiredMP = decreaseConsumeMP(pVampire, pSkillInfo);
bool bManaCheck = hasEnoughMana(pVampire, RequiredMP);
bool bTimeCheck = verifyRunTime(pVampireSkillSlot);
bool bRangeCheck = verifyDistance(pVampire, X, Y, pSkillInfo->getRange());
if (bManaCheck && bTimeCheck && bRangeCheck )
{
// 마나를 떨어뜨린다.
decreaseMana(pVampire, RequiredMP, _GCSkillToTileOK1);
// 좌표와 방향을 구한다.
ZoneCoord_t myX = pVampire->getX();
ZoneCoord_t myY = pVampire->getY();
Dir_t dir = calcDirection(myX, myY, X, Y);
list<Creature*> cList;
// knockback 때문에 recursive 하게 데미지를 먹는 경우가 있다.
// 그래서 제일 먼쪽에 있는 마스크부터 체크한다.
for (int i = 21; i >= 0; i-- )
{
int tileX = myX + m_pBloodyBreakerMask[Dir][i].x;
int tileY = myY + m_pBloodyBreakerMask[Dir][i].y;
// 현재 타일이 존 내부이고, 안전지대가 아니라면 맞을 가능성이 있다.
if (rect.ptInRect(tileX, tileY))
{
// 타일을 받아온다.
Tile& tile = pZone->getTile(tileX, tileY);
list<Creature*> targetList;
if (tile.hasCreature(Creature::MOVE_MODE_WALKING))
{
Creature* pCreature = tile.getCreature(Creature::MOVE_MODE_WALKING);
targetList.push_back(pCreature);
}
if (tile.hasCreature(Creature::MOVE_MODE_FLYING))
{
Creature* pCreature = tile.getCreature(Creature::MOVE_MODE_FLYING);
targetList.push_back(pCreature);
}
if (tile.hasCreature(Creature::MOVE_MODE_BURROWING))
{
Creature* pCreature = tile.getCreature(Creature::MOVE_MODE_BURROWING);
targetList.push_back(pCreature);
}
//.........这里部分代码省略.........
示例5: execute
//////////////////////////////////////////////////////////////////////////////
// 뱀파이어 타일 핸들러
//////////////////////////////////////////////////////////////////////////////
void Darkness::execute(Vampire* pVampire, ZoneCoord_t X, ZoneCoord_t Y, 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);
GCSkillToTileOK1 _GCSkillToTileOK1;
GCSkillToTileOK2 _GCSkillToTileOK2;
GCSkillToTileOK3 _GCSkillToTileOK3;
GCSkillToTileOK4 _GCSkillToTileOK4;
GCSkillToTileOK5 _GCSkillToTileOK5;
GCSkillToTileOK6 _GCSkillToTileOK6;
SkillType_t SkillType = pVampireSkillSlot->getSkillType();
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);
ZoneCoord_t myX = pVampire->getX();
ZoneCoord_t myY = pVampire->getY();
// Knowledge of Innate 가 있다면 hit bonus 10
int HitBonus = 0;
if (pVampire->hasRankBonus(RankBonus::RANK_BONUS_KNOWLEDGE_OF_INNATE ) )
{
RankBonus* pRankBonus = pVampire->getRankBonus(RankBonus::RANK_BONUS_KNOWLEDGE_OF_INNATE);
Assert(pRankBonus != NULL);
HitBonus = pRankBonus->getPoint();
}
int RequiredMP = decreaseConsumeMP(pVampire, pSkillInfo);
bool bManaCheck = hasEnoughMana(pVampire, RequiredMP);
bool bTimeCheck = verifyRunTime(pVampireSkillSlot);
bool bRangeCheck = verifyDistance(pVampire, X, Y, pSkillInfo->getRange());
bool bHitRoll = HitRoll::isSuccessMagic(pVampire, pSkillInfo, pVampireSkillSlot, HitBonus);
bool bSlayerSafeZone = pZone->getZoneLevel(X, Y ) & SLAYER_SAFE_ZONE;
bool bTileCheck = false;
VSRect rect(0, 0, pZone->getWidth()-1, pZone->getHeight()-1);
if (rect.ptInRect(X, Y)) bTileCheck = true;
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && bTileCheck && !bSlayerSafeZone)
{
decreaseMana(pVampire, RequiredMP, _GCSkillToTileOK1);
// 이펙트의 지속시간을 계산한다.
SkillInput input(pVampire);
SkillOutput output;
computeOutput(input, output);
// Wisdom of Darkness 이 있다면 지속시간 30% 증가
if (pVampire->hasRankBonus(RankBonus::RANK_BONUS_WISDOM_OF_DARKNESS ) )
{
RankBonus* pRankBonus = pVampire->getRankBonus(RankBonus::RANK_BONUS_WISDOM_OF_DARKNESS);
Assert(pRankBonus != NULL);
output.Duration += getPercentValue(output.Duration, pRankBonus->getPoint());
}
Range_t Range = 3;
int oX, oY;
list<Creature*> cList; // denier list
int edge = 1;
// Wide Darkness 이 있다면 범위가 5*5 로 수정. skill type 을 수정한다.
if (pVampire->hasRankBonus(RankBonus::RANK_BONUS_WIDE_DARKNESS ) )
{
RankBonus* pRankBonus = pVampire->getRankBonus(RankBonus::RANK_BONUS_WIDE_DARKNESS);
Assert(pRankBonus != NULL);
Range = pRankBonus->getPoint();
edge = (pRankBonus->getPoint() - 1 ) / 2;
SkillType = SKILL_DARKNESS_WIDE;
}
// map<int, uint> canAddMap;
for(oY = -edge; oY <= edge; oY++)
for(oX = -edge; oX <= edge; oX++)
{
int tileX = X+oX;
int tileY = Y+oY;
//.........这里部分代码省略.........
示例6: execute
//////////////////////////////////////////////////////////////////////
//
// Visible::execute()
//
//////////////////////////////////////////////////////////////////////
void Visible::execute(Slayer * pSlayer, ZoneCoord_t X, ZoneCoord_t Y, SkillSlot * pSkillSlot, CEffectID_t CEffectID)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " Begin" << endl;
Assert(pSlayer != NULL);
Assert(pSkillSlot != NULL);
try
{
// Player를 받아온다.
Player * pPlayer = pSlayer->getPlayer();
// Zone을 받아온다.
Zone * pZone = pSlayer->getZone();
SkillType_t SkillType = pSkillSlot->getSkillType();
SkillInfo * pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);
// 기술의 레벨을 받아온다.
//SkillLevel_t SkillLevel = pSkillSlot->getExpLevel();
//SkillDomainType_t DomainType = pSkillInfo->getDomainType();
VSRect rect(0, 0, pZone->getWidth()-1, pZone->getHeight()-1);
int RequiredMP = (int)pSkillInfo->getConsumeMP();
bool bManaCheck = hasEnoughMana(pSlayer, RequiredMP);
bool bTimeCheck = verifyRunTime(pSkillSlot);
bool bRangeCheck = verifyDistance(pSlayer, X, Y, pSkillInfo->getRange());
bool bHit = false;
// 기술성공률 검증.
if (bManaCheck && bTimeCheck && bRangeCheck)
{
SkillInput input(pSlayer, pSkillSlot);
SkillOutput output;
computeOutput(input, output);
GCSkillToTileOK1 _GCSkillToTileOK1;
GCSkillToTileOK2 _GCSkillToTileOK2;
GCSkillToTileOK3 _GCSkillToTileOK3;
GCSkillToTileOK4 _GCSkillToTileOK4;
GCSkillToTileOK5 _GCSkillToTileOK5;
Coord_t myX = pSlayer->getX(), myY = pSlayer->getY();
Dir_t dir = calcDirection(myX, myY, X, Y);
list<Creature*> cList;
int oX, oY;
for(oX = -2; oX <= 2; oX++)
for(oY = -2; oY <= 2; oY++)
{
int tileX = X+oX;
int tileY = Y+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)
{
if(pTargetCreature->isPC())
{
bool bHitRoll = HitRoll::isSuccessMagic(pSlayer, pSkillInfo, pSkillSlot);
bool bEffected = pTargetCreature->isFlag(Effect::EFFECT_CLASS_INVISIBILITY);
if(bHitRoll && bEffected ) {
// 주위에 GCAddXXX를 보내고, effect manager에서 effect를 삭제하고, GCRemoveEffect를 보낸다.
addVisibleCreature(pZone, pTargetCreature, true);
_GCSkillToTileOK2.setObjectID(pSlayer->getObjectID());
_GCSkillToTileOK2.setSkillType(SkillType);
_GCSkillToTileOK2.setX(X);
_GCSkillToTileOK2.setY(Y);
_GCSkillToTileOK2.setRange(dir);
_GCSkillToTileOK2.setDuration(0);
Player * pTargetPlayer = pTargetCreature->getPlayer();
Assert(pTargetPlayer != NULL);
pTargetPlayer->sendPacket(&_GCSkillToTileOK2);
cList.push_back(pTargetCreature);
bHit = true;
}
}
} // if(pTargetCreature!= NULL)
//.........这里部分代码省略.........
示例7: affect
void EffectPlasmaRocketLauncher::affect(Creature* pCreature)
throw(Error)
{
__BEGIN_TRY
__BEGIN_DEBUG
Assert(pCreature != NULL);
Zone* pZone = pCreature->getZone();
Assert(pZone != NULL);
Creature* pAttacker = pZone->getCreature(m_UserObjectID);
VSRect rect(0, 0, pZone->getWidth()-1, pZone->getHeight()-1);
int cX = pCreature->getX();
int cY = pCreature->getY();
for(int x = -1; x <= 1; x++)
{
for(int y= -1; y <= 1; y++)
{
int X = cX + x;
int Y = cY + y;
if(!rect.ptInRect(X, Y)) continue;
Tile& tile = pZone->getTile(X, Y);
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* pCreature2 = dynamic_cast<Creature*>(pObject);
Assert(pCreature2 != NULL);
if (pCreature2 != pCreature && pCreature2->isSlayer() ) continue;
if (!(pZone->getZoneLevel() & COMPLETE_SAFE_ZONE)
&& !pCreature2->isDead()
&& !pCreature2->isFlag(Effect::EFFECT_CLASS_COMA)
// 무적상태 체크. by sigi. 2002.9.5
&& canAttack(pAttacker, pCreature2 )
)
{
GCModifyInformation gcMI, gcAttackerMI;
setDamage(pCreature2, m_Point, pAttacker, SKILL_PLASMA_ROCKET_LAUNCHER, &gcMI, &gcAttackerMI);
if (pCreature2->isPC() ) pCreature2->getPlayer()->sendPacket(&gcMI);
if (pAttacker!=NULL)
{
computeAlignmentChange(pCreature2, m_Point, pAttacker, &gcMI, &gcAttackerMI);
if (pAttacker->isPC() )
{
if (pAttacker->isSlayer() && !pCreature2->isSlayer() )
{
Slayer* pSlayer = dynamic_cast<Slayer*>(pAttacker);
if (pSlayer != NULL )
{
GCModifyInformation gcMI;
shareAttrExp(pSlayer, m_Point, 1, 8, 1, gcAttackerMI);
}
}
if (pAttacker->isPC() ) pAttacker->getPlayer()->sendPacket(&gcAttackerMI);
}
}
}
}
}
}
}
setDeadline(0);
__END_DEBUG
__END_CATCH
}
示例8: execute
//////////////////////////////////////////////////////////////////////////////
// 아우스터즈 타일 핸들러
//////////////////////////////////////////////////////////////////////////////
void SummonGroundElemental::execute(Ousters* pOusters, ZoneCoord_t X, ZoneCoord_t Y, OustersSkillSlot* pOustersSkillSlot, CEffectID_t CEffectID)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << "begin " << endl;
Assert(pOusters != NULL);
Assert(pOustersSkillSlot != NULL);
BYTE Grade = 0;
if (pOustersSkillSlot->getExpLevel() < 15 ) Grade = 0;
else if (pOustersSkillSlot->getExpLevel() < 30 ) Grade = 1;
else Grade = 2;
try
{
Player* pPlayer = pOusters->getPlayer();
Zone* pZone = pOusters->getZone();
Assert(pPlayer != NULL);
Assert(pZone != NULL);
Item* pWeapon = pOusters->getWearItem(Ousters::WEAR_RIGHTHAND);
if (pWeapon == NULL || pWeapon->getItemClass() != Item::ITEM_CLASS_OUSTERS_WRISTLET || !pOusters->isRealWearingEx(Ousters::WEAR_RIGHTHAND))
{
executeSkillFailException(pOusters, pOustersSkillSlot->getSkillType(), Grade);
return;
}
GCSkillToTileOK1 _GCSkillToTileOK1;
GCSkillToTileOK2 _GCSkillToTileOK2;
GCSkillToTileOK3 _GCSkillToTileOK3;
GCSkillToTileOK4 _GCSkillToTileOK4;
GCSkillToTileOK5 _GCSkillToTileOK5;
GCSkillToTileOK6 _GCSkillToTileOK6;
SkillType_t SkillType = pOustersSkillSlot->getSkillType();
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);
// 데미지와 지속 시간을 계산한다.
SkillInput input(pOusters, pOustersSkillSlot);
SkillOutput output;
computeOutput(input, output);
int RequiredMP = (int)pSkillInfo->getConsumeMP() + pOustersSkillSlot->getExpLevel()/3;
bool bManaCheck = hasEnoughMana(pOusters, RequiredMP);
bool bTimeCheck = verifyRunTime(pOustersSkillSlot);
bool bRangeCheck = verifyDistance(pOusters, X, Y, pSkillInfo->getRange());
bool bHitRoll = HitRoll::isSuccessMagic(pOusters, pSkillInfo, pOustersSkillSlot);
bool bSatisfyRequire = pOusters->satisfySkillRequire(pSkillInfo);
bool bTileCheck = false;
VSRect rect(0, 0, pZone->getWidth()-1, pZone->getHeight()-1);
// if (rect.ptInRect(X, Y))
// {
// Tile& tile = pZone->getTile(X, Y);
// if (tile.canAddEffect()) bTileCheck = true;
// }
TPOINT pt = findSuitablePosition(pZone, X, Y, Creature::MOVE_MODE_WALKING);
if (pt.x == -1 )
{
bTileCheck = false;
}
else
{
bTileCheck = true;
for (int oX = pt.x - 2 ; oX <= pt.x + 2 ; ++oX )
for (int oY = pt.y - 2 ; oY <= pt.y + 2 ; ++oY )
{
if (!rect.ptInRect(oX, oY ) ) continue;
if (pZone->getTile(oX, oY).getEffect(Effect::EFFECT_CLASS_GROUND_ELEMENTAL_AURA ) != NULL )
{
bTileCheck = false;
break;
}
}
}
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && bTileCheck && bSatisfyRequire)
{
decreaseMana(pOusters, RequiredMP, _GCSkillToTileOK1);
int oX, oY;
/*
HP = 200 + (S_level * 10)
Defense = 50 + (S_level * 2)
Protection = 20 + (S_level * 2)
Poison Resistance = 70%
Acid Resistance = 60%
Curse Resistance = 100%
Blood Resistance = 50%
Regen = 1 HP per 1 sec
//.........这里部分代码省略.........
示例9: execute
//////////////////////////////////////////////////////////////////////////////
// 몬스터 타일 핸들러
//////////////////////////////////////////////////////////////////////////////
void EnergyDrop::execute(Monster* pMonster, ZoneCoord_t X, ZoneCoord_t Y)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << "begin " << endl;
EffectEnergyDrop * pEffect = NULL;
EffectEnergyDrop * pEffect2 = NULL;
try
{
Zone* pZone = pMonster->getZone();
Assert(pZone != NULL);
GCSkillToTileOK1 _GCSkillToTileOK1;
GCSkillToTileOK2 _GCSkillToTileOK2;
GCSkillToTileOK3 _GCSkillToTileOK3;
GCSkillToTileOK4 _GCSkillToTileOK4;
GCSkillToTileOK5 _GCSkillToTileOK5;
GCSkillToTileOK6 _GCSkillToTileOK6;
SkillType_t SkillType = SKILL_ENERGY_DROP;
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);
ZoneCoord_t myX = pMonster->getX();
ZoneCoord_t myY = pMonster->getY();
bool bRangeCheck = verifyDistance(pMonster, X, Y, pSkillInfo->getRange());
bool bHitRoll = HitRoll::isSuccessMagic(pMonster, pSkillInfo);
bool bTileCheck = false;
VSRect rect(0, 0, pZone->getWidth()-1, pZone->getHeight()-1);
if(rect.ptInRect(X, Y))
{
Tile& tile = pZone->getTile(X, Y);
if (tile.canAddEffect()) bTileCheck = true;
}
if (bRangeCheck && bHitRoll && bTileCheck)
{
// calculate damage and duration time
SkillInput input(pMonster);
SkillOutput output;
computeOutput(input, output);
Range_t Range = 3;
// 기존에 같은 이펙트가 타일에 있다면 지우고 새로 설정한다.
Tile& tile = pZone->getTile(X, Y);
Effect* pOldEffect = tile.getEffect(Effect::EFFECT_CLASS_ENERGY_DROP);
if(pOldEffect != NULL)
{
ObjectID_t effectID = pOldEffect->getObjectID();
pZone->deleteEffect(effectID);
}
// 이펙트 오브젝트를 생성해서 타일에 붙인다.
pEffect = new EffectEnergyDrop(pZone, X, Y);
pEffect->setDeadline(output.Duration);
pEffect->setNextTime(0);
pEffect->setTick(output.Tick);
pEffect->setDamage(output.Damage);
pEffect->setLevel(pSkillInfo->getLevel()/2);
//
//ObjectRegistry& objectregister = pZone->getObjectRegistry();
//objectregister.registerObject(pEffect);
//
//
//pZone->addEffect(pEffect);
//tile.addEffect(pEffect);
// 이펙트 오브젝트를 생성해서 타일에 붙인다.
pEffect2 = new EffectEnergyDrop(pZone, X, Y);
pEffect2->setDeadline(output.Duration);
pEffect2->setNextTime(0);
pEffect2->setTick(output.Tick);
pEffect2->setDamage(output.Damage * 30 / 100);
pEffect2->setLevel(pSkillInfo->getLevel()/2);
// 이펙트 범위내의 모든 Creature에게 effect를 붙여준다.
// Slayer가 기술을 사용한 경우 같은 Slayer에게는
// 해당하지 않는다.
bool bEffected = false;
Creature* pTargetCreature;
list<Creature*> cList;
cList.push_back(pMonster);
int oX, oY;
//.........这里部分代码省略.........
示例10: execute
//////////////////////////////////////////////////////////////////////////////
// 아우스터즈 타일 핸들러
//////////////////////////////////////////////////////////////////////////////
void Prominence::execute(Ousters* pOusters, ZoneCoord_t X, ZoneCoord_t Y, OustersSkillSlot* pOustersSkillSlot, CEffectID_t CEffectID)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << "begin " << endl;
Assert(pOusters != NULL);
Assert(pOustersSkillSlot != NULL);
BYTE Grade = 0;
if (pOustersSkillSlot->getExpLevel() < 15 ) Grade = 0;
else if (pOustersSkillSlot->getExpLevel() < 30 ) Grade = 1;
else Grade = 2;
try
{
Player* pPlayer = pOusters->getPlayer();
Zone* pZone = pOusters->getZone();
Assert(pPlayer != NULL);
Assert(pZone != NULL);
Item* pWeapon = pOusters->getWearItem(Ousters::WEAR_RIGHTHAND);
if (pWeapon == NULL || pWeapon->getItemClass() != Item::ITEM_CLASS_OUSTERS_WRISTLET || !pOusters->isRealWearingEx(Ousters::WEAR_RIGHTHAND))
{
executeSkillFailException(pOusters, pOustersSkillSlot->getSkillType(), Grade);
return;
}
GCSkillToTileOK1 _GCSkillToTileOK1;
GCSkillToTileOK2 _GCSkillToTileOK2;
GCSkillToTileOK3 _GCSkillToTileOK3;
GCSkillToTileOK4 _GCSkillToTileOK4;
GCSkillToTileOK5 _GCSkillToTileOK5;
GCSkillToTileOK6 _GCSkillToTileOK6;
SkillType_t SkillType = pOustersSkillSlot->getSkillType();
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);
// 데미지와 지속 시간을 계산한다.
SkillInput input(pOusters, pOustersSkillSlot);
SkillOutput output;
computeOutput(input, output);
int RequiredMP = (int)pSkillInfo->getConsumeMP() + pOustersSkillSlot->getExpLevel()/3;
bool bManaCheck = hasEnoughMana(pOusters, RequiredMP);
bool bTimeCheck = verifyRunTime(pOustersSkillSlot);
bool bRangeCheck = verifyDistance(pOusters, X, Y, output.Range);
bool bHitRoll = HitRoll::isSuccessMagic(pOusters, pSkillInfo, pOustersSkillSlot);
bool bSatisfyRequire = pOusters->satisfySkillRequire(pSkillInfo);
bool bTileCheck = false;
VSRect rect(0, 0, pZone->getWidth()-1, pZone->getHeight()-1);
if (rect.ptInRect(X, Y))
{
Tile& tile = pZone->getTile(X, Y);
if (tile.canAddEffect()) bTileCheck = true;
}
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && bTileCheck && bSatisfyRequire)
{
decreaseMana(pOusters, RequiredMP, _GCSkillToTileOK1);
int oX, oY;
for (oX = X - 1 ; oX <= X + 1 ; ++oX )
for (oY = Y - 1 ; oY <= Y + 1 ; ++oY )
{
if (!rect.ptInRect(oX, oY)) continue;
Tile& tile = pZone->getTile(oX, oY);
if (!tile.canAddEffect()) continue;
// 머시 그라운드 있음 추가 못한당.
if (tile.getEffect(Effect::EFFECT_CLASS_MERCY_GROUND) != NULL ) continue;
if (tile.getEffect(Effect::EFFECT_CLASS_TRYING_POSITION) ) continue;
// 같은 이펙트가 이미 존재한다면 삭제한다.
Effect* pOldEffect = tile.getEffect(Effect::EFFECT_CLASS_PROMINENCE);
if (pOldEffect != NULL)
{
ObjectID_t effectID = pOldEffect->getObjectID();
pZone->deleteEffect(effectID);
}
checkMine(pZone, oX, oY);
// 이펙트 오브젝트를 생성한다.
EffectProminence* pEffect = new EffectProminence(pZone, oX, oY);
pEffect->setUserObjectID(pOusters->getObjectID());
pEffect->setDeadline(output.Duration);
pEffect->setNextTime(0);
pEffect->setTick(output.Tick);
pEffect->setDamage(output.Damage);
pEffect->setLevel(pOustersSkillSlot->getExpLevel());
//.........这里部分代码省略.........
示例11: execute
void Mephisto::execute(Vampire* pVampire)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " Begin(slayerself)" << endl;
Assert(pVampire != NULL);
if(!pVampire->hasSkill(SKILL_MEPHISTO) ) return;
try
{
Player* pPlayer = pVampire->getPlayer();
Zone* pZone = pVampire->getZone();
Assert(pPlayer != NULL);
Assert(pZone != NULL);
GCSkillToObjectOK1 _GCSkillToObjectOK1;
GCSkillToObjectOK2 _GCSkillToObjectOK2;
GCSkillToObjectOK3 _GCSkillToObjectOK3;
ZoneCoord_t myX = pVampire->getX();
ZoneCoord_t myY = pVampire->getY();
int oX, oY;
VSRect rect(0, 0, pZone->getWidth()-1, pZone->getHeight()-1);
for(oX = -4; oX <= 4; oX++)
for(oY = -4; oY <= 4; oY++)
{
int tileX = myX+oX;
int tileY = myY+oY;
if (!rect.ptInRect(tileX, tileY)) continue;
// 타일 위에! 뱀파이어가 있는지 본다!
Tile& tile = pZone->getTile(tileX, tileY);
Creature * pTargetCreature = NULL;
if(tile.hasCreature(Creature::MOVE_MODE_WALKING)) pTargetCreature = tile.getCreature(Creature::MOVE_MODE_WALKING);
if(pTargetCreature != NULL && pTargetCreature != pVampire && pTargetCreature->isVampire() ) {
bool bEffected = pTargetCreature->isFlag(Effect::EFFECT_CLASS_MEPHISTO);
if(bEffected ) continue;
Vampire* pTargetVampire= dynamic_cast<Vampire*>(pTargetCreature);
// 스킬 레벨에 따라 데미지 보너스가 달라진다.
SkillInput input(pVampire);
SkillOutput output;
input.SkillLevel = pVampire->getSTR()+pVampire->getDEX()+pVampire->getINT();
input.DomainLevel = pVampire->getLevel();
computeOutput(input, output);
// 이펙트 클래스를 만들어 붙인다.
EffectMephisto* pEffect = new EffectMephisto(pTargetVampire);
pEffect->setDeadline(output.Duration);
pEffect->setBonus(output.Damage);
pTargetVampire->addEffect(pEffect);
pTargetVampire->setFlag(Effect::EFFECT_CLASS_MEPHISTO);
// 이로 인하여 바뀌는 능력치를 보낸다.
VAMPIRE_RECORD prev;
pTargetVampire->getVampireRecord(prev);
pTargetVampire->initAllStat();
pTargetVampire->sendRealWearingInfo();
pTargetVampire->sendModifyInfo(prev);
if (pTargetCreature->isPC())
{
Player* pTargetPlayer = pTargetCreature->getPlayer();
Assert(pTargetPlayer != NULL);
pTargetPlayer->sendPacket(&_GCSkillToObjectOK2);
}
else
{
Assert(false);
}
// 이펙트가 붙었다고 알려준다.
GCAddEffect gcAddEffect;
gcAddEffect.setObjectID(pTargetVampire->getObjectID());
gcAddEffect.setEffectID(Effect::EFFECT_CLASS_MEPHISTO);
gcAddEffect.setDuration(output.Duration);
pZone->broadcastPacket(pTargetVampire->getX(), pTargetVampire->getY(), &gcAddEffect);
}
}
}
catch (Throwable & t)
{
executeSkillFailException(pVampire, getSkillType());
}
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End(slayerself)" << endl;
__END_CATCH
//.........这里部分代码省略.........
示例12: execute
//////////////////////////////////////////////////////////////////////////////
// 슬레이어 타일 핸들러
//////////////////////////////////////////////////////////////////////////////
void Sanctuary::execute(Slayer* pSlayer, ZoneCoord_t X, ZoneCoord_t Y, 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);
GCSkillToTileOK1 _GCSkillToTileOK1;
GCSkillToTileOK2 _GCSkillToTileOK2;
GCSkillToTileOK3 _GCSkillToTileOK3;
GCSkillToTileOK4 _GCSkillToTileOK4;
GCSkillToTileOK5 _GCSkillToTileOK5;
GCSkillToTileOK6 _GCSkillToTileOK6;
SkillType_t SkillType = pSkillSlot->getSkillType();
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);
ZoneCoord_t myX = pSlayer->getX();
ZoneCoord_t myY = pSlayer->getY();
int RequiredMP = (int)pSkillInfo->getConsumeMP();
bool bManaCheck = hasEnoughMana(pSlayer, RequiredMP);
bool bTimeCheck = verifyRunTime(pSkillSlot);
bool bRangeCheck = verifyDistance(pSlayer, X, Y, pSkillInfo->getRange()) && checkZoneLevelToUseSkill(pSlayer);
bool bHitRoll = HitRoll::isSuccessMagic(pSlayer, pSkillInfo, pSkillSlot);
bool bTileCheck = false;
VSRect rect(0, 0, pZone->getWidth()-1, pZone->getHeight()-1);
if (rect.ptInRect(X, Y)) bTileCheck = true;
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && bTileCheck)
{
// 이펙트의 지속시간을 계산한다.
SkillInput input(pSlayer, pSkillSlot);
SkillOutput output;
computeOutput(input, output);
Range_t Range = 3;
int oX, oY;
list<Creature*> cList; // denier list
ObjectRegistry & objectregister = pZone->getObjectRegistry();
// 일단 이미 sanctuary가 있는지 검색한다.
for(oY = -1; oY <= 1; oY++)
for(oX = -1; oX <= 1; oX++)
{
int tileX = X+oX;
int tileY = Y+oY;
if (rect.ptInRect(tileX, tileY))
{
Tile& tile = pZone->getTile(tileX, tileY);
if (tile.canAddEffect())
{
Effect* pOldEffect = tile.getEffect(Effect::EFFECT_CLASS_SANCTUARY);
// 이미 있다면
// 기술 실패다.
if (pOldEffect != NULL)
{
executeSkillFailNormal(pSlayer, getSkillType(), NULL);
return;
}
}
else
{
executeSkillFailNormal(pSlayer, getSkillType(), NULL);
return;
}
}
}
// 실패하면 마나가 줄면 안 되므로 여기서 줄여준다.
decreaseMana(pSlayer, RequiredMP, _GCSkillToTileOK1);
for(oY = -1; oY <= 1; oY++)
for(oX = -1; oX <= 1; oX++)
{
int tileX = X+oX;
int tileY = Y+oY;
if (rect.ptInRect(tileX, tileY))
{
//.........这里部分代码省略.........
示例13: execute
//////////////////////////////////////////////////////////////////////////////
// 몬스터 셀프 핸들러
//////////////////////////////////////////////////////////////////////////////
void IceWave::execute(Monster* pMonster, ZoneCoord_t X, ZoneCoord_t Y)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " Begin" << endl;
Assert(pMonster != NULL);
try
{
Zone* pZone = pMonster->getZone();
Assert(pZone != NULL);
if (pMonster->isFlag(Effect::EFFECT_CLASS_HIDE))
{
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End" << endl;
return;
}
if (pMonster->isFlag(Effect::EFFECT_CLASS_INVISIBILITY))
{
addVisibleCreature(pZone, pMonster, true);
}
int dx = (rand()%7)-3;
int dy = (rand()%7)-3;
X -= min((int)X, dx);
Y -= min((int)Y, dy);
if (X > pZone->getWidth() ) X = pZone->getWidth()-1;
if (Y > pZone->getHeight() ) Y = pZone->getHeight()-1;
pZone->moveFastMonster(pMonster, pMonster->getX(), pMonster->getY(), X, Y, getSkillType());
ZoneCoord_t x = pMonster->getX();
ZoneCoord_t y = pMonster->getY();
bool bRangeCheck = checkZoneLevelToUseSkill(pMonster);
bool bMoveModeCheck = pMonster->isWalking();
if (bRangeCheck && bMoveModeCheck)
{
//--------------------------------------------------------
// 주위에 knockback되는맞는 애들을 체크해준다.
//--------------------------------------------------------
SkillInput input(pMonster);
SkillOutput output;
computeOutput(input, output);
SIMPLE_SKILL_INPUT param;
param.SkillType = getSkillType();
param.SkillDamage = output.Damage;
param.Delay = output.Delay;
param.ItemClass = Item::ITEM_CLASS_MAX;
param.STRMultiplier = 0;
param.DEXMultiplier = 0;
param.INTMultiplier = 0;
param.bMagicHitRoll = true;
param.bMagicDamage = true;
param.bAdd = false;
SIMPLE_SKILL_OUTPUT result;
for (int i=0; i<8; ++i )
{
for (int j=0; j<3; ++j )
{
int ox = pMonster->getX() + dirMoveMask[i].x * j * 3 + dirMoveMask[i].x * 2;
int oy = pMonster->getY() + dirMoveMask[i].y * j * 3 + dirMoveMask[i].y * 2;
GCAddEffectToTile gcAE;
gcAE.setXY(ox, oy);
gcAE.setEffectID(Effect::EFFECT_CLASS_ICICLE_AUGER_LARGE);
gcAE.setDuration(15);
pMonster->getZone()->broadcastPacket(ox, oy, &gcAE);
}
}
for (int i=0; i<193; i++)
{
if ((abs((int)x - (int)m_pIceWaveMask[i].x) <= 2) && (abs((int)y - (int)m_pIceWaveMask[i].y) <= 2))
param.addMask(m_pIceWaveMask[i].x, m_pIceWaveMask[i].y, 80);
else
param.addMask(m_pIceWaveMask[i].x, m_pIceWaveMask[i].y, 100);
}
// 강제로 맞는 애들을 knockback 시킨다.
bool bForceKnockback = false;
g_SimpleTileMeleeSkill.execute(pMonster, x, y,
param, result,
0,
bForceKnockback);
}
else
{
//.........这里部分代码省略.........
示例14: execute
//////////////////////////////////////////////////////////////////////////////
// 슬레이어 타일 핸들러
//////////////////////////////////////////////////////////////////////////////
void MagicElusion::execute(Slayer* pSlayer, ZoneCoord_t X, ZoneCoord_t Y, 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);
GCSkillToTileOK1 _GCSkillToTileOK1;
GCSkillToTileOK2 _GCSkillToTileOK2;
GCSkillToTileOK3 _GCSkillToTileOK3;
GCSkillToTileOK4 _GCSkillToTileOK4;
GCSkillToTileOK5 _GCSkillToTileOK5;
GCSkillToTileOK6 _GCSkillToTileOK6;
SkillType_t SkillType = pSkillSlot->getSkillType();
SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);
ZoneCoord_t myX = pSlayer->getX();
ZoneCoord_t myY = pSlayer->getY();
int RequiredMP = (int)pSkillInfo->getConsumeMP();
bool bManaCheck = hasEnoughMana(pSlayer, RequiredMP);
bool bTimeCheck = verifyRunTime(pSkillSlot);
bool bRangeCheck = verifyDistance(pSlayer, X, Y, pSkillInfo->getRange()) && checkZoneLevelToUseSkill(pSlayer);
bool bHitRoll = HitRoll::isSuccessMagicElusion(pSlayer);
bool bTileCheck = false;
VSRect rect(0, 0, pZone->getWidth()-1, pZone->getHeight()-1);
if (rect.ptInRect(X, Y)) bTileCheck = true;
// 이펙트의 지속시간을 계산한다.
SkillInput input(pSlayer, pSkillSlot);
SkillOutput output;
computeOutput(input, output);
if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && bTileCheck)
{
decreaseMana(pSlayer, RequiredMP, _GCSkillToTileOK1);
Range_t Range = 2;
int oX, oY;
list<Creature*> cList; // denier list
ObjectRegistry & objectregister = pZone->getObjectRegistry();
// 일단 이미 sanctuary가 있는지 검색한다.
for(oY = -1; oY <= 1; oY++)
for(oX = -1; oX <= 1; oX++)
{
int tileX = X+oX;
int tileY = Y+oY;
if (rect.ptInRect(tileX, tileY))
{
Tile& tile = pZone->getTile(tileX, tileY);
if (tile.canAddEffect())
{
Effect* pOldEffect = tile.getEffect(Effect::EFFECT_CLASS_MAGIC_ELUSION);
// 이미 있다면
// 기술 실패다.
if (pOldEffect != NULL)
{
executeSkillFailNormal(pSlayer, getSkillType(), NULL);
return;
}
}
else
{
executeSkillFailNormal(pSlayer, getSkillType(), NULL);
return;
}
}
}
for(oY = -1; oY <= 1; oY++)
for(oX = -1; oX <= 1; oX++)
{
int tileX = X+oX;
int tileY = Y+oY;
if (rect.ptInRect(tileX, tileY))
{
//.........这里部分代码省略.........
示例15: execute
//////////////////////////////////////////////////////////////////////////////
// 몬스터 셀프 핸들러
//////////////////////////////////////////////////////////////////////////////
void DuplicateSelf::execute(Monster* pMonster)
throw(Error)
{
__BEGIN_TRY
//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " Begin" << endl;
//cout << "DuplicateSelf" << endl;
MonsterType_t MType = pMonster->getMonsterType();
map<MonsterType_t, MonsterType_t>::const_iterator itr = m_DuplicateMonsterTypes.find(MType);
// 분신할 MonsterType이 없으면 분신 모하지..
if (itr==m_DuplicateMonsterTypes.end())
{
//cout <<"DuplicateSelf::noMonsterType: " << (int)MType << endl;
return;
}
MonsterType_t DuplicateMType = itr->second;
Assert(pMonster != NULL);
try
{
Zone* pZone = pMonster->getZone();
Assert(pZone != NULL);
if (pMonster->isFlag(Effect::EFFECT_CLASS_HIDE))
{
//cout << "DuplicateSelf: hide" << endl;
return;
}
if (pMonster->isFlag(Effect::EFFECT_CLASS_INVISIBILITY))
{
addVisibleCreature(pZone, pMonster, true);
}
//GCSkillToSelfOK2 _GCSkillToSelfOK2;
ZoneCoord_t x = pMonster->getX();
ZoneCoord_t y = pMonster->getY();
bool bRangeCheck = checkZoneLevelToUseSkill(pMonster);
//bool bMoveModeCheck = pMonster->isWalking();
if (bRangeCheck)// && bMoveModeCheck)
{
//cout << "DuplicateSelf OK" << endl;
GCSkillToTileOK5 _GCSkillToTileOK5;
_GCSkillToTileOK5.setObjectID(pMonster->getObjectID());
_GCSkillToTileOK5.setSkillType(getSkillType());
_GCSkillToTileOK5.setX(x);
_GCSkillToTileOK5.setY(y);
_GCSkillToTileOK5.setDuration( 0);
pZone->broadcastPacket(x, y, &_GCSkillToTileOK5);
//--------------------------------------------------------
// 주위에 knockback되는맞는 애들을 체크해준다.
//--------------------------------------------------------
//SkillInput input(pMonster);
//SkillOutput output;
//computeOutput(input, output);
// 몬스터를 존에 추가한다.
SUMMON_INFO summonInfo;
summonInfo.scanEnemy = true;
summonInfo.hasItem = false;
summonInfo.initHPPercent = pMonster->getHP(ATTR_CURRENT)*100/pMonster->getHP(ATTR_MAX);
int numFake = min((1+rand()%3), pMonster->getINT()/100);
//cout << "numDuplicate = " << numFake<< endl;
MonsterManager* pMonsterManager = pZone->getMonsterManager();
Assert(pMonsterManager != NULL);
list<Monster*> summonedMonsters;
for (int i=0; i<numFake; i++)
{
int X = max(0, min((int)pZone->getWidth()-1, (x - 5 + rand()%11)));
int Y = max(0, min((int)pZone->getHeight()-1, (y - 5 + rand()%11)));
try
{
pMonsterManager->addMonsters(X, Y, DuplicateMType, 1, summonInfo, &summonedMonsters);
}
catch (Throwable& t)
{
cerr << t.toString() << endl;
}
}
// 잔상을 보여준다.
list<Monster*>::const_iterator iMonster = summonedMonsters.begin();
//.........这里部分代码省略.........