瀏覽代碼

Support for custom sky (added old luclin moon back)

alter table zones add column sky_file varchar(64) not null default '';
update zones set sky_file='home_tutorial' where file!='lavastorm';
Image 4 年之前
父節點
當前提交
49db262b59

+ 3 - 1
EQ2/source/WorldServer/WorldDatabase.cpp

@@ -2417,7 +2417,7 @@ void WorldDatabase::LoadZoneInfo(ZoneServer* zone){
 	Query query;
 	int32 ruleset_id;
 	char* escaped = getEscapeString(zone->GetZoneName());
-	MYSQL_RES* result = query.RunQuery2(Q_SELECT, "SELECT id, file, description, underworld, safe_x, safe_y, safe_z, min_status, min_level, max_level, instance_type+0, shutdown_timer, zone_motd, default_reenter_time, default_reset_time, default_lockout_time, force_group_to_zone, safe_heading, xp_modifier, ruleset_id, expansion_id, weather_allowed FROM zones where name='%s'",escaped);
+	MYSQL_RES* result = query.RunQuery2(Q_SELECT, "SELECT id, file, description, underworld, safe_x, safe_y, safe_z, min_status, min_level, max_level, instance_type+0, shutdown_timer, zone_motd, default_reenter_time, default_reset_time, default_lockout_time, force_group_to_zone, safe_heading, xp_modifier, ruleset_id, expansion_id, weather_allowed, sky_file FROM zones where name='%s'",escaped);
 	if(result && mysql_num_rows(result) > 0) {
 		MYSQL_ROW row;
 		row = mysql_fetch_row(result);
@@ -2454,6 +2454,8 @@ void WorldDatabase::LoadZoneInfo(ZoneServer* zone){
 		zone->SetMinimumVersion(GetMinimumClientVersion(atoi(row[20])));
 		zone->SetWeatherAllowed(atoi(row[21]) == 0 ? false : true);
 
+		zone->SetZoneSkyFile(row[22]);
+
 		if (zone->IsInstanceZone())
 		{
 			if ( zone->GetInstanceID() < 1 )

+ 4 - 0
EQ2/source/WorldServer/zoneserver.cpp

@@ -4846,6 +4846,10 @@ EQ2Packet* ZoneServer::GetZoneInfoPacket(Client* client){
 	packet->setSmallStringByName("upload_key", "dsya987yda9");
 	packet->setSmallStringByName("zone", GetZoneFile());
 	packet->setSmallStringByName("zone2", GetZoneName());
+
+	if ( strlen(GetZoneSkyFile()) > 0 )
+		packet->setSmallStringByName("zone_unknown2", GetZoneSkyFile()); // used for the sky map
+
 	packet->setSmallStringByName("zone_desc", GetZoneDescription());
 	packet->setSmallStringByName("char_name", client->GetPlayer()->GetName());
 		

+ 11 - 4
EQ2/source/WorldServer/zoneserver.h

@@ -449,11 +449,17 @@ public:
 			return;
 		strcpy(zone_name, new_zone); 
 	}
-	inline const char*	GetZoneFile()	{ return zone_file; }
-	void	SetZoneFile(char* zone) { 
-		if( strlen(zone) >= sizeof zone_file )
+	inline const char* GetZoneFile() { return zone_file; }
+	void	SetZoneFile(char* zone) {
+		if (strlen(zone) >= sizeof zone_file)
 			return;
-		strcpy(zone_file, zone); 
+		strcpy(zone_file, zone);
+	}
+	inline const char* GetZoneSkyFile() { return zonesky_file; }
+	void	SetZoneSkyFile(char* zone) {
+		if (strlen(zone) >= sizeof zonesky_file)
+			return;
+		strcpy(zonesky_file, zone);
 	}
 	inline const char*	GetZoneDescription() { return zone_description; }
 	void	SetZoneDescription(char* desc) { 
@@ -813,6 +819,7 @@ private:
 	int16	maximumLevel;
 	int16	minimumVersion;
 	char	zone_name[64];
+	char	zonesky_file[64];
 	char	zone_file[64];
 	char	zone_description[255];
 	float	underworld;