- Unified the rest and ganstar paradise code into a single function.

- Moved the Happy State trigger to the regen function, it now triggers at the same time the SPTIME does.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8681 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex 2006-09-08 19:37:56 +00:00
parent 0d30562da5
commit 99aca1182b
8 changed files with 68 additions and 105 deletions

View File

@ -4,6 +4,10 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/09/08 2006/09/08
* Unified the rest and ganster paradise code into a single function.
[Skotlex]
* Moved the Happy State trigger to the regen function, it now triggers at
the same time SPTIME does. [Skotlex]
* Cleaned up SG_HATE, hope it works now. [Skotlex] * Cleaned up SG_HATE, hope it works now. [Skotlex]
* Removed sg_miracle_skill_duration, replaced it with * Removed sg_miracle_skill_duration, replaced it with
sg_miracle_skill_min_duration and sg_miracle_skill_max_duration, to specify sg_miracle_skill_min_duration and sg_miracle_skill_max_duration, to specify

View File

@ -8921,8 +8921,7 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type,
)) //No sitting during these states neither. )) //No sitting during these states neither.
break; break;
pc_setsit(sd); pc_setsit(sd);
skill_gangsterparadise(sd, 1); // ギャングスターパラダイス設定 fixed Valaris skill_sit(sd, 1);
skill_rest(sd, 1); // TK_HPTIME sitting down mode [Dralnu]
clif_sitting(sd); clif_sitting(sd);
break; break;
case 0x03: // standup case 0x03: // standup
@ -8935,8 +8934,7 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type,
return; return;
} }
pc_setstand(sd); pc_setstand(sd);
skill_gangsterparadise(sd, 0); skill_sit(sd, 0);
skill_rest(sd, 0); // TK_HPTIME standing up mode [Dralnu]
WBUFW(buf, 0) = 0x8a; WBUFW(buf, 0) = 0x8a;
WBUFL(buf, 2) = sd->bl.id; WBUFL(buf, 2) = sd->bl.id;
WBUFB(buf,26) = 3; WBUFB(buf,26) = 3;
@ -11084,8 +11082,6 @@ void clif_parse_PMIgnoreList(int fd,struct map_session_data *sd)
*------------------------------------------ *------------------------------------------
*/ */
void clif_parse_NoviceDoriDori(int fd, struct map_session_data *sd) { void clif_parse_NoviceDoriDori(int fd, struct map_session_data *sd) {
int level;
if (sd->state.doridori) return; if (sd->state.doridori) return;
switch (sd->class_&MAPID_UPPERMASK) switch (sd->class_&MAPID_UPPERMASK)
@ -11093,9 +11089,6 @@ void clif_parse_NoviceDoriDori(int fd, struct map_session_data *sd) {
case MAPID_TAEKWON: case MAPID_TAEKWON:
if (!sd->state.rest) if (!sd->state.rest)
break; break;
if ((level = pc_checkskill(sd,TK_SPTIME)))
sc_start(&sd->bl,SkillStatusChangeTable(TK_SPTIME),
100,level,skill_get_time(TK_SPTIME, level));
case MAPID_SUPER_NOVICE: case MAPID_SUPER_NOVICE:
sd->state.doridori=1; sd->state.doridori=1;
break; break;

View File

@ -4768,8 +4768,7 @@ void pc_damage(struct map_session_data *sd,struct block_list *src,unsigned int h
if(pc_issit(sd)) { if(pc_issit(sd)) {
pc_setstand(sd); pc_setstand(sd);
skill_gangsterparadise(sd,0); skill_sit(sd,0);
skill_rest(sd,0);
} }
clif_updatestatus(sd,SP_HP); clif_updatestatus(sd,SP_HP);

View File

@ -8919,131 +8919,97 @@ int skill_autospell (struct map_session_data *sd, int skillid)
} }
/*========================================== /*==========================================
* * Sitting skills functions.
*------------------------------------------ *------------------------------------------
*/ */
static int skill_sit_count (struct block_list *bl, va_list ap)
static int skill_gangster_count (struct block_list *bl, va_list ap)
{ {
struct map_session_data *sd; struct map_session_data *sd;
int type =va_arg(ap,int);
sd=(struct map_session_data*)bl; sd=(struct map_session_data*)bl;
if(sd && pc_issit(sd) && pc_checkskill(sd,RG_GANGSTER) > 0) if(!pc_issit(sd))
return 0;
if(type&1 && pc_checkskill(sd,RG_GANGSTER) > 0)
return 1; return 1;
if(type&2 && (pc_checkskill(sd,TK_HPTIME) > 0 || pc_checkskill(sd,TK_SPTIME) > 0))
return 1;
return 0; return 0;
} }
static int skill_gangster_in (struct block_list *bl, va_list ap) static int skill_sit_in (struct block_list *bl, va_list ap)
{ {
struct map_session_data *sd; struct map_session_data *sd;
int type =va_arg(ap,int);
sd=(struct map_session_data*)bl; sd=(struct map_session_data*)bl;
if(sd && pc_issit(sd) && pc_checkskill(sd,RG_GANGSTER) > 0)
if(!pc_issit(sd))
return 0;
if(type&1 && pc_checkskill(sd,RG_GANGSTER) > 0)
sd->state.gangsterparadise=1; sd->state.gangsterparadise=1;
return 0;
}
static int skill_gangster_out (struct block_list *bl, va_list ap) if(type&2 && (pc_checkskill(sd,TK_HPTIME) > 0 || pc_checkskill(sd,TK_SPTIME) > 0 ))
{ {
struct map_session_data *sd;
sd=(struct map_session_data*)bl;
if(sd && sd->state.gangsterparadise)
sd->state.gangsterparadise=0;
return 0;
}
int skill_gangsterparadise (struct map_session_data *sd, int type)
{
int range;
nullpo_retr(0, sd);
if((range = pc_checkskill(sd,RG_GANGSTER)) <= 0)
return 0;
range = skill_get_splash(RG_GANGSTER, range);
if(type==1) {
if (map_foreachinrange(skill_gangster_count,&sd->bl, range, BL_PC) > 1)
{
map_foreachinrange(skill_gangster_in,&sd->bl, range, BL_PC);
sd->state.gangsterparadise = 1;
}
return 0;
}
else if(type==0) {
if (map_foreachinrange(skill_gangster_count,&sd->bl, range, BL_PC) < 2)
map_foreachinrange(skill_gangster_out,&sd->bl, range, BL_PC);
sd->state.gangsterparadise = 0;
return 0;
}
return 0;
}
/*==========================================
* Taekwon TK_HPTIME and TK_SPTIME skills [Dralnu]
*------------------------------------------
*/
static int skill_rest_count (struct block_list *bl, va_list ap)
{
struct map_session_data *sd;
sd=(struct map_session_data*)bl;
if(sd && pc_issit(sd) && (pc_checkskill(sd,TK_HPTIME) > 0 || pc_checkskill(sd,TK_SPTIME) > 0 ))
return 1;
return 0;
}
static int skill_rest_in(struct block_list *bl, va_list ap)
{
struct map_session_data *sd;
nullpo_retr(0, bl);
nullpo_retr(0, ap);
sd=(struct map_session_data*)bl;
if(sd && pc_issit(sd) && (pc_checkskill(sd,TK_HPTIME) > 0 || pc_checkskill(sd,TK_SPTIME) > 0 )){
sd->state.rest=1; sd->state.rest=1;
status_calc_pc(sd,0); status_calc_regen(bl, status_get_status_data(bl), status_get_regen_data(bl));
} }
return 0; return 0;
} }
static int skill_rest_out(struct block_list *bl, va_list ap) static int skill_sit_out (struct block_list *bl, va_list ap)
{ {
struct map_session_data *sd; struct map_session_data *sd;
int type =va_arg(ap,int);
sd=(struct map_session_data*)bl; sd=(struct map_session_data*)bl;
if(sd && sd->state.rest != 0) if(sd->state.gangsterparadise && type&1)
sd->state.gangsterparadise=0;
if(sd->state.rest && type&2)
sd->state.rest=0; sd->state.rest=0;
return 0; return 0;
} }
int skill_rest(struct map_session_data *sd, int type) int skill_sit (struct map_session_data *sd, int type)
{ {
int range; int flag = 0;
int range, lv;
nullpo_retr(0, sd); nullpo_retr(0, sd);
if((range = pc_checkskill(sd,TK_HPTIME)) > 0)
range = skill_get_splash(TK_HPTIME, range);
else if ((range = pc_checkskill(sd,TK_SPTIME)) > 0)
range = skill_get_splash(TK_SPTIME, range);
else
return 0;
if((lv = pc_checkskill(sd,RG_GANGSTER)) <= 0) {
flag|=1;
range = skill_get_splash(RG_GANGSTER, lv);
}
if((lv = pc_checkskill(sd,TK_HPTIME)) > 0) {
flag|=2;
range = skill_get_splash(TK_HPTIME, lv);
}
else if ((lv= pc_checkskill(sd,TK_SPTIME)) > 0) {
flag|=2;
range = skill_get_splash(TK_SPTIME, lv);
}
if(type==1) { //When you sit down if (!flag) return 0;
if (map_foreachinrange(skill_rest_count,&sd->bl, range, BL_PC) > 1)
{ if(type==1) {
map_foreachinrange(skill_rest_in,&sd->bl, range, BL_PC); if (map_foreachinrange(skill_sit_count,&sd->bl, range, BL_PC, flag) > 1)
sd->state.rest = 1; map_foreachinrange(skill_sit_in,&sd->bl, range, BL_PC, flag);
status_calc_pc(sd,0);
}
return 0; return 0;
} }
else if(type==0) { //When you stand up else
if (map_foreachinrange(skill_rest_count,&sd->bl, range, BL_PC) < 2) if(type==0) {
map_foreachinrange(skill_rest_out,&sd->bl, range, BL_PC); if (map_foreachinrange(skill_sit_count,&sd->bl, range, BL_PC, flag) < 2)
sd->state.rest = 0; map_foreachinrange(skill_sit_out,&sd->bl, range, BL_PC, flag);
status_calc_pc(sd,0);
return 0; return 0;
} }
return 0; return 0;
} }
/*========================================== /*==========================================
* *
*------------------------------------------ *------------------------------------------

View File

@ -226,8 +226,7 @@ int skill_guildaura_sub (struct block_list *bl,va_list ap);
// 詠唱キャンセル // 詠唱キャンセル
int skill_castcancel(struct block_list *bl,int type); int skill_castcancel(struct block_list *bl,int type);
int skill_gangsterparadise(struct map_session_data *sd ,int type); int skill_sit (struct map_session_data *sd, int type);
int skill_rest(struct map_session_data *sd ,int type);
void skill_brandishspear_first(struct square *tc,int dir,int x,int y); void skill_brandishspear_first(struct square *tc,int dir,int x,int y);
void skill_brandishspear_dir(struct square *tc,int dir,int are); void skill_brandishspear_dir(struct square *tc,int dir,int are);
void skill_repairweapon(struct map_session_data *sd, int idx); void skill_repairweapon(struct map_session_data *sd, int idx);

View File

@ -1162,7 +1162,6 @@ int status_check_visibility(struct block_list *src, struct block_list *target)
} }
void status_calc_bl(struct block_list *bl, unsigned long flag); void status_calc_bl(struct block_list *bl, unsigned long flag);
void status_calc_regen(struct block_list *bl, struct status_data *status, struct regen_data *regen);
static int status_base_atk(struct block_list *bl, struct status_data *status) static int status_base_atk(struct block_list *bl, struct status_data *status)
{ {
@ -7009,6 +7008,9 @@ static int status_natural_heal(DBKey key,void * data,va_list app)
if (sd && sd->state.doridori) { if (sd && sd->state.doridori) {
val*=2; val*=2;
sd->state.doridori = 0; sd->state.doridori = 0;
if ((rate = pc_checkskill(sd,TK_SPTIME)))
sc_start(bl,SkillStatusChangeTable(TK_SPTIME),
100,rate,skill_get_time(TK_SPTIME, rate));
if ( if (
(sd->class_&MAPID_UPPERMASK) == MAPID_STAR_GLADIATOR && (sd->class_&MAPID_UPPERMASK) == MAPID_STAR_GLADIATOR &&
rand()%10000 < battle_config.sg_angel_skill_ratio rand()%10000 < battle_config.sg_angel_skill_ratio

View File

@ -637,6 +637,7 @@ int status_calc_pc(struct map_session_data* sd,int first);
int status_calc_mob(struct mob_data* md, int first); //[Skotlex] int status_calc_mob(struct mob_data* md, int first); //[Skotlex]
int status_calc_homunculus(struct homun_data *hd, int first); int status_calc_homunculus(struct homun_data *hd, int first);
void status_calc_misc(struct block_list *bl, struct status_data *status, int level); void status_calc_misc(struct block_list *bl, struct status_data *status, int level);
void status_calc_regen(struct block_list *bl, struct status_data *status, struct regen_data *regen);
void status_freecast_switch(struct map_session_data *sd); void status_freecast_switch(struct map_session_data *sd);
int status_getrefinebonus(int lv,int type); int status_getrefinebonus(int lv,int type);

View File

@ -1596,8 +1596,7 @@ int unit_remove_map(struct block_list *bl, int clrtype) {
if(pc_issit(sd)) { if(pc_issit(sd)) {
pc_setstand(sd); pc_setstand(sd);
skill_gangsterparadise(sd,0); skill_sit(sd,0);
skill_rest(sd,0);
} }
party_send_dot_remove(sd);//minimap dot fix [Kevin] party_send_dot_remove(sd);//minimap dot fix [Kevin]
guild_send_dot_remove(sd); guild_send_dot_remove(sd);