TrinityCore icon indicating copy to clipboard operation
TrinityCore copied to clipboard

Spell: Cannot cast Flame Shield

Open Killyana opened this issue 11 years ago • 15 comments

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.

Killyana avatar Feb 04 '14 18:02 Killyana

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).

ghost avatar Feb 05 '14 16:02 ghost

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.

Killyana avatar Feb 05 '14 18:02 Killyana

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

Fateswhisper avatar Apr 10 '14 09:04 Fateswhisper

Fixed here https://github.com/TrinityCore/TrinityCore/commit/3236f1641c39223a66bac7aa4a03254b096ce7d8 ?

Killyana avatar Nov 23 '14 13:11 Killyana

Still bugged on rev. 5b5c0938da0f.

Killyana avatar Apr 30 '15 12:04 Killyana

@Killyana I also encountered the same problem, has been waiting for solution

mayaren888 avatar Mar 19 '16 11:03 mayaren888

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 ?

ghost avatar Mar 19 '16 12:03 ghost

@tkrokli I think it belongs to spelleffects.cpp

mayaren888 avatar Mar 19 '16 14:03 mayaren888

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

Riztazz avatar Jun 12 '19 10:06 Riztazz

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

junker1609 avatar Feb 07 '20 16:02 junker1609

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?

Matt0615 avatar Apr 24 '20 19:04 Matt0615

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.

Matt0615 avatar May 19 '20 14:05 Matt0615

@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)?

ghost avatar Feb 27 '21 17:02 ghost

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

Riztazz avatar Jul 25 '21 05:07 Riztazz

anyone can make one PR of riztazz code if it's correct?

Aokromes avatar Feb 25 '24 23:02 Aokromes

5d7ae76d6f2a0f6f6416ff754d2243f3aafcc7d5

github-actions[bot] avatar Mar 17 '24 14:03 github-actions[bot]

My code was only meant as a starting point, but glad to see it fixed :)

Riztazz avatar Mar 18 '24 14:03 Riztazz