Merge remote-tracking branch 'origin/master' into 4.3.4
Conflicts: sql/updates/world/2012_09_09_02_world_spell_script_names.sql src/server/game/Achievements/AchievementMgr.cpp src/server/game/Entities/Unit/Unit.cpp src/server/game/Entities/Vehicle/Vehicle.cpp
This commit is contained in:
commit
d6743c7c95
15 files changed
+144
-27
No files matched your search
@@ -0,0 +1,4 @@
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_warl_banish','spell_warl_create_healthstone','spell_warl_ritual_of_doom_effect');
|
||||
INSERT INTO `spell_script_names`(`spell_id`,`ScriptName`) VALUES
|
||||
(710,'spell_warl_banish'),
|
||||
(6201,'spell_warl_create_healthstone');
|
||||
@@ -0,0 +1,9 @@
|
||||
DELETE FROM `spell_bonus_data` WHERE `entry` IN (28880,59542,59543,59544,59545,59547,59548);
|
||||
INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES
|
||||
(28880,0,0,0,0,'Warrior - Gift of the Naaru'),
|
||||
(59542,0,0,0,0,'Paladin - Gift of the Naaru'),
|
||||
(59543,0,0,0,0,'Hunter - Gift of the Naaru'),
|
||||
(59544,0,0,0,0,'Priest - Gift of the Naaru'),
|
||||
(59545,0,0,0,0,'Deathknight - Gift of the Naaru'),
|
||||
(59547,0,0,0,0,'Shaman - Gift of the Naaru'),
|
||||
(59548,0,0,0,0,'Mage - Gift of the Naaru');
|
||||
@@ -0,0 +1 @@
|
||||
UPDATE `quest_template` SET `OfferRewardText`='Excellent, $N. You''ve saved me a lot of work!$b$bBut don''t think that I''m not grateful!' WHERE `Id`=6571;
|
||||
@@ -11395,7 +11395,11 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool
|
||||
|
||||
if (eslot == EQUIPMENT_SLOT_OFFHAND)
|
||||
{
|
||||
if (type == INVTYPE_WEAPON || type == INVTYPE_WEAPONOFFHAND)
|
||||
// Do not allow polearm to be equipped in the offhand (rare case for the only 1h polearm 41750)
|
||||
if (pProto->SubClass == ITEM_SUBCLASS_WEAPON_POLEARM)
|
||||
return EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT;
|
||||
|
||||
else if (type == INVTYPE_WEAPON || type == INVTYPE_WEAPONOFFHAND)
|
||||
{
|
||||
if (!CanDualWield())
|
||||
return EQUIP_ERR_2HSKILLNOTFOUND;
|
||||
|
||||
@@ -703,17 +703,15 @@ void Transport::UpdateNPCPositions()
|
||||
}
|
||||
}
|
||||
|
||||
//! This method transforms supplied transport offsets into global coordinates
|
||||
void Transport::CalculatePassengerPosition(float& x, float& y, float& z, float& o)
|
||||
{
|
||||
float inx = x, iny = y, inz = z, ino = o;
|
||||
o = GetOrientation() + ino;
|
||||
x = GetPositionX() + (inx * cos(GetOrientation()) + iny * sin(GetOrientation() + M_PI));
|
||||
y = GetPositionY() + (iny * cos(GetOrientation()) + inx * sin(GetOrientation()));
|
||||
x = GetPositionX() + inx * cos(GetOrientation()) - iny * sin(GetOrientation());
|
||||
y = GetPositionY() + iny * cos(GetOrientation()) + inx * sin(GetOrientation());
|
||||
z = GetPositionZ() + inz;
|
||||
}
|
||||
|
||||
//! This method transforms supplied global coordinates into local offsets
|
||||
void Transport::CalculatePassengerOffset(float& x, float& y, float& z, float& o)
|
||||
{
|
||||
o = o - GetOrientation();
|
||||
@@ -721,6 +719,6 @@ void Transport::CalculatePassengerOffset(float& x, float& y, float& z, float& o)
|
||||
y -= GetPositionY(); // y = searchedY * cos(o) + searchedX * sin(o)
|
||||
x -= GetPositionX(); // x = searchedX * cos(o) + searchedY * sin(o + pi)
|
||||
float inx = x, iny = y;
|
||||
y = (iny - inx * tan(GetOrientation())) / (cos(GetOrientation()) - sin(GetOrientation() + M_PI) * tan(GetOrientation()));
|
||||
x = (inx - iny * sin(GetOrientation() + M_PI) / cos(GetOrientation())) / (cos(GetOrientation()) - tan(GetOrientation()) * sin(GetOrientation() + M_PI));
|
||||
y = (iny - inx * tan(GetOrientation())) / (cos(GetOrientation()) + sin(GetOrientation()) * tan(GetOrientation()));
|
||||
x = (inx + iny * tan(GetOrientation())) / (cos(GetOrientation()) + sin(GetOrientation()) * tan(GetOrientation()));
|
||||
}
|
||||
@@ -20,12 +20,13 @@
|
||||
#define TRANSPORTS_H
|
||||
|
||||
#include "GameObject.h"
|
||||
#include "VehicleDefines.h"
|
||||
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
||||
class Transport : public GameObject
|
||||
class Transport : public GameObject, public TransportBase
|
||||
{
|
||||
public:
|
||||
Transport(uint32 period, uint32 script);
|
||||
@@ -47,8 +48,13 @@ class Transport : public GameObject
|
||||
uint32 AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y, float z, float o, uint32 anim=0);
|
||||
void UpdatePosition(MovementInfo* mi);
|
||||
void UpdateNPCPositions();
|
||||
|
||||
/// This method transforms supplied transport offsets into global coordinates
|
||||
void CalculatePassengerPosition(float& x, float& y, float& z, float& o);
|
||||
|
||||
/// This method transforms supplied global coordinates into local offsets
|
||||
void CalculatePassengerOffset(float& x, float& y, float& z, float& o);
|
||||
|
||||
void BuildStartMovePacket(Map const* targetMap);
|
||||
void BuildStopMovePacket(Map const* targetMap);
|
||||
uint32 GetScriptId() const { return ScriptId; }
|
||||
|
||||
@@ -415,8 +415,8 @@ void Unit::UpdateSplinePosition()
|
||||
loc.z += vehicle->GetPositionZMinusOffset();
|
||||
loc.orientation = vehicle->GetOrientation();
|
||||
}
|
||||
else if (Transport* trans = GetTransport())
|
||||
trans->CalculatePassengerPosition(loc.x, loc.y, loc.z, loc.orientation);
|
||||
else if (TransportBase* transport = GetDirectTransport())
|
||||
transport->CalculatePassengerPosition(loc.x, loc.y, loc.z, loc.orientation);
|
||||
}
|
||||
|
||||
UpdatePosition(loc.x, loc.y, loc.z, loc.orientation);
|
||||
@@ -15557,6 +15557,13 @@ uint64 Unit::GetTransGUID() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
TransportBase* Unit::GetDirectTransport() const
|
||||
{
|
||||
if (Vehicle* veh = GetVehicle())
|
||||
return veh;
|
||||
return GetTransport();
|
||||
}
|
||||
|
||||
bool Unit::IsInPartyWith(Unit const* unit) const
|
||||
{
|
||||
if (this == unit)
|
||||
|
||||
@@ -340,6 +340,7 @@ class UnitAI;
|
||||
class Totem;
|
||||
class Transport;
|
||||
class Vehicle;
|
||||
class TransportBase;
|
||||
|
||||
typedef std::list<Unit*> UnitList;
|
||||
typedef std::list< std::pair<Aura*, uint8> > DispelChargesList;
|
||||
@@ -2167,6 +2168,8 @@ class Unit : public WorldObject
|
||||
uint32 GetTransTime() const { return m_movementInfo.t_time; }
|
||||
int8 GetTransSeat() const { return m_movementInfo.t_seat; }
|
||||
uint64 GetTransGUID() const;
|
||||
/// Returns the transport this unit is on directly (if on vehicle and transport, return vehicle)
|
||||
TransportBase* GetDirectTransport() const;
|
||||
|
||||
bool m_ControlledByPlayer;
|
||||
|
||||
|
||||
@@ -439,19 +439,20 @@ void Vehicle::RelocatePassengers(float x, float y, float z, float ang)
|
||||
{
|
||||
ASSERT(_me->GetMap());
|
||||
|
||||
// not sure that absolute position calculation is correct, it must depend on vehicle orientation and pitch angle
|
||||
// not sure that absolute position calculation is correct, it must depend on vehicle pitch angle
|
||||
for (SeatMap::const_iterator itr = Seats.begin(); itr != Seats.end(); ++itr)
|
||||
{
|
||||
if (Unit* passenger = ObjectAccessor::GetUnit(*GetBase(), itr->second.Passenger))
|
||||
{
|
||||
ASSERT(passenger->IsInWorld());
|
||||
|
||||
float px = x + passenger->m_movementInfo.t_pos.m_positionX;
|
||||
float py = y + passenger->m_movementInfo.t_pos.m_positionY;
|
||||
float pz = z + passenger->m_movementInfo.t_pos.m_positionZ;
|
||||
float po = ang + passenger->m_movementInfo.t_pos.GetOrientation();
|
||||
float px, py, pz, po;
|
||||
passenger->m_movementInfo.t_pos.GetPosition(px, py, pz, po);
|
||||
CalculatePassengerPosition(px, py, pz, po);
|
||||
|
||||
passenger->UpdatePosition(px, py, pz, po);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Vehicle::Dismiss()
|
||||
@@ -510,3 +511,23 @@ uint8 Vehicle::GetAvailableSeatCount() const
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void Vehicle::CalculatePassengerPosition(float& x, float& y, float& z, float& o)
|
||||
{
|
||||
float inx = x, iny = y, inz = z, ino = o;
|
||||
o = GetBase()->GetOrientation() + ino;
|
||||
x = GetBase()->GetPositionX() + inx * cos(GetBase()->GetOrientation()) - iny * sin(GetBase()->GetOrientation());
|
||||
y = GetBase()->GetPositionY() + iny * cos(GetBase()->GetOrientation()) + inx * sin(GetBase()->GetOrientation());
|
||||
z = GetBase()->GetPositionZ() + inz;
|
||||
}
|
||||
|
||||
void Vehicle::CalculatePassengerOffset(float& x, float& y, float& z, float& o)
|
||||
{
|
||||
o -= GetBase()->GetOrientation();
|
||||
z -= GetBase()->GetPositionZ();
|
||||
y -= GetBase()->GetPositionY(); // y = searchedY * cos(o) + searchedX * sin(o)
|
||||
x -= GetBase()->GetPositionX(); // x = searchedX * cos(o) + searchedY * sin(o + pi)
|
||||
float inx = x, iny = y;
|
||||
y = (iny - inx * tan(GetBase()->GetOrientation())) / (cos(GetBase()->GetOrientation()) + sin(GetBase()->GetOrientation()) * tan(GetBase()->GetOrientation()));
|
||||
x = (inx + iny * tan(GetBase()->GetOrientation())) / (cos(GetBase()->GetOrientation()) + sin(GetBase()->GetOrientation()) * tan(GetBase()->GetOrientation()));
|
||||
}
|
||||
@@ -27,7 +27,7 @@ class Unit;
|
||||
|
||||
typedef std::set<uint64> GuidSet;
|
||||
|
||||
class Vehicle
|
||||
class Vehicle : public TransportBase
|
||||
{
|
||||
public:
|
||||
explicit Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry);
|
||||
@@ -66,6 +66,12 @@ class Vehicle
|
||||
SeatMap::iterator GetSeatIteratorForPassenger(Unit* passenger);
|
||||
void InitMovementInfoForBase();
|
||||
|
||||
/// This method transforms supplied transport offsets into global coordinates
|
||||
void CalculatePassengerPosition(float& x, float& y, float& z, float& o);
|
||||
|
||||
/// This method transforms supplied global coordinates into local offsets
|
||||
void CalculatePassengerOffset(float& x, float& y, float& z, float& o);
|
||||
|
||||
Unit* _me;
|
||||
VehicleEntry const* _vehicleInfo;
|
||||
GuidSet vehiclePlayers;
|
||||
|
||||
@@ -97,4 +97,14 @@ typedef std::vector<VehicleAccessory> VehicleAccessoryList;
|
||||
typedef std::map<uint32, VehicleAccessoryList> VehicleAccessoryContainer;
|
||||
typedef std::map<int8, VehicleSeat> SeatMap;
|
||||
|
||||
class TransportBase
|
||||
{
|
||||
public:
|
||||
/// This method transforms supplied transport offsets into global coordinates
|
||||
virtual void CalculatePassengerPosition(float& x, float& y, float& z, float& o) = 0;
|
||||
|
||||
/// This method transforms supplied global coordinates into local offsets
|
||||
virtual void CalculatePassengerOffset(float& x, float& y, float& z, float& o) = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -193,17 +193,9 @@ namespace Movement
|
||||
{
|
||||
if (_transformForTransport)
|
||||
{
|
||||
if (Unit* vehicle = _owner.GetVehicleBase())
|
||||
{
|
||||
input.x -= vehicle->GetPositionX();
|
||||
input.y -= vehicle->GetPositionY();
|
||||
input.z -= vehicle->GetPositionZMinusOffset();
|
||||
}
|
||||
else if (Transport* transport = _owner.GetTransport())
|
||||
{
|
||||
float unused = 0.0f;
|
||||
float unused = 0.0f;
|
||||
if (TransportBase* transport = _owner.GetDirectTransport())
|
||||
transport->CalculatePassengerOffset(input.x, input.y, input.z, unused);
|
||||
}
|
||||
}
|
||||
|
||||
return input;
|
||||
|
||||
@@ -4235,6 +4235,9 @@ void Spell::SendChannelUpdate(uint32 time)
|
||||
void Spell::SendChannelStart(uint32 duration)
|
||||
{
|
||||
uint64 channelTarget = m_targets.GetObjectTargetGUID();
|
||||
if (!channelTarget && !m_spellInfo->NeedsExplicitUnitTarget())
|
||||
if (m_UniqueTargetInfo.size() + m_UniqueGOTargetInfo.size() == 1) // this is for TARGET_SELECT_CATEGORY_NEARBY
|
||||
channelTarget = !m_UniqueTargetInfo.empty() ? m_UniqueTargetInfo.front().targetGUID : m_UniqueGOTargetInfo.front().targetGUID;
|
||||
|
||||
WorldPacket data(MSG_CHANNEL_START, (8+4+4));
|
||||
data.append(m_caster->GetPackGUID());
|
||||
|
||||
@@ -233,7 +233,7 @@ public:
|
||||
SWPainTimer = 20000;
|
||||
AmplifyDamageTimer = 5000;
|
||||
Cleave_Timer = 8000;
|
||||
InfernalTimer = 45000;
|
||||
InfernalTimer = 40000;
|
||||
InfernalCleanupTimer = 47000;
|
||||
AxesTargetSwitchTimer = urand(7500, 20000);
|
||||
SunderArmorTimer = urand(5000, 10000);
|
||||
|
||||
@@ -3251,6 +3251,58 @@ class spell_gen_bonked : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
class spell_gen_gift_of_naaru : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_gift_of_naaru() : SpellScriptLoader("spell_gen_gift_of_naaru") { }
|
||||
|
||||
class spell_gen_gift_of_naaru_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_gen_gift_of_naaru_AuraScript);
|
||||
|
||||
void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (!GetCaster())
|
||||
return;
|
||||
|
||||
float heal = 0.0f;
|
||||
switch (GetSpellInfo()->SpellFamilyName)
|
||||
{
|
||||
case SPELLFAMILY_MAGE:
|
||||
case SPELLFAMILY_WARLOCK:
|
||||
case SPELLFAMILY_PRIEST:
|
||||
heal = 1.885f * float(GetCaster()->SpellBaseDamageBonusDone(GetSpellInfo()->GetSchoolMask()));
|
||||
break;
|
||||
case SPELLFAMILY_PALADIN:
|
||||
case SPELLFAMILY_SHAMAN:
|
||||
heal = std::max(1.885f * float(GetCaster()->SpellBaseDamageBonusDone(GetSpellInfo()->GetSchoolMask())), 1.1f * float(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK)));
|
||||
break;
|
||||
case SPELLFAMILY_WARRIOR:
|
||||
case SPELLFAMILY_HUNTER:
|
||||
case SPELLFAMILY_DEATHKNIGHT:
|
||||
heal = 1.1f * float(std::max(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK), GetCaster()->GetTotalAttackPowerValue(RANGED_ATTACK)));
|
||||
break;
|
||||
case SPELLFAMILY_GENERIC:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
int32 healTick = floor(heal / aurEff->GetTotalTicks());
|
||||
amount += int32(std::max(healTick, 0));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_gift_of_naaru_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_HEAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_gen_gift_of_naaru_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_generic_spell_scripts()
|
||||
{
|
||||
new spell_gen_absorb0_hitlimit1();
|
||||
@@ -3326,4 +3378,5 @@ void AddSC_generic_spell_scripts()
|
||||
new spell_gen_mount("spell_x53_touring_rocket", 0, 0, 0, SPELL_X53_TOURING_ROCKET_150, SPELL_X53_TOURING_ROCKET_280, SPELL_X53_TOURING_ROCKET_310);
|
||||
new spell_gen_upper_deck_create_foam_sword();
|
||||
new spell_gen_bonked();
|
||||
new spell_gen_gift_of_naaru();
|
||||
}
|
||||
Reference in new issue
Block a user