All pastes #509123 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-05-25 09:35 UTC
rendered paste body
Player.cpp

void Player::KillPlayer()
{
	setDeathState(JUST_DIED);

	// Battleground stuff
	if(m_bgInBattleground && GetCurrentBattleground() != NULL)
	{
		if(GetCurrentBattleground()->GetMapId() == 489)
			GetCurrentBattleground()->HandleBattlegroundEvent(this, NULL, BGEVENT_WSG_PLAYER_DEATH);
		else if(GetCurrentBattleground()->GetMapId() == 529)
			GetCurrentBattleground()->HandleBattlegroundEvent(this, NULL, BGEVENT_AB_PLAYER_DEATH);
	}

	EventDeath();
	
	m_session->OutPacket(SMSG_CANCEL_COMBAT);
	m_session->OutPacket(SMSG_CANCEL_AUTO_REPEAT);

	SetMovement(MOVE_ROOT, 0);

	StopMirrorTimer(0);
	StopMirrorTimer(1);
	StopMirrorTimer(2);

	SetFlag( UNIT_FIELD_FLAGS, 0x08 ); //player death animation, also can be used with DYNAMIC_FLAGS
	SetUInt32Value( UNIT_DYNAMIC_FLAGS, 0x00 );
	if(this->getClass() == WARRIOR) //rage resets on death
		SetUInt32Value(UNIT_FIELD_POWER2, 0);
        
+        uint32 selfResSpell = GetUInt32Value(PLAYER_SELF_RES_SPELL);
+        if(selfResSpell) > 0)
+        {
+                SpellEntry *m_selfresspellInfo = sSpellStore.LookupEntry(self_res_spell);
+                Spell *m_selfresspell = new Spell(this, m_selfresspellInfo ,true, NULL);
+                m_selfresspell->prepare(this);
+               if (selfResSpell = 21169)
+                {
+                            SpellEntry *m_reincarnSpellInfo = sSpellStore.LookupEntry(20608);
+                            Spell *m_reincarnSpell = new Spell(pVictim, m_reincarnSpellInfo ,true, NULL);
+                            m_reincarnSpell->AddStartCooldown();
+                }
+       }
}

Player.h
(line 885)
	int m_lifetapbonus;
	uint32 m_lastShotTime;
+        bool bReincarnate;

Object.cpp
(line 1414)
		/* victim died! */
		if(pVictim->IsPlayer())
+                        uint32 selfResSpell = 0;
+			
+                        if(((Player*)pVictim)->SoulStone)
+				selfResSpell = ((Player*)pVictim)->SoulStone);
+                        
+                        if(((Player*)pVictim)->bReincarnate && selfResSpell = 0)
+                        {
+                            SpellEntry *m_reincarnSpellInfo = sSpellStore.LookupEntry(21169);
+                            Spell *m_reincarnSpell = new Spell(pVictim, m_reincarnSpellInfo ,true, NULL);
+                            if(((Player*)pVictim)->CanCastDueToCooldown(m_reincarnSpellInfo))
+                            {
+                                uint32 ankh_count = ((Player*)pVictim)->GetItemInterface()->GetItemCount(17030,false);
+                                if(ankh_count > 0)
+                                {
+                                    selfResSpell = 21169;
+                                }
+                            }
+                        }
+                        pVictim->SetUInt32Value(PLAYER_SELF_RES_SPELL,selfResSpell);
+
			((Player*)pVictim)->KillPlayer();
+               }
		else
			pVictim->setDeathState(JUST_DIED);

...

(line 1477)
		/* Set victim health to 0 */
		pVictim->SetUInt32Value(UNIT_FIELD_HEALTH, 0);
		if(pVictim->IsPlayer())
		{
-			if(((Player*)pVictim)->SoulStone)
-				pVictim->SetUInt32Value(PLAYER_SELF_RES_SPELL,((Player*)pVictim)->SoulStone);
			pVictim->SetUInt32Value( UNIT_FIELD_MOUNTDISPLAYID , 0);
			if(pVictim->HasFlag( UNIT_FIELD_FLAGS , U_FIELD_FLAG_MOUNT_SIT ))
				pVictim->RemoveFlag( UNIT_FIELD_FLAGS , U_FIELD_FLAG_MOUNT_SIT );
		}