mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 09:31:30 +00:00
Merge pull request #746 from fryguy503/mount-dismount-water
Rule: DismountWater - Causes mounts to dismount when entering liquid …
This commit is contained in:
commit
96d146f73c
@ -158,6 +158,7 @@ RULE_BOOL(Character, UseOldConSystem, false) // Grant Health of Target's Target
|
|||||||
RULE_BOOL(Character, OPClientUpdateVisualDebug, false) // Shows a pulse and forward directional particle each time the client sends its position to server
|
RULE_BOOL(Character, OPClientUpdateVisualDebug, false) // Shows a pulse and forward directional particle each time the client sends its position to server
|
||||||
RULE_BOOL(Character, AllowCrossClassTrainers, false)
|
RULE_BOOL(Character, AllowCrossClassTrainers, false)
|
||||||
RULE_BOOL(Character, PetsUseReagents, true) //Pets use reagent on spells
|
RULE_BOOL(Character, PetsUseReagents, true) //Pets use reagent on spells
|
||||||
|
RULE_BOOL(Character, DismountWater, true) // Dismount horses when entering water
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
RULE_CATEGORY(Mercs)
|
RULE_CATEGORY(Mercs)
|
||||||
|
|||||||
@ -4407,8 +4407,7 @@ void Client::Handle_OP_ClientTimeStamp(const EQApplicationPacket *app)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) {
|
||||||
{
|
|
||||||
if (IsAIControlled())
|
if (IsAIControlled())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -4419,7 +4418,8 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
|||||||
if (app->size != sizeof(PlayerPositionUpdateClient_Struct)
|
if (app->size != sizeof(PlayerPositionUpdateClient_Struct)
|
||||||
&& app->size != (sizeof(PlayerPositionUpdateClient_Struct) + 1)
|
&& app->size != (sizeof(PlayerPositionUpdateClient_Struct) + 1)
|
||||||
) {
|
) {
|
||||||
Log(Logs::General, Logs::Error, "OP size error: OP_ClientUpdate expected:%i got:%i", sizeof(PlayerPositionUpdateClient_Struct), app->size);
|
Log(Logs::General, Logs::Error, "OP size error: OP_ClientUpdate expected:%i got:%i",
|
||||||
|
sizeof(PlayerPositionUpdateClient_Struct), app->size);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4447,8 +4447,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
|||||||
/* Update the boat's position on the server, without sending an update */
|
/* Update the boat's position on the server, without sending an update */
|
||||||
boat->GMMove(ppu->x_pos, ppu->y_pos, ppu->z_pos, EQ12toFloat(ppu->heading), false);
|
boat->GMMove(ppu->x_pos, ppu->y_pos, ppu->z_pos, EQ12toFloat(ppu->heading), false);
|
||||||
return;
|
return;
|
||||||
}
|
} else return;
|
||||||
else return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float dist = 0;
|
float dist = 0;
|
||||||
@ -4464,29 +4463,28 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
|||||||
if (m_DistanceSinceLastPositionCheck > 0.0) {
|
if (m_DistanceSinceLastPositionCheck > 0.0) {
|
||||||
uint32 cur_time = Timer::GetCurrentTime();
|
uint32 cur_time = Timer::GetCurrentTime();
|
||||||
if ((cur_time - m_TimeSinceLastPositionCheck) > 0) {
|
if ((cur_time - m_TimeSinceLastPositionCheck) > 0) {
|
||||||
float speed = (m_DistanceSinceLastPositionCheck * 100) / (float)(cur_time - m_TimeSinceLastPositionCheck);
|
float speed =
|
||||||
|
(m_DistanceSinceLastPositionCheck * 100) / (float) (cur_time - m_TimeSinceLastPositionCheck);
|
||||||
int runs = GetRunspeed();
|
int runs = GetRunspeed();
|
||||||
if (speed > (runs * RuleR(Zone, MQWarpDetectionDistanceFactor))) {
|
if (speed > (runs * RuleR(Zone, MQWarpDetectionDistanceFactor))) {
|
||||||
if (!GetGMSpeed() && (runs >= GetBaseRunspeed() || (speed > (GetBaseRunspeed() * RuleR(Zone, MQWarpDetectionDistanceFactor))))) {
|
if (!GetGMSpeed() && (runs >= GetBaseRunspeed() ||
|
||||||
|
(speed > (GetBaseRunspeed() * RuleR(Zone, MQWarpDetectionDistanceFactor))))) {
|
||||||
if (IsShadowStepExempted()) {
|
if (IsShadowStepExempted()) {
|
||||||
if (m_DistanceSinceLastPositionCheck > 800) {
|
if (m_DistanceSinceLastPositionCheck > 800) {
|
||||||
CheatDetected(MQWarpShadowStep, ppu->x_pos, ppu->y_pos, ppu->z_pos);
|
CheatDetected(MQWarpShadowStep, ppu->x_pos, ppu->y_pos, ppu->z_pos);
|
||||||
}
|
}
|
||||||
}
|
} else if (IsKnockBackExempted()) {
|
||||||
else if (IsKnockBackExempted()) {
|
|
||||||
if (speed > 30.0f) {
|
if (speed > 30.0f) {
|
||||||
CheatDetected(MQWarpKnockBack, ppu->x_pos, ppu->y_pos, ppu->z_pos);
|
CheatDetected(MQWarpKnockBack, ppu->x_pos, ppu->y_pos, ppu->z_pos);
|
||||||
}
|
}
|
||||||
}
|
} else if (!IsPortExempted()) {
|
||||||
else if (!IsPortExempted()) {
|
|
||||||
if (!IsMQExemptedArea(zone->GetZoneID(), ppu->x_pos, ppu->y_pos, ppu->z_pos)) {
|
if (!IsMQExemptedArea(zone->GetZoneID(), ppu->x_pos, ppu->y_pos, ppu->z_pos)) {
|
||||||
if (speed > (runs * 2 * RuleR(Zone, MQWarpDetectionDistanceFactor))) {
|
if (speed > (runs * 2 * RuleR(Zone, MQWarpDetectionDistanceFactor))) {
|
||||||
m_TimeSinceLastPositionCheck = cur_time;
|
m_TimeSinceLastPositionCheck = cur_time;
|
||||||
m_DistanceSinceLastPositionCheck = 0.0f;
|
m_DistanceSinceLastPositionCheck = 0.0f;
|
||||||
CheatDetected(MQWarp, ppu->x_pos, ppu->y_pos, ppu->z_pos);
|
CheatDetected(MQWarp, ppu->x_pos, ppu->y_pos, ppu->z_pos);
|
||||||
//Death(this, 10000000, SPELL_UNKNOWN, _1H_BLUNT);
|
//Death(this, 10000000, SPELL_UNKNOWN, _1H_BLUNT);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
CheatDetected(MQWarpLight, ppu->x_pos, ppu->y_pos, ppu->z_pos);
|
CheatDetected(MQWarpLight, ppu->x_pos, ppu->y_pos, ppu->z_pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4500,43 +4498,39 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
|||||||
m_DistanceSinceLastPositionCheck = 0.0f;
|
m_DistanceSinceLastPositionCheck = 0.0f;
|
||||||
m_CheatDetectMoved = false;
|
m_CheatDetectMoved = false;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
m_TimeSinceLastPositionCheck = Timer::GetCurrentTime();
|
m_TimeSinceLastPositionCheck = Timer::GetCurrentTime();
|
||||||
m_CheatDetectMoved = false;
|
m_CheatDetectMoved = false;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
m_DistanceSinceLastPositionCheck += dist;
|
m_DistanceSinceLastPositionCheck += dist;
|
||||||
m_CheatDetectMoved = true;
|
m_CheatDetectMoved = true;
|
||||||
if (m_TimeSinceLastPositionCheck == 0) {
|
if (m_TimeSinceLastPositionCheck == 0) {
|
||||||
m_TimeSinceLastPositionCheck = Timer::GetCurrentTime();
|
m_TimeSinceLastPositionCheck = Timer::GetCurrentTime();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
uint32 cur_time = Timer::GetCurrentTime();
|
uint32 cur_time = Timer::GetCurrentTime();
|
||||||
if ((cur_time - m_TimeSinceLastPositionCheck) > 2500) {
|
if ((cur_time - m_TimeSinceLastPositionCheck) > 2500) {
|
||||||
float speed = (m_DistanceSinceLastPositionCheck * 100) / (float)(cur_time - m_TimeSinceLastPositionCheck);
|
float speed =
|
||||||
|
(m_DistanceSinceLastPositionCheck * 100) / (float) (cur_time - m_TimeSinceLastPositionCheck);
|
||||||
int runs = GetRunspeed();
|
int runs = GetRunspeed();
|
||||||
if (speed > (runs * RuleR(Zone, MQWarpDetectionDistanceFactor))) {
|
if (speed > (runs * RuleR(Zone, MQWarpDetectionDistanceFactor))) {
|
||||||
if (!GetGMSpeed() && (runs >= GetBaseRunspeed() || (speed > (GetBaseRunspeed() * RuleR(Zone, MQWarpDetectionDistanceFactor))))) {
|
if (!GetGMSpeed() && (runs >= GetBaseRunspeed() ||
|
||||||
|
(speed > (GetBaseRunspeed() * RuleR(Zone, MQWarpDetectionDistanceFactor))))) {
|
||||||
if (IsShadowStepExempted()) {
|
if (IsShadowStepExempted()) {
|
||||||
if (m_DistanceSinceLastPositionCheck > 800) {
|
if (m_DistanceSinceLastPositionCheck > 800) {
|
||||||
CheatDetected(MQWarpShadowStep, ppu->x_pos, ppu->y_pos, ppu->z_pos);
|
CheatDetected(MQWarpShadowStep, ppu->x_pos, ppu->y_pos, ppu->z_pos);
|
||||||
}
|
}
|
||||||
}
|
} else if (IsKnockBackExempted()) {
|
||||||
else if (IsKnockBackExempted()) {
|
|
||||||
if (speed > 30.0f) {
|
if (speed > 30.0f) {
|
||||||
CheatDetected(MQWarpKnockBack, ppu->x_pos, ppu->y_pos, ppu->z_pos);
|
CheatDetected(MQWarpKnockBack, ppu->x_pos, ppu->y_pos, ppu->z_pos);
|
||||||
}
|
}
|
||||||
}
|
} else if (!IsPortExempted()) {
|
||||||
else if (!IsPortExempted()) {
|
|
||||||
if (!IsMQExemptedArea(zone->GetZoneID(), ppu->x_pos, ppu->y_pos, ppu->z_pos)) {
|
if (!IsMQExemptedArea(zone->GetZoneID(), ppu->x_pos, ppu->y_pos, ppu->z_pos)) {
|
||||||
if (speed > (runs * 2 * RuleR(Zone, MQWarpDetectionDistanceFactor))) {
|
if (speed > (runs * 2 * RuleR(Zone, MQWarpDetectionDistanceFactor))) {
|
||||||
m_TimeSinceLastPositionCheck = cur_time;
|
m_TimeSinceLastPositionCheck = cur_time;
|
||||||
m_DistanceSinceLastPositionCheck = 0.0f;
|
m_DistanceSinceLastPositionCheck = 0.0f;
|
||||||
CheatDetected(MQWarp, ppu->x_pos, ppu->y_pos, ppu->z_pos);
|
CheatDetected(MQWarp, ppu->x_pos, ppu->y_pos, ppu->z_pos);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
CheatDetected(MQWarpLight, ppu->x_pos, ppu->y_pos, ppu->z_pos);
|
CheatDetected(MQWarpLight, ppu->x_pos, ppu->y_pos, ppu->z_pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4620,7 +4614,8 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
|||||||
is_client_moving = (ppu->y_pos == m_Position.y && ppu->x_pos == m_Position.x) ? false : true;
|
is_client_moving = (ppu->y_pos == m_Position.y && ppu->x_pos == m_Position.x) ? false : true;
|
||||||
|
|
||||||
if (is_client_moving) {
|
if (is_client_moving) {
|
||||||
Log(Logs::Detail, Logs::Normal, "ClientUpdate: Client is moving - scan timer is: %u", client_scan_npc_aggro_timer.GetDuration());
|
Log(Logs::Detail, Logs::Normal, "ClientUpdate: Client is moving - scan timer is: %u",
|
||||||
|
client_scan_npc_aggro_timer.GetDuration());
|
||||||
if (client_scan_npc_aggro_timer.GetDuration() > 1000) {
|
if (client_scan_npc_aggro_timer.GetDuration() > 1000) {
|
||||||
|
|
||||||
npc_close_scan_timer.Disable();
|
npc_close_scan_timer.Disable();
|
||||||
@ -4630,9 +4625,9 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
|||||||
client_scan_npc_aggro_timer.Start(500);
|
client_scan_npc_aggro_timer.Start(500);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
Log(Logs::Detail, Logs::Normal, "ClientUpdate: Client is NOT moving - scan timer is: %u",
|
||||||
Log(Logs::Detail, Logs::Normal, "ClientUpdate: Client is NOT moving - scan timer is: %u", client_scan_npc_aggro_timer.GetDuration());
|
client_scan_npc_aggro_timer.GetDuration());
|
||||||
if (client_scan_npc_aggro_timer.GetDuration() < 1000) {
|
if (client_scan_npc_aggro_timer.GetDuration() < 1000) {
|
||||||
|
|
||||||
npc_close_scan_timer.Disable();
|
npc_close_scan_timer.Disable();
|
||||||
@ -4653,7 +4648,8 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
/* Visual Debugging */
|
/* Visual Debugging */
|
||||||
if (RuleB(Character, OPClientUpdateVisualDebug)) {
|
if (RuleB(Character, OPClientUpdateVisualDebug)) {
|
||||||
Log(Logs::General, Logs::Debug, "ClientUpdate: ppu x: %f y: %f z: %f h: %u", ppu->x_pos, ppu->y_pos, ppu->z_pos, ppu->heading);
|
Log(Logs::General, Logs::Debug, "ClientUpdate: ppu x: %f y: %f z: %f h: %u", ppu->x_pos, ppu->y_pos, ppu->z_pos,
|
||||||
|
ppu->heading);
|
||||||
this->SendAppearanceEffect(78, 0, 0, 0, 0);
|
this->SendAppearanceEffect(78, 0, 0, 0, 0);
|
||||||
this->SendAppearanceEffect(41, 0, 0, 0, 0);
|
this->SendAppearanceEffect(41, 0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
@ -4672,8 +4668,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
if (gm_hide_me) {
|
if (gm_hide_me) {
|
||||||
entity_list.QueueClientsStatus(this, outapp, true, Admin(), 250);
|
entity_list.QueueClientsStatus(this, outapp, true, Admin(), 250);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
entity_list.QueueCloseClients(this, outapp, true, RuleI(Range, ClientPositionUpdates), nullptr, true);
|
entity_list.QueueCloseClients(this, outapp, true, RuleI(Range, ClientPositionUpdates), nullptr, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4684,8 +4679,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
if (raid) {
|
if (raid) {
|
||||||
raid->QueueClients(this, outapp, true, true, (RuleI(Range, ClientPositionUpdates) * -1));
|
raid->QueueClients(this, outapp, true, true, (RuleI(Range, ClientPositionUpdates) * -1));
|
||||||
}
|
} else if (group) {
|
||||||
else if (group) {
|
|
||||||
group->QueueClients(this, outapp, true, true, (RuleI(Range, ClientPositionUpdates) * -1));
|
group->QueueClients(this, outapp, true, true, (RuleI(Range, ClientPositionUpdates) * -1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4693,11 +4687,17 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (zone->watermap) {
|
if (zone->watermap) {
|
||||||
if (zone->watermap->InLiquid(glm::vec3(m_Position)))
|
if (zone->watermap->InLiquid(glm::vec3(m_Position))) {
|
||||||
CheckIncreaseSkill(EQEmu::skills::SkillSwimming, nullptr, -17);
|
CheckIncreaseSkill(EQEmu::skills::SkillSwimming, nullptr, -17);
|
||||||
|
|
||||||
|
// Dismount horses when entering water
|
||||||
|
if (GetHorseId() && RuleB(Character, DismountWater)) {
|
||||||
|
SetHorseId(0);
|
||||||
|
BuffFadeByEffect(SE_SummonHorse);
|
||||||
|
}
|
||||||
|
}
|
||||||
CheckRegionTypeChanges();
|
CheckRegionTypeChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user