[DiscordArchive] I need have a spell script do this case?
[DiscordArchive] I need have a spell script do this case?
Archived author: JORGIE • Posted: 2024-01-26T15:38:40.831000+00:00
Original source
I need have a spell script do this case?
![[Image: 1706284031314.png?ex=690c1a5e&is=690ac8d...31bc02bb5&]](https://cdn.discordapp.com/attachments/376074396915335170/1200467107905798194/1706284031314.png?ex=690c1a5e&is=690ac8de&hm=f0fa185d04c4eeda0b82be6dd69c0a78e9bf4dd9cfb5321195bb6f431bc02bb5&)
Archived author: JORGIE • Posted: 2024-01-26T15:47:42.177000+00:00
Original source
![[Image: 1706284031314.png?ex=690c1a5e&is=690ac8d...31bc02bb5&]](https://cdn.discordapp.com/attachments/376074396915335170/1200467107905798194/1706284031314.png?ex=690c1a5e&is=690ac8de&hm=f0fa185d04c4eeda0b82be6dd69c0a78e9bf4dd9cfb5321195bb6f431bc02bb5&)
Archived author: JORGIE • Posted: 2024-01-26T15:52:30.819000+00:00
Original source
You guys are so familiar with this. do you give me a best solution to fix this.
Archived author: JORGIE • Posted: 2024-01-26T16:03:38.431000+00:00
Original source
```c++
// Heroic Leap
ApplySpellFix({ 52174 }, [](SpellInfo* spellInfo)
{
spellInfo->_visuals.clear();
spellInfo->_visuals.push_back(sSpellXSpellVisualStore.LookupEntry(25530));
spellInfo->_visuals.push_back(sSpellXSpellVisualStore.LookupEntry(109554));
});
```
Archived author: JORGIE • Posted: 2024-01-26T16:06:54.574000+00:00
Original source
So, I thank this is a best way to fix the heroic leap. as you mention, visual 109554 has a condition that requires player to have spell 228378. It will match the player condidtion automatic choose the correct visual
Archived author: JORGIE • Posted: 2024-01-26T16:10:55.393000+00:00
Original source
```c++
uint32 SpellInfo::GetSpellXSpellVisualId(WorldObject const* caster /*= nullptr*/, WorldObject const* viewer /*= nullptr*/) const
{
for (SpellXSpellVisualEntry const* visual : _visuals)
{
if (PlayerConditionEntry const* playerCondition = sPlayerConditionStore.LookupEntry(visual->CasterPlayerConditionID))
if (!caster || !caster->IsPlayer() || !ConditionMgr::IsPlayerMeetingCondition(caster->ToPlayer(), playerCondition))
continue;
if (UnitConditionEntry const* unitCondition = sUnitConditionStore.LookupEntry(visual->CasterUnitConditionID))
if (!caster || !caster->IsUnit() || !ConditionMgr::IsUnitMeetingCondition(caster->ToUnit(), Object::ToUnit(viewer), unitCondition))
continue;
return visual->ID;
}
return 0;
}
```