View Single Post
  #7  
Old 06-22-2008, 08:25 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

I got the PVP areas figured out correctly. There are PVP areas in the following zones:

Arena, Cabwest, citymist, freportw, Kael, mischiefplane, neriaka, neriakb, paineel, qeynos, sseru, thurgadina

I could't find one in Halas. There is an area called 'The Pit Of Doom' which looks a bit like a mini-arena, but
there is nothing in the S3D file to flag it as such, and I don't get the client message when I go in there.

My ISP is doing maintenance which means my webspace is down at the moment, but when it comes back up I will post
the water maps for the zones above with the PVP areas tagged correctly.

I also wrote a patch for the server to detect the PVP areas (bool WaterMap::InPVPArea) and added some output into
the #bestz command to show whether you were in a PVP area or not, however it still requires someone to modify the
attack code to call InPVPArea to perform the check. (I'll let someone else do that).

Here is the zone patch. I'll post the maps later when my webspace is back up. The modified version of awater to
produce the .wtr maps tagged with PVP areas will come with my modified azone when that is done and tested.

Code:
diff -u --recursive /tmp/EQEmu-0.7.0-1115/zone/command.cpp ./command.cpp
--- /tmp/EQEmu-0.7.0-1115/zone/command.cpp	2008-06-19 13:49:00.000000000 +0100
+++ ./command.cpp	2008-06-22 12:25:18.000000000 +0100
@@ -6455,13 +6455,15 @@
 			RegionType = zone->watermap->BSPReturnRegionType(1,  c->GetTarget()->GetX(), c->GetTarget()->GetY(), z);
 			c->Message(0,"InWater returns %d", zone->watermap->InWater(c->GetTarget()->GetX(), c->GetTarget()->GetY(), z));
 			c->Message(0,"InLava returns %d", zone->watermap->InLava(c->GetTarget()->GetX(), c->GetTarget()->GetY(), z));
+			c->Message(0,"InPVPArea returns %d", zone->watermap->InPVPArea(c->GetTarget()->GetX(), c->GetTarget()->GetY(), z));
 									 
 		}
 		else {
 			z=c->GetZ();
 			RegionType = zone->watermap->BSPReturnRegionType(1, c->GetX(), c->GetY(),z);
 			c->Message(0,"InWater returns %d", zone->watermap->InWater(c->GetX(), c->GetY(), z));
-					c->Message(0,"InLava returns %d", zone->watermap->InLava(c->GetX(), c->GetY(), z));
+			c->Message(0,"InLava returns %d", zone->watermap->InLava(c->GetX(), c->GetY(), z));
+			c->Message(0,"InPVPArea returns %d", zone->watermap->InPVPArea(c->GetX(), c->GetY(), z));
 	
 		}
 	
@@ -6469,6 +6471,10 @@
 			case RegionTypeNormal:	{ c->Message(0,"There is nothing special about the region you are in!"); break; }
 			case RegionTypeWater:	{ c->Message(0,"You/your target are in Water."); break; }
 			case RegionTypeLava:	{ c->Message(0,"You/your target are in Lava."); break; }
+			case RegionTypePVP:	{ c->Message(0,"You/your target are in a PVP area."); break; }
+			case RegionTypeSlime:	{ c->Message(0,"You/your target are in a Slime area."); break; }
+			case RegionTypeIce:	{ c->Message(0,"You/your target are in an Ice area."); break; }
+			case RegionTypeVWater:	{ c->Message(0,"You/your target are in a VWATER area."); break; }
 			default:  c->Message(0,"You/your target are in an unknown region type."); 
 		}
 	}
diff -u --recursive /tmp/EQEmu-0.7.0-1115/zone/watermap.cpp ./watermap.cpp
--- /tmp/EQEmu-0.7.0-1115/zone/watermap.cpp	2008-01-14 02:42:37.000000000 +0000
+++ ./watermap.cpp	2008-06-22 12:22:12.000000000 +0100
@@ -99,6 +99,12 @@
 	return(BSPReturnRegionType(1, y, x, z) == RegionTypeLava);
 }
 
+bool WaterMap::InPVPArea(float y, float x, float z) const {
+	if(BSP_Root == NULL) {
+		return false;
+	}
+	return(BSPReturnRegionType(1, y, x, z) == RegionTypePVP);
+}
 
 WaterMap* WaterMap::LoadWaterMapfile(const char* in_zonename, const char *directory) {
 	FILE *fp;
diff -u --recursive /tmp/EQEmu-0.7.0-1115/zone/watermap.h ./watermap.h
--- /tmp/EQEmu-0.7.0-1115/zone/watermap.h	2008-01-14 02:42:37.000000000 +0000
+++ ./watermap.h	2008-06-22 12:21:19.000000000 +0100
@@ -30,15 +30,21 @@
 } ZBSP_Node;
 #pragma pack()
 
+
 typedef enum {
 	RegionTypeUnsupported = -2,
 	RegionTypeUntagged = -1,
         RegionTypeNormal = 0,
         RegionTypeWater = 1,
         RegionTypeLava = 2,
-	RegionTypeZoneLine = 3
+	RegionTypeZoneLine = 3,
+	RegionTypePVP = 4,
+	RegionTypeSlime  = 5,
+	RegionTypeIce = 6,
+	RegionTypeVWater =7 
 } WaterRegionType;
 
+
 class WaterMap {
 
 public:
@@ -46,6 +52,7 @@
         WaterRegionType BSPReturnRegionType(long node_number, float y, float x, float z) const;
         bool InWater(float y, float x, float z) const;
         bool InLava(float y, float x, float z) const;
+        bool InPVPArea(float y, float x, float z) const;
 
 	WaterMap();
 	~WaterMap();
Reply With Quote