Core/Refer-a-Friend: Finish base work for Refer-a-Friend.
Any testing would be very much appreciated.
This commit is contained in:
@@ -711,6 +711,7 @@ void Spell::SelectSpellTargets()
|
||||
else if (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_TRIGGER_SPELL)
|
||||
AddUnitTarget(m_caster, i);
|
||||
break;
|
||||
case SPELL_EFFECT_SUMMON_RAF_FRIEND:
|
||||
case SPELL_EFFECT_SUMMON_PLAYER:
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->ToPlayer()->GetSelection())
|
||||
{
|
||||
@@ -5276,7 +5277,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
Player* target = ObjectAccessor::FindPlayer(m_caster->ToPlayer()->GetSelection());
|
||||
if (!target || m_caster->ToPlayer() == target || !target->IsInSameRaidWith(m_caster->ToPlayer()))
|
||||
if (!target || m_caster->ToPlayer() == target || (!target->IsInSameRaidWith(m_caster->ToPlayer()) && m_spellInfo->Id != 48955)) // refer-a-friend spell
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
// check if our map is dungeon
|
||||
@@ -5298,6 +5299,25 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
}
|
||||
break;
|
||||
}
|
||||
// RETURN HERE
|
||||
case SPELL_EFFECT_SUMMON_RAF_FRIEND:
|
||||
{
|
||||
if(m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
Player* playerCaster = m_caster->ToPlayer();
|
||||
//
|
||||
if(!(playerCaster->GetSelection()))
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
Player* target = ObjectAccessor::FindPlayer(playerCaster->GetSelection());
|
||||
|
||||
if (!target ||
|
||||
!(target->GetSession()->GetRecruiterId() == playerCaster->GetSession()->GetAccountId() || target->GetSession()->GetAccountId() == playerCaster->GetSession()->GetRecruiterId()))
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
break;
|
||||
}
|
||||
case SPELL_EFFECT_LEAP:
|
||||
case SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER:
|
||||
{
|
||||
@@ -6558,6 +6578,7 @@ bool Spell::CheckTarget(Unit* target, uint32 eff)
|
||||
//Check targets for LOS visibility (except spells without range limitations)
|
||||
switch(m_spellInfo->Effects[eff].Effect)
|
||||
{
|
||||
case SPELL_EFFECT_SUMMON_RAF_FRIEND:
|
||||
case SPELL_EFFECT_SUMMON_PLAYER: // from anywhere
|
||||
break;
|
||||
case SPELL_EFFECT_DUMMY:
|
||||
|
||||
@@ -356,6 +356,7 @@ class Spell
|
||||
void EffectEnergizePct(SpellEffIndex effIndex);
|
||||
void EffectTriggerSpellWithValue(SpellEffIndex effIndex);
|
||||
void EffectTriggerRitualOfSummoning(SpellEffIndex effIndex);
|
||||
void EffectSummonRaFFriend(SpellEffIndex effIndex);
|
||||
void EffectKillCreditPersonal(SpellEffIndex effIndex);
|
||||
void EffectKillCredit(SpellEffIndex effIndex);
|
||||
void EffectQuestFail(SpellEffIndex effIndex);
|
||||
|
||||
@@ -216,7 +216,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
|
||||
&Spell::EffectChargeDest, //149 SPELL_EFFECT_CHARGE_DEST
|
||||
&Spell::EffectQuestStart, //150 SPELL_EFFECT_QUEST_START
|
||||
&Spell::EffectTriggerRitualOfSummoning, //151 SPELL_EFFECT_TRIGGER_SPELL_2
|
||||
&Spell::EffectNULL, //152 SPELL_EFFECT_152 summon Refer-a-Friend
|
||||
&Spell::EffectSummonRaFFriend, //152 SPELL_EFFECT_SUMMON_RAF_FRIEND summon Refer-a-Friend
|
||||
&Spell::EffectCreateTamedPet, //153 SPELL_EFFECT_CREATE_TAMED_PET misc value is creature entry
|
||||
&Spell::EffectDiscoverTaxi, //154 SPELL_EFFECT_DISCOVER_TAXI
|
||||
&Spell::EffectTitanGrip, //155 SPELL_EFFECT_TITAN_GRIP Allows you to equip two-handed axes, maces and swords in one hand, but you attack $49152s1% slower than normal.
|
||||
@@ -7074,3 +7074,15 @@ void Spell::EffectBind(SpellEffIndex effIndex)
|
||||
data << uint32(area_id);
|
||||
player->SendDirectMessage(&data);
|
||||
}
|
||||
|
||||
void Spell::EffectSummonRaFFriend(SpellEffIndex effIndex) {
|
||||
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
Player *player = m_caster->ToPlayer();
|
||||
|
||||
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
m_caster->CastSpell(m_caster, m_spellInfo->Effects[effIndex].TriggerSpell, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user