summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-04-06 11:55:55 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-04-06 11:55:55 +0000
commit39d776311e6cda0692503f599ce997a77dbe700d (patch)
tree23a1f8e7a5687ddb87d397ddef68ad041bbc3831 /src
parentb1a8b920af2b39f546cd3408af893741fc94e12b (diff)
downloadhercules-39d776311e6cda0692503f599ce997a77dbe700d.tar.gz
hercules-39d776311e6cda0692503f599ce997a77dbe700d.tar.bz2
hercules-39d776311e6cda0692503f599ce997a77dbe700d.tar.xz
hercules-39d776311e6cda0692503f599ce997a77dbe700d.zip
* Fixed a crash in clif_send when checking packet version
* Fixed a crash in Deluge, Volcano and Violent Gale * Allow super novices to rent carts from the Kafra git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1420 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c18
-rw-r--r--src/map/clif.c2
-rw-r--r--src/map/pc.c12
-rw-r--r--src/map/skill.c3
-rw-r--r--src/map/skill.h3
-rw-r--r--src/map/status.c10
6 files changed, 27 insertions, 21 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index b7e0320e8..077e5fc9b 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -289,23 +289,29 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i
//属性場のダメージ増加
if(sc_data[SC_VOLCANO].timer!=-1){ // ボルケーノ
if(flag&BF_SKILL && skill_get_pl(skill_num)==3)
- damage += damage*sc_data[SC_VOLCANO].val4/100;
+ //damage += damage*sc_data[SC_VOLCANO].val4/100;
+ damage += damage * enchant_eff[sc_data[SC_VOLCANO].val1-1] /100;
else if(!flag&BF_SKILL && status_get_attack_element(bl)==3)
- damage += damage*sc_data[SC_VOLCANO].val4/100;
+ //damage += damage*sc_data[SC_VOLCANO].val4/100;
+ damage += damage * enchant_eff[sc_data[SC_VOLCANO].val1-1] /100;
}
if(sc_data[SC_VIOLENTGALE].timer!=-1){ // バイオレントゲイル
if(flag&BF_SKILL && skill_get_pl(skill_num)==4)
- damage += damage*sc_data[SC_VIOLENTGALE].val4/100;
+ //damage += damage*sc_data[SC_VIOLENTGALE].val4/100;
+ damage += damage * enchant_eff[sc_data[SC_VIOLENTGALE].val1-1] /100;
else if(!flag&BF_SKILL && status_get_attack_element(bl)==4)
- damage += damage*sc_data[SC_VIOLENTGALE].val4/100;
+ //damage += damage*sc_data[SC_VIOLENTGALE].val4/100;
+ damage += damage * enchant_eff[sc_data[SC_VIOLENTGALE].val1-1] /100;
}
if(sc_data[SC_DELUGE].timer!=-1){ // デリュージ
if(flag&BF_SKILL && skill_get_pl(skill_num)==1)
- damage += damage*sc_data[SC_DELUGE].val4/100;
+ //damage += damage*sc_data[SC_DELUGE].val4/100;
+ damage += damage * enchant_eff[sc_data[SC_DELUGE].val1-1] /100;
else if(!flag&BF_SKILL && status_get_attack_element(bl)==1)
- damage += damage*sc_data[SC_DELUGE].val4/100;
+ //damage += damage*sc_data[SC_DELUGE].val4/100;
+ damage += damage * enchant_eff[sc_data[SC_DELUGE].val1-1] /100;
}
if(sc_data[SC_ENERGYCOAT].timer!=-1 && damage>0 && flag&BF_WEAPON){ // エナジーコート
diff --git a/src/map/clif.c b/src/map/clif.c
index d3536b1c6..50031a44f 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -442,6 +442,8 @@ int clif_send(unsigned char *buf, int len, struct block_list *bl, int type) {
if ((sd = g->member[i].sd) != NULL) {
if (type == GUILD_WOS && sd->bl.id == bl->id)
continue;
+ if (sd->packet_ver > MAX_PACKET_VER)
+ continue;
if (packet_db[sd->packet_ver][RBUFW(buf,0)].len) { // packet must exist for the client version
memcpy(WFIFOP(sd->fd,0), buf, len);
WFIFOSET(sd->fd,len);
diff --git a/src/map/pc.c b/src/map/pc.c
index 12441cff0..e0c13012d 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -673,7 +673,7 @@ int pc_authok(int id, int login_id2, time_t connect_until_time, struct mmo_chars
sd->skillitem = -1;
sd->skillitemlv = -1;
sd->invincible_timer = -1;
-
+
sd->deal_locked = 0;
sd->trade_partner = 0;
@@ -687,9 +687,8 @@ int pc_authok(int id, int login_id2, time_t connect_until_time, struct mmo_chars
sd->canmove_tick = tick;
sd->canregen_tick = tick;
sd->attackabletime = tick;
-
+ sd->reg_num = 0;
sd->doridori_counter = 0;
-
sd->change_level = pc_readglobalreg(sd,"jobchange_level");
#ifndef TXT_ONLY // mail system [Valaris]
@@ -5602,13 +5601,6 @@ int pc_setreg(struct map_session_data *sd,int reg,int val)
}
sd->reg_num++;
sd->reg = (struct script_reg *) aRealloc(sd->reg, sizeof(*(sd->reg)) * sd->reg_num);
- if (sd->reg == NULL){
- printf("out of memory : pc_setreg\n");
- exit(1);
- }
-/* memset(sd->reg + (sd->reg_num - 1) * sizeof(*(sd->reg)), 0,
- sizeof(*(sd->reg)));
-*/
sd->reg[i].index = reg;
sd->reg[i].data = val;
diff --git a/src/map/skill.c b/src/map/skill.c
index 48f7a2595..1111ed293 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -586,6 +586,9 @@ struct skill_unit_group_tickset *skill_unitgrouptickset_search(struct block_list
int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int tick);
int skill_unit_effect(struct block_list *bl,va_list ap);
+int enchant_eff[5] = { 10, 14, 17, 19, 20 };
+int deluge_eff[5] = { 5, 9, 12, 14, 15 };
+
// [MouseJstr] - skill ok to cast? and when?
int skillnotok(int skillid, struct map_session_data *sd)
{
diff --git a/src/map/skill.h b/src/map/skill.h
index 736afa8f8..67d7a906c 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -82,6 +82,9 @@ struct skill_abra_db {
};
extern struct skill_abra_db skill_abra_db[MAX_SKILL_ABRA_DB];
+extern int enchant_eff[5];
+extern int deluge_eff[5];
+
struct block_list;
struct map_session_data;
struct skill_unit;
diff --git a/src/map/status.c b/src/map/status.c
index 3b910c004..c5100d8bb 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1215,7 +1215,7 @@ int status_calc_pc(struct map_session_data* sd,int first)
sd->status.max_hp = battle_config.max_hp;
}
if(sd->sc_data[SC_DELUGE].timer!=-1 && sd->def_ele==1){ // デリュ?ジ
- sd->status.max_hp += sd->status.max_hp*sd->sc_data[SC_DELUGE].val3/100;
+ sd->status.max_hp += sd->status.max_hp * deluge_eff[sd->sc_data[SC_DELUGE].val1-1]/100;
if(sd->status.max_hp < 0 || sd->status.max_hp > battle_config.max_hp)
sd->status.max_hp = battle_config.max_hp;
}
@@ -3335,19 +3335,19 @@ int status_change_start(struct block_list *bl,int type,int val1,int val2,int val
case SC_VOLCANO:
calc_flag = 1;
val3 = val1*10;
- val4 = val1>=5?20: (val1==4?19: (val1==3?17: ( val1==2?14:10 ) ) );
+ //val4 = val1>=5?20: (val1==4?19: (val1==3?17: ( val1==2?14:10 ) ) );
break;
case SC_DELUGE:
calc_flag = 1;
- val3 = val1>=5?15: (val1==4?14: (val1==3?12: ( val1==2?9:5 ) ) );
- val4 = val1>=5?20: (val1==4?19: (val1==3?17: ( val1==2?14:10 ) ) );
+ //val3 = val1>=5?15: (val1==4?14: (val1==3?12: ( val1==2?9:5 ) ) );
+ //val4 = val1>=5?20: (val1==4?19: (val1==3?17: ( val1==2?14:10 ) ) );
if (sc_data[SC_FOGWALL].timer != -1 && sc_data[SC_BLIND].timer != -1)
status_change_end(bl,SC_BLIND,-1);
break;
case SC_VIOLENTGALE:
calc_flag = 1;
val3 = val1*3;
- val4 = val1>=5?20: (val1==4?19: (val1==3?17: ( val1==2?14:10 ) ) );
+ //val4 = val1>=5?20: (val1==4?19: (val1==3?17: ( val1==2?14:10 ) ) );
break;
case SC_SPEARSQUICKEN: /* スピアクイッケン */