Code:
#ifdef ENABLE_GM_LOCK_PLAYER
if (isLocked())
return false;
#endif
client src
GameLib/ActorInstance.cpp
Code:
// find:
BOOL CActorInstance::IsDead()
{
return m_isRealDead;
}
// add after:
#ifdef ENABLE_GM_LOCK_PLAYER
BOOL CActorInstance::IsLocked()
{
return m_isLocked;
}
#endif
// find:
void CActorInstance::Stun()
{
m_isStun = TRUE;
}
// add after:
#ifdef ENABLE_GM_LOCK_PLAYER
void CActorInstance::LockPlayer(BYTE state)
{
m_isLocked = state;
}
#endif
// find:
m_isResistFallen = FALSE;
// add after:
#ifdef ENABLE_GM_LOCK_PLAYER
m_isLocked = FALSE;
#endif
Code:
// find in bool CActorInstance::CanAct()
if (IsSleep())
return false;
// add after:
#ifdef ENABLE_GM_LOCK_PLAYER
if (IsLocked())
return false;
#endif
Code:
// find:
BOOL IsDead();
// add after:
#ifdef ENABLE_GM_LOCK_PLAYER
BOOL IsLocked();
void LockPlayer(BYTE state);
#endif
// find:
BOOL m_isRealDead;
// add after:
#ifdef ENABLE_GM_LOCK_PLAYER
BOOL m_isLocked;
#endif
Code:
#define ENABLE_GM_LOCK_PLAYER // Lock Player Move by GM
Code:
// find:
BOOL CInstanceBase::IsSleep()
{
return m_GraphicThingInstance.IsSleep();
}
// add after:
#ifdef ENABLE_GM_LOCK_PLAYER
BOOL CInstanceBase::IsLocked()
{
return m_GraphicThingInstance.IsLocked();
}
#endif
UserInterface/InstanceBase.h
Code:
// find:
void Die();
// add after:
#ifdef ENABLE_GM_LOCK_PLAYER
void SetLockPlayer(BYTE status);
#endif
// find:
BOOL IsSleep();
// add after:
#ifdef ENABLE_GM_LOCK_PLAYER
BOOL IsLocked();
#endif
Code:
// find:
HEADER_GC_MAIN_CHARACTER4_BGM_VOL = 138,
// add after:
#ifdef ENABLE_GM_LOCK_PLAYER
HEADER_GC_LOCK_PLAYER = 139,
#endif
// add at the end of the file befor #pragma pack(pop)
#ifdef ENABLE_GM_LOCK_PLAYER
typedef struct SPacketGCLockPlayer
{
BYTE bHeader;
BYTE status;
DWORD vid;
} TPacketGCLockPlayer;
#endif
Code:
// find:
Set(HEADER_GC_ACCE, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCAcce), DYNAMIC_SIZE_PACKET));
// add after:
#ifdef ENABLE_GM_LOCK_PLAYER
Set(HEADER_GC_LOCK_PLAYER, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCLockPlayer), STATIC_SIZE_PACKET));
#endif
Code:
// find:
bool RecvFishing();
// add after:
#ifdef ENABLE_GM_LOCK_PLAYER
bool RecvLockPlayer();
#endif
Code:
// find in void CPythonPlayer::NEW_SetMouseSmartState(int eMBS, bool isAuto)
if (pkInstMain->IsSleep())
{
return;
}
// add after:
#ifdef ENABLE_GM_LOCK_PLAYER
if (pkInstMain->IsLocked())
return;
#endif
Code:
// find:
default:
ret = RecvDefaultPacket(header);
break;
}
}
if (!ret)
RecvErrorPacket(header);
// add BEFORE!
#ifdef ENABLE_GM_LOCK_PLAYER
case HEADER_GC_LOCK_PLAYER:
ret = RecvLockPlayer();
break;
#endif
// add at the end of the file:
#ifdef ENABLE_GM_LOCK_PLAYER
bool CPythonNetworkStream::RecvLockPlayer()
{
TPacketGCLockPlayer packet;
if (!Recv(sizeof(packet), &packet))
return false;
CPythonCharacterManager& rkChrMgr = CPythonCharacterManager::Instance();
CInstanceBase* pkInstSel = rkChrMgr.GetInstancePtr(packet.vid);
if (pkInstSel)
{
pkInstSel->SetLockPlayer(packet.status);
}
return true;
}
#endif
common/service.h
Code:
#define ENABLE_GM_LOCK_PLAYER // Lock Player Move by GM
Code:
// find:
struct command_info cmd_info[] =
// add BEFORE:
#ifdef ENABLE_GM_LOCK_PLAYER
ACMD(do_lock_player);
#endif
// find:
{ "\n", NULL, 0, POS_DEAD, GM_IMPLEMENTOR }
// add BEFORE:
#ifdef ENABLE_GM_LOCK_PLAYER
{ "lock_player", do_lock_player, 0, POS_DEAD, GM_IMPLEMENTOR },
#endif
Code:
// add at the end of the file
BEFORE:
};
ESex GET_SEX(LPCHARACTER ch);
this:
#ifdef ENABLE_GM_LOCK_PLAYER
public:
bool isLocked() const;
void LockPlayer(BYTE status);
protected:
BOOL m_isLocked;
#endif
Code:
// find in ACMD(do_user_horse_ride):
if (ch->IsDead() || ch->IsStun())
// replace it with:
if (ch->IsDead() || ch->IsStun()
#ifdef ENABLE_GM_LOCK_PLAYER
|| ch->isLocked()
#endif
)
// find in ACMD(do_ride):
if (ch->IsDead() || ch->IsStun())
// replace it with:
if (ch->IsDead() || ch->IsStun()
#ifdef ENABLE_GM_LOCK_PLAYER
|| ch->isLocked()
#endif
)
Code:
// add at the end of the file:
#ifdef ENABLE_GM_LOCK_PLAYER
ACMD(do_lock_player)
{
char arg1[256];
one_argument(argument, arg1, sizeof(arg1));
const char* name = arg1;
if (!*arg1)
{
ch->ChatPacket(CHAT_TYPE_INFO, "Invalid argument.");
return;
}
LPCHARACTER sas = CHARACTER_MANAGER::instance().FindPC(name);
if (!sas)
{
ch->ChatPacket(CHAT_TYPE_INFO, "Der Spieler ist nicht Online");
return;
}
if (!sas->IsPC())
return;
DWORD vid = sas->GetVID();
LPCHARACTER tch = CHARACTER_MANAGER::instance().Find(vid);
const char* spieler = sas->GetName();
if (!tch)
{
ch->ChatPacket(CHAT_TYPE_INFO, "<Sytem> Der Spieler existiert nicht!");
return;
}
if (!tch->IsPC())
return;
BYTE status;
if (tch->isLocked())
status = 0;
else
status = 1;
if (status == 1)
tch->ChatPacket(CHAT_TYPE_INFO, "You have been locked by a GM");
else
tch->ChatPacket(CHAT_TYPE_INFO, "You have benn unlocked by a GM");
tch->ChatPacket(CHAT_TYPE_INFO, "You was stucked by a GM.");
tch->LockPlayer(status);
TPacketGCLockPlayer packet;
packet.bHeader = HEADER_GC_LOCK_PLAYER;
packet.status = status;
packet.vid = vid;
tch->GetDesc()->Packet(&packet, sizeof(packet));
if (status == 1)
ch->ChatPacket(CHAT_TYPE_INFO, "Locked %s(%d)", spieler, vid);
else
ch->ChatPacket(CHAT_TYPE_INFO, "Unlocked %s(%d)", spieler, vid);
}
#endif
Code:
// find:
HEADER_GC_MAIN_CHARACTER4_BGM_VOL = 138,
// add after:
#ifdef ENABLE_GM_LOCK_PLAYER
HEADER_GC_LOCK_PLAYER = 139,
#endif
// add at the end of the file before #pragma pack()
#ifdef ENABLE_GM_LOCK_PLAYER
typedef struct SPacketGCLockPlayer
{
BYTE bHeader;
BYTE status;
DWORD vid;
} TPacketGCLockPlayer;
#endif
Code:
// find:
void CHARACTER::Initialize()
{
CEntity::Initialize(ENTITY_CHARACTER);
// add after:
#ifdef ENABLE_GM_LOCK_PLAYER
m_isLocked = FALSE;
#endif
// find in bool CHARACTER::CanMove() const
if (GetMyShop())
return false;
// add after:
#ifdef ENABLE_GM_LOCK_PLAYER
if (isLocked())
return false;
#endif
// add at the end of the file:
#ifdef ENABLE_GM_LOCK_PLAYER
bool CHARACTER::isLocked() const
{
return m_isLocked;
}
void CHARACTER::LockPlayer(BYTE status)
{
m_isLocked = status;
}
#endif