summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt10
-rw-r--r--doc/item_bonus.txt9
-rw-r--r--src/map/battle.c13
-rw-r--r--src/map/clif.c6
-rw-r--r--src/map/pc.c4
-rw-r--r--src/map/skill.c12
6 files changed, 42 insertions, 12 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index b4cd04888..fb7550a4c 100644
--- a/Changelog-Trunk.txt
+++ b/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.
diff --git a/doc/item_bonus.txt b/doc/item_bonus.txt
index bf92b4487..06b105f4a 100644
--- a/doc/item_bonus.txt
+++ b/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 ----
diff --git a/src/map/battle.c b/src/map/battle.c
index ef43ed39a..12438ea62 100644
--- a/src/map/battle.c
+++ b/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;
diff --git a/src/map/clif.c b/src/map/clif.c
index 85f7cdd58..32152dfc1 100644
--- a/src/map/clif.c
+++ b/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;
diff --git a/src/map/pc.c b/src/map/pc.c
index 5f16e01c0..de5977bcf 100644
--- a/src/map/pc.c
+++ b/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)
diff --git a/src/map/skill.c b/src/map/skill.c
index 1b06c355a..8e792f604 100644
--- a/src/map/skill.c
+++ b/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;