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

📄 simpletilemeleeskill.cpp

📁 天之炼狱1服务器端源文件游戏服务端不完整
💻 CPP
📖 第 1 页 / 共 3 页
字号:
								if (param.bMagicDamage)								{									Damage += computeMagicDamage(pTargetCreature, param.SkillDamage, param.SkillType);								}								else								{									Damage += param.SkillDamage;								}								// HitRoll 俊辑 角菩茄 档 拌凯狼 扁贱狼 版快 7%狼 单固瘤甫 爱档废 茄促 - by bezz								if ( bSetMinDamage )								{									Damage = getPercentValue( Damage, 7 );								}								MaxDamage = max(Damage, MaxDamage);								// 其澄萍绰 扁夯利栏肺 100捞促.								Damage = getPercentValue(Damage, penalty);								ObjectID_t targetObjectID = pTargetCreature->getObjectID();								cList.push_back(pTargetCreature);								_GCSkillToTileOK1.addCListElement(targetObjectID);								_GCSkillToTileOK2.addCListElement(targetObjectID);								_GCSkillToTileOK5.addCListElement(targetObjectID);								// 老窜 嘎绰 仇捞 罐阑 菩哦篮 澄 惑怕肺 茄 盲肺, 单固瘤甫 霖促.								setDamage(pTargetCreature, Damage, pOusters, param.SkillType, NULL, &_GCSkillToTileOK1);								computeAlignmentChange(pTargetCreature, Damage, pOusters, NULL, &_GCSkillToTileOK1);								increaseAlignment(pOusters, pTargetCreature, _GCSkillToTileOK1);								// 农府萍拿 洒飘扼搁 惑措规阑 第肺 拱矾唱霸 茄促.								if (bCriticalHit || bForceKnockback)								{									knockbackCreature(pZone, pTargetCreature, pOusters->getX(), pOusters->getY());								}								// 惑措规捞 酒快胶磐令啊 酒匆 版快俊父 嘎冕 吧肺 埃林茄促. 								if (!pTargetCreature->isOusters())								{									bHit = true;								}								if (pTargetCreature->isDead())								{									int exp = computeCreatureExp(pTargetCreature, 100, pOusters);									shareOustersExp(pOusters, exp, _GCSkillToTileOK1);								}							}						}					} //for (; itr != objectList.end(); itr++) 				} // if (rect.ptInRect(tileX, tileY) && ...			} // for (int count=0; count<3; count++)			decreaseDurability(pOusters, NULL, pSkillInfo->getPoint(), &_GCSkillToTileOK1, NULL);			_GCSkillToTileOK1.setSkillType(param.SkillType);			_GCSkillToTileOK1.setCEffectID(CEffectID);			_GCSkillToTileOK1.setX(X);			_GCSkillToTileOK1.setY(Y);			_GCSkillToTileOK1.setRange(dir);			_GCSkillToTileOK1.setDuration(0);					_GCSkillToTileOK2.setObjectID(pOusters->getObjectID());			_GCSkillToTileOK2.setSkillType(param.SkillType);			_GCSkillToTileOK2.setX(X);			_GCSkillToTileOK2.setY(Y);			_GCSkillToTileOK2.setRange(dir);			_GCSkillToTileOK2.setDuration(0);					_GCSkillToTileOK5.setObjectID(pOusters->getObjectID());			_GCSkillToTileOK5.setSkillType(param.SkillType);			_GCSkillToTileOK5.setX(X);			_GCSkillToTileOK5.setY(Y);			_GCSkillToTileOK5.setRange(dir);			_GCSkillToTileOK5.setDuration(0);					pPlayer->sendPacket(&_GCSkillToTileOK1);					// 捞 扁贱俊 狼秦 康氢阑 罐绰 仇甸俊霸 菩哦阑 焊郴拎具 茄促.			for (list<Creature*>::const_iterator itr = cList.begin(); itr != cList.end(); itr++)			{				Creature * pTargetCreature = *itr;				Assert(pTargetCreature != NULL);				if (pTargetCreature->isPC())				{					_GCSkillToTileOK2.clearList();					// HP狼 函版荤亲阑 菩哦俊促 扁废茄促.					HP_t targetHP = 0;					if (pTargetCreature->isSlayer()) targetHP = (dynamic_cast<Slayer*>(pTargetCreature))->getHP(ATTR_CURRENT);					else if (pTargetCreature->isVampire()) targetHP = (dynamic_cast<Vampire*>(pTargetCreature))->getHP(ATTR_CURRENT);					else if (pTargetCreature->isOusters()) targetHP = (dynamic_cast<Ousters*>(pTargetCreature))->getHP(ATTR_CURRENT);					_GCSkillToTileOK2.addShortData(MODIFY_CURRENT_HP, targetHP);					// 酒捞袍狼 郴备仿阑 冻绢哆赴促.					decreaseDurability(NULL, pTargetCreature, pSkillInfo->getPoint(), NULL, &_GCSkillToTileOK2);					// 菩哦阑 焊郴霖促.					pTargetCreature->getPlayer()->sendPacket(&_GCSkillToTileOK2);				}				else if (pTargetCreature->isMonster())				{					// 寸辟 利栏肺 牢侥茄促.					Monster* pMonster = dynamic_cast<Monster*>(pTargetCreature);					pMonster->addEnemy(pOusters);				}			}			cList.push_back(pOusters);			pZone->broadcastPacket(myX, myY, &_GCSkillToTileOK5 , cList);			// set Next Run Time			pOustersSkillSlot->setRunTime(param.Delay);			result.bSuccess = true;		} 		else 		{			executeSkillFailNormal(pOusters, param.SkillType, NULL);		}	} 	catch (Throwable & t) 	{		executeSkillFailException(pOusters, param.SkillType);	}	__END_CATCH}void SimpleTileMeleeSkill::execute(Monster* pMonster, int X, int Y,	const SIMPLE_SKILL_INPUT& param,  SIMPLE_SKILL_OUTPUT& result,	CEffectID_t CEffectID, bool bForceKnockback) throw (Error){	__BEGIN_TRY	Assert(pMonster != NULL);	try 	{		Zone* pZone = pMonster->getZone();		Assert(pZone != NULL);		GCSkillToTileOK2 _GCSkillToTileOK2;		GCSkillToTileOK5 _GCSkillToTileOK5;		SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(param.SkillType);		bool bRangeCheck = verifyDistance(pMonster, X, Y, pSkillInfo->getRange());		// 付唱啊 乐绢具 窍绊, 矫埃苞 芭府 眉农俊 己傍窍绊,		if (bRangeCheck)		{			// 谅钎客 规氢阑 备茄促.			ZoneCoord_t myX          = pMonster->getX();			ZoneCoord_t myY          = pMonster->getY();				Dir_t       dir          = calcDirection(myX, myY, X, Y);			Damage_t    Damage       = 0;			Damage_t    MaxDamage    = 0;			bool        bCriticalHit = false;			VSRect rect(0, 0, pZone->getWidth()-1, pZone->getHeight()-1);			list<Creature*> cList;			list<TILE_MASK>::const_iterator itr = param.MaskList.begin();			for (; itr != param.MaskList.end(); itr++)			{				TILE_MASK mask = (*itr);				int tileX   = X + mask.x;				int tileY   = Y + mask.y;				int penalty = mask.penalty;				// 泅犁 鸥老捞 粮 郴何捞绊, 救傈瘤措啊 酒聪扼搁, 嘎阑 犬伏捞 乐促.				if (rect.ptInRect(tileX, tileY))				{					// 鸥老阑 罐酒柯促.					Tile& tile = pZone->getTile(tileX, tileY);					list<Creature*> targetList;					if (tile.hasCreature(Creature::MOVE_MODE_WALKING))					{						Creature* pCreature = tile.getCreature(Creature::MOVE_MODE_WALKING);						targetList.push_back(pCreature);					}					if (tile.hasCreature(Creature::MOVE_MODE_FLYING))					{						Creature* pCreature = tile.getCreature(Creature::MOVE_MODE_FLYING);						targetList.push_back(pCreature);					}					if (tile.hasCreature(Creature::MOVE_MODE_BURROWING))					{						Creature* pCreature = tile.getCreature(Creature::MOVE_MODE_BURROWING);						targetList.push_back(pCreature);					}					list<Creature*>::iterator itr = targetList.begin();					for(; itr != targetList.end(); itr++)					{						Creature* pTargetCreature = (*itr);						Assert(pTargetCreature != NULL);						// 傍拜 措惑捞 嘎绰瘤 犬牢茄促.						if (pMonster->isEnemyToAttack( pTargetCreature ))						{							bool bMoveModeCheck  = (pTargetCreature->getMoveMode() == Creature::MOVE_MODE_WALKING) ? true : false;							bool bRaceCheck      = pTargetCreature->isNPC();// || pTargetCreature->isMonster();							bool bHitRoll        = 0;							bool bCanHit         = canHit(pMonster, pTargetCreature, param.SkillType);							bool bPK             = verifyPK(pMonster, pTargetCreature);							bool bZoneLevelCheck = checkZoneLevelToHitTarget(pTargetCreature);							if (param.bMagicHitRoll)							{								bHitRoll = HitRoll::isSuccessMagic(pMonster, pSkillInfo);							}							else							{								bHitRoll = HitRoll::isSuccess(pMonster, pTargetCreature, 0);							}							// bMoveModeCheck 窍绰芭 咯扁辑绰 话促. 瘤窍俊 乐绰 仇甸档 嘎栏扼绊. 2003.10.27							if (!bRaceCheck && bHitRoll && bCanHit && bPK && bZoneLevelCheck)							{								CheckCrossCounter(pMonster, pTargetCreature, Damage, pSkillInfo->getRange());								bCriticalHit = false;								Damage       = 0;								if (param.bAdd)								{									Damage += computeDamage(pMonster, pTargetCreature, 0, bCriticalHit);								}								if (param.bMagicDamage)								{									Damage += computeMagicDamage(pTargetCreature, param.SkillDamage, param.SkillType);								}								else								{									Damage += param.SkillDamage;								}								MaxDamage = max(Damage, MaxDamage);								// 其澄萍绰 扁夯利栏肺 100捞促.								Damage = getPercentValue(Damage, penalty);								ObjectID_t targetObjectID = pTargetCreature->getObjectID();								cList.push_back(pTargetCreature);								_GCSkillToTileOK2.addCListElement(targetObjectID);								_GCSkillToTileOK5.addCListElement(targetObjectID);								// 老窜 嘎绰 仇捞 罐阑 菩哦篮 澄 惑怕肺 茄 盲肺, 单固瘤甫 霖促.								setDamage(pTargetCreature, Damage, pMonster, param.SkillType, NULL, NULL);								// 农府萍拿 洒飘扼搁 惑措规阑 第肺 拱矾唱霸 茄促.								// 吧绢促聪绰 仇甸父 knockback矫挪促.								if ( bMoveModeCheck && (bCriticalHit || bForceKnockback) )								{									knockbackCreature(pZone, pTargetCreature, pMonster->getX(), pMonster->getY());								}							}						}					} //for (; itr != objectList.end(); itr++) 				} // if (rect.ptInRect(tileX, tileY) && ...			} // for (int count=0; count<3; count++)			_GCSkillToTileOK2.setObjectID(pMonster->getObjectID());			_GCSkillToTileOK2.setSkillType(param.SkillType);			_GCSkillToTileOK2.setX(X);			_GCSkillToTileOK2.setY(Y);			_GCSkillToTileOK2.setRange(dir);			_GCSkillToTileOK2.setDuration(0);					_GCSkillToTileOK5.setObjectID(pMonster->getObjectID());			_GCSkillToTileOK5.setSkillType(param.SkillType);			_GCSkillToTileOK5.setX(X);			_GCSkillToTileOK5.setY(Y);			_GCSkillToTileOK5.setRange(dir);			_GCSkillToTileOK5.setDuration(0);					// 捞 扁贱俊 狼秦 康氢阑 罐绰 仇甸俊霸 菩哦阑 焊郴拎具 茄促.			for (list<Creature*>::const_iterator itr = cList.begin(); itr != cList.end(); itr++)			{				Creature * pTargetCreature = *itr;				Assert(pTargetCreature != NULL);				if (pTargetCreature->isPC())				{					_GCSkillToTileOK2.clearList();					// HP狼 函版荤亲阑 菩哦俊促 扁废茄促.					HP_t targetHP = 0;					if (pTargetCreature->isSlayer()) targetHP = (dynamic_cast<Slayer*>(pTargetCreature))->getHP(ATTR_CURRENT);					else if (pTargetCreature->isVampire()) targetHP = (dynamic_cast<Vampire*>(pTargetCreature))->getHP(ATTR_CURRENT);					else if (pTargetCreature->isOusters()) targetHP = (dynamic_cast<Ousters*>(pTargetCreature))->getHP(ATTR_CURRENT);					_GCSkillToTileOK2.addShortData(MODIFY_CURRENT_HP, targetHP);					// 酒捞袍狼 郴备仿阑 冻绢哆赴促.					decreaseDurability(NULL, pTargetCreature, pSkillInfo->getPoint(), NULL, &_GCSkillToTileOK2);					// 菩哦阑 焊郴霖促.					pTargetCreature->getPlayer()->sendPacket(&_GCSkillToTileOK2);				}				else if (pTargetCreature->isMonster())				{					// 寸辟 利栏肺 牢侥茄促.					Monster* pTargetMonster = dynamic_cast<Monster*>(pTargetCreature);					pTargetMonster->addEnemy(pMonster);				}			}			cList.push_back(pMonster);			pZone->broadcastPacket(myX, myY, &_GCSkillToTileOK5 , cList);			result.bSuccess = true;		} 		else 		{			executeSkillFailNormal(pMonster, param.SkillType, NULL);		}	} 	catch (Throwable & t) 	{		executeSkillFailException(pMonster, param.SkillType);	}	__END_CATCH}

⌨️ 快捷键说明

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