Merge remote-tracking branch 'origin/master' into mmaps
Conflicts: src/server/game/Movement/Spline/MoveSplineInit.cpp
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
SET @Spell := 28715; -- Flamecap Fire
|
||||||
|
DELETE FROM `spell_bonus_data` WHERE `entry`=@Spell;
|
||||||
|
INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES
|
||||||
|
(@Spell,0,0,0,0, 'Flamecap Fire');
|
||||||
@@ -111,6 +111,11 @@ void CombatAI::UpdateAI(const uint32 diff)
|
|||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CombatAI::SpellInterrupted(uint32 spellId, uint32 unTimeMs)
|
||||||
|
{
|
||||||
|
events.RescheduleEvent(spellId, unTimeMs);
|
||||||
|
}
|
||||||
|
|
||||||
/////////////////
|
/////////////////
|
||||||
//CasterAI
|
//CasterAI
|
||||||
/////////////////
|
/////////////////
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ class CombatAI : public CreatureAI
|
|||||||
void EnterCombat(Unit* who);
|
void EnterCombat(Unit* who);
|
||||||
void JustDied(Unit* killer);
|
void JustDied(Unit* killer);
|
||||||
void UpdateAI(const uint32 diff);
|
void UpdateAI(const uint32 diff);
|
||||||
|
void SpellInterrupted(uint32 spellId, uint32 unTimeMs);
|
||||||
static int Permissible(const Creature*);
|
static int Permissible(const Creature*);
|
||||||
protected:
|
protected:
|
||||||
EventMap events;
|
EventMap events;
|
||||||
|
|||||||
@@ -242,6 +242,10 @@ class UnitAI
|
|||||||
// Called when the unit heals
|
// Called when the unit heals
|
||||||
virtual void HealDone(Unit* /*done_to*/, uint32& /*addhealth*/) {}
|
virtual void HealDone(Unit* /*done_to*/, uint32& /*addhealth*/) {}
|
||||||
|
|
||||||
|
/// Called when a spell is interrupted by Spell::EffectInterruptCast
|
||||||
|
/// Use to reschedule next planned cast of spell.
|
||||||
|
virtual void SpellInterrupted(uint32 /*spellId*/, uint32 /*unTimeMs*/) {}
|
||||||
|
|
||||||
void AttackStartCaster(Unit* victim, float dist);
|
void AttackStartCaster(Unit* victim, float dist);
|
||||||
|
|
||||||
void DoAddAuraToAllHostilePlayers(uint32 spellid);
|
void DoAddAuraToAllHostilePlayers(uint32 spellid);
|
||||||
|
|||||||
@@ -1317,6 +1317,10 @@ bool CreatureEventAI::CanCast(Unit* target, SpellInfo const* spell, bool trigger
|
|||||||
if (!me->IsInRange(target, spell->GetMinRange(false), spell->GetMaxRange(false)))
|
if (!me->IsInRange(target, spell->GetMinRange(false), spell->GetMaxRange(false)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
//Spell is on cooldown
|
||||||
|
if (me->HasSpellCooldown(spell->Id))
|
||||||
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -634,7 +634,7 @@ void SmartAI::SpellHitTarget(Unit* target, const SpellInfo* spellInfo)
|
|||||||
void SmartAI::DamageTaken(Unit* doneBy, uint32& damage)
|
void SmartAI::DamageTaken(Unit* doneBy, uint32& damage)
|
||||||
{
|
{
|
||||||
GetScript()->ProcessEventsFor(SMART_EVENT_DAMAGED, doneBy, damage);
|
GetScript()->ProcessEventsFor(SMART_EVENT_DAMAGED, doneBy, damage);
|
||||||
if ((damage >= me->GetHealth() - mInvincibilityHpLevel) && (mInvincibilityHpLevel > 0))
|
if (mInvincibilityHpLevel && (damage >= me->GetHealth() - mInvincibilityHpLevel))
|
||||||
{
|
{
|
||||||
damage = 0;
|
damage = 0;
|
||||||
me->SetHealth(mInvincibilityHpLevel);
|
me->SetHealth(mInvincibilityHpLevel);
|
||||||
|
|||||||
@@ -2231,6 +2231,38 @@ bool Creature::HasSpellCooldown(uint32 spell_id) const
|
|||||||
return (itr != m_CreatureSpellCooldowns.end() && itr->second > time(NULL)) || HasCategoryCooldown(spell_id);
|
return (itr != m_CreatureSpellCooldowns.end() && itr->second > time(NULL)) || HasCategoryCooldown(spell_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Creature::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs)
|
||||||
|
{
|
||||||
|
time_t curTime = time(NULL);
|
||||||
|
for (uint8 i = 0; i < CREATURE_MAX_SPELLS; ++i)
|
||||||
|
{
|
||||||
|
if (m_spells[i] == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
uint32 unSpellId = m_spells[i];
|
||||||
|
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(unSpellId);
|
||||||
|
if (!spellInfo)
|
||||||
|
{
|
||||||
|
ASSERT(spellInfo);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Not send cooldown for this spells
|
||||||
|
if (spellInfo->Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (spellInfo->PreventionType != SPELL_PREVENTION_TYPE_SILENCE)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ((idSchoolMask & spellInfo->GetSchoolMask()) && GetCreatureSpellCooldownDelay(unSpellId) < unTimeMs)
|
||||||
|
{
|
||||||
|
_AddCreatureSpellCooldown(unSpellId, curTime + unTimeMs/IN_MILLISECONDS);
|
||||||
|
if (UnitAI* ai = GetAI())
|
||||||
|
ai->SpellInterrupted(unSpellId, unTimeMs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool Creature::HasSpell(uint32 spellID) const
|
bool Creature::HasSpell(uint32 spellID) const
|
||||||
{
|
{
|
||||||
uint8 i;
|
uint8 i;
|
||||||
|
|||||||
@@ -540,6 +540,13 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature
|
|||||||
void AddCreatureSpellCooldown(uint32 spellid);
|
void AddCreatureSpellCooldown(uint32 spellid);
|
||||||
bool HasSpellCooldown(uint32 spell_id) const;
|
bool HasSpellCooldown(uint32 spell_id) const;
|
||||||
bool HasCategoryCooldown(uint32 spell_id) const;
|
bool HasCategoryCooldown(uint32 spell_id) const;
|
||||||
|
uint32 GetCreatureSpellCooldownDelay(uint32 spellId) const
|
||||||
|
{
|
||||||
|
CreatureSpellCooldowns::const_iterator itr = m_CreatureSpellCooldowns.find(spellId);
|
||||||
|
time_t t = time(NULL);
|
||||||
|
return uint32(itr != m_CreatureSpellCooldowns.end() && itr->second > t ? itr->second - t : 0);
|
||||||
|
}
|
||||||
|
virtual void ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs);
|
||||||
|
|
||||||
bool HasSpell(uint32 spellID) const;
|
bool HasSpell(uint32 spellID) const;
|
||||||
|
|
||||||
|
|||||||
@@ -2033,3 +2033,40 @@ void Pet::SynchronizeLevelWithOwner()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Pet::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs)
|
||||||
|
{
|
||||||
|
WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+m_spells.size()*8);
|
||||||
|
data << uint64(GetGUID());
|
||||||
|
data << uint8(0x0); // flags (0x1, 0x2)
|
||||||
|
time_t curTime = time(NULL);
|
||||||
|
for (PetSpellMap::const_iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr)
|
||||||
|
{
|
||||||
|
if (itr->second.state == PETSPELL_REMOVED)
|
||||||
|
continue;
|
||||||
|
uint32 unSpellId = itr->first;
|
||||||
|
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(unSpellId);
|
||||||
|
if (!spellInfo)
|
||||||
|
{
|
||||||
|
ASSERT(spellInfo);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Not send cooldown for this spells
|
||||||
|
if (spellInfo->Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (spellInfo->PreventionType != SPELL_PREVENTION_TYPE_SILENCE)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ((idSchoolMask & spellInfo->GetSchoolMask()) && GetCreatureSpellCooldownDelay(unSpellId) < unTimeMs)
|
||||||
|
{
|
||||||
|
data << uint32(unSpellId);
|
||||||
|
data << uint32(unTimeMs); // in m.secs
|
||||||
|
_AddCreatureSpellCooldown(unSpellId, curTime + unTimeMs/IN_MILLISECONDS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Player* owner = GetOwner())
|
||||||
|
owner->GetSession()->SendPacket(&data);
|
||||||
|
}
|
||||||
@@ -200,6 +200,7 @@ class Pet : public Guardian
|
|||||||
bool unlearnSpell(uint32 spell_id, bool learn_prev, bool clear_ab = true);
|
bool unlearnSpell(uint32 spell_id, bool learn_prev, bool clear_ab = true);
|
||||||
bool removeSpell(uint32 spell_id, bool learn_prev, bool clear_ab = true);
|
bool removeSpell(uint32 spell_id, bool learn_prev, bool clear_ab = true);
|
||||||
void CleanupActionBar();
|
void CleanupActionBar();
|
||||||
|
virtual void ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs);
|
||||||
|
|
||||||
PetSpellMap m_spells;
|
PetSpellMap m_spells;
|
||||||
AutoSpellList m_autospells;
|
AutoSpellList m_autospells;
|
||||||
|
|||||||
@@ -24502,11 +24502,11 @@ bool Player::canSeeSpellClickOn(Creature const* c) const
|
|||||||
|
|
||||||
ConditionList conds = sConditionMgr->GetConditionsForSpellClickEvent(c->GetEntry(), itr->second.spellId);
|
ConditionList conds = sConditionMgr->GetConditionsForSpellClickEvent(c->GetEntry(), itr->second.spellId);
|
||||||
ConditionSourceInfo info = ConditionSourceInfo(const_cast<Player*>(this), const_cast<Creature*>(c));
|
ConditionSourceInfo info = ConditionSourceInfo(const_cast<Player*>(this), const_cast<Creature*>(c));
|
||||||
if (!sConditionMgr->IsObjectMeetToConditions(info, conds))
|
if (sConditionMgr->IsObjectMeetToConditions(info, conds))
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::BuildPlayerTalentsInfoData(WorldPacket* data)
|
void Player::BuildPlayerTalentsInfoData(WorldPacket* data)
|
||||||
|
|||||||
@@ -405,6 +405,7 @@ void Unit::UpdateSplineMovement(uint32 t_diff)
|
|||||||
pos.m_positionY = loc.y;
|
pos.m_positionY = loc.y;
|
||||||
pos.m_positionZ = loc.z;
|
pos.m_positionZ = loc.z;
|
||||||
pos.m_orientation = loc.orientation;
|
pos.m_orientation = loc.orientation;
|
||||||
|
|
||||||
if (Unit* vehicle = GetVehicleBase())
|
if (Unit* vehicle = GetVehicleBase())
|
||||||
{
|
{
|
||||||
loc.x += vehicle->GetPositionX();
|
loc.x += vehicle->GetPositionX();
|
||||||
@@ -861,17 +862,24 @@ void Unit::CastCustomSpell(Unit* target, uint32 spellId, int32 const* bp0, int32
|
|||||||
values.AddSpellMod(SPELLVALUE_BASE_POINT1, *bp1);
|
values.AddSpellMod(SPELLVALUE_BASE_POINT1, *bp1);
|
||||||
if (bp2)
|
if (bp2)
|
||||||
values.AddSpellMod(SPELLVALUE_BASE_POINT2, *bp2);
|
values.AddSpellMod(SPELLVALUE_BASE_POINT2, *bp2);
|
||||||
CastCustomSpell(spellId, values, target, triggered, castItem, triggeredByAura, originalCaster);
|
CastCustomSpell(spellId, values, target, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unit::CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* target, bool triggered, Item* castItem, AuraEffect const* triggeredByAura, uint64 originalCaster)
|
void Unit::CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* target, bool triggered, Item* castItem, AuraEffect const* triggeredByAura, uint64 originalCaster)
|
||||||
{
|
{
|
||||||
CustomSpellValues values;
|
CustomSpellValues values;
|
||||||
values.AddSpellMod(mod, value);
|
values.AddSpellMod(mod, value);
|
||||||
CastCustomSpell(spellId, values, target, triggered, castItem, triggeredByAura, originalCaster);
|
CastCustomSpell(spellId, values, target, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unit::CastCustomSpell(uint32 spellId, CustomSpellValues const& value, Unit* victim, bool triggered, Item* castItem, AuraEffect const* triggeredByAura, uint64 originalCaster)
|
void Unit::CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* target, TriggerCastFlags triggerFlags, Item* castItem, AuraEffect const* triggeredByAura, uint64 originalCaster)
|
||||||
|
{
|
||||||
|
CustomSpellValues values;
|
||||||
|
values.AddSpellMod(mod, value);
|
||||||
|
CastCustomSpell(spellId, values, target, triggerFlags, castItem, triggeredByAura, originalCaster);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Unit::CastCustomSpell(uint32 spellId, CustomSpellValues const& value, Unit* victim, TriggerCastFlags triggerFlags, Item* castItem, AuraEffect const* triggeredByAura, uint64 originalCaster)
|
||||||
{
|
{
|
||||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||||
if (!spellInfo)
|
if (!spellInfo)
|
||||||
@@ -882,7 +890,7 @@ void Unit::CastCustomSpell(uint32 spellId, CustomSpellValues const& value, Unit*
|
|||||||
SpellCastTargets targets;
|
SpellCastTargets targets;
|
||||||
targets.SetUnitTarget(victim);
|
targets.SetUnitTarget(victim);
|
||||||
|
|
||||||
CastSpell(targets, spellInfo, &value, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster);
|
CastSpell(targets, spellInfo, &value, triggerFlags, castItem, triggeredByAura, originalCaster);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item* castItem, AuraEffect const* triggeredByAura, uint64 originalCaster)
|
void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item* castItem, AuraEffect const* triggeredByAura, uint64 originalCaster)
|
||||||
@@ -6728,7 +6736,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
|||||||
if (!victim)
|
if (!victim)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// 2% of base mana
|
// 2% of maximum health
|
||||||
basepoints0 = int32(victim->CountPctFromMaxHealth(2));
|
basepoints0 = int32(victim->CountPctFromMaxHealth(2));
|
||||||
victim->CastCustomSpell(victim, 20267, &basepoints0, 0, 0, true, 0, triggeredByAura);
|
victim->CastCustomSpell(victim, 20267, &basepoints0, 0, 0, true, 0, triggeredByAura);
|
||||||
return true;
|
return true;
|
||||||
@@ -16968,19 +16976,20 @@ void Unit::JumpTo(WorldObject* obj, float speedZ)
|
|||||||
|
|
||||||
bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
|
bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
|
||||||
{
|
{
|
||||||
|
bool result = false;
|
||||||
uint32 spellClickEntry = GetVehicleKit() ? GetVehicleKit()->GetCreatureEntry() : GetEntry();
|
uint32 spellClickEntry = GetVehicleKit() ? GetVehicleKit()->GetCreatureEntry() : GetEntry();
|
||||||
SpellClickInfoMapBounds clickPair = sObjectMgr->GetSpellClickInfoMapBounds(spellClickEntry);
|
SpellClickInfoMapBounds clickPair = sObjectMgr->GetSpellClickInfoMapBounds(spellClickEntry);
|
||||||
for (SpellClickInfoContainer::const_iterator itr = clickPair.first; itr != clickPair.second; ++itr)
|
for (SpellClickInfoContainer::const_iterator itr = clickPair.first; itr != clickPair.second; ++itr)
|
||||||
{
|
{
|
||||||
//! First check simple relations from clicker to clickee
|
//! First check simple relations from clicker to clickee
|
||||||
if (!itr->second.IsFitToRequirements(clicker, this))
|
if (!itr->second.IsFitToRequirements(clicker, this))
|
||||||
return false;
|
continue;
|
||||||
|
|
||||||
//! Check database conditions
|
//! Check database conditions
|
||||||
ConditionList conds = sConditionMgr->GetConditionsForSpellClickEvent(spellClickEntry, itr->second.spellId);
|
ConditionList conds = sConditionMgr->GetConditionsForSpellClickEvent(spellClickEntry, itr->second.spellId);
|
||||||
ConditionSourceInfo info = ConditionSourceInfo(clicker, this);
|
ConditionSourceInfo info = ConditionSourceInfo(clicker, this);
|
||||||
if (!sConditionMgr->IsObjectMeetToConditions(info, conds))
|
if (!sConditionMgr->IsObjectMeetToConditions(info, conds))
|
||||||
return false;
|
continue;
|
||||||
|
|
||||||
Unit* caster = (itr->second.castFlags & NPC_CLICK_CAST_CASTER_CLICKER) ? clicker : this;
|
Unit* caster = (itr->second.castFlags & NPC_CLICK_CAST_CASTER_CLICKER) ? clicker : this;
|
||||||
Unit* target = (itr->second.castFlags & NPC_CLICK_CAST_TARGET_CLICKER) ? clicker : this;
|
Unit* target = (itr->second.castFlags & NPC_CLICK_CAST_TARGET_CLICKER) ? clicker : this;
|
||||||
@@ -17006,11 +17015,11 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
|
|||||||
if (!valid)
|
if (!valid)
|
||||||
{
|
{
|
||||||
sLog->outError(LOG_FILTER_SQL, "Spell %u specified in npc_spellclick_spells is not a valid vehicle enter aura!", itr->second.spellId);
|
sLog->outError(LOG_FILTER_SQL, "Spell %u specified in npc_spellclick_spells is not a valid vehicle enter aura!", itr->second.spellId);
|
||||||
return false;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsInMap(caster))
|
if (IsInMap(caster))
|
||||||
caster->CastCustomSpell(itr->second.spellId, SpellValueMod(SPELLVALUE_BASE_POINT0+i), seatId+1, target, false, NULL, NULL, origCasterGUID);
|
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);
|
||||||
else // This can happen during Player::_LoadAuras
|
else // This can happen during Player::_LoadAuras
|
||||||
{
|
{
|
||||||
int32 bp0 = seatId;
|
int32 bp0 = seatId;
|
||||||
@@ -17020,22 +17029,27 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (IsInMap(caster))
|
if (IsInMap(caster))
|
||||||
caster->CastSpell(target, spellEntry, false, NULL, NULL, origCasterGUID);
|
caster->CastSpell(target, spellEntry, GetVehicleKit() ? TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE : TRIGGERED_NONE, NULL, NULL, origCasterGUID);
|
||||||
else
|
else
|
||||||
Aura::TryRefreshStackOrCreate(spellEntry, MAX_EFFECT_MASK, this, clicker, NULL, NULL, origCasterGUID);
|
Aura::TryRefreshStackOrCreate(spellEntry, MAX_EFFECT_MASK, this, clicker, NULL, NULL, origCasterGUID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
result = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
Creature* creature = ToCreature();
|
Creature* creature = ToCreature();
|
||||||
if (creature && creature->IsAIEnabled)
|
if (creature && creature->IsAIEnabled)
|
||||||
creature->AI()->OnSpellClick(clicker);
|
creature->AI()->OnSpellClick(clicker);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unit::EnterVehicle(Unit* base, int8 seatId)
|
void Unit::EnterVehicle(Unit* base, int8 seatId)
|
||||||
{
|
{
|
||||||
CastCustomSpell(VEHICLE_SPELL_RIDE_HARDCODED, SPELLVALUE_BASE_POINT0, seatId+1, base, false);
|
CastCustomSpell(VEHICLE_SPELL_RIDE_HARDCODED, SPELLVALUE_BASE_POINT0, seatId+1, base, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* aurApp)
|
void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* aurApp)
|
||||||
|
|||||||
@@ -1569,13 +1569,14 @@ class Unit : public WorldObject
|
|||||||
void CastSpell(SpellCastTargets const& targets, SpellInfo const* spellInfo, CustomSpellValues const* value, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
|
void CastSpell(SpellCastTargets const& targets, SpellInfo const* spellInfo, CustomSpellValues const* value, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
|
||||||
void CastSpell(Unit* victim, uint32 spellId, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
|
void CastSpell(Unit* victim, uint32 spellId, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
|
||||||
void CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
|
void CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
|
||||||
void CastSpell(Unit* victim, SpellInfo const* spellInfo, bool triggered, Item* castItem= NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
|
void CastSpell(Unit* victim, SpellInfo const* spellInfo, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
|
||||||
void CastSpell(Unit* victim, SpellInfo const* spellInfo, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem= NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
|
void CastSpell(Unit* victim, SpellInfo const* spellInfo, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
|
||||||
void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
|
void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
|
||||||
void CastCustomSpell(Unit* Victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item* castItem= NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
|
|
||||||
void CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* Victim = NULL, bool triggered = true, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
|
|
||||||
void CastCustomSpell(uint32 spellId, CustomSpellValues const &value, Unit* Victim = NULL, bool triggered = true, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
|
|
||||||
void CastSpell(GameObject* go, uint32 spellId, bool triggered, Item* castItem = NULL, AuraEffect* triggeredByAura = NULL, uint64 originalCaster = 0);
|
void CastSpell(GameObject* go, uint32 spellId, bool triggered, Item* castItem = NULL, AuraEffect* triggeredByAura = NULL, uint64 originalCaster = 0);
|
||||||
|
void CastCustomSpell(Unit* victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
|
||||||
|
void CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* victim, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
|
||||||
|
void CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* victim = NULL, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
|
||||||
|
void CastCustomSpell(uint32 spellId, CustomSpellValues const &value, Unit* victim = NULL, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
|
||||||
Aura* AddAura(uint32 spellId, Unit* target);
|
Aura* AddAura(uint32 spellId, Unit* target);
|
||||||
Aura* AddAura(SpellInfo const* spellInfo, uint8 effMask, Unit* target);
|
Aura* AddAura(SpellInfo const* spellInfo, uint8 effMask, Unit* target);
|
||||||
void SetAuraStack(uint32 spellId, Unit* target, uint32 stack);
|
void SetAuraStack(uint32 spellId, Unit* target, uint32 stack);
|
||||||
|
|||||||
@@ -71,10 +71,10 @@ namespace Movement
|
|||||||
real_position.z = unit->GetTransOffsetZ();
|
real_position.z = unit->GetTransOffsetZ();
|
||||||
real_position.orientation = unit->GetTransOffsetO();
|
real_position.orientation = unit->GetTransOffsetO();
|
||||||
}
|
}
|
||||||
|
|
||||||
// there is a big chance that current position is unknown if current state is not finalized, need compute it
|
// there is a big chance that current position is unknown if current state is not finalized, need compute it
|
||||||
// this also allows CalculatePath spline position and update map position in much greater intervals
|
// this also allows CalculatePath spline position and update map position in much greater intervals
|
||||||
if (!move_spline.Finalized())
|
// Don't compute for transport movement. The unit could be in a motion between two transports, thus having transport moveflag but is resulting in regular positions
|
||||||
|
else if (!move_spline.Finalized())
|
||||||
real_position = move_spline.ComputePosition();
|
real_position = move_spline.ComputePosition();
|
||||||
|
|
||||||
// should i do the things that user should do? - no.
|
// should i do the things that user should do? - no.
|
||||||
|
|||||||
@@ -283,6 +283,12 @@ public:
|
|||||||
DoScriptText(SAY_WH_KILL, me);
|
DoScriptText(SAY_WH_KILL, me);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DamageTaken(Unit* /*attacker*/, uint32& damage)
|
||||||
|
{
|
||||||
|
if (!_bCanResurrectCheck && damage >= me->GetHealth())
|
||||||
|
damage = me->GetHealth() - 1;
|
||||||
|
}
|
||||||
|
|
||||||
void UpdateAI(const uint32 diff)
|
void UpdateAI(const uint32 diff)
|
||||||
{
|
{
|
||||||
if (!UpdateVictim())
|
if (!UpdateVictim())
|
||||||
|
|||||||
@@ -2112,7 +2112,7 @@ class spell_the_lich_king_necrotic_plague : public SpellScriptLoader
|
|||||||
CustomSpellValues values;
|
CustomSpellValues values;
|
||||||
//values.AddSpellMod(SPELLVALUE_AURA_STACK, 2);
|
//values.AddSpellMod(SPELLVALUE_AURA_STACK, 2);
|
||||||
values.AddSpellMod(SPELLVALUE_MAX_TARGETS, 1);
|
values.AddSpellMod(SPELLVALUE_MAX_TARGETS, 1);
|
||||||
GetTarget()->CastCustomSpell(SPELL_NECROTIC_PLAGUE_JUMP, values, NULL, true, NULL, NULL, GetCasterGUID());
|
GetTarget()->CastCustomSpell(SPELL_NECROTIC_PLAGUE_JUMP, values, NULL, TRIGGERED_FULL_MASK, NULL, NULL, GetCasterGUID());
|
||||||
if (Unit* caster = GetCaster())
|
if (Unit* caster = GetCaster())
|
||||||
caster->CastSpell(caster, SPELL_PLAGUE_SIPHON, true);
|
caster->CastSpell(caster, SPELL_PLAGUE_SIPHON, true);
|
||||||
}
|
}
|
||||||
@@ -2204,7 +2204,7 @@ class spell_the_lich_king_necrotic_plague_jump : public SpellScriptLoader
|
|||||||
|
|
||||||
CustomSpellValues values;
|
CustomSpellValues values;
|
||||||
values.AddSpellMod(SPELLVALUE_AURA_STACK, GetStackAmount());
|
values.AddSpellMod(SPELLVALUE_AURA_STACK, GetStackAmount());
|
||||||
GetTarget()->CastCustomSpell(SPELL_NECROTIC_PLAGUE_JUMP, values, NULL, true, NULL, NULL, GetCasterGUID());
|
GetTarget()->CastCustomSpell(SPELL_NECROTIC_PLAGUE_JUMP, values, NULL, TRIGGERED_FULL_MASK, NULL, NULL, GetCasterGUID());
|
||||||
if (Unit* caster = GetCaster())
|
if (Unit* caster = GetCaster())
|
||||||
caster->CastSpell(caster, SPELL_PLAGUE_SIPHON, true);
|
caster->CastSpell(caster, SPELL_PLAGUE_SIPHON, true);
|
||||||
}
|
}
|
||||||
@@ -2223,7 +2223,7 @@ class spell_the_lich_king_necrotic_plague_jump : public SpellScriptLoader
|
|||||||
CustomSpellValues values;
|
CustomSpellValues values;
|
||||||
values.AddSpellMod(SPELLVALUE_AURA_STACK, GetStackAmount());
|
values.AddSpellMod(SPELLVALUE_AURA_STACK, GetStackAmount());
|
||||||
values.AddSpellMod(SPELLVALUE_BASE_POINT1, AURA_REMOVE_BY_ENEMY_SPELL); // add as marker (spell has no effect 1)
|
values.AddSpellMod(SPELLVALUE_BASE_POINT1, AURA_REMOVE_BY_ENEMY_SPELL); // add as marker (spell has no effect 1)
|
||||||
GetTarget()->CastCustomSpell(SPELL_NECROTIC_PLAGUE_JUMP, values, NULL, true, NULL, NULL, GetCasterGUID());
|
GetTarget()->CastCustomSpell(SPELL_NECROTIC_PLAGUE_JUMP, values, NULL, TRIGGERED_FULL_MASK, NULL, NULL, GetCasterGUID());
|
||||||
if (Unit* caster = GetCaster())
|
if (Unit* caster = GetCaster())
|
||||||
caster->CastSpell(caster, SPELL_PLAGUE_SIPHON, true);
|
caster->CastSpell(caster, SPELL_PLAGUE_SIPHON, true);
|
||||||
|
|
||||||
|
|||||||
@@ -913,7 +913,7 @@ class spell_gen_profession_research : public SpellScriptLoader
|
|||||||
uint32 spellId = GetSpellInfo()->Id;
|
uint32 spellId = GetSpellInfo()->Id;
|
||||||
|
|
||||||
// learn random explicit discovery recipe (if any)
|
// learn random explicit discovery recipe (if any)
|
||||||
if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster->ToPlayer()))
|
if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster))
|
||||||
caster->learnSpell(discoveredSpellId, false);
|
caster->learnSpell(discoveredSpellId, false);
|
||||||
|
|
||||||
caster->UpdateCraftSkill(spellId);
|
caster->UpdateCraftSkill(spellId);
|
||||||
|
|||||||
@@ -842,7 +842,7 @@ class spell_item_book_of_glyph_mastery : public SpellScriptLoader
|
|||||||
uint32 spellId = GetSpellInfo()->Id;
|
uint32 spellId = GetSpellInfo()->Id;
|
||||||
|
|
||||||
// learn random explicit discovery recipe (if any)
|
// learn random explicit discovery recipe (if any)
|
||||||
if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster->ToPlayer()))
|
if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster))
|
||||||
caster->learnSpell(discoveredSpellId, false);
|
caster->learnSpell(discoveredSpellId, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user