mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
Merge commit 'origin/master' into 320
This commit is contained in:
commit
b99565ef42
9 changed files with 73 additions and 19 deletions
|
|
@ -283,6 +283,7 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
|
||||||
(55004, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Nitro Boosts', 'Spell::EffectDummy'),
|
(55004, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Nitro Boosts', 'Spell::EffectDummy'),
|
||||||
(55441,11, -1, -1, -1, -1, -1, -1, 4,-1,'Glyph of Mana Tide', 'Spell::EffectDummy'),
|
(55441,11, -1, -1, -1, -1, -1, -1, 4,-1,'Glyph of Mana Tide', 'Spell::EffectDummy'),
|
||||||
(56235,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Glyph of Conflagrate', 'Spell::EffectSchoolDMG'),
|
(56235,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Glyph of Conflagrate', 'Spell::EffectSchoolDMG'),
|
||||||
|
(57627,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Charge', 'Spell::EffectSchoolDMG'),
|
||||||
(57946, 5,0x0000000000040000,0x00000000, -1, -1, -1, 3, -1,-1,'Life Tap', 'Spell::EffectDummy'),
|
(57946, 5,0x0000000000040000,0x00000000, -1, -1, -1, 3, -1,-1,'Life Tap', 'Spell::EffectDummy'),
|
||||||
(58367,-1, -1, -1, -1, -1, -1, -1, 4,-1,'Glyph of Execution', 'Spell::EffectDummy'),
|
(58367,-1, -1, -1, -1, -1, -1, -1, 4,-1,'Glyph of Execution', 'Spell::EffectDummy'),
|
||||||
(58418, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Portal to Orgrimmar', 'Spell::EffectDummy'),
|
(58418, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Portal to Orgrimmar', 'Spell::EffectDummy'),
|
||||||
|
|
|
||||||
|
|
@ -669,7 +669,6 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8
|
||||||
|
|
||||||
uint32 item_id = oEntry->ItemId[j];
|
uint32 item_id = oEntry->ItemId[j];
|
||||||
|
|
||||||
|
|
||||||
// Hack for not existed item id in dbc 3.0.3
|
// Hack for not existed item id in dbc 3.0.3
|
||||||
if(item_id==40582)
|
if(item_id==40582)
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -681,9 +680,10 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// max stack by default (mostly 1), 1 for infinity stackable
|
// BuyCount by default
|
||||||
uint32 count = iProto->Stackable > 0 ? uint32(iProto->Stackable) : 1;
|
uint32 count = iProto->BuyCount;
|
||||||
|
|
||||||
|
// special amount for foor/drink
|
||||||
if(iProto->Class==ITEM_CLASS_CONSUMABLE && iProto->SubClass==ITEM_SUBCLASS_FOOD)
|
if(iProto->Class==ITEM_CLASS_CONSUMABLE && iProto->SubClass==ITEM_SUBCLASS_FOOD)
|
||||||
{
|
{
|
||||||
switch(iProto->Spells[0].SpellCategory)
|
switch(iProto->Spells[0].SpellCategory)
|
||||||
|
|
|
||||||
|
|
@ -505,6 +505,16 @@ void Spell::FillTargetMap()
|
||||||
// but need it support in some know cases
|
// but need it support in some know cases
|
||||||
switch(m_spellInfo->EffectImplicitTargetA[i])
|
switch(m_spellInfo->EffectImplicitTargetA[i])
|
||||||
{
|
{
|
||||||
|
case 0:
|
||||||
|
switch(m_spellInfo->EffectImplicitTargetB[i])
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
SetTargetMap(i, m_spellInfo->EffectImplicitTargetB[i], tmpUnitMap);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case TARGET_SELF:
|
case TARGET_SELF:
|
||||||
switch(m_spellInfo->EffectImplicitTargetB[i])
|
switch(m_spellInfo->EffectImplicitTargetB[i])
|
||||||
{
|
{
|
||||||
|
|
@ -3751,7 +3761,9 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||||
return SPELL_FAILED_CASTER_AURASTATE;
|
return SPELL_FAILED_CASTER_AURASTATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(target != m_caster)
|
bool non_caster_target = target != m_caster && !IsSpellWithCasterSourceTargetsOnly(m_spellInfo);
|
||||||
|
|
||||||
|
if(non_caster_target)
|
||||||
{
|
{
|
||||||
// target state requirements (apply to non-self only), to allow cast affects to self like Dirty Deeds
|
// target state requirements (apply to non-self only), to allow cast affects to self like Dirty Deeds
|
||||||
if(m_spellInfo->TargetAuraState && !target->HasAuraStateForCaster(AuraState(m_spellInfo->TargetAuraState),m_caster->GetGUID()))
|
if(m_spellInfo->TargetAuraState && !target->HasAuraStateForCaster(AuraState(m_spellInfo->TargetAuraState),m_caster->GetGUID()))
|
||||||
|
|
@ -3806,7 +3818,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||||
|
|
||||||
//check creature type
|
//check creature type
|
||||||
//ignore self casts (including area casts when caster selected as target)
|
//ignore self casts (including area casts when caster selected as target)
|
||||||
if(target != m_caster)
|
if(non_caster_target)
|
||||||
{
|
{
|
||||||
if(!CheckTargetCreatureType(target))
|
if(!CheckTargetCreatureType(target))
|
||||||
{
|
{
|
||||||
|
|
@ -3819,7 +3831,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||||
|
|
||||||
// TODO: this check can be applied and for player to prevent cheating when IsPositiveSpell will return always correct result.
|
// TODO: this check can be applied and for player to prevent cheating when IsPositiveSpell will return always correct result.
|
||||||
// check target for pet/charmed casts (not self targeted), self targeted cast used for area effects and etc
|
// check target for pet/charmed casts (not self targeted), self targeted cast used for area effects and etc
|
||||||
if(m_caster != target && m_caster->GetTypeId() == TYPEID_UNIT && m_caster->GetCharmerOrOwnerGUID())
|
if(non_caster_target && m_caster->GetTypeId() == TYPEID_UNIT && m_caster->GetCharmerOrOwnerGUID())
|
||||||
{
|
{
|
||||||
// check correctness positive/negative cast target (pet cast real check and cheating check)
|
// check correctness positive/negative cast target (pet cast real check and cheating check)
|
||||||
if(IsPositiveSpell(m_spellInfo->Id))
|
if(IsPositiveSpell(m_spellInfo->Id))
|
||||||
|
|
@ -3859,7 +3871,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if target is in combat
|
// check if target is in combat
|
||||||
if (target != m_caster && (m_spellInfo->AttributesEx & SPELL_ATTR_EX_NOT_IN_COMBAT_TARGET) && target->isInCombat())
|
if (non_caster_target && (m_spellInfo->AttributesEx & SPELL_ATTR_EX_NOT_IN_COMBAT_TARGET) && target->isInCombat())
|
||||||
return SPELL_FAILED_TARGET_AFFECTING_COMBAT;
|
return SPELL_FAILED_TARGET_AFFECTING_COMBAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7029,7 +7029,7 @@ void Aura::UnregisterSingleCastAura()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sLog.outError("Couldn't find the caster of the single target aura, may crash later!");
|
sLog.outError("Couldn't find the caster of the single target aura (SpellId %u), may crash later!", GetId());
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
m_isSingleTargetAura = false;
|
m_isSingleTargetAura = false;
|
||||||
|
|
|
||||||
|
|
@ -577,7 +577,8 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
|
||||||
//Gore
|
//Gore
|
||||||
if (m_spellInfo->SpellIconID == 1578)
|
if (m_spellInfo->SpellIconID == 1578)
|
||||||
{
|
{
|
||||||
damage+= rand()%2 ? damage : 0;
|
if (m_caster->HasAura(57627)) // Charge 6 sec post-affect
|
||||||
|
damage *= 2;
|
||||||
}
|
}
|
||||||
// Mongoose Bite
|
// Mongoose Bite
|
||||||
else if ((m_spellInfo->SpellFamilyFlags & UI64LIT(0x000000002)) && m_spellInfo->SpellVisual[0]==342)
|
else if ((m_spellInfo->SpellFamilyFlags & UI64LIT(0x000000002)) && m_spellInfo->SpellVisual[0]==342)
|
||||||
|
|
|
||||||
|
|
@ -196,6 +196,46 @@ bool IsPositiveTarget(uint32 targetA, uint32 targetB);
|
||||||
bool IsSingleTargetSpell(SpellEntry const *spellInfo);
|
bool IsSingleTargetSpell(SpellEntry const *spellInfo);
|
||||||
bool IsSingleTargetSpells(SpellEntry const *spellInfo1, SpellEntry const *spellInfo2);
|
bool IsSingleTargetSpells(SpellEntry const *spellInfo1, SpellEntry const *spellInfo2);
|
||||||
|
|
||||||
|
inline bool IsCasterSourceTarget(uint32 target)
|
||||||
|
{
|
||||||
|
switch (target )
|
||||||
|
{
|
||||||
|
case TARGET_SELF:
|
||||||
|
case TARGET_PET:
|
||||||
|
case TARGET_ALL_PARTY_AROUND_CASTER:
|
||||||
|
case TARGET_IN_FRONT_OF_CASTER:
|
||||||
|
case TARGET_MASTER:
|
||||||
|
case TARGET_MINION:
|
||||||
|
case TARGET_ALL_PARTY:
|
||||||
|
case TARGET_ALL_PARTY_AROUND_CASTER_2:
|
||||||
|
case TARGET_SELF_FISHING:
|
||||||
|
case TARGET_TOTEM_EARTH:
|
||||||
|
case TARGET_TOTEM_WATER:
|
||||||
|
case TARGET_TOTEM_AIR:
|
||||||
|
case TARGET_TOTEM_FIRE:
|
||||||
|
case TARGET_SUMMON:
|
||||||
|
case TARGET_AREAEFFECT_CUSTOM_2:
|
||||||
|
case TARGET_ALL_RAID_AROUND_CASTER:
|
||||||
|
case TARGET_SELF2:
|
||||||
|
case TARGET_DIRECTLY_FORWARD:
|
||||||
|
case TARGET_NONCOMBAT_PET:
|
||||||
|
case TARGET_IN_FRONT_OF_CASTER_30:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool IsSpellWithCasterSourceTargetsOnly(SpellEntry const* spellInfo)
|
||||||
|
{
|
||||||
|
for(int i = 0; i < 3; ++i)
|
||||||
|
if(uint32 target = spellInfo->EffectImplicitTargetA[i])
|
||||||
|
if(!IsCasterSourceTarget(target))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
inline bool IsPointEffectTarget( Targets target )
|
inline bool IsPointEffectTarget( Targets target )
|
||||||
{
|
{
|
||||||
switch (target )
|
switch (target )
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ bool WaypointMovementGenerator<Creature>::Update(Creature &creature, const uint3
|
||||||
{
|
{
|
||||||
if( i_nextMoveTime.Passed()) // Timer has elapsed, meaning this part controlled it
|
if( i_nextMoveTime.Passed()) // Timer has elapsed, meaning this part controlled it
|
||||||
{
|
{
|
||||||
SetStopedByPlayer(false);
|
SetStoppedByPlayer(false);
|
||||||
// Now we re-set destination to same node and start travel
|
// Now we re-set destination to same node and start travel
|
||||||
creature.addUnitState(UNIT_STAT_ROAMING);
|
creature.addUnitState(UNIT_STAT_ROAMING);
|
||||||
if (creature.canFly())
|
if (creature.canFly())
|
||||||
|
|
@ -117,11 +117,11 @@ bool WaypointMovementGenerator<Creature>::Update(Creature &creature, const uint3
|
||||||
}
|
}
|
||||||
else // if( !i_nextMoveTime.Passed())
|
else // if( !i_nextMoveTime.Passed())
|
||||||
{ // unexpected end of timer && creature stopped && not at end of segment
|
{ // unexpected end of timer && creature stopped && not at end of segment
|
||||||
if (!IsStopedByPlayer())
|
if (!IsStoppedByPlayer())
|
||||||
{ // Put 30 seconds delay
|
{ // Put 30 seconds delay
|
||||||
i_destinationHolder.IncreaseTravelTime(STOP_TIME_FOR_PLAYER);
|
i_destinationHolder.IncreaseTravelTime(STOP_TIME_FOR_PLAYER);
|
||||||
i_nextMoveTime.Reset(STOP_TIME_FOR_PLAYER);
|
i_nextMoveTime.Reset(STOP_TIME_FOR_PLAYER);
|
||||||
SetStopedByPlayer(true); // Mark we did it
|
SetStoppedByPlayer(true); // Mark we did it
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true; // Abort here this update
|
return true; // Abort here this update
|
||||||
|
|
@ -194,7 +194,7 @@ bool WaypointMovementGenerator<Creature>::Update(Creature &creature, const uint3
|
||||||
else // If not stopped then stop it and set the reset of TimeTracker to waittime
|
else // If not stopped then stop it and set the reset of TimeTracker to waittime
|
||||||
{
|
{
|
||||||
creature.StopMoving();
|
creature.StopMoving();
|
||||||
SetStopedByPlayer(false);
|
SetStoppedByPlayer(false);
|
||||||
i_nextMoveTime.Reset(i_path->at(i_currentNode).delay);
|
i_nextMoveTime.Reset(i_path->at(i_currentNode).delay);
|
||||||
++i_currentNode;
|
++i_currentNode;
|
||||||
if( i_currentNode >= i_path->size() )
|
if( i_currentNode >= i_path->size() )
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ class MANGOS_DLL_SPEC WaypointMovementGenerator<Creature>
|
||||||
public PathMovementBase<Creature, WaypointPath*>
|
public PathMovementBase<Creature, WaypointPath*>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WaypointMovementGenerator(Creature &) : i_nextMoveTime(0), b_StopedByPlayer(false) {}
|
WaypointMovementGenerator(Creature &) : i_nextMoveTime(0), b_StoppedByPlayer(false) {}
|
||||||
~WaypointMovementGenerator() { ClearWaypoints(); }
|
~WaypointMovementGenerator() { ClearWaypoints(); }
|
||||||
void Initialize(Creature &u)
|
void Initialize(Creature &u)
|
||||||
{
|
{
|
||||||
|
|
@ -86,7 +86,7 @@ public PathMovementBase<Creature, WaypointPath*>
|
||||||
void Reset(Creature &u)
|
void Reset(Creature &u)
|
||||||
{
|
{
|
||||||
ReloadPath(u);
|
ReloadPath(u);
|
||||||
b_StopedByPlayer = false;
|
b_StoppedByPlayer = false;
|
||||||
i_nextMoveTime.Reset(0);
|
i_nextMoveTime.Reset(0);
|
||||||
}
|
}
|
||||||
bool Update(Creature &u, const uint32 &diff);
|
bool Update(Creature &u, const uint32 &diff);
|
||||||
|
|
@ -100,8 +100,8 @@ public PathMovementBase<Creature, WaypointPath*>
|
||||||
void ReloadPath(Creature &c) { ClearWaypoints(); LoadPath(c); }
|
void ReloadPath(Creature &c) { ClearWaypoints(); LoadPath(c); }
|
||||||
|
|
||||||
// Player stoping creature
|
// Player stoping creature
|
||||||
bool IsStopedByPlayer() { return b_StopedByPlayer; }
|
bool IsStoppedByPlayer() { return b_StoppedByPlayer; }
|
||||||
void SetStopedByPlayer(bool val) { b_StopedByPlayer = val; }
|
void SetStoppedByPlayer(bool val) { b_StoppedByPlayer = val; }
|
||||||
|
|
||||||
// statics
|
// statics
|
||||||
static void Initialize(void);
|
static void Initialize(void);
|
||||||
|
|
@ -114,7 +114,7 @@ public PathMovementBase<Creature, WaypointPath*>
|
||||||
|
|
||||||
TimeTrackerSmall i_nextMoveTime;
|
TimeTrackerSmall i_nextMoveTime;
|
||||||
std::vector<bool> i_hasDone;
|
std::vector<bool> i_hasDone;
|
||||||
bool b_StopedByPlayer;
|
bool b_StoppedByPlayer;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** FlightPathMovementGenerator generates movement of the player for the paths
|
/** FlightPathMovementGenerator generates movement of the player for the paths
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8280"
|
#define REVISION_NR "8284"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue