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

📄 ousters.cpp

📁 天之炼狱1服务器端源文件游戏服务端不完整
💻 CPP
📖 第 1 页 / 共 5 页
字号:
//////////////////////////////////////////////////////////////////////////////// Filename    : Ousters.cpp// Written By  : Elca// Description : //////////////////////////////////////////////////////////////////////////////#include "Ousters.h"#include "Player.h"#include "OptionInfo.h"#include "SkillInfo.h"#include "ItemLoaderManager.h"#include "EffectLoaderManager.h"#include "SkillParentInfo.h"#include "DB.h"#include "ItemInfoManager.h"#include "AbilityBalance.h"#include "Stash.h"#include "TradeManager.h"#include "CreatureUtil.h"#include "FlagSet.h"#include "OustersEXPInfo.h"#include "Party.h"#include "ItemUtil.h"#include "PacketUtil.h"#include "SkillUtil.h"#include "Shape.h"#include "GamePlayer.h"//#include "RankEXPInfo.h"#include "RankExpTable.h"#include "VariableManager.h"#include "WarSystem.h"#include "ResurrectLocationManager.h"#include "PKZoneInfoManager.h"#include "TimeLimitItemManager.h"#include <stdio.h>#include "item/AR.h"#include "item/SR.h"#include "item/SG.h"#include "item/SMG.h"#include "item/Belt.h"#include "item/Skull.h"#include "item/OustersWristlet.h"#include "item/OustersStone.h"#include "item/OustersArmsband.h"#include "skill/EffectBless.h"#include "skill/EffectParalyze.h"#include "skill/EffectDoom.h"#include "skill/EffectTransformToWolf.h"#include "skill/EffectTransformToBat.h"#include "EffectGrandMasterOusters.h"#include "RaceWarLimiter.h"#include "Gpackets/GCModifyInformation.h"#include "Gpackets/GCChangeShape.h"#include "Gpackets/GCSkillInfo.h"#include "Gpackets/GCRealWearingInfo.h"#include "Gpackets/GCStatusCurrentHP.h"#include "Gpackets/GCTakeOff.h"#include "Gpackets/GCOtherModifyInfo.h"#include "Gpackets/GCPetStashList.h"#include "MonsterInfo.h"#include "SystemAvailabilitiesManager.h"const Color_t UNIQUE_COLOR = 0xFFFF;const Color_t QUEST_COLOR = 0xFFFE;const Level_t MAX_OUSTERS_LEVEL = 150;//////////////////////////////////////////////////////////////////////////////// incraseOustersExp///////////////////////////////////////////////////////////////////////////////*void Ousters::increaseOustersExp(Exp_t Point){	if (Point <= 0) return;	Level_t curLevel = getLevel();	if (curLevel >= OUSTERS_MAX_LEVEL) 	{		// 饭骇 茄拌俊 档崔秦档 版氰摹绰 阶霸 秦霖促.		// by sigi. 2002.8.31		Exp_t NewExp = getExp() + Point;		WORD ExpSaveCount = getExpSaveCount();		if (ExpSaveCount > OUSTERS_EXP_SAVE_PERIOD)		{			char pField[80];			sprintf(pField, "Exp=%lu", NewExp);			tinysave(pField);			ExpSaveCount = 0;		}		else ExpSaveCount++;		setExpSaveCount(ExpSaveCount);		setExp( NewExp );		return;	}	Exp_t OldExp = getExp();	Exp_t OldGoalExp = getGoalExp();	Exp_t NewGoalExp = max(0, (int)(OldGoalExp - Point));	// 穿利 版氰摹俊绰 格钎 版氰摹啊 临绢电 父怒 敲矾胶 窍咯具 茄促.	Exp_t DiffGoalExp = max(0, (int)(OldGoalExp - NewGoalExp));	Exp_t NewExp = OldExp + DiffGoalExp;	setExp(NewExp);	setGoalExp(NewGoalExp);	// 格钎 版氰摹啊 0 捞扼搁 饭骇 诀捞促.	if (NewGoalExp == 0 && curLevel < OUSTERS_MAX_LEVEL)	{		curLevel++;		setLevel(curLevel);		// add bonus point		Bonus_t bonus = getBonus();		if ((getSTR(ATTR_BASIC) + getDEX(ATTR_BASIC) + getINT(ATTR_BASIC) + getBonus() - 45) < ((getLevel() - 1) * 3)) 		{			// 饭骇俊 惑包摹 臼绊, 公炼扒 3栏肺 函版登菌促.			// 2001.12.12 辫己刮			bonus += 3;		}		setBonus(bonus);		OustersEXPInfo* pBeforeExpInfo = g_pOustersEXPInfoManager->getOustersEXPInfo(curLevel-1);		OustersEXPInfo* pNextExpInfo = g_pOustersEXPInfoManager->getOustersEXPInfo(curLevel);		Exp_t NextGoalExp = pNextExpInfo->getGoalExp();		setGoalExp(NextGoalExp);		char pField[80];		sprintf(pField, "Level=%d, Exp=%u, GoalExp=%lu, Bonus=%d", 						curLevel, pBeforeExpInfo->getAccumExp(), NextGoalExp, bonus);		tinysave(pField);		setExpSaveCount(0);	}	else	{		// 林扁利栏肺 历厘茄促.		WORD ExpSaveCount = getExpSaveCount();		if (ExpSaveCount > OUSTERS_EXP_SAVE_PERIOD)		{			// by sigi. 2002.5.15			char pField[80];			sprintf(pField, "Exp=%lu, GoalExp=%lu", NewExp, NewGoalExp);			tinysave(pField);			ExpSaveCount = 0;		}		else ExpSaveCount++;		setExpSaveCount(ExpSaveCount);	}}*///////////////////////////////////////////////////////////////////////////////// increaseRankExp///////////////////////////////////////////////////////////////////////////////*void Ousters::increaseRankExp(RankExp_t Point){	if (Point <= 0) return;	// PK粮 救俊辑绰 版氰摹甫 林瘤 臼绰促.	if ( g_pPKZoneInfoManager->isPKZone( getZoneID() ) )		return;	Rank_t curRank = getRank();	if (curRank >= OUSTERS_MAX_RANK)	{		// 饭骇 茄拌俊 档崔秦档 版氰摹绰 阶霸 秦霖促.		// by sigi. 2002.8.31		Exp_t NewExp = getRankExp() + Point;		WORD ExpSaveCount = getRankExpSaveCount();		if (ExpSaveCount > RANK_EXP_SAVE_PERIOD)		{			char pField[80];			sprintf(pField, "RankExp=%lu", NewExp);			tinysave(pField);			ExpSaveCount = 0;		}		else ExpSaveCount++;		setRankExpSaveCount(ExpSaveCount);		setRankExp( NewExp );		return;	}	Exp_t OldExp = getRankExp();	Exp_t OldGoalExp = getRankGoalExp();	Exp_t NewGoalExp = max(0, (int)(OldGoalExp - Point));	// 穿利 版氰摹俊绰 格钎 版氰摹啊 临绢电 父怒 敲矾胶 窍咯具 茄促.	Exp_t DiffGoalExp = max(0, (int)(OldGoalExp - NewGoalExp));	Exp_t NewExp = OldExp + DiffGoalExp;	// 格钎 版氰摹啊 0 捞扼搁 饭骇 诀捞促.	if (NewGoalExp == 0 && curRank < OUSTERS_MAX_RANK)	{		OUSTERS_RECORD prev;		getOustersRecord(prev);		curRank++;		setRank(curRank);		setRankExp(NewExp);		setRankGoalExp(NewGoalExp);		RankEXPInfo* pBeforeExpInfo = g_pRankEXPInfoManager[RANK_TYPE_OUSTERS]->getRankEXPInfo(curRank-1);		RankEXPInfo* pNextExpInfo = g_pRankEXPInfoManager[RANK_TYPE_OUSTERS]->getRankEXPInfo(curRank);		Exp_t NextGoalExp = pNextExpInfo->getGoalExp();		setRankGoalExp(NextGoalExp);		char pField[80];		sprintf(pField, "Rank=%d, RankExp=%u, RankGoalExp=%lu",						curRank, pBeforeExpInfo->getAccumExp(), NextGoalExp);		tinysave(pField);		setRankExpSaveCount(0);		sendModifyInfo(prev);		if (m_pZone != NULL)		{			GCOtherModifyInfo gcOtherModifyInfo;			gcOtherModifyInfo.setObjectID(getObjectID());			gcOtherModifyInfo.addShortData(MODIFY_RANK, curRank);			m_pZone->broadcastPacket(m_X, m_Y, &gcOtherModifyInfo, this);		}	}	else	{		setRankExp(NewExp);		setRankGoalExp(NewGoalExp);		// 林扁利栏肺 历厘茄促.		WORD rankExpSaveCount = getRankExpSaveCount();		if (rankExpSaveCount > RANK_EXP_SAVE_PERIOD)		{			char pField[80];			sprintf(pField, "RankExp=%lu, RankGoalExp=%lu", NewExp, NewGoalExp);			tinysave(pField);			rankExpSaveCount = 0;		}		else rankExpSaveCount++;		setRankExpSaveCount(rankExpSaveCount);		// 拌鞭 版氰摹甫 焊郴霖促. by sigi. 2002.9.13		GCModifyInformation gcModifyInformation;		gcModifyInformation.addLongData(MODIFY_RANK_EXP, NewExp);		m_pPlayer->sendPacket(&gcModifyInformation);	}}*/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Ousters::Ousters () 	throw () : PlayerCreature(0, NULL){	__BEGIN_TRY	m_CClass = CREATURE_CLASS_OUSTERS;	m_Mutex.setName("Ousters");	// AttackMelee 鞍篮 扁夯 傍拜阑 笼绢持绢霖促.	for (int i=0; i<SKILL_DOUBLE_IMPACT; i++)	{		OustersSkillSlot* pOustersSkillSlot = new OustersSkillSlot;		pOustersSkillSlot->setName(m_Name);		pOustersSkillSlot->setSkillType(i);		pOustersSkillSlot->setInterval(5);		pOustersSkillSlot->setRunTime();		addSkill(pOustersSkillSlot);	}	//////////////////////////////////////	// 扁夯 胶懦	//////////////////////////////////////	{		OustersSkillSlot* pOustersSkillSlot = new OustersSkillSlot;		pOustersSkillSlot->setName(m_Name);		pOustersSkillSlot->setSkillType(SKILL_ABSORB_SOUL);		pOustersSkillSlot->setExpLevel(1);		pOustersSkillSlot->setInterval(5);		pOustersSkillSlot->setRunTime();		addSkill(pOustersSkillSlot);	}	{		OustersSkillSlot* pOustersSkillSlot = new OustersSkillSlot;		pOustersSkillSlot->setName(m_Name);		pOustersSkillSlot->setSkillType(SKILL_SUMMON_SYLPH);		pOustersSkillSlot->setExpLevel(1);		pOustersSkillSlot->setInterval(5);		pOustersSkillSlot->setRunTime();		addSkill(pOustersSkillSlot);	}    for (int i = 0; i < OUSTERS_WEAR_MAX; i++)         m_pWearItem[i] = NULL;	getCurrentTime(m_MPRegenTime);	// 版氰摹 技捞宏 墨款飘 檬扁拳//	m_RankExpSaveCount		= 0;	m_ExpSaveCount			= 0;	m_FameSaveCount			= 0;	m_AlignmentSaveCount	= 0;	__END_CATCH}Ousters::~Ousters()     throw (Error){	__BEGIN_TRY	// 汗厘 沥焊甫 积己秦敌促. by sigi. 2002.6.18	char pField[128];	sprintf(pField, "CoatType=%d,ArmType=%d,CoatColor=%d,ArmColor=%d,BootsColor=%d",					m_OustersInfo.getCoatType(),					m_OustersInfo.getArmType(),					m_OustersInfo.getCoatColor(),					m_OustersInfo.getArmColor(),					m_OustersInfo.getBootsColor() );	tinysave(pField);	// 冻绢柳 酒捞袍狼 郴备己苞 版氰摹, 己氢 殿阑 历厘茄促.	saveGears();	saveExps();	saveSkills();	// 涝绊 乐绰 酒捞袍阑 皋葛府俊辑 昏力茄促.	destroyGears();	// 努贰胶啊 昏力瞪 版快, 秦寸窍绰 背券 沥焊甫 昏力秦具 窃篮 拱沸,	// 背券 惑措俊霸档 捞 荤角阑 舅妨拎具 茄促.	TradeManager* pTradeManager = m_pZone->getTradeManager();	TradeInfo* pInfo = pTradeManager->getTradeInfo(getName());	if (pInfo != NULL)	{		// 背券 沥焊甫 昏力		pTradeManager->cancelTrade(this);	}	// 臂肺国 颇萍 沥焊甫 昏力茄促. 	// 老馆利牢 肺弊酒眶狼 版快俊绰	// CGLogoutHandler俊辑 Zone::deleteCreature() 窃荐甫 何福霸 登绊,	// 厚沥惑利牢 版快扼绊 秦档, 	// GamePlayer::disconnect()俊辑 Zone::deleteCreature() 窃荐甫 何福霸 登骨肺,	// 肺拿 颇萍 棺 颇萍 檬措, 飘饭捞靛 沥焊甫 捌沥且 鞘夸绰 绝促.	deleteAllPartyInfo(this);	// 扁贱甸阑 昏力	hash_map<SkillType_t, OustersSkillSlot*>::iterator itr = m_SkillSlot.begin();	for (; itr != m_SkillSlot.end(); itr++)	{		OustersSkillSlot* pOustersSkillSlot = itr->second;		SAFE_DELETE(pOustersSkillSlot);	}	__END_CATCH}// registerObject// Zone俊 辆加等 ObjectRegistry甫 荤侩秦辑, Ousters 客 家蜡酒捞袍甸狼// ObjectID甫 且寸罐绰促.void Ousters::registerObject ()    throw (Error){    __BEGIN_TRY    Assert(getZone() != NULL);    // zone 狼 object registery 俊 立辟茄促.    ObjectRegistry & OR = getZone()->getObjectRegistry();    __ENTER_CRITICAL_SECTION(OR)	// 葛电 酒捞袍俊 OID 啊 官差骨肺 矫埃力茄 酒捞袍 概聪历俊辑 OID 甘阑 瘤况拎具 茄促.	if (m_pTimeLimitItemManager != NULL)		m_pTimeLimitItemManager->clear();	// 快急 酒快胶磐胶狼 OID甫 殿废罐绰促.	OR.registerObject_NOLOCKED(this);	// 牢亥配府狼 酒捞袍甸狼 OID甫 殿废罐绰促.	registerInventory(OR);	// Goods Inventory狼 酒捞袍甸狼 OID甫 殿废罐绰促.	registerGoodsInventory(OR);	// 厘馒窍绊 乐绰 酒捞袍甸狼 OID甫 殿废罐绰促.	for (int i = 0; i < OUSTERS_WEAR_MAX; i++) 	{		Item* pItem = m_pWearItem[i];		if (pItem != NULL) 		{			bool bCheck = true;			// 剧颊 公扁老 版快, WEAR_LEFTHAND 俊辑 殿废沁栏骨肺,			// 肚 殿废且 鞘夸绰 绝促.			if (i == WEAR_RIGHTHAND && isTwohandWeapon(pItem))				bCheck = false;			if (bCheck) registerItem(pItem, OR);		}	}	// 付快胶俊 甸绊 乐绰 酒捞袍狼 OID甫 殿废 罐绰促.	Item* pSlotItem = m_pExtraInventorySlot->getItem();	if (pSlotItem != NULL) registerItem(pSlotItem, OR);	m_Garbage.registerObject(OR);	for ( int i=0; i<MAX_PET_STASH; ++i )	{		Item* pItem = getPetStashItem(i);		if ( pItem != NULL ) registerItem( pItem, OR );	}    __LEAVE_CRITICAL_SECTION(OR)	m_OustersInfo.setObjectID(m_ObjectID);    __END_CATCH}// Zone俊 辆加等 ObjectRegistry甫 荤侩秦辑, Ousters 客 家蜡酒捞袍甸狼// ObjectID甫 且寸罐绰促. ItemTrace 甫 巢辨瘤 咯何 搬沥阑 困秦 蝶肺 话促void Ousters::registerInitObject ()    throw (Error){    __BEGIN_TRY    Assert(getZone() != NULL);    // zone 狼 object registery 俊 立辟茄促.    ObjectRegistry & OR = getZone()->getObjectRegistry();    __ENTER_CRITICAL_SECTION(OR)	// 葛电 酒捞袍俊 OID 啊 官差骨肺 矫埃力茄 酒捞袍 概聪历俊辑 OID 甘阑 瘤况拎具 茄促.	if (m_pTimeLimitItemManager != NULL)		m_pTimeLimitItemManager->clear();	// 快急 酒快胶磐胶狼 OID甫 殿废罐绰促.	OR.registerObject_NOLOCKED(this);

⌨️ 快捷键说明

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