Core/Vehicles: Fixed seat id for auras with SPELL_AURA_CONTROL_VEHICLE. Also always allow npc passengers to cast spells and remove TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE hacks.
* Author: Horn. Please give feedback, I tested a lot stuff, but it will be appreciated. * One of the fixes allow all creatures to cast when being passangers, researched, this doesn't involve players. * This basically rewrittes vehicle seat formula calculated, so it fix quite stuff that will not be visible and some eye candies: #3831 and #1984 Heart part ;) (which magically fix a lot more of it and some quests), also Yog-Sarron mechanics
This commit is contained in:
1 parent
fd25bdd4b6
commit
452e585f7b
4 files changed
+8
-6
No files matched your search
@@ -17064,7 +17064,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
|
||||
}
|
||||
|
||||
if (IsInMap(caster))
|
||||
caster->CastCustomSpell(itr->second.spellId, SpellValueMod(SPELLVALUE_BASE_POINT0+i), seatId+1, target, GetVehicleKit() ? TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE : TRIGGERED_NONE, NULL, NULL, origCasterGUID);
|
||||
caster->CastCustomSpell(itr->second.spellId, SpellValueMod(SPELLVALUE_BASE_POINT0+i), seatId, target, GetVehicleKit() ? TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE : TRIGGERED_NONE, NULL, NULL, origCasterGUID);
|
||||
else // This can happen during Player::_LoadAuras
|
||||
{
|
||||
int32 bp0 = seatId;
|
||||
@@ -17094,7 +17094,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
|
||||
|
||||
void Unit::EnterVehicle(Unit* base, int8 seatId)
|
||||
{
|
||||
CastCustomSpell(VEHICLE_SPELL_RIDE_HARDCODED, SPELLVALUE_BASE_POINT0, seatId+1, base, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
|
||||
CastCustomSpell(VEHICLE_SPELL_RIDE_HARDCODED, SPELLVALUE_BASE_POINT0, seatId, base, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
|
||||
}
|
||||
|
||||
void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* aurApp)
|
||||
|
||||
@@ -3199,7 +3199,8 @@ void AuraEffect::HandleAuraControlVehicle(AuraApplication const* aurApp, uint8 m
|
||||
|
||||
if (apply)
|
||||
{
|
||||
caster->_EnterVehicle(target->GetVehicleKit(), m_amount - 1, aurApp);
|
||||
// correct amount is already calculated adding one more -1 meant calculated amount - 1
|
||||
caster->_EnterVehicle(target->GetVehicleKit(), m_amount, aurApp);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -4853,9 +4853,10 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
if (!checkMask)
|
||||
checkMask = VEHICLE_SEAT_FLAG_CAN_ATTACK;
|
||||
|
||||
// All creatures should be able to cast as passengers freely, restriction and attribute are only for players
|
||||
VehicleSeatEntry const* vehicleSeat = vehicle->GetSeatForPassenger(m_caster);
|
||||
if (!(m_spellInfo->AttributesEx6 & SPELL_ATTR6_CASTABLE_WHILE_ON_VEHICLE) && !(m_spellInfo->Attributes & SPELL_ATTR0_CASTABLE_WHILE_MOUNTED)
|
||||
&& (vehicleSeat->m_flags & checkMask) != checkMask)
|
||||
&& (vehicleSeat->m_flags & checkMask) != checkMask && m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
}
|
||||
|
||||
|
||||
@@ -226,13 +226,13 @@ class boss_ick : public CreatureScript
|
||||
case EVENT_TOXIC_WASTE:
|
||||
if (Creature* krick = GetKrick())
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
krick->CastSpell(target, SPELL_TOXIC_WASTE, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
|
||||
krick->CastSpell(target, SPELL_TOXIC_WASTE);
|
||||
events.ScheduleEvent(EVENT_TOXIC_WASTE, urand(7000, 10000));
|
||||
break;
|
||||
case EVENT_SHADOW_BOLT:
|
||||
if (Creature* krick = GetKrick())
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
krick->CastSpell(target, SPELL_SHADOW_BOLT, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
|
||||
krick->CastSpell(target, SPELL_SHADOW_BOLT);
|
||||
events.ScheduleEvent(EVENT_SHADOW_BOLT, 15000);
|
||||
return;
|
||||
case EVENT_MIGHTY_KICK:
|
||||
|
||||
Reference in new issue
Block a user