浏览代码

* Added HP and SP rate underflow checking
* Added stop auto attacking if no arrows were equipped

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

celest 20 年之前
父节点
当前提交
39020d9e76
共有 3 个文件被更改,包括 11 次插入0 次删除
  1. 2 0
      Changelog-SVN.txt
  2. 5 0
      src/map/pc.c
  3. 4 0
      src/map/status.c

+ 2 - 0
Changelog-SVN.txt

@@ -1,6 +1,8 @@
 Date	Added
 
 03/09
+        * Added HP and SP rate underflow checking [celest]
+        * Added stop auto attacking if no arrows were equipped [celest]
 	* Added new script command: 'cardscnt'. It returns N of inserted cards in the same weapon. [Lupus]
 	  Now I can start fixing CARDS COMBO exploits. And it's possible to fix old cards power abuse, too.
 		e.g. Assassins can equip 2 4-slot weapons and have HUGE card bonuses.

+ 5 - 0
src/map/pc.c

@@ -3694,6 +3694,11 @@ int pc_attack_timer(int tid,unsigned int tick,int id,int data)
 		}
 	}
 
+	if(sd->status.weapon == 11 && sd->equip_index[10] < 0) {
+		clif_arrow_fail(sd,0);
+		return 0;
+	}
+
 	dist = distance(sd->bl.x,sd->bl.y,bl->x,bl->y);
 	range = sd->attackrange;
 	if(sd->status.weapon != 11) range++;

+ 4 - 0
src/map/status.c

@@ -943,6 +943,8 @@ int status_calc_pc(struct map_session_data* sd,int first)
 		else if (s_class.upper==2)
 			sd->status.max_hp = sd->status.max_hp * 70/100;
 
+	if (sd->hprate <= 0)
+		sd->hprate = 1;
 	if(sd->hprate!=100)
 		sd->status.max_hp = sd->status.max_hp*sd->hprate/100;
 
@@ -968,6 +970,8 @@ int status_calc_pc(struct map_session_data* sd,int first)
 			sd->status.max_sp = sd->status.max_sp * 130/100;
 		else if (s_class.upper==2)
 			sd->status.max_sp = sd->status.max_sp * 70/100;
+	if (sd->sprate <= 0)
+		sd->sprate = 1;
 	if(sd->sprate!=100)
 		sd->status.max_sp = sd->status.max_sp*sd->sprate/100;