Ver código fonte

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6239 54d463be-8e91-2dee-dedb-b68131a5f0ec

shinomori 19 anos atrás
pai
commit
1f3b70b776
5 arquivos alterados com 37 adições e 5 exclusões
  1. 4 1
      Changelog-Trunk.txt
  2. 5 1
      src/map/map.c
  3. 2 0
      src/map/map.h
  4. 18 2
      src/map/mob.c
  5. 8 1
      src/map/npc.c

+ 4 - 1
Changelog-Trunk.txt

@@ -2,7 +2,10 @@ Date	Added
 
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
-
+2006/04/23
+	* additional experience multiplicator as mapflags which is based off battle.conf
+	  so with battle.conf rates 200 and "mapflag <jexp/bexp> 200" it will be 4x 
+	  on this specific map and 2x anywhere else [Jbain]
 2006/04/22
 	* Angelus was giving more bonus than it should. Fixed. [Zido]
 	* Added Option constants for Carts, fixed OPTION_FLYING (it conflicts with

+ 5 - 1
src/map/map.c

@@ -3057,7 +3057,11 @@ int map_readallmaps (void)
 
 				map[i].bxs = (map[i].xs + BLOCK_SIZE - 1) / BLOCK_SIZE;
 				map[i].bys = (map[i].ys + BLOCK_SIZE - 1) / BLOCK_SIZE;
-
+				
+				// default experience multiplicator
+				map[i].jexp = 100;
+				map[i].bexp = 100;
+				
 				size = map[i].bxs * map[i].bys * sizeof(struct block_list*);
 				map[i].block = (struct block_list**)aCalloc(size, 1);
 				map[i].block_mob = (struct block_list**)aCalloc(size, 1);

+ 2 - 0
src/map/map.h

@@ -1067,6 +1067,8 @@ struct map_data {
 	struct spawn_data *moblist[MAX_MOB_LIST_PER_MAP]; // [Wizputer]
 	int mob_delete_timer;	// [Skotlex]
 	int zone;	// [Komurka]
+	int jexp;	// map experience multiplicator
+	int bexp;	// map experience multiplicator
 };
 
 struct map_data_other_server {

+ 18 - 2
src/map/mob.c

@@ -1861,13 +1861,29 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
 		else
 			job_exp = (unsigned int)(job_exp*per);
 	
-		//mapflags: noexp check [Lorky]
+/*		//mapflags: noexp check [Lorky]
 		if (map[md->bl.m].flag.nobaseexp == 1)	base_exp=0; 
 		else if (base_exp < 1) base_exp = 1;
 		
 		if (map[md->bl.m].flag.nojobexp == 1)	job_exp=0; 
 		else if (job_exp < 1) job_exp = 1;
-		
+*/
+		if (map[md->bl.m].flag.nobaseexp == 1)
+			base_exp=0; 
+		else if (base_exp < 1)
+			base_exp = (map[md->bl.m].bexp<=100) ? 1 : map[md->bl.m].bexp/100;
+		else if ( map[md->bl.m].bexp != 100 )
+			base_exp=(int)((double)base_exp*((double)map[md->bl.m].bexp/100.0));
+
+		if (map[md->bl.m].flag.nojobexp == 1)
+			job_exp=0; 
+		else if (job_exp < 1)
+			job_exp = (map[md->bl.m].jexp<=100) ? 1 : map[md->bl.m].jexp/100;
+		else if ( map[md->bl.m].bexp != 100 )
+			job_exp=(int)((double)job_exp*((double)map[md->bl.m].jexp/100.0));
+ 		
+	
+			
 		//end added Lorky 
 		if((pid=tmpsd[i]->status.party_id)>0){	// ƒp�[ƒeƒB‚É“ü‚Á‚Ä‚¢‚é
 			int j;

+ 8 - 1
src/map/npc.c

@@ -2412,7 +2412,14 @@ static int npc_parse_mapflag (char *w1, char *w2, char *w3, char *w4)
 			map[m].zone = 0;
 		}
 	}
-
+	else if (strcmpi(w3,"jexp")==0) {
+		map[m].jexp = (state) ? atoi(w4) : 100;
+		if( map[m].jexp < 0 ) map[m].jexp = 100;
+	}
+	else if (strcmpi(w3,"bexp")==0) {
+		map[m].bexp = (state) ? atoi(w4) : 100;
+		if( map[m].bexp < 0 ) map[m].bexp = 100;
+	}
 	return 0;
 }