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

📄 zone.cpp

📁 天之炼狱1服务器端源文件游戏服务端不完整
💻 CPP
📖 第 1 页 / 共 5 页
字号:
//////////////////////////////////////////////////////////////////////////////// FileName 	: Zone.cpp// WrittenBy	:// Description	://////////////////////////////////////////////////////////////////////////////#include "Zone.h"#include <stdio.h>#include <string.h>#include "Assert.h"#include "LogClient.h"#include "ZoneGroup.h"#include "ZoneInfo.h"#include "ZoneInfoManager.h"#include "PCManager.h"#include "NPCManager.h"#include "MonsterManager.h"#include "MasterLairInfoManager.h"#include "MasterLairManager.h"#include "WarScheduler.h"#include "WarSystem.h"#include "War.h"#include "QuestManager.h"#include "VisionInfo.h"//#include "EventMonsterManager.h"#include "EffectManager.h"#include "EffectSchedule.h"#include "NPCInfo.h"#include "WeatherManager.h"#include "Creature.h"#include "Item.h"#include "ItemInfo.h"#include "DarkLightInfo.h"#include "DB.h"#include "Slayer.h"#include "Vampire.h"#include "Ousters.h"#include "Monster.h"#include "NPC.h"#include "Player.h"#include "Properties.h"#include "ZoneUtil.h"#include "PacketUtil.h"#include "Party.h"#include "TradeManager.h"#include "ParkingCenter.h"#include "Relic.h"#include "ItemFactoryManager.h"#include "CombatInfoManager.h"#include "PaySystem.h"#include "GamePlayer.h"#include "VariableManager.h"#include "CastleInfoManager.h"#include "RelicUtil.h"#include "HolyLandManager.h"#include "BloodBibleBonusManager.h"#include "ShrineInfoManager.h"#include "TimeManager.h"#include "PKZoneInfoManager.h"#include "StringPool.h"#include "FlagSet.h"#include "PCFinder.h"#include "DefaultOptionSetInfo.h"#include "LevelWarZoneInfoManager.h"#include "SweeperBonusManager.h"#include "ctf/FlagManager.h"#include "RegenZoneManager.h"#include <fstream>#include <math.h>#include "EffectDarkness.h"#include "EffectVampirePortal.h"#include "SlayerCorpse.h"#include "VampireCorpse.h"#include "OustersCorpse.h"#include "MonsterCorpse.h"#include "EffectLoaderManager.h"#include "EffectDecayCorpse.h"#include "EffectDecayItem.h"//#include "EffectRevealer.h"#include "EffectObservingEye.h"#include "EffectGnomesWhisper.h"#include "EffectDecayMotorcycle.h"#include "EffectCallMotorcycle.h"#include "EffectAddItem.h"#include "EffectDeleteItem.h"#include "EffectTransportItem.h"#include "EffectSanctuary.h"#include "EffectRelicTable.h"#include "EffectHasSlayerRelic.h"#include "EffectHasVampireRelic.h"#include "EffectVampireRelic.h"#include "EffectSlayerRelic.h"#include "EffectHasBloodBible.h"#include "EffectShrineGuard.h"#include "EffectShrineHoly.h"#include "EffectShrineShield.h"#include "EffectAddItemToCorpse.h"#include "EffectTransportItemToCorpse.h"//#include "EffectDropBloodBible.h"#include "EffectHasCastleSymbol.h"#include "EffectPKZoneRegen.h"#include "EffectContinualGroundAttack.h"#include "EventTransport.h"#include "Gpackets/GCAddBurrowingCreature.h"#include "Gpackets/GCAddVampireFromTransformation.h"#include "Gpackets/GCAddMonsterFromTransformation.h"#include "Gpackets/GCUntransformOK.h"#include "Gpackets/GCUntransformFail.h"#include "Gpackets/GCAddVampireFromBurrowing.h"#include "Gpackets/GCAddMonsterFromBurrowing.h"#include "Gpackets/GCAddWolf.h"#include "Gpackets/GCAddBat.h"#include "Gpackets/GCAddSlayerCorpse.h"#include "Gpackets/GCAddVampireCorpse.h"#include "Gpackets/GCAddOustersCorpse.h"#include "Gpackets/GCAddMonsterCorpse.h"#include "Gpackets/GCAddEffectToTile.h"#include "Gpackets/GCAddVampirePortal.h"#include "Gpackets/GCDeleteEffectFromTile.h"#include "Gpackets/GCMineExplosionOK1.h"#include "Gpackets/GCMineExplosionOK2.h"#include "Gpackets/GCAddInstalledMineToZone.h"#include "Gpackets/GCModifyInformation.h"#include "Gpackets/GCSystemMessage.h"#include "Gpackets/GCFastMove.h"#include "Gpackets/GCMove.h"#include "Gpackets/GCMoveOK.h"#include "Gpackets/GCMoveError.h"#include "Gpackets/GCAddMonster.h"#include "Gpackets/GCAddNewItemToZone.h"#include "Gpackets/GCDropItemToZone.h"#include "Gpackets/GCAddNPC.h"#include "Gpackets/GCAddSlayer.h"#include "Gpackets/GCAddVampire.h"#include "Gpackets/GCAddOusters.h"#include "Gpackets/GCDeleteObject.h"#include "Gpackets/GCSetPosition.h"#include "Gpackets/GCUnburrowOK.h"#include "Gpackets/GCUnburrowFail.h"#include "Gpackets/GCRemoveEffect.h"#include "Gpackets/GCAddEffect.h"#include "Gpackets/GCKnockBack.h"#include "Gpackets/GCNoticeEvent.h"#include "Gpackets/GCNPCInfo.h"#include "Gpackets/GCHolyLandBonusInfo.h"#include "Gpackets/GCSweeperBonusInfo.h"#include "Gpackets/GCRegenZoneStatus.h"//#include "Gpackets/CGItemNameInfoList.h"#include "item/VampirePortalItem.h"#include "item/Motorcycle.h"#include "Profile.h"#include "ResurrectLocationManager.h"#include "LevelWarManager.h"// by sigi.  2002.12.30//#define __PROFILE_BROADCAST__#ifdef __PROFILE_BROADCAST__	#define __BEGIN_PROFILE_ZONE(name)	beginProfileEx(name);	#define __END_PROFILE_ZONE(name)	endProfileEx(name);#else	#define __BEGIN_PROFILE_ZONE(name)	((void)0);	#define __END_PROFILE_ZONE(name)	((void)0);#endif// 付胶磐 饭绢俊辑 矫眉/酒捞袍捞 官蹿俊辑 荤扼瘤绰 矫埃const Turn_t DELAY_MASTER_LAIR_DECAY_CORPSE 		= 200;	// 20檬const Turn_t DELAY_MASTER_LAIR_DECAY_ITEM   		= 400;	// 40檬const Turn_t DELAY_MASTER_LAIR_DECAY_MASTER_CORPSE 	= 50;	// 5檬int g_FastMoveSearchX[8][4] ={	{ 0, 1, 1, 1 },     // LEFT	{ 0, 1, 0, 1 },   // LEFTDOWN	{ 0, 0, -1, 1 },    // DOWN	{ 0, -1, 0, -1 },   // RIGHTDOWN	{ 0, -1, -1, -1 },  // RIGHT	{ 0, -1, 0, -1 },   // RIGHTUP	{ 0, 0, -1, 1 },    // UP	{ 0, 1, 0, 1 },     // LEFTUP};int g_FastMoveSearchY[8][4] ={	{ 0, 0, -1, 1 },    // LEFT	{ 0, -1, -1, 0 },   // LEFTDOWN	{ 0, -1, -1, -1 },  // DOWN	{ 0, -1, -1, 0 },   // RIGHTDOWN	{ 0, 0, -1, 1 },    // RIGHT	{ 0, 1, 1, 0 },     // RIGHTUP	{ 0, 1, 1, 1 },     // UP	{ 0, 1, 1, 0 },     // LEFTUP};voidstrlwr(char* str){	while (*str!='\0')	{		*str = tolower( *str );		str ++;	}}//////////////////////////////////////////////////////////////////////////////// 老馆利牢 阁胶磐甸捞 利栏肺 牢侥窍蠢衬 付蠢衬 窍绰 窃荐//////////////////////////////////////////////////////////////////////////////bool isPotentialEnemy(Monster* pMonster, Creature* pCreature){	Assert(pCreature != NULL);	// 泅犁肺辑绰 浇饭捞绢唱 酒快胶磐胶绰 公炼扒 利捞促. 	if (pCreature->isSlayer()) return true;	if (pCreature->isOusters())	{		Ousters* pOusters = dynamic_cast<Ousters*>(pCreature);		if ( (pOusters->getLevel() + 10) <= pMonster->getLevel() ) return true;		if ( pOusters->getLevel() > 10 ) return true;	}	else if (pCreature->isVampire())	{		Vampire* pVampire = dynamic_cast<Vampire*>(pCreature);		// 阁胶磐狼 饭骇捞 轨颇捞绢狼 饭骇焊促 10饭骇 捞惑 臭阑 版快,		// 利栏肺 牢侥茄促.		if ((pVampire->getLevel() + 10) <= pMonster->getLevel())		{			return true;		}		// 10饭骇 捞惑牢 轨颇捞绢绰 利捞促.		if (pVampire->getLevel() > 10)		{			return true;		}	}	else if (pCreature->isMonster())	{		Monster* pOtherMonster = dynamic_cast<Monster*>(pCreature);		return pMonster->isFlag(Effect::EFFECT_CLASS_HALLUCINATION) || pMonster->getClanType()!=pOtherMonster->getClanType();	}	return false;}//////////////////////////////////////////////////////////////////////////////// STL find_if 舅绊府硫阑 捞侩窍扁 困茄 厚背 努贰胶//////////////////////////////////////////////////////////////////////////////class isSameCreature {public:	isSameCreature(Creature* pCreature) : m_Creature(pCreature) {}	bool operator () (Creature* pCreature) throw ()	{		return pCreature->getName() == m_Creature->getName();	}	private :	Creature* m_Creature;};list<Packet*> * getRelicEffectPacket( MonsterCorpse* pMonsterCorpse, Effect::EffectClass EClass, list<Packet*> * pPackets ){	if (pMonsterCorpse->isFlag(EClass))	{		Effect* pEffect = pMonsterCorpse->getEffectManager().findEffect( EClass );		if ( pEffect == NULL ) cout << (int)EClass << endl;		Assert(pEffect!=NULL);		GCAddEffect* pPacket = new GCAddEffect;		pPacket->setObjectID( pMonsterCorpse->getObjectID() );		pPacket->setEffectID( pEffect->getSendEffectClass() );		pPacket->setDuration( pEffect->getRemainDuration() );		if (pPackets==NULL) pPackets = new list<Packet*>;		pPackets->push_back( pPacket );	}	return pPackets;}//////////////////////////////////////////////////////////////////////////////// sendRelicEffect( MonsterCorpse* )//////////////////////////////////////////////////////////////////////////////// pMonsterCorpse俊 嘿篮 Effect甫 pPlayer俊霸 焊辰促.//////////////////////////////////////////////////////////////////////////////list<Packet*> *createRelicEffect( MonsterCorpse* pMonsterCorpse ){	list<Packet*>* pPackets = NULL;	if (pMonsterCorpse->isFlag(Effect::EFFECT_CLASS_SLAYER_RELIC))	{		GCAddEffect* pPacket = new GCAddEffect;		pPacket->setObjectID( pMonsterCorpse->getObjectID() );		pPacket->setEffectID(Effect::EFFECT_CLASS_SLAYER_RELIC);		pPacket->setDuration(65000);		if (pPackets==NULL) pPackets = new list<Packet*>;		pPackets->push_back( pPacket );	}	if (pMonsterCorpse->isFlag(Effect::EFFECT_CLASS_VAMPIRE_RELIC))	{		GCAddEffect* pPacket = new GCAddEffect;		pPacket->setObjectID( pMonsterCorpse->getObjectID() );		pPacket->setEffectID(Effect::EFFECT_CLASS_VAMPIRE_RELIC);		pPacket->setDuration(65000);		if (pPackets==NULL) pPackets = new list<Packet*>;		pPackets->push_back( pPacket );	}	Effect::EffectClass EClass = Effect::EFFECT_CLASS_SHRINE_GUARD;	if (pMonsterCorpse->isFlag(EClass))	{		Effect* pEffect = pMonsterCorpse->getEffectManager().findEffect( EClass );		Assert(pEffect!=NULL);		EffectShrineGuard* pEffectShrineGuard = dynamic_cast<EffectShrineGuard*>(pEffect);		Assert(pEffectShrineGuard!=NULL);		GCAddEffect* pPacket = new GCAddEffect;		pPacket->setObjectID( pMonsterCorpse->getObjectID() );		pPacket->setEffectID(EClass + pEffectShrineGuard->getShrineID());		pPacket->setDuration(65000);		if (pPackets==NULL) pPackets = new list<Packet*>;		pPackets->push_back( pPacket );	}	EClass = Effect::EFFECT_CLASS_SHRINE_HOLY;	if (pMonsterCorpse->isFlag(EClass))	{		Effect* pEffect = pMonsterCorpse->getEffectManager().findEffect( EClass );		Assert(pEffect!=NULL);		EffectShrineHoly* pEffectShrineHoly = dynamic_cast<EffectShrineHoly*>(pEffect);		Assert(pEffectShrineHoly!=NULL);		GCAddEffect* pPacket = new GCAddEffect;		pPacket->setObjectID( pMonsterCorpse->getObjectID() );		pPacket->setEffectID(EClass + pEffectShrineHoly->getShrineID());		pPacket->setDuration(65000);		if (pPackets==NULL) pPackets = new list<Packet*>;		pPackets->push_back( pPacket );	}	EClass = Effect::EFFECT_CLASS_SHRINE_SHIELD;	if (pMonsterCorpse->isFlag(EClass))	{		Effect* pEffect = pMonsterCorpse->getEffectManager().findEffect( EClass );		Assert(pEffect!=NULL);		EffectShrineShield* pEffectShrineShield = dynamic_cast<EffectShrineShield*>(pEffect);		Assert(pEffectShrineShield!=NULL);		GCAddEffect* pPacket = new GCAddEffect;		pPacket->setObjectID( pMonsterCorpse->getObjectID() );		pPacket->setEffectID(EClass);		pPacket->setDuration(65000);		if (pPackets==NULL) pPackets = new list<Packet*>;		pPackets->push_back( pPacket );	}	EClass = Effect::EFFECT_CLASS_HAS_BLOOD_BIBLE;	if (pMonsterCorpse->isFlag(EClass))	{		Effect* pEffect = pMonsterCorpse->getEffectManager().findEffect( EClass );		Assert(pEffect!=NULL);		EffectHasBloodBible* pEffectHasBloodBible = dynamic_cast<EffectHasBloodBible*>(pEffect);		Assert(pEffectHasBloodBible!=NULL);		GCAddEffect* pPacket = new GCAddEffect;		pPacket->setObjectID( pMonsterCorpse->getObjectID() );		pPacket->setEffectID( pEffectHasBloodBible->getSendEffectClass() );		pPacket->setDuration(65000);		if (pPackets==NULL) pPackets = new list<Packet*>;		pPackets->push_back( pPacket );	}	EClass = Effect::EFFECT_CLASS_HAS_CASTLE_SYMBOL;	if (pMonsterCorpse->isFlag(EClass))	{		Effect* pEffect = pMonsterCorpse->getEffectManager().findEffect( EClass );		Assert(pEffect!=NULL);		EffectHasCastleSymbol* pEffectHasCastleSymbol = dynamic_cast<EffectHasCastleSymbol*>(pEffect);		Assert(pEffectHasCastleSymbol!=NULL);		GCAddEffect* pPacket = new GCAddEffect;		pPacket->setObjectID( pMonsterCorpse->getObjectID() );		pPacket->setEffectID( pEffectHasCastleSymbol->getSendEffectClass() );		pPacket->setDuration(65000);		if (pPackets==NULL) pPackets = new list<Packet*>;		pPackets->push_back( pPacket );	}	EClass = Effect::EFFECT_CLASS_FLAG_INSERT;	if (pMonsterCorpse->isFlag(EClass))	{		Effect* pEffect = pMonsterCorpse->getEffectManager().findEffect( EClass );		Assert(pEffect!=NULL);		GCAddEffect* pPacket = new GCAddEffect;		pPacket->setObjectID( pMonsterCorpse->getObjectID() );		pPacket->setEffectID( pEffect->getSendEffectClass() );		pPacket->setDuration(65000);		if (pPackets==NULL) pPackets = new list<Packet*>;		pPackets->push_back( pPacket );	}	EClass = Effect::EFFECT_CLASS_KEEP_SWEEPER;	if (pMonsterCorpse->isFlag(EClass))	{		Effect* pEffect = pMonsterCorpse->getEffectManager().findEffect( EClass );		Assert(pEffect!=NULL);		GCAddEffect* pPacket = new GCAddEffect;		pPacket->setObjectID( pMonsterCorpse->getObjectID() );

⌨️ 快捷键说明

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