fix(Core): Adjustments to summoning ritual object handling. (#19600)

* Init.

* Allow self-summoning.

* Revert unintended change.

Self-summoning still works fine without this being removed, I see no harm in putting it back.
This commit is contained in:
Benjamin Jackson
2024-08-13 11:12:05 -04:00
committed by GitHub
parent ad411b49b7
commit 67010623a0
3 changed files with 4 additions and 10 deletions

View File

@@ -1906,8 +1906,8 @@ void GameObject::Use(Unit* user)
Player* targetPlayer = ObjectAccessor::FindPlayer(player->GetTarget());
// accept only use by player from same raid as caster, except caster itself
if (!targetPlayer || targetPlayer == player || !targetPlayer->IsInSameRaidWith(player))
// accept only use by player from same raid as caster
if (!targetPlayer || !targetPlayer->IsInSameRaidWith(player))
return;
//required lvl checks!
@@ -1918,10 +1918,7 @@ void GameObject::Use(Unit* user)
if (level < info->meetingstone.minLevel)
return;
if (info->entry == 194097)
spellId = 61994; // Ritual of Summoning
else
spellId = 23598; // Meeting Stone Summon
spellId = 23598; // Meeting Stone Summon
break;
}

View File

@@ -6471,7 +6471,7 @@ SpellCastResult Spell::CheckCast(bool strict)
return SPELL_FAILED_BAD_TARGETS;
Player* target = ObjectAccessor::FindPlayer(m_caster->ToPlayer()->GetTarget());
if (!target || m_caster->ToPlayer() == target || (!target->IsInSameRaidWith(m_caster->ToPlayer()) && m_spellInfo->Id != 48955)) // refer-a-friend spell
if (!target || (!target->IsInSameRaidWith(m_caster->ToPlayer()) && m_spellInfo->Id != 48955)) // refer-a-friend spell
return SPELL_FAILED_BAD_TARGETS;
// Xinef: Implement summon pending error

View File

@@ -5380,9 +5380,6 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
}
Map* cMap = m_caster->GetMap();
// if gameobject is summoning object, it should be spawned right on caster's position
if (goinfo->type == GAMEOBJECT_TYPE_SUMMONING_RITUAL)
m_caster->GetPosition(fx, fy, fz);
GameObject* pGameObj = sObjectMgr->IsGameObjectStaticTransport(name_id) ? new StaticTransport() : new GameObject();