*Merge.
*Also fix build in VC7 and VC8. --HG-- branch : trunk
This commit is contained in:
@@ -525,7 +525,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\eastern_plaguelands\scarlet_enclave.cpp"
|
||||
RelativePath="..\scripts\zone\eastern_plaguelands\the_scarlet_enclave.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
|
||||
@@ -694,7 +694,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\eastern_plaguelands\scarlet_enclave.cpp"
|
||||
RelativePath="..\scripts\zone\eastern_plaguelands\the_scarlet_enclave.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
|
||||
@@ -552,49 +552,49 @@ void FillSpellSummary()
|
||||
for (int j=0; j<3; j++)
|
||||
{
|
||||
//Spell targets self
|
||||
if ( TempSpell->EffectImplicitTargetA[j] == TARGET_SELF )
|
||||
if ( TempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_CASTER )
|
||||
SpellSummary[i].Targets |= 1 << (SELECT_TARGET_SELF-1);
|
||||
|
||||
//Spell targets a single enemy
|
||||
if ( TempSpell->EffectImplicitTargetA[j] == TARGET_CHAIN_DAMAGE ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_CURRENT_ENEMY_COORDINATES )
|
||||
if ( TempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_TARGET_ENEMY ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_DST_TARGET_ENEMY )
|
||||
SpellSummary[i].Targets |= 1 << (SELECT_TARGET_SINGLE_ENEMY-1);
|
||||
|
||||
//Spell targets AoE at enemy
|
||||
if ( TempSpell->EffectImplicitTargetA[j] == TARGET_ALL_ENEMY_IN_AREA ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_ALL_ENEMY_IN_AREA_INSTANT ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_DEST_CASTER ||
|
||||
if ( TempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_AREA_ENEMY_SRC ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_AREA_ENEMY_DST ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_SRC_CASTER ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_DEST_DYNOBJ_ENEMY )
|
||||
SpellSummary[i].Targets |= 1 << (SELECT_TARGET_AOE_ENEMY-1);
|
||||
|
||||
//Spell targets an enemy
|
||||
if ( TempSpell->EffectImplicitTargetA[j] == TARGET_CHAIN_DAMAGE ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_CURRENT_ENEMY_COORDINATES ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_ALL_ENEMY_IN_AREA ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_ALL_ENEMY_IN_AREA_INSTANT ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_DEST_CASTER ||
|
||||
if ( TempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_TARGET_ENEMY ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_DST_TARGET_ENEMY ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_AREA_ENEMY_SRC ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_AREA_ENEMY_DST ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_SRC_CASTER ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_DEST_DYNOBJ_ENEMY )
|
||||
SpellSummary[i].Targets |= 1 << (SELECT_TARGET_ANY_ENEMY-1);
|
||||
|
||||
//Spell targets a single friend(or self)
|
||||
if ( TempSpell->EffectImplicitTargetA[j] == TARGET_SELF ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_SINGLE_FRIEND ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_SINGLE_PARTY )
|
||||
if ( TempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_CASTER ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_TARGET_ALLY ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_TARGET_PARTY )
|
||||
SpellSummary[i].Targets |= 1 << (SELECT_TARGET_SINGLE_FRIEND-1);
|
||||
|
||||
//Spell targets aoe friends
|
||||
if ( TempSpell->EffectImplicitTargetA[j] == TARGET_ALL_PARTY_AROUND_CASTER ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_AREAEFFECT_PARTY ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_DEST_CASTER)
|
||||
if ( TempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_PARTY_CASTER ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_PARTY_TARGET ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_SRC_CASTER)
|
||||
SpellSummary[i].Targets |= 1 << (SELECT_TARGET_AOE_FRIEND-1);
|
||||
|
||||
//Spell targets any friend(or self)
|
||||
if ( TempSpell->EffectImplicitTargetA[j] == TARGET_SELF ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_SINGLE_FRIEND ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_SINGLE_PARTY ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_ALL_PARTY_AROUND_CASTER ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_AREAEFFECT_PARTY ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_DEST_CASTER)
|
||||
if ( TempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_CASTER ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_TARGET_ALLY ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_TARGET_PARTY ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_PARTY_CASTER ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_PARTY_TARGET ||
|
||||
TempSpell->EffectImplicitTargetA[j] == TARGET_SRC_CASTER)
|
||||
SpellSummary[i].Targets |= 1 << (SELECT_TARGET_ANY_FRIEND-1);
|
||||
|
||||
//Make sure that this spell includes a damage effect
|
||||
|
||||
@@ -114,12 +114,12 @@ ConfusedMovementGenerator<T>::Update(T &unit, const uint32 &diff)
|
||||
{
|
||||
// currently moving, update location
|
||||
Traveller<T> traveller(unit);
|
||||
if( i_destinationHolder.UpdateTraveller(traveller, diff, false))
|
||||
if( i_destinationHolder.UpdateTraveller(traveller, diff))
|
||||
{
|
||||
if( i_destinationHolder.HasArrived())
|
||||
{
|
||||
// arrived, stop and wait a bit
|
||||
unit.StopMoving();
|
||||
unit.clearUnitState(UNIT_STAT_MOVE);
|
||||
|
||||
i_nextMove = urand(1,MAX_CONF_WAYPOINTS);
|
||||
i_nextMoveTime.Reset(urand(0, 1500-1)); // TODO: check the minimum reset time, should be probably higher
|
||||
|
||||
@@ -51,7 +51,7 @@ class TRINITY_DLL_DECL DestinationHolder
|
||||
bool HasDestination(void) const { return i_destSet; }
|
||||
float GetDestinationDiff(float x, float y, float z) const;
|
||||
bool HasArrived(void) const { return (i_totalTravelTime == 0 || i_timeElapsed >= i_totalTravelTime); }
|
||||
bool UpdateTraveller(TRAVELLER &traveller, uint32 diff, bool force_update=false, bool micro_movement=false);
|
||||
bool UpdateTraveller(TRAVELLER &traveller, uint32 diff, bool micro_movement=false);
|
||||
uint32 StartTravel(TRAVELLER &traveller, bool sendMove = true);
|
||||
void GetLocationNow(uint32 mapid, float &x, float &y, float &z, bool is3D = false) const;
|
||||
void GetLocationNowNoMicroMovement(float &x, float &y, float &z) const; // For use without micro movement
|
||||
|
||||
@@ -93,37 +93,29 @@ DestinationHolder<TRAVELLER>::StartTravel(TRAVELLER &traveller, bool sendMove)
|
||||
|
||||
template<typename TRAVELLER>
|
||||
bool
|
||||
DestinationHolder<TRAVELLER>::UpdateTraveller(TRAVELLER &traveller, uint32 diff, bool force_update, bool micro_movement)
|
||||
DestinationHolder<TRAVELLER>::UpdateTraveller(TRAVELLER &traveller, uint32 diff, bool micro_movement)
|
||||
{
|
||||
i_timeElapsed += diff;
|
||||
|
||||
// Update every TRAVELLER_UPDATE_INTERVAL
|
||||
i_tracker.Update(diff);
|
||||
if(!i_tracker.Passed())
|
||||
return false;
|
||||
else
|
||||
ResetUpdate();
|
||||
|
||||
if(!i_destSet) return true;
|
||||
|
||||
float x, y, z;
|
||||
if(!micro_movement)
|
||||
{
|
||||
i_tracker.Update(diff);
|
||||
i_timeElapsed += diff;
|
||||
if( i_tracker.Passed() || force_update )
|
||||
{
|
||||
ResetUpdate();
|
||||
if(!i_destSet) return true;
|
||||
float x,y,z;
|
||||
GetLocationNowNoMicroMovement(x, y, z);
|
||||
|
||||
if( x == -431602080 )
|
||||
return false;
|
||||
if( traveller.GetTraveller().GetPositionX() != x || traveller.GetTraveller().GetPositionY() != y )
|
||||
}
|
||||
else
|
||||
{
|
||||
float ori = traveller.GetTraveller().GetAngle(x, y);
|
||||
traveller.Relocation(x, y, z, ori);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
i_tracker.Update(diff);
|
||||
i_timeElapsed += diff;
|
||||
if( i_tracker.Passed() || force_update )
|
||||
{
|
||||
ResetUpdate();
|
||||
if(!i_destSet) return true;
|
||||
float x,y,z;
|
||||
|
||||
if(!traveller.GetTraveller().hasUnitState(UNIT_STAT_MOVING | UNIT_STAT_IN_FLIGHT))
|
||||
return true;
|
||||
|
||||
@@ -135,11 +127,6 @@ DestinationHolder<TRAVELLER>::UpdateTraveller(TRAVELLER &traveller, uint32 diff,
|
||||
if( x == -431602080 )
|
||||
return false;
|
||||
|
||||
if( traveller.GetTraveller().GetPositionX() != x || traveller.GetTraveller().GetPositionY() != y )
|
||||
{
|
||||
float ori = traveller.GetTraveller().GetAngle(x, y);
|
||||
traveller.Relocation(x, y, z, ori);
|
||||
}
|
||||
// Change movement computation to micro movement based on last tick coords, this makes system work
|
||||
// even on multiple floors zones without hugh vmaps usage ;)
|
||||
|
||||
@@ -153,9 +140,15 @@ DestinationHolder<TRAVELLER>::UpdateTraveller(TRAVELLER &traveller, uint32 diff,
|
||||
i_fromX = x; // and change origine
|
||||
i_fromY = y; // then I take into account only micro movement
|
||||
i_fromZ = z;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
if( traveller.GetTraveller().GetPositionX() != x || traveller.GetTraveller().GetPositionY() != y )
|
||||
{
|
||||
float ori = traveller.GetTraveller().GetAngle(x, y);
|
||||
traveller.Relocation(x, y, z, ori);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
template<typename TRAVELLER>
|
||||
|
||||
@@ -383,7 +383,7 @@ FleeingMovementGenerator<T>::Update(T &owner, const uint32 & time_diff)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (i_destinationHolder.UpdateTraveller(traveller, time_diff, false))
|
||||
if (i_destinationHolder.UpdateTraveller(traveller, time_diff))
|
||||
{
|
||||
i_destinationHolder.ResetUpdate(50);
|
||||
if(i_nextCheckTime.Passed() && i_destinationHolder.HasArrived())
|
||||
|
||||
@@ -181,7 +181,7 @@ inline void Trinity::DynamicObjectUpdater::VisitHelper(Unit* target)
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(i_dynobject.GetSpellId());
|
||||
uint32 eff_index = i_dynobject.GetEffIndex();
|
||||
if(spellInfo->EffectImplicitTargetB[eff_index] == TARGET_DEST_DYNOBJ_ALLY
|
||||
|| spellInfo->EffectImplicitTargetB[eff_index] == TARGET_UNIT_AREA_ALLY_GROUND)
|
||||
|| spellInfo->EffectImplicitTargetB[eff_index] == TARGET_UNIT_AREA_ALLY_DST)
|
||||
{
|
||||
if(!i_check->IsFriendlyTo(target))
|
||||
return;
|
||||
|
||||
@@ -60,7 +60,7 @@ bool
|
||||
HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32& time_diff)
|
||||
{
|
||||
CreatureTraveller traveller( owner);
|
||||
i_destinationHolder.UpdateTraveller(traveller, time_diff, false);
|
||||
i_destinationHolder.UpdateTraveller(traveller, time_diff);
|
||||
|
||||
if (time_diff > i_travel_timer)
|
||||
{
|
||||
|
||||
@@ -23,14 +23,19 @@
|
||||
|
||||
IdleMovementGenerator si_idleMovement;
|
||||
|
||||
// StopMoving is needed to make unit stop if its last movement generator expires
|
||||
// But it should not be sent otherwise there are many redundent packets
|
||||
void IdleMovementGenerator::Initialize(Unit &owner)
|
||||
{
|
||||
if(owner.hasUnitState(UNIT_STAT_MOVE))
|
||||
owner.StopMoving();
|
||||
}
|
||||
|
||||
void
|
||||
IdleMovementGenerator::Reset(Unit& /*owner*/)
|
||||
IdleMovementGenerator::Reset(Unit& owner)
|
||||
{
|
||||
if(owner.hasUnitState(UNIT_STAT_MOVE))
|
||||
owner.StopMoving();
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -209,7 +209,7 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid
|
||||
|
||||
for(uint32 i = 0; i < 3;++i)
|
||||
{
|
||||
if(spellInfo->EffectImplicitTargetA[i] == TARGET_ALL_ENEMY_IN_AREA || spellInfo->EffectImplicitTargetA[i] == TARGET_ALL_ENEMY_IN_AREA_INSTANT || spellInfo->EffectImplicitTargetA[i] == TARGET_DEST_DYNOBJ_ENEMY)
|
||||
if(spellInfo->EffectImplicitTargetA[i] == TARGET_UNIT_AREA_ENEMY_SRC || spellInfo->EffectImplicitTargetA[i] == TARGET_UNIT_AREA_ENEMY_DST || spellInfo->EffectImplicitTargetA[i] == TARGET_DEST_DYNOBJ_ENEMY)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,10 +53,11 @@ bool PointMovementGenerator<T>::Update(T &unit, const uint32 &diff)
|
||||
|
||||
Traveller<T> traveller(unit);
|
||||
|
||||
i_destinationHolder.UpdateTraveller(traveller, diff, false);
|
||||
i_destinationHolder.UpdateTraveller(traveller, diff);
|
||||
|
||||
if(i_destinationHolder.HasArrived())
|
||||
{
|
||||
unit.clearUnitState(UNIT_STAT_MOVE);
|
||||
arrived = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -164,14 +164,14 @@ RandomMovementGenerator<Creature>::Update(Creature &creature, const uint32 &diff
|
||||
i_nextMoveTime.Update(diff);
|
||||
|
||||
if(i_destinationHolder.HasArrived() && !creature.IsStopped() && !creature.canFly())
|
||||
creature.clearUnitState(UNIT_STAT_ROAMING);
|
||||
creature.clearUnitState(UNIT_STAT_ROAMING | UNIT_STAT_MOVE);
|
||||
|
||||
if(!i_destinationHolder.HasArrived() && creature.IsStopped())
|
||||
creature.addUnitState(UNIT_STAT_ROAMING);
|
||||
|
||||
CreatureTraveller traveller(creature);
|
||||
|
||||
if( i_destinationHolder.UpdateTraveller(traveller, diff, false, true) )
|
||||
if( i_destinationHolder.UpdateTraveller(traveller, diff, true) )
|
||||
{
|
||||
if(i_nextMoveTime.Passed())
|
||||
{
|
||||
|
||||
+23
-48
@@ -995,63 +995,43 @@ enum SpellImmunity
|
||||
|
||||
enum Targets
|
||||
{
|
||||
TARGET_SELF = 1,
|
||||
TARGET_UNIT_CASTER = 1,
|
||||
TARGET_UNIT_NEARBY_ENEMY = 2,
|
||||
TARGET_UNIT_NEARBY_ENEMY = 2, // only one spell has that, but regardless, it's a target type after all
|
||||
TARGET_UNIT_NEARBY_ALLY = 3,
|
||||
TARGET_UNIT_NEARBY_ALLY_UNK = 4,
|
||||
TARGET_PET = 5,
|
||||
TARGET_UNIT_PET = 5,
|
||||
TARGET_CHAIN_DAMAGE = 6,
|
||||
TARGET_UNIT_TARGET_ENEMY = 6,
|
||||
TARGET_UNIT_AREA_ENTRY = 7,
|
||||
TARGET_AREAEFFECT_CUSTOM = 8,
|
||||
TARGET_UNIT_AREA_ENTRY_GROUND = 8,
|
||||
TARGET_INNKEEPER_COORDINATES = 9, // uses in teleport to innkeeper spells
|
||||
//TARGET_DEST_HOME
|
||||
TARGET_UNIT_AREA_ENTRY_SRC = 7,
|
||||
TARGET_UNIT_AREA_ENTRY_DST = 8,
|
||||
TARGET_DST_HOME = 9, // uses in teleport to innkeeper spells
|
||||
TARGET_UNIT_TARGET_DEST_CASTER = 11, // teleport target to caster
|
||||
TARGET_ALL_ENEMY_IN_AREA = 15,
|
||||
TARGET_UNIT_AREA_ENEMY = 15,
|
||||
TARGET_ALL_ENEMY_IN_AREA_INSTANT = 16,
|
||||
TARGET_UNIT_AREA_ENEMY_GROUND = 16,
|
||||
TARGET_TABLE_X_Y_Z_COORDINATES = 17, // uses in teleport spells and some other
|
||||
//TARGET_DEST_TABLE
|
||||
TARGET_EFFECT_SELECT = 18, // highly depends on the spell effect
|
||||
TARGET_DEST_CASTER_GROUND = 18,
|
||||
TARGET_UNIT_AREA_ENEMY_SRC = 15,
|
||||
TARGET_UNIT_AREA_ENEMY_DST = 16,
|
||||
TARGET_DST_DB = 17, // uses in teleport spells and some other
|
||||
TARGET_DST_CASTER = 18,
|
||||
TARGET_PREV_EFFECT_SUMMON = 18,
|
||||
TARGET_ALL_PARTY_AROUND_CASTER = 20,
|
||||
TARGET_UNIT_PARTY_CASTER = 20,
|
||||
TARGET_SINGLE_FRIEND = 21,
|
||||
TARGET_UNIT_TARGET_ALLY = 21,
|
||||
TARGET_DEST_CASTER = 22,
|
||||
TARGET_SRC_CASTER = 22,
|
||||
TARGET_GAMEOBJECT = 23,
|
||||
//TARGET_OBJECT_OPEN
|
||||
TARGET_IN_FRONT_OF_CASTER = 24,
|
||||
TARGET_UNIT_CONE_ENEMY = 24,
|
||||
TARGET_DUELVSPLAYER = 25,
|
||||
TARGET_UNIT_TARGET_ANY = 25,
|
||||
TARGET_GAMEOBJECT_ITEM = 26,
|
||||
//TARGET_OBJECT_ITEM_PICKLOCK
|
||||
TARGET_UNIT_MASTER = 27,
|
||||
TARGET_DEST_DYNOBJ_ENEMY = 28,
|
||||
TARGET_DEST_DYNOBJ_ALLY = 29, // only for effect 27
|
||||
TARGET_ALL_FRIENDLY_UNITS_AROUND_CASTER = 30, // in TargetB used only with TARGET_ALL_AROUND_CASTER and in self casting range in TargetA
|
||||
TARGET_UNIT_AREA_ALLY = 30,
|
||||
TARGET_ALL_FRIENDLY_UNITS_IN_AREA = 31,
|
||||
TARGET_UNIT_AREA_ALLY_GROUND = 31,
|
||||
TARGET_UNIT_AREA_ALLY_SRC = 30, // in TargetB used only with TARGET_SRC_CASTER and in self casting range in TargetA
|
||||
TARGET_UNIT_AREA_ALLY_DST = 31,
|
||||
TARGET_MINION = 32,
|
||||
//TARGET_DEST_SUMMON
|
||||
TARGET_ALL_PARTY = 33,
|
||||
TARGET_UNIT_AREA_PARTY = 33,
|
||||
TARGET_ALL_PARTY_AROUND_CASTER_2 = 34, // used in Tranquility
|
||||
TARGET_UNIT_AREA_PARTY_GROUND = 34,
|
||||
TARGET_SINGLE_PARTY = 35,
|
||||
TARGET_UNIT_AREA_PARTY_SRC = 33,
|
||||
TARGET_UNIT_AREA_PARTY_DST = 34, // used in Tranquility
|
||||
TARGET_UNIT_TARGET_PARTY = 35,
|
||||
TARGET_DEST_CASTER_RANDOM_UNKNOWN = 36, //unknown
|
||||
TARGET_AREAEFFECT_PARTY = 37,
|
||||
TARGET_UNIT_PARTY_TARGET = 37,
|
||||
TARGET_SCRIPT = 38,
|
||||
//TARGET_UNIT_NEARBY_ENTRY
|
||||
TARGET_UNIT_NEARBY_ENTRY = 38,
|
||||
TARGET_UNIT_CASTER_FISHING = 39,
|
||||
TARGET_OBJECT_USE = 40,
|
||||
TARGET_DEST_CASTER_FRONT_LEFT = 41, //earth totem
|
||||
@@ -1059,28 +1039,23 @@ enum Targets
|
||||
TARGET_DEST_CASTER_BACK_RIGHT = 43, //air totem
|
||||
TARGET_DEST_CASTER_FRONT_RIGHT = 44, //fire totem
|
||||
TARGET_UNIT_CHAINHEAL = 45,
|
||||
TARGET_SCRIPT_COORDINATES = 46,
|
||||
//TARGET_DEST_NEARBY_ENTRY
|
||||
TARGET_DST_NEARBY_ENTRY = 46,
|
||||
TARGET_DEST_CASTER_FRONT = 47,
|
||||
TARGET_DEST_CASTER_BACK = 48,
|
||||
TARGET_DEST_CASTER_RIGHT = 49,
|
||||
TARGET_DEST_CASTER_LEFT = 50,
|
||||
TARGET_OBJECT_AREA = 51,
|
||||
TARGET_AREAEFFECT_CUSTOM_2 = 52,
|
||||
//TARGET_DUMMY
|
||||
TARGET_CURRENT_ENEMY_COORDINATES = 53, // set unit coordinates as dest, only 16 target B imlemented
|
||||
TARGET_DEST_TARGET_ENEMY = 53,
|
||||
TARGET_UNIT_CONE_ENEMY_UNKNOWN = 54,
|
||||
TARGET_OBJECT_AREA_SRC = 51,
|
||||
TARGET_OBJECT_AREA_DST = 52,
|
||||
TARGET_DST_TARGET_ENEMY = 53, // set unit coordinates as dest, only 16 target B imlemented
|
||||
TARGET_UNIT_CONE_ENEMY_UNKNOWN = 54, // 180 degree, or different angle
|
||||
TARGET_DEST_CASTER_FRONT_LEAP = 55, // for a leap spell
|
||||
TARGET_UNIT_RAID = 56,
|
||||
TARGET_SINGLE_FRIEND_2 = 57,
|
||||
TARGET_UNIT_RAID_CASTER = 56,
|
||||
TARGET_UNIT_TARGET_RAID = 57,
|
||||
TARGET_UNIT_NEARBY_RAID = 58,
|
||||
TARGET_UNIT_CONE_ALLY = 59,
|
||||
TARGET_UNIT_AREA_SCRIPT = 60,
|
||||
TARGET_AREAEFFECT_PARTY_AND_CLASS = 61,
|
||||
TARGET_UNIT_CONE_ENTRY = 60,
|
||||
TARGET_UNIT_CLASS_TARGET = 61,
|
||||
TARGET_TEST = 62, // for a test spell
|
||||
TARGET_DUELVSPLAYER_COORDINATES = 63,
|
||||
TARGET_DEST_TARGET_ANY = 63,
|
||||
TARGET_DEST_TARGET_FRONT = 64,
|
||||
TARGET_DEST_TARGET_BACK = 65, // uses in teleport behind spells
|
||||
@@ -1106,7 +1081,7 @@ enum Targets
|
||||
TARGET_DEST_DEST_FRONT_RIGHT = 85,
|
||||
TARGET_DEST_DEST_RANDOM = 86,
|
||||
TARGET_DEST_DEST = 87,
|
||||
TARGET_UNIT_AREA_ALL_CHANNEL = 88,
|
||||
TARGET_DEST_DYNOBJ_NONE = 88,
|
||||
TARGET_DEST_TRAJ = 89,
|
||||
TARGET_UNIT_MINIPET = 90,
|
||||
TARGET_CORPSE_AREA_ENEMY_PLAYER = 93,
|
||||
|
||||
+538
-508
File diff suppressed because it is too large
Load Diff
+28
-21
@@ -101,11 +101,14 @@ enum SpellRangeFlag
|
||||
|
||||
enum SpellNotifyPushType
|
||||
{
|
||||
PUSH_NONE = 0,
|
||||
PUSH_IN_FRONT,
|
||||
PUSH_IN_BACK,
|
||||
PUSH_IN_LINE,
|
||||
PUSH_DEST_CENTER,
|
||||
PUSH_TARGET_CENTER,
|
||||
PUSH_SRC_CENTER,
|
||||
PUSH_DST_CENTER,
|
||||
PUSH_CASTER_CENTER,
|
||||
PUSH_CHAIN,
|
||||
};
|
||||
|
||||
bool IsQuestTameSpell(uint32 spellId);
|
||||
@@ -137,29 +140,30 @@ class SpellCastTargets
|
||||
|
||||
m_itemTargetEntry = target.m_itemTargetEntry;
|
||||
|
||||
//m_srcX = target.m_srcX;
|
||||
//m_srcY = target.m_srcY;
|
||||
//m_srcZ = target.m_srcZ;
|
||||
m_srcX = target.m_srcX;
|
||||
m_srcY = target.m_srcY;
|
||||
m_srcZ = target.m_srcZ;
|
||||
|
||||
m_mapId = -1;
|
||||
m_destX = target.m_destX;
|
||||
m_destY = target.m_destY;
|
||||
m_destZ = target.m_destZ;
|
||||
m_hasDest = target.m_hasDest;
|
||||
|
||||
m_strTarget = target.m_strTarget;
|
||||
|
||||
m_targetMask = target.m_targetMask;
|
||||
|
||||
m_mapId = -1;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
uint64 getUnitTargetGUID() const { return m_unitTargetGUID; }
|
||||
Unit *getUnitTarget() const { return m_unitTarget; }
|
||||
void setUnitTarget(Unit *target);
|
||||
void setDestination(float x, float y, float z, bool send = true, int32 mapId = -1);
|
||||
void setDestination(Unit *target, bool send = true);
|
||||
void setSource(float x, float y, float z);
|
||||
void setSrc(float x, float y, float z);
|
||||
void setSrc(WorldObject *target);
|
||||
void setDestination(float x, float y, float z, int32 mapId = -1);
|
||||
void setDestination(WorldObject *target);
|
||||
|
||||
uint64 getGOTargetGUID() const { return m_GOTargetGUID; }
|
||||
GameObject *getGOTarget() const { return m_GOTarget; }
|
||||
@@ -181,14 +185,14 @@ class SpellCastTargets
|
||||
}
|
||||
|
||||
bool IsEmpty() const { return m_GOTargetGUID==0 && m_unitTargetGUID==0 && m_itemTarget==0 && m_CorpseTargetGUID==0; }
|
||||
bool HasDest() const { return m_hasDest; }
|
||||
bool HasSrc() const { return m_targetMask & TARGET_FLAG_SOURCE_LOCATION; }
|
||||
bool HasDst() const { return m_targetMask & TARGET_FLAG_DEST_LOCATION; }
|
||||
|
||||
void Update(Unit* caster);
|
||||
|
||||
float m_srcX, m_srcY, m_srcZ;
|
||||
int32 m_mapId;
|
||||
float m_destX, m_destY, m_destZ;
|
||||
bool m_hasDest;
|
||||
int32 m_mapId;
|
||||
std::string m_strTarget;
|
||||
|
||||
uint32 m_targetMask;
|
||||
@@ -240,6 +244,7 @@ enum ReplenishType
|
||||
|
||||
enum SpellTargets
|
||||
{
|
||||
SPELL_TARGETS_NONE = 0,
|
||||
SPELL_TARGETS_ALLY,
|
||||
SPELL_TARGETS_ENEMY,
|
||||
SPELL_TARGETS_ENTRY,
|
||||
@@ -405,10 +410,12 @@ class Spell
|
||||
void WriteAmmoToPacket( WorldPacket * data );
|
||||
void FillTargetMap();
|
||||
|
||||
void SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap);
|
||||
void SetTargetMap(uint32 i, uint32 cur);
|
||||
|
||||
bool CheckTarget( Unit* target, uint32 eff );
|
||||
bool CanAutoCast(Unit* target);
|
||||
void CheckSrc() { if(!m_targets.HasSrc()) m_targets.setSrc(m_caster); }
|
||||
void CheckDst() { if(!m_targets.HasDst()) m_targets.setDestination(m_caster); }
|
||||
|
||||
void SendCastResult(SpellCastResult result);
|
||||
void SendSpellStart();
|
||||
@@ -593,11 +600,9 @@ class Spell
|
||||
void DoAllEffectOnTarget(GOTargetInfo *target);
|
||||
void DoAllEffectOnTarget(ItemTargetInfo *target);
|
||||
bool UpdateChanneledTargetList();
|
||||
void SearchAreaTarget(std::list<Unit*> &data, float radius, SpellNotifyPushType type,
|
||||
SpellTargets TargetType, uint32 entry = 0);
|
||||
void SearchChainTarget(std::list<Unit*> &data, float radius, uint32 unMaxTargets,
|
||||
SpellTargets TargetType);
|
||||
Unit* SearchNearbyTarget(float radius, SpellTargets TargetType, uint32 entry = 0);
|
||||
void SearchAreaTarget(std::list<Unit*> &unitList, float radius, SpellNotifyPushType type, SpellTargets TargetType, uint32 entry = 0);
|
||||
void SearchChainTarget(std::list<Unit*> &unitList, float radius, uint32 unMaxTargets, SpellTargets TargetType);
|
||||
WorldObject* SearchNearbyTarget(float range, SpellTargets TargetType);
|
||||
bool IsValidSingleTargetEffect(Unit const* target, Targets type) const;
|
||||
bool IsValidSingleTargetSpell(Unit const* target) const;
|
||||
void CalculateDamageDoneForAllTargets();
|
||||
@@ -696,8 +701,10 @@ namespace Trinity
|
||||
|
||||
switch(i_push_type)
|
||||
{
|
||||
case PUSH_DEST_CENTER:
|
||||
case PUSH_TARGET_CENTER:
|
||||
case PUSH_SRC_CENTER:
|
||||
case PUSH_DST_CENTER:
|
||||
case PUSH_CHAIN:
|
||||
default:
|
||||
if((target->GetDistanceSq(i_x, i_y, i_z) < i_radiusSq))
|
||||
i_data->push_back(target);
|
||||
break;
|
||||
|
||||
@@ -2110,7 +2110,7 @@ void Spell::EffectTriggerSpell(uint32 i)
|
||||
bool instant = false;
|
||||
for(uint32 j = i+1; j < 3; ++j)
|
||||
{
|
||||
if(m_spellInfo->Effect[j]==SPELL_EFFECT_INSTAKILL && m_spellInfo->EffectImplicitTargetA[j]==TARGET_SELF)
|
||||
if(m_spellInfo->Effect[j]==SPELL_EFFECT_INSTAKILL && m_spellInfo->EffectImplicitTargetA[j]==TARGET_UNIT_CASTER)
|
||||
{
|
||||
instant = true;
|
||||
break;
|
||||
@@ -2153,7 +2153,7 @@ void Spell::EffectJump(uint32 i)
|
||||
|
||||
// Init dest coordinates
|
||||
float x,y,z,o;
|
||||
if(m_targets.HasDest())
|
||||
if(m_targets.HasDst())
|
||||
{
|
||||
x = m_targets.m_destX;
|
||||
y = m_targets.m_destY;
|
||||
@@ -2210,7 +2210,7 @@ void Spell::EffectTeleportUnits(uint32 i)
|
||||
return;
|
||||
|
||||
// If not exist data for dest location - return
|
||||
if(!m_targets.HasDest())
|
||||
if(!m_targets.HasDst())
|
||||
{
|
||||
sLog.outError( "Spell::EffectTeleportUnits - does not have destination for spell ID %u\n", m_spellInfo->Id );
|
||||
return;
|
||||
@@ -2230,7 +2230,7 @@ void Spell::EffectTeleportUnits(uint32 i)
|
||||
else if(unitTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)unitTarget)->TeleportTo(mapid, x, y, z, orientation, unitTarget==m_caster ? TELE_TO_SPELL : 0);
|
||||
|
||||
// post effects for TARGET_TABLE_X_Y_Z_COORDINATES
|
||||
// post effects for TARGET_DST_DB
|
||||
switch ( m_spellInfo->Id )
|
||||
{
|
||||
// Dimensional Ripper - Everlook
|
||||
@@ -5674,7 +5674,7 @@ void Spell::EffectMomentMove(uint32 i)
|
||||
if(unitTarget->isInFlight())
|
||||
return;
|
||||
|
||||
if(!m_targets.HasDest())
|
||||
if(!m_targets.HasDst())
|
||||
return;
|
||||
|
||||
uint32 mapid = m_caster->GetMapId();
|
||||
|
||||
+82
-57
@@ -94,7 +94,7 @@ SpellMgr::SpellMgr()
|
||||
case TARGET_UNIT_MASTER:
|
||||
case TARGET_UNIT_PET:
|
||||
case TARGET_UNIT_PARTY_CASTER:
|
||||
case TARGET_UNIT_RAID:
|
||||
case TARGET_UNIT_RAID_CASTER:
|
||||
SpellTargetType[i] = TARGET_TYPE_UNIT_CASTER;
|
||||
break;
|
||||
case TARGET_UNIT_MINIPET:
|
||||
@@ -104,24 +104,54 @@ SpellMgr::SpellMgr()
|
||||
case TARGET_UNIT_TARGET_ENEMY:
|
||||
case TARGET_UNIT_TARGET_PARTY:
|
||||
case TARGET_UNIT_PARTY_TARGET:
|
||||
case TARGET_UNIT_CLASS_TARGET:
|
||||
case TARGET_UNIT_CHAINHEAL:
|
||||
SpellTargetType[i] = TARGET_TYPE_UNIT_TARGET;
|
||||
break;
|
||||
case TARGET_UNIT_CHANNEL:
|
||||
case TARGET_DEST_CHANNEL:
|
||||
SpellTargetType[i] = TARGET_TYPE_CHANNEL;
|
||||
case TARGET_UNIT_NEARBY_ENEMY:
|
||||
case TARGET_UNIT_NEARBY_ALLY:
|
||||
case TARGET_UNIT_NEARBY_ALLY_UNK:
|
||||
case TARGET_UNIT_NEARBY_ENTRY:
|
||||
case TARGET_UNIT_NEARBY_RAID:
|
||||
SpellTargetType[i] = TARGET_TYPE_UNIT_NEARBY;
|
||||
break;
|
||||
case TARGET_UNIT_AREA_ENEMY_GROUND:
|
||||
case TARGET_UNIT_AREA_ENEMY:
|
||||
case TARGET_UNIT_AREA_ALLY_GROUND:
|
||||
case TARGET_UNIT_AREA_ALLY:
|
||||
case TARGET_UNIT_AREA_ENTRY_GROUND:
|
||||
case TARGET_UNIT_AREA_ENTRY:
|
||||
case TARGET_UNIT_AREA_PARTY_GROUND:
|
||||
case TARGET_UNIT_AREA_PARTY:
|
||||
SpellTargetType[i] = TARGET_TYPE_AREA_DEST;
|
||||
case TARGET_UNIT_AREA_ENEMY_SRC:
|
||||
case TARGET_UNIT_AREA_ALLY_SRC:
|
||||
case TARGET_UNIT_AREA_ENTRY_SRC:
|
||||
case TARGET_UNIT_AREA_PARTY_SRC:
|
||||
case TARGET_OBJECT_AREA_SRC:
|
||||
SpellTargetType[i] = TARGET_TYPE_AREA_SRC;
|
||||
break;
|
||||
case TARGET_DEST_TARGET_ENEMY:
|
||||
case TARGET_UNIT_AREA_ENEMY_DST:
|
||||
case TARGET_UNIT_AREA_ALLY_DST:
|
||||
case TARGET_UNIT_AREA_ENTRY_DST:
|
||||
case TARGET_UNIT_AREA_PARTY_DST:
|
||||
case TARGET_OBJECT_AREA_DST:
|
||||
SpellTargetType[i] = TARGET_TYPE_AREA_DST;
|
||||
break;
|
||||
case TARGET_UNIT_CONE_ENEMY:
|
||||
case TARGET_UNIT_CONE_ALLY:
|
||||
case TARGET_UNIT_CONE_ENTRY:
|
||||
case TARGET_UNIT_CONE_ENEMY_UNKNOWN:
|
||||
SpellTargetType[i] = TARGET_TYPE_AREA_CONE;
|
||||
break;
|
||||
case TARGET_DST_CASTER:
|
||||
case TARGET_SRC_CASTER:
|
||||
case TARGET_MINION:
|
||||
case TARGET_DEST_CASTER_FRONT_LEAP:
|
||||
case TARGET_DEST_CASTER_FRONT:
|
||||
case TARGET_DEST_CASTER_BACK:
|
||||
case TARGET_DEST_CASTER_RIGHT:
|
||||
case TARGET_DEST_CASTER_LEFT:
|
||||
case TARGET_DEST_CASTER_FRONT_LEFT:
|
||||
case TARGET_DEST_CASTER_BACK_LEFT:
|
||||
case TARGET_DEST_CASTER_BACK_RIGHT:
|
||||
case TARGET_DEST_CASTER_FRONT_RIGHT:
|
||||
case TARGET_DEST_CASTER_RANDOM:
|
||||
case TARGET_DEST_CASTER_RADIUS:
|
||||
SpellTargetType[i] = TARGET_TYPE_DEST_CASTER;
|
||||
break;
|
||||
case TARGET_DST_TARGET_ENEMY:
|
||||
case TARGET_DEST_TARGET_ANY:
|
||||
case TARGET_DEST_TARGET_FRONT:
|
||||
case TARGET_DEST_TARGET_BACK:
|
||||
@@ -135,25 +165,11 @@ SpellMgr::SpellMgr()
|
||||
case TARGET_DEST_TARGET_RADIUS:
|
||||
SpellTargetType[i] = TARGET_TYPE_DEST_TARGET;
|
||||
break;
|
||||
case TARGET_DEST_CASTER_GROUND:
|
||||
case TARGET_DEST_CASTER:
|
||||
case TARGET_DEST_CASTER_FRONT_LEFT:
|
||||
case TARGET_DEST_CASTER_BACK_LEFT:
|
||||
case TARGET_DEST_CASTER_BACK_RIGHT:
|
||||
case TARGET_DEST_CASTER_FRONT_RIGHT:
|
||||
case TARGET_DEST_CASTER_FRONT:
|
||||
case TARGET_MINION:
|
||||
case TARGET_DEST_CASTER_FRONT_LEAP:
|
||||
case TARGET_DEST_CASTER_BACK:
|
||||
case TARGET_DEST_CASTER_RIGHT:
|
||||
case TARGET_DEST_CASTER_LEFT:
|
||||
case TARGET_DEST_CASTER_RANDOM:
|
||||
case TARGET_DEST_CASTER_RADIUS:
|
||||
SpellTargetType[i] = TARGET_TYPE_DEST_CASTER;
|
||||
break;
|
||||
case TARGET_DEST_DYNOBJ_ENEMY:
|
||||
case TARGET_DEST_DYNOBJ_ALLY:
|
||||
case TARGET_DEST_DYNOBJ_NONE:
|
||||
case TARGET_DEST_DEST:
|
||||
case TARGET_DEST_TRAJ:
|
||||
case TARGET_DEST_DEST_FRONT_LEFT:
|
||||
case TARGET_DEST_DEST_BACK_LEFT:
|
||||
case TARGET_DEST_DEST_BACK_RIGHT:
|
||||
@@ -165,6 +181,15 @@ SpellMgr::SpellMgr()
|
||||
case TARGET_DEST_DEST_RANDOM:
|
||||
SpellTargetType[i] = TARGET_TYPE_DEST_DEST;
|
||||
break;
|
||||
case TARGET_DST_DB:
|
||||
case TARGET_DST_HOME:
|
||||
case TARGET_DST_NEARBY_ENTRY:
|
||||
SpellTargetType[i] = TARGET_TYPE_DEST_SPECIAL;
|
||||
break;
|
||||
case TARGET_UNIT_CHANNEL:
|
||||
case TARGET_DEST_CHANNEL:
|
||||
SpellTargetType[i] = TARGET_TYPE_CHANNEL;
|
||||
break;
|
||||
default:
|
||||
SpellTargetType[i] = TARGET_TYPE_DEFAULT;
|
||||
}
|
||||
@@ -174,20 +199,20 @@ SpellMgr::SpellMgr()
|
||||
{
|
||||
switch(i)
|
||||
{
|
||||
case TARGET_UNIT_AREA_ENEMY_GROUND:
|
||||
case TARGET_UNIT_AREA_ENEMY:
|
||||
case TARGET_UNIT_AREA_ALLY_GROUND:
|
||||
case TARGET_UNIT_AREA_ALLY:
|
||||
case TARGET_UNIT_AREA_ENTRY_GROUND:
|
||||
case TARGET_UNIT_AREA_ENTRY:
|
||||
case TARGET_UNIT_AREA_PARTY_GROUND:
|
||||
case TARGET_UNIT_AREA_PARTY:
|
||||
case TARGET_UNIT_AREA_ENEMY_DST:
|
||||
case TARGET_UNIT_AREA_ENEMY_SRC:
|
||||
case TARGET_UNIT_AREA_ALLY_DST:
|
||||
case TARGET_UNIT_AREA_ALLY_SRC:
|
||||
case TARGET_UNIT_AREA_ENTRY_DST:
|
||||
case TARGET_UNIT_AREA_ENTRY_SRC:
|
||||
case TARGET_UNIT_AREA_PARTY_DST:
|
||||
case TARGET_UNIT_AREA_PARTY_SRC:
|
||||
case TARGET_UNIT_PARTY_TARGET:
|
||||
case TARGET_UNIT_PARTY_CASTER:
|
||||
case TARGET_UNIT_CONE_ENEMY:
|
||||
case TARGET_UNIT_CONE_ALLY:
|
||||
case TARGET_UNIT_CONE_ENEMY_UNKNOWN:
|
||||
case TARGET_UNIT_RAID:
|
||||
case TARGET_UNIT_RAID_CASTER:
|
||||
IsAreaEffectTarget[i] = true;
|
||||
break;
|
||||
default:
|
||||
@@ -494,12 +519,12 @@ bool IsPositiveTarget(uint32 targetA, uint32 targetB)
|
||||
// non-positive targets
|
||||
switch(targetA)
|
||||
{
|
||||
case TARGET_CHAIN_DAMAGE:
|
||||
case TARGET_ALL_ENEMY_IN_AREA:
|
||||
case TARGET_ALL_ENEMY_IN_AREA_INSTANT:
|
||||
case TARGET_IN_FRONT_OF_CASTER:
|
||||
case TARGET_UNIT_TARGET_ENEMY:
|
||||
case TARGET_UNIT_AREA_ENEMY_SRC:
|
||||
case TARGET_UNIT_AREA_ENEMY_DST:
|
||||
case TARGET_UNIT_CONE_ENEMY:
|
||||
case TARGET_DEST_DYNOBJ_ENEMY:
|
||||
case TARGET_CURRENT_ENEMY_COORDINATES:
|
||||
case TARGET_DST_TARGET_ENEMY:
|
||||
case TARGET_UNIT_CHANNEL:
|
||||
return false;
|
||||
default:
|
||||
@@ -622,12 +647,12 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex, bool deep)
|
||||
return false;
|
||||
case SPELL_AURA_PERIODIC_DAMAGE: // used in positive spells also.
|
||||
// part of negative spell if casted at self (prevent cancel)
|
||||
if(spellproto->EffectImplicitTargetA[effIndex] == TARGET_SELF)
|
||||
if(spellproto->EffectImplicitTargetA[effIndex] == TARGET_UNIT_CASTER)
|
||||
return false;
|
||||
break;
|
||||
case SPELL_AURA_MOD_DECREASE_SPEED: // used in positive spells also
|
||||
// part of positive spell if casted at self
|
||||
if(spellproto->EffectImplicitTargetA[effIndex] != TARGET_SELF)
|
||||
if(spellproto->EffectImplicitTargetA[effIndex] != TARGET_UNIT_CASTER)
|
||||
return false;
|
||||
// but not this if this first effect (don't found batter check)
|
||||
if(spellproto->Attributes & 0x4000000 && effIndex==0)
|
||||
@@ -918,7 +943,7 @@ void SpellMgr::LoadSpellTargetPositions()
|
||||
bool found = false;
|
||||
for(int i = 0; i < 3; ++i)
|
||||
{
|
||||
if( spellInfo->EffectImplicitTargetA[i]==TARGET_TABLE_X_Y_Z_COORDINATES || spellInfo->EffectImplicitTargetB[i]==TARGET_TABLE_X_Y_Z_COORDINATES )
|
||||
if( spellInfo->EffectImplicitTargetA[i]==TARGET_DST_DB || spellInfo->EffectImplicitTargetB[i]==TARGET_DST_DB )
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
@@ -926,7 +951,7 @@ void SpellMgr::LoadSpellTargetPositions()
|
||||
}
|
||||
if(!found)
|
||||
{
|
||||
sLog.outErrorDb("Spell (Id: %u) listed in `spell_target_position` does not have target TARGET_TABLE_X_Y_Z_COORDINATES (17).",Spell_ID);
|
||||
sLog.outErrorDb("Spell (Id: %u) listed in `spell_target_position` does not have target TARGET_DST_DB (17).",Spell_ID);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -2023,7 +2048,7 @@ void SpellMgr::LoadSpellLearnSpells()
|
||||
// talent or passive spells or skill-step spells auto-casted and not need dependent learning,
|
||||
// pet teaching spells don't must be dependent learning (casted)
|
||||
// other required explicit dependent learning
|
||||
dbc_node.autoLearned = entry->EffectImplicitTargetA[i]==TARGET_PET || GetTalentSpellCost(spell) > 0 || IsPassiveSpell(spell) || IsSpellHaveEffect(entry,SPELL_EFFECT_SKILL_STEP);
|
||||
dbc_node.autoLearned = entry->EffectImplicitTargetA[i] == TARGET_UNIT_PET || GetTalentSpellCost(spell) > 0 || IsPassiveSpell(spell) || IsSpellHaveEffect(entry,SPELL_EFFECT_SKILL_STEP);
|
||||
|
||||
SpellLearnSpellMap::const_iterator db_node_begin = GetBeginSpellLearnSpell(spell);
|
||||
SpellLearnSpellMap::const_iterator db_node_end = GetEndSpellLearnSpell(spell);
|
||||
@@ -2095,10 +2120,10 @@ void SpellMgr::LoadSpellScriptTarget()
|
||||
/*bool targetfound = false;
|
||||
for(int i = 0; i <3; ++i)
|
||||
{
|
||||
if( spellProto->EffectImplicitTargetA[i]==TARGET_SCRIPT ||
|
||||
spellProto->EffectImplicitTargetB[i]==TARGET_SCRIPT ||
|
||||
spellProto->EffectImplicitTargetA[i]==TARGET_SCRIPT_COORDINATES ||
|
||||
spellProto->EffectImplicitTargetB[i]==TARGET_SCRIPT_COORDINATES )
|
||||
if( spellProto->EffectImplicitTargetA[i]==TARGET_UNIT_NEARBY_ENTRY ||
|
||||
spellProto->EffectImplicitTargetB[i]==TARGET_UNIT_NEARBY_ENTRY ||
|
||||
spellProto->EffectImplicitTargetA[i]==TARGET_DST_NEARBY_ENTRY ||
|
||||
spellProto->EffectImplicitTargetB[i]==TARGET_DST_NEARBY_ENTRY )
|
||||
{
|
||||
targetfound = true;
|
||||
break;
|
||||
@@ -2106,7 +2131,7 @@ void SpellMgr::LoadSpellScriptTarget()
|
||||
}
|
||||
if(!targetfound)
|
||||
{
|
||||
sLog.outErrorDb("Table `spell_script_target`: spellId %u listed for TargetEntry %u does not have any implicit target TARGET_SCRIPT(38) or TARGET_SCRIPT_COORDINATES (46).",spellId,targetEntry);
|
||||
sLog.outErrorDb("Table `spell_script_target`: spellId %u listed for TargetEntry %u does not have any implicit target TARGET_UNIT_NEARBY_ENTRY(38) or TARGET_DST_NEARBY_ENTRY (46).",spellId,targetEntry);
|
||||
continue;
|
||||
}*/
|
||||
|
||||
@@ -2172,13 +2197,13 @@ void SpellMgr::LoadSpellScriptTarget()
|
||||
bool found = false;
|
||||
for(int j=0; j<3; ++j)
|
||||
{
|
||||
if( spellInfo->EffectImplicitTargetA[j] == TARGET_SCRIPT || spellInfo->EffectImplicitTargetA[j] != TARGET_SELF && spellInfo->EffectImplicitTargetB[j] == TARGET_SCRIPT )
|
||||
if( spellInfo->EffectImplicitTargetA[j] == TARGET_UNIT_NEARBY_ENTRY || spellInfo->EffectImplicitTargetA[j] != TARGET_UNIT_CASTER && spellInfo->EffectImplicitTargetB[j] == TARGET_UNIT_NEARBY_ENTRY )
|
||||
{
|
||||
SpellScriptTarget::const_iterator lower = spellmgr.GetBeginSpellScriptTarget(spellInfo->Id);
|
||||
SpellScriptTarget::const_iterator upper = spellmgr.GetEndSpellScriptTarget(spellInfo->Id);
|
||||
if(lower==upper)
|
||||
{
|
||||
sLog.outErrorDb("Spell (ID: %u) has effect EffectImplicitTargetA/EffectImplicitTargetB = %u (TARGET_SCRIPT), but does not have record in `spell_script_target`",spellInfo->Id,TARGET_SCRIPT);
|
||||
sLog.outErrorDb("Spell (ID: %u) has effect EffectImplicitTargetA/EffectImplicitTargetB = %u (TARGET_UNIT_NEARBY_ENTRY), but does not have record in `spell_script_target`",spellInfo->Id,TARGET_UNIT_NEARBY_ENTRY);
|
||||
break; // effects of spell
|
||||
}
|
||||
}
|
||||
@@ -2255,7 +2280,7 @@ void SpellMgr::LoadSpellPetAuras()
|
||||
continue;
|
||||
}
|
||||
|
||||
PetAura pa(pet, aura, spellInfo->EffectImplicitTargetA[i] == TARGET_PET, spellInfo->CalculateSimpleValue(i));
|
||||
PetAura pa(pet, aura, spellInfo->EffectImplicitTargetA[i] == TARGET_UNIT_PET, spellInfo->CalculateSimpleValue(i));
|
||||
mSpellPetAuraMap[spell] = pa;
|
||||
}
|
||||
|
||||
|
||||
+18
-2
@@ -89,11 +89,15 @@ enum SpellSelectTargetTypes
|
||||
TARGET_TYPE_DEFAULT,
|
||||
TARGET_TYPE_UNIT_CASTER,
|
||||
TARGET_TYPE_UNIT_TARGET,
|
||||
TARGET_TYPE_CHANNEL,
|
||||
TARGET_TYPE_AREA_DEST,
|
||||
TARGET_TYPE_UNIT_NEARBY,
|
||||
TARGET_TYPE_AREA_SRC,
|
||||
TARGET_TYPE_AREA_DST,
|
||||
TARGET_TYPE_AREA_CONE,
|
||||
TARGET_TYPE_DEST_CASTER,
|
||||
TARGET_TYPE_DEST_TARGET,
|
||||
TARGET_TYPE_DEST_DEST,
|
||||
TARGET_TYPE_DEST_SPECIAL,
|
||||
TARGET_TYPE_CHANNEL,
|
||||
};
|
||||
|
||||
//Some SpellFamilyFlags
|
||||
@@ -161,6 +165,18 @@ inline uint32 GetSpellRangeType(SpellRangeEntry const *range) { return (range ?
|
||||
inline uint32 GetSpellRecoveryTime(SpellEntry const *spellInfo) { return spellInfo->RecoveryTime > spellInfo->CategoryRecoveryTime ? spellInfo->RecoveryTime : spellInfo->CategoryRecoveryTime; }
|
||||
int32 GetSpellDuration(SpellEntry const *spellInfo);
|
||||
int32 GetSpellMaxDuration(SpellEntry const *spellInfo);
|
||||
inline float GetSpellRadius(SpellEntry const *spellInfo, uint32 effectIdx, bool positive)
|
||||
{
|
||||
return positive
|
||||
? GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(spellInfo->EffectRadiusIndex[effectIdx]))
|
||||
: GetSpellRadiusForHostile(sSpellRadiusStore.LookupEntry(spellInfo->EffectRadiusIndex[effectIdx]));
|
||||
}
|
||||
inline float GetSpellMaxRange(SpellEntry const *spellInfo, bool positive)
|
||||
{
|
||||
return positive
|
||||
? GetSpellMaxRangeForFriend(sSpellRangeStore.LookupEntry(spellInfo->rangeIndex))
|
||||
: GetSpellMaxRangeForHostile(sSpellRangeStore.LookupEntry(spellInfo->rangeIndex));
|
||||
}
|
||||
|
||||
/*struct DispelEntry
|
||||
{
|
||||
|
||||
@@ -155,7 +155,7 @@ TargetedMovementGenerator<T>::Update(T &owner, const uint32 & time_diff)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (i_destinationHolder.UpdateTraveller(traveller, time_diff, false))
|
||||
if (i_destinationHolder.UpdateTraveller(traveller, time_diff))
|
||||
{
|
||||
// put targeted movement generators on a higher priority
|
||||
if (owner.GetObjectSize())
|
||||
|
||||
+7
-1
@@ -289,6 +289,8 @@ void Unit::SendMonsterStop()
|
||||
data << getMSTime();
|
||||
data << uint8(1);
|
||||
SendMessageToSet(&data, true);
|
||||
|
||||
clearUnitState(UNIT_STAT_MOVE);
|
||||
}
|
||||
|
||||
void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 Time, Player* player)
|
||||
@@ -310,6 +312,8 @@ void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 T
|
||||
player->GetSession()->SendPacket(&data);
|
||||
else
|
||||
SendMessageToSet( &data, true );
|
||||
|
||||
addUnitState(UNIT_STAT_MOVE);
|
||||
}
|
||||
|
||||
void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 MoveFlags, uint32 time, float speedZ, Player *player)
|
||||
@@ -399,6 +403,8 @@ void Unit::SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end)
|
||||
data << uint32( pathSize );
|
||||
data.append( (char*)path.GetNodes(start), pathSize * 4 * 3 );
|
||||
SendMessageToSet(&data, true);
|
||||
|
||||
addUnitState(UNIT_STAT_MOVE);
|
||||
}
|
||||
|
||||
void Unit::resetAttackTimer(WeaponAttackType type)
|
||||
@@ -11533,7 +11539,7 @@ void CharmInfo::InitCharmCreateSpells()
|
||||
if(!spellInfo) onlyselfcast = false;
|
||||
for(uint32 i = 0;i<3 && onlyselfcast;++i) //non existent spell will not make any problems as onlyselfcast would be false -> break right away
|
||||
{
|
||||
if(spellInfo->EffectImplicitTargetA[i] != TARGET_SELF && spellInfo->EffectImplicitTargetA[i] != 0)
|
||||
if(spellInfo->EffectImplicitTargetA[i] != TARGET_UNIT_CASTER && spellInfo->EffectImplicitTargetA[i] != 0)
|
||||
onlyselfcast = false;
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -443,11 +443,12 @@ enum UnitState
|
||||
UNIT_STAT_CHARGING = 0x00020000,
|
||||
UNIT_STAT_JUMPING = 0x00040000,
|
||||
UNIT_STAT_ONVEHICLE = 0x00080000,
|
||||
UNIT_STAT_MOVE = 0x00100000,
|
||||
UNIT_STAT_UNATTACKABLE = (UNIT_STAT_IN_FLIGHT | UNIT_STAT_ONVEHICLE),
|
||||
UNIT_STAT_MOVING = (UNIT_STAT_ROAMING | UNIT_STAT_CHASE),
|
||||
UNIT_STAT_CONTROLLED = (UNIT_STAT_CONFUSED | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING),
|
||||
UNIT_STAT_LOST_CONTROL = (UNIT_STAT_CONTROLLED | UNIT_STAT_JUMPING | UNIT_STAT_CHARGING),
|
||||
UNIT_STAT_SIGHTLESS = (UNIT_STAT_LOST_CONTROL | UNIT_STAT_CHASE),
|
||||
UNIT_STAT_SIGHTLESS = (UNIT_STAT_LOST_CONTROL),
|
||||
UNIT_STAT_CANNOT_AUTOATTACK = (UNIT_STAT_LOST_CONTROL | UNIT_STAT_CASTING),
|
||||
UNIT_STAT_ALL_STATE = 0xffffffff //(UNIT_STAT_STOPPED | UNIT_STAT_MOVING | UNIT_STAT_IN_COMBAT | UNIT_STAT_IN_FLIGHT)
|
||||
};
|
||||
|
||||
@@ -151,7 +151,7 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
|
||||
Traveller<Creature> traveller(unit);
|
||||
|
||||
i_nextMoveTime.Update(diff);
|
||||
i_destinationHolder.UpdateTraveller(traveller, diff, false, true);
|
||||
i_destinationHolder.UpdateTraveller(traveller, diff, true);
|
||||
|
||||
if(i_nextMoveTime.Passed())
|
||||
{
|
||||
@@ -291,7 +291,7 @@ FlightPathMovementGenerator::Update(Player &player, const uint32 &diff)
|
||||
if( MovementInProgress() )
|
||||
{
|
||||
Traveller<Player> traveller(player);
|
||||
if( i_destinationHolder.UpdateTraveller(traveller, diff, false) )
|
||||
if( i_destinationHolder.UpdateTraveller(traveller, diff) )
|
||||
{
|
||||
i_destinationHolder.ResetUpdate(FLIGHT_TRAVEL_UPDATE);
|
||||
if( i_destinationHolder.HasArrived() )
|
||||
|
||||
Reference in New Issue
Block a user