diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-03-07 04:15:39 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-03-07 04:15:39 +0000 |
commit | 2fd138bcf99d5dae36069b715363029f07a5e057 (patch) | |
tree | 9eb5b6de5b7effa979c2fd8d43fd04f4532358a9 /src | |
parent | 7b72dcdc54c991a85565edb14e86e16a6b1fbda7 (diff) | |
download | hercules-2fd138bcf99d5dae36069b715363029f07a5e057.tar.gz hercules-2fd138bcf99d5dae36069b715363029f07a5e057.tar.bz2 hercules-2fd138bcf99d5dae36069b715363029f07a5e057.tar.xz hercules-2fd138bcf99d5dae36069b715363029f07a5e057.zip |
- Some corrections due to the guild skill position change.
- Removed file todo-for-stable as it's impossible to keep it updated :X
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5479 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/map/battle.c | 2 | ||||
-rw-r--r-- | src/map/map.h | 3 | ||||
-rw-r--r-- | src/map/mob.c | 2 | ||||
-rw-r--r-- | src/map/script.c | 51 | ||||
-rw-r--r-- | src/map/skill.c | 57 | ||||
-rw-r--r-- | src/map/status.c | 3 |
6 files changed, 58 insertions, 60 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index e2391a2f9..a215f3af9 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -1343,7 +1343,7 @@ static struct Damage battle_calc_weapon_attack( } else { //Check for Perfect Hit
if(sd && sd->perfect_hit > 0 && rand()%100 < sd->perfect_hit)
flag.hit = 1;
- if (sc && sc->count && sc->data[SC_FUSION].timer != -1) {
+ if (sc && sc->data[SC_FUSION].timer != -1) {
flag.hit = 1; //SG_FUSION always hit [Komurka]
flag.idef = flag.idef2 = 1; //def ignore [Komurka]
}
diff --git a/src/map/map.h b/src/map/map.h index 7dba6ac6e..14eca4ca5 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -350,7 +350,6 @@ struct weapon_data { short sp_drain_rate;
short sp_drain_per;
short sp_drain_value;
-
short add_damage_classid[MAX_PC_BONUS];
int add_damage_classrate[MAX_PC_BONUS];
int add_damage_class_count;
@@ -514,7 +513,6 @@ struct map_session_data { int skilltarget;
short skillx,skilly;
short skillid,skilllv;
-
short skillitem,skillitemlv;
short skillid_old,skilllv_old;
short skillid_dance,skilllv_dance;
@@ -1230,7 +1228,6 @@ int map_delblock_sub(struct block_list *, int); #define map_addblock(bl) map_addblock_sub(bl,1)
#define map_delblock(bl) map_delblock_sub(bl,1)
int map_moveblock(struct block_list *, int, int, unsigned int);
-
int map_foreachinrange(int (*)(struct block_list*,va_list),struct block_list *,int,int,...);
int map_foreachinarea(int (*)(struct block_list*,va_list),int,int,int,int,int,int,...);
// -- moonsoul (added map_foreachincell)
diff --git a/src/map/mob.c b/src/map/mob.c index 700b00e7f..183e063ff 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -3061,7 +3061,7 @@ int mob_warp(struct mob_data *md,int m,int x,int y,int type) status_change_end(&md->bl, SC_TRICKDEAD, -1);
if(md->sc.data[SC_BLADESTOP].timer!=-1)
status_change_end(&md->bl,SC_BLADESTOP,-1);
- if(md->sc.data && md->sc.data[SC_RUN].timer!=-1)
+ if(md->sc.data[SC_RUN].timer!=-1)
status_change_end(&md->bl,SC_RUN,-1);
if(md->sc.data[SC_DANCING].timer!=-1)
skill_stop_dancing(&md->bl);
diff --git a/src/map/script.c b/src/map/script.c index b0bc77171..b615a935c 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -4370,33 +4370,30 @@ int buildin_strcharinfo(struct script_state *st) return 0;
}
num=conv_num(st,& (st->stack->stack_data[st->start+2]));
- if(sd){
- switch(num){
- case 0:
- buf=(char *)aCallocA(NAME_LENGTH,sizeof(char));
- memcpy(buf, sd->status.name, NAME_LENGTH-1);
+ switch(num){
+ case 0:
+ buf=(char *)aCallocA(NAME_LENGTH,sizeof(char));
+ memcpy(buf, sd->status.name, NAME_LENGTH-1);
+ push_str(st->stack,C_STR,(unsigned char *) buf);
+ break;
+ case 1:
+ buf=buildin_getpartyname_sub(sd->status.party_id);
+ if(buf!=0)
push_str(st->stack,C_STR,(unsigned char *) buf);
- break;
- case 1:
- buf=buildin_getpartyname_sub(sd->status.party_id);
- if(buf!=0)
- push_str(st->stack,C_STR,(unsigned char *) buf);
- else
- push_str(st->stack,C_CONSTSTR,(unsigned char *) "");
- break;
- case 2:
- buf=buildin_getguildname_sub(sd->status.guild_id);
- if(buf != NULL)
- push_str(st->stack,C_STR,(unsigned char *) buf);
- else
- push_str(st->stack,C_CONSTSTR,(unsigned char *) "");
- break;
- default:
- ShowWarning("buildin_strcharinfo: unknown parameter.");
- break;
- }
- } else {
- push_str(st->stack,C_CONSTSTR,(unsigned char *) "");
+ else
+ push_str(st->stack,C_CONSTSTR,(unsigned char *) "");
+ break;
+ case 2:
+ buf=buildin_getguildname_sub(sd->status.guild_id);
+ if(buf != NULL)
+ push_str(st->stack,C_STR,(unsigned char *) buf);
+ else
+ push_str(st->stack,C_CONSTSTR,(unsigned char *) "");
+ break;
+ default:
+ ShowWarning("buildin_strcharinfo: unknown parameter.");
+ push_str(st->stack,C_CONSTSTR,(unsigned char *) "");
+ break;
}
return 0;
@@ -9058,7 +9055,7 @@ int buildin_summon(struct script_state *st) md->master_id=sd->bl.id;
md->special_state.ai=1;
md->mode=mob_db(md->class_)->mode|0x04;
- md->deletetimer=add_timer(tick+(timeout<=0?timeout*1000:60000),mob_timer_delete,id,0);
+ md->deletetimer=add_timer(tick+(timeout>0?timeout*1000:60000),mob_timer_delete,id,0);
clif_misceffect2(&md->bl,344);
}
clif_skill_poseffect(&sd->bl,AM_CALLHOMUN,1,sd->bl.x,sd->bl.y,tick);
diff --git a/src/map/skill.c b/src/map/skill.c index 9061078b8..38c54dd79 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -597,6 +597,12 @@ int skill_get_range( int id , int lv ){ skill_get(skill_db[id].range[lv-1], id, int skill_get_splash( int id , int lv ){ skill_chk (id, lv); return (skill_db[id].splash[lv-1]>=0?skill_db[id].splash[lv-1]:AREA_SIZE); }
int skill_get_hp( int id ,int lv ){ skill_get (skill_db[id].hp[lv-1], id, lv); }
int skill_get_sp( int id ,int lv ){ skill_get (skill_db[id].sp[lv-1], id, lv); }
+int skill_get_hp_rate(int id, int lv ){ skill_get (skill_db[id].hp_rate[lv-1], id, lv); }
+int skill_get_sp_rate(int id, int lv ){ skill_get (skill_db[id].sp_rate[lv-1], id, lv); }
+int skill_get_state(int id) { skill_get (skill_db[id].state, id, 1); }
+int skill_get_spiritball(int id, int lv) { skill_get (skill_db[id].spiritball[lv-1], id, lv); }
+int skill_get_itemid(int id, int idx) { skill_get (skill_db[id].itemid[idx], id, 1); }
+int skill_get_itemqty(int id, int idx) { skill_get (skill_db[id].amount[idx], id, 1); }
int skill_get_zeny( int id ,int lv ){ skill_get (skill_db[id].zeny[lv-1], id, lv); }
int skill_get_num( int id ,int lv ){ skill_get (skill_db[id].num[lv-1], id, lv); }
int skill_get_cast( int id ,int lv ){ skill_get (skill_db[id].cast[lv-1], id, lv); }
@@ -721,14 +727,14 @@ int skillnotok(int skillid, struct map_session_data *sd) //return 1;
// I think it was meant to be "no skills allowed when not a valid sd"
- if (!(skillid >= 10000 && skillid < 10015))
+ if (!(skillid >= GD_SKILLRANGEMIN && skillid <= GD_SKILLRANGEMAX))
if ((skillid > MAX_SKILL) || (skillid < 0))
return 1;
{
int i = skillid;
- if (i >= 10000 && i < 10015)
- i -= 9500;
+ if (i >= GD_SKILLBASE)
+ i = GD_SKILLRANGEMIN + i - GD_SKILLBASE;
if (sd->blockskill[i] > 0)
return 1;
}
@@ -7539,21 +7545,20 @@ int skill_check_condition(struct map_session_data *sd,int type) lv = sd->skilllv;
if (lv <= 0) return 0;
// for the guild skills [celest]
- if (skill >= 10000 && skill < 10015) skill-= 9500;
hp = skill_get_hp(skill, lv); /* ?チ費HP */
sp = skill_get_sp(skill, lv); /* ?チ費SP */
if((sd->skillid_old == BD_ENCORE) && skill == sd->skillid_dance)
sp=sp/2; //アンコ?ル時はSP?チ費が半分
- hp_rate = (lv <= 0)? 0:skill_db[skill].hp_rate[lv-1];
- sp_rate = (lv <= 0)? 0:skill_db[skill].sp_rate[lv-1];
+ hp_rate = skill_get_hp_rate(skill, lv);
+ sp_rate = skill_get_sp_rate(skill, lv);
zeny = skill_get_zeny(skill,lv);
- weapon = skill_db[skill].weapon;
- state = skill_db[skill].state;
- spiritball = (lv <= 0)? 0:skill_db[skill].spiritball[lv-1];
+ weapon = skill_get_weapontype(skill);
+ state = skill_get_state(skill);
+ spiritball = skill_get_spiritball(skill,lv);
mhp = skill_get_mhp(skill, lv); /* ?チ費HP */
for(i = 0; i < 10; i++) {
- itemid[i] = skill_db[skill].itemid[i];
- amount[i] = skill_db[skill].amount[i];
+ itemid[i] = skill_get_itemid(skill, i);
+ amount[i] = skill_get_itemqty(skill, i);
}
if(mhp > 0)
hp += (sd->status.max_hp * mhp)/100;
@@ -11077,9 +11082,9 @@ int skill_readdb(void) continue;
i=atoi(split[0]);
- if (i>=10000 && i<10015) // for guild skills [Celest]
- i -= 9500;
- else if(i<=0 || i>MAX_SKILL_DB)
+ if (i >= GD_SKILLBASE)
+ i = GD_SKILLRANGEMIN + i - GD_SKILLBASE;
+ if(i<=0 || i>MAX_SKILL_DB)
continue;
skill_split_atoi(split[1],skill_db[i].hp);
@@ -11168,9 +11173,9 @@ int skill_readdb(void) continue;
}
i=atoi(split[0]);
- if (i>=10000 && i<10015) // for guild skills [Celest]
- i -= 9500;
- else if(i<=0 || i>MAX_SKILL_DB)
+ if (i >= GD_SKILLBASE)
+ i = GD_SKILLRANGEMIN + i - GD_SKILLBASE;
+ if(i<=0 || i>MAX_SKILL_DB)
continue;
skill_split_atoi(split[1],skill_db[i].cast);
@@ -11200,9 +11205,9 @@ int skill_readdb(void) continue;
i=atoi(split[0]);
- if (i>=10000 && i<10015) // for guild skills [Celest]
- i -= 9500;
- else if(i<=0 || i>MAX_SKILL_DB)
+ if (i >= GD_SKILLBASE)
+ i = GD_SKILLRANGEMIN + i - GD_SKILLBASE;
+ if(i<=0 || i>MAX_SKILL_DB)
continue;
skill_db[i].unit_id[0] = strtol(split[1],NULL,16);
skill_db[i].unit_id[1] = strtol(split[2],NULL,16);
@@ -11359,9 +11364,9 @@ int skill_readdb(void) if(split[0]==0) //fixed by Lupus
continue;
i=atoi(split[0]);
- if (i>=10000 && i<10015) // for guild skills [Celest]
- i -= 9500;
- else if(i<=0 || i>MAX_SKILL_DB)
+ if (i >= GD_SKILLBASE)
+ i = GD_SKILLRANGEMIN + i - GD_SKILLBASE;
+ if(i<=0 || i>MAX_SKILL_DB)
continue;
skill_split_atoi(split[1],skill_db[i].castnodex);
@@ -11388,9 +11393,9 @@ int skill_readdb(void) if(split[0]==0) //fixed by Lupus
continue;
i=atoi(split[0]);
- if (i>=10000 && i<10015) // for guild skills [Celest]
- i -= 9500;
- else if(i<=0 || i>MAX_SKILL_DB)
+ if (i >= GD_SKILLBASE)
+ i = GD_SKILLRANGEMIN + i - GD_SKILLBASE;
+ if(i<=0 || i>MAX_SKILL_DB)
continue;
skill_db[i].nocast=atoi(split[1]);
k++;
diff --git a/src/map/status.c b/src/map/status.c index 831b18eb5..3e0c844f5 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -3565,7 +3565,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val break;
}
- //Check for BOSS resistnces
+ //Check for BOSS resistances
if(mode & MD_BOSS && !(flag&1)) {
if (type>=SC_COMMON_MIN && type <= SC_COMMON_MAX)
return 0;
@@ -5541,7 +5541,6 @@ int status_change_timer_sub(struct block_list *bl, va_list ap ) {
if(tsd)
//Only damage SP [Skotlex]
- // case SG_SUN_WARM:
pc_damage_sp(tsd, 60, 0);
else { //Otherwise, Knockback attack.
if(sd && pc_damage_sp(sd, 2, 0) <= 0)
|