瀏覽代碼

- Fixed Joint Beat's speed penalty.
- Added a pc_authok check to prevent the case in which somehow another character of the same account manages to log in as well.
- The pc normalize job function will now recognize you as a novice if you don't have NV_BASIC maxed.
- Accessories will now by default go into the rigth-side rather than the left-side of the equip window.
- Added a check in the mob_ai_subhard function to make mobs unlock targets which have their invincible timer set.


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

skotlex 18 年之前
父節點
當前提交
539fe020dc
共有 6 個文件被更改,包括 29 次插入13 次删除
  1. 9 0
      Changelog-Trunk.txt
  2. 1 1
      src/map/battle.c
  3. 2 2
      src/map/clif.c
  4. 2 1
      src/map/mob.c
  5. 13 7
      src/map/pc.c
  6. 2 2
      src/map/status.c

+ 9 - 0
Changelog-Trunk.txt

@@ -4,6 +4,15 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 2007/01/15
+	* Fixed Joint Beat's speed penalty.
+	* Added a pc_authok check to prevent the case in which somehow another
+	  character of the same account manages to log in as well.
+	* The pc normalize job function will now recognize you as a novice if you
+	  don't have NV_BASIC maxed.
+	* Accessories will now by default go into the rigth-side rather than the
+	  left-side of the equip window.
+	* Added a check in the mob_ai_subhard function to make mobs unlock targets
+	  which have their invincible timer set.
 	* Probably fixed the registration flood protection code being broken.
 	* Joint Break should only re-start the bleeding timer when it currently IS
 	  the one that causes bleeding. [Skotlex]

+ 1 - 1
src/map/battle.c

@@ -871,7 +871,7 @@ static struct Damage battle_calc_weapon_attack(
 	if(
 		(sd && sd->state.arrow_atk) ||
 		(!sd && ((skill_num && skill_get_ammotype(skill_num)) || sstatus->rhw.range>3))
-	) {	
+	) {
 		wd.flag=(wd.flag&~BF_RANGEMASK)|BF_LONG;
 		flag.arrow = 1;
 	}

+ 2 - 2
src/map/clif.c

@@ -8211,8 +8211,8 @@ void clif_parse_WantToConnection(int fd, TBL_PC* sd)
 			WFIFOSET(fd,packet_len(0x6a));
 			clif_setwaitclose(fd);
 			return;
-
-		} else if( (old_sd=map_id2sd(account_id)) != NULL ){
+		}
+		if( (old_sd=map_id2sd(account_id)) != NULL ){
 			// if same account already connected, we disconnect the 2 sessions
 			//Check for characters with no connection (includes those that are using autotrade) [durf],[Skotlex]
 			if (old_sd->state.finalsave || !old_sd->state.auth)

+ 2 - 1
src/map/mob.c

@@ -1101,7 +1101,8 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap)
 			(md->ud.walktimer != -1 && !(battle_config.mob_ai&0x1) && !check_distance_bl(&md->bl, tbl, md->min_chase)) ||
 			(
 				tbl->type == BL_PC && !(mode&MD_BOSS) &&
-				((TBL_PC*)tbl)->state.gangsterparadise
+				(((TBL_PC*)tbl)->state.gangsterparadise ||
+				((TBL_PC*)tbl)->invincible_timer != INVALID_TIMER)
 		)) {	//Unlock current target.
 			if (tbl && tbl->m != md->bl.m && battle_config.mob_ai&0x40)
 			{	//Chase to a nearby warp [Skotlex]

+ 13 - 7
src/map/pc.c

@@ -125,7 +125,7 @@ static int pc_invincible_timer(int tid,unsigned int tick,int id,int data) {
 int pc_setinvincibletimer(struct map_session_data *sd,int val) {
 	nullpo_retr(0, sd);
 
-	if(sd->invincible_timer != -1)
+	if(sd->invincible_timer != INVALID_TIMER)
 		delete_timer(sd->invincible_timer,pc_invincible_timer);
 	sd->invincible_timer = add_timer(gettick()+val,pc_invincible_timer,sd->bl.id,0);
 	return 0;
@@ -134,9 +134,9 @@ int pc_setinvincibletimer(struct map_session_data *sd,int val) {
 int pc_delinvincibletimer(struct map_session_data *sd) {
 	nullpo_retr(0, sd);
 
-	if(sd->invincible_timer != -1) {
+	if(sd->invincible_timer != INVALID_TIMER) {
 		delete_timer(sd->invincible_timer,pc_invincible_timer);
-		sd->invincible_timer = -1;
+		sd->invincible_timer = INVALID_TIMER;
 		skill_unit_move(&sd->bl,gettick(),1);
 	}
 	return 0;
@@ -581,6 +581,14 @@ int pc_authok(struct map_session_data *sd, int login_id2, time_t connect_until_t
 		clif_authfail_fd(sd->fd, 0);
 		return 1;
 	}
+
+	if (map_id2sd(st->account_id) != NULL)
+	{	//Somehow a second connection has managed to go through the double-connection
+		//check in clif_parse_WantToConnection! [Skotlex]
+		clif_authfail_fd(sd->fd, 0);
+		return 1;
+	}
+
 	memcpy(&sd->status, st, sizeof(*st));
 
 	//Set the map-server used job id. [Skotlex]
@@ -1037,8 +1045,6 @@ static void pc_check_skilltree(struct map_session_data *sd, int skill) {
 				continue;
 			if (sd->status.job_level < skill_tree[c][i].joblv)
 				continue;
-			else if (pc_checkskill(sd, NV_BASIC) < 9 && id != NV_BASIC && !(skill_get_inf2(id)&INF2_QUEST_SKILL))
-				continue; // Do not unlock normal skills when Basic Skills is not maxed out (can happen because of skill reset)
 			
 			if(skill_get_inf2(id)&INF2_SPIRIT_SKILL)
 				//Spirit skills cannot be learned
@@ -1076,7 +1082,7 @@ int pc_calc_skilltree_normalize_job(struct map_session_data *sd) {
 		return c; //Only Normalize non-first classes (and non-super novice)
 	
 	skill_point = pc_calc_skillpoint(sd);
-	if(skill_point < 9)
+	if(pc_checkskill(sd, NV_BASIC) < 9) //Consider Novice Tree when you dont have NV_BASIC maxed.
 		c = MAPID_NOVICE;
 	else if (sd->status.skill_point >= (int)sd->status.job_level
 		&& ((sd->change_level > 0 && skill_point < sd->change_level+8) || skill_point < 58)) {
@@ -6308,7 +6314,7 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
 	if(pos == EQP_ACC) { //Accesories should only go in one of the two,
 		pos = req_pos&EQP_ACC;
 		if (pos == EQP_ACC) //User specified both slots.. 
-			pos = sd->equip_index[EQI_ACC_L] >= 0 ? EQP_ACC_R : EQP_ACC_L;
+			pos = sd->equip_index[EQI_ACC_R] >= 0 ? EQP_ACC_L : EQP_ACC_R;
 	}
 
 	if(pos == EQP_ARMS && id->equip == EQP_HAND_R)

+ 2 - 2
src/map/status.c

@@ -3676,8 +3676,8 @@ static unsigned short status_calc_speed(struct block_list *bl, struct status_cha
 		speed = speed * 100/sc->data[SC_DEFENDER].val3;
 	if(sc->data[SC_GOSPEL].timer!=-1 && sc->data[SC_GOSPEL].val4 == BCT_ENEMY)
 		speed = speed * 100/75;
-	if(sc->data[SC_JOINTBEAT].timer!=-1) {
-		speed = speed * ( 100
+	if(sc->data[SC_JOINTBEAT].timer!=-1 && sc->data[SC_JOINTBEAT].val2&(BREAK_ANKLE|BREAK_KNEE)) {
+		speed = speed * 100/(100
 			- ( sc->data[SC_JOINTBEAT].val2&BREAK_ANKLE ? 50 : 0 )
 			- ( sc->data[SC_JOINTBEAT].val2&BREAK_KNEE  ? 30 : 0 ));
 	}