All pastes #744342 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-10-21 10:54 UTC
rendered paste body
Index: src/game/ObjectMgr.cpp
===================================================================
--- src/game/ObjectMgr.cpp	(revision 2016)
+++ src/game/ObjectMgr.cpp	(working copy)
@@ -1489,7 +1489,7 @@
 				continue;   // Class not valid for this race.
 
 			// Generate each level's information
-			uint32 MaxLevel = 70 + 1;
+			uint32 MaxLevel = sWorld.Expansion1LevelCap + 1;
 			LevelInfo* lvl=0, lastlvl;
 			lastlvl.HP = PCI->health;
 			lastlvl.Mana = PCI->mana;
Index: src/game/Player.cpp
===================================================================
--- src/game/Player.cpp	(revision 2016)
+++ src/game/Player.cpp	(working copy)
@@ -666,7 +666,7 @@
 	SetUInt32Value(PLAYER_FIELD_BYTES, 0x08 );
 	SetUInt32Value(PLAYER_CHARACTER_POINTS2,2);
 	SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f);
-	SetUInt32Value(PLAYER_FIELD_MAX_LEVEL, 70);
+	SetUInt32Value(PLAYER_FIELD_MAX_LEVEL, sWorld.Expansion1LevelCap);
   
 	for(uint32 x=0;x<7;x++)
 		SetFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT+x, 1.00);
@@ -2598,7 +2598,7 @@
 	}
 
 	SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f);
-	SetUInt32Value(PLAYER_FIELD_MAX_LEVEL, (GetSession()->HasFlag(ACCOUNT_FLAG_XPACK_01)?70:60));
+		SetUInt32Value(PLAYER_FIELD_MAX_LEVEL, sWorld.Expansion1LevelCap);
 	SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, info->factiontemplate);
 	if(cfaction)
 	{
@@ -3046,7 +3046,7 @@
 		CompleteLoading();
 
 	m_TeleportState = 0;
-
+	
 	 if(flying_aura && m_mapId != 530)
 	{
 		RemoveAura(flying_aura);
@@ -3059,8 +3059,12 @@
 	/* send weather */
 	sWeatherMgr.SendWeather(this);
 
+	if(m_mapMgr && m_mapMgr->m_battleground)
+		m_mapMgr->m_battleground->PortPlayer(this, true);
+	if(!m_TeleportState == 1) {	
 	SetUInt32Value(UNIT_FIELD_HEALTH, load_health);
 	SetUInt32Value(UNIT_FIELD_POWER1, load_mana);
+	}
 }
 
 void Player::ResetHeartbeatCoords()
Index: src/game/Stats.h
===================================================================
--- src/game/Stats.h	(revision 2016)
+++ src/game/Stats.h	(working copy)
@@ -111,7 +111,7 @@
 {
 
 //	const uint32 grayLevel[sWorld.LevelCap+1] = {0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,13,14,15,16,17,18,19,20,21,22,22,23,24,25,26,27,28,29,30,31,31,32,33,34,35,35,36,37,38,39,39,40,41,42,43,43,44,45,46,47,47,48,49,50,51,51,52,53,54,55,55};
-#define PLAYER_LEVEL_CAP 70
+#define PLAYER_LEVEL_CAP 80
 	const uint32 grayLevel[PLAYER_LEVEL_CAP+1] = {0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,13,14,15,16,17,18,19,20,21,22,22,23,24,25,26,27,28,29,30,31,31,32,33,34,35,35,36,37,38,39,39,40,41,42,43,43,44,45,46,47,47,48,49,50,51,51,52,53,54,55,55};
 	if(AttackerLvl + 5 <= VictimLvl)
 	{
@@ -144,7 +144,7 @@
 			}
 			else
 			{
-				if(AttackerLvl > PLAYER_LEVEL_CAP)
+				if(AttackerLvl > sWorld.Expansion1LevelCap)
 					return 1;//gm
 				if(AttackerLvl<PLAYER_LEVEL_CAP && VictimLvl <= grayLevel[AttackerLvl])
 					return 0;
Index: src/game/World.cpp
===================================================================
--- src/game/World.cpp	(revision 2016)
+++ src/game/World.cpp	(working copy)
@@ -2659,7 +2659,8 @@
 	BreathingEnabled = Config.MainConfig.GetBoolDefault("Server", "EnableBreathing", true);
 	SendStatsOnJoin = Config.MainConfig.GetBoolDefault("Server", "SendStatsOnJoin", true);
 	compression_threshold = Config.MainConfig.GetIntDefault("Server", "CompressionThreshold", 1000);
-
+	LevelCap = Config.MainConfig.GetIntDefault("Server", "LevelCap", 60);
+		Expansion1LevelCap = Config.MainConfig.GetIntDefault("Server", "Expansion1LevelCap", 70);
 	// load regeneration rates.
 	setRate(RATE_HEALTH,Config.MainConfig.GetFloatDefault("Rates", "Health",1));
 	setRate(RATE_POWER1,Config.MainConfig.GetFloatDefault("Rates", "Power1",1));
Index: src/game/World.h
===================================================================
--- src/game/World.h	(revision 2016)
+++ src/game/World.h	(working copy)
@@ -456,7 +456,8 @@
 	bool sendRevisionOnJoin;
 
 	void SaveAllPlayers();
-
+	uint32 LevelCap;
+	uint32 Expansion1LevelCap;
 	string MapPath;
 	bool UnloadMapFiles;
 	bool BreathingEnabled;