📄 rapidgliding.cpp
字号:
//////////////////////////////////////////////////////////////////////////////// Filename : RapidGliding.cpp// Written by : // Description : //////////////////////////////////////////////////////////////////////////////#include "RapidGliding.h"#include "Gpackets/GCModifyInformation.h"#include "Gpackets/GCStatusCurrentHP.h"#include "Gpackets/GCSkillToTileOK1.h"#include "Gpackets/GCSkillToTileOK5.h"//////////////////////////////////////////////////////////////////////////////// 轨颇捞绢 鸥老 勤甸矾 //////////////////////////////////////////////////////////////////////////////void RapidGliding::execute(Vampire* pVampire, ZoneCoord_t X, ZoneCoord_t Y, VampireSkillSlot* pVampireSkillSlot, CEffectID_t CEffectID) throw(Error){ __BEGIN_TRY Assert(pVampire != NULL); Assert(pVampireSkillSlot != NULL); try { Player* pPlayer = pVampire->getPlayer(); Zone* pZone = pVampire->getZone(); Assert(pPlayer != NULL); Assert(pZone != NULL); SkillType_t SkillType = pVampireSkillSlot->getSkillType(); //Assert(pTargetCreature != NULL); // NoSuch力芭. by sigi. 2002.5.2 // NPC绰 傍拜且 荐啊 绝促. // bool bIncreaseDomainExp = pVampire->isRealWearingEx(Vampire::WEAR_RIGHTHAND); GCSkillToTileOK1 _GCSkillToTileOK1; GCSkillToTileOK5 _GCSkillToTileOK5; VSRect rect(0, 0, pZone->getWidth()-1, pZone->getHeight()-1); if ( !rect.ptInRect(X, Y) ) { executeSkillFailException(pVampire, getSkillType()); } SkillInput input(pVampire); SkillOutput output; computeOutput(input, output); 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, output.Range); bool bEffected = pVampire->hasRelicItem() || pVampire->isFlag(Effect::EFFECT_CLASS_HAS_FLAG) || pVampire->isFlag(Effect::EFFECT_CLASS_HAS_SWEEPER); bool bPassLine = isPassLine( pZone, pVampire->getX(), pVampire->getY(), X, Y ); if (bManaCheck && bTimeCheck && bRangeCheck && !bEffected && bPassLine ) { // 狐福霸 PC甫 框流咯霖促. if (pZone->moveFastPC(pVampire, pVampire->getX(), pVampire->getY(), X, Y, getSkillType())) { decreaseMana(pVampire, RequiredMP, _GCSkillToTileOK1); _GCSkillToTileOK1.setSkillType(SkillType); _GCSkillToTileOK1.setCEffectID(0); _GCSkillToTileOK1.setX(X); _GCSkillToTileOK1.setY(Y); _GCSkillToTileOK1.setRange(0); _GCSkillToTileOK1.setDuration(0); _GCSkillToTileOK5.setObjectID(pVampire->getObjectID()); _GCSkillToTileOK5.setSkillType(SkillType); _GCSkillToTileOK5.setX(X); _GCSkillToTileOK5.setY(Y); _GCSkillToTileOK5.setRange(0); _GCSkillToTileOK5.setDuration(0); // 磊脚俊霸 官诧 HP甫 舅妨霖促. pPlayer->sendPacket( &_GCSkillToTileOK1); // 林困俊 HP啊 官布促绊 舅赴促. GCStatusCurrentHP gcStatusCurrentHP; gcStatusCurrentHP.setObjectID(pVampire->getObjectID()); gcStatusCurrentHP.setCurrentHP(pVampire->getHP()); pZone->broadcastPacket(pVampire->getX(), pVampire->getY(), &gcStatusCurrentHP, pVampire); pZone->broadcastPacket(pVampire->getX(), pVampire->getY(), &_GCSkillToTileOK5, pVampire); pVampireSkillSlot->setRunTime(output.Delay); } else { executeSkillFailException(pVampire, getSkillType()); } } else { executeSkillFailException(pVampire, getSkillType()); } } catch (Throwable & t) { executeSkillFailException(pVampire, getSkillType()); } //cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End" << endl; __END_CATCH}//////////////////////////////////////////////////////////////////////////////// 轨颇捞绢 坷宏璃飘 勤甸矾//////////////////////////////////////////////////////////////////////////////void RapidGliding::execute(Vampire * pVampire, ObjectID_t TargetObjectID, 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); Creature* pTargetCreature = pZone->getCreature(TargetObjectID); //SkillType_t SkillType = pVampireSkillSlot->getSkillType(); //Assert(pTargetCreature != NULL); // NoSuch力芭. by sigi. 2002.5.2 // NPC绰 傍拜且 荐啊 绝促. if (pTargetCreature==NULL) { executeSkillFailException(pVampire, getSkillType()); //cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End" << endl; return; }// bool bIncreaseDomainExp = pVampire->isRealWearingEx(Vampire::WEAR_RIGHTHAND); execute( pVampire, pTargetCreature->getX(), pTargetCreature->getY(), pVampireSkillSlot, CEffectID );/* SkillInput input(pVampire); SkillOutput output; computeOutput(input, output); SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType); int RequiredMP = (int)pSkillInfo->getConsumeMP(); bool bManaCheck = hasEnoughMana(pVampire, RequiredMP); bool bTimeCheck = verifyRunTime(pVampireSkillSlot); bool bRangeCheck = verifyDistance(pVampire, pTargetCreature, output.Range); bool bEffected = pVampire->hasRelicItem(); if (bManaCheck && bTimeCheck && bRangeCheck && !bEffected ) { // 狐福霸 PC甫 框流咯霖促. if (pZone->moveFastPC(pVampire, pVampire->getX(), pVampire->getY(), pTargetCreature->getX(), pTargetCreature->getY())) { GCModifyInformation gcMI; decreaseMana(pVampire, RequiredMP, gcMI); // 磊脚俊霸 官诧 HP甫 舅妨霖促. pPlayer->sendPacket( &gcMI ); // 林困俊 HP啊 官布促绊 舅赴促. GCStatusCurrentHP gcStatusCurrentHP; gcStatusCurrentHP.setObjectID(pVampire->getObjectID()); gcStatusCurrentHP.setCurrentHP(pVampire->getHP()); pZone->broadcastPacket(pVampire->getX(), pVampire->getY(), &gcStatusCurrentHP, pVampire); pVampireSkillSlot->setRunTime(output.Delay); } else { executeSkillFailNormal(pVampire, getSkillType(), pTargetCreature); } } else { executeSkillFailNormal(pVampire, getSkillType(), pTargetCreature); } */ } catch (Throwable & t) { executeSkillFailException(pVampire, getSkillType()); } //cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End" << endl; __END_CATCH}RapidGliding g_RapidGliding;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -