📄 paralyze.cpp
字号:
{ executeSkillFailNormal(pVampire, getSkillType(), pTargetCreature); } } catch(Throwable & t) { executeSkillFailException(pVampire, getSkillType()); } //cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " end " << endl; __END_CATCH}//////////////////////////////////////////////////////////////////////////////// 阁胶磐 坷宏璃飘 勤甸矾//////////////////////////////////////////////////////////////////////////////void Paralyze::execute(Monster* pMonster, Creature* pEnemy) throw(Error){ __BEGIN_TRY //cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << "begin " << endl; Assert(pMonster != NULL); Assert(pEnemy != NULL); try { Zone* pZone = pMonster->getZone(); Assert(pZone != NULL); if (pMonster->isFlag(Effect::EFFECT_CLASS_HIDE)) { //cout << "Monster cannot use skill while hiding." << endl; //cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End(monster)" << endl; return; } if (pMonster->isFlag(Effect::EFFECT_CLASS_INVISIBILITY)) { addVisibleCreature(pZone, pMonster, true); } if (pMonster->isMaster()) { int x = pMonster->getX(); int y = pMonster->getY(); int Splash = 3 + rand()%5; // 3~7 付府 int range = 2; // 5x5 list<Creature*> creatureList; getSplashVictims(pMonster->getZone(), x, y, Creature::CREATURE_CLASS_MAX, creatureList, Splash, range); list<Creature*>::iterator itr = creatureList.begin(); for (; itr != creatureList.end(); itr++) { Creature* pTargetCreature = (*itr); Assert(pTargetCreature != NULL); if (pMonster!=pTargetCreature) executeMonster(pZone, pMonster, pTargetCreature); } } else { executeMonster(pZone, pMonster, pEnemy); } } catch(Throwable & t) { executeSkillFailException(pMonster, getSkillType()); } //cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " end " << endl; __END_CATCH}void Paralyze::executeMonster(Zone* pZone, Monster* pMonster, Creature* pEnemy) throw(Error){ __BEGIN_TRY if (!pMonster->isEnemyToAttack(pEnemy)) { return; } GCSkillToObjectOK2 _GCSkillToObjectOK2; GCSkillToObjectOK3 _GCSkillToObjectOK3; GCSkillToObjectOK4 _GCSkillToObjectOK4; GCSkillToObjectOK5 _GCSkillToObjectOK5; GCSkillToObjectOK6 _GCSkillToObjectOK6; SkillType_t SkillType = SKILL_PARALYZE; SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType); bool bRangeCheck = verifyDistance(pMonster, pEnemy, pSkillInfo->getRange()); bool bHitRoll = HitRoll::isSuccessCurse(pSkillInfo->getLevel()/2, pEnemy->getResist(MAGIC_DOMAIN_CURSE)); bool bHitRoll2 = HitRoll::isSuccessMagic(pMonster, pSkillInfo); bool bCanHit = canHit(pMonster, pEnemy, SkillType); bool bEffected = pEnemy->isFlag(Effect::EFFECT_CLASS_PARALYZE) || pEnemy->isFlag(Effect::EFFECT_CLASS_IMMUNE_TO_PARALYZE); ZoneCoord_t vampX = pMonster->getX(); ZoneCoord_t vampY = pMonster->getY(); ZoneCoord_t targetX = pEnemy->getX(); ZoneCoord_t targetY = pEnemy->getY(); if (bRangeCheck && bHitRoll && bHitRoll2 && bCanHit && !bEffected) { bool bCanSeeCaster = canSee(pEnemy, pMonster); SkillInput input(pMonster); SkillOutput output; computeOutput(input, output); // pTargetCreature啊 历林付过阑 馆荤窍绰 版快 if (CheckReflection(pMonster, pEnemy, getSkillType())) { pEnemy = (Creature*)pMonster; } Resist_t resist = pEnemy->getResist( MAGIC_DOMAIN_CURSE ); if ( resist > output.Duration ) resist = output.Duration; output.Duration -= resist; if ( output.Duration < 20 ) output.Duration=20; // 捞棋飘 坷宏璃飘甫 积己秦辑 嘿牢促. EffectParalyze* pEffectParalyze = new EffectParalyze(pEnemy); pEffectParalyze->setLevel(pSkillInfo->getLevel()/2); //pEffectParalyze->setDefensePenalty(output.Damage); pEffectParalyze->setDeadline(output.Duration); pEnemy->addEffect(pEffectParalyze); pEnemy->setFlag(Effect::EFFECT_CLASS_PARALYZE); // 历林俊 吧府搁 叼奇胶啊 冻绢柳促. if (pEnemy->isSlayer()) { Slayer* pTargetSlayer = dynamic_cast<Slayer*>(pEnemy); SLAYER_RECORD prev; pTargetSlayer->getSlayerRecord(prev); pTargetSlayer->initAllStat(); pTargetSlayer->addModifyInfo(prev, _GCSkillToObjectOK2); } else if (pEnemy->isVampire()) { Vampire* pTargetVampire = dynamic_cast<Vampire*>(pEnemy); VAMPIRE_RECORD prev; pTargetVampire->getVampireRecord(prev); pTargetVampire->initAllStat(); pTargetVampire->addModifyInfo(prev, _GCSkillToObjectOK2); } else if (pEnemy->isOusters()) { Ousters* pTargetOusters = dynamic_cast<Ousters*>(pEnemy); OUSTERS_RECORD prev; pTargetOusters->getOustersRecord(prev); pTargetOusters->initAllStat(); pTargetOusters->addModifyInfo(prev, _GCSkillToObjectOK2); } else if (pEnemy->isMonster()) { Monster* pTargetMonster = dynamic_cast<Monster*>(pEnemy); pTargetMonster->initAllStat(); } else Assert(false); // 捞棋飘啊 嘿菌促绰 巴阑 宏肺靛某胶泼秦霖促. GCAddEffect gcAddEffect; gcAddEffect.setObjectID(pEnemy->getObjectID()); gcAddEffect.setEffectID(Effect::EFFECT_CLASS_PARALYZE); gcAddEffect.setDuration(output.Duration); pZone->broadcastPacket(targetX, targetY, &gcAddEffect); _GCSkillToObjectOK2.setObjectID(pMonster->getObjectID()); _GCSkillToObjectOK2.setSkillType(SkillType); _GCSkillToObjectOK2.setDuration(output.Duration); _GCSkillToObjectOK3.setObjectID(pMonster->getObjectID()); _GCSkillToObjectOK3.setSkillType(SkillType); _GCSkillToObjectOK3.setTargetXY(targetX, targetY); _GCSkillToObjectOK4.setSkillType(SkillType); _GCSkillToObjectOK4.setTargetObjectID(pEnemy->getObjectID()); _GCSkillToObjectOK5.setObjectID(pMonster->getObjectID()); _GCSkillToObjectOK5.setTargetObjectID(pEnemy->getObjectID()); _GCSkillToObjectOK5.setSkillType(SkillType); _GCSkillToObjectOK5.setDuration(output.Duration); _GCSkillToObjectOK6.setXY(vampX, vampY); _GCSkillToObjectOK6.setSkillType(SkillType); _GCSkillToObjectOK6.setDuration(output.Duration); if (pEnemy->isPC()) { Player* pTargetPlayer = pEnemy->getPlayer(); if (pTargetPlayer == NULL) { //cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " end " << endl; return; } if (bCanSeeCaster) pTargetPlayer->sendPacket(&_GCSkillToObjectOK2); else pTargetPlayer->sendPacket(&_GCSkillToObjectOK6); } else { Monster* pTargetMonster = dynamic_cast<Monster*>(pEnemy); pTargetMonster->addEnemy(pMonster); } list<Creature*> cList; cList.push_back(pMonster); cList.push_back(pEnemy); cList = pZone->broadcastSkillPacket(vampX, vampY, targetX, targetY, &_GCSkillToObjectOK5, cList); pZone->broadcastPacket(vampX, vampY, &_GCSkillToObjectOK3 , cList); pZone->broadcastPacket(targetX, targetY, &_GCSkillToObjectOK4 , cList); } else { executeSkillFailNormal(pMonster, getSkillType(), pEnemy); } __END_CATCH}Paralyze g_Paralyze;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -