Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::General Support

Support::General Support Post all topics here having to do with errors while trying to connect to an EQEMu server but not about the setup/running of the Server itself.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #12  
Old 07-29-2015, 01:25 PM
image
Demi-God
 
Join Date: Jan 2002
Posts: 1,290
Default

Edit: guess eqemu current might use 'instrument_mod' in the buff struct, demonstar can enlighten us to the changes as all I saw was 'update' :P









The problem is the instrument calculation should be done and saved for the duration of the spell, not requiring the instrument each tic. The instrument does not 'save' on the buff in eqemu code.

I have this on my server, but I am on a slightly older code base. Pretty much you have to create an array in the buff structure for the bardMod value.

eg in Buffs_Struct
int bardMod[EFFECT_COUNT];

the setting of the bardMod was handled in spell_effects.cpp Mob::CalcSpellEffectValue


Code:
int Mob::CalcSpellEffectValue(int16 spell_id, int buffID, int effect_id, int caster_level, Mob *caster, int ticsremaining)
{
	int formula, base, max, effect_value;

	if
		(
		!IsValidSpell(spell_id) ||
		effect_id < 0 ||
		effect_id >= EFFECT_COUNT
		)
		return 0;

	formula = spells[spell_id].formula[effect_id];
	base = spells[spell_id].base[effect_id];
	max = spells[spell_id].max[effect_id];

	if(IsBlankSpellEffect(spell_id, effect_id))
		return 0;

	effect_value = CalcSpellEffectValue_formula(formula, base, max, caster_level, spell_id, ticsremaining);

	if(caster && IsBardSong(spell_id) &&
		(spells[spell_id].effectid[effect_id] != SE_AttackSpeed) &&
		(spells[spell_id].effectid[effect_id] != SE_AttackSpeed2) &&
		(spells[spell_id].effectid[effect_id] != SE_AttackSpeed3) &&
		(spells[spell_id].effectid[effect_id] != SE_Lull) &&
		(spells[spell_id].effectid[effect_id] != SE_ChangeFrenzyRad) &&
		(spells[spell_id].effectid[effect_id] != SE_Harmony) //&& 
		// Kings & Bandits - EQEmu revision 1883 - The mana regen portion of bard songs is no longer affected by instrument mods.
		/*(spells[spell_id].effectid[effect_id] != SE_CurrentMana)*/) {
			int oval = effect_value;
			if ( buffID > -1 && buffID < BUFF_COUNT )
			{
				if ( buffs[buffID].bardMod[effect_id] == 0 )
				{
					int mod = caster->GetInstrumentMod(spell_id);
					effect_value = effect_value * mod / 10;
					mlog(SPELLS__BARDS, "Effect value %d altered with bard modifier of %d to yield %d with buffid %i", oval, mod, effect_value, buffID);
					buffs[buffID].bardMod[effect_id] = mod;
				}
				else
				{
					int mod = caster->GetInstrumentMod(spell_id);
					if ( mod > buffs[buffID].bardMod[effect_id] )
						buffs[buffID].bardMod[effect_id] = mod;

					effect_value = effect_value * buffs[buffID].bardMod[effect_id] / 10;
					mlog(SPELLS__BARDS, "Effect value altered %d with existing bard modifier of %d to yield %d with buffid %i", oval, buffs[buffID].bardMod[effect_id], effect_value, buffID);
				}
			}
			else
			{
					int mod = caster->GetInstrumentMod(spell_id);
					effect_value = effect_value * mod / 10;
					mlog(SPELLS__BARDS, "Effect value %d altered with bard modifier of %d to yield %d", oval, mod, effect_value);
			}
	}

	return(effect_value);
}
in the initialize of the buffs you have to zero the array out of course..eg Client::InitializeBuffSlots in the for loop add

for(int i=0;i<EFFECT_COUNT;i++)
buffs[x].bardMod[i] = 0;

there are probably multiple other places where we 'nullify' out buffs as well that varies on the code base (current/past).
__________________
www.eq2emu.com
EQ2Emu Developer
Former EQEMu Developer / GuildWars / Zek Seasons Servers
Member of the "I hate devn00b" club.
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 03:26 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3