View Single Post
  #6  
Old 02-25-2015, 07:23 PM
rencro
Hill Giant
 
Join Date: Sep 2008
Location: So. California
Posts: 219
Default

Heres a quick patch to make races have a red nameplate (ala PVP mode). This code was all borrowed from a Xachary fork

url = https://github.com/Xackery/Server.git

I just removed all the pvp stuff out, and made compatible with current source.

Credits Xachary (Shin Noir?) and I believe secrets, sorry if I left any one out

Its set to have Ogres and Iksar carry a red nameplate. But other than their name being red, they are clients like any other( can group ect ect). Of course if you want them to be green instead of red its just a matter of setting the first value of SendAppearancePacket to the gm setting
#define AT_PVP 4 // 0 = blue, 1 = pvp (red)
#define AT_GM 20 // 0 = normal, 1 = GM - all odd numbers seem to make it GM

Very basic stuff. If you wanted this to be acquirable (ie, red/green nameplate via a quest), that needs a different solution.

Code:
diff --git a/zone/client.cpp b/zone/client.cpp
index 93ef853..cd78644 100644
--- a/zone/client.cpp
+++ b/zone/client.cpp
@@ -436,6 +436,9 @@ void Client::SendZoneInPackets()
 	if (GetPVP())	//force a PVP update until we fix the spawn struct
 		SendAppearancePacket(AT_PVP, GetPVP(), true, false);
 
+	if (IsEvil())  //Evil has a red tag
+		SendAppearancePacket(AT_PVP, IsEvil(), true, false); //rencro via xachary
+ 
 	//Send AA Exp packet:
 	if (GetLevel() >= 51)
 		SendAAStats();
diff --git a/zone/entity.cpp b/zone/entity.cpp
index b1b1394..6c96eb0 100644
--- a/zone/entity.cpp
+++ b/zone/entity.cpp
@@ -1175,6 +1175,10 @@ void EntityList::SendZonePVPUpdates(Client *to)
 		Client *c = it->second;
 		if(c->GetPVP())
 			c->SendAppearancePacket(AT_PVP, c->GetPVP(), true, false, to);
+
+		if (c->IsEvil()) //Evil people have red tags rencro via xachary @pvp patch
+			c->SendAppearancePacket(AT_PVP, c->IsEvil(), true, false, to);
+
 		++it;
 	}
 }
diff --git a/zone/mob.cpp b/zone/mob.cpp
index 57d04f3..96e831e 100644
--- a/zone/mob.cpp
+++ b/zone/mob.cpp
@@ -452,6 +452,17 @@ uint32 Mob::GetAppearanceValue(EmuAppearance iAppearance) {
 	return(ANIM_STAND);
 }
 
+
+//Returns whether mob is evil or not (Based on race) rencro via xachary @pvp patch
+bool Mob::IsEvil() 
+{
+	return ( 
+		base_race == OGRE ||
+		base_race == IKSAR 
+		);
+}
+
+
 void Mob::SetInvisible(uint8 state)
 {
 	invisible = state;
diff --git a/zone/mob.h b/zone/mob.h
index fb81487..4e824f5 100644
--- a/zone/mob.h
+++ b/zone/mob.h
@@ -429,6 +429,8 @@ public:
 	//Faction
 	virtual inline int32 GetPrimaryFaction() const { return 0; }
 
+	bool IsEvil(); //rencro via xachary @pvp patch
+
 	//Movement
 	void Warp(const glm::vec3& location);
 	inline bool IsMoving() const { return moving; }
Reply With Quote