Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-09-2004, 02:54 PM
Draupner
Hill Giant
 
Join Date: Jul 2004
Location: In my basement
Posts: 131
Default XP bonuses per zone

Heres the code for adding seperate xp bonuses to each zone. It defaults at 100 which is no bonus. For 2x experience rate set it to 200 for that particular zone.

Source this into your database
Code:
alter table zone add column xpmod int(4) NOT NULL default 100;
database.cpp Line 3295
Code:
int32 Database::SetZoneXPBonus(int32 zoneid) {
	char errbuf[MYSQL_ERRMSG_SIZE];
	char *query = 0;
	MYSQL_RES *result;
	MYSQL_ROW row;

	if (RunQuery(query, MakeAnyLenString(&query, "select distinct xpmod from zone where zoneidnumber=%i", zoneid), errbuf, &result)) {
		safe_delete_array(query);
		if (mysql_num_rows(result) == 1) {
			row = mysql_fetch_row(result);
			int32 ret = 0;
			if (row[0])
				ret = atoi(row[0]);
			mysql_free_result(result);
			return ret;
		}
		mysql_free_result(result);
	}
	else {
		cerr << "Error in GetZoneXPBonus Query '" << query << "' " << errbuf << endl;
		safe_delete_array(query);
		return 0;
	}
	
	return 0;	
}
database.h Line 206
Code:
int32   SetZoneXPBonus(int32);
Client.cpp

Replace
Code:
 
int32 exp = GetEXP() + (int32)((zone->GetEXPMod()) *  (add_exp - add_aaxp));
with
Code:
int32 exp = GetEXP() + (int32)((zone->GetEXPMod()) * (database.SetZoneXPBonus(zone->GetZoneID())/100) * (add_exp - add_aaxp));
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 10:57 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3