📄 holyblast.cpp
字号:
//////////////////////////////////////////////////////////////////////////////// Filename : HolyBlast.cpp// Written by : elca@ewestsoft.com// Description : //////////////////////////////////////////////////////////////////////////////#include "HolyBlast.h"#include "ZoneUtil.h"#include "SimpleTileCureSkill.h"#include "EffectBloodDrain.h"#include "EffectAftermath.h"#include "Gpackets/GCSkillToTileOK1.h"#include "Gpackets/GCSkillToTileOK2.h"#include "Gpackets/GCSkillToTileOK3.h"#include "Gpackets/GCSkillToTileOK4.h"#include "Gpackets/GCSkillToTileOK5.h"#include "Gpackets/GCSkillToTileOK6.h"#include "Gpackets/GCSkillToSelfOK1.h"#include "Gpackets/GCSkillToSelfOK2.h"#include "Gpackets/GCRemoveEffect.h"//////////////////////////////////////////////////////////////////////////////// 浇饭捞绢 坷宏璃飘 勤甸矾//////////////////////////////////////////////////////////////////////////////void HolyBlast::execute(Slayer* pSlayer, ObjectID_t TargetObjectID, SkillSlot* pSkillSlot, CEffectID_t CEffectID) throw(Error){ __BEGIN_TRY //cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " Begin" << endl; SkillInput input(pSlayer, pSkillSlot); SkillOutput output; input.TargetType = SkillInput::TARGET_OTHER; computeOutput(input, output); SIMPLE_SKILL_INPUT param; param.SkillType = getSkillType(); param.SkillDamage = output.Damage; param.Delay = output.Delay; param.STRMultiplier = 1; param.DEXMultiplier = 1; param.INTMultiplier = 8; param.Level = input.SkillLevel; SIMPLE_SKILL_OUTPUT result; g_SimpleTileCureSkill.execute(pSlayer, TargetObjectID, pSkillSlot, param, result); //cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End" << endl; __END_CATCH}//////////////////////////////////////////////////////////////////////////////// 浇饭捞绢 伎橇 勤甸矾//////////////////////////////////////////////////////////////////////////////void HolyBlast::execute(Slayer* pSlayer, SkillSlot* pSkillSlot, CEffectID_t CEffectID) throw(Error){ __BEGIN_TRY //cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " Begin" << endl; SkillInput input(pSlayer, pSkillSlot); SkillOutput output; input.TargetType = SkillInput::TARGET_SELF; computeOutput(input, output); SIMPLE_SKILL_INPUT param; param.SkillType = getSkillType(); param.SkillDamage = output.Damage; param.Delay = output.Delay; param.STRMultiplier = 1; param.DEXMultiplier = 1; param.INTMultiplier = 8; param.Level = input.SkillLevel; SIMPLE_SKILL_OUTPUT result; g_SimpleTileCureSkill.execute(pSlayer, pSkillSlot, param, result); //cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End" << endl; __END_CATCH}void HolyBlast::execute(Slayer* pSlayer, ZoneCoord_t X, ZoneCoord_t Y, SkillSlot* pSkillSlot, CEffectID_t CEffectID) throw(Error){ __BEGIN_TRY SkillInput input(pSlayer, pSkillSlot); SkillOutput output; input.TargetType = SkillInput::TARGET_SELF; computeOutput(input, output); SIMPLE_SKILL_INPUT param; param.SkillType = getSkillType(); param.SkillDamage = output.Damage; param.Delay = output.Delay; param.STRMultiplier = 1; param.DEXMultiplier = 1; param.INTMultiplier = 8; param.Level = input.SkillLevel; SIMPLE_SKILL_OUTPUT result; cout << "Tile X :" << (int)X << "Tile Y : " << (int)Y << endl; g_SimpleTileCureSkill.execute(pSlayer, X, Y, pSkillSlot, param, result); __END_CATCH}//////////////////////////////////////////////////////////////////////////////// class SimpleTileMissileSkill member methods//////////////////////////////////////////////////////////////////////////////void HolyBlast::execute(Slayer* pSlayer, int X, int Y, SkillSlot* pSkillSlot, const SIMPLE_SKILL_INPUT& param, SIMPLE_SKILL_OUTPUT& result, CEffectID_t CEffectID) throw (Error){ __BEGIN_TRY try { Player* pPlayer = pSlayer->getPlayer(); Zone* pZone = pSlayer->getZone(); Assert(pPlayer != NULL); Assert(pZone != NULL); // 父老 捞 扁贱捞 漂喊茄 公扁啊 乐绢具 矫傈且 荐 乐绰 扁贱捞扼搁... // 弊 拌凯狼 公扁甫 甸绊 乐绰瘤甫 眉农秦辑 酒聪扼搁 角菩促. if (param.ItemClass != Item::ITEM_CLASS_MAX) { Item* pItem = pSlayer->getWearItem(Slayer::WEAR_RIGHTHAND); if (pItem == NULL || pItem->getItemClass() != param.ItemClass) { executeSkillFailException(pSlayer, param.SkillType); return; } } bool bIncreaseDomainExp = pSlayer->isRealWearingEx(Slayer::WEAR_RIGHTHAND); GCSkillToTileOK1 _GCSkillToTileOK1; GCSkillToTileOK2 _GCSkillToTileOK2; GCSkillToTileOK3 _GCSkillToTileOK3; GCSkillToTileOK4 _GCSkillToTileOK4; GCSkillToTileOK5 _GCSkillToTileOK5; GCSkillToTileOK6 _GCSkillToTileOK6; GCSkillToSelfOK1 _GCSkillToSelfOK1; GCSkillToSelfOK2 _GCSkillToSelfOK2; SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(param.SkillType); SkillDomainType_t DomainType = pSkillInfo->getDomainType(); SkillLevel_t SkillLevel = pSkillSlot->getExpLevel(); int RequiredMP = (int)pSkillInfo->getConsumeMP(); bool bManaCheck = hasEnoughMana(pSlayer, RequiredMP); bool bTimeCheck = verifyRunTime(pSkillSlot); bool bRangeCheck = verifyDistance(pSlayer, X, Y, pSkillInfo->getRange()); if (bManaCheck && bTimeCheck && bRangeCheck ) { // 付唱甫 冻绢哆赴促. decreaseMana(pSlayer, RequiredMP, _GCSkillToTileOK1); // 谅钎客 规氢阑 备茄促. ZoneCoord_t myX = pSlayer->getX(); ZoneCoord_t myY = pSlayer->getY(); Dir_t dir = calcDirection(myX, myY, X, Y); Damage_t Damage = 0; Damage_t MaxDamage = 0; Damage_t TotalDamage = 0; // SkillFomula俊辑 备秦瘤绰扒 傍拜damage促. - -; // 弊贰辑 烙矫肺... uint HealPoint = 30 + param.Level/8; //param.SkillDamage; uint RealHealPoint = 0; bool bCriticalHit = false; bool bHit = false; bool bHeal = false; //VSRect rect(1, 1, pZone->getWidth()-2, pZone->getHeight()-2); int Splash = 3 + pSkillSlot->getExpLevel()/10 + 1; list<Creature*> cList; list<Creature*> creatureList; getSplashVictims(pZone, X, Y, Creature::CREATURE_CLASS_MAX, creatureList, Splash); list<Creature*>::iterator itr = creatureList.begin(); for (; itr != creatureList.end(); itr++) { Creature* pTargetCreature = (*itr); Assert(pTargetCreature != NULL); if (pTargetCreature != pSlayer) // 夯牢捞 酒囱 版快 { bool bSameRaceCheck = pTargetCreature->isSlayer(); bool bZoneLevelCheck = checkZoneLevelToHitTarget(pTargetCreature); // 鞍篮 辆练捞搁 摹丰茄促. if (bSameRaceCheck && bZoneLevelCheck) { // 鳃罐篮 局绰 cList俊 眠啊窍瘤 臼绰促. // cList俊绰 嘎绰 局代父 持绢林绊 // 娟匙甸篮 CURE_EFFECT甫 焊咯霖促. EffectBloodDrain* pEffectBloodDrain = NULL; bool bHPCheck = false; // 农府媚甫 眉农且锭 付促 货肺 技泼秦具窍瘤 臼阑鳖? 2002.05.31 by bezz if (!pTargetCreature->isFlag(Effect::EFFECT_CLASS_COMA) ) { Slayer* pTargetSlayer = dynamic_cast<Slayer*>(pTargetCreature); Assert(pTargetSlayer!=NULL); HP_t CurrentHP = pTargetSlayer->getHP(ATTR_CURRENT); HP_t MaxHP = pTargetSlayer->getHP(ATTR_MAX); if ( CurrentHP < MaxHP ) { bHPCheck = true; } if ( pTargetCreature->isFlag(Effect::EFFECT_CLASS_BLOOD_DRAIN)) { Effect* pEffect = pTargetCreature->findEffect(Effect::EFFECT_CLASS_BLOOD_DRAIN); pEffectBloodDrain = dynamic_cast<EffectBloodDrain*>(pEffect); Assert(pEffectBloodDrain != NULL); if (pEffectBloodDrain->getLevel() < param.Level) { bHPCheck = true; bHeal = true; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -