View Single Post
  #6  
Old 09-05-2004, 06:58 PM
monalin crusader
Hill Giant
 
Join Date: May 2004
Posts: 238
Default

Ok now if u dont want red titles do this, Forget about branks code (no offence i just dont use it since mine is a complete different way of doing it)

goto mob.cpp
search for // if they're dueling they can go at it

*EDIT** This is the one around line 2129 there are 2 places in this code where its got it make sure to get the right one or it will not work.

go a couple lines down and after

Code:
				else if	// if they're dueling they can go at it
				(
					c1->IsDueling() &&
					c2->IsDueling() &&
					c1->GetDuelTarget() == c2->GetID() &&
					c2->GetDuelTarget() == c1->GetID()
				)
					return true;
insert in this

Code:
		// Monalin: PvP in certian zones only replace zone ID's with zones you want
				else if ((zone->GetZoneID() == 21) || (zone->GetZoneID() == 6))
				{
					int c1_level = c1->GetLevel(); // Level of client 1
					int c2_level = c2->GetLevel(); // Level of client 2

					// If they are within 4 levels of each other fight.
					if(((c1_level + 4) >= c2_level) && ((c2_level + 4) >= c1_level))
						return true;
					else 
						return false;
				}
Insert in whatever zoneid's ou like u can have as many as you like also, if u want to change the level ranges u can attack in.

Alternate code
if u would like to use it instead it hasent been tested but its a little easier to change the level range u can attack in i dont care what you use.

Code:
					// Monalin: PvP in certian zones only replace zone ID's with zones you want
				else if ((zone->GetZoneID() == 21) || (zone->GetZoneID() == 6))
				{
					int c1_level = c1->GetLevel(); // Level of client 1
					int c2_level = c2->GetLevel(); // Level of client 2
					unsigned int level_diff;

					level_diff = c1_level - c2_level;

					// If they are within 4 levels of each other fight.
					if(level_diff > 4)
						return true;
					else 
						return false;
				}
__________________
Ascending Dawn Server Op
Coder/Quester/Mysql
Reply With Quote