소스 검색

- Added the +20hit that were missing the NPC elemental attack skills.
- Added support for autospells using "a random skill level". The last value of bonus4 bAutoSpell is used for determining this as well as the target. &1 is to cast on target (otherwise cast on self), and &2 is to use a random level UP to the level specified in the script (otherwise always cast the specified level)
- Updated item_bonus.txt with the documentation for the bAutoSpell/bAutoSpellWhenHit changes.
- Corrected @refresh not reupdating the basic stat bonuses.


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

skotlex 18 년 전
부모
커밋
4c9c8bb7a3
6개의 변경된 파일42개의 추가작업 그리고 12개의 파일을 삭제
  1. 10 0
      Changelog-Trunk.txt
  2. 7 2
      doc/item_bonus.txt
  3. 10 3
      src/map/battle.c
  4. 6 0
      src/map/clif.c
  5. 2 2
      src/map/pc.c
  6. 7 5
      src/map/skill.c

+ 10 - 0
Changelog-Trunk.txt

@@ -3,6 +3,16 @@ 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.
 
+2007/03/05
+	* Added the +20hit that were missing the NPC elemental attack skills.
+	* Added support for autospells using "a random skill level". The last value
+	  of bonus4 bAutoSpell is used for determining this as well as the target. &1
+	  is to cast on target (otherwise cast on self), and &2 is to use a random
+	  level UP to the level specified in the script (otherwise always cast the
+	  specified level)
+	* Updated item_bonus.txt with the documentation for the
+	  bAutoSpell/bAutoSpellWhenHit changes.
+	* Corrected @refresh not reupdating the basic stat bonuses.
 2007/03/03
 	* Modified a bit the storm gust counter code to see if it fixes storm gusts
 	  sometimes freezing on first hit.

+ 7 - 2
doc/item_bonus.txt

@@ -174,11 +174,16 @@ bonus3 bSPDrainValue,n,x,y;		When attacking there is a n% chance to either
 
 bonus4 bAutoSpell,x,y,n,i;		n/10% chance to cast skill x of level y when
                                         being attacking
-                                        i:0=cast on self  1=cast on enemy
+                                        i: 1=cast on enemy, not on self
+                                           2=use random skill lv in [1..y]
+                                           3=1+2 (random lv on enemy)
 bonus4 bAutoSpellWhenHit,x,y,n,i;	n/10% chance to cast skill x of level y when
                                         being hit by a direct attack. Target
 													 must be within spell's range to go
-													 off. i:0=cast on self  1=cast on enemy
+													 off.
+                                        i: 1=cast on enemy, not on self
+                                           2=use random skill lv in [1..y]
+                                           3=1+2 (random lv on enemy)
 
 //---- 2/22 new card effects ----
 

+ 10 - 3
src/map/battle.c

@@ -1121,14 +1121,21 @@ static struct Damage battle_calc_weapon_attack(
 				hitrate += 10*skill_lv;
 				break;
 			case KN_AUTOCOUNTER:
+			case PA_SHIELDCHAIN:
+			case NPC_WATERATTACK:
+			case NPC_GROUNDATTACK:
+			case NPC_FIREATTACK:
+			case NPC_WINDATTACK:
+			case NPC_POISONATTACK:
+			case NPC_HOLYATTACK:
+			case NPC_DARKNESSATTACK:
+			case NPC_UNDEADATTACK:
+			case NPC_TELEKINESISATTACK:
 				hitrate += 20;
 				break;
 			case KN_PIERCE:
 				hitrate += hitrate*(5*skill_lv)/100;
 				break;
-			case PA_SHIELDCHAIN:
-				hitrate += 20;
-				break;
 			case AS_SONICBLOW:
 				if(sd && pc_checkskill(sd,AS_SONICACCEL)>0)
 					hitrate += 50;

+ 6 - 0
src/map/clif.c

@@ -7566,6 +7566,12 @@ int clif_refresh(struct map_session_data *sd) {
 	}
 	clif_updatestatus(sd,SP_MAXWEIGHT);
 	clif_updatestatus(sd,SP_WEIGHT);
+	clif_updatestatus(sd,SP_STR);
+	clif_updatestatus(sd,SP_AGI);
+	clif_updatestatus(sd,SP_VIT);
+	clif_updatestatus(sd,SP_INT);
+	clif_updatestatus(sd,SP_DEX);
+	clif_updatestatus(sd,SP_LUK);
 	map_foreachinrange(clif_getareachar,&sd->bl,AREA_SIZE,BL_ALL,sd);
 	clif_weather_check(sd);
 	return 0;

+ 2 - 2
src/map/pc.c

@@ -2397,12 +2397,12 @@ int pc_bonus4(struct map_session_data *sd,int type,int type2,int type3,int type4
 	switch(type){
 	case SP_AUTOSPELL:
 		if(sd->state.lr_flag != 2)
-			pc_bonus_autospell(sd->autospell, MAX_PC_BONUS, (val?type2:-type2), type3, type4, current_equip_card_id);
+			pc_bonus_autospell(sd->autospell, MAX_PC_BONUS, (val&1?type2:-type2), (val&2?-type3:type3), type4, current_equip_card_id);
 		break;
 
 	case SP_AUTOSPELL_WHENHIT:
 		if(sd->state.lr_flag != 2)
-			pc_bonus_autospell(sd->autospell2, MAX_PC_BONUS, (val?type2:-type2), type3, type4, current_equip_card_id);
+			pc_bonus_autospell(sd->autospell2, MAX_PC_BONUS, (val&1?type2:-type2), (val&2?-type3:type3), type4, current_equip_card_id);
 		break;
 	default:
 		if(battle_config.error_log)

+ 7 - 5
src/map/skill.c

@@ -1408,7 +1408,9 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
 			if (skillnotok(skill, sd))
 				continue;
 
-			skilllv = (sd->autospell[i].lv > 0) ? sd->autospell[i].lv : 1;
+			skilllv = sd->autospell[i].lv?sd->autospell[i].lv:1;
+			if (skilllv < 0) skilllv = 1+rand()%(-skilllv);
+
 			rate = (!sd->state.arrow_atk) ? sd->autospell[i].rate : sd->autospell[i].rate / 2;
 
 			if (rand()%1000 > rate)
@@ -1569,12 +1571,12 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
 		struct unit_data *ud;
 		int i, skillid, skilllv, rate;
 
-		for (i = 0; i < MAX_PC_BONUS; i++) {
-			if (dstsd->autospell2[i].id == 0)
-				break;
+		for (i = 0; i < MAX_PC_BONUS && dstsd->autospell2[i].id; i++) {
 
 			skillid = (dstsd->autospell2[i].id > 0) ? dstsd->autospell2[i].id : -dstsd->autospell2[i].id;
-			skilllv = (dstsd->autospell2[i].lv > 0) ? dstsd->autospell2[i].lv : 1;
+			skilllv = dstsd->autospell2[i].lv?dstsd->autospell2[i].lv:1;
+			if (skilllv < 0) skilllv = 1+rand()%(-skilllv);
+
 			rate = ((sd && !sd->state.arrow_atk) || (status_get_range(src)<=2)) ?
 				dstsd->autospell2[i].rate : dstsd->autospell2[i].rate / 2;