⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 berserker.cpp

📁 天之炼狱1服务器端源文件游戏服务端不完整
💻 CPP
字号:
//////////////////////////////////////////////////////////////////////////////// Filename    : Berserker.cpp// Written by  : excel96// Description : //////////////////////////////////////////////////////////////////////////////#include "Berserker.h"#include "EffectBerserker.h"#include "Gpackets/GCSkillToSelfOK1.h"#include "Gpackets/GCSkillToSelfOK2.h"#include "Gpackets/GCStatusCurrentHP.h"#include "Gpackets/GCAddEffect.h"//////////////////////////////////////////////////////////////////////////////// 浇饭捞绢 伎橇 勤甸矾//////////////////////////////////////////////////////////////////////////////void Berserker::execute(Slayer* pSlayer, 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);		// 公厘窍绊 乐绰 公扁啊 澄捞芭唱, 档啊 酒聪扼搁 荤侩且 荐 绝促.		Item* pItem = pSlayer->getWearItem(Slayer::WEAR_RIGHTHAND);		if (pItem == NULL || pItem->getItemClass() != Item::ITEM_CLASS_BLADE)		{			executeSkillFailException(pSlayer, getSkillType());			//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End" << endl;			return;		}		bool bIncreaseDomainExp = pSlayer->isRealWearingEx(Slayer::WEAR_RIGHTHAND);		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 = checkZoneLevelToUseSkill(pSlayer);		bool bHitRoll    = HitRoll::isSuccessMagic(pSlayer, pSkillInfo, pSkillSlot);		// 瞒隆 颇况尔 悼矫俊 荤侩且 荐 绝促.		bool bEffected   = pSlayer->isFlag(Effect::EFFECT_CLASS_BERSERKER) || pSlayer->isFlag(Effect::EFFECT_CLASS_CHARGING_POWER);		if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && !bEffected)		{			decreaseMana(pSlayer, RequiredMP, _GCSkillToSelfOK1);			SkillInput input(pSlayer, pSkillSlot);			SkillOutput output;			computeOutput(input, output);			// by sigi. 2002.12.3			// by 全芒. 2002.12.6//			int DefensePenalty = 35 - pSkillSlot->getExpLevel()*2/13;	// %//			int ProtectionPenalty = 25 - pSkillSlot->getExpLevel()*2/13;	// %			int DefensePenalty = 25 - pSkillSlot->getExpLevel()*2/13;	// %			int ProtectionPenalty = 20 - pSkillSlot->getExpLevel()*2/13;	// %			// 捞棋飘 努贰胶甫 父甸绢 嘿牢促.			EffectBerserker* pEffect = new EffectBerserker(pSlayer);			pEffect->setDeadline(output.Duration);			pEffect->setDefensePenalty( DefensePenalty );			pEffect->setProtectionPenalty( ProtectionPenalty );			pEffect->setToHitBonus(output.ToHit);			pEffect->setDamageBonus(output.Damage);			pSlayer->addEffect(pEffect);			pSlayer->setFlag(Effect::EFFECT_CLASS_BERSERKER);			// 捞肺 牢窍咯 官差绰 瓷仿摹甫 焊辰促.			SLAYER_RECORD prev;			pSlayer->getSlayerRecord(prev);			pSlayer->initAllStat();			pSlayer->sendRealWearingInfo();			pSlayer->sendModifyInfo(prev);			// 版氰摹甫 棵赴促.			SkillGrade Grade = g_pSkillInfoManager->getGradeByDomainLevel(pSlayer->getSkillDomainLevel(DomainType));			Exp_t ExpUp = 10*(Grade+1);			if ( bIncreaseDomainExp )			{				shareAttrExp(pSlayer, ExpUp, 8, 1, 1, _GCSkillToSelfOK1);				increaseDomainExp(pSlayer, DomainType, pSkillInfo->getPoint(), _GCSkillToSelfOK1);//				increaseSkillExp(pSlayer, DomainType,  pSkillSlot, pSkillInfo, _GCSkillToSelfOK1);			}			_GCSkillToSelfOK1.setSkillType(SkillType);			_GCSkillToSelfOK1.setCEffectID(CEffectID);			_GCSkillToSelfOK1.setDuration(output.Duration);					_GCSkillToSelfOK2.setObjectID(pSlayer->getObjectID());			_GCSkillToSelfOK2.setSkillType(SkillType);			_GCSkillToSelfOK2.setDuration(output.Duration);					pPlayer->sendPacket(&_GCSkillToSelfOK1);			pZone->broadcastPacket(X, Y, &_GCSkillToSelfOK2, pSlayer);			GCAddEffect gcAddEffect;			gcAddEffect.setObjectID(pSlayer->getObjectID());			gcAddEffect.setEffectID(Effect::EFFECT_CLASS_BERSERKER);			gcAddEffect.setDuration(output.Duration);			pZone->broadcastPacket(pSlayer->getX(), pSlayer->getY(), &gcAddEffect);			pSkillSlot->setRunTime(output.Delay);		} 		else 		{			executeSkillFailNormal(pSlayer, getSkillType(), NULL);		}	} 	catch (Throwable & t) 	{		executeSkillFailException(pSlayer, getSkillType());	}	//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End" << endl;	__END_CATCH}Berserker g_Berserker;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -