ArcEmu: Paladin - Blessing Of Sanctuary - 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

Paladin - Blessing Of Sanctuary

#1 User is offline   CurlyVIII 

  • Newbie
  • Group: Members
  • Posts: 8
  • Joined: 20-December 09

Posted 16 June 2010 - 10:32 AM

Hi, Im new to coding (go easy on me ;))and I've fixed Blessing of Sanctuary for Paladins (only 10min one though).

The only problem I have though is if I try to add Greater Blessing to it, the player recasts the blessing (using up the reagents) instead of dealing with the proc and giving the required mana/rage etc.

I've used WAmadeus's Cut to the Chase fix as a template to my coding. Found that very inspiring

Any suggestions to how I could fix the problem with the Greater Blessing or a better way to get the stam/stre to apply ?

Im all for learning so any help/pointers would be great :)

PaladinSpells.cpp
bool BlessingOfSanctuary(uint32 i, Aura *pAura, bool apply)
{
	Unit *target = pAura->GetTarget();
	if( target == NULL )
		return true;

	if (apply)
	{
		target->AddProcTriggerSpell(pAura->GetSpellProto(), pAura->GetSpellProto(), pAura->m_casterGuid, pAura->GetSpellProto()->procChance, PROC_ON_BLOCK_VICTIM | PROC_ON_DODGE_VICTIM | PROC_ON_MELEE_ATTACK_VICTIM, 0, NULL, NULL);
	}
	else
		target->RemoveProcTriggerSpell(pAura->GetSpellId(), pAura->m_casterGuid);

	return true;
}

void SetupPaladinSpells(ScriptMgr * mgr)
{
	mgr->register_dummy_aura(20911, &BlessingOfSanctuary);
}


SpellProc_Paladin.cpp
class BlessingOfSanctuaryProc : public SpellProc
{
	SPELL_PROC_FACTORY_FUNCTION(BlessingOfSanctuaryProc);

	bool DoEffect(Unit *victim, SpellEntry *CastingSpell, uint32 dmg, uint32 abs)
 	{
		Aura *aura = mTarget->FindAuraByNameHash(SPELL_HASH_BLESSING_OF_SANCTUARY);

		if (aura)
		{
			switch(mTarget->GetPowerType())
			{
			case POWER_TYPE_FOCUS:
			case POWER_TYPE_ENERGY:
				break;
			case POWER_TYPE_RAGE:
				mTarget->CastSpell(mTarget->GetGUID(), 57320, true); // Rage
				break;
			case POWER_TYPE_RUNIC_POWER:
				mTarget->CastSpell(mTarget->GetGUID(), 57321, true); // Runic power
				break;
			default:
				mTarget->CastSpell(mTarget->GetGUID(), 57319, true); // Mana
			}
		}
		return true;
	}
};

void SpellProcMgr::SetupPaladin()
{
	AddByNameHash( SPELL_HASH_BLESSING_OF_SANCTUARY, &BlessingOfSanctuaryProc::Create );
}


Hackfixes.cpp - Not really happy with this as I had to heavily overwrite to apply the stam/stre buff. Any sugestions here would be great
sp = dbcSpell.LookupEntryForced( 20911 );
if( sp != NULL )
{
sp->Effect[1] = SPELL_EFFECT_APPLY_AURA;
sp->Effect[2] = SPELL_EFFECT_APPLY_AURA;
sp->EffectDieSides[2] = 1;
sp->EffectBasePoints[2] = 9;
sp->EffectImplicitTargetA[1] = EFF_TARGET_SINGLE_FRIEND;
sp->EffectImplicitTargetA[2] = EFF_TARGET_SINGLE_FRIEND;
sp->EffectApplyAuraName[1] = SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE;
sp->EffectApplyAuraName[2] = SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE;
sp->EffectMiscValue[1] = 2;
}

0

#2 User is offline   Shauren 

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

Posted 16 June 2010 - 11:21 AM

yes. http://www.wowhead.com/spell=67480 is the additional aura that handles stat boosts - you need to apply and remove it together with Bos/GBoS, not let it expire by itself

damage reduction has to be handled 20911/25899 dummy effect (see its base value)

also, you need to watch aura stacking rules as there is a small possibility that 67480 will not get applied with regular version (20911)

using Aura *aura = mTarget->FindAuraByNameHash(SPELL_HASH_BLESSING_OF_SANCTUARY);
and if(aura) is not needed imo, the one who proc occurs for (= the one with buff) already has this aura so we do not need to check it again
0

#3 User is offline   CurlyVIII 

  • Newbie
  • Group: Members
  • Posts: 8
  • Joined: 20-December 09

Posted 16 June 2010 - 12:07 PM

Thankyou very much for the help and pointers ;). Its really nice to know where your going wrong to progress further.

I'll plod on an post another update when I have something new
0

#4 User is offline   WAmadeus 

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

Posted 16 June 2010 - 12:11 PM

Try always to not use hackfixes.cpp, and if stuff you're dealing with is already there, remove it and do a better implementation.
2

#5 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 16 June 2010 - 01:01 PM

View PostWAmadeus, on 16 June 2010 - 12:11 PM, said:

Try always to not use hackfixes.cpp, and if stuff you're dealing with is already there, remove it and do a better implementation.

This.


It is a dummy spell. Treat it as such.
Another suggestion: If you are "new to coding", whatever that means, you should not mess with spells. It's complicated and confusing for even those who have considerable programming experience.
Follow this path: Learn programming --> Learn C++ --> Study the Arcemu codebase.
This should keep you busy for the next (half) year at least ;)
"The demand for free goods is infinite."
0

#6 User is offline   CurlyVIII 

  • Newbie
  • Group: Members
  • Posts: 8
  • Joined: 20-December 09

Posted 16 June 2010 - 01:21 PM

Ive just been learning c++ for a few months since Jan/Feb, mainly got into it because of the Arcemu project. I find it really interesting and as time has past, my understanding of the code has increased. Not the easiest thing to start looking at first I must admit, hehe.

I suppose the main thing I need to really learn from the code (not sure if theres documentation for this) it what sections were put in just to get the server running, and are outdated or not complete. With years worth of work here I suppose parts are due for overhauls.

Thanks for all the help and advice though
0

#7 User is offline   CurlyVIII 

  • Newbie
  • Group: Members
  • Posts: 8
  • Joined: 20-December 09

Posted 21 June 2010 - 07:19 AM

Ive tried to get the buff working correctly by using spell 67480 for the stats. When 67480 gets applied to the player though, it removes spell 20911 and visa versa.

I removed all of my code and also commented out the below in Hackfixes.. just incase it was causing the problem but the problem still remains:

else if( strstr( sp->Name, "Blessing"))
  sp->BGR_one_buff_on_target |= SPELL_TYPE_BLESSING;


As expected, with the above code removed all other blessings can stack except for this spell. I just cant find the reason for these 2 spells replacing each other ;)

Properly fixing this probably was well outside my skillbase, but if you dont try, you dont learn I guess..
0

#8 User is offline   Shauren 

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

Posted 21 June 2010 - 12:31 PM

else if( strstr( sp->Name, "Blessing"))

change to

else if( strstr( sp->Name, "Blessing") && sp->Id != 67480 )

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