summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-02 17:06:40 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-02 17:06:40 +0000
commit6d695639b4e40a5739f5d8fa45b48a54a8523431 (patch)
treefc6e589b58698e61f7f61e3c02b76dc9b22bd72f /src/map
parent0073a0c0267b57250645bf3e0ed5a7ac4aa7463b (diff)
downloadhercules-6d695639b4e40a5739f5d8fa45b48a54a8523431.tar.gz
hercules-6d695639b4e40a5739f5d8fa45b48a54a8523431.tar.bz2
hercules-6d695639b4e40a5739f5d8fa45b48a54a8523431.tar.xz
hercules-6d695639b4e40a5739f5d8fa45b48a54a8523431.zip
- Modified Weapon Refine - should only +1 every time.
- Updated Berserk, Chase Walk, Slim Pitcher - Added skill_range_leniency * Added check for clif.c in case the server didn't realise we've died git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@433 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.c11
-rw-r--r--src/map/battle.h1
-rw-r--r--src/map/clif.c3
-rw-r--r--src/map/pc.c48
-rw-r--r--src/map/skill.c18
5 files changed, 42 insertions, 39 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 6ff2697b4..9a11ab892 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -4955,8 +4955,12 @@ int battle_check_range(struct block_list *src,struct block_list *bl,int range)
if(src->m != bl->m) // 違うマップ
return 0;
- if( range>0 && range < arange ) // 遠すぎる
+ if( range>0 && range < arange ) {// 遠すぎる
+// be lenient if the skill was cast before we have moved to the correct position [Celest]
+ if (src->type == BL_PC && ((struct map_session_data *)bl)->walktimer != -1 &&
+ !((arange-=battle_config.skill_range_leniency)<=range))
return 0;
+ }
if( arange<2 ) // 同じマスか隣接
return 1;
@@ -5208,6 +5212,7 @@ static const struct {
{ "skill_steal_type", &battle_config.skill_steal_type}, // [celest]
{ "skill_steal_rate", &battle_config.skill_steal_rate}, // [celest]
{ "night_darkness_level", &battle_config.night_darkness_level}, // [celest]
+ { "skill_range_leniency", &battle_config.skill_range_leniency}, // [celest]
//SQL-only options start
#ifndef TXT_ONLY
@@ -5437,6 +5442,7 @@ void battle_set_defaults() {
battle_config.skill_steal_type = 1;
battle_config.skill_steal_rate = 100;
battle_config.night_darkness_level = 9;
+ battle_config.skill_range_leniency = 1;
battle_config.castrate_dex_scale = 150;
@@ -5560,6 +5566,9 @@ void battle_validate_conf() {
if (battle_config.night_darkness_level > 10) // Celest
battle_config.night_darkness_level = 10;
+ if (battle_config.skill_range_leniency <= 0) // Celest
+ battle_config.skill_range_leniency = 0;
+
if (battle_config.vending_max_value > 10000000 || battle_config.vending_max_value<=0) // Lupus & Kobra_k88
battle_config.vending_max_value = 10000000;
diff --git a/src/map/battle.h b/src/map/battle.h
index f6f0345ca..b0f6c523d 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -340,6 +340,7 @@ extern struct Battle_Config {
int skill_steal_type; // [celest]
int skill_steal_rate; // [celest]
int night_darkness_level; // [celest]
+ int skill_range_leniency; // [celest]
#ifndef TXT_ONLY /* SQL-only options */
int mail_system; // [Valaris]
diff --git a/src/map/clif.c b/src/map/clif.c
index 50de1e108..34ee7aaea 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -7947,6 +7947,9 @@ void clif_parse_Restart(int fd, struct map_session_data *sd) {
pc_setrestartvalue(sd, 3);
pc_setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, 2);
}
+ // in case the player's status somehow wasn't updated yet [Celest]
+ else if (sd->status.hp <= 0)
+ pc_setdead(sd);
break;
case 0x01:
if(!pc_isdead(sd) && (sd->opt1 || (sd->opt2 && !(night_flag == 1 && sd->opt2 == STATE_BLIND))))
diff --git a/src/map/pc.c b/src/map/pc.c
index 118104b9d..c047b5745 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1,4 +1,4 @@
-// $Id: pc.c 101 2004-11-30 8:27:10 PM Celestia $
+// $Id: pc.c 101 2004-12-2 12:58:29 AM Celestia $
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -1501,12 +1501,12 @@ int pc_calcstatus(struct map_session_data* sd,int first)
if(sd->sc_data[SC_CLOAKING].timer!=-1) {
sd->critical_rate += 100; // critical increases
sd->speed = sd->speed * (sd->sc_data[SC_CLOAKING].val3-sd->sc_data[SC_CLOAKING].val1*3) /100;
- // Ours is accurate enough - refer skill_check_cloaking. ^^
- //sd->speed = (sd->speed*(76+(sd->sc_data[SC_CLOAKING].val1*3)))/100; // Fixed by MiKa & Asa [Lupus]
}
- //sd->speed = (sd->speed*(76+(sd->sc_data[SC_INCREASEAGI].val1*3)))/100;
- if(sd->sc_data[SC_CHASEWALK].timer!=-1)
+ if(sd->sc_data[SC_CHASEWALK].timer!=-1) {
sd->speed = sd->speed * sd->sc_data[SC_CHASEWALK].val3 /100; // slow down by chasewalk
+ if(sd->sc_data[SC_CHASEWALK].val4)
+ sd->paramb[0] += (1<<(sd->sc_data[SC_CHASEWALK].val1-1)); // increases strength after 10 seconds
+ }
if(sd->sc_data[SC_BLESSING].timer!=-1){ // ブレッシング
sd->paramb[0]+= sd->sc_data[SC_BLESSING].val1;
sd->paramb[3]+= sd->sc_data[SC_BLESSING].val1;
@@ -3501,7 +3501,7 @@ int pc_item_repair(struct map_session_data *sd,int idx)
*/
int pc_item_refine(struct map_session_data *sd,int idx)
{
- int flag = 1, i = 0, count = 0, ep = 0, per, refine;
+ int flag = 1, i = 0, ep = 0, per;
int material[5] = { 0, 1010, 1011, 984, 984 };
struct item *item;
@@ -3511,38 +3511,23 @@ int pc_item_refine(struct map_session_data *sd,int idx)
if(idx >= 0 && idx < MAX_INVENTORY) {
if(item->nameid > 0 && itemdb_type(item->nameid)==4) {
// if it's no longer refineable
- if (item->refine == 10) {
+ if (item->refine >= sd->skilllv || item->refine == 10) {
clif_skill_fail(sd,sd->skillid,0,0);
return 0;
}
- refine = item->refine + sd->skilllv > 10
- ? 10 - item->refine : sd->skilllv;
- for (i=0; i < MAX_INVENTORY; i++)
- if(sd->status.inventory[i].nameid == material [itemdb_wlv (item->nameid)])
- count += sd->status.inventory[i].amount;
- if (count < refine ) {
+ if ((i=pc_search_inventory(sd, material [itemdb_wlv (item->nameid)])) < 0 ) { //fixed by Lupus (item pos can be = 0!)
clif_skill_fail(sd,sd->skillid,0,0);
return 0;
}
- per = percentrefinery [itemdb_wlv (item->nameid)][item->refine + refine - 1];
+
+ per = percentrefinery [itemdb_wlv (item->nameid)][(int)item->refine];
//per += pc_checkskill(sd,BS_WEAPONRESEARCH);
per *= (75 + sd->status.job_level/2)/100;
if (per > rand() % 100) {
flag = 0;
- item->refine += refine;
-
- for (i=0; i < MAX_INVENTORY; i++)
- if(sd->status.inventory[i].nameid == material [itemdb_wlv (item->nameid)]) {
- if (sd->status.inventory[i].amount >= refine) {
- pc_delitem(sd,i,refine,0);
- break;
- } else {
- refine -= sd->status.inventory[i].amount;
- pc_delitem(sd,i,sd->status.inventory[i].amount,0);
- }
- }
-
+ item->refine++;
+ pc_delitem(sd, i, 1, 0);
if(item->equip) {
ep = item->equip;
pc_unequipitem(sd,idx,0, BF_NORMAL);
@@ -3555,7 +3540,7 @@ int pc_item_refine(struct map_session_data *sd,int idx)
clif_misceffect(&sd->bl,3);
}
else {
- clif_delitem(sd,i,refine);
+ pc_delitem(sd, i, 1, 0);
item->refine = 0;
if(item->equip)
pc_unequipitem(sd,idx,0, BF_NORMAL);
@@ -4006,9 +3991,7 @@ static int pc_walk(int tid,unsigned int tick,int id,int data)
int moveblock;
int x,y,dx,dy;
- sd=map_id2sd(id);
- if(sd==NULL)
- return 0;
+ nullpo_retr(0, (sd=map_id2sd(id)));
if(sd->walktimer != tid){
if(battle_config.error_log)
@@ -4026,6 +4009,7 @@ static int pc_walk(int tid,unsigned int tick,int id,int data)
sd->walkpath.path_half ^= 1;
if(sd->walkpath.path_half==0){ // マス目中心へ到着
sd->walkpath.path_pos++;
+
if(sd->state.change_walk_target){
pc_walktoxy_sub(sd);
return 0;
@@ -7194,7 +7178,7 @@ static int pc_natural_heal_hp(struct map_session_data *sd)
return 0;
- if(sd->sc_count && sd->sc_data[SC_APPLEIDUN].timer!=-1) { // Apple of Idun
+ if(sd->sc_count && sd->sc_data[SC_APPLEIDUN].timer!=-1 && sd->sc_data[SC_BERSERK].timer==-1) { // Apple of Idun
if(sd->inchealhptick >= 6000 && sd->status.hp < sd->status.max_hp) {
bonus = skill*20;
while(sd->inchealhptick >= 6000) {
diff --git a/src/map/skill.c b/src/map/skill.c
index 4830ba6c7..5be308425 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1,4 +1,4 @@
-// $Id: skill.c,v 1.8 2004/12/1 11:59:43 PM Celestia Exp $
+// $Id: skill.c,v 1.8 2004/12/2 12:58:19 AM Celestia Exp $
/* スキル?係 */
#include <stdio.h>
@@ -4522,7 +4522,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
case CR_SLIMPITCHER:
{
if (sd && flag&1) {
- int hp = sd->potion_hp * (100 + pc_checkskill(sd,CR_SLIMPITCHER)*5 + pc_checkskill(sd,AM_POTIONPITCHER)*10 + pc_checkskill(sd,AM_LEARNINGPOTION)*5)/100;
+ int hp = sd->potion_hp * (100 + pc_checkskill(sd,CR_SLIMPITCHER)*10 + pc_checkskill(sd,AM_POTIONPITCHER)*10 + pc_checkskill(sd,AM_LEARNINGPOTION)*5)/100;
hp = hp * (100 + (battle_get_vit(bl)<<1))/100;
if (dstsd)
hp = hp * (100 + pc_checkskill(dstsd,SM_RECOVERY)*10)/100;
@@ -7816,7 +7816,7 @@ int skill_castcancel(struct block_list *bl,int type)
}
sd->skilltimer=-1;
clif_skillcastcancel(bl);
- }
+ }
return 0;
}else if(bl->type==BL_MOB){
@@ -8775,11 +8775,17 @@ int skill_status_change_timer(int tid, unsigned int tick, int id, int data)
case SC_CHASEWALK:
if(sd){
- if( sd->status.sp > 19+sc_data[SC_CHASEWALK].val1*3){
- sd->status.sp-=(19+(sc_data[SC_CHASEWALK].val1*3)); // update sp cost [Celest]
+ int sp = 10+sc_data[SC_CHASEWALK].val1*2;
+ if (map[sd->bl.m].flag.gvg) sp *= 5;
+ if( sd->status.sp > sp){
+ sd->status.sp -= sp; // update sp cost [Celest]
clif_updatestatus(sd,SP_SP);
sc_data[type].timer=add_timer( /* タイマ?再設定 */
- sc_data[type].val2+tick, skill_status_change_timer, bl->id, data);
+ sc_data[type].val2+tick, skill_status_change_timer, bl->id, data);
+ sc_data[SC_CHASEWALK].val4++;
+ if (sc_data[SC_CHASEWALK].val4 > 3)
+ sc_data[SC_CHASEWALK].val4 = 0;
+ pc_calcstatus (sd, 0);
return 0;
}
}