Thread: TGB Change
View Single Post
  #1  
Old 10-14-2008, 04:47 PM
seveianrex
Sarnak
 
Join Date: Sep 2008
Location: asdf
Posts: 60
Default TGB Change

As per live, when someone uses /tgb it can hit up to 7 targets. This is noted in the comments, as you will see, but for some reason in Group::CastGroupSpell it has been omitted by a comment. Since I can't speculate nor determine the reason for that change, I will implement it in SpellFinished instead.

{spells.cpp}

Find (~1448)
Code:
case GroupSpell:
		{
			if(IsClient() && CastToClient()->CheckAAEffect(aaEffectMassGroupBuff)){
				SpellOnTarget(spell_id, this);
				entity_list.AESpell(this, this, spell_id, true);
				CastToClient()->DisableAAEffect(aaEffectMassGroupBuff);
			}
			else
			{
				// at this point spell_target is a member of the other group, or the
				// caster if they're not using TGB
				// NOTE: this will always hit the caster, plus the target's group so
				// it can affect up to 7 people if the targeted group is not our own
				if(spell_target->IsGrouped())
				{
					Group *target_group = entity_list.GetGroupByMob(spell_target);
					if(target_group)
					{
						target_group->CastGroupSpell(this, spell_id);
					}
				}
				else
				{
					// if target is grouped, CastGroupSpell will cast it on the caster
					// too, but if not then we have to do that here.
					if(spell_target != this){
						SpellOnTarget(spell_id, this);
	#ifdef GROUP_BUFF_PETS
						//pet too
						if (GetPet() && GetAA(aaPetAffinity))
							SpellOnTarget(spell_id, GetPet());
	#endif					
					}

					SpellOnTarget(spell_id, spell_target);
	#ifdef GROUP_BUFF_PETS
					//pet too
					if (spell_target->GetPet() && GetAA(aaPetAffinity))
						SpellOnTarget(spell_id, spell_target->GetPet());
	#endif
				}
			}
			break;
		}
And REPLACE with:
Code:
case GroupSpell:
		{
			if(IsClient() && CastToClient()->CheckAAEffect(aaEffectMassGroupBuff)){
				SpellOnTarget(spell_id, this);
				entity_list.AESpell(this, this, spell_id, true);
				CastToClient()->DisableAAEffect(aaEffectMassGroupBuff);
			}
			else
			{
				if(spell_target != this){
					SpellOnTarget(spell_id, this);
#ifdef GROUP_BUFF_PETS
					//pet too
					if (GetPet() && GetAA(aaPetAffinity))
						SpellOnTarget(spell_id, GetPet());
#endif					
				}

				// at this point spell_target is a member of the other group, or the
				// caster if they're not using TGB
				// NOTE: this will always hit the caster, plus the target's group so
				// it can affect up to 7 people if the targeted group is not our own
				if(spell_target->IsGrouped())
				{
					Group *target_group = entity_list.GetGroupByMob(spell_target);
					if(target_group)
					{
						target_group->CastGroupSpell(this, spell_id);
					}
				}
				else
				{
					SpellOnTarget(spell_id, spell_target);
	#ifdef GROUP_BUFF_PETS
					//pet too
					if (spell_target->GetPet() && GetAA(aaPetAffinity))
						SpellOnTarget(spell_id, spell_target->GetPet());
	#endif
				}
			}
			break;
		}
Reply With Quote