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

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 12-12-2010, 12:10 AM
haynar
Developer
 
Join Date: Jul 2009
Location: In a state of bliss
Posts: 31
Default

Very annoying not being able to edit. Now I remember another reason I don't post here.

Sorry, but I misread your post. Since I did a half assed post, here is a real solution.

To get it to not topslot, you can do it for same spell id. But put in a condition to not send a fade packet to the client. That way when new buff goes over to client, it will update same slot. I tested it, and the client will topslot lower level versions of spells, that would get overwritten.

You will have to add additional parameters to BuffFadeBySlot(), which perform the fade packet function. You have to call BuffFadeBySlot(), to get procs, etc., other things updated properly.

The BuffFadeBySlot I am using is:

Code:
void	BuffFadeBySlot(int slot, bool iRecalcBonuses = true, bool death = false, bool sendmessage = true, bool sendfadepacket = true);
You can figure out where to put the checks for sendmessage (for sending the message that the buff faded) and sendfadepacket in the function, so they send when you want them.

The section of AddBuff() now becomes:

Code:
	if(will_overwrite)
	{
		vector<int>::iterator cur, end;
		cur = overwrite_slots.begin();
		end = overwrite_slots.end();
		for(; cur != end; cur++) {
			if (buffs[*cur].spellid == spell_id) { // special handling for same spell (should overwrite only one buff)
				emptyslot = *cur;
				if(caster && buffs[*cur].casterid == caster->GetID()) {
					BuffFadeBySlot(*cur, false, false, false, false); // no fade message or packet (same caster)
				} else {
					BuffFadeBySlot(*cur, false, false, true, false); // no fade packet, but send fade message
				}
			} else {
				BuffFadeBySlot(*cur, false);
				if (*cur < emptyslot || emptyslot == -1)
					emptyslot = *cur;
			}
		}
	}
Haynar
Reply With Quote
 


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 09: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