13 cmangos commits implemented

commits:

432bd63 Commit Ported  Core Implement TakePossessOf to generalize the
code.
0b663eb Commit Ported  Core Implement a possibility to summon manualy a

temporary creature.
b6a9ead Commit Imported  Core Little rewrite of resurect code to prepare
ability
ro resurrect a player to a ghoul form.
e98b42c Commit Imported  Core Implement TemporarySummon Linked aura to
owner.
ab139ff Commit Imported  Core Do not force the creature to attack
summoner in all
case
555f055 Commit Imported  Core Avoid possibility to charm more than one
new
creature for an unit.
fd78c4a Commit Imported  Core Fix problem that occur when the charm unit
field is
updated after the possess bar.
e9821e2 Commit Imported  Core fix lightwell gameobject not appearing
after spell
is cast
17d0e93 Commit Imported  Core Implement logic for Target 95 as
TARGET_VEHICLE_DRIVER
42b3545 Commit Imported  Core Now npc/gameobject interaction will remove

unauthorized aura
1195398 Commit Imported  Core Improve functionality for eventAI action
26 -
ACTION_T_QUEST_EVENT_ALL
72b7a48 Commit Ported  Core fix pet stay
245f068 Commit Imported  Warlock [Charm] prevent charming multiple
demons also remove
pet temporarily when casting specific channels that summon other charmed
creatures
This commit is contained in:
Charles A Edwards 2016-09-13 10:37:38 +01:00 committed by Antz
parent 18dd18780d
commit df3ab5df8e
25 changed files with 508 additions and 313 deletions

View file

@ -2298,6 +2298,9 @@ Creature* Player::GetNPCIfCanInteractWith(ObjectGuid guid, uint32 NpcFlagsmask)
if (!guid || !IsInWorld() || IsTaxiFlying())
return NULL;
// set player as interacting
DoInteraction(guid);
// not in interactive state
if (hasUnitState(UNIT_STAT_CAN_NOT_REACT_OR_LOST_CONTROL))
return NULL;
@ -2339,12 +2342,15 @@ Creature* Player::GetNPCIfCanInteractWith(ObjectGuid guid, uint32 NpcFlagsmask)
return unit;
}
GameObject* Player::GetGameObjectIfCanInteractWith(ObjectGuid guid, uint32 gameobject_type) const
GameObject* Player::GetGameObjectIfCanInteractWith(ObjectGuid guid, uint32 gameobject_type)
{
// some basic checks
if (!guid || !IsInWorld() || IsTaxiFlying())
return NULL;
// set player as interacting
DoInteraction(guid);
// not in interactive state
if (hasUnitState(UNIT_STAT_CAN_NOT_REACT_OR_LOST_CONTROL))
return NULL;
@ -21270,6 +21276,24 @@ void Player::SetClientControl(Unit* target, uint8 allowMove)
GetSession()->SendPacket(&data);
}
void Player::Uncharm()
{
if (Unit* charm = GetCharm())
{
charm->RemoveSpellsCausingAura(SPELL_AURA_MOD_CHARM);
charm->RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS);
charm->RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS_PET);
if (charm == GetMover())
{
SetMover(nullptr);
GetCamera().ResetView();
RemoveSpellsCausingAura(SPELL_AURA_MOD_INVISIBILITY);
SetCharm(nullptr);
SetClientControl(this, 1);
}
}
}
void Player::UpdateZoneDependentAuras()
{
// Some spells applied at enter into zone (with subzones), aura removed in UpdateAreaDependentAuras that called always at zone->area update
@ -22699,6 +22723,15 @@ void Player::UnsummonPetTemporaryIfAny()
pet->Unsummon(PET_SAVE_AS_CURRENT, this);
}
void Player::UnsummonPetIfAny()
{
Pet* pet = GetPet();
if (!pet)
return;
pet->Unsummon(PET_SAVE_NOT_IN_SLOT, this);
}
void Player::ResummonPetTemporaryUnSummonedIfAny()
{
if (!m_temporaryUnsummonedPetNumber)
@ -24307,6 +24340,41 @@ float Player::GetCollisionHeight(bool mounted) const
}
}
// set data to accept next resurrect response and process it with required data
void Player::setResurrectRequestData(Unit* caster, uint32 health, uint32 mana)
{
m_resurrectGuid = caster->GetObjectGuid();
m_resurrectMap = caster->GetMapId();
caster->GetPosition(m_resurrectX, m_resurrectY, m_resurrectZ);
m_resurrectHealth = health;
m_resurrectMana = mana;
m_resurrectToGhoul = false;
}
// we can use this to prepare data in case we have to resurrect player in ghoul form
void Player::setResurrectRequestDataToGhoul(Unit* caster)
{
setResurrectRequestData(caster, 0, 0);
m_resurrectToGhoul = true;
}
// player is interacting so we have to remove non authorized aura
void Player::DoInteraction(ObjectGuid const& interactObjGuid)
{
if (interactObjGuid.IsUnit())
{
// remove some aura like stealth aura
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK);
}
else if (interactObjGuid.IsGameObject())
{
// remove some aura like stealth aura
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_USE);
}
SendForcedObjectUpdate();
}
void Player::SendPetitionSignResult(ObjectGuid petitionGuid, Player* player, uint32 result)
{
WorldPacket data(SMSG_PETITION_SIGN_RESULTS, 8 + 8 + 4);