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

📄 slayer.cpp

📁 天之炼狱1服务器端源文件游戏服务端不完整
💻 CPP
📖 第 1 页 / 共 5 页
字号:
			}			addSkill(pSkillSlot);		}		SAFE_DELETE(pStmt);	} 	END_DB(pStmt)	// 捞棋飘甫 肺爹茄促.	g_pEffectLoaderManager->load(this);	// Rank Bonus 甫 肺爹茄促.	loadRankBonus();	// GrandMaster牢 版快绰 Effect甫 嘿咯霖促.	// by sigi. 2002.11.8	if (getHighestSkillDomainLevel()>=100		&& SystemAvailabilitiesManager::getInstance()->isAvailable( SystemAvailabilitiesManager::SYSTEM_GRAND_MASTER_EFFECT ) )	{		if (!isFlag(Effect::EFFECT_CLASS_GRAND_MASTER_SLAYER))		{			EffectGrandMasterSlayer* pEffect = new EffectGrandMasterSlayer(this);			pEffect->setDeadline(999999);			getEffectManager()->addEffect( pEffect );			setFlag(Effect::EFFECT_CLASS_GRAND_MASTER_SLAYER);		}	}	// 敲贰弊 悸阑 肺靛茄促.	m_pFlagSet->load(getName());	// Slayer Outlook Information 阑 备己茄促.	m_SlayerInfo.setHelmetType(HELMET_NONE);	m_SlayerInfo.setJacketType(JACKET_BASIC);	m_SlayerInfo.setPantsType(PANTS_BASIC);	m_SlayerInfo.setWeaponType(WEAPON_NONE); 	m_SlayerInfo.setShieldType(SHIELD_NONE); 	m_SlayerInfo.setMotorcycleType(MOTORCYCLE_NONE);    m_SlayerInfo.setHairColor(m_HairColor);    m_SlayerInfo.setSkinColor(m_SkinColor);	// 肋给等 版氰摹甫 犁炼沥 秦霖促./*	STRBalanceInfo* pSTRInfo = g_pSTRBalanceInfoManager->getSTRBalanceInfo(m_STR[ATTR_BASIC]);	if (pSTRInfo->getAccumExp() != m_STRExp + m_STRGoalExp) 	{		//ofstream file("瓷仿摹炼沥.txt", ios::out | ios::app);		//file << "NAME:" << m_Name << endl;		//file << "==STR==" << endl;		//file << "泅犁饭骇狼醚版氰摹 : " << (int)pSTRInfo->getAccumExp() << endl;		//file << "泅犁 穿利 版氰摹 : " << (int)m_STRExp << endl;		//file << "泅犁 格钎 版氰摹 : " << (int)m_STRGoalExp << endl;		//file << endl;		// 泅犁 格钎 版氰摹啊 泅犁 饭骇狼 格钎 版氰摹 焊促 农促搁, 犁 汲沥 秦霖促.		if (m_STRGoalExp > pSTRInfo->getGoalExp()) 		{			m_STRGoalExp = pSTRInfo->getGoalExp();		}		// 捞傈 饭骇狼 牢器甫 罐酒柯促.		STRBalanceInfo* pBeforeSTRInfo = g_pSTRBalanceInfoManager->getSTRBalanceInfo(m_STR[ATTR_BASIC] - 1);		// 捞傈 饭骇狼 醚 版氰摹 + 格钎 版氰摹 函拳樊 = 泅犁 穿利 版氰摹		m_STRExp = pBeforeSTRInfo->getAccumExp() + (pSTRInfo->getGoalExp() - m_STRGoalExp);		//file << "荐沥等 穿利 版氰摹 : " << (int)m_STRExp << endl;		//file << "荐沥等 格钎 版氰摹 : " << (int)m_STRGoalExp << endl;//		StringStream attrsave;//		attrsave << "STRExp = " << (int)m_STRExp << ", STRGoalExp = " << (int)m_STRGoalExp;//		tinysave(attrsave.toString());		// by sigi. 2002.5.15		char pField[80];		sprintf(pField, "STRExp=%lu, STRGoalExp=%lu", m_STRExp, m_STRGoalExp);		tinysave(pField);				//file.close();	}	// 肋给等 版氰摹甫 犁炼沥 秦霖促.	DEXBalanceInfo* pDEXInfo = g_pDEXBalanceInfoManager->getDEXBalanceInfo(m_DEX[ATTR_BASIC]);	if (pDEXInfo->getAccumExp() != m_DEXExp + m_DEXGoalExp) 	{		//ofstream file("瓷仿摹炼沥.txt", ios::out | ios::app);		//file << "NAME:" << m_Name << endl;		//file << "==DEX==" << endl;		//file << "泅犁饭骇狼醚版氰摹 : " << (int)pDEXInfo->getAccumExp() << endl;		//file << "泅犁 穿利 版氰摹 : " << (int)m_DEXExp << endl;		//file << "泅犁 格钎 版氰摹 : " << (int)m_DEXGoalExp << endl;		//file << endl;		// 泅犁 格钎 版氰摹啊 泅犁 饭骇狼 格钎 版氰摹 焊促 农促搁, 犁 汲沥 秦霖促.		if (m_DEXGoalExp > pDEXInfo->getGoalExp()) 		{			m_DEXGoalExp = pDEXInfo->getGoalExp();		}		// 捞傈 饭骇狼 牢器甫 罐酒柯促.		DEXBalanceInfo* pBeforeDEXInfo = g_pDEXBalanceInfoManager->getDEXBalanceInfo(m_DEX[ATTR_BASIC] - 1);		// 捞傈 饭骇狼 醚 版氰摹 + 格钎 版氰摹 函拳樊 = 泅犁 穿利 版氰摹		m_DEXExp = pBeforeDEXInfo->getAccumExp() + (pDEXInfo->getGoalExp() - m_DEXGoalExp);		//file << "荐沥等 穿利 版氰摹 : " << (int)m_DEXExp << endl;		//file << "荐沥等 格钎 版氰摹 : " << (int)m_DEXGoalExp << endl;//		StringStream attrsave;//		attrsave << "DEXExp = " << (int)m_DEXExp << ", DEXGoalExp = " << (int)m_DEXGoalExp;//		tinysave(attrsave.toString());		// by sigi. 2002.5.15		char pField[80];		sprintf(pField, "DEXExp=%lu, DEXGoalExp=%lu", m_DEXExp, m_DEXGoalExp);		tinysave(pField);				//file.close();	}	// 肋给等 版氰摹甫 犁炼沥 秦霖促.	INTBalanceInfo* pINTInfo = g_pINTBalanceInfoManager->getINTBalanceInfo(m_INT[ATTR_BASIC]);	if (pINTInfo->getAccumExp() != m_INTExp + m_INTGoalExp) 	{		//ofstream file("瓷仿摹炼沥.txt", ios::out | ios::app);		//file << "NAME:" << m_Name << endl;		//file << "==INT==" << endl;		//file << "泅犁饭骇狼醚版氰摹 : " << (int)pINTInfo->getAccumExp() << endl;		//file << "泅犁 穿利 版氰摹 : " << (int)m_INTExp << endl;		//file << "泅犁 格钎 版氰摹 : " << (int)m_INTGoalExp << endl;		//file << endl;		// 泅犁 格钎 版氰摹啊 泅犁 饭骇狼 格钎 版氰摹 焊促 农促搁, 犁 汲沥 秦霖促.		if (m_INTGoalExp > pINTInfo->getGoalExp()) 		{			m_INTGoalExp = pINTInfo->getGoalExp();		}		// 捞傈 饭骇狼 牢器甫 罐酒柯促.		INTBalanceInfo* pBeforeINTInfo = g_pINTBalanceInfoManager->getINTBalanceInfo(m_INT[ATTR_BASIC] - 1);		// 捞傈 饭骇狼 醚 版氰摹 + 格钎 版氰摹 函拳樊 = 泅犁 穿利 版氰摹		m_INTExp = pBeforeINTInfo->getAccumExp() + (pINTInfo->getGoalExp() - m_INTGoalExp);		//file << "荐沥等 穿利 版氰摹 : " << (int)m_INTExp << endl;		//file << "荐沥等 格钎 版氰摹 : " << (int)m_INTGoalExp << endl;//		StringStream attrsave;//		attrsave << "INTExp = " << (int)m_INTExp << ", INTGoalExp = " << (int)m_INTGoalExp;//		tinysave(attrsave.toString());		// by sigi. 2002.5.15		char pField[80];		sprintf(pField, "INTExp=%lu, INTGoalExp=%lu", m_INTExp, m_INTGoalExp);		tinysave(pField);						//file.close();	}*/	// rank啊 0捞搁 檬扁蔼捞 汲沥登瘤 臼疽促绰 狼固捞促.	if (getRank()==0)	{		saveInitialRank();	}	// 肋给等 版氰摹甫 犁炼沥 秦霖促.	// by sigi. 2002.8.31/*	RankEXPInfo* pRankInfo = g_pRankEXPInfoManager[RANK_TYPE_SLAYER]->getRankEXPInfo(m_Rank);		if (m_Rank>1 && pRankInfo->getAccumExp() != m_RankExp + m_RankGoalExp) 	{		//ofstream file("瓷仿摹炼沥.txt", ios::out | ios::app);		//file << "NAME:" << m_Name << endl;		//file << "==Rank==" << endl;		//file << "泅犁饭骇狼醚版氰摹 : " << (int)pRankInfo->getAccumExp() << endl;		//file << "泅犁 穿利 版氰摹 : " << (int)m_RankExp << endl;		//file << "泅犁 格钎 版氰摹 : " << (int)m_RankGoalExp << endl;		//file << endl;		// 泅犁 格钎 版氰摹啊 泅犁 饭骇狼 格钎 版氰摹 焊促 农促搁, 犁 汲沥 秦霖促.		if (m_RankGoalExp > pRankInfo->getGoalExp()) 		{			m_RankGoalExp = pRankInfo->getGoalExp();		}		// 捞傈 饭骇狼 牢器甫 罐酒柯促.		RankEXPInfo* pBeforeRankInfo = g_pRankEXPInfoManager[RANK_TYPE_SLAYER]->getRankEXPInfo(m_Rank - 1);		// 捞傈 饭骇狼 醚 版氰摹 + 格钎 版氰摹 函拳樊 = 泅犁 穿利 版氰摹		m_RankExp = pBeforeRankInfo->getAccumExp() + (pRankInfo->getGoalExp() - m_RankGoalExp);		//file << "荐沥等 穿利 版氰摹 : " << (int)m_RankExp << endl;		//file << "荐沥等 格钎 版氰摹 : " << (int)m_RankGoalExp << endl;//		StringStream attrsave;//		attrsave << "RankExp = " << (int)m_RankExp << ", RankGoalExp = " << (int)m_RankGoalExp;//		tinysave(attrsave.toString());		// by sigi. 2002.5.15		char pField[80];		sprintf(pField, "RankExp=%lu, RankGoalExp=%lu", m_RankExp, m_RankGoalExp);		tinysave(pField);						//file.close();	}*/	// 肋给等 档皋牢 版氰摹甫 焊沥茄促./*	for (int i = 0; i < SKILL_DOMAIN_ETC; i++) 	{		DomainInfo* pDomainInfo = g_pSkillDomainInfoManager->getDomainInfo((SkillDomain)i , m_SkillDomainLevels[i]); 		Assert(pDomainInfo!=NULL);		if (pDomainInfo->getAccumExp() != m_SkillDomainExps[i] + m_GoalExp[i] 			&& m_SkillDomainLevels[i] > 0) 		{			//ofstream file("档皋牢炼沥.txt", ios::out | ios::app);			//file << "NAME:" << m_Name << endl;			//file << "==" << i << "==" << endl;			//file << "泅犁饭骇狼醚版氰摹 : " << (int)pDomainInfo->getAccumExp() << endl;			//file << "泅犁 穿利 版氰摹 : " << (int)m_SkillDomainExps[i] << endl;			//file << "泅犁 格钎 版氰摹 : " << (int)m_GoalExp[i] << endl;			//file << endl;			// 泅犁 格钎 版氰摹啊 泅犁 饭骇狼 格钎 版氰摹 焊促 农促搁, 犁 汲沥 秦霖促.			if (m_GoalExp[i] > pDomainInfo->getGoalExp()) 			{				m_GoalExp[i] = pDomainInfo->getGoalExp();			}			// 捞傈 饭骇狼 牢器甫 罐酒柯促.			DomainInfo* pBeforeDomainInfo = g_pSkillDomainInfoManager->getDomainInfo((SkillDomain)i , (m_SkillDomainLevels[i] - 1)); 			// 捞傈 饭骇狼 醚 版氰摹 + 格钎 版氰摹 函拳樊 = 泅犁 穿利 版氰摹			m_SkillDomainExps[i] = pBeforeDomainInfo->getAccumExp() + (pDomainInfo->getGoalExp() - m_GoalExp[i]);			//file << "荐沥等 穿利 版氰摹 : " << (int)m_SkillDomainExps[i] << endl;			//file << "荐沥等 格钎 版氰摹 : " << (int)m_GoalExp[i] << endl;			//StringStream attrsave;			// by sigi. 2002.5.15			char pField[80];			pField[0] = '\0';			if (i == SKILL_DOMAIN_BLADE) 			{				//attrsave << "BladeExp = " << (int)m_SkillDomainExps[i] << ", BladeGoalExp = " << (int)m_GoalExp[i];				sprintf(pField, "BladeExp=%lu, BladeGoalExp=%lu", m_SkillDomainExps[i], m_GoalExp[i]);			} 			else if (i == SKILL_DOMAIN_SWORD) 			{				//attrsave << "SwordExp = " << (int)m_SkillDomainExps[i] << ", SwordGoalExp = " << (int)m_GoalExp[i];				sprintf(pField, "SwordExp=%lu, SwordGoalExp=%lu", m_SkillDomainExps[i], m_GoalExp[i]);			} 			else if (i == SKILL_DOMAIN_GUN) 			{				//attrsave << "GunExp = " << (int)m_SkillDomainExps[i] << ", GunGoalExp = " << (int)m_GoalExp[i];				sprintf(pField, "GunExp=%lu, GunGoalExp=%lu", m_SkillDomainExps[i], m_GoalExp[i]);			}			else if (i == SKILL_DOMAIN_HEAL) 			{				//attrsave << "HealExp = " << (int)m_SkillDomainExps[i] << ", HealGoalExp = " << (int)m_GoalExp[i];				sprintf(pField, "HealExp=%lu, HealGoalExp=%lu", m_SkillDomainExps[i], m_GoalExp[i]);			}			else if (i == SKILL_DOMAIN_ENCHANT) 			{				//attrsave << "EnchantExp = " << (int)m_SkillDomainExps[i] << ", EnchantGoalExp = " << (int)m_GoalExp[i];				sprintf(pField, "EnchantExp=%lu, EnchantGoalExp=%lu", m_SkillDomainExps[i], m_GoalExp[i]);			}			//tinysave(attrsave.toString());			if (pField[0]!='\0')				tinysave( pField );			//file.close();		}	}*/	// 葛电 瓷仿摹甫 肺靛沁扁 锭巩俊,	// 捞吧 扁夯栏肺 何啊 瓷仿摹甫 檬扁拳茄促.	initAllStat();	// 傈里 曼啊 Flag 眉农	if ( RaceWarLimiter::isInPCList( this ) )	{		setFlag( Effect::EFFECT_CLASS_RACE_WAR_JOIN_TICKET );	}	if (m_pZone->isHolyLand() 		&& g_pWarSystem->hasActiveRaceWar()		&& !isFlag( Effect::EFFECT_CLASS_RACE_WAR_JOIN_TICKET ))	{		ZONE_COORD ResurrectCoord;		g_pResurrectLocationManager->getPosition( this, ResurrectCoord );		setZoneID( ResurrectCoord.id );		setX( ResurrectCoord.x );		setY( ResurrectCoord.y );	}	return true;	__END_CATCH}void Slayer::save () const	throw (Error){	__BEGIN_TRY	__ENTER_CRITICAL_SECTION(m_Mutex)	Statement* pStmt = NULL;	BEGIN_DB	{		/*		// StringStream 救静扁. by sigi. 2002.5.9		StringStream sql;		sql << "UPDATE Slayer SET"			//<< " Competence = " << (int)m_Competence			//<< ", HairStyle = '" << HairStyle2String[m_HairStyle]			//<< "', HairColor = " << (int)m_HairColor			//<< ", SkinColor = " << (int)m_SkinColor			//<< ", STR = " << (int)m_STR[ATTR_MAX]			//<< ", DEX = " << (int)m_DEX[ATTR_MAX]			//<< ", INTE = " << (int)m_INT[ATTR_MAX]			//<< ", STRExp = " << m_STRExp			//<< ", DEXExp = " << m_DEXExp			//<< ", INTExp = " << m_INTExp			//<< ", STRExpLevel = " << (int)m_STRExpLevel			//<< ", DEXExpLevel = " << (int)m_DEXExpLevel			//<< ", INTExpLevel = " << (int)m_INTExpLevel			<< " CurrentHP = " << m_HP[ATTR_CURRENT]			<< ", HP = " << m_HP[ATTR_MAX]			<< ", CurrentMP = " << m_MP[ATTR_CURRENT]			<< ", MP = " << m_MP[ATTR_MAX]			//<< ", Fame = " << m_Fame			//<< ", Gold = " << m_Gold			//<< ", GuildID = " << m_GuildID			//<< ", InMagics = '" << ??? << "'"			//<< ", BladeLevel = " << (int)m_SkillDomainLevels[SKILL_DOMAIN_BLADE]			//<< ", BladeExp = " << m_SkillDomainExps[SKILL_DOMAIN_BLADE]			//<< ", BladeGoalExp = " << m_GoalExp[SKILL_DOMAIN_BLADE]			//<< ", SwordLevel = " << (int)m_SkillDomainLevels[SKILL_DOMAIN_SWORD]			//<< ", SwordExp = " << m_SkillDomainExps[SKILL_DOMAIN_SWORD]			//<< ", SwordGoalExp = " << m_GoalExp[SKILL_DOMAIN_SWORD]			//<< ", GunLevel = " << (int)m_SkillDomainLevels[SKILL_DOMAIN_GUN]			//<< ", GunExp = " << m_SkillDomainExps[SKILL_DOMAIN_GUN]			//<< ", GunGoalExp = " << m_GoalExp[SKILL_DOMAIN_GUN]			//<< ", RifleLevel = " << (int)m_SkillDomainLevels[SKILL_DOMAIN_RIFLE]			//<< ", RifleExp = " << m_SkillDomainExps[SKILL_DOMAIN_RIFLE]			//<< ", RifleGoalExp = " << m_GoalExp[SKILL_DOMAIN_RIFLE]			//<< ", EnchantLevel = " << (int)m_SkillDomainLevels[SKILL_DOMAIN_ENCHANT]			//<< ", EnchantExp = " << m_SkillDomainExps[SKILL_DOMAIN_ENCHANT]			//<< ", EnchantGoalExp = " << m_GoalExp[SKILL_DOMAIN_ENCHANT]			//<< ", HealLevel = " << (int)m_SkillDomainLevels[SKILL_DOMAIN_HEAL]			//<< ", HealExp = " << m_SkillDomainExps[SKILL_DOMAIN_HEAL]			//<< ", HealGoalExp = " << m_GoalExp[SKILL_DOMAIN_HEAL]			//<< ", ETCLevel = " << (int)m_SkillDomainLevels[SKILL_DOMAIN_ETC]			//<< ", ETCExp = " << m_SkillDomainExps[SKILL_DOMAIN_ETC]			//<< ", ETCGoalExp = " << m_GoalExp[SKILL_DOMAIN_ETC]			//<< ", SubSkills = '" << ??? << "'"			<< ", ZoneID = " << getZoneID()			<< ", XCoord = " << (int)m_X			<< ", YCoord = " << (int)m_Y			//<< ", Sight = " << (int)m_Sight			//<< ", GunBonusExp = " << (int)m_GunBonusExp			//<< ", RifleBonusExp = " << (int)m_GunBonusExp			<< ", F9 = " << (int)m_HotKey[0]			<< ", F10 = " << (int)m_HotKey[1]			<< ", F11 = " << (int)m_HotKey[2]			<< ", F12 = " << (int)m_HotKey[3]			<< "  WHERE Name = '" << m_Name << "'";			pStmt->executeQuery(sql.toString());		*/		pStmt = g_pDatabaseManager->getConnection("DARKEDEN")->createStatement();		pStmt->executeQuery( "UPDATE Slayer SET CurrentHP=%d, HP=%d, CurrentMP=%d, MP=%d, ZoneID=%d, XCoord=%d, YCoord=%d WHERE Name='%s'",								m_HP[ATTR_CURRENT], m_HP[ATTR_MAX], m_MP[ATTR_CURRENT], m_MP[ATTR_MAX], getZoneID(), (int)m_X, (int)m_Y, m_Name.c_str() );		// 老馆利栏肺, 酒公繁 单捞鸥档 官差瘤 臼疽阑 版快		// #Affected Rows == 0 捞促. 弊繁单, 措何盒狼 版快		// 单捞鸥啊 距埃捞扼档 官差霸 等促. 弊矾唱, 救官拆		// 啊瓷己档 乐促. 蝶扼辑, AffectedRows 绰 眉农登瘤		// 臼酒具 茄促.		//Assert(pStmt->getAffectedRowCount() == 1);		SAFE_DELETE(pStmt);	} 	END_DB(pStmt)	/*	// 牢亥配府狼 酒捞袍甸阑 技捞宏 茄促.	m_pInventory->save(m_Name);	*/	// 捞棋飘甫 技捞宏 茄促.	m_pEffectManager->save(m_Name);	// 坷配官捞甫 技捞宏 茄促.	if (m_pMotorcycle != NULL) 	{		//m_pMotorcycle->save("", STORAGE_ZONE, m_pZone->getZoneID(), m_X, m_Y);		// by sigi. 2002.5.15		char pField[80];		sprintf(pField, "OwnerID='', Storage=%d, StorageID=%u, X=%d, Y=%d",									STORAGE_ZONE, m_pZone->getZoneID(), m_X, m_Y);		m_pMotorcycle->tinysave( pField );	}	__LEAVE_CRITICAL_SECTION(m_Mutex)	__END_CATCH}// tinysavevoid Slayer::tinysave(const string & field)    const throw (Error){    __BEGIN_TRY    Statement* pStmt = NULL;	BEGIN_DB	{		pStmt = g_pDatabaseManager->getConnection("DARKEDEN")->createStatement();		pStmt->executeQuery("UPDATE Slayer SET %s WHERE NAME='%s'", field.c_str(), m_Name.c_str());		SAFE_DELETE(pStmt);	} 	END_DB(pStmt)    __END_CATCH}

⌨️ 快捷键说明

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