ArcEmu: [Applied][priest] Dispersion - ArcEmu

Jump to content

Toggle shoutbox Lastest Announcements

dfighter  : (07 December 2014 - 12:06 PM) Arcemu is in hibernation mode, please read http://arcemu.org/fo...showtopic=26903
dfighter  : (01 January 2013 - 05:56 PM) Arcemu wishes you all a happy new year!
Hasbro  : (12 September 2012 - 10:01 AM) Please excuse our outage from the web! Our web host had a major malfunction!
dfighter  : (01 September 2012 - 04:05 PM) Since the spam bots just don't want to stop, I've enabled admin verification when registering.
dfighter  : (23 January 2012 - 09:56 PM) Please note that from now on you will need to confirm your email on the wiki in order to edit it!
Hasbro  : (31 December 2011 - 12:50 PM) Happy New Years all!
Navid  : (26 December 2011 - 04:09 AM) Merry Christmas !!!!!! Happy holidays all :)
WAmadeus  : (24 December 2011 - 03:54 PM) Merry Christmas to all!
dfighter  : (24 December 2011 - 11:05 AM) The Arcemu team wishes y'all a Merry Christmukkah!
Hasbro  : (05 October 2011 - 12:53 PM) Looking for web designers for upcoming web related project. If you're interested in designing user interfaces contact me
dfighter  : (02 September 2011 - 03:47 PM) So who here wants vehicles in Arcemu? :P http://arcemu.org/fo...showtopic=25440
Hasbro  : (14 August 2011 - 03:25 PM) Join us on irc, grab an irc client and connect to irc.freenode.net join channel #arcemu /server irc.freenode.net:6667 /join #arcemu
jackpoz  : (03 August 2011 - 05:33 AM) to all Lua Engine (old one) users: please check http://arcemu.org/fo...showtopic=25274
Hasbro  : (20 May 2011 - 05:27 PM) Looking for people experienced with CMake configuration and setup! Contact me asap
Hasbro  : (15 May 2011 - 05:03 PM) ArcEmu is recruiting C++ programmers, contact Hasbro if interested.
paroxysm  : (03 May 2011 - 06:26 PM) Updated luabridge gossip example to describe the whole gossip creation process rather than just how to create menu. Gossip tutorial
paroxysm  : (23 April 2011 - 11:35 AM) Lua writers can refer to the Luabridge Tutorials section in the Wiki to learn how to write gossip code correctly.
Hasbro  : (20 April 2011 - 05:22 PM) Thank you for your continuous contribution of bug reports, we are working on them.
Hasbro  : (17 April 2011 - 03:20 AM) Please consider donating to support our bills. Donations can be sent using PayPal to donations@arcemu.org - Thank you for your support.
paroxysm  : (10 April 2011 - 12:43 AM) Refer to the Luabridge Tutorials section in the Wiki to learn the new syntax of luabridge.
Resize Shouts Area

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[Applied][priest] Dispersion

#1 User is offline   Neo_mat 

  • drunken bear rider
  • PipPipPip
  • Group: Developers
  • Posts: 278
  • Joined: 07-June 08
  • Gender:Male
  • Server OS:Linux

Posted 16 August 2010 - 07:34 AM

Fix for spell: Dispersion
As reported in: Priest - Broken/partly Broken Spells & Talents

Dispersion now triggers mana restoring part (Dispersion) and making spell working as intended.
Index: Spell.cpp
===================================================================
--- Spell.cpp	(revision 3603)
+++ Spell.cpp	(working copy)
@@ -1218,6 +1218,11 @@
 				p_caster->RemoveAura( 57531 );
 			}
 
+			if( GetProto()->Id == 47585 )
+			{                   
+				p_caster->CastSpell( p_caster, 60069, false );
+			}
+
 			if( p_caster->IsStealth() && !hasAttributeEx(ATTRIBUTESEX_NOT_BREAK_STEALTH)
 				&& GetProto()->Id != 1 ) //check spells that get trigger spell 1 after spell loading
 			{


Well, found another way to fix it, instead of triggering spell, added a SPELL_AURA_MOD_TOTAL_MANA_REGEN_PCT to a spell, thanks to Artox for pointing that out.
Index: arcemu-world/HackFixes.cpp
===================================================================
--- arcemu-world/HackFixes.cpp	(revision 3603)
+++ arcemu-world/HackFixes.cpp	(working copy)
@@ -3218,6 +3218,15 @@
 		if( sp != NULL )
 			sp->DurationIndex = 29;
 
+		//Dispersion
+		sp = dbcSpell.LookupEntryForced( 47585 );
+		if( sp != NULL )
+		{
+			sp->Effect[1] = SPELL_EFFECT_APPLY_AURA;
+			sp->EffectApplyAuraName[1] = SPELL_AURA_MOD_TOTAL_MANA_REGEN_PCT;
+			sp->EffectAmplitude[1] = 1000;
+		}
+
 		/**********************************************************
 		 *	Holy Nova
 		 **********************************************************/

Attached File(s)


Posted Image
Posted Image
Posted Image
I am 91% addicted to World of Warcraft. What about you?
0

#2 User is offline   WAmadeus 

  • Cunning Code Composer
  • PipPipPip
  • Group: Developers
  • Posts: 287
  • Joined: 23-July 09
  • Gender:Male
  • Location:Brazil

Posted 16 August 2010 - 07:57 AM

Man, don't change spell effects.
0

#3 User is offline   Akamaran 

  • Member
  • Pip
  • Group: Members
  • Posts: 56
  • Joined: 26-August 08
  • Gender:Male
  • Location:Canada

Posted 16 August 2010 - 11:04 AM

Is this fix proper ? If so should consider commiting
0

#4 User is offline   suchASunthan 

  • Enthusiast
  • PipPipPip
  • Group: Members
  • Posts: 246
  • Joined: 29-November 08
  • Gender:Male
  • Location:Frankfurt
  • Interests:Vcpp, vb, sql, all programmlanguages
    more informations >:-]

Posted 16 August 2010 - 11:19 AM

not a proper fix. that's because a hackfix is needed but it shouldn't need a hackfix to work. beter to implement that in a SpellEffect/Aura.
Koninzidenz begründet keine Korrelation und ist kein Beweis für Kausalität!

coincidence causes no correlation and in´t a argument for causality!

Posted Image
Posted Image
0

#5 User is offline   Artox 

  • Occasional Poster
  • PipPip
  • Group: Members
  • Posts: 142
  • Joined: 01-November 08

Posted 16 August 2010 - 01:25 PM

View PostsuchASunthan, on 16 August 2010 - 11:19 AM, said:

not a proper fix. that's because a hackfix is needed but it shouldn't need a hackfix to work. beter to implement that in a SpellEffect/Aura.


I would say the second one is a proper fix and here is why:
In the Spell.dbc only 2 Effects are set, Effect 0 and Effect 2. Looking on wowhead, those are the ones you can see there too. The Problem is that one function of the spell is not covered by any of those 2 aura effects, namely the mana regeneration. Therefore it looks like the Spell.dbc is incomplete. This patch adds this missing third effect to the Spell and Hackfixes.cpp is exactly the right place to solve such trouble.
Posted Image
0

#6 User is offline   Akamaran 

  • Member
  • Pip
  • Group: Members
  • Posts: 56
  • Joined: 26-August 08
  • Gender:Male
  • Location:Canada

Posted 16 August 2010 - 04:43 PM

May i get developpers point of view for this following patch ?
0

#7 User is offline   Shauren 

  • Helper
  • Group: Contributor
  • Posts: 808
  • Joined: 04-November 08
  • Gender:Male
  • Location:Poland
  • Interests:hmm, wow?

Posted 17 August 2010 - 02:29 AM

the FIRST fix is valid, thats how blizzard does it, cast additional spell
the second is just a stupid hack that CAN be avoided
0

#8 User is offline   Neo_mat 

  • drunken bear rider
  • PipPipPip
  • Group: Developers
  • Posts: 278
  • Joined: 07-June 08
  • Gender:Male
  • Server OS:Linux

Posted 18 August 2010 - 03:15 AM

Well after rechecking it on retail, combat log says that energize spell is 49766, that has aura SPELL_AURA_PERIODIC_ENERGIZE, but if we will look at DBC or wowhead, it says it has only SPELL_EFFECT_RESTORE_POWER_PCT, that is not enough.
[06:12] <Andy|nas> 8/18 03:11:12.636  ENVIRONMENTAL_DAMAGE,0x0000000000000000,nil,0x80000000,0x0100000000112337,"Name",0x511,FALLING,463,0,1,0,0,0,nil,nil,nil[/size][/font]
[06:12] <Andy|nas> 8/18 03:11:14.361  SPELL_AURA_APPLIED,0x0100000000112337,"Lolshield",0x511,0x0100000000112337,"Name",0x511,47585,"Dispersion",0x1,BUFF[/size][/font]
[06:12] <Andy|nas> 8/18 03:11:14.361  SPELL_CAST_SUCCESS,0x0100000000112337,"Lolshield",0x511,0x0000000000000000,nil,0x80000000,47585,"Dispersion",0x1
[06:12] <Andy|nas> 8/18 03:11:15.100  SPELL_PERIODIC_ENERGIZE,0x0100000000112337,"Lolshield",0x511,0x0100000000112337,"Name",0x511,49766,"Dispersion",0x20,1589,0
[06:12] <Andy|nas> 8/18 03:11:15.649  SPELL_PERIODIC_ENERGIZE,0x0100000000112337,"Lolshield",0x511,0x0100000000112337,"Name",0x511,49766,"Dispersion",0x20,1589,0
[06:12] <Andy|nas> 8/18 03:11:16.502  SPELL_PERIODIC_ENERGIZE,0x0100000000112337,"Lolshield",0x511,0x0100000000112337,"Name",0x511,49766,"Dispersion",0x20,1589,0
[06:12] <Andy|nas> 8/18 03:11:17.284  SPELL_PERIODIC_ENERGIZE,0x0100000000112337,"Lolshield",0x511,0x0100000000112337,"Name",0x511,49766,"Dispersion",0x20,1588,0
[06:12] <Andy|nas> 8/18 03:11:18.828  SPELL_PERIODIC_ENERGIZE,0x0100000000112337,"Lolshield",0x511,0x0100000000112337,"Name",0x511,49766,"Dispersion",0x20,1588,0
[06:12] <Andy|nas> 8/18 03:11:19.706  SPELL_AURA_REMOVED,0x0100000000112337,"Lolshield",0x511,0x0100000000112337,"Name",0x511,47585,"Dispersion",0x1,BUFF
[06:12] <Andy|nas> 8/18 03:11:19.706  SPELL_PERIODIC_ENERGIZE,0x0100000000112337,"Lolshield",0x511,0x0100000000112337,"Name",0x511,49766,"Dispersion",0x20,1588,0

After that, we got a packets sniff ( URL ), where we can see that on par with triggering 49766, spell 47585 is also triggering 60069... it's kinda double regen and since spell 49766 has no set aura to be a periodic energize, fix will be hacky anyway (or am I wrong and someone has a better idea how to properly avoid "hacking"?). Just checked other well known emu, they just trigger spell 60069 for a spell 47585 as I did in my first patch, but that's not a really proper fix, because then mana regen is not showing out in combat log... Why do I think Blizzard has some chinese guys developing their game for food? Really don't see a logic in doubling mana restoring part with two spells, well currently I getting it working, but then it restoring 72% of mana instead of 36% (two spells restoring mana, gj blizz, looks like they disable 60069 after it was casted and just using 49766 to regen mana), and have to touch HackFixes.cpp and especially sp->EffectApplyAuraName[1] with sp->Effect[1] for spell 47669... Wtb more brains to this issue to help me with.


UPD: Just a little schema how this spell is working:
Cast 47585 -> Apply auras: Reduce damage taken by 90% and Silence&Pacify -> Cast spell 60069 (Apply Aura: Restore total mana %) -> Cast spell 63230 (Apply auras: Immunity to snares and immunity to roots) -> Cast spell 49766 (Spell Effect: Restore mana % ( Also % of total mana, but since it doesn't has aura as I've described earlier it just procs once, showing in combat log once too) ).
Posted Image
Posted Image
Posted Image
I am 91% addicted to World of Warcraft. What about you?
0

#9 User is offline   Shauren 

  • Helper
  • Group: Contributor
  • Posts: 808
  • Joined: 04-November 08
  • Gender:Male
  • Location:Poland
  • Interests:hmm, wow?

Posted 18 August 2010 - 03:52 AM

why dont you check if packet structure for periodic energize is correct?
0

#10 User is offline   Neo_mat 

  • drunken bear rider
  • PipPipPip
  • Group: Developers
  • Posts: 278
  • Joined: 07-June 08
  • Gender:Male
  • Server OS:Linux

Posted 27 January 2012 - 05:13 PM

Ok, here is a proper fix for this:
From 2e77cb43e9790f60eab117c8dec6c616cb21ff59 Mon Sep 17 00:00:00 2001
From: Neo_mat <neomat.github@gmail.com>
Date: Thu, 26 Jan 2012 18:10:24 +0400
Subject: [PATCH 1/2] Priest: Dispersion is now removing snares and restores
 mana.

---
 src/arcemu-world/Spell_Priest.cpp |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/arcemu-world/Spell_Priest.cpp b/src/arcemu-world/Spell_Priest.cpp
index 7df4174..74a7319 100644
--- a/src/arcemu-world/Spell_Priest.cpp
+++ b/src/arcemu-world/Spell_Priest.cpp
@@ -20,6 +20,20 @@
 
 #include "StdAfx.h"
 
+class DispersionSpell : public Spell
+{
+		SPELL_FACTORY_FUNCTION(DispersionSpell);
+
+		void DoAfterHandleEffect(Unit* target, uint32 i)
+		{
+			// Mana regeneration
+			p_caster->CastSpell(target, 60069, false);
+			// Remove snares and movement impairing effects and make player immune to them
+			p_caster->CastSpell(target, 63230, false);
+		}
+};
+
 void SpellFactoryMgr::SetupPriest()
 {
+	AddSpellById(47585, &DispersionSpell::Create);
 }
-- 
1.7.8.msysgit.0




From d043e0db9aaf1b482a540decc636e5b7cea6307f Mon Sep 17 00:00:00 2001
From: Neo_mat <neomat.github@gmail.com>
Date: Sat, 28 Jan 2012 02:03:02 +0400
Subject: [PATCH 2/2] Priest: Dispersion is now working totally as intented on
 retail. In previous implementation it wasn't doing
 anything with SpellId 49766, though it supposed to cast
 it and it supposed to show out in combat log and
 actually 49766 should restore mana, not 60069. 60069 is
 used just like a handler for calculating how much
 percent of power should be restored.

Old topic with sniffs and more detailed explaination:
http://arcemu.org/forums/index.php?showtopic=23157
---
 src/arcemu-world/SpellAuras.cpp |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/arcemu-world/SpellAuras.cpp b/src/arcemu-world/SpellAuras.cpp
index edacf17..ed0492c 100644
--- a/src/arcemu-world/SpellAuras.cpp
+++ b/src/arcemu-world/SpellAuras.cpp
@@ -2941,10 +2941,15 @@ void Aura::EventPeriodicManaPct(float RegenPct)
 
 	uint32 add = float2int32(m_target->GetMaxPower(POWER_TYPE_MANA) * (RegenPct / 100.0f));
 
-	uint32 newHealth = m_target->GetPower(POWER_TYPE_MANA) + add;
+	uint32 newPower = m_target->GetPower(POWER_TYPE_MANA) + add;
 
-	if(newHealth <= m_target->GetMaxPower(POWER_TYPE_MANA))
-		m_target->SetPower(POWER_TYPE_MANA, newHealth);
+	if(newPower <= m_target->GetMaxPower(POWER_TYPE_MANA))
+	{
+		if(GetSpellProto()->Id != 60069)
+			m_target->Energize(m_target, m_spellProto->Id, add, POWER_TYPE_MANA);
+		else
+			m_target->Energize(m_target, 49766, add, POWER_TYPE_MANA);
+	}
 	else
 		m_target->SetPower(POWER_TYPE_MANA, m_target->GetMaxPower(POWER_TYPE_MANA));
 
-- 
1.7.8.msysgit.0

Attached File(s)


Posted Image
Posted Image
Posted Image
I am 91% addicted to World of Warcraft. What about you?
0

#11 User is offline   Neo_mat 

  • drunken bear rider
  • PipPipPip
  • Group: Developers
  • Posts: 278
  • Joined: 07-June 08
  • Gender:Male
  • Server OS:Linux

Posted 03 February 2012 - 04:16 AM

- Applied.
- Moved to applied patches.
Posted Image
Posted Image
Posted Image
I am 91% addicted to World of Warcraft. What about you?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users