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.

Reply
 
Thread Tools Display Modes
  #1  
Old 05-09-2004, 09:57 PM
bUsh
Sarnak
 
Join Date: Apr 2004
Location: Waukesha, WI
Posts: 93
Default FIX UPDATE: Group Experience & Greens

Greetings!

This fix addresses the issue of players receiving experience when killing green-conned mobs.

Please Re-Evaluate the code, couple things I had to fix

This fix emulates EQLive in three aspects:
1. Players will no longer receive experience when killing green-conned mobs if grouped.
2. Players will not receive experience if another member of the group is too high level.
3. Mobs which still con higher than green to members of the group will give experience to those members only.

in zone\groups.h - around line 46, change:
Code:
void	SplitExp(uint32 exp, int16);
to
Code:
void	SplitExp(uint32 exp, Mob* other);
in zone\groups.cpp - around line 347, replace SplitExp function with this:
Code:
void Group::SplitExp(uint32 exp, Mob* other)
{
	if( other->CastToNPC()->MerchantType == 0 )
	{
		int i;
		uint32 groupexp = exp;
		int8 membercount = 0;
		int8 maxlevel = 1;
		for (i = 0; i < MAX_GROUP_MEMBERS; i++)
		{
			if (members[i] != NULL)
			{
				if(members[i]->GetLevel() > maxlevel)
					maxlevel = members[i]->GetLevel();
				//groupexp += exp/10;
				groupexp += (uint32)(exp * zone->GetGroupEXPBonus());

				membercount++;
			}
		}

		if (membercount == 0)
			return;

		for (i = 0; i < MAX_GROUP_MEMBERS; i++)
		{
			if (members[i] != NULL && members[i]->IsClient())
    		{
				if( members[i]->GetLevelCon( other->GetLevel() ) != CON_GREEN )
				{
					// add exp + exp cap
					sint16 diff = members[i]->GetLevel() - maxlevel;
					if (diff >= -8) /*Instead of person who killed the mob, the person who has the highest level in the group*/
					{
						members[i]->CastToClient()->AddEXP(((members[i]->GetLevel()+3) * (members[i]->GetLevel()+3) * 75*3.5f < groupexp/membercount ) ? (int32)(members[i]->GetLevel() * members[i]->GetLevel() * 75*3.5f):(int32)(groupexp/membercount) );
					}
				}
			}
		}
	}
}
Finally,

in zone\attack.cpp - around line 1804, change line:
Code:
entity_list.GetGroupByClient(killer->CastToClient())->SplitExp((uint32)(level*level*75*3.5f), GetLevel() );
to this:
Code:
entity_list.GetGroupByClient(killer->CastToClient())->SplitExp((uint32)(level*level*75*3.5f), this );
You're done!
__________________
~ b [ u ] s h

* ServerOP * The Green Leaf Server
Reply With Quote
  #2  
Old 05-10-2004, 07:40 AM
bUsh
Sarnak
 
Join Date: Apr 2004
Location: Waukesha, WI
Posts: 93
Default

Committed to CVS.
__________________
~ b [ u ] s h

* ServerOP * The Green Leaf Server
Reply With Quote
  #3  
Old 05-10-2004, 08:51 AM
Jezebell
Discordant
 
Join Date: Feb 2004
Location: Florida
Posts: 441
Default

This compiled perfectly, thanks!
__________________
Eru, the Creator of Arda
ServerOwner for The First Age
An EQEMulator Roleplaying [Custom-Legit] Server
The First Age Website

Running on: Asus A7N8X-Deluxe, AMD Athlon XP 2100+, Geil 1024MB PC3200 Ultra DDR RAM,
WD 40GB 7200rpm ATA-100 HDD, Visiontek 128MB Geforce4 TI 4400, Windows XP Pro SP2
Reply With Quote
Reply


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 12:38 PM.


 

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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3