Code:
Index: zone/spell_effects.cpp
===================================================================
--- zone/spell_effects.cpp (revision 110)
+++ zone/spell_effects.cpp (working copy)
@@ -1682,11 +1682,13 @@
case SE_SummonPC:
{
- if(IsClient())
- CastToClient()->MovePC(zone->GetZoneID(), caster->GetX(), caster->GetY(), caster->GetZ(), caster->GetHeading(), 2, SummonPC);
- else
- caster->Message(13, "This spell can only be cast on players.");
-
+ if(IsClient()){
+ CastToClient()->cheat_timer.Start(3500, false); //Lieka: Exempt spells the "SummonPC" effect from triggering the MQWarp detector.
+ CastToClient()->MovePC(zone->GetZoneID(), caster->GetX(), caster->GetY(), caster->GetZ(), caster->GetHeading(), 2, SummonPC);
+ Message(15, "You have been summoned!");
+ } else {
+ caster->Message(13, "This spell can only be cast on players.");
+ }
break;
}
Index: zone/spells.cpp
===================================================================
--- zone/spells.cpp (revision 110)
+++ zone/spells.cpp (working copy)
@@ -942,6 +942,16 @@
if(IsClient())
{
this->CastToClient()->CheckSongSkillIncrease(spell_id);
+ //Lieka start Edit: Fixing Warp Detector triggered for Bard Songs
+ if ((IsGateSpell(spell_id)) ||//Lieka Edit Begin: Checking effects within the spell, rather than hardcoding Spell IDs.
+ (IsTeleportSpell(spell_id)) ||
+ (IsSuccorSpell(spell_id)) ||
+ (IsShadowStepSpell(spell_id)) ||
+ (IsGateSpell(spell_id)))
+ {
+ this->cheat_timer.Start(2000,false); //Lieka: Exempt above effects from setting off MQWarp detector due to intrazone movement generated from the bard song effects
+ }
+ //Lieka end edit.
}
// go again in 6 seconds
//this is handled with bardsong_timer
@@ -972,8 +982,15 @@
c->CheckSpecializeIncrease(spell_id);
}
+ if ((IsGateSpell(spell_id)) ||//Lieka Edit Begin: Checking effects within the spell, rather than hardcoding Spell IDs.
+ (IsTeleportSpell(spell_id)) ||
+ (IsSuccorSpell(spell_id)) ||
+ (IsShadowStepSpell(spell_id)) ||
+ (IsGateSpell(spell_id)))
+ {
+ c->cheat_timer.Start(2000,false); //Lieka: Exempt above effects from setting off MQWarp detector due to intrazone movement generated from the spell effects
+ }
-
}
// there should be no casting going on now
@@ -2242,6 +2259,17 @@
action->instrument_mod = GetInstrumentMod(spell_id);
action->buff_unknown = 0;
+ //Lieka start Edit: Fixing Warp Detector triggered by spells cast on the player.
+ if ((IsGateSpell(spell_id)) ||//Lieka Edit Begin: Checking effects within the spell, rather than hardcoding Spell IDs.
+ (IsTeleportSpell(spell_id)) ||
+ (IsSuccorSpell(spell_id)) ||
+ (IsShadowStepSpell(spell_id)) ||
+ (IsGateSpell(spell_id)))
+ {
+ spelltar->cheat_timer.Start(2000,false); //Lieka: Exempt above effects from setting off MQWarp detector due to intrazone movement generated from the spell effects
+ }
+ //Lieka end edit.
+
if(spelltar->IsClient()) // send to target
spelltar->CastToClient()->QueuePacket(action_packet);
if(IsClient()) // send to caster
Index: zone/zone.cpp
===================================================================
--- zone/zone.cpp (revision 110)
+++ zone/zone.cpp (working copy)
@@ -1185,7 +1185,7 @@
}
}
-ZonePoint* Zone::GetClosestZonePoint(float x, float y, float z, int32 to, float max_distance) {
+ZonePoint* Zone::GetClosestZonePoint(float x, float y, float z, int32 to, float max_distance, Client* client) {
LinkedListIterator<ZonePoint*> iterator(zone_point_list);
ZonePoint* closest_zp = 0;
float closest_dist = FLT_MAX;
@@ -1214,8 +1214,14 @@
}
if(closest_dist>(200.0f*200.0f) && closest_dist<max_distance2)
- LogFile->write(EQEMuLog::Status, "WARNING: Closest zone point for zone id %d is %f, you might need to update your zone_points table if you dont arrive at the right spot.",to,closest_dist);
-
+ {
+ client->CheatDetected(MQZone); //[Paddy] Someone is trying to use /zone
+ LogFile->write(EQEMuLog::Status, "WARNING: Closest zone point for zone id %d is %f, you might need to update your zone_points table if you dont arrive at the right spot.",to,closest_dist);
+ LogFile->write(EQEMuLog::Status, "<Real Zone Points>. %f x %f y %fz ",x,y,z);
+ //worldserver.SendEmoteMessage(0,0,0,13,"<Real Zone Points>. %f x %f y %fz ",x,y,z);
+ closest_zp = NULL; //Lieka: Prevent the zone request from happening.
+ }
+
if(closest_dist > max_distance2)
closest_zp = NULL;
Index: zone/zone.h
===================================================================
--- zone/zone.h (revision 110)
+++ zone/zone.h (working copy)
@@ -108,7 +108,7 @@
int32 CountSpawn2();
ZonePoint* GetClosestZonePoint(float x, float y, float z, const char* to_name, float max_distance = 40000.0f);
- ZonePoint* GetClosestZonePoint(float x, float y, float z, int32 to, float max_distance = 40000.0f);
+ ZonePoint* GetClosestZonePoint(float x, float y, float z, int32 to, float max_distance = 40000.0f, Client* client = NULL);
ZonePoint* GetClosestZonePointWithoutZone(float x, float y, float z, float max_distance = 40000.0f);
SpawnGroupList spawn_group_list;
Index: zone/mob.cpp
===================================================================
--- zone/mob.cpp (revision 110)
+++ zone/mob.cpp (working copy)
@@ -100,8 +100,10 @@
tic_timer(6000),
mana_timer(2000),
spellend_timer(0),
+ cheat_timer(0), //Lieka: Timer for MQ Detector exemptions
stunned_timer(0),
bardsong_timer(6000),
+ threshold_timer(0), //Lieka: Timer to allow exemptions MQWarp related to lag
#ifdef FLEE_HP_RATIO
flee_timer(FLEE_CHECK_TIMER),
#endif
@@ -121,7 +123,8 @@
AI_Init();
SetMoving(false);
moved=false;
-
+ warp_threshold = 140; //Null: set the threshold on creation of mob instance
+ last_warp_distance = 0; //Null: set this one to zero also just because.
_egnode = NULL;
adverrorinfo = 0;
name[0]=0;
@@ -231,7 +234,7 @@
// guildeqid = GUILD_NONE;
spellend_timer.Disable();
-
+ cheat_timer.Disable();
bardsong_timer.Disable();
bardsong = 0;
bardsong_target_id = 0;
@@ -874,6 +877,7 @@
client->Message(0, " STR: %i STA: %i DEX: %i AGI: %i INT: %i WIS: %i CHA: %i", GetSTR(), GetSTA(), GetDEX(), GetAGI(), GetINT(), GetWIS(), GetCHA());
client->Message(0, " MR: %i PR: %i FR: %i CR: %i DR: %i", GetMR(), GetPR(), GetFR(), GetCR(), GetDR());
client->Message(0, " Race: %i BaseRace: %i Texture: %i HelmTexture: %i Gender: %i BaseGender: %i", GetRace(), GetBaseRace(), GetTexture(), GetHelmTexture(), GetGender(), GetBaseGender());
+ client->Message(0, " Last Warp Distance: %f Threshold Remaining: %f", GetLWDistance(), GetWarpThreshold()); //Null: added this to check players last warp distance for debuging.
if (client->Admin() >= 100) {
client->Message(0, " EntityID: %i PetID: %i OwnerID: %i AIControlled: %i", this->GetID(), this->GetPetID(), this->GetOwnerID(), this->IsAIControlled());
if (this->IsClient()) {
@@ -1842,6 +1846,10 @@
// RangerDown - GMMove doesn't seem to be working well with players, so use MovePC for them, GMMove for NPC's
if (target->IsClient())
target->CastToClient()->MovePC(zone->GetZoneID(), x_pos, y_pos, z_pos, target->GetHeading(), 0, SummonPC);
+ if (target->IsClient()) {
+ target->CastToClient()->cheat_timer.Start(3500,false); //Lieka: Prevent Mob Summons from tripping hack detector.
+ target->CastToClient()->MovePC(zone->GetZoneID(), x_pos, y_pos, z_pos, target->GetHeading(), 0, SummonPC);
+ }
else
GetHateTop()->GMMove(x_pos, y_pos, z_pos, target->GetHeading());
return true;
}
Index: zone/spdat.cpp
===================================================================
--- zone/spdat.cpp (revision 110)
+++ zone/spdat.cpp (working copy)
@@ -637,6 +637,39 @@
return Result;
}
+bool IsShadowStepSpell(int16 spell_id) {
+ if (IsEffectInSpell(spell_id, SE_ShadowStep)){
+ return true;
+ }
+ else {
+ return false;
+ }
+}
+bool IsSuccorSpell(int16 spell_id) {
+ if (IsEffectInSpell(spell_id, SE_Succor)){
+ return true;
+ }
+ else {
+ return false;
+ }
+}
+bool IsTeleportSpell(int16 spell_id) {
+ if (IsEffectInSpell(spell_id, SE_Teleport)){
+ return true;
+ }
+ else {
+ return false;
+ }
+}
+bool IsGateSpell(int16 spell_id) {
+ if (IsEffectInSpell(spell_id, SE_Gate)){
+ return true;
+ }
+ else {
+ return false;
+ }
+}
+
bool IsMagicRuneSpell(int16 spell_id) {
bool Result = false;
Index: zone/spdat.h
===================================================================
--- zone/spdat.h (revision 110)
+++ zone/spdat.h (working copy)
@@ -531,6 +531,10 @@
bool IsResurrectionEffects(int16 spell_id);
bool IsRuneSpell(int16 spell_id);
bool IsMagicRuneSpell(int16 spell_id);
+bool IsShadowStepSpell(int16 spell_id);
+bool IsSuccorSpell(int16 spell_id);
+bool IsTeleportSpell(int16 spell_id);
+bool IsGateSpell(int16 spell_id);
bool IsManaTapSpell(int16 spell_id);
bool IsAllianceSpellLine(int16 spell_id);
bool IsDeathSaveSpell(int16 spell_id);