*Fix some summon vehicle spells.
--HG-- branch : trunk
This commit is contained in:
@@ -179,7 +179,7 @@ Creature *ScriptedAI::DoSummonFlyer(uint32 uiEntry, WorldObject *obj, float _fZ,
|
||||
{
|
||||
float fX, fY, fZ;
|
||||
obj->GetGroundPointAroundUnit(fX, fY, fZ, fRadius * rand_norm(), rand_norm()*2*M_PI);
|
||||
return me->SummonCreature(uiEntry, fX, fY, _fZ, me->GetOrientation(), uiType, uiDespawntime);
|
||||
return me->SummonCreature(uiEntry, fX, fY, fZ + _fZ, me->GetOrientation(), uiType, uiDespawntime);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+4
-3
@@ -1757,10 +1757,11 @@ TempSummon *Map::SummonCreature(uint32 entry, float x, float y, float z, float a
|
||||
mask = UNIT_MASK_GUARDIAN;
|
||||
else if(properties->Type == SUMMON_TYPE_TOTEM)
|
||||
mask = UNIT_MASK_TOTEM;
|
||||
else if(properties->Category == SUMMON_CATEGORY_VEHICLE
|
||||
|| properties->Type == SUMMON_TYPE_VEHICLE
|
||||
else if(properties->Category == SUMMON_CATEGORY_VEHICLE)
|
||||
mask = UNIT_MASK_MINION;
|
||||
else if(properties->Type == SUMMON_TYPE_VEHICLE
|
||||
|| properties->Type == SUMMON_TYPE_VEHICLE2)
|
||||
mask = UNIT_MASK_VEHICLE;
|
||||
mask = UNIT_MASK_SUMMON;
|
||||
else if(properties->Category == SUMMON_CATEGORY_PUPPET)
|
||||
mask = UNIT_MASK_PUPPET;
|
||||
else if(properties->Type == SUMMON_TYPE_MINIPET)
|
||||
|
||||
@@ -3411,21 +3411,9 @@ void Spell::EffectSummonType(uint32 i)
|
||||
break;
|
||||
case SUMMON_TYPE_VEHICLE:
|
||||
case SUMMON_TYPE_VEHICLE2:
|
||||
{
|
||||
if(!m_originalCaster)
|
||||
return;
|
||||
|
||||
Creature *vehicle = m_originalCaster->SummonCreature(entry, x, y, z, 0, 0);
|
||||
if(!vehicle)
|
||||
return;
|
||||
|
||||
// this is for wintergrasp, need to find a better way
|
||||
// in the future, we can just use getsummoner
|
||||
vehicle->SetUInt64Value(UNIT_FIELD_SUMMONEDBY, m_originalCasterGUID);
|
||||
vehicle->setFaction(m_originalCaster->getFaction());
|
||||
vehicle->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
|
||||
if(m_originalCaster)
|
||||
summon = m_caster->GetMap()->SummonCreature(entry, x, y, z, m_caster->GetOrientation(), 0, properties, duration, m_originalCaster);
|
||||
break;
|
||||
}
|
||||
case SUMMON_TYPE_TOTEM:
|
||||
{
|
||||
summon = m_caster->GetMap()->SummonCreature(entry, x, y, z, m_caster->GetOrientation(), 0, properties, duration, m_originalCaster);
|
||||
@@ -3511,17 +3499,13 @@ void Spell::EffectSummonType(uint32 i)
|
||||
{
|
||||
float x, y, z;
|
||||
m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE);
|
||||
Creature *vehicle = m_caster->SummonCreature(entry, x, y, z, m_caster->GetOrientation(), 0);
|
||||
if(!vehicle || !vehicle->IsVehicle())
|
||||
summon = m_caster->GetMap()->SummonCreature(entry, x, y, z, m_caster->GetOrientation(), 0, properties, duration, m_caster);
|
||||
if(!summon || !summon->IsVehicle())
|
||||
return;
|
||||
|
||||
vehicle->SetUInt64Value(UNIT_FIELD_SUMMONEDBY, m_caster->GetGUID());
|
||||
vehicle->setFaction(m_caster->getFaction());
|
||||
vehicle->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
|
||||
|
||||
if(damage)
|
||||
m_caster->CastSpell(vehicle, damage, true);
|
||||
m_caster->EnterVehicle(vehicle->GetVehicleKit());
|
||||
m_caster->CastSpell(summon, damage, true);
|
||||
m_caster->EnterVehicle(summon->GetVehicleKit());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,6 +205,8 @@ void TempSummon::InitStats(uint32 duration)
|
||||
|
||||
if(m_Properties->Faction)
|
||||
setFaction(m_Properties->Faction);
|
||||
else if(IsVehicle()) // properties should be vehicle
|
||||
setFaction(owner->getFaction());
|
||||
}
|
||||
|
||||
void TempSummon::InitSummon()
|
||||
@@ -287,16 +289,6 @@ void Minion::InitStats(uint32 duration)
|
||||
m_owner->SetMinion(this, true);
|
||||
}
|
||||
|
||||
void Minion::InitSummon()
|
||||
{
|
||||
TempSummon::InitSummon();
|
||||
|
||||
if(m_owner->GetTypeId() == TYPEID_PLAYER
|
||||
&& m_owner->GetMinionGUID() == GetGUID()
|
||||
&& !m_owner->GetCharmGUID())
|
||||
((Player*)m_owner)->CharmSpellInitialize();
|
||||
}
|
||||
|
||||
void Minion::RemoveFromWorld()
|
||||
{
|
||||
if(!IsInWorld())
|
||||
@@ -329,6 +321,16 @@ void Guardian::InitStats(uint32 duration)
|
||||
SetReactState(REACT_AGGRESSIVE);
|
||||
}
|
||||
|
||||
void Guardian::InitSummon()
|
||||
{
|
||||
TempSummon::InitSummon();
|
||||
|
||||
if(m_owner->GetTypeId() == TYPEID_PLAYER
|
||||
&& m_owner->GetMinionGUID() == GetGUID()
|
||||
&& !m_owner->GetCharmGUID())
|
||||
((Player*)m_owner)->CharmSpellInitialize();
|
||||
}
|
||||
|
||||
Puppet::Puppet(SummonPropertiesEntry const *properties, Unit *owner) : Minion(properties, owner)
|
||||
{
|
||||
assert(owner->GetTypeId() == TYPEID_PLAYER);
|
||||
|
||||
@@ -51,7 +51,6 @@ class Minion : public TempSummon
|
||||
public:
|
||||
Minion(SummonPropertiesEntry const *properties, Unit *owner);
|
||||
void InitStats(uint32 duration);
|
||||
void InitSummon();
|
||||
void RemoveFromWorld();
|
||||
Unit *GetOwner() { return m_owner; }
|
||||
float GetFollowAngle() const { return m_followAngle; }
|
||||
@@ -68,6 +67,7 @@ class Guardian : public Minion
|
||||
Guardian(SummonPropertiesEntry const *properties, Unit *owner);
|
||||
void InitStats(uint32 duration);
|
||||
bool InitStatsForLevel(uint32 level);
|
||||
void InitSummon();
|
||||
|
||||
bool UpdateStats(Stats stat);
|
||||
bool UpdateAllStats();
|
||||
|
||||
@@ -353,6 +353,9 @@ void OPvPWintergrasp::OnCreatureCreate(Creature *creature, bool add)
|
||||
{
|
||||
case CREATURE_SIEGE_VEHICLE:
|
||||
{
|
||||
if(!creature->isSummon())
|
||||
return;
|
||||
|
||||
TeamId team;
|
||||
if(creature->getFaction() == WintergraspFaction[TEAM_ALLIANCE])
|
||||
team = TEAM_ALLIANCE;
|
||||
@@ -361,7 +364,7 @@ void OPvPWintergrasp::OnCreatureCreate(Creature *creature, bool add)
|
||||
else
|
||||
return;
|
||||
|
||||
if(uint32 engLowguid = GUID_LOPART(creature->GetOwnerGUID()))
|
||||
if(uint32 engLowguid = GUID_LOPART(((TempSummon*)creature)->GetSummonerGUID()))
|
||||
{
|
||||
if(SiegeWorkshop *workshop = GetWorkshopByEngGuid(engLowguid))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user