From e81175ec11124e885d349b1dca257d0cf97bdd85 Mon Sep 17 00:00:00 2001 From: QAston Date: Mon, 15 Jun 2009 01:10:09 +0200 Subject: *Fix Hungering Cold. --HG-- branch : trunk rename : sql/updates/3997_world_spell_proc_event.sql => sql/updates/4000_world_spell_proc_event.sql --- src/game/Unit.cpp | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'src/game/Unit.cpp') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 944a92ae755..3b1889d03f2 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -7035,6 +7035,32 @@ bool Unit::HandleModDamagePctTakenAuraProc(Unit *pVictim, uint32 damage, AuraEff return true; } +// Used in case when access to whole aura is needed +// All procs should be handled like this... +bool Unit::HandleAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const * procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown, bool * handled) +{ + SpellEntry const *dummySpell = triggeredByAura->GetSpellProto(); + + switch(dummySpell->SpellFamilyName) + { + case SPELLFAMILY_DEATHKNIGHT: + { + switch(dummySpell->Id) + { + // Hungering Cold aura drop + case 51209: + *handled = true; + // Drop only in disease case + if (procSpell && procSpell->Dispel == DISPEL_DISEASE) + return false; + return true; + } + break; + } + } + return false; +} + bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const *procSpell, uint32 procFlags, uint32 procEx, uint32 cooldown) { // Get triggered aura spell info @@ -12498,8 +12524,16 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag if (GetTypeId() == TYPEID_PLAYER && i->spellProcEvent && i->spellProcEvent->cooldown) cooldown = i->spellProcEvent->cooldown; - uint32 procDebug = 0; + // This bool is needed till separate aura effect procs are still here + bool handled = false; + if (HandleAuraProc(pTarget, damage, i->aura, procSpell, procFlag, procExtra, cooldown, &handled)) + { + sLog.outDebug("ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), Id); + takeCharges = true; + } + uint32 procDebug = 0; + if (!handled) for (uint8 effIndex = 0; effIndexeffMask & (1< Date: Sun, 14 Jun 2009 21:04:20 -0500 Subject: *Some update of vehicle. --HG-- branch : trunk --- src/game/Unit.cpp | 44 +++++++++++++++++++++++++++----------------- src/game/Unit.h | 2 +- src/game/Vehicle.cpp | 46 ++++++++++++++++++++++++++++++---------------- 3 files changed, 58 insertions(+), 34 deletions(-) (limited to 'src/game/Unit.cpp') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 3b1889d03f2..e1120e90d12 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -417,7 +417,7 @@ void Unit::SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end) addUnitState(UNIT_STAT_MOVE); } -void Unit::SendMonsterMoveTransport(Vehicle *vehicle, bool apply) +void Unit::SendMonsterMoveTransport(Vehicle *vehicle) { WorldPacket data(SMSG_MONSTER_MOVE_TRANSPORT, GetPackGUID().size()+vehicle->GetPackGUID().size()); data.append(GetPackGUID()); @@ -432,9 +432,9 @@ void Unit::SendMonsterMoveTransport(Vehicle *vehicle, bool apply) data << GetTransOffsetO(); data << uint32(MOVEFLAG_ENTER_TRANSPORT); data << uint32(0); // move time - data << GetTransOffsetX(); - data << GetTransOffsetY(); - data << GetTransOffsetZ(); + data << uint32(0);//GetTransOffsetX(); + data << uint32(0);//GetTransOffsetY(); + data << uint32(0);//GetTransOffsetZ(); SendMessageToSet(&data, true); } @@ -3508,6 +3508,7 @@ void Unit::InterruptSpell(uint32 spellType, bool withDelayed, bool withInstant) { assert(spellType < CURRENT_MAX_SPELL); + //sLog.outDebug("Interrupt spell for unit %u.", GetEntry()); Spell *spell = m_currentSpells[spellType]; if(spell && (withDelayed || spell->getState() != SPELL_STATE_DELAYED) @@ -13534,6 +13535,9 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss) // Prevent killing unit twice (and giving reward from kill twice) if (!pVictim->GetHealth()) return; + + //sLog.outError("%u kill %u", GetEntry(), pVictim->GetEntry()); + pVictim->SetHealth(0); // find player: owner of controlled `this` or `this` itself maybe @@ -13733,7 +13737,7 @@ void Unit::SetControlled(bool apply, UnitState state) { case UNIT_STAT_STUNNED: if(HasAuraType(SPELL_AURA_MOD_STUN)) return; else SetStunned(false); break; - case UNIT_STAT_ROOT: if(HasAuraType(SPELL_AURA_MOD_ROOT)) return; + case UNIT_STAT_ROOT: if(HasAuraType(SPELL_AURA_MOD_ROOT) || m_Vehicle) return; else SetRooted(false); break; case UNIT_STAT_CONFUSED:if(HasAuraType(SPELL_AURA_MOD_CONFUSE)) return; else SetConfused(false); break; @@ -13943,6 +13947,8 @@ void Unit::SetCharmedBy(Unit* charmer, CharmType type) switch(type) { case CHARM_TYPE_VEHICLE: + SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_24); + ((Player*)charmer)->SetClientControl(this, 1); ((Player*)charmer)->SetViewpoint(this, true); ((Player*)charmer)->VehicleSpellInitialize(); break; @@ -14043,6 +14049,7 @@ void Unit::RemoveCharmedBy(Unit *charmer) switch(type) { case CHARM_TYPE_VEHICLE: + ((Player*)charmer)->SetClientControl(charmer, 1); ((Player*)charmer)->SetViewpoint(this, false); break; case CHARM_TYPE_POSSESS: @@ -14506,16 +14513,14 @@ void Unit::EnterVehicle(Vehicle *vehicle, int8 seatId) return; } - m_Vehicle->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_24); - //m_Vehicle->setFaction(getFaction()); - addUnitState(UNIT_STAT_ONVEHICLE); + SetControlled(true, UNIT_STAT_ROOT); //movementInfo is set in AddPassenger //packets are sent in AddPassenger if(GetTypeId() == TYPEID_PLAYER) { - ((Player*)this)->SetClientControl(vehicle, 1); + //((Player*)this)->SetClientControl(vehicle, 1); WorldPacket data(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, 0); ((Player*)this)->GetSession()->SendPacket(&data); } @@ -14545,16 +14550,17 @@ void Unit::ExitVehicle() if(!m_Vehicle) return; - m_Vehicle->RemovePassenger(this); + //sLog.outError("exit vehicle"); - m_Vehicle->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_24); - //setFaction((GetTeam() == ALLIANCE) ? GetCreatureInfo()->faction_A : GetCreatureInfo()->faction_H); + m_Vehicle->RemovePassenger(this); // This should be done before dismiss, because there may be some aura removal Vehicle *vehicle = m_Vehicle; m_Vehicle = NULL; clearUnitState(UNIT_STAT_ONVEHICLE); + SetControlled(false, UNIT_STAT_ROOT); + RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_FLY_UNK1); m_movementInfo.t_x = 0; m_movementInfo.t_y = 0; @@ -14563,18 +14569,16 @@ void Unit::ExitVehicle() m_movementInfo.t_time = 0; m_movementInfo.t_seat = 0; - //Send leave vehicle + //Send leave vehicle, not correct if(GetTypeId() == TYPEID_PLAYER) { - ((Player*)this)->SetClientControl(this, 1); + //((Player*)this)->SetClientControl(this, 1); ((Player*)this)->SendTeleportAckMsg(); } WorldPacket data; BuildHeartBeatMsg(&data); SendMessageToSet(&data, false); - //SendMonsterMoveTransport(m_Vehicle, false); - if(vehicle->GetOwnerGUID() == GetGUID()) vehicle->Dismiss(); } @@ -14645,11 +14649,17 @@ void Unit::BuildMovementPacket(ByteBuffer *data) const // 0x04000000 if(GetUnitMovementFlags() & MOVEMENTFLAG_SPLINE) *data << (float)m_movementInfo.u_unk1; + + /*if(GetTypeId() == TYPEID_PLAYER) + { + sLog.outString("Send MovementInfo:"); + OutMovementInfo(); + }*/ } void Unit::OutMovementInfo() const { - sLog.outString("MovementInfo: Flag %u, Unk1 %u, Time %u, Pos %f %f %f %f, Fall %u", m_movementInfo.flags, (uint32)m_movementInfo.unk1, m_movementInfo.time, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation(), m_movementInfo.fallTime); + sLog.outString("MovementInfo for %u: Flag %u, Unk1 %u, Time %u, Pos %f %f %f %f, Fall %u", GetEntry(), m_movementInfo.flags, (uint32)m_movementInfo.unk1, m_movementInfo.time, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation(), m_movementInfo.fallTime); if(m_movementInfo.flags & MOVEMENTFLAG_ONTRANSPORT) sLog.outString("Transport: GUID " UI64FMTD ", Pos %f %f %f %f, Time %u, Seat %d", m_movementInfo.t_guid, m_movementInfo.t_x, m_movementInfo.t_y, m_movementInfo.t_z, m_movementInfo.t_o, m_movementInfo.t_time, (int32)m_movementInfo.t_seat); if((m_movementInfo.flags & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING2)) || (m_movementInfo.unk1 & 0x20)) diff --git a/src/game/Unit.h b/src/game/Unit.h index 6ecdc8ccc63..976e5aceadf 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1311,7 +1311,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 MoveFlags, uint32 time, float speedZ, Player *player = NULL); //void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player = NULL); void SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end); - void SendMonsterMoveTransport(Vehicle *vehicle, bool apply); + void SendMonsterMoveTransport(Vehicle *vehicle); void SendMonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime = 0, Player* player = NULL); void SendMonsterMoveWithSpeedToCurrentDestination(Player* player = NULL); void SendMovementFlagUpdate(); diff --git a/src/game/Vehicle.cpp b/src/game/Vehicle.cpp index 2271bcc3c4a..3fbbd9f922c 100644 --- a/src/game/Vehicle.cpp +++ b/src/game/Vehicle.cpp @@ -44,8 +44,7 @@ void Vehicle::AddToWorld() if(m_zoneScript) m_zoneScript->OnCreatureCreate(this, true); ObjectAccessor::Instance().AddObject(this); - Unit::AddToWorld(); - AIM_Initialize(); + switch(GetEntry()) { //case 27850:InstallAccessory(27905,1);break; @@ -66,11 +65,28 @@ void Vehicle::AddToWorld() InstallAccessory(33142,2); break; } - if(!GetMaxPower(POWER_MANA)) // m_vehicleInfo->36 + for(uint32 i = 0; i < MAX_SPELL_VEHICLE; ++i) { - setPowerType(POWER_ENERGY); - SetMaxPower(POWER_ENERGY, 100); + if(!m_spells[i]) + continue; + + SpellEntry const *spellInfo = sSpellStore.LookupEntry(m_spells[i]); + if(!spellInfo) + continue; + + if(spellInfo->powerType == POWER_MANA) + break; + + if(spellInfo->powerType == POWER_ENERGY) + { + setPowerType(POWER_ENERGY); + SetMaxPower(POWER_ENERGY, 100); + break; + } } + + Unit::AddToWorld(); + AIM_Initialize(); } } @@ -114,7 +130,7 @@ void Vehicle::Update(uint32 diff) { Creature::Update(diff); //310 - if(getPowerType() == POWER_ENERGY) + if(getPowerType() == POWER_ENERGY) // m_vehicleInfo->36 ModifyPower(POWER_ENERGY, 100); } @@ -224,6 +240,8 @@ void Vehicle::InstallAccessory(uint32 entry, int8 seatId) accessory->m_Vehicle = this; AddPassenger(accessory, seatId); + // This is not good, we have to send update twice + accessory->SendMovementFlagUpdate(); } bool Vehicle::AddPassenger(Unit *unit, int8 seatId) @@ -278,16 +296,12 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId) if(unit->GetTypeId() == TYPEID_PLAYER && seat->first == 0 && seat->second.seatInfo->IsUsable()) // not right SetCharmedBy(unit, CHARM_TYPE_VEHICLE); - if(false) - { - unit->SendMonsterMoveTransport(this, true); - } - else - { - if(unit->GetTypeId() == TYPEID_PLAYER) - ((Player*)unit)->SendTeleportAckMsg(); - unit->SendMovementFlagUpdate(); - } + if(IsInWorld()) + unit->SendMonsterMoveTransport(this); + + //if(unit->GetTypeId() == TYPEID_PLAYER) + // ((Player*)unit)->SendTeleportAckMsg(); + //unit->SendMovementFlagUpdate(); return true; } -- cgit v1.2.3 From 7268e291b40be2eb67d7acee88eee5ba5de98c55 Mon Sep 17 00:00:00 2001 From: QAston Date: Mon, 15 Jun 2009 13:42:43 +0200 Subject: *Fix improved drain soul. --HG-- branch : trunk --- src/game/SharedDefines.h | 2 +- src/game/SpellMgr.h | 2 +- src/game/Unit.cpp | 12 +++++++----- src/game/Unit.h | 4 ++-- 4 files changed, 11 insertions(+), 9 deletions(-) (limited to 'src/game/Unit.cpp') diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index e1440d45454..b6ac8054ce2 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -344,7 +344,7 @@ enum SpellCategory #define SPELL_ATTR_EX3_REQ_OFFHAND 0x01000000 // 24 Req offhand weapon #define SPELL_ATTR_EX3_UNK25 0x02000000 // 25 no cause spell pushback ? #define SPELL_ATTR_EX3_CAN_PROC_TRIGGERED 0x04000000 // 26 -#define SPELL_ATTR_EX3_UNK27 0x08000000 // 27 +#define SPELL_ATTR_EX3_DRAIN_SOUL 0x08000000 // 27 only drain soul has this flag #define SPELL_ATTR_EX3_UNK28 0x10000000 // 28 #define SPELL_ATTR_EX3_UNK29 0x20000000 // 29 #define SPELL_ATTR_EX3_UNK30 0x40000000 // 30 diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index 330dfd56eee..f217a64f298 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -424,7 +424,7 @@ enum ProcFlags PROC_FLAG_ON_TRAP_ACTIVATION = 0x00200000, // 21 On trap activation PROC_FLAG_TAKEN_OFFHAND_HIT = 0x00400000, // 22 Taken off-hand melee attacks(not used) - PROC_FLAG_SUCCESSFUL_OFFHAND_HIT = 0x00800000, // 23 Successful off-hand melee attacks + PROC_FLAG_SUCCESSFUL_OFFHAND_HIT = 0x00800000, // 23 Successful off-hand melee attacks ( this is probably wrong ) PROC_FLAG_DEATH = 0x01000000 // 24 Died in any way }; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index e1120e90d12..408bf62f224 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -7275,15 +7275,16 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig trigger_spell_id = 18093; } - // Drain Soul + // Improved Drain Soul else if (auraSpellInfo->SpellFamilyFlags[0] & 0x4000) { - Unit::AuraEffectList const& mAddFlatModifier = GetAurasByType(SPELL_AURA_ADD_FLAT_MODIFIER); + Unit::AuraEffectList const& mAddFlatModifier = GetAurasByType(SPELL_AURA_DUMMY); for(Unit::AuraEffectList::const_iterator i = mAddFlatModifier.begin(); i != mAddFlatModifier.end(); ++i) { if ((*i)->GetMiscValue() == SPELLMOD_CHANCE_OF_SUCCESS && (*i)->GetSpellProto()->SpellIconID == 113) { int32 value2 = CalculateSpellDamage((*i)->GetSpellProto(),2,(*i)->GetSpellProto()->EffectBasePoints[2],this); + basepoints0 = value2 * GetMaxPower(POWER_MANA) / 100; // Drain Soul CastCustomSpell(this, 18371, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); break; @@ -12478,7 +12479,7 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag // Fill procTriggered list for(AuraMap::const_iterator itr = GetAuras().begin(); itr!= GetAuras().end(); ++itr) { - // Do not allow auras to proc from effect of itself + // Do not allow auras to proc from effect triggered by itself if (procAura && procAura->Id == itr->first) continue; ProcTriggeredData triggerData(itr->second); @@ -13365,8 +13366,9 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura * aura, SpellEntry co return false; } // Aura added by spell can`t trogger from self (prevent drop charges/do triggers) - // But except periodic triggers (can triggered from self) - if(procSpell && procSpell->Id == spellProto->Id && !(spellProto->procFlags&PROC_FLAG_ON_TAKE_PERIODIC)) + // But except periodic and kill triggers (can triggered from self) + if(procSpell && procSpell->Id == spellProto->Id + && !(spellProto->procFlags&PROC_FLAG_ON_TAKE_PERIODIC | PROC_FLAG_KILL)) return false; // Check if current equipment allows aura to proc diff --git a/src/game/Unit.h b/src/game/Unit.h index 976e5aceadf..b7868c6c83b 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -354,8 +354,8 @@ enum DamageTypeToSchool enum AuraRemoveMode { - AURA_REMOVE_BY_DEFAULT=0, - AURA_REMOVE_BY_STACK, // change stack, single aura remove, + AURA_REMOVE_BY_DEFAULT=0, // scripted remove, remove by stack with aura with different ids and sc aura remove + AURA_REMOVE_BY_STACK, // replace by aura with same id AURA_REMOVE_BY_CANCEL, AURA_REMOVE_BY_ENEMY_SPELL, // dispel and absorb aura destroy AURA_REMOVE_BY_EXPIRE, // dispel and absorb aura destroy -- cgit v1.2.3 From 425863abd9e59b55bfaf75fa61ebf9bec69acbc1 Mon Sep 17 00:00:00 2001 From: QAston Date: Mon, 15 Jun 2009 17:15:19 +0200 Subject: *Fix dead loop in proc system. *Fix curse of doom. --HG-- branch : trunk --- src/game/Spell.h | 1 - src/game/SpellAuras.cpp | 38 ++++++++++++++++++++++++++------------ src/game/SpellEffects.cpp | 4 ++-- src/game/SpellMgr.cpp | 8 ++++---- src/game/Unit.cpp | 2 +- 5 files changed, 33 insertions(+), 20 deletions(-) (limited to 'src/game/Unit.cpp') diff --git a/src/game/Spell.h b/src/game/Spell.h index 5309d881990..9f666ecf47b 100644 --- a/src/game/Spell.h +++ b/src/game/Spell.h @@ -274,7 +274,6 @@ class Spell void EffectDualWield(uint32 i); void EffectPickPocket(uint32 i); void EffectAddFarsight(uint32 i); - void EffectSummonWild(uint32 i); void EffectHealMechanical(uint32 i); void EffectJump(uint32 i); void EffectJump2(uint32 i); diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 2cba7a7344c..bc7c07768d6 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -4593,6 +4593,20 @@ void AuraEffect::HandlePeriodicDamage(bool apply, bool Real, bool changeAmount) // For prevent double apply bonuses bool loading = (m_target->GetTypeId() == TYPEID_PLAYER && ((Player*)m_target)->GetSession()->PlayerLoading()); + // Curse of Doom + // This is a hack - this aura should be handled by passive aura and proc doomguard spawn on kill, however there is no such aura in dbcs + if(m_spellProto->SpellFamilyName==SPELLFAMILY_WARLOCK && m_spellProto->SpellFamilyFlags.IsEqual(0,0x02,0)) + { + if (Real && !apply && GetParentAura()->GetRemoveMode()==AURA_REMOVE_BY_DEATH) + { + if (Unit * caster = GetCaster()) + { + if (caster->GetTypeId()==TYPEID_PLAYER && ((Player*)caster)->isHonorOrXPTarget(m_target)) + caster->CastSpell(m_target, 18662, true); + } + } + } + // Custom damage calculation after if (!apply || loading) return; @@ -5994,9 +6008,9 @@ void AuraEffect::PeriodicTick() SpellEntry const* spellProto = GetSpellProto(); // Set trigger flag - uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC | PROC_FLAG_SUCCESSFUL_DAMAGING_SPELL_HIT; - uint32 procVictim = PROC_FLAG_ON_TAKE_PERIODIC | PROC_FLAG_TAKEN_DAMAGING_SPELL_HIT; - uint32 procEx = PROC_EX_NORMAL_HIT; + uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC; + uint32 procVictim = PROC_FLAG_ON_TAKE_PERIODIC; + uint32 procEx = PROC_EX_NORMAL_HIT | PROC_EX_INTERNAL_DOT; pdamage = (pdamage <= absorb+resist) ? 0 : (pdamage-absorb-resist); if (pdamage) procVictim|=PROC_FLAG_TAKEN_ANY_DAMAGE; @@ -6059,9 +6073,9 @@ void AuraEffect::PeriodicTick() int32 stackAmount = GetParentAura()->GetStackAmount(); // Set trigger flag - uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC | PROC_FLAG_SUCCESSFUL_DAMAGING_SPELL_HIT; - uint32 procVictim = PROC_FLAG_ON_TAKE_PERIODIC | PROC_FLAG_TAKEN_DAMAGING_SPELL_HIT; - uint32 procEx = PROC_EX_NORMAL_HIT; + uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC; + uint32 procVictim = PROC_FLAG_ON_TAKE_PERIODIC; + uint32 procEx = PROC_EX_NORMAL_HIT | PROC_EX_INTERNAL_DOT; pdamage = (pdamage <= absorb+resist) ? 0 : (pdamage-absorb-resist); if (pdamage) procVictim|=PROC_FLAG_TAKEN_ANY_DAMAGE; @@ -6184,9 +6198,9 @@ void AuraEffect::PeriodicTick() } } - uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC | PROC_FLAG_SUCCESSFUL_HEALING_SPELL; - uint32 procVictim = PROC_FLAG_ON_TAKE_PERIODIC | PROC_FLAG_TAKEN_HEALING_SPELL; - uint32 procEx = PROC_EX_NORMAL_HIT; + uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC; + uint32 procVictim = PROC_FLAG_ON_TAKE_PERIODIC; + uint32 procEx = PROC_EX_NORMAL_HIT | PROC_EX_INTERNAL_HOT; // ignore item heals if(!haveCastItem) pCaster->ProcDamageAndSpell(target, procAttacker, procVictim, procEx, pdamage, BASE_ATTACK, spellProto); @@ -6381,9 +6395,9 @@ void AuraEffect::PeriodicTick() pCaster->SendSpellNonMeleeDamageLog(&damageInfo); // Set trigger flag - uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC | PROC_FLAG_SUCCESSFUL_DAMAGING_SPELL_HIT; - uint32 procVictim = PROC_FLAG_ON_TAKE_PERIODIC | PROC_FLAG_TAKEN_DAMAGING_SPELL_HIT; - uint32 procEx = createProcExtendMask(&damageInfo, SPELL_MISS_NONE); + uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC; + uint32 procVictim = PROC_FLAG_ON_TAKE_PERIODIC; + uint32 procEx = createProcExtendMask(&damageInfo, SPELL_MISS_NONE) | PROC_EX_INTERNAL_DOT; if (damageInfo.damage) procVictim|=PROC_FLAG_TAKEN_ANY_DAMAGE; diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 5506ec0dab1..f29c883a5f4 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -3364,6 +3364,8 @@ void Spell::EffectSummonType(uint32 i) float radius = GetSpellRadiusForHostile(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i])); int32 amount = damage > 0 ? damage : 1; + if (m_spellInfo->Id == 18662) // Curse of Doom + amount = 1; for(int32 count = 0; count < amount; ++count) { @@ -6655,8 +6657,6 @@ void Spell::SummonGuardian(uint32 entry, SummonPropertiesEntry const *properties switch(m_spellInfo->Id) { case 1122: // Inferno - case 18662: // Curse of Doom - amount = 1; break; } int32 duration = GetSpellDuration(m_spellInfo); diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index cc9dcfb14e4..7ab580e3042 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -1275,11 +1275,11 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const* spellPr { if (EventProcFlag & PROC_FLAG_SUCCESSFUL_DAMAGING_SPELL_HIT) { - if (!(procFlags & PROC_FLAG_SUCCESSFUL_DAMAGING_SPELL_HIT)) + if (!(procEx & PROC_EX_INTERNAL_DOT)) return false; } else if (EventProcFlag & PROC_FLAG_SUCCESSFUL_HEALING_SPELL - && !(procFlags & PROC_FLAG_SUCCESSFUL_HEALING_SPELL)) + && !(procEx & PROC_EX_INTERNAL_HOT)) return false; } @@ -1287,11 +1287,11 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const* spellPr { if (EventProcFlag & PROC_FLAG_TAKEN_DAMAGING_SPELL_HIT) { - if (!(procFlags & PROC_FLAG_TAKEN_DAMAGING_SPELL_HIT)) + if (!(procEx & PROC_EX_INTERNAL_DOT)) return false; } else if (EventProcFlag & PROC_FLAG_TAKEN_HEALING_SPELL - && !(procFlags & PROC_FLAG_TAKEN_HEALING_SPELL)) + && !(procEx & PROC_EX_INTERNAL_HOT)) return false; } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 408bf62f224..38963dc51d5 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -13368,7 +13368,7 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura * aura, SpellEntry co // Aura added by spell can`t trogger from self (prevent drop charges/do triggers) // But except periodic and kill triggers (can triggered from self) if(procSpell && procSpell->Id == spellProto->Id - && !(spellProto->procFlags&PROC_FLAG_ON_TAKE_PERIODIC | PROC_FLAG_KILL)) + && !(spellProto->procFlags&(PROC_FLAG_ON_TAKE_PERIODIC | PROC_FLAG_KILL))) return false; // Check if current equipment allows aura to proc -- cgit v1.2.3 From 109302999d63c85fe14842d1222f0ce30addbe92 Mon Sep 17 00:00:00 2001 From: QAston Date: Mon, 15 Jun 2009 17:56:10 +0200 Subject: *Fix improved stormstrike - by CRAZyBUg --HG-- branch : trunk --- sql/updates/4023_world_spell_proc_event.sql | 4 ++++ sql/world_spell_full.sql | 2 ++ src/game/SpellMgr.cpp | 1 + src/game/SpellMgr.h | 2 ++ src/game/Unit.cpp | 5 +++++ 5 files changed, 14 insertions(+) create mode 100644 sql/updates/4023_world_spell_proc_event.sql (limited to 'src/game/Unit.cpp') diff --git a/sql/updates/4023_world_spell_proc_event.sql b/sql/updates/4023_world_spell_proc_event.sql new file mode 100644 index 00000000000..caa53b3c119 --- /dev/null +++ b/sql/updates/4023_world_spell_proc_event.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_proc_event` WHERE `entry` IN (51521, 51522); +INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES +( 51521, 0x00, 11, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Stormspike +( 51522, 0x00, 11, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0); -- Improved Stormspike \ No newline at end of file diff --git a/sql/world_spell_full.sql b/sql/world_spell_full.sql index 4580801b457..87fd476365e 100644 --- a/sql/world_spell_full.sql +++ b/sql/world_spell_full.sql @@ -1215,6 +1215,8 @@ INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `Spell ( 51474, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Astral Shift (Rank 1) ( 51478, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Astral Shift (Rank 2) ( 51479, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Astral Shift (Rank 3) +( 51521, 0x00, 11, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Stormstrike +( 51522, 0x00, 11, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Stormstrike ( 51528, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.5, 0, 0), -- Maelstrom Weapon (Rank 1) ( 51529, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 5, 0, 0), -- Maelstrom Weapon (Rank 2) ( 51530, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 7.5, 0, 0), -- Maelstrom Weapon (Rank 3) diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 7ab580e3042..dce89ec7007 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -583,6 +583,7 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) case 34700: // Allergic Reaction case 31719: // Suspension case 61987: // Avenging Wrath Marker + case 11196: // Recently Bandadged return false; case 12042: // Arcane Power return true; diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index f217a64f298..09ab1759669 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -459,6 +459,8 @@ enum ProcFlagsEx PROC_EX_EX_TRIGGER_ALWAYS = 0x0010000, // If set trigger always ( no matter another flags) used for drop charges PROC_EX_EX_ONE_TIME_TRIGGER = 0x0020000, // If set trigger always but only one time (not used) PROC_EX_INTERNAL_CANT_PROC = 0x0800000, + PROC_EX_INTERNAL_DOT = 0x1000000, // Only for internal use + PROC_EX_INTERNAL_HOT = 0x2000000 // Only for internal use PROC_EX_INTERNAL_TRIGGERED = 0x4000000, // Only for internal use PROC_EX_INTERNAL_REQ_FAMILY = 0x8000000 // Only for internal use }; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 38963dc51d5..89728d586a5 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -7757,6 +7757,11 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig ((Player*)this)->RemoveCategoryCooldown(1209); break; } + case 63375: // Improved Stormstrike + { + basepoints0 = GetCreateMana() * 0.20f; + break; + } // Brain Freeze case 57761: { -- cgit v1.2.3 From b9610f27dd2c55f63f9a96f1259a8dce33b71d88 Mon Sep 17 00:00:00 2001 From: megamage Date: Mon, 15 Jun 2009 12:02:55 -0500 Subject: *Check movementflag to interrupt casting instead of checking position. *Also some other fixes about movement flags. --HG-- branch : trunk --- .../scripts/scripts/zone/azshara/azshara.cpp | 4 +- .../scarlet_monastery/boss_headless_horseman.cpp | 4 +- .../utgarde_keep/boss_ingvar_the_plunderer.cpp | 2 +- src/game/Creature.cpp | 15 ++++-- src/game/Creature.h | 2 +- src/game/MovementHandler.cpp | 10 ++-- src/game/Player.cpp | 39 ++++++++-------- src/game/Player.h | 16 ------- src/game/PointMovementGenerator.cpp | 2 +- src/game/RandomMovementGenerator.cpp | 6 +-- src/game/Spell.cpp | 23 +-------- src/game/SpellAuras.cpp | 17 ++----- src/game/TargetedMovementGenerator.cpp | 6 +-- src/game/Traveller.h | 4 +- src/game/Unit.cpp | 54 ++++++++++++++++------ src/game/Unit.h | 26 ++++++++--- src/game/Vehicle.cpp | 2 +- src/game/WaypointMovementGenerator.cpp | 2 +- src/game/WorldSession.cpp | 2 +- 19 files changed, 119 insertions(+), 117 deletions(-) (limited to 'src/game/Unit.cpp') diff --git a/src/bindings/scripts/scripts/zone/azshara/azshara.cpp b/src/bindings/scripts/scripts/zone/azshara/azshara.cpp index 5223b6d93c3..6d191db16b2 100644 --- a/src/bindings/scripts/scripts/zone/azshara/azshara.cpp +++ b/src/bindings/scripts/scripts/zone/azshara/azshara.cpp @@ -310,7 +310,7 @@ struct TRINITY_DLL_DECL mob_rizzle_sprysprocketAI : public ScriptedAI Player* player = Unit::GetPlayer(PlayerGUID); SendText(MSG_ESCAPE_NOTICE, player); DoCast(m_creature, SPELL_PERIODIC_DEPTH_CHARGE); - m_creature->SetUnitMovementFlags(MOVEMENTFLAG_FLYING2 | MOVEMENTFLAG_SWIMMING); + m_creature->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING); m_creature->SetSpeed(MOVE_RUN, 0.85f, true); m_creature->GetMotionMaster()->MovementExpired(); m_creature->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP][0], WPs[CurrWP][1], WPs[CurrWP][2]); @@ -441,7 +441,7 @@ struct TRINITY_DLL_DECL mob_depth_chargeAI : public ScriptedAI void Reset() { - m_creature->SetUnitMovementFlags(MOVEMENTFLAG_FLYING2 | MOVEMENTFLAG_SWIMMING); + m_creature->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); we_must_die = false; must_die_timer = 1000; diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_headless_horseman.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_headless_horseman.cpp index 0cf5119f0d8..f0a80248c19 100644 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_headless_horseman.cpp +++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_headless_horseman.cpp @@ -400,7 +400,7 @@ struct TRINITY_DLL_DECL boss_headless_horsemanAI : public ScriptedAI { m_creature->SetVisibility(VISIBILITY_OFF); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_FLYING2); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_HOVER); m_creature->SetSpeed(MOVE_WALK,5.0f,true); wp_reached = false; count = 0; @@ -432,7 +432,7 @@ struct TRINITY_DLL_DECL boss_headless_horsemanAI : public ScriptedAI pInstance->SetData(GAMEOBJECT_PUMPKIN_SHRINE, 0); //hide gameobject break; case 19: - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING2);break; + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_HOVER);break; case 20: { Phase = 1; IsFlying = false; diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp index e3c66109dfc..035df9082c8 100644 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp +++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp @@ -295,7 +295,7 @@ struct TRINITY_DLL_DECL mob_annhylde_the_callerAI : public ScriptedAI void Reset() { - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_FLYING + MOVEMENTFLAG_FLYING2); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_FLYING + MOVEMENTFLAG_HOVER); m_creature->SetSpeed(MOVE_SWIM , 0.1f); m_creature->SetSpeed(MOVE_RUN , 0.1f); m_creature->SetSpeed(MOVE_WALK , 0.1f); diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index bfa185010fd..24fd970bddf 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -1648,9 +1648,13 @@ bool Creature::IsWithinSightDist(Unit const* u) const bool Creature::canStartAttack(Unit const* who, bool force) const { - if(isCivilian() - || !who->isInAccessiblePlaceFor(this) - || !canFly() && GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + if(isCivilian() || !who->isInAccessiblePlaceFor(this)) + return false; + + if(!canFly() && (GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)) + //|| who->IsControlledByPlayer() && who->IsFlying())) + // we cannot check flying for other creatures, too much map/vmap calculation + // TODO: should switch to range attack return false; if(!force && (IsNeutralToAll() || !IsWithinDistInMap(who, GetAttackDistance(who)))) @@ -2190,6 +2194,9 @@ bool Creature::LoadCreaturesAddon(bool reload) if (cainfo->move_flags != 0) SetUnitMovementFlags(cainfo->move_flags); + if(GetCreatureInfo()->InhabitType & INHABIT_AIR) + AddUnitMovementFlag(MOVEMENTFLAG_FLY_MODE); + if(cainfo->auras) { for (CreatureDataAddonAura const* cAura = cainfo->auras; cAura->spell_id; ++cAura) @@ -2504,4 +2511,4 @@ time_t Creature::GetLinkedCreatureRespawnTime() const } return 0; -} \ No newline at end of file +} diff --git a/src/game/Creature.h b/src/game/Creature.h index d7d070fc526..954259d8846 100644 --- a/src/game/Creature.h +++ b/src/game/Creature.h @@ -516,7 +516,7 @@ class TRINITY_DLL_SPEC Creature : public Unit bool isTrigger() const { return GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER; } bool canWalk() const { return GetCreatureInfo()->InhabitType & INHABIT_GROUND; } bool canSwim() const { return GetCreatureInfo()->InhabitType & INHABIT_WATER; } - bool canFly() const { return GetCreatureInfo()->InhabitType & INHABIT_AIR; } + //bool canFly() const { return GetCreatureInfo()->InhabitType & INHABIT_AIR; } void SetReactState(ReactStates st) { m_reactState = st; } ReactStates GetReactState() { return m_reactState; } bool HasReactState(ReactStates state) const { return (m_reactState == state); } diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp index c3c82d552ac..1a483a8869d 100644 --- a/src/game/MovementHandler.cpp +++ b/src/game/MovementHandler.cpp @@ -299,9 +299,6 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data ) plMover->SetPosition(movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o); plMover->UpdateFallInformationIfNeed(movementInfo, recv_data.GetOpcode()); - if(plMover->isMovingOrTurning()) - plMover->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - if(movementInfo.z < -500.0f) { if(plMover->InBattleGround() @@ -339,6 +336,13 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data ) if(mover->m_Vehicle) return; mover->GetMap()->CreatureRelocation((Creature*)mover, movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o); + + /*if(mover->canFly()) + { + bool flying = mover->IsFlying(); + if(flying != ((mover->GetByteValue(UNIT_FIELD_BYTES_1, 3) & 0x02) ? true : false)) + mover->SetFlying(flying); + }*/ } //sLog.outString("Receive Movement Packet %s:", opcodeTable[recv_data.GetOpcode()]); diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 7abe7f67d55..68545b6a379 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -5635,38 +5635,35 @@ bool Player::SetPosition(float x, float y, float z, float orientation, bool tele return false; } - Map *m = GetMap(); + //if(movementInfo.flags & MOVEMENTFLAG_MOVING) + // mover->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MOVE); + //if(movementInfo.flags & MOVEMENTFLAG_TURNING) + // mover->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TURNING); + //AURA_INTERRUPT_FLAG_JUMP not sure - const float old_x = GetPositionX(); - const float old_y = GetPositionY(); - const float old_z = GetPositionZ(); - const float old_r = GetOrientation(); + if(GetOrientation() != orientation) + RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TURNING); - if( teleport || old_x != x || old_y != y || old_z != z || old_r != orientation ) + bool move2d = (teleport || GetPositionX() != x || GetPositionY() != y); + if(move2d || GetPositionZ() != z) { - if (teleport || old_x != x || old_y != y || old_z != z) - RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MOVE | AURA_INTERRUPT_FLAG_TURNING); - else - RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TURNING); + RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MOVE); // move and update visible state if need - m->PlayerRelocation(this, x, y, z, orientation); + GetMap()->PlayerRelocation(this, x, y, z, orientation); // reread after Map::Relocation - m = GetMap(); - x = GetPositionX(); - y = GetPositionY(); - z = GetPositionZ(); + GetPosition(x, y, z); // group update - if(GetGroup() && (old_x != x || old_y != y)) + if(move2d && GetGroup()) SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION); - } - // code block for underwater state update - UpdateUnderwaterState(m, x, y, z); + // code block for underwater state update + UpdateUnderwaterState(GetMap(), x, y, z); - CheckExploreSystem(); + CheckExploreSystem(); + } return true; } @@ -6415,7 +6412,7 @@ void Player::CheckDuelDistance(time_t currTime) bool Player::IsOutdoorPvPActive() { - return (isAlive() && !HasInvisibilityAura() && !HasStealthAura() && (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP) || sWorld.IsPvPRealm()) && !HasUnitMovementFlag(MOVEMENTFLAG_FLYING2) && !isInFlight()); + return (isAlive() && !HasInvisibilityAura() && !HasStealthAura() && (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP) || sWorld.IsPvPRealm()) && !HasUnitMovementFlag(MOVEMENTFLAG_FLYING) && !isInFlight()); } void Player::DuelComplete(DuelCompleteType type) diff --git a/src/game/Player.h b/src/game/Player.h index 9dcad34f0e8..c879222d8d8 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -689,17 +689,6 @@ enum InstanceResetWarningType RAID_INSTANCE_EXPIRED = 5 }; -// flags that use in movement check for example at spell casting -MovementFlags const movementFlagsMask = MovementFlags( - MOVEMENTFLAG_FORWARD |MOVEMENTFLAG_BACKWARD |MOVEMENTFLAG_STRAFE_LEFT|MOVEMENTFLAG_STRAFE_RIGHT| - MOVEMENTFLAG_PITCH_UP|MOVEMENTFLAG_PITCH_DOWN|MOVEMENTFLAG_FLY_UNK1 | - MOVEMENTFLAG_JUMPING |MOVEMENTFLAG_FALLING |MOVEMENTFLAG_FLY_UP | - MOVEMENTFLAG_FLYING |MOVEMENTFLAG_SPLINE -); - -MovementFlags const movementOrTurningFlagsMask = MovementFlags( - movementFlagsMask | MOVEMENTFLAG_LEFT | MOVEMENTFLAG_RIGHT -); class InstanceSave; enum RestType @@ -1951,11 +1940,6 @@ class TRINITY_DLL_SPEC Player : public Unit } void HandleFall(MovementInfo const& movementInfo); - bool isMoving() const { return m_movementInfo.HasMovementFlag(movementFlagsMask); } - bool isMovingOrTurning() const { return m_movementInfo.HasMovementFlag(movementOrTurningFlagsMask); } - - bool CanFly() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY); } - bool IsFlying() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_FLYING); } bool IsAllowUseFlyMountsHere() const; void SetClientControl(Unit* target, uint8 allowMove); diff --git a/src/game/PointMovementGenerator.cpp b/src/game/PointMovementGenerator.cpp index c972683ce0b..ed057854aaa 100644 --- a/src/game/PointMovementGenerator.cpp +++ b/src/game/PointMovementGenerator.cpp @@ -35,7 +35,7 @@ void PointMovementGenerator::Initialize(T &unit) i_destinationHolder.SetDestination(traveller,i_x,i_y,i_z, !unit.hasUnitState(UNIT_STAT_JUMPING)); if (unit.GetTypeId() == TYPEID_UNIT && ((Creature*)&unit)->canFly()) - unit.AddUnitMovementFlag(MOVEMENTFLAG_FLYING2); + unit.AddUnitMovementFlag(MOVEMENTFLAG_FLYING); } template diff --git a/src/game/RandomMovementGenerator.cpp b/src/game/RandomMovementGenerator.cpp index 6d3648d51e4..e354e41827c 100644 --- a/src/game/RandomMovementGenerator.cpp +++ b/src/game/RandomMovementGenerator.cpp @@ -124,7 +124,7 @@ RandomMovementGenerator::_setRandomLocation(Creature &creature) if (is_air_ok) { i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime()); - creature.AddUnitMovementFlag(MOVEMENTFLAG_FLYING2); + creature.AddUnitMovementFlag(MOVEMENTFLAG_FLYING); } //else if (is_water_ok) // Swimming mode to be done with more than this check else @@ -151,7 +151,7 @@ RandomMovementGenerator::Initialize(Creature &creature) wander_distance = creature.GetRespawnRadius(); if (creature.canFly()) - creature.AddUnitMovementFlag(MOVEMENTFLAG_FLYING2); + creature.AddUnitMovementFlag(MOVEMENTFLAG_FLYING); else if(irand(0,RUNNING_CHANCE_RANDOMMV) > 0) creature.AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); _setRandomLocation(creature); @@ -194,7 +194,7 @@ RandomMovementGenerator::Update(Creature &creature, const uint32 &diff if(i_nextMoveTime.Passed()) { if (creature.canFly()) - creature.AddUnitMovementFlag(MOVEMENTFLAG_FLYING2); + creature.AddUnitMovementFlag(MOVEMENTFLAG_FLYING); else if(irand(0,RUNNING_CHANCE_RANDOMMV) > 0) creature.AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); _setRandomLocation(creature); diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 0f2def62271..645c2529433 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -423,7 +423,6 @@ Spell::Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 origi m_spellState = SPELL_STATE_NULL; - m_castPositionX = m_castPositionY = m_castPositionZ = 0; m_TriggerSpells.clear(); m_IsTriggeredSpell = triggered; //m_AreaAura = false; @@ -2391,9 +2390,6 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect* triggeredByAura m_spellState = SPELL_STATE_PREPARING; - m_caster->GetPosition(m_castPositionX, m_castPositionY, m_castPositionZ); - m_castOrientation = m_caster->GetOrientation(); - if(triggeredByAura) m_triggeredByAuraSpell = triggeredByAura->GetSpellProto(); @@ -2920,15 +2916,11 @@ void Spell::update(uint32 difftime) // check if the player caster has moved before the spell finished if ((m_caster->GetTypeId() == TYPEID_PLAYER && m_timer != 0) && - (m_castPositionX != m_caster->GetPositionX() || m_castPositionY != m_caster->GetPositionY() || m_castPositionZ != m_caster->GetPositionZ()) && + m_caster->isMoving() && (m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT) && (m_spellInfo->Effect[0] != SPELL_EFFECT_STUCK || !m_caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING))) { - // always cancel for channeled spells - //if( m_spellState == SPELL_STATE_CASTING ) - // cancel(); // don't cancel for melee, autorepeat, triggered and instant spells - //else - if(!IsNextMeleeSwingSpell() && !IsAutoRepeat() && !m_IsTriggeredSpell && (m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT)) + if(!IsNextMeleeSwingSpell() && !IsAutoRepeat() && !m_IsTriggeredSpell) cancel(); } @@ -2951,17 +2943,6 @@ void Spell::update(uint32 difftime) { if(m_timer > 0) { - if( m_caster->GetTypeId() == TYPEID_PLAYER ) - { - // check if player has jumped before the channeling finished - if(m_caster->HasUnitMovementFlag(MOVEMENTFLAG_JUMPING)) - cancel(); - - // check for incapacitating player states - //if( m_caster->hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_CONFUSED)) - // cancel(); - } - // check if there are alive targets left if (!UpdateChanneledTargetList()) { diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 2ebf5b0002d..53a865380d8 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -5668,26 +5668,15 @@ void AuraEffect::HandleAuraAllowFlight(bool apply, bool Real, bool /*changeAmoun if(!Real) return; + if(m_target->GetTypeId() == TYPEID_UNIT) + m_target->SetFlying(apply); + // allow fly WorldPacket data; if(apply) - { data.Initialize(SMSG_MOVE_SET_CAN_FLY, 12); - if(m_target->GetTypeId() == TYPEID_UNIT) - { - m_target->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02); - m_target->AddUnitMovementFlag(MOVEMENTFLAG_FLYING2); - } - } else - { data.Initialize(SMSG_MOVE_UNSET_CAN_FLY, 12); - if(m_target->GetTypeId() == TYPEID_UNIT) - { - m_target->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02); - m_target->RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING2); - } - } data.append(m_target->GetPackGUID()); data << uint32(0); // unk m_target->SendMessageToSet(&data, true); diff --git a/src/game/TargetedMovementGenerator.cpp b/src/game/TargetedMovementGenerator.cpp index 54c99ee90dd..c40568318d4 100644 --- a/src/game/TargetedMovementGenerator.cpp +++ b/src/game/TargetedMovementGenerator.cpp @@ -132,7 +132,7 @@ TargetedMovementGenerator::_setTargetLocation(T &owner) i_destinationHolder.SetDestination(traveller, x, y, z); owner.addUnitState(UNIT_STAT_CHASE); if (owner.GetTypeId() == TYPEID_UNIT && ((Creature*)&owner)->canFly()) - owner.AddUnitMovementFlag(MOVEMENTFLAG_FLYING2); + owner.AddUnitMovementFlag(MOVEMENTFLAG_FLYING); i_destinationHolder.StartTravel(traveller); return true; } @@ -147,7 +147,7 @@ TargetedMovementGenerator::Initialize(T &owner) owner.RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); if (owner.GetTypeId() == TYPEID_UNIT && ((Creature*)&owner)->canFly()) - owner.AddUnitMovementFlag(MOVEMENTFLAG_FLYING2); + owner.AddUnitMovementFlag(MOVEMENTFLAG_FLYING); _setTargetLocation(owner); } @@ -199,7 +199,7 @@ TargetedMovementGenerator::Update(T &owner, const uint32 & time_diff) { owner.addUnitState(UNIT_STAT_CHASE); if (owner.GetTypeId() == TYPEID_UNIT && ((Creature*)&owner)->canFly()) - owner.AddUnitMovementFlag(MOVEMENTFLAG_FLYING2); + owner.AddUnitMovementFlag(MOVEMENTFLAG_FLYING); i_destinationHolder.StartTravel(traveller); return true; diff --git a/src/game/Traveller.h b/src/game/Traveller.h index dfa4913a4cc..b5d0fb28ecc 100644 --- a/src/game/Traveller.h +++ b/src/game/Traveller.h @@ -79,7 +79,7 @@ inline float Traveller::Speed() return i_traveller.m_TempSpeed; else if(i_traveller.HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE)) return i_traveller.GetSpeed(MOVE_WALK); - else if(i_traveller.HasUnitMovementFlag(MOVEMENTFLAG_FLYING2)) + else if(i_traveller.HasUnitMovementFlag(MOVEMENTFLAG_FLYING)) return i_traveller.GetSpeed(MOVE_FLIGHT); else return i_traveller.GetSpeed(MOVE_RUN); @@ -98,7 +98,7 @@ inline float Traveller::GetMoveDestinationTo(float x, float y, float z float dy = y - GetPositionY(); float dz = z - GetPositionZ(); - if(i_traveller.HasUnitMovementFlag(MOVEMENTFLAG_FLYING2)) + if(i_traveller.HasUnitMovementFlag(MOVEMENTFLAG_FLYING)) return sqrt((dx*dx) + (dy*dy) + (dz*dz)); else //Walking on the ground return sqrt((dx*dx) + (dy*dy)); diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 89728d586a5..ebeac678c8c 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -13777,13 +13777,13 @@ void Unit::SetStunned(bool apply) SetUInt64Value(UNIT_FIELD_TARGET, 0); SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); CastStop(); + AddUnitMovementFlag(MOVEMENTFLAG_ROOT); // Creature specific if(GetTypeId() != TYPEID_PLAYER) ((Creature*)this)->StopMoving(); else SetStandState(UNIT_STAND_STATE_STAND); - // SetUnitMovementFlags(0); //Clear movement flags WorldPacket data(SMSG_FORCE_MOVE_ROOT, 8); data.append(GetPackGUID()); @@ -13806,21 +13806,20 @@ void Unit::SetStunned(bool apply) data.append(GetPackGUID()); data << uint32(0); SendMessageToSet(&data,true); + + RemoveUnitMovementFlag(MOVEMENTFLAG_ROOT); } } } void Unit::SetRooted(bool apply) { - uint32 apply_stat = UNIT_STAT_ROOT; if(apply) { - //SetFlag(UNIT_FIELD_FLAGS,(apply_stat<<16)); // probably wrong + AddUnitMovementFlag(MOVEMENTFLAG_ROOT); if(GetTypeId() == TYPEID_PLAYER) { - //SetUnitMovementFlags(0); - WorldPacket data(SMSG_FORCE_MOVE_ROOT, 10); data.append(GetPackGUID()); data << (uint32)2; @@ -13831,8 +13830,6 @@ void Unit::SetRooted(bool apply) } else { - //RemoveFlag(UNIT_FIELD_FLAGS,(apply_stat<<16)); // probably wrong - if(!hasUnitState(UNIT_STAT_STUNNED)) // prevent allow move if have also stun effect { if(GetTypeId() == TYPEID_PLAYER) @@ -13842,6 +13839,8 @@ void Unit::SetRooted(bool apply) data << (uint32)2; SendMessageToSet(&data,true); } + + RemoveUnitMovementFlag(MOVEMENTFLAG_ROOT); } } } @@ -13850,6 +13849,8 @@ void Unit::SetFeared(bool apply) { if(apply) { + SetUInt64Value(UNIT_FIELD_TARGET, 0); + Unit *caster = NULL; Unit::AuraEffectList const& fearAuras = GetAurasByType(SPELL_AURA_MOD_FEAR); if(!fearAuras.empty()) @@ -13860,8 +13861,13 @@ void Unit::SetFeared(bool apply) } else { - if(isAlive() && GetMotionMaster()->GetCurrentMovementGeneratorType() == FLEEING_MOTION_TYPE) - GetMotionMaster()->MovementExpired(); + if(isAlive()) + { + if(GetMotionMaster()->GetCurrentMovementGeneratorType() == FLEEING_MOTION_TYPE) + GetMotionMaster()->MovementExpired(); + if(getVictim()) + SetUInt64Value(UNIT_FIELD_TARGET, getVictim()->GetGUID()); + } } if (GetTypeId() == TYPEID_PLAYER) @@ -13872,12 +13878,18 @@ void Unit::SetConfused(bool apply) { if(apply) { + SetUInt64Value(UNIT_FIELD_TARGET, 0); GetMotionMaster()->MoveConfused(); } else { - if(isAlive() && GetMotionMaster()->GetCurrentMovementGeneratorType() == CONFUSED_MOTION_TYPE) - GetMotionMaster()->MovementExpired(); + if(isAlive()) + { + if(GetMotionMaster()->GetCurrentMovementGeneratorType() == CONFUSED_MOTION_TYPE) + GetMotionMaster()->MovementExpired(); + if(getVictim()) + SetUInt64Value(UNIT_FIELD_TARGET, getVictim()->GetGUID()); + } } if(GetTypeId() == TYPEID_PLAYER) @@ -14568,7 +14580,7 @@ void Unit::ExitVehicle() clearUnitState(UNIT_STAT_ONVEHICLE); SetControlled(false, UNIT_STAT_ROOT); - RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_FLY_UNK1); + RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); m_movementInfo.t_x = 0; m_movementInfo.t_y = 0; m_movementInfo.t_z = 0; @@ -14638,7 +14650,7 @@ void Unit::BuildMovementPacket(ByteBuffer *data) const } // 0x02200000 - if((GetUnitMovementFlags() & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING2)) + if((GetUnitMovementFlags() & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || (m_movementInfo.unk1 & 0x20)) *data << (float)m_movementInfo.s_pitch; @@ -14669,7 +14681,7 @@ void Unit::OutMovementInfo() const sLog.outString("MovementInfo for %u: Flag %u, Unk1 %u, Time %u, Pos %f %f %f %f, Fall %u", GetEntry(), m_movementInfo.flags, (uint32)m_movementInfo.unk1, m_movementInfo.time, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation(), m_movementInfo.fallTime); if(m_movementInfo.flags & MOVEMENTFLAG_ONTRANSPORT) sLog.outString("Transport: GUID " UI64FMTD ", Pos %f %f %f %f, Time %u, Seat %d", m_movementInfo.t_guid, m_movementInfo.t_x, m_movementInfo.t_y, m_movementInfo.t_z, m_movementInfo.t_o, m_movementInfo.t_time, (int32)m_movementInfo.t_seat); - if((m_movementInfo.flags & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING2)) || (m_movementInfo.unk1 & 0x20)) + if((m_movementInfo.flags & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || (m_movementInfo.unk1 & 0x20)) sLog.outString("Pitch: %f", m_movementInfo.s_pitch); if(m_movementInfo.flags & MOVEMENTFLAG_JUMPING) sLog.outString("Jump: speedz %f, sin %f, cos %f, speedxy %f", m_movementInfo.j_zspeed, m_movementInfo.j_sinAngle, m_movementInfo.j_cosAngle, m_movementInfo.j_xyspeed); @@ -14677,6 +14689,20 @@ void Unit::OutMovementInfo() const sLog.outString("Spline: %f", m_movementInfo.u_unk1); } +void Unit::SetFlying(bool apply) +{ + if(apply) + { + SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02); + AddUnitMovementFlag(MOVEMENTFLAG_FLYING); + } + else + { + RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02); + RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING); + } +} + void Unit::NearTeleportTo( float x, float y, float z, float orientation, bool casting /*= false*/ ) { if(GetTypeId() == TYPEID_PLAYER) diff --git a/src/game/Unit.h b/src/game/Unit.h index 9a8b7a51c1e..00478a74acd 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -642,21 +642,29 @@ enum MovementFlags MOVEMENTFLAG_WALK_MODE = 0x00000100, // Walking MOVEMENTFLAG_ONTRANSPORT = 0x00000200, // Used for flying on some creatures MOVEMENTFLAG_LEVITATING = 0x00000400, - MOVEMENTFLAG_FLY_UNK1 = 0x00000800, + MOVEMENTFLAG_ROOT = 0x00000800, MOVEMENTFLAG_JUMPING = 0x00001000, - MOVEMENTFLAG_UNK4 = 0x00002000, + MOVEMENTFLAG_FALL_DAMAGE = 0x00002000, // newZ < oldZ MOVEMENTFLAG_FALLING = 0x00004000, // 0x8000, 0x10000, 0x20000, 0x40000, 0x80000, 0x100000 MOVEMENTFLAG_SWIMMING = 0x00200000, // appears with fly flag also - MOVEMENTFLAG_FLY_UP = 0x00400000, // press "space" when flying + MOVEMENTFLAG_ASCEND = 0x00400000, // press "space" when flying MOVEMENTFLAG_CAN_FLY = 0x00800000, - MOVEMENTFLAG_FLYING = 0x01000000, // fly land - MOVEMENTFLAG_FLYING2 = 0x02000000, // fly hover + MOVEMENTFLAG_FLY_MODE = 0x01000000, // can fly + MOVEMENTFLAG_FLYING = 0x02000000, // hover MOVEMENTFLAG_SPLINE = 0x04000000, // used for flight paths MOVEMENTFLAG_SPLINE2 = 0x08000000, // used for flight paths MOVEMENTFLAG_WATERWALKING = 0x10000000, // prevent unit from falling through water MOVEMENTFLAG_SAFE_FALL = 0x20000000, // active rogue safe fall spell (passive) - MOVEMENTFLAG_UNK3 = 0x40000000 + MOVEMENTFLAG_HOVER = 0x40000000, // hover, cannot jump + + MOVEMENTFLAG_MOVING = + MOVEMENTFLAG_FORWARD |MOVEMENTFLAG_BACKWARD |MOVEMENTFLAG_STRAFE_LEFT|MOVEMENTFLAG_STRAFE_RIGHT| + MOVEMENTFLAG_PITCH_UP|MOVEMENTFLAG_PITCH_DOWN|MOVEMENTFLAG_FALL_DAMAGE| + MOVEMENTFLAG_JUMPING |MOVEMENTFLAG_FALLING |MOVEMENTFLAG_ASCEND | + MOVEMENTFLAG_SPLINE, + MOVEMENTFLAG_TURNING = + MOVEMENTFLAG_LEFT | MOVEMENTFLAG_RIGHT, }; /* @@ -1767,6 +1775,12 @@ class TRINITY_DLL_SPEC Unit : public WorldObject void SetTransport(Transport * t) { m_transport = t; } void BuildMovementPacket(ByteBuffer *data) const; + + bool isMoving() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_MOVING); } + bool isTurning() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_TURNING); } + bool canFly() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_FLY_MODE); } + bool IsFlying() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_FLYING); } + void SetFlying(bool apply); protected: explicit Unit (); diff --git a/src/game/Vehicle.cpp b/src/game/Vehicle.cpp index 3fbbd9f922c..0464c52705e 100644 --- a/src/game/Vehicle.cpp +++ b/src/game/Vehicle.cpp @@ -284,7 +284,7 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId) //SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_24); - unit->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_FLY_UNK1); + unit->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); VehicleSeatEntry const *veSeat = seat->second.seatInfo; unit->m_movementInfo.t_x = veSeat->m_attachmentOffsetX; unit->m_movementInfo.t_y = veSeat->m_attachmentOffsetY; diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp index 49d38799fe3..d256b01bd5d 100644 --- a/src/game/WaypointMovementGenerator.cpp +++ b/src/game/WaypointMovementGenerator.cpp @@ -86,7 +86,7 @@ void WaypointMovementGenerator::InitTraveller(Creature &unit, const Wa unit.SetUInt32Value(UNIT_FIELD_BYTES_1, 0); if(unit.canFly()) - unit.AddUnitMovementFlag(MOVEMENTFLAG_FLYING2); + unit.AddUnitMovementFlag(MOVEMENTFLAG_FLYING); unit.addUnitState(UNIT_STAT_ROAMING); } diff --git a/src/game/WorldSession.cpp b/src/game/WorldSession.cpp index 6c2b9cd9932..91d1e6e018a 100644 --- a/src/game/WorldSession.cpp +++ b/src/game/WorldSession.cpp @@ -654,7 +654,7 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo *mi) data >> mi->t_seat; } - if((mi->flags & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING2)) || (mi->unk1 & 0x20)) + if((mi->flags & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || (mi->unk1 & 0x20)) { CHECK_PACKET_SIZE(data, data.rpos()+4); data >> mi->s_pitch; -- cgit v1.2.3 From 81333d8dcecba85c1af5344116eb1e86cbd664ca Mon Sep 17 00:00:00 2001 From: QAston Date: Mon, 15 Jun 2009 22:27:39 +0200 Subject: *Fix Honor Among Thieves *Fix Turn the Tables. --HG-- branch : trunk --- sql/updates/4031_world_spell_proc_event.sql | 8 ++++++++ sql/world_spell_full.sql | 3 +++ src/game/SpellAuras.cpp | 4 ++++ src/game/Unit.cpp | 21 +++++++++++++++++++++ 4 files changed, 36 insertions(+) create mode 100644 sql/updates/4031_world_spell_proc_event.sql (limited to 'src/game/Unit.cpp') diff --git a/sql/updates/4031_world_spell_proc_event.sql b/sql/updates/4031_world_spell_proc_event.sql new file mode 100644 index 00000000000..d426dc437cb --- /dev/null +++ b/sql/updates/4031_world_spell_proc_event.sql @@ -0,0 +1,8 @@ +DELETE FROM `spell_proc_event` WHERE `entry` IN (50880, 50884, 50885, 50886, 50887, 55610); +INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES +( 50880, 0x00, 15, 0x00000000, 0x04000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Icy Talons +( 50884, 0x00, 15, 0x00000000, 0x04000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Icy Talons +( 50885, 0x00, 15, 0x00000000, 0x04000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Icy Talons +( 50886, 0x00, 15, 0x00000000, 0x04000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Icy Talons +( 50887, 0x00, 15, 0x00000000, 0x04000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Icy Talons +( 55610, 0x00, 15, 0x00000000, 0x04000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0); -- Improved Icy Talons diff --git a/sql/world_spell_full.sql b/sql/world_spell_full.sql index 87fd476365e..9929146d0e9 100644 --- a/sql/world_spell_full.sql +++ b/sql/world_spell_full.sql @@ -1243,6 +1243,9 @@ INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `Spell ( 51667, 0x00, 8, 0x00020000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Cut to the Chase (Rank 3) ( 51668, 0x00, 8, 0x00020000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Cut to the Chase (Rank 4) ( 51669, 0x00, 8, 0x00020000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Cut to the Chase (Rank 5) +( 51698, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 1), -- Honor Among Thieves +( 51700, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 1), -- Honor Among Thieves +( 51701, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 1), -- Honor Among Thieves ( 51672, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0, 0, 1), -- Unfair Advantage (Rank 1) ( 51674, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0, 0, 1), -- Unfair Advantage (Rank 2) ( 51679, 0x00, 8, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Throwing Specialization (Rank 2) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 53a865380d8..471209e8f77 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -2478,6 +2478,10 @@ void AuraEffect::HandleAuraDummy(bool apply, bool Real, bool changeAmount) if(m_target->GetTypeId()==TYPEID_PLAYER) ((Player*)m_target)->RemoveAmmo(); // not use ammo and not allow use return; + case 52916: // Honor Among Thieves + if (Unit * target = ObjectAccessor::GetUnit(*m_target, m_target->GetUInt64Value(UNIT_FIELD_TARGET))) + m_target->CastSpell(target, 51699, true); + return; } // Earth Shield diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index ebeac678c8c..dd1307e7ef4 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -7679,6 +7679,27 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig // dummy basepoints or other customs switch(trigger_spell_id) { + // Auras which should proc on area aura source (caster in this case): + // Turn the Tables + case 52914: + case 52915: + case 52910: + // Honor Among Thieves + case 52916: + { + target = triggeredByAura->GetParentAura()->GetCaster(); + if(!target) + return false; + + if( cooldown && GetTypeId()==TYPEID_PLAYER && ((Player*)target)->HasSpellCooldown(trigger_spell_id)) + return false; + + target->CastSpell(target,trigger_spell_id,true,castItem,triggeredByAura); + + if( cooldown && GetTypeId()==TYPEID_PLAYER ) + ((Player*)this)->AddSpellCooldown(trigger_spell_id,0,time(NULL) + cooldown); + return true; + } // Cast positive spell on enemy target case 7099: // Curse of Mending case 39647: // Curse of Mending -- cgit v1.2.3