* Implement Spell 6962 by Muhaha & Nevan , based on http://bitbucket.org/panaut0lordv/tc2-patches/src/tip/bgpetressurect
--HG-- branch : trunk
This commit is contained in:
@@ -319,6 +319,7 @@ void BattleGround::Update(uint32 diff)
|
|||||||
if (!plr)
|
if (!plr)
|
||||||
continue;
|
continue;
|
||||||
plr->ResurrectPlayer(1.0f);
|
plr->ResurrectPlayer(1.0f);
|
||||||
|
plr->CastSpell(plr, 6962, true);
|
||||||
plr->CastSpell(plr, SPELL_SPIRIT_HEAL_MANA, true);
|
plr->CastSpell(plr, SPELL_SPIRIT_HEAL_MANA, true);
|
||||||
ObjectAccessor::Instance().ConvertCorpseForPlayer(*itr);
|
ObjectAccessor::Instance().ConvertCorpseForPlayer(*itr);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -346,6 +346,10 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//set last used pet number (for use in BG's)
|
||||||
|
if(owner->GetTypeId() == TYPEID_PLAYER && isControlled() && !isTemporarySummoned() && (getPetType() == SUMMON_PET || getPetType() == HUNTER_PET))
|
||||||
|
((Player*)owner)->SetLastPetNumber(pet_number);
|
||||||
|
|
||||||
m_loading = false;
|
m_loading = false;
|
||||||
|
|
||||||
SynchronizeLevelWithOwner();
|
SynchronizeLevelWithOwner();
|
||||||
|
|||||||
+2
-1
@@ -392,6 +392,7 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa
|
|||||||
//returning reagents for temporarily removed pets
|
//returning reagents for temporarily removed pets
|
||||||
//when dying/logging out
|
//when dying/logging out
|
||||||
m_oldpetspell = 0;
|
m_oldpetspell = 0;
|
||||||
|
m_lastpetnumber = 0;
|
||||||
|
|
||||||
////////////////////Rest System/////////////////////
|
////////////////////Rest System/////////////////////
|
||||||
time_inn_enter=0;
|
time_inn_enter=0;
|
||||||
@@ -17117,7 +17118,7 @@ void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(returnreagent && (pet || m_temporaryUnsummonedPetNumber))
|
if(returnreagent && (pet || m_temporaryUnsummonedPetNumber) && !InBattleGround())
|
||||||
{
|
{
|
||||||
//returning of reagents only for players, so best done here
|
//returning of reagents only for players, so best done here
|
||||||
uint32 spellId = pet ? pet->GetUInt32Value(UNIT_CREATED_BY_SPELL) : m_oldpetspell;
|
uint32 spellId = pet ? pet->GetUInt32Value(UNIT_CREATED_BY_SPELL) : m_oldpetspell;
|
||||||
|
|||||||
@@ -2159,6 +2159,10 @@ class MANGOS_DLL_SPEC Player : public Unit
|
|||||||
static void ConvertInstancesToGroup(Player *player, Group *group = NULL, uint64 player_guid = 0);
|
static void ConvertInstancesToGroup(Player *player, Group *group = NULL, uint64 player_guid = 0);
|
||||||
bool Satisfy(AccessRequirement const*, uint32 target_map, bool report = false);
|
bool Satisfy(AccessRequirement const*, uint32 target_map, bool report = false);
|
||||||
|
|
||||||
|
// last used pet number (for BG's)
|
||||||
|
uint32 GetLastPetNumber() const { return m_lastpetnumber; }
|
||||||
|
void SetLastPetNumber(uint32 petnumber) { m_lastpetnumber = petnumber; }
|
||||||
|
|
||||||
/*********************************************************/
|
/*********************************************************/
|
||||||
/*** GROUP SYSTEM ***/
|
/*** GROUP SYSTEM ***/
|
||||||
/*********************************************************/
|
/*********************************************************/
|
||||||
@@ -2434,6 +2438,9 @@ Spell * m_spellModTakingSpell;
|
|||||||
uint32 m_groupUpdateMask;
|
uint32 m_groupUpdateMask;
|
||||||
uint64 m_auraRaidUpdateMask;
|
uint64 m_auraRaidUpdateMask;
|
||||||
|
|
||||||
|
// last used pet number (for BG's)
|
||||||
|
uint32 m_lastpetnumber;
|
||||||
|
|
||||||
// Player summoning
|
// Player summoning
|
||||||
time_t m_summon_expire;
|
time_t m_summon_expire;
|
||||||
uint32 m_summon_mapid;
|
uint32 m_summon_mapid;
|
||||||
|
|||||||
@@ -4736,6 +4736,38 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
|||||||
{
|
{
|
||||||
switch(m_spellInfo->Id)
|
switch(m_spellInfo->Id)
|
||||||
{
|
{
|
||||||
|
case 6962:
|
||||||
|
{
|
||||||
|
if(m_caster->GetTypeId()!=TYPEID_PLAYER)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Player* plr = ((Player*)m_caster);
|
||||||
|
if(plr && plr->GetLastPetNumber())
|
||||||
|
{
|
||||||
|
PetType NewPetType = (plr->getClass()==CLASS_HUNTER) ? HUNTER_PET : SUMMON_PET;
|
||||||
|
if (Pet* NewPet = new Pet(plr,NewPetType))
|
||||||
|
{
|
||||||
|
if(NewPet->LoadPetFromDB(plr, 0, plr->GetLastPetNumber(), true))
|
||||||
|
{
|
||||||
|
NewPet->SetHealth(NewPet->GetMaxHealth());
|
||||||
|
NewPet->SetPower(NewPet->getPowerType(),NewPet->GetMaxPower(NewPet->getPowerType()));
|
||||||
|
|
||||||
|
switch (NewPet->GetEntry())
|
||||||
|
{
|
||||||
|
case 11859:
|
||||||
|
case 89:
|
||||||
|
NewPet->SetEntry(416);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
delete NewPet;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Glyph of Starfire
|
// Glyph of Starfire
|
||||||
case 54846:
|
case 54846:
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user