TrinityCore
TrinityCore copied to clipboard
Spell: Cannot cast Flame Shield
TrinityCore rev. a242662ae6fd 2014-01-31 DB revision number : TDB 335.51
When I try to cast Flame Shield I got "no target", even if I have the drake in target.
http://www.wowhead.com/spell=57108 http://www.wowhead.com/npc=30161 (Malygos encounter) http://www.wowhead.com/npc=32535 (wowhead.com/quest=13414)
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The spell needs to be properly conditioned so the effect index is cast on caster. At the moment it feels like it requires you to target the drake but then fails as your drake as no combo points (and abilities that require combo points can only be used if you hold combo points on the current target).
You can use http://www.wowhead.com/spell=57090 on your drake to stuck combo points, but the flame shield still can't be cast.
works for me:
case 57108: // Fire Shield Wyrmrest Skytalon
spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
rev https://github.com/TrinityCore/TrinityCore/commit/29610b250dd5017f068264d9b1a37748c9f30feb
Fixed here https://github.com/TrinityCore/TrinityCore/commit/3236f1641c39223a66bac7aa4a03254b096ce7d8 ?
Still bugged on rev. 5b5c0938da0f.
@Killyana I also encountered the same problem, has been waiting for solution
Is the suggestion from Fateswhisper (https://github.com/TrinityCore/TrinityCore/issues/11566#issuecomment-40058832) a valid fix, or is it considered to be a hack and not valid? If it could be used, does it belong in SpellMgr.cpp
or in SpellEffects.cpp
?
@tkrokli I think it belongs to spelleffects.cpp
Vehicle cannot cast that spell because it requires explicit target. https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/game/Handlers/PetHandler.cpp#L804 In here we're passing nullptr as target and said function does that check: https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/game/Spells/Spell.cpp#L5989 and due to that, spell will be finished immediately
Possible solution would be something like this?
Unit* target = targets.GetUnitTarget();
//! target still missing, get target from player
if (!target)
// target = some function which returns selected target by player
and then pass that target to CheckPetCast
Or something along those lines
Vehicle cannot cast that spell because it requires explicit target. https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/game/Handlers/PetHandler.cpp#L804 In here we're passing nullptr as target and said function does that check: https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/game/Spells/Spell.cpp#L5989 and due to that, spell will be finished immediately
Possible solution would be something like this?
Unit* target = targets.GetUnitTarget(); //! target still missing, get target from player if (!target) // target = some function which returns selected target by player
and then pass that target to CheckPetCast
Or something along those lines
I don't know if someone try it to check, I will try to see
So the dragon for Aces High and Maly's Phase 3 are the same and having the same issue. Reading old info on this gives some hints how it should work:
https://www.wowhead.com/news=55196/the-eye-of-eternity-a-raid-overview#news-post-55196
cast your Flame Shield (while targeting your dragon!) in order to survive
https://www.aspectofthehare.net/2008/12/aces-high-a-quick-guide.html
Before we begin, you will want to go into the interface menu and enable “Auto Self Cast”. This will make your life five million times easier.
It seems that the spell should try to cast on the target of the player, can only be cast on own dragon though. Also seems that auto self cast option would make the spell target your own dragon.
So is this just a bug with getting the player target in Spell.cpp? And what about the auto self cast scenario?
Hack fix I wrote, working for me:
if (spellId == 57108) {
caster->AddComboPoints(caster, caster->GetComboPoints(targets.GetUnitTarget()));
targets.SetUnitTarget(caster);
}
Insert right before these lines in PetHandler.cpp:
Spell* spell = new Spell(caster, spellInfo, triggerCastFlags);
spell->m_cast_count = castCount; // probably pending spell cast
spell->m_targets = targets;
https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/game/Handlers/PetHandler.cpp#L796
First I get the combo points from the target, then I apply them to the caster. Then I set the target of the spell to the caster. Works whether auto self cast is on or off.
@Jildor : Do you have any ideas, based on the comment above (from May 19, 2020) and the SpellMgr.cpp
"hack" from 2014 (https://github.com/TrinityCore/TrinityCore/issues/11566#issuecomment-40058832)?
replace https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/game/Handlers/PetHandler.cpp#L805 with
bool const needsExplicit = !targets.GetUnitTarget() && spellInfo->NeedsExplicitUnitTarget();
Unit* target = needsExplicit ? _player->GetSelectedUnit() : nullptr;
SpellCastResult result = spell->CheckPetCast(target);
and see if it helps
anyone can make one PR of riztazz code if it's correct?
5d7ae76d6f2a0f6f6416ff754d2243f3aafcc7d5
My code was only meant as a starting point, but glad to see it fixed :)