Created
March 12, 2014 09:41
-
-
Save callmephil/9503779 to your computer and use it in GitHub Desktop.
[Patch || C++] Remove Player Resurrect Timer and Spawning at GY (Rewrite). Old Rev.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp | |
index 0625a65..8c2b2d9 100644 | |
--- a/src/server/game/Entities/Player/Player.cpp | |
+++ b/src/server/game/Entities/Player/Player.cpp | |
@@ -80,6 +80,7 @@ | |
#include "WorldSession.h" | |
#include "MovementStructures.h" | |
#include "GameObjectAI.h" | |
+#include "Config.h" | |
@@ -134,7 +135,7 @@ enum CharacterCustomizeFlags | |
#define DEATH_EXPIRE_STEP (5*MINUTE) | |
#define MAX_DEATH_COUNT 3 | |
-static uint32 copseReclaimDelay[MAX_DEATH_COUNT] = { 30, 60, 120 }; | |
+// Change the 3 value as you whises. if you want only more values please change MAX_DEATH_COUNT. | |
+static uint32 copseReclaimDelay[MAX_DEATH_COUNT] = { 15, 25, 30 }; | |
uint32 const MasterySpells[MAX_CLASSES] = | |
{ | |
@@ -5575,24 +5576,44 @@ void Player::RepopAtGraveyard() | |
// stop countdown until repop | |
m_deathTimer = 0; | |
- // if no grave found, stay at the current location | |
- // and don't show spirit healer location | |
- if (ClosestGrave) | |
- { | |
- float const* orientation = sObjectMgr->GetGraveyardOrientation(ClosestGrave->ID); | |
- TeleportTo(ClosestGrave->map_id, ClosestGrave->x, ClosestGrave->y, ClosestGrave->z, orientation ? *orientation : GetOrientation()); | |
- if (isDead()) // not send if alive, because it used in TeleportTo() | |
- { | |
- WorldPacket data(SMSG_DEATH_RELEASE_LOC, 4*4); // show spirit healer position on minimap | |
- data << ClosestGrave->map_id; | |
- data << ClosestGrave->x; | |
- data << ClosestGrave->y; | |
- data << ClosestGrave->z; | |
- GetSession()->SendPacket(&data); | |
- } | |
- } | |
- else if (GetPositionZ() < zone->MaxDepth) | |
- TeleportTo(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, GetOrientation()); | |
+ // if no grave found, stay at the current location | |
+ // and don't show spirit healer location | |
+ if (ClosestGrave) | |
+ { | |
+ if(sConfigMgr->GetBoolDefault("Remove.Graveyard.Activation", 0)) | |
+ { | |
+ TeleportTo(ClosestGrave->map_id, ClosestGrave->x, ClosestGrave->y, ClosestGrave->z, GetOrientation()); | |
+ if (isDead()) // not send if alive, because it used in TeleportTo() | |
+ { | |
+ WorldPacket data(SMSG_DEATH_RELEASE_LOC, 4*4); // show spirit healer position on minimap | |
+ data << ClosestGrave->map_id; | |
+ data << ClosestGrave->x; | |
+ data << ClosestGrave->y; | |
+ data << ClosestGrave->z; | |
+ GetSession()->SendPacket(&data); | |
+ } | |
+ } | |
+ else | |
+ { | |
+ if (GetBattleground() || GetInstanceScript()) | |
+ { | |
+ TeleportTo(ClosestGrave->map_id, ClosestGrave->x, ClosestGrave->y, ClosestGrave->z, GetOrientation()); | |
+ } | |
+ else if(isDead()) // not send if alive, because it used in TeleportTo() | |
+ { | |
+ WorldPacket data(SMSG_DEATH_RELEASE_LOC, 4*4); // show spirit healer position on minimap | |
+ data << ClosestGrave->map_id; | |
+ data << ClosestGrave->x; | |
+ data << ClosestGrave->y; | |
+ data << ClosestGrave->z; | |
+ GetSession()->SendPacket(&data); | |
+ } | |
+ } | |
+ } | |
+else if (GetPositionZ() < -500.0f) | |
+TeleportTo(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, GetOrientation()); | |
} | |
bool Player::CanJoinConstantChannelInZone(ChatChannelsEntry const* channel, AreaTableEntry const* zone) | |
diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist | |
index e00169b..f4e71ab 100644 | |
--- a/src/server/worldserver/worldserver.conf.dist | |
+++ b/src/server/worldserver/worldserver.conf.dist | |
@@ -1959,6 +1959,14 @@ Death.SicknessLevel = 11 | |
Death.CorpseReclaimDelay.PvP = 1 | |
Death.CorpseReclaimDelay.PvE = 0 | |
+# Custom | |
+# Remove.Graveyard.Activation | |
+# Description: Remove Graveyard to set self Respawn (Not In Battleground or Instances/Raid) | |
+# Default: 0 - (Disabled || Default) | |
+# 1 - (Enabled) | |
+ | |
+Remove.Graveyard.Activation = 0 | |
+ | |
# | |
# Death.Bones.World | |
# Death.Bones.BattlegroundOrArena |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment