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

📄 bloodytunnel.cpp

📁 天之炼狱1服务器端源文件游戏服务端不完整
💻 CPP
字号:
//////////////////////////////////////////////////////////////////////////////// Filename    : BloodyTunnel.cpp// Written by  : elca@ewestsoft.com// Description : //////////////////////////////////////////////////////////////////////////////#include "BloodyTunnel.h"#include "ZoneUtil.h"#include "EffectSchedule.h"#include "EffectVampirePortal.h"#include "item/VampirePortalItem.h"#include "Gpackets/GCSkillToSelfOK1.h"#include "Gpackets/GCSkillToInventoryOK1.h"#include "Gpackets/GCSkillToSelfOK3.h"//////////////////////////////////////////////////////////////////////////////// 轨颇捞绢 牢亥配府 勤甸矾//////////////////////////////////////////////////////////////////////////////void BloodyTunnel::execute(Vampire* pVampire, ObjectID_t InvenObjectID, CoordInven_t X, CoordInven_t Y, CoordInven_t TargetX, CoordInven_t TargetY, VampireSkillSlot* pSkillSlot)	throw(Error){	__BEGIN_TRY	//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " Begin" << endl;	Assert(pVampire != NULL);	Assert(pSkillSlot != NULL);	try 	{		Player* pPlayer = pVampire->getPlayer();		Zone* pZone = pVampire->getZone();		Inventory* pInventory = pVampire->getInventory();		Assert(pPlayer != NULL);		Assert(pZone != NULL);		Assert(pInventory!= NULL);		// 傈里 粮捞扼搁 BloodyTunnel甫 荤侩且 荐 绝促.		// 老窜篮 ZoneID肺 啊绰单.. ZoneInfo俊 持档废 秦具茄促.		///*		//if (pZone->getZoneID()==1122 || pZone->getZoneID()==1123)		// 捞亥飘 版扁厘/OX 阜扁. by sigi. 2002.8.31		//int zoneID = pZone->getZoneID();		//if (zoneID==1005 || zoneID==1006)		if (pZone->isNoPortalZone()			|| pZone->isMasterLair()			|| pZone->isCastle()			|| pZone->isHolyLand())		{			executeSkillFailException(pVampire, getSkillType());			//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End" << endl;			return;		}		//*/		Item* pItem = pInventory->getItem(X, Y);		// 酒捞袍捞 绝芭唱, 轨颇捞绢 器呕 酒捞袍捞 酒聪芭唱, OID啊 撇府促搁 扁贱 荤侩 阂啊		if (pItem == NULL || pItem->getItemClass() != Item::ITEM_CLASS_VAMPIRE_PORTAL_ITEM || pItem->getObjectID() != InvenObjectID)		{			executeSkillFailException(pVampire, getSkillType());			//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End" << endl;			return;		}		VampirePortalItem* pVampirePortalItem = dynamic_cast<VampirePortalItem*>(pItem);		Assert(pVampirePortalItem != NULL);		// 轨颇捞绢 器呕 酒捞袍俊 扁废等 困摹啊 绝阑 版快俊绰 角菩促.		ZoneID_t    zoneid = pVampirePortalItem->getZoneID();		ZoneCoord_t tx     = pVampirePortalItem->getX();		ZoneCoord_t ty     = pVampirePortalItem->getY();		if (zoneid == 0)		{			executeSkillFailException(pVampire, getSkillType());			//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End" << endl;			return;		}		// 掘绢柯 格钎 粮苞 谅钎甫 八刘茄促.		Zone* pTargetZone = getZoneByZoneID(zoneid);		// 酒淬狼 己瘤客 促弗 粮苞绰 楷搬登瘤 臼绰促.		if (pZone->isHolyLand() != pTargetZone->isHolyLand())		{			executeSkillFailException(pVampire, getSkillType());			return;		}		//cout << "鸥百 粮 器牢磐 裙垫 己傍" << endl;		VSRect* pRect = pTargetZone->getOuterRect();		if (!pRect->ptInRect(tx, ty))		{			executeSkillFailException(pVampire, getSkillType());			//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End" << endl;			return;		}		//cout << "谅钎 八刘 己傍" << endl;				GCSkillToInventoryOK1 _GCSkillToInventoryOK1;		SkillType_t SkillType  = pSkillSlot->getSkillType();		SkillInfo*  pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType);		int  RequiredMP     = decreaseConsumeMP(pVampire, pSkillInfo);		bool bManaCheck     = hasEnoughMana(pVampire, RequiredMP);		bool bTimeCheck     = verifyRunTime(pSkillSlot);		bool bRangeCheck    = checkZoneLevelToUseSkill(pVampire);		//bool bHitRoll       = HitRoll::isSuccessMagic(pVampire, pSkillInfo, pSkillSlot);		bool bHitRoll       = true;		if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll)		{			decreaseMana(pVampire, RequiredMP, _GCSkillToInventoryOK1);			SkillInput input(pVampire);			SkillOutput output;			computeOutput(input, output);			// 阿阿狼 粮俊促啊 器呕阑 歹茄促.			ZONE_COORD s_coord;			ZONE_COORD t_coord;			s_coord.id = pZone->getZoneID();			s_coord.x  = pVampire->getX();			s_coord.y  = pVampire->getY();			t_coord.id = pTargetZone->getZoneID();			t_coord.x  = tx;			t_coord.y  = ty;			pZone->addVampirePortal(s_coord.x, s_coord.y, pVampire, t_coord);			pTargetZone->addVampirePortal(t_coord.x, t_coord.y, pVampire, s_coord);			_GCSkillToInventoryOK1.setSkillType(SkillType);			_GCSkillToInventoryOK1.setObjectID(InvenObjectID);			_GCSkillToInventoryOK1.setCEffectID(0);			_GCSkillToInventoryOK1.setDuration(0);					pPlayer->sendPacket(&_GCSkillToInventoryOK1);			// 瞒瘤 荐甫 临牢促.			pVampirePortalItem->setCharge(pVampirePortalItem->getCharge()-1);			if (pVampirePortalItem->getCharge() > 0)			{				// 酒流 瞒瘤啊 巢疽促搁 混妨敌促.				pVampirePortalItem->save(pVampire->getName(), STORAGE_INVENTORY, 0, X, Y);			}			else			{				// 器呕 酒捞袍狼 瞒瘤啊 促 家葛登菌促搁 昏力矫挪促.				pInventory->deleteItem(X, Y);				pVampirePortalItem->destroy();				// 酒捞袍 器牢磐 磊眉啊 瘤况瘤绊, NULL捞 登搁,				// 捞棋飘 郴何俊辑狼 酒捞袍 器牢磐档 NULL捞 登摆瘤...				SAFE_DELETE(pVampirePortalItem);			}			pSkillSlot->setRunTime(output.Delay);		} 		else 		{			executeSkillFailNormal(pVampire, getSkillType(), NULL);		}	} 	catch(Throwable & t) 	{		executeSkillFailException(pVampire, getSkillType());	}	//cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End" << endl;	__END_CATCH}BloodyTunnel g_BloodyTunnel;

⌨️ 快捷键说明

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