Skip to content

Commit

Permalink
[12333] Add some taxi flying spell cast exceptions
Browse files Browse the repository at this point in the history
This will fix quests 10525 and 11142
  • Loading branch information
xfurry committed Jan 18, 2013
1 parent b0872cf commit 2b5261d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
13 changes: 12 additions & 1 deletion src/game/Spell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5116,7 +5116,18 @@ SpellCastResult Spell::CheckCast(bool strict)

// Not allow casting on flying player
if (target->IsTaxiFlying())
return SPELL_FAILED_BAD_TARGETS;
{
switch (m_spellInfo->Id)
{
// Except some spells from Taxi Flying cast
case 36573: // Vision Guide
case 42316: // Alcaz Survey Credit
case 42385: // Alcaz Survey Aura
break;
default:
return SPELL_FAILED_BAD_TARGETS;
}
}

if (!m_IsTriggeredSpell && !m_spellInfo->HasAttribute(SPELL_ATTR_EX2_IGNORE_LOS) && VMAP::VMapFactory::checkSpellForLoS(m_spellInfo->Id) && !m_caster->IsWithinLOSInMap(target))
return SPELL_FAILED_LINE_OF_SIGHT;
Expand Down
22 changes: 20 additions & 2 deletions src/game/SpellAuras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1497,8 +1497,16 @@ void Aura::TriggerSpell()
// case 36556: break;
// // Cursed Scarab Despawn Periodic
// case 36561: break;
// // Vision Guide
// case 36573: break;
case 36573: // Vision Guide
{
if (GetAuraTicks() == 10 && target->GetTypeId() == TYPEID_PLAYER)
{
((Player*)target)->AreaExploredOrEventHappens(10525);
target->RemoveAurasDueToSpell(36573);
}

return;
}
// // Cannon Charging (platform)
// case 36785: break;
// // Cannon Charging (self)
Expand Down Expand Up @@ -2181,6 +2189,11 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
target->RemoveAurasDueToSpell(32346);
return;
}
case 36587: // Vision Guide
{
target->CastSpell(target, 36573, true, NULL, this);
return;
}
// Gender spells
case 38224: // Illidari Agent Illusion
case 37096: // Blood Elf Illusion
Expand Down Expand Up @@ -2603,6 +2616,11 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
target->RemoveAurasDueToSpell(41105);
return;
}
case 42385: // Alcaz Survey Aura
{
target->CastSpell(target, 42316, true, NULL, this);
return;
}
case 42454: // Captured Totem
{
if (m_removeMode == AURA_REMOVE_BY_DEFAULT)
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "12332"
#define REVISION_NR "12333"
#endif // __REVISION_NR_H__

14 comments on commit 2b5261d

@rsa
Copy link
Contributor

@rsa rsa commented on 2b5261d Jan 18, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very suspicious for first case. need reconstruct 37715...

@xfurry
Copy link
Member Author

@xfurry xfurry commented on 2b5261d Jan 18, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean? What's wrong with it?

@Dokman
Copy link

@Dokman Dokman commented on 2b5261d Jan 18, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one question xfurry what does it means in this case GetAuraTicks

@xfurry
Copy link
Member Author

@xfurry xfurry commented on 2b5261d Jan 18, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Dokman: this means after the aura has ticked 10 times. It needs to be checked, because, the aura duration is much larger than expected and will stuck player with that aura for too long if not remove after 10 ticks.
This bug was also reported to happen on blizz, but it seems they never fixed it, or fixed it somehow with the server-side spell.

@Dokman
Copy link

@Dokman Dokman commented on 2b5261d Jan 18, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see, thx xfurry

@Dokman
Copy link

@Dokman Dokman commented on 2b5261d Jan 18, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok i have a lot of questions because i know the control structures and OOP but a little i know how works the control structures and a little of idea of OOP, but i am reading code alot i see that if you want to put an aura you have to put target-> but i need more information of cases, i am noobie

@rsa
Copy link
Contributor

@rsa rsa commented on 2b5261d Jan 18, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your manually count ticks, blizz newer do it. spell 37715 must have stacked dummy aura for counting, also (sorry, cannot find sniff with it), if i'm remember true, must have triggered/proced "after 10 stacks" another dummy spell. your way also usable, but this not "true emulation", this - simple half-hack :)

@xfurry
Copy link
Member Author

@xfurry xfurry commented on 2b5261d Jan 18, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rsa Maybe you are right. But it won't actually matter too much if we trigger another stacking aura 10 times and check the stacks in the dummy aura, or just count the aura ticks as I did. Blizz method I will just make the code complicated in this case.
And since this is a server side spell, we can't actually know what happens, so the "half-hack" would do just fine. :)

@VladimirMangos
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Blizz method I will just make the code complicated in this case." but will not hack.

@Schmoozerd
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but to implement some server side spells for this, we would require a sniff containing them.
Otherwise it is indeed possible that they did remote these spells

@xfurry
Copy link
Member Author

@xfurry xfurry commented on 2b5261d Jan 18, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'mon guys... there are tons of other hacks in mangos which are much more worse than this one, and you are complaining about a workaround for a possibly existing server side spell.

Let's come into our senses.
It won't help us in any way, adding a dummy server side spell aura (or whatever blizz used here) in spell_template, and then check the stacks of the aura and then apply the same code in the dummy aura function.

@Lillecarl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xfurry as long as we don't know how to do the "proper way" this is just fine :) I do not blame you, since the output is all the same. But personally i agree with both you and rsa. I think its great that we produce, and this is not really what i would like to call a hack. But if it is, add a note or something so someone with knowledge/time can fix this at some time :) (Something like // Not 100% blizzlike)

@Schmoozerd
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guys - please stop arguing about something we have no soures to conclude.

XFurry's solution is fine to the knowledge we have.
And inventing server side spells is only an option with very good proof (at least dbc data from other client versions, better a sniff showing that the spell is still used)

Always remember:

  • Blizz uses server-side spells
  • Blizz sometimes stopps using a spell for something

Hence we cannot do things only because we assume this might be the way it could be done by blizz, we need strong proof.

In this case here we know a behaviour as xfurry programmed it. And he programmed it in a reasonable way.
Hence without solid proof that there is indeed used a server-side spell on 335a client by blizz, suggesting that this was inproper is unreasonable.

@rsa
Copy link
Contributor

@rsa rsa commented on 2b5261d Jan 18, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gentlemens, when I was making an observation, I mean a very different side of the code, namely transparency and portability to newer versions of client. Code Xfurry completely fulfills the required functions, but far from certain that it will work in the stream 4.3.4/5.0. I've encountered a many spells like this, radically reworked by blizz, in the case if we have recovered through the DB spell emulation - his continues work, and in the case of methods, such as this - it is necessary to rewrite the entire hack. It is because the same hack, but done in the usual way (through server-side spells) is much more logical to use.
However, everyone decides it for himself.

Please sign in to comment.