[Patch] Compile Error While Trying To Apply An Old Patch, Please Help Me Update The Patch

Hello Trinity community,

I’m trying to make an old patch to work on rev 1aa4e7bd5762e7d8e926

I’m trying to fix Eviscerate & Envenom spells by applying the following patch (originally written by Dr Tenma):

[CODE]diff -r 5bf73e999a5d -r dffee391792d sql/updates/9960_world_spell_bonus_data.sql

— /dev/null Thu Jan 01 00:00:00 1970 +0000

+++ b/sql/updates/9960_world_spell_bonus_data.sql Sun Sep 19 08:09:43 2010 -0300

@@ -0,0 +1,3 @@

+DELETE FROM spell_bonus_data WHERE entry IN (‘32645’);

+INSERT INTO spell_bonus_data (entry, direct_bonus, dot_bonus, ap_bonus, ap_dot_bonus, comments) VALUES

+(‘32645’,‘0’,‘0’,‘0’,‘0’,‘Rogue - Envenom’);

diff -r 5bf73e999a5d -r dffee391792d src/server/game/Spells/SpellEffects.cpp

— a/src/server/game/Spells/SpellEffects.cpp Sun Sep 19 12:36:48 2010 +0200

+++ b/src/server/game/Spells/SpellEffects.cpp Sun Sep 19 08:09:43 2010 -0300

@@ -626,58 +626,64 @@

		case SPELLFAMILY_ROGUE:

		{

			// Envenom
  •        	if (m_caster->GetTypeId() == TYPEID_PLAYER && (m_spellInfo->SpellFamilyFlags[1] & 0x8))
    
  •        	if (m_spellInfo->SpellFamilyFlags[EFFECT_1] & 0x8)
    
      		{
    
  •            	// consume from stack dozes not more that have combo-points
    
  •            	if (uint32 combo = m_caster->ToPlayer()->GetComboPoints())
    
  •            	{
    
  •                	// Lookup for Deadly poison (only attacker applied)
    
  •                	if (AuraEffect const * aurEff = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x10000, 0, 0, m_caster->GetGUID()))
    
  •            	if (!m_caster->ToPlayer())
    
  •                	return;
    
  •            	uint32 combo = m_caster->ToPlayer()->GetComboPoints();
    
  •            	if (!combo)
    
  •                	return;
    
  •            	AuraEffect const * aurEffA = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x10000, 0, 0, m_caster->GetGUID());
    
  •            	if (!aurEffA)
    
  •                	return;
    
  •            	uint32 doses = aurEffA->GetBase()->GetStackAmount();
    
  •            	if (doses > combo)
    
  •                	doses = combo;
    
  •            	// Master Poisoner
    
  •            	bool needConsume = true;
    
  •            	Unit::AuraEffectList const & auras = m_caster->ToPlayer()->GetAuraEffectsByType(SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL_NOT_STACK);
    
  •            	for (Unit::AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
    
  •                	if (((*itr)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_ROGUE) &&
    
  •                    	((*itr)->GetSpellProto()->SpellIconID == 1960))
    
       				{
    
  •                    	// count consumed deadly poison doses at target
    
  •                    	bool needConsume = true;
    
  •                    	uint32 spellId = aurEff->GetId();
    
  •    &nbsp%p;        &nbs3B      	uint32 doses = aurEff->GetBase()->GetStackAmount();
    
  •                    	if (doses > combo)
    
  •                        	doses = combo;
    
  •                    	// Master Poisoner
    
  •                    	Unit::AuraEffectList const& auraList = m_caster->ToPlayer()->GetAuraEffectsByType(SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL_NOT_STACK);
    
  •                    	for (Unit::AuraEffectList::const_iterator iter = auraList.begin(); iter != auraList.end(); ++iter)
    
  •                    	{
    
  •                        	if ((*iter)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_ROGUE && (*iter)->GetSpellProto()->SpellIconID == 1960)
    
  •                        	{
    
  •                            	uint32 chance = SpellMgr::CalculateSpellEffectAmount((*iter)->GetSpellProto(), 2, m_caster);
    
  •                            	if (chance && roll_chance_i(chance))
    
  • 6nbsp; %2 needConsume = false;

  •                            	break;
    
  •                        	}
    
  •                    	}
    
  •                    	if (needConsume)
    
  •                        	for (uint32 i = 0; i < doses; ++i)
    
  •                            	unitTarget->RemoveAuraFromStack(spellId);
    
  •                    	damage *= doses;
    
  •                    	damage += int32(((Player*)m_caster)->GetTotalAttackPowerValue(BASE_ATTACK) * 0.09f * doses);
    
  •                    	uint32 chance = SpellMgr::CalculateSpellEffectAmount((*itr)->GetSpellProto(), EFFECT_2);
    
  •                    	if ((chance >= 100) || roll_chance_i(chance))
    
  •                        	needConsume = false;
    
  •                    	break;
    
       				}
    
  •                	// Eviscerate and Envenom Bonus Damage (item set effect)
    
  •                	if (m_caster->HasAura(37169))
    
  •                    	damage += ((Player*)m_caster)->GetComboPoints()*40;
    
  •            	}
    
  •            	if (needConsume)
    
  •                	for (uint32 i = 0; i < doses; ++i)
    
  •                    	unitTarget->RemoveAuraFromStack(aurEffA->GetId());
    
  •            	damage *= doses;
    
  •            	damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.09f * combo);
    
  •            	// Eviscerate and Envenom Bonus Damage
    
  •            	if (AuraEffect const * aurEffB = m_caster->GetAuraEffect(37169, EFFECT_0, m_caster->GetGUID()))
    
  •                	damage += combo * aurEffB->GetAmount();
    
  •            	break;
    
      		}
    
      		// Eviscerate
    
  •        	else if ((m_spellInfo->SpellFamilyFlags[0] & 0x00020000) && m_caster->GetTypeId() == TYPEID_PLAYER)
    
  •        	if (m_spellInfo->SpellFamilyFlags[EFFECT_0] & 0x20000)
    
      		{
    
  •            	if (uint32 combo = ((Player*)m_caster)->GetComboPoints())
    
  •            	{
    
  •                	float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
    
  •                	damage += irand(int32(ap * combo * 0.03f), int32(ap * combo * 0.07f));
    
  •                	// Eviscerate and Envenom Bonus Damage (item set effect)
    
  •                	if (m_caster->HasAura(37169))
    
  •                    	damage += combo*40;
    
  •            	}
    
  •            	if (!m_caster->ToPlayer())
    
  •                	return;
    
  •            	uint32 combo = m_caster->ToPlayer()->GetComboPoints();
    
  •            	if (!combo)
    
  •                	return;
    
  •            	float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
    
  •            	damage += irand(int32(ap * combo * 0.03f), int32(ap * combo * 0.07f));
    
  •            	// Eviscerate and Envenom Bonus Damage
    
  •            	if (AuraEffect const * aurEffB = m_caster->GetAuraEffect(37169, EFFECT_0, m_caster->GetGUID()))
    
  •                	damage += combo * aurEffB->GetAmount();
    
  •            	break;
    
      		}
    
      		break;
    
      	}[/CODE]
    

However I get the following errors while compiling:

12>F:\Trinity\src\server\game\Spells\SpellEffects.cpp(614): error C2039: ‘GetSpellProto’ : is not a member of ‘AuraEffect’

12> F:/Trinity/src/server/game/Spells/Auras\SpellAuraEffects.h(31) : see declaration of ‘AuraEffect’

12>F:\Trinity\src\server\game\Spells\SpellEffects.cpp(614): error C2227: left of ‘->SpellFamilyName’ must point to class/struct/union/generic type

12>F:\Trinity\src\server\game\Spells\SpellEffects.cpp(615): error C2039: ‘GetSpellProto’ : is not a member of ‘AuraEffect’

12> F:/Trinity/src/server/game/Spells/Auras\SpellAuraEffects.h(31) : see declaration of ‘AuraEffect’

12>F:\Trinity\src\server\game\Spells\SpellEffects.cpp(615): error C2227: left of ‘->SpellIconID’ must point to class/struct/union/generic type

12>F:\Trinity\src\server\game\Spells\SpellEffects.cpp(617): error C2039: ‘CalculateSpellEffectAmount’ : is not a member of ‘SpellMgr’

12> f:\trinity\src\server\game\spells\SpellMgr.h(538) : see declaration of ‘SpellMgr’

12>F:\Trinity\src\server\game\Spells\SpellEffects.cpp(617): error C2039: ‘GetSpellProto’ : is not a member of ‘AuraEffect’

12> F:/Trinity/src/server/game/Spells/Auras\SpellAuraEffects.h(31) : see declaration of ‘AuraEffect’

12>F:\Trinity\src\server\game\Spells\SpellEffects.cpp(617): error C3861: ‘CalculateSpellEffectAmount’: identifier not found

Now, from what I read I think the error is because the declarations in SpellMgr.cpp/h have changed.

Can someone please give me e direction how to update this patch, so it matches the updated souce of Trinity?

And please don’t reject me with “we don’t support custom patches”, because our entire source is made of “custom patches” which people merge together for a better working source.

Thank you in advance. /emoticons/default_smile.png

Edit:

OK, as I was reading through the source, I figured out that GetSpellProto is now GetSpellInfo, however I am still stuck at SpellMgr::CalculateSpellEffectAmount so now the error is only:

1>F:\Trinity\src\server\game\Spells\SpellEffects.cpp(617): error C2039: ‘CalculateSpellEffectAmount’ : is not a member of 'SpellMgr’1> f:\trinity\src\server\game\spells\SpellMgr.h(538) : see declaration of ‘SpellMgr’

1>F:\Trinity\src\server\game\Spells\SpellEffects.cpp(617): error C3861: ‘CalculateSpellEffectAmount’: identifier not found

Can anyone please give me a direction?

— Canned message start —

The topic did not belong to the section it was posted in and was moved to Code Development.

— Canned message end —

I guess I basically need to know what’s the new equivalent of SpellMgr::CalculateSpellEffectAmount.

Thanks for moving the topic btw.

Check this out

https://github.com/TrinityCore/TrinityCore/commit/b0fe236265465a0f39aa98a8cee2916d1ccfaa02

Thank you guys, I already managed to compile without getting errors, but now I see that the patch actually did not make any changes. I guess I will have to figure out things on my own.