diff options
-rw-r--r-- | Changelog.txt | 15 | ||||
-rw-r--r-- | conf-tmpl/battle_athena.conf | 6 | ||||
-rw-r--r-- | src/common/malloc.h | 88 | ||||
-rw-r--r-- | src/map/Makefile | 6 | ||||
-rw-r--r-- | src/map/atcommand.c | 33 | ||||
-rw-r--r-- | src/map/battle.c | 1699 | ||||
-rw-r--r-- | src/map/battle.h | 44 | ||||
-rw-r--r-- | src/map/charcommand.c | 9 | ||||
-rw-r--r-- | src/map/clif.c | 85 | ||||
-rw-r--r-- | src/map/guild.c | 3 | ||||
-rw-r--r-- | src/map/map.c | 6 | ||||
-rw-r--r-- | src/map/mob.c | 67 | ||||
-rw-r--r-- | src/map/npc.c | 7 | ||||
-rw-r--r-- | src/map/pc.c | 1576 | ||||
-rw-r--r-- | src/map/pc.h | 5 | ||||
-rw-r--r-- | src/map/pet.c | 37 | ||||
-rw-r--r-- | src/map/script.c | 17 | ||||
-rw-r--r-- | src/map/skill.c | 2661 | ||||
-rw-r--r-- | src/map/skill.h | 6 | ||||
-rw-r--r-- | src/map/status.c | 4699 | ||||
-rw-r--r-- | src/map/status.h | 75 |
21 files changed, 5624 insertions, 5520 deletions
diff --git a/Changelog.txt b/Changelog.txt index 8f8394b29..102db3014 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,8 +1,19 @@ Date Added 01/26 - * Removed my changes to /stable/Makefile that i've accidentally commited, sorry - ^^; [celest] + * Added status.c and status.h of jA 1091 update and moved some functions into + the new source files: + -- skill_status_change_ -> status_change_ + -- battle_get_ -> status_get_ + -- pc_calc_ -> status_calc_ + -- pc_getrefinebonus and pc_percentrefinery -> status_getrefinebonus and + status_percentrefinery + + * Updated auto_counter_type's description in battle_athena, thanks to + akusarujin for pointing it out [celest] + * Removed some unnecessary skill level checks in battle.c [celest] + * Removed my changes to /stable/Makefile which has libGC enabled by default + that i've accidentally commited, sorry ^^; [celest] * Removed an unnecessary "cloneskill_lv" from map_session_data [celest] * Removed WATER.TXT (this file wasn't used at all. There's no such mapflag as WATER even). [Lupus] * Added Water Height of New Yuno Fileds 9 and 11. diff --git a/conf-tmpl/battle_athena.conf b/conf-tmpl/battle_athena.conf index 3b2b93c94..10df2b7ee 100644 --- a/conf-tmpl/battle_athena.conf +++ b/conf-tmpl/battle_athena.conf @@ -467,9 +467,11 @@ save_clothcolor: yes undead_detect_type: 2 // Operational mode of automatic counter. -// 0 = disregard DEF and HIT+20 . CRI*2, 1 = 100% critical +// 0 = 100% critical +// 1 = disregard DEF and HIT+20, CRI*2 +// 2 = Same as 0, but can counter skills (?) // Players -player_auto_counter_type: 0 +player_auto_counter_type: 1 // Monsters monster_auto_counter_type: 0 diff --git a/src/common/malloc.h b/src/common/malloc.h index b37c3b799..d90665487 100644 --- a/src/common/malloc.h +++ b/src/common/malloc.h @@ -5,43 +5,45 @@ #if defined(DMALLOC) -#include "dmalloc.h" - -#define aMalloc(size) \ - dmalloc_malloc(__FILE__, __LINE__, (size), DMALLOC_FUNC_MALLOC, 0, 0) -#define aMallocA(size) \ - dmalloc_malloc(__FILE__, __LINE__, (size), DMALLOC_FUNC_MALLOC, 0, 0) -#define aCallocA(count,size) \ - dmalloc_malloc(__FILE__, __LINE__, (count)*(size), DMALLOC_FUNC_CALLOC, 0, 0) -#define aCalloc(count,size) \ - dmalloc_malloc(__FILE__, __LINE__, (count)*(size), DMALLOC_FUNC_CALLOC, 0, 0) -#define aRealloc(ptr,size) \ - dmalloc_realloc(__FILE__, __LINE__, (ptr), (size), DMALLOC_FUNC_REALLOC, 0) -#define aFree(ptr) free(ptr) -#define aStrdup(ptr) strdup(ptr) +# include "dmalloc.h" +# define aMalloc(size) \ + dmalloc_malloc(__FILE__, __LINE__, (size), DMALLOC_FUNC_MALLOC, 0, 0) +# define aMallocA(size) \ + dmalloc_malloc(__FILE__, __LINE__, (size), DMALLOC_FUNC_MALLOC, 0, 0) +# define aCallocA(count,size) \ + dmalloc_malloc(__FILE__, __LINE__, (count)*(size), DMALLOC_FUNC_CALLOC, 0, 0) +# define aCalloc(count,size) \ + dmalloc_malloc(__FILE__, __LINE__, (count)*(size), DMALLOC_FUNC_CALLOC, 0, 0) +# define aRealloc(ptr,size) \ + dmalloc_realloc(__FILE__, __LINE__, (ptr), (size), DMALLOC_FUNC_REALLOC, 0) +# define aFree(ptr) free(ptr) +# define aStrdup(ptr) strdup(ptr) #elif defined(GCOLLECT) -#include "gc.h" -#define aMalloc(n) GC_MALLOC(n) -#define aMallocA(n) GC_MALLOC_ATOMIC(n) -#define aCallocA(m,n) _bcallocA(m,n) -#define aCalloc(m,n) _bcalloc(m,n) -#define aRealloc(p,n) GC_REALLOC(p,n) -#define aFree(n) GC_FREE(n) -#define aStrdup(n) _bstrdup(n) -extern void * _bcalloc(size_t, size_t); -extern void * _bcallocA(size_t, size_t); -extern char * _bstrdup(const char *); +# include "gc.h" +# define aMalloc(n) GC_MALLOC(n) +# define aMallocA(n) GC_MALLOC_ATOMIC(n) +# define aCallocA(m,n) _bcallocA(m,n) +# define aCalloc(m,n) _bcalloc(m,n) +# define aRealloc(p,n) GC_REALLOC(p,n) +# define aFree(n) GC_FREE(n) +# define aStrdup(n) _bstrdup(n) + + extern void * _bcalloc(size_t, size_t); + extern void * _bcallocA(size_t, size_t); + extern char * _bstrdup(const char *); #elif defined(BCHECK) -#define aMalloc(n) malloc(n) -#define aMallocA(n) malloc(n) -#define aCalloc(m,n) calloc(m,n) -#define aCallocA(m,n) calloc(m,n) -#define aRealloc(p,n) realloc(p,n) -#define aFree(n) free(n) -#define aStrdup(n) strdup(n) + +# define aMalloc(n) malloc(n) +# define aMallocA(n) malloc(n) +# define aCalloc(m,n) calloc(m,n) +# define aCallocA(m,n) calloc(m,n) +# define aRealloc(p,n) realloc(p,n) +# define aFree(n) free(n) +# define aStrdup(n) strdup(n) + #else #if __STDC_VERSION__ < 199901L @@ -52,19 +54,19 @@ extern char * _bstrdup(const char *); # endif #endif -#define ALC_MARK __FILE__, __LINE__, __func__ +# define ALC_MARK __FILE__, __LINE__, __func__ -void* aMalloc_( size_t size, const char *file, int line, const char *func ); -void* aCalloc_( size_t num, size_t size, const char *file, int line, const char *func ); -void* aRealloc_( void *p, size_t size, const char *file, int line, const char *func ); + void* aMalloc_( size_t size, const char *file, int line, const char *func ); + void* aCalloc_( size_t num, size_t size, const char *file, int line, const char *func ); + void* aRealloc_( void *p, size_t size, const char *file, int line, const char *func ); -#define aMalloc(n) aMalloc_(n,ALC_MARK) -#define aMallocA(n) aMalloc_(n,ALC_MARK) -#define aCalloc(m,n) aCalloc_(m,n,ALC_MARK) -#define aCallocA(m,n) aCalloc_(m,n,ALC_MARK) -#define aRealloc(p,n) aRealloc_(p,n,ALC_MARK) -#define aFree(ptr) free(ptr) -#define aStrdup(ptr) strdup(ptr) +# define aMalloc(n) aMalloc_(n,ALC_MARK) +# define aMallocA(n) aMalloc_(n,ALC_MARK) +# define aCalloc(m,n) aCalloc_(m,n,ALC_MARK) +# define aCallocA(m,n) aCalloc_(m,n,ALC_MARK) +# define aRealloc(p,n) aRealloc_(p,n,ALC_MARK) +# define aFree(ptr) free(ptr) +# define aStrdup(ptr) strdup(ptr) #endif diff --git a/src/map/Makefile b/src/map/Makefile index ac9ba9bf7..3a05cd7a8 100644 --- a/src/map/Makefile +++ b/src/map/Makefile @@ -13,10 +13,10 @@ sqlobj: COMMON_OBJ = ../common/core.o ../common/socket.o ../common/timer.o ../common/grfio.o ../common/db.o ../common/lock.o ../common/nullpo.o ../common/malloc.o ../common/showmsg.o ../common/utils.o ../common/strlib.o LIBS = -lz -lm -map-server: txtobj/map.o txtobj/chrif.o txtobj/clif.o txtobj/pc.o txtobj/npc.o txtobj/chat.o txtobj/path.o txtobj/itemdb.o txtobj/mob.o txtobj/script.o txtobj/storage.o txtobj/skill.o txtobj/atcommand.o txtobj/charcommand.o txtobj/battle.o txtobj/intif.o txtobj/trade.o txtobj/party.o txtobj/vending.o txtobj/guild.o txtobj/pet.o txtobj/log.o $(COMMON_OBJ) +map-server: txtobj/map.o txtobj/chrif.o txtobj/clif.o txtobj/pc.o txtobj/status.o txtobj/npc.o txtobj/chat.o txtobj/path.o txtobj/itemdb.o txtobj/mob.o txtobj/script.o txtobj/storage.o txtobj/skill.o txtobj/atcommand.o txtobj/charcommand.o txtobj/battle.o txtobj/intif.o txtobj/trade.o txtobj/party.o txtobj/vending.o txtobj/guild.o txtobj/pet.o txtobj/log.o $(COMMON_OBJ) $(CC) -o ../../$@ $> $(LIBS) $(LIB_S) -map-server_sql: sqlobj/map.o sqlobj/chrif.o sqlobj/clif.o sqlobj/pc.o sqlobj/npc.o sqlobj/chat.o sqlobj/path.o sqlobj/itemdb.o sqlobj/mob.o sqlobj/script.o sqlobj/storage.o sqlobj/skill.o sqlobj/atcommand.o sqlobj/charcommand.o sqlobj/battle.o sqlobj/intif.o sqlobj/trade.o sqlobj/party.o sqlobj/vending.o sqlobj/guild.o sqlobj/pet.o sqlobj/mail.o sqlobj/log.o $(COMMON_OBJ) +map-server_sql: sqlobj/map.o sqlobj/chrif.o sqlobj/clif.o sqlobj/pc.o sqlobj/status.o sqlobj/npc.o sqlobj/chat.o sqlobj/path.o sqlobj/itemdb.o sqlobj/mob.o sqlobj/script.o sqlobj/storage.o sqlobj/skill.o sqlobj/atcommand.o sqlobj/charcommand.o sqlobj/battle.o sqlobj/intif.o sqlobj/trade.o sqlobj/party.o sqlobj/vending.o sqlobj/guild.o sqlobj/pet.o sqlobj/mail.o sqlobj/log.o $(COMMON_OBJ) $(CC) -o ../../$@ $> $(LIB_S) txtobj/%.o: %.c @@ -29,6 +29,7 @@ txtobj/map.o: map.c map.h chrif.h clif.h npc.h pc.h mob.h chat.h skill.h itemdb. txtobj/chrif.o: chrif.c map.h battle.h chrif.h clif.h intif.h pc.h npc.h ../common/socket.h ../common/timer.h ../common/mmo.h ../common/showmsg.h txtobj/clif.o: clif.c map.h chrif.h clif.h mob.h intif.h pc.h npc.h itemdb.h chat.h script.h storage.h party.h guild.h atcommand.h pet.h charcommand.h ../common/socket.h ../common/timer.h ../common/mmo.h ../common/version.h ../common/showmsg.h txtobj/pc.o: pc.c map.h clif.h intif.h pc.h npc.h mob.h itemdb.h battle.h skill.h script.h party.h guild.h pet.h trade.h storage.h chat.h vending.h ../common/timer.h ../common/mmo.h ../common/db.h ../common/showmsg.h +txtobj/status.o: status.c pc.h map.h clif.h status.h mob.h itemdb.h battle.h skill.h script.h pet.h guild.h ../common/timer.h ../common/mmo.h ../common/db.h ../common/showmsg.h txtobj/npc.o: npc.c map.h npc.h clif.h pc.h script.h mob.h itemdb.h battle.h ../common/db.h ../common/timer.h ../common/mmo.h ../common/showmsg.h txtobj/chat.o: chat.c map.h clif.h pc.h chat.h ../common/db.h ../common/mmo.h ../common/showmsg.h txtobj/path.o: path.c map.h battle.h ../common/mmo.h ../common/showmsg.h @@ -52,6 +53,7 @@ sqlobj/map.o: map.c map.h chrif.h clif.h npc.h pc.h mob.h chat.h skill.h itemdb. sqlobj/chrif.o: chrif.c map.h battle.h chrif.h clif.h intif.h pc.h npc.h ../common/socket.h ../common/timer.h ../common/mmo.h ../common/showmsg.h sqlobj/clif.o: clif.c map.h chrif.h clif.h mob.h intif.h pc.h npc.h itemdb.h chat.h script.h storage.h party.h guild.h atcommand.h pet.h charcommand.h ../common/socket.h ../common/timer.h ../common/mmo.h ../common/version.h ../common/showmsg.h sqlobj/pc.o: pc.c map.h clif.h intif.h pc.h npc.h mob.h itemdb.h battle.h skill.h script.h party.h guild.h pet.h trade.h storage.h chat.h vending.h log.h ../common/timer.h ../common/mmo.h ../common/db.h ../common/showmsg.h +sqlobj/status.o: status.c pc.h map.h clif.h status.h mob.h itemdb.h battle.h skill.h script.h pet.h guild.h ../common/timer.h ../common/mmo.h ../common/db.h ../common/showmsg.h sqlobj/npc.o: npc.c map.h npc.h clif.h pc.h script.h mob.h itemdb.h battle.h ../common/db.h ../common/timer.h ../common/mmo.h ../common/showmsg.h sqlobj/chat.o: chat.c map.h clif.h pc.h chat.h ../common/db.h ../common/mmo.h ../common/showmsg.h sqlobj/path.o: path.c map.h battle.h ../common/mmo.h ../common/showmsg.h diff --git a/src/map/atcommand.c b/src/map/atcommand.c index c1f491910..ba21a9f08 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -17,6 +17,7 @@ #include "itemdb.h" #include "map.h" #include "pc.h" +#include "status.h" #include "skill.h" #include "mob.h" #include "pet.h" @@ -1935,7 +1936,7 @@ int atcommand_option( } clif_changeoption(&sd->bl); - pc_calcstatus(sd, 0); + status_calc_pc(sd, 0); clif_displaymessage(fd, msg_table[9]); // Options changed. return 0; @@ -2079,7 +2080,7 @@ int atcommand_jobchange( sd->status.class_ = sd->view_class = 4015; sd->status.option &= ~0x0020; clif_changeoption(&sd->bl); - pc_calcstatus(sd, 0); + status_calc_pc(sd, 0); } } else { if (!pc_isriding(sd)) { @@ -2461,7 +2462,7 @@ int atcommand_baselevelup( clif_updatestatus(sd, SP_BASELEVEL); clif_updatestatus(sd, SP_NEXTBASEEXP); clif_updatestatus(sd, SP_STATUSPOINT); - pc_calcstatus(sd, 0); + status_calc_pc(sd, 0); pc_heal(sd, sd->status.max_hp, sd->status.max_sp); clif_misceffect(&sd->bl, 0); clif_displaymessage(fd, msg_table[21]); // Base level raised. @@ -2482,7 +2483,7 @@ int atcommand_baselevelup( sd->status.base_level += level; clif_updatestatus(sd, SP_BASELEVEL); clif_updatestatus(sd, SP_NEXTBASEEXP); - pc_calcstatus(sd, 0); + status_calc_pc(sd, 0); clif_displaymessage(fd, msg_table[22]); // Base level lowered. } @@ -2528,7 +2529,7 @@ int atcommand_joblevelup( clif_updatestatus(sd, SP_NEXTJOBEXP); sd->status.skill_point += level; clif_updatestatus(sd, SP_SKILLPOINT); - pc_calcstatus(sd, 0); + status_calc_pc(sd, 0); clif_misceffect(&sd->bl, 1); clif_displaymessage(fd, msg_table[24]); // Job level raised. } else { @@ -2547,7 +2548,7 @@ int atcommand_joblevelup( sd->status.skill_point = 0; clif_updatestatus(sd, SP_SKILLPOINT); } // to add: remove status points from skills - pc_calcstatus(sd, 0); + status_calc_pc(sd, 0); clif_displaymessage(fd, msg_table[25]); // Job level lowered. } @@ -3864,7 +3865,7 @@ int atcommand_param( *status[index] = new_value; clif_updatestatus(sd, SP_STR + index); clif_updatestatus(sd, SP_USTR + index); - pc_calcstatus(sd, 0); + status_calc_pc(sd, 0); clif_displaymessage(fd, msg_table[42]); // Stat changed. } else { if (value < 0) @@ -3909,7 +3910,7 @@ int atcommand_stat_all( *status[index] = new_value; clif_updatestatus(sd, SP_STR + index); clif_updatestatus(sd, SP_USTR + index); - pc_calcstatus(sd, 0); + status_calc_pc(sd, 0); count++; } } @@ -4057,9 +4058,9 @@ int atcommand_petfriendly( if ((sd->pet.intimate > 0 && t <= 0) || (sd->pet.intimate <= 0 && t > 0)) { if (sd->bl.prev != NULL) - pc_calcstatus(sd, 0); + status_calc_pc(sd, 0); else - pc_calcstatus(sd, 2); + status_calc_pc(sd, 2); } } clif_displaymessage(fd, msg_table[182]); // Pet friendly value changed! @@ -4673,7 +4674,7 @@ int atcommand_character_baselevel( clif_updatestatus(pl_sd, SP_BASELEVEL); clif_updatestatus(pl_sd, SP_NEXTBASEEXP); clif_updatestatus(pl_sd, SP_STATUSPOINT); - pc_calcstatus(pl_sd, 0); + status_calc_pc(pl_sd, 0); pc_heal(pl_sd, pl_sd->status.max_hp, pl_sd->status.max_sp); clif_misceffect(&pl_sd->bl, 0); clif_displaymessage(fd, msg_table[65]); // Character's base level raised. @@ -4694,7 +4695,7 @@ int atcommand_character_baselevel( pl_sd->status.base_level += level; clif_updatestatus(pl_sd, SP_BASELEVEL); clif_updatestatus(pl_sd, SP_NEXTBASEEXP); - pc_calcstatus(pl_sd, 0); + status_calc_pc(pl_sd, 0); clif_displaymessage(fd, msg_table[66]); // Character's base level lowered. } } else { @@ -4755,7 +4756,7 @@ int atcommand_character_joblevel( clif_updatestatus(pl_sd, SP_NEXTJOBEXP); pl_sd->status.skill_point += level; clif_updatestatus(pl_sd, SP_SKILLPOINT); - pc_calcstatus(pl_sd, 0); + status_calc_pc(pl_sd, 0); clif_misceffect(&pl_sd->bl, 1); clif_displaymessage(fd, msg_table[68]); // character's job level raised. } else { @@ -4774,7 +4775,7 @@ int atcommand_character_joblevel( pl_sd->status.skill_point = 0; clif_updatestatus(pl_sd, SP_SKILLPOINT); } // to add: remove status points from skills - pc_calcstatus(pl_sd, 0); + status_calc_pc(pl_sd, 0); clif_displaymessage(fd, msg_table[69]); // Character's job level lowered. } } else { @@ -7909,7 +7910,7 @@ int atcommand_unmute( if((pl_sd=map_nick2sd((char *) message)) != NULL) { if(pl_sd->sc_data[SC_NOCHAT].timer!=-1) { pl_sd->status.manner = 0; // have to set to 0 first [celest] - skill_status_change_end(&pl_sd->bl,SC_NOCHAT,-1); + status_change_end(&pl_sd->bl,SC_NOCHAT,-1); clif_displaymessage(sd->fd,"Player unmuted"); } else @@ -7985,7 +7986,7 @@ int atcommand_mute( if ((pl_sd = map_nick2sd(character)) != NULL) { pl_sd->status.manner -= manner; if(pl_sd->status.manner < 0) - skill_status_change_start(&pl_sd->bl,SC_NOCHAT,0,0,0,0,0,0); + status_change_start(&pl_sd->bl,SC_NOCHAT,0,0,0,0,0,0); } else { clif_displaymessage(fd, msg_table[3]); // Character not found. diff --git a/src/map/battle.c b/src/map/battle.c index a11facfc9..31041f405 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -12,6 +12,7 @@ #include "map.h" #include "pc.h" +#include "status.h" #include "skill.h" #include "mob.h" #include "itemdb.h" @@ -55,1302 +56,6 @@ int battle_counttargeted(struct block_list *bl,struct block_list *src,int target return mob_counttargeted((struct mob_data *)bl,src,target_lv); return 0; } -/*========================================== - * 対象のClassを返す(汎用) - * 戻りは整数で0以上 - *------------------------------------------ - */ -int battle_get_class(struct block_list *bl) -{ - nullpo_retr(0, bl); - if(bl->type==BL_MOB && (struct mob_data *)bl) - return ((struct mob_data *)bl)->class_; - else if(bl->type==BL_PC && (struct map_session_data *)bl) - return ((struct map_session_data *)bl)->status.class_; - else if(bl->type==BL_PET && (struct pet_data *)bl) - return ((struct pet_data *)bl)->class_; - else - return 0; -} -/*========================================== - * 対象の方向を返す(汎用) - * 戻りは整数で0以上 - *------------------------------------------ - */ -int battle_get_dir(struct block_list *bl) -{ - nullpo_retr(0, bl); - if(bl->type==BL_MOB && (struct mob_data *)bl) - return ((struct mob_data *)bl)->dir; - else if(bl->type==BL_PC && (struct map_session_data *)bl) - return ((struct map_session_data *)bl)->dir; - else if(bl->type==BL_PET && (struct pet_data *)bl) - return ((struct pet_data *)bl)->dir; - else - return 0; -} -/*========================================== - * 対象のレベルを返す(汎用) - * 戻りは整数で0以上 - *------------------------------------------ - */ -int battle_get_lv(struct block_list *bl) -{ - nullpo_retr(0, bl); - if(bl->type==BL_MOB && (struct mob_data *)bl) - return ((struct mob_data *)bl)->level; - else if(bl->type==BL_PC && (struct map_session_data *)bl) - return ((struct map_session_data *)bl)->status.base_level; - else if(bl->type==BL_PET && (struct pet_data *)bl) - return ((struct pet_data *)bl)->msd->pet.level; - else - return 0; -} -/*========================================== - * 対象の射程を返す(汎用) - * 戻りは整数で0以上 - *------------------------------------------ - */ -int battle_get_range(struct block_list *bl) -{ - nullpo_retr(0, bl); - if(bl->type==BL_MOB && (struct mob_data *)bl) - return mob_db[((struct mob_data *)bl)->class_].range; - else if(bl->type==BL_PC && (struct map_session_data *)bl) - return ((struct map_session_data *)bl)->attackrange; - else if(bl->type==BL_PET && (struct pet_data *)bl) - return mob_db[((struct pet_data *)bl)->class_].range; - else - return 0; -} -/*========================================== - * 対象のHPを返す(汎用) - * 戻りは整数で0以上 - *------------------------------------------ - */ -int battle_get_hp(struct block_list *bl) -{ - nullpo_retr(1, bl); - if(bl->type==BL_MOB && (struct mob_data *)bl) - return ((struct mob_data *)bl)->hp; - else if(bl->type==BL_PC && (struct map_session_data *)bl) - return ((struct map_session_data *)bl)->status.hp; - else - return 1; -} -/*========================================== - * 対象のMHPを返す(汎用) - * 戻りは整数で0以上 - *------------------------------------------ - */ -int battle_get_max_hp(struct block_list *bl) -{ - nullpo_retr(1, bl); - if(bl->type==BL_PC && ((struct map_session_data *)bl)) - return ((struct map_session_data *)bl)->status.max_hp; - else { - struct status_change *sc_data=battle_get_sc_data(bl); - int max_hp=1; - if(bl->type==BL_MOB && ((struct mob_data*)bl)) { - max_hp = mob_db[((struct mob_data*)bl)->class_].max_hp; - if(battle_config.mobs_level_up) // mobs leveling up increase [Valaris] - max_hp+=(((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class_].lv)*battle_get_vit(bl); - if(mob_db[((struct mob_data*)bl)->class_].mexp > 0) { - if(battle_config.mvp_hp_rate != 100) - max_hp = (max_hp * battle_config.mvp_hp_rate)/100; - } - else { - if(battle_config.monster_hp_rate != 100) - max_hp = (max_hp * battle_config.monster_hp_rate)/100; - } - } - else if(bl->type==BL_PET && ((struct pet_data*)bl)) { - max_hp = mob_db[((struct pet_data*)bl)->class_].max_hp; - if(mob_db[((struct pet_data*)bl)->class_].mexp > 0) { - if(battle_config.mvp_hp_rate != 100) - max_hp = (max_hp * battle_config.mvp_hp_rate)/100; - } - else { - if(battle_config.monster_hp_rate != 100) - max_hp = (max_hp * battle_config.monster_hp_rate)/100; - } - } - if(sc_data) { - if(sc_data[SC_APPLEIDUN].timer!=-1) - max_hp += ((5+sc_data[SC_APPLEIDUN].val1*2+((sc_data[SC_APPLEIDUN].val2+1)>>1) - +sc_data[SC_APPLEIDUN].val3/10) * max_hp)/100; - if(sc_data[SC_GOSPEL].timer!=-1 && - sc_data[SC_GOSPEL].val4 == BCT_PARTY && - sc_data[SC_GOSPEL].val3 == 4) - max_hp += max_hp * 25 / 100; - } - if(max_hp < 1) max_hp = 1; - return max_hp; - } - return 1; -} -/*========================================== - * 対象のStrを返す(汎用) - * 戻りは整数で0以上 - *------------------------------------------ - */ -int battle_get_str(struct block_list *bl) -{ - int str=0; - struct status_change *sc_data; - - nullpo_retr(0, bl); - sc_data=battle_get_sc_data(bl); - if(bl->type==BL_MOB && ((struct mob_data *)bl)) { - str = mob_db[((struct mob_data *)bl)->class_].str; - if(battle_config.mobs_level_up) // mobs leveling up increase [Valaris] - str+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class_].lv; - } - else if(bl->type==BL_PC && ((struct map_session_data *)bl)) - return ((struct map_session_data *)bl)->paramc[0]; - else if(bl->type==BL_PET && ((struct pet_data *)bl)) - str = mob_db[((struct pet_data *)bl)->class_].str; - - if(sc_data) { - if(sc_data[SC_LOUD].timer!=-1 && sc_data[SC_QUAGMIRE].timer == -1 && bl->type != BL_PC) - str += 4; - if( sc_data[SC_BLESSING].timer != -1 && bl->type != BL_PC){ // ブレッシング - int race=battle_get_race(bl); - if(battle_check_undead(race,battle_get_elem_type(bl)) || race==6 ) str >>= 1; // 悪 魔/不死 - else str += sc_data[SC_BLESSING].val1; // その他 - } - if(sc_data[SC_TRUESIGHT].timer!=-1 && bl->type != BL_PC) // トゥルーサイト - str += 5; - } - if(str < 0) str = 0; - return str; -} -/*========================================== - * 対象のAgiを返す(汎用) - * 戻りは整数で0以上 - *------------------------------------------ - */ - -int battle_get_agi(struct block_list *bl) -{ - int agi=0; - struct status_change *sc_data; - - nullpo_retr(0, bl); - sc_data=battle_get_sc_data(bl); - if(bl->type==BL_MOB && (struct mob_data *)bl) { - agi=mob_db[((struct mob_data *)bl)->class_].agi; - if(battle_config.mobs_level_up) // increase of mobs leveling up [Valaris] - agi+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class_].lv; - } - else if(bl->type==BL_PC && (struct map_session_data *)bl) - agi=((struct map_session_data *)bl)->paramc[1]; - else if(bl->type==BL_PET && (struct pet_data *)bl) - agi=mob_db[((struct pet_data *)bl)->class_].agi; - - if(sc_data) { - if( sc_data[SC_INCREASEAGI].timer!=-1 && sc_data[SC_QUAGMIRE].timer == -1 && sc_data[SC_DONTFORGETME].timer == -1 && - bl->type != BL_PC) // 速度増加(PCはpc.cで) - agi += 2+sc_data[SC_INCREASEAGI].val1; - - if(sc_data[SC_CONCENTRATE].timer!=-1 && sc_data[SC_QUAGMIRE].timer == -1 && bl->type != BL_PC) - agi += agi*(2+sc_data[SC_CONCENTRATE].val1)/100; - - if(sc_data[SC_DECREASEAGI].timer!=-1) // 速度減少 - agi -= 2+sc_data[SC_DECREASEAGI].val1; - - if(sc_data[SC_QUAGMIRE].timer!=-1 ) { // クァグマイア - //agi >>= 1; - //int agib = agi*(sc_data[SC_QUAGMIRE].val1*10)/100; - //agi -= agib > 50 ? 50 : agib; - agi -= (bl->type == BL_PC) ? sc_data[SC_QUAGMIRE].val1*5 : sc_data[SC_QUAGMIRE].val1*10; - } - if(sc_data[SC_TRUESIGHT].timer!=-1 && bl->type != BL_PC) // トゥルーサイト - agi += 5; - } - if(agi < 0) agi = 0; - return agi; -} -/*========================================== - * 対象のVitを返す(汎用) - * 戻りは整数で0以上 - *------------------------------------------ - */ -int battle_get_vit(struct block_list *bl) -{ - int vit=0; - struct status_change *sc_data; - - nullpo_retr(0, bl); - sc_data=battle_get_sc_data(bl); - if(bl->type==BL_MOB && (struct mob_data *)bl) { - vit=mob_db[((struct mob_data *)bl)->class_].vit; - if(battle_config.mobs_level_up) // increase from mobs leveling up [Valaris] - vit+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class_].lv; - } - else if(bl->type==BL_PC && (struct map_session_data *)bl) - vit=((struct map_session_data *)bl)->paramc[2]; - else if(bl->type==BL_PET && (struct pet_data *)bl) - vit=mob_db[((struct pet_data *)bl)->class_].vit; - if(sc_data) { - if(sc_data[SC_STRIPARMOR].timer != -1 && bl->type!=BL_PC) - vit = vit*60/100; - if(sc_data[SC_TRUESIGHT].timer!=-1 && bl->type != BL_PC) // トゥルーサイト - vit += 5; - } - - if(vit < 0) vit = 0; - return vit; -} -/*========================================== - * 対象のIntを返す(汎用) - * 戻りは整数で0以上 - *------------------------------------------ - */ -int battle_get_int(struct block_list *bl) -{ - int int_=0; - struct status_change *sc_data; - - nullpo_retr(0, bl); - sc_data=battle_get_sc_data(bl); - if(bl->type==BL_MOB && (struct mob_data *)bl){ - int_=mob_db[((struct mob_data *)bl)->class_].int_; - if(battle_config.mobs_level_up) // increase from mobs leveling up [Valaris] - int_+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class_].lv; - } - else if(bl->type==BL_PC && (struct map_session_data *)bl) - int_=((struct map_session_data *)bl)->paramc[3]; - else if(bl->type==BL_PET && (struct pet_data *)bl) - int_=mob_db[((struct pet_data *)bl)->class_].int_; - - if(sc_data) { - if( sc_data[SC_BLESSING].timer != -1 && bl->type != BL_PC){ // ブレッシング - int race=battle_get_race(bl); - if(battle_check_undead(race,battle_get_elem_type(bl)) || race==6 ) int_ >>= 1; // 悪 魔/不死 - else int_ += sc_data[SC_BLESSING].val1; // その他 - } - if( sc_data[SC_STRIPHELM].timer != -1 && bl->type != BL_PC) - int_ = int_*60/100; - if(sc_data[SC_TRUESIGHT].timer!=-1 && bl->type != BL_PC) // トゥルーサイト - int_ += 5; - } - if(int_ < 0) int_ = 0; - return int_; -} -/*========================================== - * 対象のDexを返す(汎用) - * 戻りは整数で0以上 - *------------------------------------------ - */ -int battle_get_dex(struct block_list *bl) -{ - int dex=0; - struct status_change *sc_data; - - nullpo_retr(0, bl); - sc_data=battle_get_sc_data(bl); - if(bl->type==BL_MOB && (struct mob_data *)bl) { - dex=mob_db[((struct mob_data *)bl)->class_].dex; - if(battle_config.mobs_level_up) // increase from mobs leveling up [Valaris] - dex+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class_].lv; - } - else if(bl->type==BL_PC && (struct map_session_data *)bl) - dex=((struct map_session_data *)bl)->paramc[4]; - else if(bl->type==BL_PET && (struct pet_data *)bl) - dex=mob_db[((struct pet_data *)bl)->class_].dex; - - if(sc_data) { - if(sc_data[SC_CONCENTRATE].timer!=-1 && sc_data[SC_QUAGMIRE].timer == -1 && bl->type != BL_PC) - dex += dex*(2+sc_data[SC_CONCENTRATE].val1)/100; - - if( sc_data[SC_BLESSING].timer != -1 && bl->type != BL_PC){ // ブレッシング - int race=battle_get_race(bl); - if(battle_check_undead(race,battle_get_elem_type(bl)) || race==6 ) dex >>= 1; // 悪 魔/不死 - else dex += sc_data[SC_BLESSING].val1; // その他 - } - - if(sc_data[SC_QUAGMIRE].timer!=-1 ) { // クァグマイア - // dex >>= 1; - //int dexb = dex*(sc_data[SC_QUAGMIRE].val1*10)/100; - //dex -= dexb > 50 ? 50 : dexb; - dex -= (bl->type == BL_PC) ? sc_data[SC_QUAGMIRE].val1*5 : sc_data[SC_QUAGMIRE].val1*10; - } - if(sc_data[SC_TRUESIGHT].timer!=-1 && bl->type != BL_PC) // トゥルーサイト - dex += 5; - } - if(dex < 0) dex = 0; - return dex; -} -/*========================================== - * 対象のLukを返す(汎用) - * 戻りは整数で0以上 - *------------------------------------------ - */ -int battle_get_luk(struct block_list *bl) -{ - int luk=0; - struct status_change *sc_data; - - nullpo_retr(0, bl); - sc_data=battle_get_sc_data(bl); - if(bl->type==BL_MOB && (struct mob_data *)bl) { - luk=mob_db[((struct mob_data *)bl)->class_].luk; - if(battle_config.mobs_level_up) // increase from mobs leveling up [Valaris] - luk+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class_].lv; - } - else if(bl->type==BL_PC && (struct map_session_data *)bl) - luk=((struct map_session_data *)bl)->paramc[5]; - else if(bl->type==BL_PET && (struct pet_data *)bl) - luk=mob_db[((struct pet_data *)bl)->class_].luk; - - if(sc_data) { - if(sc_data[SC_GLORIA].timer!=-1 && bl->type != BL_PC) // グロリア(PCはpc.cで) - luk += 30; - if(sc_data[SC_CURSE].timer!=-1 ) // 呪い - luk=0; - if(sc_data[SC_TRUESIGHT].timer!=-1 && bl->type != BL_PC) // トゥルーサイト - luk += 5; - } - if(luk < 0) luk = 0; - return luk; -} - -/*========================================== - * 対象のFleeを返す(汎用) - * 戻りは整数で1以上 - *------------------------------------------ - */ -int battle_get_flee(struct block_list *bl) -{ - int flee=1; - struct status_change *sc_data; - - nullpo_retr(1, bl); - sc_data=battle_get_sc_data(bl); - if(bl->type==BL_PC && (struct map_session_data *)bl) - flee=((struct map_session_data *)bl)->flee; - else - flee=battle_get_agi(bl) + battle_get_lv(bl); - - if(bl->type != BL_PC && sc_data){ - if(sc_data[SC_WHISTLE].timer!=-1) - flee += flee*(sc_data[SC_WHISTLE].val1+sc_data[SC_WHISTLE].val2 - +(sc_data[SC_WHISTLE].val3>>16))/100; - if(sc_data[SC_BLIND].timer!=-1) - flee -= flee*25/100; - if(sc_data[SC_WINDWALK].timer!=-1) // ウィンドウォーク - flee += flee*(sc_data[SC_WINDWALK].val2)/100; - if(sc_data[SC_SPIDERWEB].timer!=-1) //スパイダーウェブ - flee -= flee*50/100; - if(sc_data[SC_GOSPEL].timer!=-1) { - if (sc_data[SC_GOSPEL].val4 == BCT_PARTY && - sc_data[SC_GOSPEL].val3 == 13) - flee += flee*5/100; - else if (sc_data[SC_GOSPEL].val4 == BCT_ENEMY && - sc_data[SC_GOSPEL].val3 == 7) - flee = 0; - } - } - if(flee < 1) flee = 1; - return flee; -} -/*========================================== - * 対象のHitを返す(汎用) - * 戻りは整数で1以上 - *------------------------------------------ - */ -int battle_get_hit(struct block_list *bl) -{ - int hit=1; - struct status_change *sc_data; - - nullpo_retr(1, bl); - sc_data=battle_get_sc_data(bl); - if(bl->type==BL_PC && (struct map_session_data *)bl) - hit=((struct map_session_data *)bl)->hit; - else - hit=battle_get_dex(bl) + battle_get_lv(bl); - - if(bl->type != BL_PC && sc_data) { - if(sc_data[SC_HUMMING].timer!=-1) // - hit += hit*(sc_data[SC_HUMMING].val1*2+sc_data[SC_HUMMING].val2 - +sc_data[SC_HUMMING].val3)/100; - if(sc_data[SC_BLIND].timer!=-1) // 呪い - hit -= hit*25/100; - if(sc_data[SC_TRUESIGHT].timer!=-1) // トゥルーサイト - hit += 3*(sc_data[SC_TRUESIGHT].val1); - if(sc_data[SC_CONCENTRATION].timer!=-1) //コンセントレーション - hit += (hit*(10*(sc_data[SC_CONCENTRATION].val1)))/100; - if(sc_data[SC_GOSPEL].timer!=-1 && - sc_data[SC_GOSPEL].val4 == BCT_PARTY && - sc_data[SC_GOSPEL].val3 == 14) - hit += hit*5/100; - } - if(hit < 1) hit = 1; - return hit; -} -/*========================================== - * 対象の完全回避を返す(汎用) - * 戻りは整数で1以上 - *------------------------------------------ - */ -int battle_get_flee2(struct block_list *bl) -{ - int flee2=1; - struct status_change *sc_data; - - nullpo_retr(1, bl); - sc_data=battle_get_sc_data(bl); - if(bl->type==BL_PC && (struct map_session_data *)bl){ - flee2 = battle_get_luk(bl) + 10; - flee2 += ((struct map_session_data *)bl)->flee2 - (((struct map_session_data *)bl)->paramc[5] + 10); - } - else - flee2=battle_get_luk(bl)+1; - - if(sc_data) { - if(sc_data[SC_WHISTLE].timer!=-1 && bl->type != BL_PC) - flee2 += (sc_data[SC_WHISTLE].val1+sc_data[SC_WHISTLE].val2 - +(sc_data[SC_WHISTLE].val3&0xffff))*10; - } - if(flee2 < 1) flee2 = 1; - return flee2; -} -/*========================================== - * 対象のクリティカルを返す(汎用) - * 戻りは整数で1以上 - *------------------------------------------ - */ -int battle_get_critical(struct block_list *bl) -{ - int critical=1; - struct status_change *sc_data; - - nullpo_retr(1, bl); - sc_data=battle_get_sc_data(bl); - if(bl->type==BL_PC && (struct map_session_data *)bl){ - critical = battle_get_luk(bl)*3 + 10; - critical += ((struct map_session_data *)bl)->critical - ((((struct map_session_data *)bl)->paramc[5]*3) + 10); - } - else - critical=battle_get_luk(bl)*3 + 1; - - if(sc_data) { - if(sc_data[SC_FORTUNE].timer!=-1 && bl->type != BL_PC) - critical += (10+sc_data[SC_FORTUNE].val1+sc_data[SC_FORTUNE].val2 - +sc_data[SC_FORTUNE].val3)*10; - if(sc_data[SC_EXPLOSIONSPIRITS].timer!=-1 && bl->type != BL_PC) - critical += sc_data[SC_EXPLOSIONSPIRITS].val2; - if(sc_data[SC_TRUESIGHT].timer!=-1 && bl->type != BL_PC) //トゥルーサイト - critical += critical*sc_data[SC_TRUESIGHT].val1/100; - } - if(critical < 1) critical = 1; - return critical; -} -/*========================================== - * base_atkの取得 - * 戻りは整数で1以上 - *------------------------------------------ - */ -int battle_get_baseatk(struct block_list *bl) -{ - struct status_change *sc_data; - int batk=1; - - nullpo_retr(1, bl); - sc_data=battle_get_sc_data(bl); - if(bl->type==BL_PC && (struct map_session_data *)bl) { - batk = ((struct map_session_data *)bl)->base_atk; //設定されているbase_atk - if (((struct map_session_data *)bl)->status.weapon < 16) - batk += ((struct map_session_data *)bl)->weapon_atk[((struct map_session_data *)bl)->status.weapon]; - } else { //それ以外なら - int str,dstr; - str = battle_get_str(bl); //STR - dstr = str/10; - batk = dstr*dstr + str; //base_atkを計算する - } - if(sc_data) { //状態異常あり - if(sc_data[SC_PROVOKE].timer!=-1 && bl->type != BL_PC) //PCでプロボック(SM_PROVOKE)状態 - batk = batk*(100+2*sc_data[SC_PROVOKE].val1)/100; //base_atk増加 - if(sc_data[SC_CURSE].timer!=-1 ) //呪われていたら - batk -= batk*25/100; //base_atkが25%減少 - if(sc_data[SC_CONCENTRATION].timer!=-1 && bl->type != BL_PC) //コンセントレーション - batk += batk*(5*sc_data[SC_CONCENTRATION].val1)/100; - } - if(batk < 1) batk = 1; //base_atkは最低でも1 - return batk; -} -/*========================================== - * 対象のAtkを返す(汎用) - * 戻りは整数で0以上 - *------------------------------------------ - */ -int battle_get_atk(struct block_list *bl) -{ - struct status_change *sc_data; - int atk=0; - - nullpo_retr(0, bl); - sc_data=battle_get_sc_data(bl); - if(bl->type==BL_PC && (struct map_session_data *)bl) - atk = ((struct map_session_data*)bl)->watk; - else if(bl->type==BL_MOB && (struct mob_data *)bl) - atk = mob_db[((struct mob_data*)bl)->class_].atk1; - else if(bl->type==BL_PET && (struct pet_data *)bl) - atk = mob_db[((struct pet_data*)bl)->class_].atk1; - - if(bl->type != BL_PC && sc_data) { - if(sc_data[SC_PROVOKE].timer!=-1) - atk = atk*(100+2*sc_data[SC_PROVOKE].val1)/100; - if(sc_data[SC_CURSE].timer!=-1) - atk -= atk*25/100; - if(sc_data[SC_CONCENTRATION].timer!=-1) //コンセントレーション - atk += atk*(5*sc_data[SC_CONCENTRATION].val1)/100; - - if(sc_data[SC_GOSPEL].timer!=-1) { - if (sc_data[SC_GOSPEL].val4 == BCT_PARTY && - sc_data[SC_GOSPEL].val3 == 12) - atk += atk*8/100; - else if (sc_data[SC_GOSPEL].val4 == BCT_ENEMY && - sc_data[SC_GOSPEL].val3 == 6) - atk = 0; - } - } - if(atk < 0) atk = 0; - return atk; -} -/*========================================== - * 対象の左手Atkを返す(汎用) - * 戻りは整数で0以上 - *------------------------------------------ - */ -int battle_get_atk_(struct block_list *bl) -{ - nullpo_retr(0, bl); - if(bl->type==BL_PC && (struct map_session_data *)bl){ - int atk=((struct map_session_data*)bl)->watk_; - return atk; - } - else - return 0; -} -/*========================================== - * 対象のAtk2を返す(汎用) - * 戻りは整数で0以上 - *------------------------------------------ - */ -int battle_get_atk2(struct block_list *bl) -{ - nullpo_retr(0, bl); - if(bl->type==BL_PC && (struct map_session_data *)bl) - return ((struct map_session_data*)bl)->watk2; - else { - struct status_change *sc_data=battle_get_sc_data(bl); - int atk2=0; - if(bl->type==BL_MOB && (struct mob_data *)bl) - atk2 = mob_db[((struct mob_data*)bl)->class_].atk2; - else if(bl->type==BL_PET && (struct pet_data *)bl) - atk2 = mob_db[((struct pet_data*)bl)->class_].atk2; - if(sc_data) { - if( sc_data[SC_IMPOSITIO].timer!=-1) - atk2 += sc_data[SC_IMPOSITIO].val1*5; - if( sc_data[SC_PROVOKE].timer!=-1 ) - atk2 = atk2*(100+2*sc_data[SC_PROVOKE].val1)/100; - if( sc_data[SC_CURSE].timer!=-1 ) - atk2 -= atk2*25/100; - if(sc_data[SC_DRUMBATTLE].timer!=-1) - atk2 += sc_data[SC_DRUMBATTLE].val2; - if(sc_data[SC_NIBELUNGEN].timer!=-1 && (battle_get_element(bl)/10) >= 8 ) - atk2 += sc_data[SC_NIBELUNGEN].val3; - if(sc_data[SC_STRIPWEAPON].timer!=-1) - atk2 = atk2*sc_data[SC_STRIPWEAPON].val2/100; - if(sc_data[SC_CONCENTRATION].timer!=-1) //コンセントレーション - atk2 += atk2*(5*sc_data[SC_CONCENTRATION].val1)/100; - } - if(atk2 < 0) atk2 = 0; - return atk2; - } - return 0; -} -/*========================================== - * 対象の左手Atk2を返す(汎用) - * 戻りは整数で0以上 - *------------------------------------------ - */ -int battle_get_atk_2(struct block_list *bl) -{ - nullpo_retr(0, bl); - if(bl->type==BL_PC && (struct map_session_data *)bl) - return ((struct map_session_data*)bl)->watk_2; - else - return 0; -} -/*========================================== - * 対象のMAtk1を返す(汎用) - * 戻りは整数で0以上 - *------------------------------------------ - */ -int battle_get_matk1(struct block_list *bl) -{ - struct status_change *sc_data; - nullpo_retr(0, bl); - sc_data=battle_get_sc_data(bl); - if(bl->type==BL_MOB){ - int matk,int_=battle_get_int(bl); - matk = int_+(int_/5)*(int_/5); - - if(sc_data) - if(sc_data[SC_MINDBREAKER].timer!=-1 && bl->type != BL_PC) - matk = matk*(100+2*sc_data[SC_MINDBREAKER].val1)/100; - return matk; - } - else if(bl->type==BL_PC && (struct map_session_data *)bl) - return ((struct map_session_data *)bl)->matk1; - else if(bl->type==BL_PET){ - int matk,int_=battle_get_int(bl); - matk = int_+(int_/5)*(int_/5); - - if(sc_data) - if(sc_data[SC_MINDBREAKER].timer!=-1 && bl->type != BL_PC) - matk = matk*(100+2*sc_data[SC_MINDBREAKER].val1)/100; - return matk; - } - else - return 0; -} -/*========================================== - * 対象のMAtk2を返す(汎用) - * 戻りは整数で0以上 - *------------------------------------------ - */ -int battle_get_matk2(struct block_list *bl) -{ - struct status_change *sc_data=battle_get_sc_data(bl); - nullpo_retr(0, bl); - if(bl->type==BL_MOB){ - int matk,int_=battle_get_int(bl); - matk = int_+(int_/7)*(int_/7); - - if(sc_data) - if(sc_data[SC_MINDBREAKER].timer!=-1 && bl->type != BL_PC) - matk = matk*(100+2*sc_data[SC_MINDBREAKER].val1)/100; - return matk; - } - else if(bl->type==BL_PC && (struct map_session_data *)bl) - return ((struct map_session_data *)bl)->matk2; - else if(bl->type==BL_PET){ - int matk,int_=battle_get_int(bl); - matk = int_+(int_/7)*(int_/7); - if(sc_data) - if(sc_data[SC_MINDBREAKER].timer!=-1 && bl->type != BL_PC) - matk = matk*(100+2*sc_data[SC_MINDBREAKER].val1)/100; - return matk; - } - else - return 0; -} -/*========================================== - * 対象のDefを返す(汎用) - * 戻りは整数で0以上 - *------------------------------------------ - */ -int battle_get_def(struct block_list *bl) -{ - struct status_change *sc_data; - int def=0,skilltimer=-1,skillid=0; - - nullpo_retr(0, bl); - sc_data=battle_get_sc_data(bl); - if(bl->type==BL_PC && (struct map_session_data *)bl){ - def = ((struct map_session_data *)bl)->def; - skilltimer = ((struct map_session_data *)bl)->skilltimer; - skillid = ((struct map_session_data *)bl)->skillid; - } - else if(bl->type==BL_MOB && (struct mob_data *)bl) { - def = mob_db[((struct mob_data *)bl)->class_].def; - skilltimer = ((struct mob_data *)bl)->skilltimer; - skillid = ((struct mob_data *)bl)->skillid; - } - else if(bl->type==BL_PET && (struct pet_data *)bl) - def = mob_db[((struct pet_data *)bl)->class_].def; - - if(def < 1000000) { - if(sc_data) { - //凍結、石化時は右シフト - if(sc_data[SC_FREEZE].timer != -1 || (sc_data[SC_STONE].timer != -1 && sc_data[SC_STONE].val2 == 0)) - def >>= 1; - - if (bl->type != BL_PC) { - //キーピング時はDEF100 - if( sc_data[SC_KEEPING].timer!=-1) - def = 100; - //プロボック時は減算 - if( sc_data[SC_PROVOKE].timer!=-1) - def = (def*(100 - 6*sc_data[SC_PROVOKE].val1)+50)/100; - //戦太鼓の響き時は加算 - if( sc_data[SC_DRUMBATTLE].timer!=-1) - def += sc_data[SC_DRUMBATTLE].val3; - //毒にかかっている時は減算 - if(sc_data[SC_POISON].timer!=-1) - def = def*75/100; - //ストリップシールド時は減算 - if(sc_data[SC_STRIPSHIELD].timer!=-1) - def = def*sc_data[SC_STRIPSHIELD].val2/100; - //シグナムクルシス時は減算 - if(sc_data[SC_SIGNUMCRUCIS].timer!=-1) - def = def * (100 - sc_data[SC_SIGNUMCRUCIS].val2)/100; - //永遠の混沌時はDEF0になる - if(sc_data[SC_ETERNALCHAOS].timer!=-1) - def = 0; - //コンセントレーション時は減算 - if( sc_data[SC_CONCENTRATION].timer!=-1) - def = (def*(100 - 5*sc_data[SC_CONCENTRATION].val1))/100; - - if(sc_data[SC_GOSPEL].timer!=-1) { - if (sc_data[SC_GOSPEL].val4 == BCT_PARTY && - sc_data[SC_GOSPEL].val3 == 11) - def += def*25/100; - else if (sc_data[SC_GOSPEL].val4 == BCT_ENEMY && - sc_data[SC_GOSPEL].val3 == 5) - def = 0; - } - } - } - //詠唱中は詠唱時減算率に基づいて減算 - if(skilltimer != -1) { - int def_rate = skill_get_castdef(skillid); - if(def_rate != 0) - def = (def * (100 - def_rate))/100; - } - } - if(def < 0) def = 0; - return def; -} -/*========================================== - * 対象のMDefを返す(汎用) - * 戻りは整数で0以上 - *------------------------------------------ - */ -int battle_get_mdef(struct block_list *bl) -{ - struct status_change *sc_data; - int mdef=0; - - nullpo_retr(0, bl); - sc_data=battle_get_sc_data(bl); - if(bl->type==BL_PC && (struct map_session_data *)bl) - mdef = ((struct map_session_data *)bl)->mdef; - else if(bl->type==BL_MOB && (struct mob_data *)bl) - mdef = mob_db[((struct mob_data *)bl)->class_].mdef; - else if(bl->type==BL_PET && (struct pet_data *)bl) - mdef = mob_db[((struct pet_data *)bl)->class_].mdef; - - if(mdef < 1000000) { - if(sc_data) { - //バリアー状態時はMDEF100 - if(sc_data[SC_BARRIER].timer != -1) - mdef = 100; - //凍結、石化時は1.25倍 - if(sc_data[SC_FREEZE].timer != -1 || (sc_data[SC_STONE].timer != -1 && sc_data[SC_STONE].val2 == 0)) - mdef = mdef*125/100; - if( sc_data[SC_MINDBREAKER].timer!=-1 && bl->type != BL_PC) - mdef -= (mdef*6*sc_data[SC_MINDBREAKER].val1)/100; - } - } - if(mdef < 0) mdef = 0; - return mdef; -} -/*========================================== - * 対象のDef2を返す(汎用) - * 戻りは整数で1以上 - *------------------------------------------ - */ -int battle_get_def2(struct block_list *bl) -{ - struct status_change *sc_data; - int def2=1; - - nullpo_retr(1, bl); - sc_data=battle_get_sc_data(bl); - if(bl->type==BL_PC) - def2 = ((struct map_session_data *)bl)->def2; - else if(bl->type==BL_MOB) - def2 = mob_db[((struct mob_data *)bl)->class_].vit; - else if(bl->type==BL_PET) - def2 = mob_db[((struct pet_data *)bl)->class_].vit; - - if(bl->type != BL_PC && sc_data) { - if( sc_data[SC_ANGELUS].timer!=-1) - def2 = def2*(110+5*sc_data[SC_ANGELUS].val1)/100; - if( sc_data[SC_PROVOKE].timer!=-1) - def2 = (def2*(100 - 6*sc_data[SC_PROVOKE].val1)+50)/100; - if(sc_data[SC_POISON].timer!=-1) - def2 = def2*75/100; - //コンセントレーション時は減算 - if( sc_data[SC_CONCENTRATION].timer!=-1) - def2 = def2*(100 - 5*sc_data[SC_CONCENTRATION].val1)/100; - - if(sc_data[SC_GOSPEL].timer!=-1) { - if (sc_data[SC_GOSPEL].val4 == BCT_PARTY && - sc_data[SC_GOSPEL].val3 == 11) - def2 += def2*25/100; - else if (sc_data[SC_GOSPEL].val4 == BCT_ENEMY && - sc_data[SC_GOSPEL].val3 == 5) - def2 = 0; - } - } - if(def2 < 1) def2 = 1; - return def2; -} -/*========================================== - * 対象のMDef2を返す(汎用) - * 戻りは整数で0以上 - *------------------------------------------ - */ -int battle_get_mdef2(struct block_list *bl) -{ - int mdef2=0; - struct status_change *sc_data=battle_get_sc_data(bl); - - nullpo_retr(0, bl); - if(bl->type==BL_MOB) - mdef2 = mob_db[((struct mob_data *)bl)->class_].int_ + (mob_db[((struct mob_data *)bl)->class_].vit>>1); - else if(bl->type==BL_PC) - mdef2 = ((struct map_session_data *)bl)->mdef2 + (((struct map_session_data *)bl)->paramc[2]>>1); - else if(bl->type==BL_PET) - mdef2 = mob_db[((struct pet_data *)bl)->class_].int_ + (mob_db[((struct pet_data *)bl)->class_].vit>>1); - if(sc_data) { - if( sc_data[SC_MINDBREAKER].timer!=-1 && bl->type != BL_PC) - mdef2 -= (mdef2*6*sc_data[SC_MINDBREAKER].val1)/100; - } - if(mdef2 < 0) mdef2 = 0; - return mdef2; -} -/*========================================== - * 対象のSpeed(移動速度)を返す(汎用) - * 戻りは整数で1以上 - * Speedは小さいほうが移動速度が速い - *------------------------------------------ - */ -int battle_get_speed(struct block_list *bl) -{ - nullpo_retr(1000, bl); - if(bl->type==BL_PC && (struct map_session_data *)bl) - return ((struct map_session_data *)bl)->speed; - else { - struct status_change *sc_data=battle_get_sc_data(bl); - int speed = 1000; - if(bl->type==BL_MOB && (struct mob_data *)bl) { - speed = ((struct mob_data *)bl)->speed; - if(battle_config.mobs_level_up) // increase from mobs leveling up [Valaris] - speed-=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class_].lv; - } - else if(bl->type==BL_PET && (struct pet_data *)bl) - speed = ((struct pet_data *)bl)->msd->petDB->speed; - - if(sc_data) { - //速度増加時は25%減算 - if(sc_data[SC_INCREASEAGI].timer!=-1 && sc_data[SC_DONTFORGETME].timer == -1) - speed -= speed*25/100; - //速度減少時は25%加算 - if(sc_data[SC_DECREASEAGI].timer!=-1) - speed = speed*125/100; - //クァグマイア時は50%加算 - if(sc_data[SC_QUAGMIRE].timer!=-1) - speed = speed*3/2; - //私を忘れないで…時は加算 - if(sc_data[SC_DONTFORGETME].timer!=-1) - speed = speed*(100+sc_data[SC_DONTFORGETME].val1*2 + sc_data[SC_DONTFORGETME].val2 + (sc_data[SC_DONTFORGETME].val3&0xffff))/100; - //金剛時は25%加算 - if(sc_data[SC_STEELBODY].timer!=-1) - speed = speed*125/100; - //ディフェンダー時は加算 - // removed as of 12/14's patch [celest] - /*if(sc_data[SC_DEFENDER].timer!=-1) - speed = (speed * (155 - sc_data[SC_DEFENDER].val1*5)) / 100;*/ - //踊り状態は4倍遅い - if(sc_data[SC_DANCING].timer!=-1 ) - speed *= 6; - //呪い時は450加算 - if(sc_data[SC_CURSE].timer!=-1) - speed = speed + 450; - //ウィンドウォーク時はLv*2%減算 - if(sc_data[SC_WINDWALK].timer!=-1 && sc_data[SC_INCREASEAGI].timer==-1) - speed -= (speed*(sc_data[SC_WINDWALK].val1*2))/100; - if(sc_data[SC_SLOWDOWN].timer!=-1) - speed = speed*150/100; - if(sc_data[SC_SPEEDUP0].timer!=-1) - speed -= speed*25/100; - if(sc_data[SC_GOSPEL].timer!=-1 && - sc_data[SC_GOSPEL].val4 == BCT_ENEMY && - sc_data[SC_GOSPEL].val3 == 8) - speed = speed*125/100; - } - if(speed < 1) speed = 1; - return speed; - } - - return 1000; -} -/*========================================== - * 対象のaDelay(攻撃時ディレイ)を返す(汎用) - * aDelayは小さいほうが攻撃速度が速い - *------------------------------------------ - */ -int battle_get_adelay(struct block_list *bl) -{ - nullpo_retr(4000, bl); - if(bl->type==BL_PC && (struct map_session_data *)bl) - return (((struct map_session_data *)bl)->aspd<<1); - else { - struct status_change *sc_data=battle_get_sc_data(bl); - int adelay=4000,aspd_rate = 100,i; - if(bl->type==BL_MOB && (struct mob_data *)bl) - adelay = mob_db[((struct mob_data *)bl)->class_].adelay; - else if(bl->type==BL_PET && (struct pet_data *)bl) - adelay = mob_db[((struct pet_data *)bl)->class_].adelay; - - if(sc_data) { - //ツーハンドクイッケン使用時でクァグマイアでも私を忘れないで…でもない時は3割減算 - if(sc_data[SC_TWOHANDQUICKEN].timer != -1 && sc_data[SC_QUAGMIRE].timer == -1 && sc_data[SC_DONTFORGETME].timer == -1) // 2HQ - aspd_rate -= 30; - //アドレナリンラッシュ使用時でツーハンドクイッケンでもクァグマイアでも私を忘れないで…でもない時は - if(sc_data[SC_ADRENALINE].timer != -1 && sc_data[SC_TWOHANDQUICKEN].timer == -1 && - sc_data[SC_QUAGMIRE].timer == -1 && sc_data[SC_DONTFORGETME].timer == -1) { // アドレナリンラッシュ - //使用者とパーティメンバーで格差が出る設定でなければ3割減算 - if(sc_data[SC_ADRENALINE].val2 || !battle_config.party_skill_penalty) - aspd_rate -= 30; - //そうでなければ2.5割減算 - else - aspd_rate -= 25; - } - //スピアクィッケン時は減算 - if(sc_data[SC_SPEARSQUICKEN].timer != -1 && sc_data[SC_ADRENALINE].timer == -1 && - sc_data[SC_TWOHANDQUICKEN].timer == -1 && sc_data[SC_QUAGMIRE].timer == -1 && sc_data[SC_DONTFORGETME].timer == -1) // スピアクィッケン - aspd_rate -= sc_data[SC_SPEARSQUICKEN].val2; - //夕日のアサシンクロス時は減算 - if(sc_data[SC_ASSNCROS].timer!=-1 && // 夕陽のアサシンクロス - sc_data[SC_TWOHANDQUICKEN].timer==-1 && sc_data[SC_ADRENALINE].timer==-1 && sc_data[SC_SPEARSQUICKEN].timer==-1 && - sc_data[SC_DONTFORGETME].timer == -1) - aspd_rate -= 5+sc_data[SC_ASSNCROS].val1+sc_data[SC_ASSNCROS].val2+sc_data[SC_ASSNCROS].val3; - //私を忘れないで…時は加算 - if(sc_data[SC_DONTFORGETME].timer!=-1) // 私を忘れないで - aspd_rate += sc_data[SC_DONTFORGETME].val1*3 + sc_data[SC_DONTFORGETME].val2 + (sc_data[SC_DONTFORGETME].val3>>16); - //金剛時25%加算 - if(sc_data[SC_STEELBODY].timer!=-1) // 金剛 - aspd_rate += 25; - //増速ポーション使用時は減算 - if( sc_data[i=SC_SPEEDPOTION3].timer!=-1 || sc_data[i=SC_SPEEDPOTION2].timer!=-1 || sc_data[i=SC_SPEEDPOTION1].timer!=-1 || sc_data[i=SC_SPEEDPOTION0].timer!=-1) - aspd_rate -= sc_data[i].val2; - //ディフェンダー時は加算 - if(sc_data[SC_DEFENDER].timer != -1) - adelay += (1100 - sc_data[SC_DEFENDER].val1*100); - if(sc_data[SC_GOSPEL].timer!=-1 && - sc_data[SC_GOSPEL].val4 == BCT_ENEMY && - sc_data[SC_GOSPEL].val3 == 8) - aspd_rate = aspd_rate*125/100; - } - if(aspd_rate != 100) - adelay = adelay*aspd_rate/100; - if(adelay < battle_config.monster_max_aspd<<1) adelay = battle_config.monster_max_aspd<<1; - return adelay; - } - return 4000; -} -int battle_get_amotion(struct block_list *bl) -{ - nullpo_retr(2000, bl); - if(bl->type==BL_PC && (struct map_session_data *)bl) - return ((struct map_session_data *)bl)->amotion; - else { - struct status_change *sc_data=battle_get_sc_data(bl); - int amotion=2000,aspd_rate = 100,i; - if(bl->type==BL_MOB && (struct mob_data *)bl) - amotion = mob_db[((struct mob_data *)bl)->class_].amotion; - else if(bl->type==BL_PET && (struct pet_data *)bl) - amotion = mob_db[((struct pet_data *)bl)->class_].amotion; - - if(sc_data) { - if(sc_data[SC_TWOHANDQUICKEN].timer != -1 && sc_data[SC_QUAGMIRE].timer == -1 && sc_data[SC_DONTFORGETME].timer == -1) // 2HQ - aspd_rate -= 30; - if(sc_data[SC_ADRENALINE].timer != -1 && sc_data[SC_TWOHANDQUICKEN].timer == -1 && - sc_data[SC_QUAGMIRE].timer == -1 && sc_data[SC_DONTFORGETME].timer == -1) { // アドレナリンラッシュ - if(sc_data[SC_ADRENALINE].val2 || !battle_config.party_skill_penalty) - aspd_rate -= 30; - else - aspd_rate -= 25; - } - if(sc_data[SC_SPEARSQUICKEN].timer != -1 && sc_data[SC_ADRENALINE].timer == -1 && - sc_data[SC_TWOHANDQUICKEN].timer == -1 && sc_data[SC_QUAGMIRE].timer == -1 && sc_data[SC_DONTFORGETME].timer == -1) // スピアクィッケン - aspd_rate -= sc_data[SC_SPEARSQUICKEN].val2; - if(sc_data[SC_ASSNCROS].timer!=-1 && // 夕陽のアサシンクロス - sc_data[SC_TWOHANDQUICKEN].timer==-1 && sc_data[SC_ADRENALINE].timer==-1 && sc_data[SC_SPEARSQUICKEN].timer==-1 && - sc_data[SC_DONTFORGETME].timer == -1) - aspd_rate -= 5+sc_data[SC_ASSNCROS].val1+sc_data[SC_ASSNCROS].val2+sc_data[SC_ASSNCROS].val3; - if(sc_data[SC_DONTFORGETME].timer!=-1) // 私を忘れないで - aspd_rate += sc_data[SC_DONTFORGETME].val1*3 + sc_data[SC_DONTFORGETME].val2 + (sc_data[SC_DONTFORGETME].val3>>16); - if(sc_data[SC_STEELBODY].timer!=-1) // 金剛 - aspd_rate += 25; - if( sc_data[i=SC_SPEEDPOTION3].timer!=-1 || sc_data[i=SC_SPEEDPOTION2].timer!=-1 || sc_data[i=SC_SPEEDPOTION1].timer!=-1 || sc_data[i=SC_SPEEDPOTION0].timer!=-1) - aspd_rate -= sc_data[i].val2; - if(sc_data[SC_DEFENDER].timer != -1) - amotion += (550 - sc_data[SC_DEFENDER].val1*50); - } - if(aspd_rate != 100) - amotion = amotion*aspd_rate/100; - if(amotion < battle_config.monster_max_aspd) amotion = battle_config.monster_max_aspd; - return amotion; - } - return 2000; -} -int battle_get_dmotion(struct block_list *bl) -{ - int ret; - struct status_change *sc_data; - - nullpo_retr(0, bl); - sc_data = battle_get_sc_data(bl); - if(bl->type==BL_MOB && (struct mob_data *)bl){ - ret=mob_db[((struct mob_data *)bl)->class_].dmotion; - if(battle_config.monster_damage_delay_rate != 100) - ret = ret*battle_config.monster_damage_delay_rate/400; - } - else if(bl->type==BL_PC && (struct map_session_data *)bl){ - ret=((struct map_session_data *)bl)->dmotion; - if(battle_config.pc_damage_delay_rate != 100) - ret = ret*battle_config.pc_damage_delay_rate/400; - } - else if(bl->type==BL_PET && (struct pet_data *)bl) - ret=mob_db[((struct pet_data *)bl)->class_].dmotion; - else - return 2000; - - if((sc_data && (sc_data[SC_ENDURE].timer!=-1 || sc_data[SC_BERSERK].timer!=-1)) || - (bl->type == BL_PC && ((struct map_session_data *)bl)->special_state.infinite_endure)) - ret=0; - - return ret; -} -int battle_get_element(struct block_list *bl) -{ - int ret = 20; - struct status_change *sc_data; - - nullpo_retr(ret, bl); - sc_data = battle_get_sc_data(bl); - if(bl->type==BL_MOB && (struct mob_data *)bl) // 10の位=Lv*2、1の位=属性 - ret=((struct mob_data *)bl)->def_ele; - else if(bl->type==BL_PC && (struct map_session_data *)bl) - ret=20+((struct map_session_data *)bl)->def_ele; // 防御属性Lv1 - else if(bl->type==BL_PET && (struct pet_data *)bl) - ret = mob_db[((struct pet_data *)bl)->class_].element; - - if(sc_data) { - if( sc_data[SC_BENEDICTIO].timer!=-1 ) // 聖体降福 - ret=26; - if( sc_data[SC_FREEZE].timer!=-1 ) // 凍結 - ret=21; - if( sc_data[SC_STONE].timer!=-1 && sc_data[SC_STONE].val2==0) - ret=22; - } - - return ret; -} -int battle_get_attack_element(struct block_list *bl) -{ - int ret = 0; - struct status_change *sc_data=battle_get_sc_data(bl); - - nullpo_retr(0, bl); - if(bl->type==BL_MOB && (struct mob_data *)bl) - ret=0; - else if(bl->type==BL_PC && (struct map_session_data *)bl) - ret=((struct map_session_data *)bl)->atk_ele; - else if(bl->type==BL_PET && (struct pet_data *)bl) - ret=0; - - if(sc_data) { - if( sc_data[SC_FROSTWEAPON].timer!=-1) // フロストウェポン - ret=1; - if( sc_data[SC_SEISMICWEAPON].timer!=-1) // サイズミックウェポン - ret=2; - if( sc_data[SC_FLAMELAUNCHER].timer!=-1) // フレームランチャー - ret=3; - if( sc_data[SC_LIGHTNINGLOADER].timer!=-1) // ライトニングローダー - ret=4; - if( sc_data[SC_ENCPOISON].timer!=-1) // エンチャントポイズン - ret=5; - if( sc_data[SC_ASPERSIO].timer!=-1) // アスペルシオ - ret=6; - } - - return ret; -} -int battle_get_attack_element2(struct block_list *bl) -{ - nullpo_retr(0, bl); - if(bl->type==BL_PC && (struct map_session_data *)bl) { - int ret = ((struct map_session_data *)bl)->atk_ele_; - struct status_change *sc_data = ((struct map_session_data *)bl)->sc_data; - - if(sc_data) { - if( sc_data[SC_FROSTWEAPON].timer!=-1) // フロストウェポン - ret=1; - if( sc_data[SC_SEISMICWEAPON].timer!=-1) // サイズミックウェポン - ret=2; - if( sc_data[SC_FLAMELAUNCHER].timer!=-1) // フレームランチャー - ret=3; - if( sc_data[SC_LIGHTNINGLOADER].timer!=-1) // ライトニングローダー - ret=4; - if( sc_data[SC_ENCPOISON].timer!=-1) // エンチャントポイズン - ret=5; - if( sc_data[SC_ASPERSIO].timer!=-1) // アスペルシオ - ret=6; - } - return ret; - } - return 0; -} -int battle_get_party_id(struct block_list *bl) -{ - nullpo_retr(0, bl); - if(bl->type==BL_PC && (struct map_session_data *)bl) - return ((struct map_session_data *)bl)->status.party_id; - else if(bl->type==BL_MOB && (struct mob_data *)bl){ - struct mob_data *md=(struct mob_data *)bl; - if( md->master_id>0 ) - return -md->master_id; - return -md->bl.id; - } - else if(bl->type==BL_SKILL && (struct skill_unit *)bl) - return ((struct skill_unit *)bl)->group->party_id; - else - return 0; -} -int battle_get_guild_id(struct block_list *bl) -{ - nullpo_retr(0, bl); - if(bl->type==BL_PC && (struct map_session_data *)bl) - return ((struct map_session_data *)bl)->status.guild_id; - else if(bl->type==BL_MOB && (struct mob_data *)bl) - return ((struct mob_data *)bl)->class_; - else if(bl->type==BL_SKILL && (struct skill_unit *)bl) - return ((struct skill_unit *)bl)->group->guild_id; - else - return 0; -} -int battle_get_race(struct block_list *bl) -{ - nullpo_retr(0, bl); - if(bl->type==BL_MOB && (struct mob_data *)bl) - return mob_db[((struct mob_data *)bl)->class_].race; - else if(bl->type==BL_PC && (struct map_session_data *)bl) - return 7; - else if(bl->type==BL_PET && (struct pet_data *)bl) - return mob_db[((struct pet_data *)bl)->class_].race; - else - return 0; -} -int battle_get_size(struct block_list *bl) -{ - nullpo_retr(1, bl); - if(bl->type==BL_MOB && (struct mob_data *)bl) - return mob_db[((struct mob_data *)bl)->class_].size; - else if(bl->type==BL_PC && (struct map_session_data *)bl) - return 1; - else if(bl->type==BL_PET && (struct pet_data *)bl) - return mob_db[((struct pet_data *)bl)->class_].size; - else - return 1; -} -int battle_get_mode(struct block_list *bl) -{ - nullpo_retr(0x01, bl); - if(bl->type==BL_MOB && (struct mob_data *)bl) - return mob_db[((struct mob_data *)bl)->class_].mode; - else if(bl->type==BL_PET && (struct pet_data *)bl) - return mob_db[((struct pet_data *)bl)->class_].mode; - else - return 0x01; // とりあえず動くということで1 -} - -int battle_get_mexp(struct block_list *bl) -{ - nullpo_retr(0, bl); - if(bl->type==BL_MOB && (struct mob_data *)bl) - return mob_db[((struct mob_data *)bl)->class_].mexp; - else if(bl->type==BL_PET && (struct pet_data *)bl) - return mob_db[((struct pet_data *)bl)->class_].mexp; - else - return 0; -} - -// StatusChange系の所得 -struct status_change *battle_get_sc_data(struct block_list *bl) -{ - nullpo_retr(NULL, bl); - if(bl->type==BL_MOB && (struct mob_data *)bl) - return ((struct mob_data*)bl)->sc_data; - else if(bl->type==BL_PC && (struct map_session_data *)bl) - return ((struct map_session_data*)bl)->sc_data; - return NULL; -} -short *battle_get_sc_count(struct block_list *bl) -{ - nullpo_retr(NULL, bl); - if(bl->type==BL_MOB && (struct mob_data *)bl) - return &((struct mob_data*)bl)->sc_count; - else if(bl->type==BL_PC && (struct map_session_data *)bl) - return &((struct map_session_data*)bl)->sc_count; - return NULL; -} -short *battle_get_opt1(struct block_list *bl) -{ - nullpo_retr(0, bl); - if(bl->type==BL_MOB && (struct mob_data *)bl) - return &((struct mob_data*)bl)->opt1; - else if(bl->type==BL_PC && (struct map_session_data *)bl) - return &((struct map_session_data*)bl)->opt1; - else if(bl->type==BL_NPC && (struct npc_data *)bl) - return &((struct npc_data*)bl)->opt1; - return 0; -} -short *battle_get_opt2(struct block_list *bl) -{ - nullpo_retr(0, bl); - if(bl->type==BL_MOB && (struct mob_data *)bl) - return &((struct mob_data*)bl)->opt2; - else if(bl->type==BL_PC && (struct map_session_data *)bl) - return &((struct map_session_data*)bl)->opt2; - else if(bl->type==BL_NPC && (struct npc_data *)bl) - return &((struct npc_data*)bl)->opt2; - return 0; -} -short *battle_get_opt3(struct block_list *bl) -{ - nullpo_retr(0, bl); - if(bl->type==BL_MOB && (struct mob_data *)bl) - return &((struct mob_data*)bl)->opt3; - else if(bl->type==BL_PC && (struct map_session_data *)bl) - return &((struct map_session_data*)bl)->opt3; - else if(bl->type==BL_NPC && (struct npc_data *)bl) - return &((struct npc_data*)bl)->opt3; - return 0; -} -short *battle_get_option(struct block_list *bl) -{ - nullpo_retr(0, bl); - if(bl->type==BL_MOB && (struct mob_data *)bl) - return &((struct mob_data*)bl)->option; - else if(bl->type==BL_PC && (struct map_session_data *)bl) - return &((struct map_session_data*)bl)->status.option; - else if(bl->type==BL_NPC && (struct npc_data *)bl) - return &((struct npc_data*)bl)->option; - return 0; -} - -//------------------------------------------------------------------- // ダメージの遅延 struct battle_delay_damage_ { @@ -1386,7 +91,7 @@ int battle_delay_damage(unsigned int tick,struct block_list *src,struct block_li int battle_damage(struct block_list *bl,struct block_list *target,int damage,int flag) { struct map_session_data *sd=NULL; - struct status_change *sc_data=battle_get_sc_data(target); + struct status_change *sc_data=status_get_sc_data(target); short *sc_count; int i; @@ -1409,14 +114,14 @@ int battle_damage(struct block_list *bl,struct block_list *target,int damage,int if(damage<0) return battle_heal(bl,target,-damage,0,flag); - if(!flag && (sc_count=battle_get_sc_count(target))!=NULL && *sc_count>0){ + if(!flag && (sc_count=status_get_sc_count(target))!=NULL && *sc_count>0){ // 凍結、石化、睡眠を消去 if(sc_data[SC_FREEZE].timer!=-1) - skill_status_change_end(target,SC_FREEZE,-1); + status_change_end(target,SC_FREEZE,-1); if(sc_data[SC_STONE].timer!=-1 && sc_data[SC_STONE].val2==0) - skill_status_change_end(target,SC_STONE,-1); + status_change_end(target,SC_STONE,-1); if(sc_data[SC_SLEEP].timer!=-1) - skill_status_change_end(target,SC_SLEEP,-1); + status_change_end(target,SC_SLEEP,-1); } if(target->type==BL_MOB){ // MOB @@ -1539,12 +244,12 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i nullpo_retr(0, bl); - class_ = battle_get_class(bl); + class_ = status_get_class(bl); if(bl->type==BL_MOB) md=(struct mob_data *)bl; else sd=(struct map_session_data *)bl; - sc_data=battle_get_sc_data(bl); - sc_count=battle_get_sc_count(bl); + sc_data=status_get_sc_data(bl); + sc_count=status_get_sc_count(bl); if(sc_count!=NULL && *sc_count>0){ @@ -1570,28 +275,28 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i if(sc_data[SC_AETERNA].timer!=-1 && damage>0){ // レックスエーテルナ damage<<=1; - skill_status_change_end( bl,SC_AETERNA,-1 ); + status_change_end( bl,SC_AETERNA,-1 ); } //属性場のダメージ増加 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; - else if(!flag&BF_SKILL && battle_get_attack_element(bl)==3) + else if(!flag&BF_SKILL && status_get_attack_element(bl)==3) damage += damage*sc_data[SC_VOLCANO].val4/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; - else if(!flag&BF_SKILL && battle_get_attack_element(bl)==4) + else if(!flag&BF_SKILL && status_get_attack_element(bl)==4) damage += damage*sc_data[SC_VIOLENTGALE].val4/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; - else if(!flag&BF_SKILL && battle_get_attack_element(bl)==1) + else if(!flag&BF_SKILL && status_get_attack_element(bl)==1) damage += damage*sc_data[SC_DELUGE].val4/100; } @@ -1605,7 +310,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i clif_updatestatus(sd,SP_SP); } if(sd->status.sp<=0) - skill_status_change_end( bl,SC_ENERGYCOAT,-1 ); + status_change_end( bl,SC_ENERGYCOAT,-1 ); } else damage -= damage * (sc_data[SC_ENERGYCOAT].val1 * 6) / 100; @@ -1619,7 +324,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i else damage=-sc->val2; } if((--sc->val3)<=0 || (sc->val2<=0) || skill_num == AL_HOLYLIGHT) - skill_status_change_end(bl, SC_KYRIE, -1); + status_change_end(bl, SC_KYRIE, -1); } if(sc_data[SC_BASILICA].timer!=-1 && damage > 0){ @@ -1672,14 +377,14 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i //エフェクトもこれでいいのかわかんねぇ clif_skill_nodamage(bl,bl,ST_REJECTSWORD,sc_data[SC_REJECTSWORD].val1,1); if((--sc_data[SC_REJECTSWORD].val2)<=0) - skill_status_change_end(bl, SC_REJECTSWORD, -1); + status_change_end(bl, SC_REJECTSWORD, -1); } } if(sc_data[SC_SPIDERWEB].timer!=-1 && damage > 0) // [Celest] if ((flag&BF_SKILL && skill_get_pl(skill_num)==3) || - (!flag&BF_SKILL && battle_get_attack_element(src)==3)) { + (!flag&BF_SKILL && status_get_attack_element(src)==3)) { damage<<=1; - skill_status_change_end(bl, SC_SPIDERWEB, -1); + status_change_end(bl, SC_SPIDERWEB, -1); } if(sc_data[SC_FOGWALL].timer != -1 && flag&BF_MAGIC) @@ -1777,14 +482,14 @@ int battle_calc_drain(int damage, int rate, int per, int val) int battle_addmastery(struct map_session_data *sd,struct block_list *target,int dmg,int type) { int damage,skill; - int race=battle_get_race(target); + int race=status_get_race(target); int weapon; damage = 0; nullpo_retr(0, sd); // デーモンベイン(+3 〜 +30) vs 不死 or 悪魔 (死人は含めない?) - if((skill = pc_checkskill(sd,AL_DEMONBANE)) > 0 && (battle_check_undead(race,battle_get_elem_type(target)) || race==6) ) + if((skill = pc_checkskill(sd,AL_DEMONBANE)) > 0 && (battle_check_undead(race,status_get_elem_type(target)) || race==6) ) damage += (skill*(int)(3+(sd->status.base_level+1)*0.05)); // submitted by orn //damage += (skill * 3); @@ -1903,9 +608,9 @@ static struct Damage battle_calc_pet_weapon_attack( struct mob_data *tmd=NULL; int hitrate,flee,cri = 0,atkmin,atkmax; int luk,target_count = 1; - int def1 = battle_get_def(target); - int def2 = battle_get_def2(target); - int t_vit = battle_get_vit(target); + int def1 = status_get_def(target); + int def2 = status_get_def2(target); + int t_vit = status_get_vit(target); struct Damage wd; int damage,damage2=0,type,div_,blewcount=skill_get_blewcount(skill_num,skill_lv); int flag,dmg_lv=0; @@ -1919,8 +624,8 @@ static struct Damage battle_calc_pet_weapon_attack( return wd; } - s_race=battle_get_race(src); - s_ele=battle_get_attack_element(src); + s_race=status_get_race(src); + s_ele=status_get_attack_element(src); // ターゲット if(target->type == BL_MOB) @@ -1929,15 +634,15 @@ static struct Damage battle_calc_pet_weapon_attack( memset(&wd,0,sizeof(wd)); return wd; } - t_race=battle_get_race( target ); - t_size=battle_get_size( target ); - t_mode=battle_get_mode( target ); - t_sc_data=battle_get_sc_data( target ); + t_race=status_get_race( target ); + t_size=status_get_size( target ); + t_mode=status_get_mode( target ); + t_sc_data=status_get_sc_data( target ); flag=BF_SHORT|BF_WEAPON|BF_NORMAL; // 攻撃の種類の設定 // 回避率計算、回避判定は後で - flee = battle_get_flee(target); + flee = status_get_flee(target); if(battle_config.agi_penalty_type > 0 || battle_config.vit_penalty_type > 0) target_count += battle_counttargeted(target,src,battle_config.agi_penalty_count_lv); if(battle_config.agi_penalty_type > 0) { @@ -1949,32 +654,32 @@ static struct Damage battle_calc_pet_weapon_attack( if(flee < 1) flee = 1; } } - hitrate=battle_get_hit(src) - flee + 80; + hitrate=status_get_hit(src) - flee + 80; type=0; // normal div_ = 1; // single attack - luk=battle_get_luk(src); + luk=status_get_luk(src); if(battle_config.pet_str) - damage = battle_get_baseatk(src); + damage = status_get_baseatk(src); else damage = 0; if(skill_num==HW_MAGICCRASHER){ /* マジッククラッシャーはMATKで殴る */ - atkmin = battle_get_matk1(src); - atkmax = battle_get_matk2(src); + atkmin = status_get_matk1(src); + atkmax = status_get_matk2(src); }else{ - atkmin = battle_get_atk(src); - atkmax = battle_get_atk2(src); + atkmin = status_get_atk(src); + atkmax = status_get_atk2(src); } if(mob_db[pd->class_].range>3 ) flag=(flag&~BF_RANGEMASK)|BF_LONG; if(atkmin > atkmax) atkmin = atkmax; - cri = battle_get_critical(src); - cri -= battle_get_luk(target) * 2; // luk/5*10 => target_luk*2 not target_luk*3 + cri = status_get_critical(src); + cri -= status_get_luk(target) * 2; // luk/5*10 => target_luk*2 not target_luk*3 if(battle_config.enemy_critical_rate != 100) { cri = cri*battle_config.enemy_critical_rate/100; if(cri < 1) @@ -2286,22 +991,22 @@ static struct Damage battle_calc_pet_weapon_attack( // 属 性の適用 if(skill_num != 0 || s_ele != 0 || !battle_config.pet_attack_attr_none) - damage=battle_attr_fix(damage, s_ele, battle_get_element(target) ); + damage=battle_attr_fix(damage, s_ele, status_get_element(target) ); if(skill_num==PA_PRESSURE) /* プレッシャー 必中? */ damage = 500+300*skill_lv; // インベナム修正 if(skill_num==TF_POISON){ - damage = battle_attr_fix(damage + 15*skill_lv, s_ele, battle_get_element(target) ); + damage = battle_attr_fix(damage + 15*skill_lv, s_ele, status_get_element(target) ); } if(skill_num==MC_CARTREVOLUTION){ - damage = battle_attr_fix(damage, 0, battle_get_element(target) ); + damage = battle_attr_fix(damage, 0, status_get_element(target) ); } // 完全回避の判定 if(battle_config.enemy_perfect_flee) { - if(skill_num == 0 && tmd!=NULL && rand()%1000 < battle_get_flee2(target) ){ + if(skill_num == 0 && tmd!=NULL && rand()%1000 < status_get_flee2(target) ){ damage=0; type=0x0b; dmg_lv = ATK_LUCKY; @@ -2319,10 +1024,10 @@ static struct Damage battle_calc_pet_weapon_attack( wd.damage2=0; wd.type=type; wd.div_=div_; - wd.amotion=battle_get_amotion(src); + wd.amotion=status_get_amotion(src); if(skill_num == KN_AUTOCOUNTER) wd.amotion >>= 1; - wd.dmotion=battle_get_dmotion(target); + wd.dmotion=status_get_dmotion(target); wd.blewcount=blewcount; wd.flag=flag; wd.dmg_lv=dmg_lv; @@ -2337,9 +1042,9 @@ static struct Damage battle_calc_mob_weapon_attack( struct mob_data* md=(struct mob_data *)src,*tmd=NULL; int hitrate,flee,cri = 0,atkmin,atkmax; int luk,target_count = 1; - int def1 = battle_get_def(target); - int def2 = battle_get_def2(target); - int t_vit = battle_get_vit(target); + int def1 = status_get_def(target); + int def2 = status_get_def2(target); + int t_vit = status_get_vit(target); struct Damage wd; int damage,damage2=0,type,div_,blewcount=skill_get_blewcount(skill_num,skill_lv); int flag,skill,ac_flag = 0,dmg_lv = 0; @@ -2355,35 +1060,35 @@ static struct Damage battle_calc_mob_weapon_attack( return wd; } - s_race=battle_get_race(src); - s_ele=battle_get_attack_element(src); - sc_data=battle_get_sc_data(src); - sc_count=battle_get_sc_count(src); - option=battle_get_option(src); - opt1=battle_get_opt1(src); - opt2=battle_get_opt2(src); + s_race = status_get_race(src); + s_ele = status_get_attack_element(src); + sc_data = status_get_sc_data(src); + sc_count = status_get_sc_count(src); + option = status_get_option(src); + opt1 = status_get_opt1(src); + opt2 = status_get_opt2(src); // ターゲット - if(target->type==BL_PC) - tsd=(struct map_session_data *)target; - else if(target->type==BL_MOB) - tmd=(struct mob_data *)target; - t_race=battle_get_race( target ); - t_size=battle_get_size( target ); - t_mode=battle_get_mode( target ); - t_sc_data=battle_get_sc_data( target ); - - if((skill_num == 0 || (target->type == BL_PC && battle_config.pc_auto_counter_type&2) || - (target->type == BL_MOB && battle_config.monster_auto_counter_type&2)) && skill_lv >= 0) { + if(target->type == BL_PC) + tsd = (struct map_session_data *)target; + else if(target->type == BL_MOB) + tmd = (struct mob_data *)target; + t_race = status_get_race( target ); + t_size = status_get_size( target ); + t_mode = status_get_mode( target ); + t_sc_data = status_get_sc_data( target ); + + if(skill_num == 0 || (target->type == BL_PC && battle_config.pc_auto_counter_type&2) || + (target->type == BL_MOB && battle_config.monster_auto_counter_type&2)) { if(skill_num != CR_GRANDCROSS && t_sc_data && t_sc_data[SC_AUTOCOUNTER].timer != -1) { - int dir = map_calc_dir(src,target->x,target->y),t_dir = battle_get_dir(target); + int dir = map_calc_dir(src,target->x,target->y),t_dir = status_get_dir(target); int dist = distance(src->x,src->y,target->x,target->y); if(dist <= 0 || map_check_dir(dir,t_dir) ) { memset(&wd,0,sizeof(wd)); t_sc_data[SC_AUTOCOUNTER].val3 = 0; t_sc_data[SC_AUTOCOUNTER].val4 = 1; if(sc_data && sc_data[SC_AUTOCOUNTER].timer == -1) { - int range = battle_get_range(target); + int range = status_get_range(target); if((target->type == BL_PC && ((struct map_session_data *)target)->status.weapon != 11 && dist <= range+1) || (target->type == BL_MOB && range <= 3 && dist <= range+1) ) t_sc_data[SC_AUTOCOUNTER].val3 = src->id; @@ -2400,7 +1105,7 @@ static struct Damage battle_calc_mob_weapon_attack( flag=BF_SHORT|BF_WEAPON|BF_NORMAL; // 攻撃の種類の設定 // 回避率計算、回避判定は後で - flee = battle_get_flee(target); + flee = status_get_flee(target); if(battle_config.agi_penalty_type > 0 || battle_config.vit_penalty_type > 0) target_count += battle_counttargeted(target,src,battle_config.agi_penalty_count_lv); if(battle_config.agi_penalty_type > 0) { @@ -2412,23 +1117,23 @@ static struct Damage battle_calc_mob_weapon_attack( if(flee < 1) flee = 1; } } - hitrate=battle_get_hit(src) - flee + 80; + hitrate=status_get_hit(src) - flee + 80; type=0; // normal div_ = 1; // single attack - luk=battle_get_luk(src); + luk=status_get_luk(src); if(battle_config.enemy_str) - damage = battle_get_baseatk(src); + damage = status_get_baseatk(src); else damage = 0; if(skill_num==HW_MAGICCRASHER){ /* マジッククラッシャーはMATKで殴る */ - atkmin = battle_get_matk1(src); - atkmax = battle_get_matk2(src); + atkmin = status_get_matk1(src); + atkmax = status_get_matk2(src); }else{ - atkmin = battle_get_atk(src); - atkmax = battle_get_atk2(src); + atkmin = status_get_atk(src); + atkmax = status_get_atk2(src); } if(mob_db[md->class_].range>3 ) flag=(flag&~BF_RANGEMASK)|BF_LONG; @@ -2439,8 +1144,8 @@ static struct Damage battle_calc_mob_weapon_attack( atkmin=atkmax; } - cri = battle_get_critical(src); - cri -= battle_get_luk(target) * 3; + cri = status_get_critical(src); + cri -= status_get_luk(target) * 3; if(battle_config.enemy_critical_rate != 100) { cri = cri*battle_config.enemy_critical_rate/100; if(cri < 1) @@ -2736,7 +1441,7 @@ static struct Damage battle_calc_mob_weapon_attack( } } t_def = def2*8/10; - if(battle_check_undead(s_race,battle_get_elem_type(src)) || s_race==6) + if(battle_check_undead(s_race,status_get_elem_type(src)) || s_race==6) if(tsd && (skill=pc_checkskill(tsd,AL_DP)) > 0 ) t_def += skill* (int) (3 + (tsd->status.base_level+1)*0.04); // submitted by orn //t_def += skill*3; @@ -2814,10 +1519,10 @@ static struct Damage battle_calc_mob_weapon_attack( // 属 性の適用 if (!((battle_config.mob_ghostring_fix == 1) && - (battle_get_elem_type(target) == 8) && + (status_get_elem_type(target) == 8) && (target->type==BL_PC))) // [MouseJstr] if(skill_num != 0 || s_ele != 0 || !battle_config.mob_attack_attr_none) - damage=battle_attr_fix(damage, s_ele, battle_get_element(target) ); + damage=battle_attr_fix(damage, s_ele, status_get_element(target) ); //if(sc_data && sc_data[SC_AURABLADE].timer!=-1) /* オーラブレード 必中 */ // damage += sc_data[SC_AURABLADE].val1 * 10; @@ -2826,21 +1531,21 @@ static struct Damage battle_calc_mob_weapon_attack( // インベナム修正 if(skill_num==TF_POISON){ - damage = battle_attr_fix(damage + 15*skill_lv, s_ele, battle_get_element(target) ); + damage = battle_attr_fix(damage + 15*skill_lv, s_ele, status_get_element(target) ); } if(skill_num==MC_CARTREVOLUTION){ - damage = battle_attr_fix(damage, 0, battle_get_element(target) ); + damage = battle_attr_fix(damage, 0, status_get_element(target) ); } // 完全回避の判定 - if(skill_num == 0 && tsd!=NULL && rand()%1000 < battle_get_flee2(target) ){ + if(skill_num == 0 && tsd!=NULL && rand()%1000 < status_get_flee2(target) ){ damage=0; type=0x0b; dmg_lv = ATK_LUCKY; } if(battle_config.enemy_perfect_flee) { - if(skill_num == 0 && tmd!=NULL && rand()%1000 < battle_get_flee2(target) ){ + if(skill_num == 0 && tmd!=NULL && rand()%1000 < status_get_flee2(target) ){ damage=0; type=0x0b; dmg_lv = ATK_LUCKY; @@ -2861,10 +1566,10 @@ static struct Damage battle_calc_mob_weapon_attack( wd.damage2=0; wd.type=type; wd.div_=div_; - wd.amotion=battle_get_amotion(src); + wd.amotion=status_get_amotion(src); if(skill_num == KN_AUTOCOUNTER) wd.amotion >>= 1; - wd.dmotion=battle_get_dmotion(target); + wd.dmotion=status_get_dmotion(target); wd.blewcount=blewcount; wd.flag=flag; wd.dmg_lv=dmg_lv; @@ -2883,10 +1588,10 @@ static struct Damage battle_calc_pc_weapon_attack( int hitrate,flee,cri = 0,atkmin,atkmax; int dex,luk,target_count = 1; int no_cardfix=0; - int def1 = battle_get_def(target); - int def2 = battle_get_def2(target); + int def1 = status_get_def(target); + int def2 = status_get_def2(target); // int mdef1, mdef2; - int t_vit = battle_get_vit(target); + int t_vit = status_get_vit(target); struct Damage wd; int damage,damage2,damage3=0,damage4=0,type,div_,blewcount=skill_get_blewcount(skill_num,skill_lv); int flag,skill,dmg_lv = 0; @@ -2908,14 +1613,14 @@ static struct Damage battle_calc_pc_weapon_attack( // アタッカー - s_race=battle_get_race(src); //種族 - s_ele=battle_get_attack_element(src); //属性 - s_ele_=battle_get_attack_element2(src); //左手属性 - sc_data=battle_get_sc_data(src); //ステータス異常 - sc_count=battle_get_sc_count(src); //ステータス異常の数 - option=battle_get_option(src); //鷹とかペコとかカートとか - opt1=battle_get_opt1(src); //石化、凍結、スタン、睡眠、暗闇 - opt2=battle_get_opt2(src); //毒、呪い、沈黙、暗闇? + s_race=status_get_race(src); //種族 + s_ele=status_get_attack_element(src); //属性 + s_ele_=status_get_attack_element2(src); //左手属性 + sc_data=status_get_sc_data(src); //ステータス異常 + sc_count=status_get_sc_count(src); //ステータス異常の数 + option=status_get_option(src); //鷹とかペコとかカートとか + opt1=status_get_opt1(src); //石化、凍結、スタン、睡眠、暗闇 + opt2=status_get_opt2(src); //毒、呪い、沈黙、暗闇? if(skill_num != CR_GRANDCROSS) //グランドクロスでないなら sd->state.attack_type = BF_WEAPON; //攻撃タイプは武器攻撃 @@ -2925,24 +1630,24 @@ static struct Damage battle_calc_pc_weapon_attack( tsd=(struct map_session_data *)target; //tsdに代入(tmdはNULL) else if(target->type==BL_MOB) //対象がMobなら tmd=(struct mob_data *)target; //tmdに代入(tsdはNULL) - t_race=battle_get_race( target ); //対象の種族 - t_ele=battle_get_elem_type(target); //対象の属性 - t_size=battle_get_size( target ); //対象のサイズ - t_mode=battle_get_mode( target ); //対象のMode - t_sc_data=battle_get_sc_data( target ); //対象のステータス異常 + t_race=status_get_race( target ); //対象の種族 + t_ele=status_get_elem_type(target); //対象の属性 + t_size=status_get_size( target ); //対象のサイズ + t_mode=status_get_mode( target ); //対象のMode + t_sc_data=status_get_sc_data( target ); //対象のステータス異常 //オートカウンター処理ここから - if((skill_num == 0 || (target->type == BL_PC && battle_config.pc_auto_counter_type&2) || - (target->type == BL_MOB && battle_config.monster_auto_counter_type&2)) && skill_lv >= 0) { + if(skill_num == 0 || (target->type == BL_PC && battle_config.pc_auto_counter_type&2) || + (target->type == BL_MOB && battle_config.monster_auto_counter_type&2)) { if(skill_num != CR_GRANDCROSS && t_sc_data && t_sc_data[SC_AUTOCOUNTER].timer != -1) { //グランドクロスでなく、対象がオートカウンター状態の場合 - int dir = map_calc_dir(src,target->x,target->y),t_dir = battle_get_dir(target); + int dir = map_calc_dir(src,target->x,target->y),t_dir = status_get_dir(target); int dist = distance(src->x,src->y,target->x,target->y); if(dist <= 0 || map_check_dir(dir,t_dir) ) { //対象との距離が0以下、または対象の正面? memset(&wd,0,sizeof(wd)); t_sc_data[SC_AUTOCOUNTER].val3 = 0; t_sc_data[SC_AUTOCOUNTER].val4 = 1; if(sc_data && sc_data[SC_AUTOCOUNTER].timer == -1) { //自分がオートカウンター状態 - int range = battle_get_range(target); + int range = status_get_range(target); if((target->type == BL_PC && ((struct map_session_data *)target)->status.weapon != 11 && dist <= range+1) || //対象がPCで武器が弓矢でなく射程内 (target->type == BL_MOB && range <= 3 && dist <= range+1) ) //または対象がMobで射程が3以下で射程内 t_sc_data[SC_AUTOCOUNTER].val3 = src->id; @@ -2961,7 +1666,7 @@ static struct Damage battle_calc_pc_weapon_attack( flag=BF_SHORT|BF_WEAPON|BF_NORMAL; // 攻撃の種類の設定 // 回避率計算、回避判定は後で - flee = battle_get_flee(target); + flee = status_get_flee(target); if(battle_config.agi_penalty_type > 0 || battle_config.vit_penalty_type > 0) //AGI、VITペナルティ設定が有効 target_count += battle_counttargeted(target,src,battle_config.agi_penalty_count_lv); //対象の数を算出 if(battle_config.agi_penalty_type > 0) { @@ -2973,20 +1678,20 @@ static struct Damage battle_calc_pc_weapon_attack( if(flee < 1) flee = 1; //回避率は最低でも1 } } - hitrate=battle_get_hit(src) - flee + 80; //命中率計算 + hitrate=status_get_hit(src) - flee + 80; //命中率計算 type=0; // normal div_ = 1; // single attack - dex=battle_get_dex(src); //DEX - luk=battle_get_luk(src); //LUK - watk = battle_get_atk(src); //ATK - watk_ = battle_get_atk_(src); //ATK左手 + dex=status_get_dex(src); //DEX + luk=status_get_luk(src); //LUK + watk = status_get_atk(src); //ATK + watk_ = status_get_atk_(src); //ATK左手 if(skill_num==HW_MAGICCRASHER){ /* マジッククラッシャーはMATKで殴る */ - damage = damage2 = battle_get_matk1(src); //damega,damega2初登場、base_atkの取得 + damage = damage2 = status_get_matk1(src); //damega,damega2初登場、base_atkの取得 }else{ - damage = damage2 = battle_get_baseatk(&sd->bl); //damega,damega2初登場、base_atkの取得 + damage = damage2 = status_get_baseatk(&sd->bl); //damega,damega2初登場、base_atkの取得 } atkmin = atkmin_ = dex; //最低ATKはDEXで初期化? sd->state.arrow_atk = 0; //arrow_atk初期化 @@ -3050,14 +1755,14 @@ static struct Damage battle_calc_pc_weapon_attack( if(da == 0){ //ダブルアタックが発動していない // クリティカル計算 - cri = battle_get_critical(src); + cri = status_get_critical(src); if(sd->state.arrow_atk) cri += sd->arrow_cri; if(sd->status.weapon == 16) // カタールの場合、クリティカルを倍に cri <<=1; - cri -= battle_get_luk(target) * 3; + cri -= status_get_luk(target) * 3; if(t_sc_data != NULL && t_sc_data[SC_SLEEP].timer!=-1 ) // 睡眠中はクリティカルが倍に cri <<=1; if(ac_flag) cri = 1000; @@ -3554,12 +2259,12 @@ static struct Damage battle_calc_pc_weapon_attack( break; case ASC_BREAKER: // -- moonsoul (special damage for ASC_BREAKER skill) if(sd){ -/* int mdef1=battle_get_mdef(target); - int mdef2=battle_get_mdef2(target); +/* int mdef1=status_get_mdef(target); + int mdef2=status_get_mdef2(target); int imdef_flag=0; - damage = ((damage * 5) + (skill_lv * battle_get_int(src) * 5) + rand()%500 + 500) /2; - damage2 = ((damage2 * 5) + (skill_lv * battle_get_int(src) * 5) + rand()%500 + 500) /2; + damage = ((damage * 5) + (skill_lv * status_get_int(src) * 5) + rand()%500 + 500) /2; + damage2 = ((damage2 * 5) + (skill_lv * status_get_int(src) * 5) + rand()%500 + 500) /2; damage3 = damage; // physical damage can miss hitrate = 1000000;*/ @@ -3570,7 +2275,7 @@ static struct Damage battle_calc_pc_weapon_attack( // element modifier added right after this // calculate magic part of damage - damage3 = skill_lv * battle_get_int(src) * 5; + damage3 = skill_lv * status_get_int(src) * 5; // ignores magic defense now [Celest] /*if(sd->ignore_mdef_ele & (1<<t_ele) || sd->ignore_mdef_race & (1<<t_race)) @@ -3595,7 +2300,7 @@ static struct Damage battle_calc_pc_weapon_attack( if(damage3<1) damage3=1; - damage3=battle_attr_fix(damage2,s_ele_, battle_get_element(target) );*/ + damage3=battle_attr_fix(damage2,s_ele_, status_get_element(target) );*/ flag=(flag&~BF_RANGEMASK)|BF_LONG; } @@ -3679,7 +2384,7 @@ static struct Damage battle_calc_pc_weapon_attack( } // sacrifice works on boss monsters, and does 9% damage to self [Celest] if (!skill_num && /*!(t_mode&0x20) &&*/ sc_data[SC_SACRIFICE].timer != -1) { - int mhp = battle_get_max_hp(src); + int mhp = status_get_max_hp(src); int dmg = mhp * 9/100; pc_heal(sd, -dmg, 0); damage = dmg * (90 + sc_data[SC_SACRIFICE].val1 * 10) / 100; @@ -3689,21 +2394,21 @@ static struct Damage battle_calc_pc_weapon_attack( s_ele_ = 0; sc_data[SC_SACRIFICE].val2 --; if (sc_data[SC_SACRIFICE].val2 == 0) - skill_status_change_end(src, SC_SACRIFICE,-1); + status_change_end(src, SC_SACRIFICE,-1); } } // 精錬ダメージの追加 if( skill_num != MO_INVESTIGATE && skill_num != MO_EXTREMITYFIST) { //DEF, VIT無視 - damage += battle_get_atk2(src); - damage2 += battle_get_atk_2(src); + damage += status_get_atk2(src); + damage2 += status_get_atk_2(src); } if(skill_num == CR_SHIELDBOOMERANG) { if(sd->equip_index[8] >= 0) { int index = sd->equip_index[8]; if(sd->inventory_data[index] && sd->inventory_data[index]->type == 5) { damage += sd->inventory_data[index]->weight/10; - damage += sd->status.inventory[index].refine * pc_getrefinebonus(0,1); + damage += sd->status.inventory[index].refine * status_getrefinebonus(0,1); } } } @@ -3712,7 +2417,7 @@ static struct Damage battle_calc_pc_weapon_attack( int index = sd->equip_index[9]; if(sd->inventory_data[index] && sd->inventory_data[index]->type == 4) { damage += (int)(double)(sd->inventory_data[index]->weight*(0.8*skill_lv*4/10)); - damage += sd->status.inventory[index].refine * pc_getrefinebonus(0,1); + damage += sd->status.inventory[index].refine * status_getrefinebonus(0,1); } } } @@ -3805,7 +2510,7 @@ static struct Damage battle_calc_pc_weapon_attack( cardfix=cardfix*(100+sd->addrace[11]+sd->arrow_addrace[11])/100; //ボス以外モンスターに追加ダメージ(弓矢による追加あり) } //特定Class用補正処理(少女の日記→ボンゴン用?) - t_class = battle_get_class(target); + t_class = status_get_class(target); for(i=0;i<sd->add_damage_class_count;i++) { if(sd->add_damage_classid[i] == t_class) { cardfix=cardfix*(100+sd->add_damage_classrate[i])/100; @@ -3851,7 +2556,7 @@ static struct Damage battle_calc_pc_weapon_attack( cardfix=100; cardfix=cardfix*(100-tsd->subrace[s_race])/100; // 種族によるダメージ耐性 cardfix=cardfix*(100-tsd->subele[s_ele])/100; // 属性によるダメージ耐性 - if(battle_get_mode(src) & 0x20) + if(status_get_mode(src) & 0x20) cardfix=cardfix*(100-tsd->subrace[10])/100; //ボスからの攻撃はダメージ減少 else cardfix=cardfix*(100-tsd->subrace[11])/100; //ボス以外からの攻撃はダメージ減少 @@ -3898,8 +2603,8 @@ static struct Damage battle_calc_pc_weapon_attack( if(damage2 < 0) damage2 = 0; // 属 性の適用 - damage=battle_attr_fix(damage,s_ele, battle_get_element(target) ); - damage2=battle_attr_fix(damage2,s_ele_, battle_get_element(target) ); + damage=battle_attr_fix(damage,s_ele, status_get_element(target) ); + damage2=battle_attr_fix(damage2,s_ele_, status_get_element(target) ); // 星のかけら、気球の適用 damage += sd->star; @@ -3918,9 +2623,9 @@ static struct Damage battle_calc_pc_weapon_attack( // >二刀流の左右ダメージ計算誰かやってくれぇぇぇぇえええ! // >map_session_data に左手ダメージ(atk,atk2)追加して - // >pc_calcstatus()でやるべきかな? + // >status_calc_pc()でやるべきかな? // map_session_data に左手武器(atk,atk2,ele,star,atkmods)追加して - // pc_calcstatus()でデータを入力しています + // status_calc_pc()でデータを入力しています //左手のみ武器装備 if(sd->weapontype1 == 0 && sd->weapontype2 > 0) { @@ -3959,14 +2664,14 @@ static struct Damage battle_calc_pc_weapon_attack( // インベナム修正 if(skill_num==TF_POISON){ - damage = battle_attr_fix(damage + 15*skill_lv, s_ele, battle_get_element(target) ); + damage = battle_attr_fix(damage + 15*skill_lv, s_ele, status_get_element(target) ); } if(skill_num==MC_CARTREVOLUTION){ - damage = battle_attr_fix(damage, 0, battle_get_element(target) ); + damage = battle_attr_fix(damage, 0, status_get_element(target) ); } // 完全回避の判定 - if(skill_num == 0 && tsd!=NULL && div_ < 255 && rand()%1000 < battle_get_flee2(target) ){ + if(skill_num == 0 && tsd!=NULL && div_ < 255 && rand()%1000 < status_get_flee2(target) ){ damage=damage2=0; type=0x0b; dmg_lv = ATK_LUCKY; @@ -3974,7 +2679,7 @@ static struct Damage battle_calc_pc_weapon_attack( // 対象が完全回避をする設定がONなら if(battle_config.enemy_perfect_flee) { - if(skill_num == 0 && tmd!=NULL && div_ < 255 && rand()%1000 < battle_get_flee2(target) ) { + if(skill_num == 0 && tmd!=NULL && div_ < 255 && rand()%1000 < status_get_flee2(target) ) { damage=damage2=0; type=0x0b; dmg_lv = ATK_LUCKY; @@ -4054,10 +2759,10 @@ static struct Damage battle_calc_pc_weapon_attack( wd.damage2=damage2; wd.type=type; wd.div_=div_; - wd.amotion=battle_get_amotion(src); + wd.amotion=status_get_amotion(src); if(skill_num == KN_AUTOCOUNTER) wd.amotion >>= 1; - wd.dmotion=battle_get_dmotion(target); + wd.dmotion=status_get_dmotion(target); wd.blewcount=blewcount; wd.flag=flag; wd.dmg_lv=dmg_lv; @@ -4105,7 +2810,7 @@ struct Damage battle_calc_weapon_attack( if (target->type == BL_PC) pc_breakweapon((struct map_session_data *)target); else - skill_status_change_start(target,SC_STRIPWEAPON,1,75,0,0,skill_get_time2(WS_MELTDOWN,1),0 ); + status_change_start(target,SC_STRIPWEAPON,1,75,0,0,skill_get_time2(WS_MELTDOWN,1),0 ); } breakrate_ = 70*sd->sc_data[SC_MELTDOWN].val1; @@ -4113,7 +2818,7 @@ struct Damage battle_calc_weapon_attack( if (target->type == BL_PC) pc_breakarmor((struct map_session_data *)target); else - skill_status_change_start(target,SC_STRIPSHIELD,1,75,0,0,skill_get_time2(WS_MELTDOWN,1),0 ); + status_change_start(target,SC_STRIPSHIELD,1,75,0,0,skill_get_time2(WS_MELTDOWN,1),0 ); } } if(sd->sc_data[SC_OVERTHRUST].timer!=-1) @@ -4138,8 +2843,8 @@ struct Damage battle_calc_weapon_attack( struct Damage battle_calc_magic_attack( struct block_list *bl,struct block_list *target,int skill_num,int skill_lv,int flag) { - int mdef1=battle_get_mdef(target); - int mdef2=battle_get_mdef2(target); + int mdef1=status_get_mdef(target); + int mdef2=status_get_mdef2(target); int matk1,matk2,damage=0,div_=1,blewcount=skill_get_blewcount(skill_num,skill_lv),rdamage = 0; struct Damage md; int aflag; @@ -4162,13 +2867,13 @@ struct Damage battle_calc_magic_attack( return md; } - matk1=battle_get_matk1(bl); - matk2=battle_get_matk2(bl); + matk1=status_get_matk1(bl); + matk2=status_get_matk2(bl); ele = skill_get_pl(skill_num); - race = battle_get_race(bl); - t_ele = battle_get_elem_type(target); - t_race = battle_get_race(target); - t_mode = battle_get_mode(target); + race = status_get_race(bl); + t_ele = status_get_elem_type(target); + t_race = status_get_race(target); + t_mode = status_get_mode(target); #define MATK_FIX( a,b ) { matk1=matk1*(a)/(b); matk2=matk2*(a)/(b); } @@ -4206,10 +2911,10 @@ struct Damage battle_calc_magic_attack( case PR_TURNUNDEAD: // 攻撃リザレクションとターンアンデッド if(target->type != BL_PC && battle_check_undead(t_race,t_ele)){ int hp, mhp, thres; - hp = battle_get_hp(target); - mhp = battle_get_max_hp(target); - thres = (skill_lv * 20) + battle_get_luk(bl)+ - battle_get_int(bl) + battle_get_lv(bl)+ + hp = status_get_hp(target); + mhp = status_get_max_hp(target); + thres = (skill_lv * 20) + status_get_luk(bl)+ + status_get_int(bl) + status_get_lv(bl)+ ((200 - hp * 200 / mhp)); if(thres > 700) thres = 700; // if(battle_config.battle_log) @@ -4217,7 +2922,7 @@ struct Damage battle_calc_magic_attack( if(rand()%1000 < thres && !(t_mode&0x20)) // 成功 damage = hp; else // 失敗 - damage = battle_get_lv(bl) + battle_get_int(bl) + skill_lv * 10; + damage = status_get_lv(bl) + status_get_int(bl) + skill_lv * 10; } normalmagic_flag=0; break; @@ -4355,7 +3060,7 @@ struct Damage battle_calc_magic_attack( cardfix=cardfix*(100+sd->magic_addrace[10])/100; else cardfix=cardfix*(100+sd->magic_addrace[11])/100; - t_class = battle_get_class(target); + t_class = status_get_class(target); for(i=0;i<sd->add_magic_damage_class_count;i++) { if(sd->add_magic_damage_classid[i] == t_class) { cardfix=cardfix*(100+sd->add_magic_damage_classrate[i])/100; @@ -4366,12 +3071,12 @@ struct Damage battle_calc_magic_attack( } if( tsd ){ - int s_class = battle_get_class(bl); + int s_class = status_get_class(bl); cardfix=100; cardfix=cardfix*(100-tsd->subele[ele])/100; // 属 性によるダメージ耐性 cardfix=cardfix*(100-tsd->subrace[race])/100; // 種族によるダメージ耐性 cardfix=cardfix*(100-tsd->magic_subrace[race])/100; - if(battle_get_mode(bl) & 0x20) + if(status_get_mode(bl) & 0x20) cardfix=cardfix*(100-tsd->magic_subrace[10])/100; else cardfix=cardfix*(100-tsd->magic_subrace[11])/100; @@ -4386,13 +3091,13 @@ struct Damage battle_calc_magic_attack( } if(damage < 0) damage = 0; - damage=battle_attr_fix(damage, ele, battle_get_element(target) ); // 属 性修正 + damage=battle_attr_fix(damage, ele, status_get_element(target) ); // 属 性修正 if(skill_num == CR_GRANDCROSS) { // グランドクロス struct Damage wd; wd=battle_calc_weapon_attack(bl,target,skill_num,skill_lv,flag); damage = (damage + wd.damage) * (100 + 40*skill_lv)/100; - if(battle_config.gx_dupele) damage=battle_attr_fix(damage, ele, battle_get_element(target) ); //属性2回かかる + if(battle_config.gx_dupele) damage=battle_attr_fix(damage, ele, status_get_element(target) ); //属性2回かかる if(bl==target) damage=damage/2; //反動は半分 } @@ -4426,8 +3131,8 @@ struct Damage battle_calc_magic_attack( md.damage=damage; md.div_=div_; - md.amotion=battle_get_amotion(bl); - md.dmotion=battle_get_dmotion(target); + md.amotion=status_get_amotion(bl); + md.dmotion=status_get_dmotion(target); md.damage2=0; md.type=0; md.blewcount=blewcount; @@ -4443,9 +3148,9 @@ struct Damage battle_calc_magic_attack( struct Damage battle_calc_misc_attack( struct block_list *bl,struct block_list *target,int skill_num,int skill_lv,int flag) { - int int_=battle_get_int(bl); -// int luk=battle_get_luk(bl); - int dex=battle_get_dex(bl); + int int_=status_get_int(bl); +// int luk=status_get_luk(bl); + int dex=status_get_dex(bl); int skill,ele,race,cardfix; struct map_session_data *sd=NULL,*tsd=NULL; int damage=0,div_=1,blewcount=skill_get_blewcount(skill_num,skill_lv); @@ -4494,7 +3199,7 @@ struct Damage battle_calc_misc_attack( damage=(dex/10+int_/2+skill*3+40)*2; if(flag > 1) damage /= flag; - if(battle_get_mode(target) & 0x40) + if(status_get_mode(target) & 0x40) damage = 1; break; @@ -4508,7 +3213,7 @@ struct Damage battle_calc_misc_attack( break; case NPC_SELFDESTRUCTION: // 自爆 - damage=battle_get_hp(bl)-(bl==target?1:0); + damage=status_get_hp(bl)-(bl==target?1:0); damagefix=0; break; @@ -4519,8 +3224,8 @@ struct Damage battle_calc_misc_attack( case NPC_DARKBREATH: { - struct status_change *sc_data = battle_get_sc_data(target); - int hitrate=battle_get_hit(bl) - battle_get_flee(target) + 80; + struct status_change *sc_data = status_get_sc_data(target); + int hitrate=status_get_hit(bl) - status_get_flee(target) + 80; hitrate = ( (hitrate>95)?95: ((hitrate<5)?5:hitrate) ); if(sc_data && (sc_data[SC_SLEEP].timer!=-1 || sc_data[SC_STAN].timer!=-1 || sc_data[SC_FREEZE].timer!=-1 || (sc_data[SC_STONE].timer!=-1 && sc_data[SC_STONE].val2==0) ) ) @@ -4543,13 +3248,13 @@ struct Damage battle_calc_misc_attack( #endif if(flag > 1) damage /= flag; - if(battle_get_mode(target) & 0x40) + if(status_get_mode(target) & 0x40) damage = 1; break; } ele = skill_get_pl(skill_num); - race = battle_get_race(bl); + race = status_get_race(bl); if(damagefix){ if(damage<1 && skill_num != NPC_DARKBREATH) @@ -4563,14 +3268,14 @@ struct Damage battle_calc_misc_attack( damage=damage*cardfix/100; } if(damage < 0) damage = 0; - damage=battle_attr_fix(damage, ele, battle_get_element(target) ); // 属性修正 + damage=battle_attr_fix(damage, ele, status_get_element(target) ); // 属性修正 } div_=skill_get_num( skill_num,skill_lv ); if(div_>1) damage*=div_; - if(damage > 0 && (damage < div_ || (battle_get_def(target) >= 1000000 && battle_get_mdef(target) >= 1000000) ) ) { + if(damage > 0 && (damage < div_ || (status_get_def(target) >= 1000000 && status_get_mdef(target) >= 1000000) ) ) { damage = div_; } @@ -4578,8 +3283,8 @@ struct Damage battle_calc_misc_attack( md.damage=damage; md.div_=div_; - md.amotion=battle_get_amotion(bl); - md.dmotion=battle_get_dmotion(target); + md.amotion=status_get_amotion(bl); + md.dmotion=status_get_dmotion(target); md.damage2=0; md.type=0; md.blewcount=blewcount; @@ -4618,7 +3323,7 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target, unsigned int tick,int flag) { struct map_session_data *sd=NULL; - struct status_change *sc_data = battle_get_sc_data(src),*t_sc_data=battle_get_sc_data(target); + struct status_change *sc_data = status_get_sc_data(src),*t_sc_data=status_get_sc_data(target); short *opt1; int race = 7, ele = 0; int damage,rdamage = 0; @@ -4637,7 +3342,7 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target, if(target->type == BL_PC && pc_isdead((struct map_session_data *)target)) return 0; - opt1=battle_get_opt1(src); + opt1=status_get_opt1(src); if(opt1 && *opt1 > 0) { battle_stopattack(src); return 0; @@ -4651,8 +3356,8 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target, !battle_check_range(src,target,0)) return 0; // 攻撃対象外 - race = battle_get_race(target); - ele = battle_get_elem_type(target); + race = status_get_race(target); + ele = status_get_elem_type(target); if(battle_check_target(src,target,BCT_ENEMY) > 0 && battle_check_range(src,target,0)){ // 攻撃対象となりうるので攻撃 @@ -4706,13 +3411,13 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target, } if (wd.div_ == 255 && sd) { //三段掌 - int delay = 1000 - 4 * battle_get_agi(src) - 2 * battle_get_dex(src); + int delay = 1000 - 4 * status_get_agi(src) - 2 * status_get_dex(src); int skilllv; - if(wd.damage+wd.damage2 < battle_get_hp(target)) { + if(wd.damage+wd.damage2 < status_get_hp(target)) { if((skilllv = pc_checkskill(sd, MO_CHAINCOMBO)) > 0) delay += 300 * battle_config.combo_delay_rate /100; //追加ディレイをconfにより調整 - skill_status_change_start(src,SC_COMBO,MO_TRIPLEATTACK,skilllv,0,0,delay,0); + status_change_start(src,SC_COMBO,MO_TRIPLEATTACK,skilllv,0,0,delay,0); } sd->attackabletime = sd->canmove_tick = tick + delay; clif_combo_delay(src,delay); @@ -4736,16 +3441,16 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target, skill_additional_effect(src,target,0,0,BF_WEAPON,tick); if(sd) { if(sd->weapon_coma_ele[ele] > 0 && rand()%10000 < sd->weapon_coma_ele[ele]) - battle_damage(src,target,battle_get_max_hp(target),1); + battle_damage(src,target,status_get_max_hp(target),1); if(sd->weapon_coma_race[race] > 0 && rand()%10000 < sd->weapon_coma_race[race]) - battle_damage(src,target,battle_get_max_hp(target),1); - if(battle_get_mode(target) & 0x20) { + battle_damage(src,target,status_get_max_hp(target),1); + if(status_get_mode(target) & 0x20) { if(sd->weapon_coma_race[10] > 0 && rand()%10000 < sd->weapon_coma_race[10]) - battle_damage(src,target,battle_get_max_hp(target),1); + battle_damage(src,target,status_get_max_hp(target),1); } else { if(sd->weapon_coma_race[11] > 0 && rand()%10000 < sd->weapon_coma_race[11]) - battle_damage(src,target,battle_get_max_hp(target),1); + battle_damage(src,target,status_get_max_hp(target),1); } } } @@ -4849,12 +3554,12 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target, if(t_sc_data && t_sc_data[SC_AUTOCOUNTER].timer != -1 && t_sc_data[SC_AUTOCOUNTER].val4 > 0) { if(t_sc_data[SC_AUTOCOUNTER].val3 == src->id) battle_weapon_attack(target,src,tick,0x8000|t_sc_data[SC_AUTOCOUNTER].val1); - skill_status_change_end(target,SC_AUTOCOUNTER,-1); + status_change_end(target,SC_AUTOCOUNTER,-1); } if(t_sc_data && t_sc_data[SC_POISONREACT].timer != -1 && t_sc_data[SC_POISONREACT].val4 > 0) { // poison react [Celest] if(t_sc_data[SC_POISONREACT].val3 == src->id) { struct map_session_data *tsd = (struct map_session_data *)target; - if ((src->type == BL_MOB && battle_get_elem_type(src)==5) || (src->type == BL_PC && battle_get_attack_element(src)==5)) { + if ((src->type == BL_MOB && status_get_elem_type(src)==5) || (src->type == BL_PC && status_get_attack_element(src)==5)) { t_sc_data[SC_POISONREACT].val2 = 0; battle_weapon_attack(target,src,tick,flag|AS_POISONREACT); } else { @@ -4862,18 +3567,18 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target, --t_sc_data[SC_POISONREACT].val2; } if (t_sc_data[SC_POISONREACT].val2<=0) - skill_status_change_end(target,SC_POISONREACT,-1); + status_change_end(target,SC_POISONREACT,-1); } } if (t_sc_data && t_sc_data[SC_BLADESTOP_WAIT].timer != -1 && - !(battle_get_mode(src)&0x20)) { // ボスには無効 + !(status_get_mode(src)&0x20)) { // ボスには無効 int lv = t_sc_data[SC_BLADESTOP_WAIT].val1; - skill_status_change_end(target,SC_BLADESTOP_WAIT,-1); - skill_status_change_start(src,SC_BLADESTOP,lv,1,(int)src,(int)target,skill_get_time2(MO_BLADESTOP,lv),0); - skill_status_change_start(target,SC_BLADESTOP,lv,2,(int)target,(int)src,skill_get_time2(MO_BLADESTOP,lv),0); + status_change_end(target,SC_BLADESTOP_WAIT,-1); + status_change_start(src,SC_BLADESTOP,lv,1,(int)src,(int)target,skill_get_time2(MO_BLADESTOP,lv),0); + status_change_start(target,SC_BLADESTOP,lv,2,(int)target,(int)src,skill_get_time2(MO_BLADESTOP,lv),0); } if(t_sc_data && t_sc_data[SC_SPLASHER].timer!=-1) //殴ったので対象のベナムスプラッシャー状態を解除 - skill_status_change_end(target,SC_SPLASHER,-1); + status_change_end(target,SC_SPLASHER,-1); map_freeblock_unlock(); } @@ -4937,8 +3642,8 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f return -1; // Celest - sc_data = battle_get_sc_data(src); - tsc_data = battle_get_sc_data(target); + sc_data = status_get_sc_data(src); + tsc_data = status_get_sc_data(target); if ((sc_data && sc_data[SC_BASILICA].timer != -1) || (tsc_data && tsc_data[SC_BASILICA].timer != -1)) return -1; @@ -5017,11 +3722,11 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f if(ss->type == BL_PET && target->type==BL_MOB) return 0; - s_p=battle_get_party_id(ss); - s_g=battle_get_guild_id(ss); + s_p=status_get_party_id(ss); + s_g=status_get_guild_id(ss); - t_p=battle_get_party_id(target); - t_g=battle_get_guild_id(target); + t_p=status_get_party_id(target); + t_g=status_get_guild_id(target); if(flag&0x10000) { if(s_p && t_p && s_p == t_p) // 同じパーティなら肯定(味方) diff --git a/src/map/battle.h b/src/map/battle.h index d88ea54c1..4a75dfe1e 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -63,50 +63,6 @@ int battle_weapon_attack( struct block_list *bl,struct block_list *target, // 各種パラメータを得る int battle_counttargeted(struct block_list *bl,struct block_list *src,int target_lv); -int battle_get_class(struct block_list *bl); -int battle_get_dir(struct block_list *bl); -int battle_get_lv(struct block_list *bl); -int battle_get_range(struct block_list *bl); -int battle_get_hp(struct block_list *bl); -int battle_get_max_hp(struct block_list *bl); -int battle_get_str(struct block_list *bl); -int battle_get_agi(struct block_list *bl); -int battle_get_vit(struct block_list *bl); -int battle_get_int(struct block_list *bl); -int battle_get_dex(struct block_list *bl); -int battle_get_luk(struct block_list *bl); -int battle_get_hit(struct block_list *bl); -int battle_get_flee(struct block_list *bl); -int battle_get_def(struct block_list *bl); -int battle_get_mdef(struct block_list *bl); -int battle_get_flee2(struct block_list *bl); -int battle_get_def2(struct block_list *bl); -int battle_get_mdef2(struct block_list *bl); -int battle_get_baseatk(struct block_list *bl); -int battle_get_atk(struct block_list *bl); -int battle_get_atk2(struct block_list *bl); -int battle_get_speed(struct block_list *bl); -int battle_get_adelay(struct block_list *bl); -int battle_get_amotion(struct block_list *bl); -int battle_get_dmotion(struct block_list *bl); -int battle_get_element(struct block_list *bl); -int battle_get_attack_element(struct block_list *bl); -int battle_get_attack_element2(struct block_list *bl); //左手武器属性取得 -#define battle_get_elem_type(bl) (battle_get_element(bl)%10) -#define battle_get_elem_level(bl) (battle_get_element(bl)/10/2) -int battle_get_party_id(struct block_list *bl); -int battle_get_guild_id(struct block_list *bl); -int battle_get_race(struct block_list *bl); -int battle_get_size(struct block_list *bl); -int battle_get_mode(struct block_list *bl); -int battle_get_mexp(struct block_list *bl); - -struct status_change *battle_get_sc_data(struct block_list *bl); -short *battle_get_sc_count(struct block_list *bl); -short *battle_get_opt1(struct block_list *bl); -short *battle_get_opt2(struct block_list *bl); -short *battle_get_opt3(struct block_list *bl); -short *battle_get_option(struct block_list *bl); enum { BCT_NOENEMY =0x00000, diff --git a/src/map/charcommand.c b/src/map/charcommand.c index 5d65c8f01..40961f39e 100644 --- a/src/map/charcommand.c +++ b/src/map/charcommand.c @@ -15,6 +15,7 @@ #include "itemdb.h" #include "map.h" #include "pc.h" +#include "status.h" #include "skill.h" #include "mob.h" #include "pet.h" @@ -319,7 +320,7 @@ int charcommand_jobchange( pl_sd->status.class_ = pl_sd->view_class = 4015; pl_sd->status.option &= ~0x0020; clif_changeoption(&pl_sd->bl); - pc_calcstatus(pl_sd, 0); + status_calc_pc(pl_sd, 0); } } else { if (!pc_isriding(sd)) { @@ -433,9 +434,9 @@ int charcommand_petfriendly( if ((pl_sd->pet.intimate > 0 && t <= 0) || (pl_sd->pet.intimate <= 0 && t > 0)) { if (pl_sd->bl.prev != NULL) - pc_calcstatus(pl_sd, 0); + status_calc_pc(pl_sd, 0); else - pc_calcstatus(pl_sd, 2); + status_calc_pc(pl_sd, 2); } } clif_displaymessage(pl_sd->fd, msg_table[182]); // Pet friendly value changed! @@ -612,7 +613,7 @@ int charcommand_option( } } clif_changeoption(&pl_sd->bl); - pc_calcstatus(pl_sd, 0); + status_calc_pc(pl_sd, 0); clif_displaymessage(fd, msg_table[58]); // Character's options changed. } else { clif_displaymessage(fd, msg_table[81]); // Your GM level don't authorise you to do this action on this player. diff --git a/src/map/clif.c b/src/map/clif.c index eeae87439..d0bf86e27 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -30,6 +30,7 @@ #include "chrif.h" #include "clif.h" #include "pc.h" +#include "status.h" #include "npc.h" #include "itemdb.h" #include "chat.h" @@ -695,7 +696,7 @@ static int clif_set0078(struct map_session_data *sd, unsigned char *buf) { WBUFW(buf,0) = 0x78; WBUFL(buf,2) = sd->bl.id; - WBUFW(buf,6) = battle_get_speed(&sd->bl); + WBUFW(buf,6) = status_get_speed(&sd->bl); WBUFW(buf,8) = sd->opt1; WBUFW(buf,10) = sd->opt2; WBUFW(buf,12) = sd->status.option; @@ -707,7 +708,7 @@ static int clif_set0078(struct map_session_data *sd, unsigned char *buf) { WBUFB(buf,49) = 5; WBUFB(buf,50) = 5; WBUFB(buf,51) = 0; - WBUFW(buf,52) = ((level = battle_get_lv(&sd->bl)) > battle_config.max_lv) ? battle_config.max_lv : level; + WBUFW(buf,52) = ((level = status_get_lv(&sd->bl)) > battle_config.max_lv) ? battle_config.max_lv : level; return packet_len_table[0x78]; } @@ -785,7 +786,7 @@ static int clif_set0078(struct map_session_data *sd, unsigned char *buf) { WBUFB(buf,49) = 5; WBUFB(buf,50) = 5; WBUFB(buf,51) = sd->state.dead_sit; - WBUFW(buf,52) = ((level = battle_get_lv(&sd->bl)) > battle_config.max_lv) ? battle_config.max_lv : level; + WBUFW(buf,52) = ((level = status_get_lv(&sd->bl)) > battle_config.max_lv) ? battle_config.max_lv : level; return packet_len_table[0x1d8]; #endif @@ -804,7 +805,7 @@ static int clif_set007b(struct map_session_data *sd,unsigned char *buf) { WBUFW(buf,0)=0x7b; WBUFL(buf,2)=sd->bl.id; - WBUFW(buf,6)=battle_get_speed(&sd->bl); + WBUFW(buf,6)=status_get_speed(&sd->bl); WBUFW(buf,8)=sd->opt1; WBUFW(buf,10)=sd->opt2; WBUFW(buf,12)=sd->status.option; @@ -816,7 +817,7 @@ static int clif_set007b(struct map_session_data *sd,unsigned char *buf) { WBUFB(buf,55)=0; WBUFB(buf,56)=5; WBUFB(buf,57)=5; - WBUFW(buf,58)=((level = battle_get_lv(&sd->bl))>battle_config.max_lv)? battle_config.max_lv:level; + WBUFW(buf,58)=((level = status_get_lv(&sd->bl))>battle_config.max_lv)? battle_config.max_lv:level; return packet_len_table[0x7b]; } @@ -975,7 +976,7 @@ static int clif_mob0078(struct mob_data *md, unsigned char *buf) WBUFW(buf,0)=0x78; WBUFL(buf,2)=md->bl.id; - WBUFW(buf,6)=battle_get_speed(&md->bl); + WBUFW(buf,6)=status_get_speed(&md->bl); WBUFW(buf,8)=md->opt1; WBUFW(buf,10)=md->opt2; WBUFW(buf,12)=md->option; @@ -1009,7 +1010,7 @@ static int clif_mob0078(struct mob_data *md, unsigned char *buf) WBUFB(buf,48)|=md->dir&0x0f; WBUFB(buf,49)=5; WBUFB(buf,50)=5; - WBUFW(buf,52)=((level = battle_get_lv(&md->bl))>battle_config.max_lv)? battle_config.max_lv:level; + WBUFW(buf,52)=((level = status_get_lv(&md->bl))>battle_config.max_lv)? battle_config.max_lv:level; return packet_len_table[0x78]; } @@ -1027,7 +1028,7 @@ static int clif_mob007b(struct mob_data *md, unsigned char *buf) { WBUFW(buf,0)=0x7b; WBUFL(buf,2)=md->bl.id; - WBUFW(buf,6)=battle_get_speed(&md->bl); + WBUFW(buf,6)=status_get_speed(&md->bl); WBUFW(buf,8)=md->opt1; WBUFW(buf,10)=md->opt2; WBUFW(buf,12)=md->option; @@ -1062,7 +1063,7 @@ static int clif_mob007b(struct mob_data *md, unsigned char *buf) { WBUFPOS2(buf,50,md->bl.x,md->bl.y,md->to_x,md->to_y); WBUFB(buf,56)=5; WBUFB(buf,57)=5; - WBUFW(buf,58)=((level = battle_get_lv(&md->bl))>battle_config.max_lv)? battle_config.max_lv:level; + WBUFW(buf,58)=((level = status_get_lv(&md->bl))>battle_config.max_lv)? battle_config.max_lv:level; return packet_len_table[0x7b]; } @@ -1156,7 +1157,7 @@ static int clif_pet0078(struct pet_data *pd, unsigned char *buf) { WBUFB(buf,48)|=pd->dir&0x0f; WBUFB(buf,49)=0; WBUFB(buf,50)=0; - WBUFW(buf,52)=((level = battle_get_lv(&pd->bl))>battle_config.max_lv)? battle_config.max_lv:level; + WBUFW(buf,52)=((level = status_get_lv(&pd->bl))>battle_config.max_lv)? battle_config.max_lv:level; return packet_len_table[0x78]; } @@ -1199,7 +1200,7 @@ static int clif_pet007b(struct pet_data *pd, unsigned char *buf) { WBUFPOS2(buf,50,pd->bl.x,pd->bl.y,pd->to_x,pd->to_y); WBUFB(buf,56)=0; WBUFB(buf,57)=0; - WBUFW(buf,58)=((level = battle_get_lv(&pd->bl))>battle_config.max_lv)? battle_config.max_lv:level; + WBUFW(buf,58)=((level = status_get_lv(&pd->bl))>battle_config.max_lv)? battle_config.max_lv:level; return packet_len_table[0x7b]; } @@ -2884,13 +2885,13 @@ int clif_changeoption(struct block_list* bl) nullpo_retr(0, bl); - option = *battle_get_option(bl); - sc_data = battle_get_sc_data(bl); + option = *status_get_option(bl); + sc_data = status_get_sc_data(bl); WBUFW(buf,0) = 0x119; WBUFL(buf,2) = bl->id; - WBUFW(buf,6) = *battle_get_opt1(bl); - WBUFW(buf,8) = *battle_get_opt2(bl); + WBUFW(buf,6) = *status_get_opt1(bl); + WBUFW(buf,8) = *status_get_opt2(bl); WBUFW(buf,10) = option; WBUFB(buf,12) = 0; // ?? @@ -2908,9 +2909,9 @@ int clif_changeoption(struct block_list* bl) for(i=0;i<sizeof(omask)/sizeof(omask[0]);i++){ if( option&omask[i] ){ if( sc_data[scnum[i]].timer==-1) - skill_status_change_start(bl,scnum[i],0,0,0,0,0,0); + status_change_start(bl,scnum[i],0,0,0,0,0,0); } else { - skill_status_change_end(bl,scnum[i],-1); + status_change_end(bl,scnum[i],-1); } } @@ -3695,7 +3696,7 @@ int clif_damage(struct block_list *src,struct block_list *dst,unsigned int tick, nullpo_retr(0, src); nullpo_retr(0, dst); - sc_data = battle_get_sc_data(dst); + sc_data = status_get_sc_data(dst); if(type != 4 && dst->type == BL_PC && ((struct map_session_data *)dst)->special_state.infinite_endure) type = 9; @@ -4191,7 +4192,7 @@ int clif_skillinfo(struct map_session_data *sd,int skillid,int type,int range) if(range < 0) { range = skill_get_range(id,sd->status.skill[skillid].lv); if(range < 0) - range = battle_get_range(&sd->bl) - (range + 1); + range = status_get_range(&sd->bl) - (range + 1); WFIFOW(fd,12)= range; } else WFIFOW(fd,12)= range; @@ -4228,7 +4229,7 @@ int clif_skillinfoblock(struct map_session_data *sd) WFIFOW(fd,len+8) = skill_get_sp(id,sd->status.skill[i].lv); range = skill_get_range(id,sd->status.skill[i].lv); if(range < 0) - range = battle_get_range(&sd->bl) - (range + 1); + range = status_get_range(&sd->bl) - (range + 1); WFIFOW(fd,len+10)= range; memset(WFIFOP(fd,len+12),0,24); if(!(skill_get_inf2(id)&0x01) || battle_config.quest_skill_learn == 1 || (battle_config.gm_allskill > 0 && pc_isGM(sd) >= battle_config.gm_allskill) ) @@ -4263,7 +4264,7 @@ int clif_skillup(struct map_session_data *sd,int skill_num) WFIFOW(fd,6) = skill_get_sp(skill_num,sd->status.skill[skill_num].lv); range = skill_get_range(skill_num,sd->status.skill[skill_num].lv); if(range < 0) - range = battle_get_range(&sd->bl) - (range + 1); + range = status_get_range(&sd->bl) - (range + 1); WFIFOW(fd,8) = range; //WFIFOB(fd,10) = (sd->status.skill[skill_num].lv < skill_get_max(sd->status.skill[skill_num].id)) ? 1 : 0; WFIFOB(fd,10) = (sd->status.skill[skill_num].lv < skill_tree_get_max(sd->status.skill[skill_num].id, sd->status.class_)) ? 1 : 0; @@ -4355,7 +4356,7 @@ int clif_skill_damage(struct block_list *src,struct block_list *dst, nullpo_retr(0, src); nullpo_retr(0, dst); - sc_data = battle_get_sc_data(dst); + sc_data = status_get_sc_data(dst); if(type != 5 && dst->type == BL_PC && ((struct map_session_data *)dst)->special_state.infinite_endure) type = 9; @@ -4410,7 +4411,7 @@ int clif_skill_damage2(struct block_list *src,struct block_list *dst, nullpo_retr(0, src); nullpo_retr(0, dst); - sc_data = battle_get_sc_data(dst); + sc_data = status_get_sc_data(dst); if(type != 5 && dst->type == BL_PC && ((struct map_session_data *)dst)->special_state.infinite_endure) type = 9; @@ -4639,10 +4640,10 @@ int clif_skill_estimation(struct map_session_data *sd,struct block_list *dst) WBUFW(buf, 4)=md->level; WBUFW(buf, 6)=mob_db[md->class_].size; WBUFL(buf, 8)=md->hp; - WBUFW(buf,12)=battle_get_def2(&md->bl); + WBUFW(buf,12)=status_get_def2(&md->bl); WBUFW(buf,14)=mob_db[md->class_].race; - WBUFW(buf,16)=battle_get_mdef2(&md->bl) - (mob_db[md->class_].vit>>1); - WBUFW(buf,18)=battle_get_elem_type(&md->bl); + WBUFW(buf,16)=status_get_mdef2(&md->bl) - (mob_db[md->class_].vit>>1); + WBUFW(buf,18)=status_get_elem_type(&md->bl); for(i=0;i<9;i++) WBUFB(buf,20+i)= battle_attr_fix(100,i+1,md->def_ele); @@ -5116,7 +5117,7 @@ int clif_item_skill(struct map_session_data *sd,int skillid,int skilllv,const ch WFIFOW(fd,10)=skill_get_sp(skillid,skilllv); range = skill_get_range(skillid,skilllv); if(range < 0) - range = battle_get_range(&sd->bl) - (range + 1); + range = status_get_range(&sd->bl) - (range + 1); WFIFOW(fd,12)=range; strncpy((char*)WFIFOP(fd,14),name,24); WFIFOB(fd,38)=0; @@ -7529,13 +7530,13 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) if(sd->status.hp<sd->status.max_hp>>2 && pc_checkskill(sd,SM_AUTOBERSERK)>0 && (sd->sc_data[SC_PROVOKE].timer==-1 || sd->sc_data[SC_PROVOKE].val2==0 )) // オートバーサーク発動 - skill_status_change_start(&sd->bl,SC_PROVOKE,10,1,0,0,0,0); + status_change_start(&sd->bl,SC_PROVOKE,10,1,0,0,0,0); // if(time(&timer) < ((weddingtime=pc_readglobalreg(sd,"PC_WEDDING_TIME")) + 3600)) -// skill_status_change_start(&sd->bl,SC_WEDDING,0,weddingtime,0,0,36000,0); +// status_change_start(&sd->bl,SC_WEDDING,0,weddingtime,0,0,36000,0); if(battle_config.muting_players && sd->status.manner < 0) - skill_status_change_start(&sd->bl,SC_NOCHAT,0,0,0,0,0,0); + status_change_start(&sd->bl,SC_NOCHAT,0,0,0,0,0,0); if (night_flag) { if (battle_config.night_darkness_level > 0 && !map[sd->bl.m].flag.indoors) @@ -7554,16 +7555,16 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) // option clif_changeoption(&sd->bl); if(sd->sc_data[SC_TRICKDEAD].timer != -1) - skill_status_change_end(&sd->bl,SC_TRICKDEAD,-1); + status_change_end(&sd->bl,SC_TRICKDEAD,-1); if(sd->sc_data[SC_SIGNUMCRUCIS].timer != -1 && !battle_check_undead(7,sd->def_ele)) - skill_status_change_end(&sd->bl,SC_SIGNUMCRUCIS,-1); + status_change_end(&sd->bl,SC_SIGNUMCRUCIS,-1); if(sd->special_state.infinite_endure && sd->sc_data[SC_ENDURE].timer == -1) - skill_status_change_start(&sd->bl,SC_ENDURE,10,1,0,0,0,0); + status_change_start(&sd->bl,SC_ENDURE,10,1,0,0,0,0); for(i=0;i<MAX_INVENTORY;i++){ if(sd->status.inventory[i].equip && sd->status.inventory[i].equip & 0x0002 && sd->status.inventory[i].attribute==1) - skill_status_change_start(&sd->bl,SC_BROKNWEAPON,0,0,0,0,0,0); + status_change_start(&sd->bl,SC_BROKNWEAPON,0,0,0,0,0,0); if(sd->status.inventory[i].equip && sd->status.inventory[i].equip & 0x0010 && sd->status.inventory[i].attribute==1) - skill_status_change_start(&sd->bl,SC_BROKNARMOR,0,0,0,0,0,0); + status_change_start(&sd->bl,SC_BROKNARMOR,0,0,0,0,0,0); } map_foreachinarea(clif_getareachar,sd->bl.m,sd->bl.x-AREA_SIZE,sd->bl.y-AREA_SIZE,sd->bl.x+AREA_SIZE,sd->bl.y+AREA_SIZE,0,sd); @@ -7961,7 +7962,7 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data *sd) { // S 008c < sd->state.snovice_flag = 3; else if (sd->state.snovice_flag == 3) { int i; - skill_status_change_start(&sd->bl,SkillStatusChangeTable[MO_EXPLOSIONSPIRITS],1,0,0,0,skill_get_time(MO_EXPLOSIONSPIRITS,1),0 ); + status_change_start(&sd->bl,SkillStatusChangeTable[MO_EXPLOSIONSPIRITS],1,0,0,0,skill_get_time(MO_EXPLOSIONSPIRITS,1),0 ); for(i=0;i<5;i++) pc_addspiritball(sd,skill_get_time(MO_CALLSPIRITS,1),5); sd->state.snovice_flag = 0; @@ -8031,7 +8032,7 @@ void clif_changed_dir(struct block_list *bl) { WBUFL(buf,2) = bl->id; if (sd) WBUFW(buf,6) = sd->head_dir; - WBUFB(buf,8) = battle_get_dir(bl); + WBUFB(buf,8) = status_get_dir(bl); if (sd && sd->disguise > 23 && sd->disguise < 4001) // mob disguises [Valaris] clif_send(buf, packet_len_table[0x9c], &sd->bl, AREA); else @@ -8610,9 +8611,9 @@ void clif_parse_UnequipItem(int fd,struct map_session_data *sd) index = RFIFOW(fd,2)-2; /*if(sd->status.inventory[index].attribute == 1 && sd->sc_data && sd->sc_data[SC_BROKNWEAPON].timer!=-1) - skill_status_change_end(&sd->bl,SC_BROKNWEAPON,-1); + status_change_end(&sd->bl,SC_BROKNWEAPON,-1); if(sd->status.inventory[index].attribute == 1 && sd->sc_data && sd->sc_data[SC_BROKNARMOR].timer!=-1) - skill_status_change_end(&sd->bl,SC_BROKNARMOR,-1); + status_change_end(&sd->bl,SC_BROKNARMOR,-1); if(sd->sc_count && ( sd->sc_data[SC_BLADESTOP].timer!=-1 || sd->sc_data[SC_BERSERK].timer!=-1 )) return;*/ @@ -10062,10 +10063,10 @@ void clif_parse_GMReqNoChat(int fd,struct map_session_data *sd) WFIFOSET(dstfd,packet_len_table[0x14b]); dstsd->status.manner -= limit; if(dstsd->status.manner < 0) - skill_status_change_start(bl,SC_NOCHAT,0,0,0,0,0,0); + status_change_start(bl,SC_NOCHAT,0,0,0,0,0,0); else{ dstsd->status.manner = 0; - skill_status_change_end(bl,SC_NOCHAT,-1); + status_change_end(bl,SC_NOCHAT,-1); } printf("name:%s type:%d limit:%d manner:%d\n",dstsd->status.name,type,limit,dstsd->status.manner); } @@ -10263,7 +10264,7 @@ void clif_parse_sn_explosionspirits(int fd, struct map_session_data *sd) } if(s_class.job == 23 && sd->status.base_exp > 0 && nextbaseexp > 0 && (int)((double)1000*sd->status.base_exp/nextbaseexp)%100==0){ clif_skill_nodamage(&sd->bl,&sd->bl,MO_EXPLOSIONSPIRITS,5,1); - skill_status_change_start(&sd->bl,SkillStatusChangeTable[MO_EXPLOSIONSPIRITS],5,0,0,0,skill_get_time(MO_EXPLOSIONSPIRITS,5),0 ); + status_change_start(&sd->bl,SkillStatusChangeTable[MO_EXPLOSIONSPIRITS],5,0,0,0,skill_get_time(MO_EXPLOSIONSPIRITS,5),0 ); } } return; diff --git a/src/map/guild.c b/src/map/guild.c index 8099ac934..64e2b29d2 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -13,6 +13,7 @@ #include "battle.h" #include "npc.h" #include "pc.h" +#include "status.h" #include "map.h" #include "mob.h" #include "intif.h" @@ -995,7 +996,7 @@ int guild_skillup(struct map_session_data *sd,int skill_num,int flag) g->skill[idx].lv < guild_skill_get_max(skill_num) ){ intif_guild_skillup(g->guild_id,skill_num,sd->status.account_id,flag); } - pc_calcstatus (sd, 0); // Celest + status_calc_pc (sd, 0); // Celest return 0; } diff --git a/src/map/map.c b/src/map/map.c index 00643faca..2a74e94e8 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -22,6 +22,7 @@ #include "intif.h" #include "npc.h" #include "pc.h" +#include "status.h" #include "mob.h" #include "chat.h" #include "itemdb.h" @@ -1011,7 +1012,7 @@ int map_quit(struct map_session_data *sd) { if(sd->sc_data && sd->sc_data[SC_BERSERK].timer!=-1) //バ?サ?ク中の終了はHPを100に sd->status.hp = 100; - skill_status_change_clear(&sd->bl,1); // ステ?タス異常を解除する + status_change_clear(&sd->bl,1); // ステ?タス異常を解除する skill_clear_unitgroup(&sd->bl); // スキルユニットグル?プの削除 skill_cleartimerskill(&sd->bl); @@ -1025,7 +1026,7 @@ int map_quit(struct map_session_data *sd) { skill_gangsterparadise(sd,0); if (sd->state.auth) - pc_calcstatus(sd,4); + status_calc_pc(sd,4); // skill_clear_unitgroup(&sd->bl); // [Sara-chan] clif_clearchar_area(&sd->bl,2); @@ -2808,6 +2809,7 @@ int do_init(int argc, char *argv[]) { do_init_mob(); // npcの初期化時?でmob_spawnして、mob_dbを?照するのでinit_npcより先 do_init_script(); do_init_pc(); + do_init_status(); do_init_party(); do_init_guild(); do_init_storage(); diff --git a/src/map/mob.c b/src/map/mob.c index 741982041..6a2666cf1 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -13,6 +13,7 @@ #include "clif.h" #include "intif.h" #include "pc.h" +#include "status.h" #include "mob.h" #include "guild.h" #include "itemdb.h" @@ -449,8 +450,8 @@ static int calc_next_walk_step(struct mob_data *md) if(md->walkpath.path_pos>=md->walkpath.path_len) return -1; if(md->walkpath.path[md->walkpath.path_pos]&1) - return battle_get_speed(&md->bl)*14/10; - return battle_get_speed(&md->bl); + return status_get_speed(&md->bl)*14/10; + return status_get_speed(&md->bl); } static int mob_walktoxy_sub(struct mob_data *md); @@ -634,9 +635,9 @@ static int mob_attack(struct mob_data *md,unsigned int tick,int data) md->target_lv = battle_weapon_attack(&md->bl,tbl,tick,0); if(!(battle_config.monster_cloak_check_type&2) && md->sc_data[SC_CLOAKING].timer != -1) - skill_status_change_end(&md->bl,SC_CLOAKING,-1); + status_change_end(&md->bl,SC_CLOAKING,-1); - md->attackabletime = tick + battle_get_adelay(&md->bl); + md->attackabletime = tick + status_get_adelay(&md->bl); md->timer=add_timer(md->attackabletime,mob_timer,md->bl.id,0); md->state.state=MS_ATTACK; @@ -693,7 +694,7 @@ int mob_changestate(struct mob_data *md,int state,int type) if(i>0 && i<2000) md->timer=add_timer(md->attackabletime,mob_timer,md->bl.id,0); else if(type) { - md->attackabletime = tick + battle_get_amotion(&md->bl); + md->attackabletime = tick + status_get_amotion(&md->bl); md->timer=add_timer(md->attackabletime,mob_timer,md->bl.id,0); } else { @@ -712,7 +713,7 @@ int mob_changestate(struct mob_data *md,int state,int type) // Since it died, all aggressors' attack to this mob is stopped. clif_foreachclient(mob_stopattacked,md->bl.id); skill_unit_out_all(&md->bl,gettick(),1); - skill_status_change_clear(&md->bl,2); // ステータス異常を解除する + status_change_clear(&md->bl,2); // ステータス異常を解除する skill_clear_unitgroup(&md->bl); // 全てのスキルユニットグループを削除する skill_cleartimerskill(&md->bl); if(md->deletetimer!=-1) @@ -996,10 +997,10 @@ int mob_spawn(int id) memset(md->skillunit,0,sizeof(md->skillunit)); memset(md->skillunittick,0,sizeof(md->skillunittick)); - md->hp = battle_get_max_hp(&md->bl); + md->hp = status_get_max_hp(&md->bl); if(md->hp<=0){ mob_makedummymobdb(md->class_); - md->hp = battle_get_max_hp(&md->bl); + md->hp = status_get_max_hp(&md->bl); } clif_spawnmob(md); @@ -1067,7 +1068,7 @@ int mob_stop_walking(struct mob_data *md,int type) if(type&0x01) clif_fixmobpos(md); if(type&0x02) { - int delay=battle_get_dmotion(&md->bl); + int delay=status_get_dmotion(&md->bl); unsigned int tick = gettick(); if(md->canmove_tick < tick) md->canmove_tick = tick + delay; @@ -1169,8 +1170,8 @@ int mob_target(struct mob_data *md,struct block_list *bl,int dist) nullpo_retr(0, md); nullpo_retr(0, bl); - sc_data = battle_get_sc_data(bl); - option = battle_get_option(bl); + sc_data = status_get_sc_data(bl); + option = status_get_option(bl); race=mob_db[md->class_].race; if(!md->mode) @@ -1502,7 +1503,7 @@ static int mob_randomwalk(struct mob_data *md,int tick) nullpo_retr(0, md); - speed=battle_get_speed(&md->bl); + speed=status_get_speed(&md->bl); if(DIFF_TICK(md->next_walktime,tick)<0){ int i,x,y,c,d=12-md->move_fail_count; int mask[8][2] = {{0,1},{-1,1},{-1,0},{-1,-1},{0,-1},{1,-1},{1,0},{1,1}}; @@ -2110,7 +2111,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) nullpo_retr(0, md); //srcはNULLで呼ばれる場合もあるので、他でチェック - max_hp = battle_get_max_hp(&md->bl); + max_hp = status_get_max_hp(&md->bl); if(src && src->type == BL_PC) { sd = (struct map_session_data *)src; @@ -2289,9 +2290,9 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) } // end addition [Valaris] if(md->option&2 ) - skill_status_change_end(&md->bl, SC_HIDING, -1); + status_change_end(&md->bl, SC_HIDING, -1); if(md->option&4 ) - skill_status_change_end(&md->bl, SC_CLOAKING, -1); + status_change_end(&md->bl, SC_CLOAKING, -1); if(md->state.special_mob_ai == 2){//スフィアーマイン int skillidx=0; @@ -2321,7 +2322,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) memset(tmpsd,0,sizeof(tmpsd)); memset(pt,0,sizeof(pt)); - max_hp = battle_get_max_hp(&md->bl); + max_hp = status_get_max_hp(&md->bl); if(src && src->type == BL_MOB) mob_unlocktarget((struct mob_data *)src,tick); @@ -2329,7 +2330,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) /* ソウルドレイン */ if(sd && sd->state.attack_type == BF_MAGIC && (skill=pc_checkskill(sd,HW_SOULDRAIN))>0){ clif_skill_nodamage(src,&md->bl,HW_SOULDRAIN,skill,1); - sp = (battle_get_lv(&md->bl))*(65+15*skill)/100; + sp = (status_get_lv(&md->bl))*(65+15*skill)/100; if(sd->status.sp + sp > sd->status.max_sp) sp = sd->status.max_sp - sd->status.sp; sd->status.sp += sp; @@ -2530,7 +2531,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) if(sd && sd->state.attack_type == BF_WEAPON) { for(i=0;i<sd->monster_drop_item_count;i++) { struct delay_item_drop *ditem; - int race = battle_get_race(&md->bl); + int race = status_get_race(&md->bl); if(sd->monster_drop_itemid[i] <= 0) continue; if(sd->monster_drop_race[i] & (1<<race) || @@ -2684,11 +2685,11 @@ int mob_class_change(struct mob_data *md,int *value) class_ = value[rand()%count]; if(class_<=1000 || class_>MAX_MOB_DB) return 0; - max_hp = battle_get_max_hp(&md->bl); + max_hp = status_get_max_hp(&md->bl); hp_rate = md->hp*100/max_hp; clif_mob_class_change(md,class_); md->class_ = class_; - max_hp = battle_get_max_hp(&md->bl); + max_hp = status_get_max_hp(&md->bl); if(battle_config.monster_class_change_full_recover==1) { md->hp = max_hp; memset(md->dmglog,0,sizeof(md->dmglog)); @@ -2738,7 +2739,7 @@ int mob_class_change(struct mob_data *md,int *value) */ int mob_heal(struct mob_data *md,int heal) { - int max_hp = battle_get_max_hp(&md->bl); + int max_hp = status_get_max_hp(&md->bl); nullpo_retr(0, md); @@ -3079,7 +3080,7 @@ int mobskill_castend_id( int tid, unsigned int tick, int id,int data ) return 0; } if(md->skillid != NPC_EMOTION) - md->last_thinktime=tick + battle_get_adelay(&md->bl); + md->last_thinktime=tick + status_get_adelay(&md->bl); if((bl = map_id2bl(md->skilltarget)) == NULL || bl->prev==NULL){ //スキルターゲットが存在しない //printf("mobskill_castend_id nullpo\n");//ターゲットがいないときはnullpoじゃなくて普通に終了 @@ -3089,12 +3090,12 @@ int mobskill_castend_id( int tid, unsigned int tick, int id,int data ) return 0; if(md->skillid == PR_LEXAETERNA) { - struct status_change *sc_data = battle_get_sc_data(bl); + struct status_change *sc_data = status_get_sc_data(bl); if(sc_data && (sc_data[SC_FREEZE].timer != -1 || (sc_data[SC_STONE].timer != -1 && sc_data[SC_STONE].val2 == 0))) return 0; } else if(md->skillid == RG_BACKSTAP) { - int dir = map_calc_dir(&md->bl,bl->x,bl->y),t_dir = battle_get_dir(bl); + int dir = map_calc_dir(&md->bl,bl->x,bl->y),t_dir = status_get_dir(bl); int dist = distance(md->bl.x,md->bl.y,bl->x,bl->y); if(bl->type != BL_SKILL && (dist == 0 || map_check_dir(dir,t_dir))) return 0; @@ -3104,7 +3105,7 @@ int mobskill_castend_id( int tid, unsigned int tick, int id,int data ) return 0; range = skill_get_range(md->skillid,md->skilllv); if(range < 0) - range = battle_get_range(&md->bl) - (range + 1); + range = status_get_range(&md->bl) - (range + 1); if(range + battle_config.mob_skill_add_range < distance(md->bl.x,md->bl.y,bl->x,bl->y)) return 0; @@ -3122,7 +3123,7 @@ int mobskill_castend_id( int tid, unsigned int tick, int id,int data ) break; case 1:// 支援系 if(!mob_db[md->class_].skill[md->skillidx].val[0] && - (md->skillid==AL_HEAL || (md->skillid==ALL_RESURRECTION && bl->type != BL_PC)) && battle_check_undead(battle_get_race(bl),battle_get_elem_type(bl)) ) + (md->skillid==AL_HEAL || (md->skillid==ALL_RESURRECTION && bl->type != BL_PC)) && battle_check_undead(status_get_race(bl),status_get_elem_type(bl)) ) skill_castend_damage_id(&md->bl,bl,md->skillid,md->skilllv,tick,0); else skill_castend_nodamage_id(&md->bl,bl,md->skillid,md->skilllv,tick,0); @@ -3236,7 +3237,7 @@ int mobskill_castend_pos( int tid, unsigned int tick, int id,int data ) range = skill_get_range(md->skillid,md->skilllv); if(range < 0) - range = battle_get_range(&md->bl) - (range + 1); + range = status_get_range(&md->bl) - (range + 1); if(range + battle_config.mob_skill_add_range < distance(md->bl.x,md->bl.y,md->skillx,md->skilly)) return 0; md->skilldelay[md->skillidx]=tick; @@ -3300,7 +3301,7 @@ int mobskill_use_id(struct mob_data *md,struct block_list *target,int skill_idx) // 射程と障害物チェック range = skill_get_range(skill_id,skill_lv); if(range < 0) - range = battle_get_range(&md->bl) - (range + 1); + range = status_get_range(&md->bl) - (range + 1); if(!battle_check_range(&md->bl,target,range)) return 0; @@ -3312,7 +3313,7 @@ int mobskill_use_id(struct mob_data *md,struct block_list *target,int skill_idx) switch(skill_id){ /* 何か特殊な処理が必要 */ case ALL_RESURRECTION: /* リザレクション */ - if(target->type != BL_PC && battle_check_undead(battle_get_race(target),battle_get_elem_type(target))){ /* 敵がアンデッドなら */ + if(target->type != BL_PC && battle_check_undead(status_get_race(target),status_get_elem_type(target))){ /* 敵がアンデッドなら */ forcecast=1; /* ターンアンデットと同じ詠唱時間 */ casttime=skill_castfix(&md->bl, skill_get_cast(PR_TURNUNDEAD,skill_lv) ); } @@ -3358,7 +3359,7 @@ int mobskill_use_id(struct mob_data *md,struct block_list *target,int skill_idx) md->skillidx = skill_idx; if(!(battle_config.monster_cloak_check_type&2) && md->sc_data[SC_CLOAKING].timer != -1 && md->skillid != AS_CLOAKING) - skill_status_change_end(&md->bl,SC_CLOAKING,-1); + status_change_end(&md->bl,SC_CLOAKING,-1); if( casttime>0 ){ md->skilltimer = @@ -3417,7 +3418,7 @@ int mobskill_use_pos( struct mob_data *md, bl.y = skill_y; range = skill_get_range(skill_id,skill_lv); if(range < 0) - range = battle_get_range(&md->bl) - (range + 1); + range = status_get_range(&md->bl) - (range + 1); if(!battle_check_range(&md->bl,&bl,range)) return 0; @@ -3447,7 +3448,7 @@ int mobskill_use_pos( struct mob_data *md, md->skilllv = skill_lv; md->skillidx = skill_idx; if(!(battle_config.monster_cloak_check_type&2) && md->sc_data[SC_CLOAKING].timer != -1) - skill_status_change_end(&md->bl,SC_CLOAKING,-1); + status_change_end(&md->bl,SC_CLOAKING,-1); if( casttime>0 ){ md->skilltimer = add_timer( gettick()+casttime, mobskill_castend_pos, md->bl.id, 0 ); @@ -3553,7 +3554,7 @@ int mobskill_use(struct mob_data *md,unsigned int tick,int event) nullpo_retr(0, md); nullpo_retr(0, ms = mob_db[md->class_].skill); - max_hp = battle_get_max_hp(&md->bl); + max_hp = status_get_max_hp(&md->bl); if(battle_config.mob_skill_use == 0 || md->skilltimer != -1) return 0; diff --git a/src/map/npc.c b/src/map/npc.c index 349514e3b..133ab0ed7 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -15,6 +15,7 @@ #include "clif.h" #include "intif.h" #include "pc.h" +#include "status.h" #include "itemdb.h" #include "script.h" #include "mob.h" @@ -1117,8 +1118,8 @@ static int calc_next_walk_step(struct npc_data *nd) if(nd->walkpath.path_pos>=nd->walkpath.path_len) return -1; if(nd->walkpath.path[nd->walkpath.path_pos]&1) - return battle_get_speed(&nd->bl)*14/10; - return battle_get_speed(&nd->bl); + return status_get_speed(&nd->bl)*14/10; + return status_get_speed(&nd->bl); } @@ -1327,7 +1328,7 @@ int npc_stop_walking(struct npc_data *nd,int type) if(type&0x01) clif_fixnpcpos(nd); if(type&0x02) { - int delay=battle_get_dmotion(&nd->bl); + int delay=status_get_dmotion(&nd->bl); unsigned int tick = gettick(); if(nd->canmove_tick < tick) nd->canmove_tick = tick + delay; diff --git a/src/map/pc.c b/src/map/pc.c index 3713b4409..7f43c88e9 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -15,6 +15,7 @@ #include "clif.h" #include "intif.h" #include "pc.h" +#include "status.h" #include "npc.h" #include "mob.h" #include "pet.h" @@ -43,15 +44,6 @@ #define PVP_CALCRANK_INTERVAL 1000 // PVP順位計算の間隔 -#define STATE_BLIND 0x10 - -static int max_weight_base[MAX_PC_CLASS]; -static int hp_coefficient[MAX_PC_CLASS]; -static int hp_coefficient2[MAX_PC_CLASS]; -static int hp_sigma_val[MAX_PC_CLASS][MAX_LEVEL]; -static int sp_coefficient[MAX_PC_CLASS]; -static int aspd_base[MAX_PC_CLASS][20]; -static char job_bonus[3][MAX_PC_CLASS][MAX_LEVEL]; static int exp_table[14][MAX_LEVEL]; static char statp[255][7]; @@ -61,10 +53,6 @@ struct skill_tree_entry skill_tree[3][MAX_PC_CLASS][100]; int day_timer_tid; int night_timer_tid; -static int atkmods[3][20]; // 武器ATKサイズ修正(size_fix.txt) -static int refinebonus[5][3]; // 精?ボ?ナステ?ブル(refine_db.txt) -static int percentrefinery[5][10]; // 精?成功率(refine_db.txt) - static int dirx[8]={0,-1,-1,-1,0,1,1,1}; static int diry[8]={1,1,0,-1,-1,-1,0,1}; @@ -132,12 +120,6 @@ int pc_set_gm_level(int account_id, int level) { return 0; } -int pc_getrefinebonus(int lv, int type) { - if (lv >= 0 && lv < 5 && type >= 0 && type < 3) - return refinebonus[lv][type]; - return 0; -} - static int distance(int x0, int y0, int x1, int y1) { int dx, dy; @@ -279,7 +261,7 @@ int pc_setrestartvalue(struct map_session_data *sd,int type) { sd->status.sp=sd->status.max_sp; if (sd->state.snovice_flag == 4) { sd->state.snovice_flag = 0; - skill_status_change_start(&sd->bl,SkillStatusChangeTable[MO_STEELBODY],1,0,0,0,skill_get_time(MO_STEELBODY,1),0 ); + status_change_start(&sd->bl,SkillStatusChangeTable[MO_STEELBODY],1,0,0,0,skill_get_time(MO_STEELBODY,1),0 ); } } else { @@ -553,7 +535,7 @@ int pc_isequip(struct map_session_data *sd,int n) nullpo_retr(0, sd); item = sd->inventory_data[n]; - sc_data = battle_get_sc_data(&sd->bl); + sc_data = status_get_sc_data(&sd->bl); //s_class = pc_calc_base_job(sd->status.class_); if( battle_config.gm_allequip>0 && pc_isGM(sd)>=battle_config.gm_allequip ) @@ -889,7 +871,7 @@ int pc_authok(int id, int login_id2, time_t connect_until_time, struct mmo_chars } // ステ?タス初期計算など - pc_calcstatus(sd,1); + status_calc_pc(sd,1); if (pc_isGM(sd)) sprintf(tmp_output,"GM Character '"CL_WHITE"%s"CL_RESET"' logged in. (Acc. ID: '"CL_WHITE"%d"CL_RESET"', GM Level '"CL_WHITE"%d"CL_RESET"').\n", sd->status.name, sd->status.account_id, pc_isGM(sd)); @@ -1183,1208 +1165,16 @@ int pc_checkweighticon(struct map_session_data *sd) if(flag==1){ if(sd->sc_data[SC_WEIGHT50].timer==-1) - skill_status_change_start(&sd->bl,SC_WEIGHT50,0,0,0,0,0,0); + status_change_start(&sd->bl,SC_WEIGHT50,0,0,0,0,0,0); }else{ - skill_status_change_end(&sd->bl,SC_WEIGHT50,-1); + status_change_end(&sd->bl,SC_WEIGHT50,-1); } if(flag==2){ if(sd->sc_data[SC_WEIGHT90].timer==-1) - skill_status_change_start(&sd->bl,SC_WEIGHT90,0,0,0,0,0,0); + status_change_start(&sd->bl,SC_WEIGHT90,0,0,0,0,0,0); }else{ - skill_status_change_end(&sd->bl,SC_WEIGHT90,-1); - } - return 0; -} - -/*========================================== - * パラメ?タ計算 - * first==0の斬A計算?象のパラメ?タが呼び出し前から - * ? 化した場合自動でsendするが、 - * 能動的に?化させたパラメ?タは自前でsendするように - *------------------------------------------ - */ -int pc_calcstatus(struct map_session_data* sd,int first) -{ - int b_speed,b_max_hp,b_max_sp,b_hp,b_sp,b_weight,b_max_weight,b_paramb[6],b_parame[6],b_hit,b_flee; - int b_aspd,b_watk,b_def,b_watk2,b_def2,b_flee2,b_critical,b_attackrange,b_matk1,b_matk2,b_mdef,b_mdef2,b_class; - int b_base_atk; - struct skill b_skill[MAX_SKILL]; - int i,bl,index; - int skill,aspd_rate,wele,wele_,def_ele,refinedef=0; - int pele=0,pdef_ele=0; - int str,dstr,dex; - struct pc_base_job s_class; - - nullpo_retr(0, sd); - - //?生や養子の場合の元の職業を算出する - s_class = pc_calc_base_job(sd->status.class_); - - b_speed = sd->speed; - b_max_hp = sd->status.max_hp; - b_max_sp = sd->status.max_sp; - b_hp = sd->status.hp; - b_sp = sd->status.sp; - b_weight = sd->weight; - b_max_weight = sd->max_weight; - memcpy(b_paramb,&sd->paramb,sizeof(b_paramb)); - memcpy(b_parame,&sd->paramc,sizeof(b_parame)); - memcpy(b_skill,&sd->status.skill,sizeof(b_skill)); - b_hit = sd->hit; - b_flee = sd->flee; - b_aspd = sd->aspd; - b_watk = sd->watk; - b_def = sd->def; - b_watk2 = sd->watk2; - b_def2 = sd->def2; - b_flee2 = sd->flee2; - b_critical = sd->critical; - b_attackrange = sd->attackrange; - b_matk1 = sd->matk1; - b_matk2 = sd->matk2; - b_mdef = sd->mdef; - b_mdef2 = sd->mdef2; - b_class = sd->view_class; - sd->view_class = sd->status.class_; - b_base_atk = sd->base_atk; - - pc_calc_skilltree(sd); // スキルツリ?の計算 - - sd->max_weight = max_weight_base[s_class.job]+sd->status.str*300; - - if(first&1) { - sd->weight=0; - for(i=0;i<MAX_INVENTORY;i++){ - if(sd->status.inventory[i].nameid==0 || sd->inventory_data[i] == NULL) - continue; - sd->weight += sd->inventory_data[i]->weight*sd->status.inventory[i].amount; - } - sd->cart_max_weight=battle_config.max_cart_weight; - sd->cart_weight=0; - sd->cart_max_num=MAX_CART; - sd->cart_num=0; - for(i=0;i<MAX_CART;i++){ - if(sd->status.cart[i].nameid==0) - continue; - sd->cart_weight+=itemdb_weight(sd->status.cart[i].nameid)*sd->status.cart[i].amount; - sd->cart_num++; - } - } - - memset(sd->paramb,0,sizeof(sd->paramb)); - memset(sd->parame,0,sizeof(sd->parame)); - sd->hit = 0; - sd->flee = 0; - sd->flee2 = 0; - sd->critical = 0; - sd->aspd = 0; - sd->watk = 0; - sd->def = 0; - sd->mdef = 0; - sd->watk2 = 0; - sd->def2 = 0; - sd->mdef2 = 0; - sd->status.max_hp = 0; - sd->status.max_sp = 0; - sd->attackrange = 0; - sd->attackrange_ = 0; - sd->atk_ele = 0; - sd->def_ele = 0; - sd->star =0; - sd->overrefine =0; - sd->matk1 =0; - sd->matk2 =0; - sd->speed = DEFAULT_WALK_SPEED ; - sd->hprate=battle_config.hp_rate; - sd->sprate=battle_config.sp_rate; - sd->castrate=100; - sd->delayrate=100; - sd->dsprate=100; - sd->base_atk=0; - sd->arrow_atk=0; - sd->arrow_ele=0; - sd->arrow_hit=0; - sd->arrow_range=0; - sd->nhealhp=sd->nhealsp=sd->nshealhp=sd->nshealsp=sd->nsshealhp=sd->nsshealsp=0; - memset(sd->addele,0,sizeof(sd->addele)); - memset(sd->addrace,0,sizeof(sd->addrace)); - memset(sd->addsize,0,sizeof(sd->addsize)); - memset(sd->addele_,0,sizeof(sd->addele_)); - memset(sd->addrace_,0,sizeof(sd->addrace_)); - memset(sd->addsize_,0,sizeof(sd->addsize_)); - memset(sd->subele,0,sizeof(sd->subele)); - memset(sd->subrace,0,sizeof(sd->subrace)); - memset(sd->addeff,0,sizeof(sd->addeff)); - memset(sd->addeff2,0,sizeof(sd->addeff2)); - memset(sd->reseff,0,sizeof(sd->reseff)); - memset(&sd->special_state,0,sizeof(sd->special_state)); - memset(sd->weapon_coma_ele,0,sizeof(sd->weapon_coma_ele)); - memset(sd->weapon_coma_race,0,sizeof(sd->weapon_coma_race)); - memset(sd->weapon_atk,0,sizeof(sd->weapon_atk)); - memset(sd->weapon_atk_rate,0,sizeof(sd->weapon_atk_rate)); - - sd->watk_ = 0; //二刀流用(?) - sd->watk_2 = 0; - sd->atk_ele_ = 0; - sd->star_ = 0; - sd->overrefine_ = 0; - - sd->aspd_rate = 100; - sd->speed_rate = 100; - sd->hprecov_rate = 100; - sd->sprecov_rate = 100; - sd->critical_def = 0; - sd->double_rate = 0; - sd->near_attack_def_rate = sd->long_attack_def_rate = 0; - sd->atk_rate = sd->matk_rate = 100; - sd->ignore_def_ele = sd->ignore_def_race = 0; - sd->ignore_def_ele_ = sd->ignore_def_race_ = 0; - sd->ignore_mdef_ele = sd->ignore_mdef_race = 0; - sd->arrow_cri = 0; - sd->magic_def_rate = sd->misc_def_rate = 0; - memset(sd->arrow_addele,0,sizeof(sd->arrow_addele)); - memset(sd->arrow_addrace,0,sizeof(sd->arrow_addrace)); - memset(sd->arrow_addsize,0,sizeof(sd->arrow_addsize)); - memset(sd->arrow_addeff,0,sizeof(sd->arrow_addeff)); - memset(sd->arrow_addeff2,0,sizeof(sd->arrow_addeff2)); - memset(sd->magic_addele,0,sizeof(sd->magic_addele)); - memset(sd->magic_addrace,0,sizeof(sd->magic_addrace)); - memset(sd->magic_subrace,0,sizeof(sd->magic_subrace)); - sd->perfect_hit = 0; - sd->critical_rate = sd->hit_rate = sd->flee_rate = sd->flee2_rate = 100; - sd->def_rate = sd->def2_rate = sd->mdef_rate = sd->mdef2_rate = 100; - sd->def_ratio_atk_ele = sd->def_ratio_atk_ele_ = 0; - sd->def_ratio_atk_race = sd->def_ratio_atk_race_ = 0; - sd->get_zeny_num = 0; - sd->add_damage_class_count = sd->add_damage_class_count_ = sd->add_magic_damage_class_count = 0; - sd->add_def_class_count = sd->add_mdef_class_count = 0; - sd->monster_drop_item_count = 0; - memset(sd->add_damage_classrate,0,sizeof(sd->add_damage_classrate)); - memset(sd->add_damage_classrate_,0,sizeof(sd->add_damage_classrate_)); - memset(sd->add_magic_damage_classrate,0,sizeof(sd->add_magic_damage_classrate)); - memset(sd->add_def_classrate,0,sizeof(sd->add_def_classrate)); - memset(sd->add_mdef_classrate,0,sizeof(sd->add_mdef_classrate)); - memset(sd->monster_drop_race,0,sizeof(sd->monster_drop_race)); - memset(sd->monster_drop_itemrate,0,sizeof(sd->monster_drop_itemrate)); - sd->speed_add_rate = sd->aspd_add_rate = 100; - sd->double_add_rate = sd->perfect_hit_add = sd->get_zeny_add_num = 0; - sd->splash_range = sd->splash_add_range = 0; - sd->autospell_id = sd->autospell_lv = sd->autospell_rate = 0; - sd->hp_drain_rate = sd->hp_drain_per = sd->sp_drain_rate = sd->sp_drain_per = 0; - sd->hp_drain_rate_ = sd->hp_drain_per_ = sd->sp_drain_rate_ = sd->sp_drain_per_ = 0; - sd->short_weapon_damage_return = sd->long_weapon_damage_return = 0; - sd->magic_damage_return = 0; //AppleGirl Was Here - sd->random_attack_increase_add = sd->random_attack_increase_per = 0; - sd->hp_drain_value = sd->hp_drain_value_ = sd->sp_drain_value = sd->sp_drain_value_ = 0; - sd->unbreakable_equip = 0; - - - if(!sd->disguiseflag && sd->disguise) { - sd->disguise=0; - clif_changelook(&sd->bl,LOOK_WEAPON,sd->status.weapon); - clif_changelook(&sd->bl,LOOK_SHIELD,sd->status.shield); - clif_changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom); - clif_changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top); - clif_changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid); - clif_clearchar(&sd->bl, 9); - pc_setpos(sd, sd->mapname, sd->bl.x, sd->bl.y, 3); - } - - for(i=0;i<10;i++) { - index = sd->equip_index[i]; - if(index < 0) - continue; - if(i == 9 && sd->equip_index[8] == index) - continue; - if(i == 5 && sd->equip_index[4] == index) - continue; - if(i == 6 && (sd->equip_index[5] == index || sd->equip_index[4] == index)) - continue; - - if(sd->inventory_data[index]) { - if(sd->inventory_data[index]->type == 4) { - if(sd->status.inventory[index].card[0]!=0x00ff && sd->status.inventory[index].card[0]!=0x00fe && sd->status.inventory[index].card[0]!=(short)0xff00) { - int j; - for(j=0;j<sd->inventory_data[index]->slot;j++){ // カ?ド - int c=sd->status.inventory[index].card[j]; - if(c>0){ - if(i == 8 && sd->status.inventory[index].equip == 0x20) - sd->state.lr_flag = 1; - run_script(itemdb_equipscript(c),0,sd->bl.id,0); - sd->state.lr_flag = 0; - } - } - } - } - else if(sd->inventory_data[index]->type==5){ // 防具 - if(sd->status.inventory[index].card[0]!=0x00ff && sd->status.inventory[index].card[0]!=0x00fe && sd->status.inventory[index].card[0]!=(short)0xff00) { - int j; - for(j=0;j<sd->inventory_data[index]->slot;j++){ // カ?ド - int c=sd->status.inventory[index].card[j]; - if(c>0) - run_script(itemdb_equipscript(c),0,sd->bl.id,0); - } - } - } - } - } - wele = sd->atk_ele; - wele_ = sd->atk_ele_; - def_ele = sd->def_ele; - if(sd->status.pet_id > 0) { - struct pet_data *pd=sd->pd; - if((pd && battle_config.pet_status_support==1) && (battle_config.pet_equip_required==0 || (battle_config.pet_equip_required && pd->equip > 0))) { - if(sd->status.pet_id > 0 && sd->petDB && sd->pet.intimate > 0) - run_script(sd->petDB->script,0,sd->bl.id,0); - pele = sd->atk_ele; - pdef_ele = sd->def_ele; - sd->atk_ele = sd->def_ele = 0; - } - } - memcpy(sd->paramcard,sd->parame,sizeof(sd->paramcard)); - - // ?備品によるステ?タス?化はここで?行 - for(i=0;i<10;i++) { - index = sd->equip_index[i]; - if(index < 0) - continue; - if(i == 9 && sd->equip_index[8] == index) - continue; - if(i == 5 && sd->equip_index[4] == index) - continue; - if(i == 6 && (sd->equip_index[5] == index || sd->equip_index[4] == index)) - continue; - if(sd->inventory_data[index]) { - sd->def += sd->inventory_data[index]->def; - if(sd->inventory_data[index]->type == 4) { - int r,wlv = sd->inventory_data[index]->wlv; - if(i == 8 && sd->status.inventory[index].equip == 0x20) { - //二刀流用デ?タ入力 - sd->watk_ += sd->inventory_data[index]->atk; - sd->watk_2 = (r=sd->status.inventory[index].refine)* // 精?攻?力 - refinebonus[wlv][0]; - if( (r-=refinebonus[wlv][2])>0 ) // 過?精?ボ?ナス - sd->overrefine_ = r*refinebonus[wlv][1]; - - if(sd->status.inventory[index].card[0]==0x00ff){ // 製造武器 - sd->star_ = (sd->status.inventory[index].card[1]>>8); // 星のかけら - wele_= (sd->status.inventory[index].card[1]&0x0f); // ? 性 - } - sd->attackrange_ += sd->inventory_data[index]->range; - sd->state.lr_flag = 1; - run_script(sd->inventory_data[index]->equip_script,0,sd->bl.id,0); - sd->state.lr_flag = 0; - } - else { //二刀流武器以外 - sd->watk += sd->inventory_data[index]->atk; - sd->watk2 += (r=sd->status.inventory[index].refine)* // 精?攻?力 - refinebonus[wlv][0]; - if( (r-=refinebonus[wlv][2])>0 ) // 過?精?ボ?ナス - sd->overrefine += r*refinebonus[wlv][1]; - - if(sd->status.inventory[index].card[0]==0x00ff){ // 製造武器 - sd->star += (sd->status.inventory[index].card[1]>>8); // 星のかけら - wele = (sd->status.inventory[index].card[1]&0x0f); // ? 性 - } - sd->attackrange += sd->inventory_data[index]->range; - run_script(sd->inventory_data[index]->equip_script,0,sd->bl.id,0); - } - } - else if(sd->inventory_data[index]->type == 5) { - sd->watk += sd->inventory_data[index]->atk; - refinedef += sd->status.inventory[index].refine*refinebonus[0][0]; - run_script(sd->inventory_data[index]->equip_script,0,sd->bl.id,0); - } - } - } - - if(sd->equip_index[10] >= 0){ // 矢 - index = sd->equip_index[10]; - if(sd->inventory_data[index]){ //まだ?性が入っていない - sd->state.lr_flag = 2; - run_script(sd->inventory_data[index]->equip_script,0,sd->bl.id,0); - sd->state.lr_flag = 0; - sd->arrow_atk += sd->inventory_data[index]->atk; - } - } - sd->def += (refinedef+50)/100; - - if(sd->attackrange < 1) sd->attackrange = 1; - if(sd->attackrange_ < 1) sd->attackrange_ = 1; - if(sd->attackrange < sd->attackrange_) - sd->attackrange = sd->attackrange_; - if(sd->status.weapon == 11) - sd->attackrange += sd->arrow_range; - if(wele > 0) - sd->atk_ele = wele; - if(wele_ > 0) - sd->atk_ele_ = wele_; - if(def_ele > 0) - sd->def_ele = def_ele; - if(battle_config.pet_status_support) { - if(pele > 0 && !sd->atk_ele) - sd->atk_ele = pele; - if(pdef_ele > 0 && !sd->def_ele) - sd->def_ele = pdef_ele; - } - sd->double_rate += sd->double_add_rate; - sd->perfect_hit += sd->perfect_hit_add; - sd->get_zeny_num += sd->get_zeny_add_num; - sd->splash_range += sd->splash_add_range; - if(sd->speed_add_rate != 100) - sd->speed_rate += sd->speed_add_rate - 100; - if(sd->aspd_add_rate != 100) - sd->aspd_rate += sd->aspd_add_rate - 100; - - // 武器ATKサイズ補正 (右手) - sd->atkmods[0] = atkmods[0][sd->weapontype1]; - sd->atkmods[1] = atkmods[1][sd->weapontype1]; - sd->atkmods[2] = atkmods[2][sd->weapontype1]; - //武器ATKサイズ補正 (左手) - sd->atkmods_[0] = atkmods[0][sd->weapontype2]; - sd->atkmods_[1] = atkmods[1][sd->weapontype2]; - sd->atkmods_[2] = atkmods[2][sd->weapontype2]; - - // jobボ?ナス分 - for(i=0;i<sd->status.job_level && i<MAX_LEVEL;i++){ - if(job_bonus[s_class.upper][s_class.job][i]) - sd->paramb[job_bonus[s_class.upper][s_class.job][i]-1]++; - } - - if( (skill=pc_checkskill(sd,MC_INCCARRY))>0 ) // skill can be used with an item now, thanks to orn [Valaris] - sd->max_weight += skill*2000; - - if( (skill=pc_checkskill(sd,AC_OWL))>0 ) // ふくろうの目 - sd->paramb[4] += skill; - - if((skill=pc_checkskill(sd,BS_HILTBINDING))>0) { // Hilt binding gives +1 str +4 atk - sd->paramb[0] ++; - sd->base_atk += 4; - } - if((skill=pc_checkskill(sd,SA_DRAGONOLOGY))>0 ){ // Dragonology increases +1 int every 2 levels - sd->paramb[3] += (skill+1)*0.5; - } - - // New guild skills - Celest - if (sd->status.guild_id > 0 && !(first&4)) { - struct guild *g; - if ((g = guild_search(sd->status.guild_id)) && strcmp(sd->status.name,g->master)==0) { - if (!sd->state.leadership_flag && guild_checkskill(g, GD_LEADERSHIP)>0) { - skill_unitsetting(&sd->bl,GD_LEADERSHIP,1,sd->bl.x,sd->bl.y,0); - } - if (!sd->state.glorywounds_flag && guild_checkskill(g, GD_GLORYWOUNDS)>0) { - skill_unitsetting(&sd->bl,GD_GLORYWOUNDS,1,sd->bl.x,sd->bl.y,0); - } - if (!sd->state.soulcold_flag && guild_checkskill(g, GD_SOULCOLD)>0) { - skill_unitsetting(&sd->bl,GD_SOULCOLD,1,sd->bl.x,sd->bl.y,0); - } - if (!sd->state.hawkeyes_flag && guild_checkskill(g, GD_HAWKEYES)>0) { - skill_unitsetting(&sd->bl,GD_HAWKEYES,1,sd->bl.x,sd->bl.y,0); - } - } - else if (g) { - if (sd->sc_count && sd->sc_data[SC_BATTLEORDERS].timer != -1) { - sd->paramb[0]+= 5; - sd->paramb[3]+= 5; - sd->paramb[4]+= 5; - } - if (sd->state.leadership_flag) - sd->paramb[0] += 2; - if (sd->state.glorywounds_flag) - sd->paramb[2] += 2; - if (sd->state.soulcold_flag) - sd->paramb[1] += 2; - if (sd->state.hawkeyes_flag) - sd->paramb[4] += 2; - } - } - - // ステ?タス?化による基本パラメ?タ補正 - if(sd->sc_count){ - if(sd->sc_data[SC_CONCENTRATE].timer!=-1 && sd->sc_data[SC_QUAGMIRE].timer == -1){ // 集中力向上 - sd->paramb[1]+= (sd->status.agi+sd->paramb[1]+sd->parame[1]-sd->paramcard[1])*(2+sd->sc_data[SC_CONCENTRATE].val1)/100; - sd->paramb[4]+= (sd->status.dex+sd->paramb[4]+sd->parame[4]-sd->paramcard[4])*(2+sd->sc_data[SC_CONCENTRATE].val1)/100; - } - if(sd->sc_data[SC_INCREASEAGI].timer!=-1 && sd->sc_data[SC_QUAGMIRE].timer == -1 && sd->sc_data[SC_DONTFORGETME].timer == -1){ // 速度?加 - sd->paramb[1]+= 2+sd->sc_data[SC_INCREASEAGI].val1; - sd->speed -= sd->speed *25/100; - } - if(sd->sc_data[SC_DECREASEAGI].timer!=-1) // 速度減少(agiはbattle.cで) - sd->speed = sd->speed *125/100; - 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; - } - 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_SLOWDOWN].timer!=-1) - sd->speed = sd->speed*150/100; - if(sd->sc_data[SC_SPEEDUP0].timer!=-1) - sd->speed -= sd->speed*25/100; - 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; - sd->paramb[4]+= sd->sc_data[SC_BLESSING].val1; - } - if(sd->sc_data[SC_GLORIA].timer!=-1) // グロリア - sd->paramb[5]+= 30; - if(sd->sc_data[SC_LOUD].timer!=-1 && sd->sc_data[SC_QUAGMIRE].timer == -1) // ラウドボイス - sd->paramb[0]+= 4; - if(sd->sc_data[SC_QUAGMIRE].timer!=-1){ // クァグマイア - //int agib = (sd->status.agi+sd->paramb[1]+sd->parame[1])*(sd->sc_data[SC_QUAGMIRE].val1*10)/100; - //int dexb = (sd->status.dex+sd->paramb[4]+sd->parame[4])*(sd->sc_data[SC_QUAGMIRE].val1*10)/100; - //sd->paramb[1]-= agib > 50 ? 50 : agib; - //sd->paramb[4]-= dexb > 50 ? 50 : dexb; - sd->paramb[1]-= sd->sc_data[SC_QUAGMIRE].val1*5; - sd->paramb[4]-= sd->sc_data[SC_QUAGMIRE].val1*5; - sd->speed = sd->speed*3/2; - } - if(sd->sc_data[SC_TRUESIGHT].timer!=-1){ // トゥル?サイト - sd->paramb[0]+= 5; - sd->paramb[1]+= 5; - sd->paramb[2]+= 5; - sd->paramb[3]+= 5; - sd->paramb[4]+= 5; - sd->paramb[5]+= 5; - } - if(sd->sc_data[SC_MARIONETTE].timer!=-1){ - struct map_session_data *psd = map_id2sd(sd->sc_data[SC_MARIONETTE2].val3); - if (psd) { // if partner is found - sd->paramb[0]-= sd->status.str/2; // bonuses not included - sd->paramb[1]-= sd->status.agi/2; - sd->paramb[2]-= sd->status.vit/2; - sd->paramb[3]-= sd->status.int_/2; - sd->paramb[4]-= sd->status.dex/2; - sd->paramb[5]-= sd->status.luk/2; - } - } - else if(sd->sc_data[SC_MARIONETTE2].timer!=-1){ - struct map_session_data *psd = map_id2sd(sd->sc_data[SC_MARIONETTE2].val3); - if (psd) { // if partner is found - sd->paramb[0] += sd->status.str+psd->status.str/2 > 99 ? 99-sd->status.str : psd->status.str/2; - sd->paramb[1] += sd->status.agi+psd->status.agi/2 > 99 ? 99-sd->status.agi : psd->status.agi/2; - sd->paramb[2] += sd->status.vit+psd->status.vit/2 > 99 ? 99-sd->status.vit : psd->status.vit/2; - sd->paramb[3] += sd->status.int_+psd->status.int_/2 > 99 ? 99-sd->status.int_ : psd->status.int_/2; - sd->paramb[4] += sd->status.dex+psd->status.dex/2 > 99 ? 99-sd->status.dex : psd->status.dex/2; - sd->paramb[5] += sd->status.luk+psd->status.luk/2 > 99 ? 99-sd->status.luk : psd->status.luk/2; - } - } - if(sd->sc_data[SC_GOSPEL].timer!=-1 && sd->sc_data[SC_GOSPEL].val4 == BCT_PARTY){ - if (sd->sc_data[SC_GOSPEL].val3 == 6) { - sd->paramb[0]+= 2; - sd->paramb[1]+= 2; - sd->paramb[2]+= 2; - sd->paramb[3]+= 2; - sd->paramb[4]+= 2; - sd->paramb[5]+= 2; - } - } - } - - //1度も死んでないJob70スパノビに+10 - if(s_class.job == 23 && sd->die_counter == 0 && sd->status.job_level >= 70){ - sd->paramb[0]+= 15; - sd->paramb[1]+= 15; - sd->paramb[2]+= 15; - sd->paramb[3]+= 15; - sd->paramb[4]+= 15; - sd->paramb[5]+= 15; - } - sd->paramc[0]=sd->status.str+sd->paramb[0]+sd->parame[0]; - sd->paramc[1]=sd->status.agi+sd->paramb[1]+sd->parame[1]; - sd->paramc[2]=sd->status.vit+sd->paramb[2]+sd->parame[2]; - sd->paramc[3]=sd->status.int_+sd->paramb[3]+sd->parame[3]; - sd->paramc[4]=sd->status.dex+sd->paramb[4]+sd->parame[4]; - sd->paramc[5]=sd->status.luk+sd->paramb[5]+sd->parame[5]; - for(i=0;i<6;i++) - if(sd->paramc[i] < 0) sd->paramc[i] = 0; - - if(sd->status.weapon == 11 || sd->status.weapon == 13 || sd->status.weapon == 14) { - str = sd->paramc[4]; - dex = sd->paramc[0]; - } - else { - str = sd->paramc[0]; - dex = sd->paramc[4]; - } - dstr = str/10; - sd->base_atk += str + dstr*dstr + dex/5 + sd->paramc[5]/5; - sd->matk1 += sd->paramc[3]+(sd->paramc[3]/5)*(sd->paramc[3]/5); - sd->matk2 += sd->paramc[3]+(sd->paramc[3]/7)*(sd->paramc[3]/7); - if(sd->matk1 < sd->matk2) { - int temp = sd->matk2; - sd->matk2 = sd->matk1; - sd->matk1 = temp; - } - sd->hit += sd->paramc[4] + sd->status.base_level; - sd->flee += sd->paramc[1] + sd->status.base_level; - sd->def2 += sd->paramc[2]; - sd->mdef2 += sd->paramc[3]; - sd->flee2 += sd->paramc[5]+10; - sd->critical += (sd->paramc[5]*3)+10; - - if(sd->base_atk < 1) - sd->base_atk = 1; - if(sd->critical_rate != 100) - sd->critical = (sd->critical*sd->critical_rate)/100; - if(sd->critical < 10) sd->critical = 10; - if(sd->hit_rate != 100) - sd->hit = (sd->hit*sd->hit_rate)/100; - if(sd->hit < 1) sd->hit = 1; - if(sd->flee_rate != 100) - sd->flee = (sd->flee*sd->flee_rate)/100; - if(sd->flee < 1) sd->flee = 1; - if(sd->flee2_rate != 100) - sd->flee2 = (sd->flee2*sd->flee2_rate)/100; - if(sd->flee2 < 10) sd->flee2 = 10; - if(sd->def_rate != 100) - sd->def = (sd->def*sd->def_rate)/100; - if(sd->def < 0) sd->def = 0; - if(sd->def2_rate != 100) - sd->def2 = (sd->def2*sd->def2_rate)/100; - if(sd->def2 < 1) sd->def2 = 1; - if(sd->mdef_rate != 100) - sd->mdef = (sd->mdef*sd->mdef_rate)/100; - if(sd->mdef < 0) sd->mdef = 0; - if(sd->mdef2_rate != 100) - sd->mdef2 = (sd->mdef2*sd->mdef2_rate)/100; - if(sd->mdef2 < 1) sd->mdef2 = 1; - - // 二刀流 ASPD 修正 - if (sd->status.weapon <= 16) - sd->aspd += aspd_base[s_class.job][sd->status.weapon]-(sd->paramc[1]*4+sd->paramc[4])*aspd_base[s_class.job][sd->status.weapon]/1000; - else - sd->aspd += ( - (aspd_base[s_class.job][sd->weapontype1]-(sd->paramc[1]*4+sd->paramc[4])*aspd_base[s_class.job][sd->weapontype1]/1000) + - (aspd_base[s_class.job][sd->weapontype2]-(sd->paramc[1]*4+sd->paramc[4])*aspd_base[s_class.job][sd->weapontype2]/1000) - ) * 140 / 200; - - aspd_rate = sd->aspd_rate; - - //攻?速度?加 - - if((skill=pc_checkskill(sd,AC_VULTURE))>0){ // ワシの目 - sd->hit += skill; - if(sd->status.weapon == 11) - sd->attackrange += skill; - } - - if( (skill=pc_checkskill(sd,BS_WEAPONRESEARCH))>0) // 武器?究の命中率?加 - sd->hit += skill*2; - if(sd->status.option&2 && (skill = pc_checkskill(sd,RG_TUNNELDRIVE))>0 ) // トンネルドライブ // トンネルドライブ - sd->speed += (1.2*DEFAULT_WALK_SPEED - skill*9); - if (pc_iscarton(sd) && (skill=pc_checkskill(sd,MC_PUSHCART))>0) // カ?トによる速度低下 - sd->speed += (10-skill) * (DEFAULT_WALK_SPEED * 0.1); - else if (pc_isriding(sd)) { // ペコペコ?りによる速度?加 - sd->speed -= (0.25 * DEFAULT_WALK_SPEED); - sd->max_weight += 10000; - } - if((skill=pc_checkskill(sd,CR_TRUST))>0) { // フェイス - sd->status.max_hp += skill*200; - sd->subele[6] += skill*5; - } - if((skill=pc_checkskill(sd,BS_SKINTEMPER))>0) { - sd->subele[0] += skill; - sd->subele[3] += skill*5; - } - if((skill=pc_checkskill(sd,SA_ADVANCEDBOOK))>0 ) - aspd_rate -= skill*0.5; - - bl=sd->status.base_level; - - sd->status.max_hp += (3500 + bl*hp_coefficient2[s_class.job] + hp_sigma_val[s_class.job][(bl > 0)? bl-1:0])/100 * (100 + sd->paramc[2])/100 + (sd->parame[2] - sd->paramcard[2]); - if (s_class.upper==1) // [MouseJstr] - sd->status.max_hp = sd->status.max_hp * 130/100; - else if (s_class.upper==2) - sd->status.max_hp = sd->status.max_hp * 70/100; - - if(sd->hprate!=100) - sd->status.max_hp = sd->status.max_hp*sd->hprate/100; - - if(sd->sc_count && sd->sc_data[SC_BERSERK].timer!=-1){ // バ?サ?ク - sd->status.max_hp = sd->status.max_hp * 3; - // sd->status.hp = sd->status.hp * 3; - if(sd->status.max_hp > battle_config.max_hp) // removed negative max hp bug by Valaris - sd->status.max_hp = battle_config.max_hp; - if(sd->status.hp > battle_config.max_hp) // removed negative max hp bug by Valaris - sd->status.hp = battle_config.max_hp; - } - if(s_class.job == 23 && sd->status.base_level >= 99){ - sd->status.max_hp = sd->status.max_hp + 2000; - } - - if(sd->status.max_hp > battle_config.max_hp) // removed negative max hp bug by Valaris - sd->status.max_hp = battle_config.max_hp; - if(sd->status.max_hp <= 0) sd->status.max_hp = 1; // end - - // 最大SP計算 - sd->status.max_sp += ((sp_coefficient[s_class.job] * bl) + 1000)/100 * (100 + sd->paramc[3])/100 + (sd->parame[3] - sd->paramcard[3]); - if (s_class.upper==1) // [MouseJstr] - sd->status.max_sp = sd->status.max_sp * 130/100; - else if (s_class.upper==2) - sd->status.max_sp = sd->status.max_sp * 70/100; - if(sd->sprate!=100) - sd->status.max_sp = sd->status.max_sp*sd->sprate/100; - - if((skill=pc_checkskill(sd,HP_MEDITATIO))>0) // メディテイティオ - sd->status.max_sp += sd->status.max_sp*skill/100; - if((skill=pc_checkskill(sd,HW_SOULDRAIN))>0) /* ソウルドレイン */ - sd->status.max_sp += sd->status.max_sp*2*skill/100; - - if(sd->status.max_sp < 0 || sd->status.max_sp > battle_config.max_sp) - sd->status.max_sp = battle_config.max_sp; - - //自然回復HP - sd->nhealhp = 1 + (sd->paramc[2]/5) + (sd->status.max_hp/200); - if((skill=pc_checkskill(sd,SM_RECOVERY)) > 0) { /* HP回復力向上 */ - sd->nshealhp = skill*5 + (sd->status.max_hp*skill/500); - if(sd->nshealhp > 0x7fff) sd->nshealhp = 0x7fff; - } - //自然回復SP - sd->nhealsp = 1 + (sd->paramc[3]/6) + (sd->status.max_sp/100); - if(sd->paramc[3] >= 120) - sd->nhealsp += ((sd->paramc[3]-120)>>1) + 4; - if((skill=pc_checkskill(sd,MG_SRECOVERY)) > 0) { /* SP回復力向上 */ - sd->nshealsp = skill*3 + (sd->status.max_sp*skill/500); - if(sd->nshealsp > 0x7fff) sd->nshealsp = 0x7fff; - } - - if((skill = pc_checkskill(sd,MO_SPIRITSRECOVERY)) > 0) { - sd->nsshealhp = skill*4 + (sd->status.max_hp*skill/500); - sd->nsshealsp = skill*2 + (sd->status.max_sp*skill/500); - if(sd->nsshealhp > 0x7fff) sd->nsshealhp = 0x7fff; - if(sd->nsshealsp > 0x7fff) sd->nsshealsp = 0x7fff; - } - if(sd->hprecov_rate != 100) { - sd->nhealhp = sd->nhealhp*sd->hprecov_rate/100; - if(sd->nhealhp < 1) sd->nhealhp = 1; - } - if(sd->sprecov_rate != 100) { - sd->nhealsp = sd->nhealsp*sd->sprecov_rate/100; - if(sd->nhealsp < 1) sd->nhealsp = 1; - } - /* if((skill=pc_checkskill(sd,HP_MEDITATIO)) > 0) { // f?fffBfefCfefBfI,I'SPR,A*,I',E`,。ゥZ((c)。ョR「カn~.ゥォ,E',(c),(c),e' - sd->nhealsp += 3*skill*(sd->status.max_sp)/100; - if(sd->nhealsp > 0x7fff) sd->nhealsp = 0x7fff; - } Increase natural SP regen instead of colossal SP Recovery effect [DracoRPG]*/ - - // 種族耐性(これでいいの? ディバインプロテクションと同じ?理がいるかも) - if( (skill=pc_checkskill(sd,SA_DRAGONOLOGY))>0 ){ // ドラゴノロジ? - skill = skill*4; - sd->addrace[9]+=skill; - sd->addrace_[9]+=skill; - sd->subrace[9]+=skill; - sd->magic_addrace[9]+=skill; - sd->magic_subrace[9]-=skill; - } - - //Flee上昇 - if( (skill=pc_checkskill(sd,TF_MISS))>0 ){ // 回避率?加 - if(sd->status.class_==6||sd->status.class_==4007 || sd->status.class_==23){ - sd->flee += skill*3; - } - if(sd->status.class_==12||sd->status.class_==17||sd->status.class_==4013||sd->status.class_==4018) - sd->flee += skill*4; - if(sd->status.class_==12||sd->status.class_==4013) - sd->speed -= sd->speed *(skill*1.5)/100; - } - if( (skill=pc_checkskill(sd,MO_DODGE))>0 ) // 見切り - sd->flee += (skill*3)>>1; - - // スキルやステ?タス異常による?りのパラメ?タ補正 - if(sd->sc_count){ - // ATK/DEF?化形 - if(sd->sc_data[SC_ANGELUS].timer!=-1) // エンジェラス - sd->def2 = sd->def2*(110+5*sd->sc_data[SC_ANGELUS].val1)/100; - if(sd->sc_data[SC_IMPOSITIO].timer!=-1) {// インポシティオマヌス - sd->watk += sd->sc_data[SC_IMPOSITIO].val1*5; - index = sd->equip_index[8]; - if(index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->type == 4) - sd->watk_ += sd->sc_data[SC_IMPOSITIO].val1*5; - } - if(sd->sc_data[SC_PROVOKE].timer!=-1){ // プロボック - sd->def2 = sd->def2*(100-6*sd->sc_data[SC_PROVOKE].val1)/100; - sd->base_atk = sd->base_atk*(100+2*sd->sc_data[SC_PROVOKE].val1)/100; - sd->watk = sd->watk*(100+2*sd->sc_data[SC_PROVOKE].val1)/100; - index = sd->equip_index[8]; - if(index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->type == 4) - sd->watk_ = sd->watk_*(100+2*sd->sc_data[SC_PROVOKE].val1)/100; - } - if(sd->sc_data[SC_ENDURE].timer!=-1) - sd->mdef2 += sd->sc_data[SC_ENDURE].val1; - if(sd->sc_data[SC_MINDBREAKER].timer!=-1){ // プロボック - sd->mdef2 = sd->mdef2*(100-6*sd->sc_data[SC_MINDBREAKER].val1)/100; - sd->matk1 = sd->matk1*(100+2*sd->sc_data[SC_MINDBREAKER].val1)/100; - sd->matk2 = sd->matk2*(100+2*sd->sc_data[SC_MINDBREAKER].val1)/100; - } - if(sd->sc_data[SC_POISON].timer!=-1) // 毒?態 - sd->def2 = sd->def2*75/100; - if(sd->sc_data[SC_CURSE].timer!=-1){ - sd->base_atk = sd->base_atk*75/100; - sd->watk = sd->watk*75/100; - index = sd->equip_index[8]; - if(index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->type == 4) - sd->watk_ = sd->watk_*75/100; - } - if(sd->sc_data[SC_DRUMBATTLE].timer!=-1){ // ?太鼓の響き - sd->watk += sd->sc_data[SC_DRUMBATTLE].val2; - sd->def += sd->sc_data[SC_DRUMBATTLE].val3; - index = sd->equip_index[8]; - if(index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->type == 4) - sd->watk_ += sd->sc_data[SC_DRUMBATTLE].val2; - } - if(sd->sc_data[SC_NIBELUNGEN].timer!=-1) { // ニ?ベルングの指輪 - index = sd->equip_index[9]; - /*if(index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->wlv == 3) - sd->watk += sd->sc_data[SC_NIBELUNGEN].val3; - index = sd->equip_index[8]; - if(index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->wlv == 3) - sd->watk_ += sd->sc_data[SC_NIBELUNGEN].val3; - index = sd->equip_index[9];*/ - if(index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->wlv == 4) - sd->watk2 += sd->sc_data[SC_NIBELUNGEN].val3; - index = sd->equip_index[8]; - if(index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->wlv == 4) - sd->watk_2 += sd->sc_data[SC_NIBELUNGEN].val3; - } - - if(sd->sc_data[SC_VOLCANO].timer!=-1 && sd->def_ele==3){ // ボルケ?ノ - sd->watk += sd->sc_data[SC_VIOLENTGALE].val3; - } - - if(sd->sc_data[SC_SIGNUMCRUCIS].timer!=-1) - sd->def = sd->def * (100 - sd->sc_data[SC_SIGNUMCRUCIS].val2)/100; - if(sd->sc_data[SC_ETERNALCHAOS].timer!=-1) // エタ?ナルカオス - sd->def=0; - - if(sd->sc_data[SC_CONCENTRATION].timer!=-1){ //コンセントレ?ション - sd->watk = sd->watk * (100 + 5*sd->sc_data[SC_CONCENTRATION].val1)/100; - index = sd->equip_index[8]; - if(index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->type == 4) - sd->watk_ = sd->watk * (100 + 5*sd->sc_data[SC_CONCENTRATION].val1)/100; - sd->def = sd->def * (100 - 5*sd->sc_data[SC_CONCENTRATION].val1)/100; - } - - if(sd->sc_data[SC_MAGICPOWER].timer!=-1){ //魔法力?幅 - sd->matk1 = sd->matk1*(100+5*sd->sc_data[SC_MAGICPOWER].val1)/100; - sd->matk2 = sd->matk2*(100+5*sd->sc_data[SC_MAGICPOWER].val1)/100; - } - if(sd->sc_data[SC_ATKPOT].timer!=-1) - sd->watk += sd->sc_data[SC_ATKPOT].val1; - if(sd->sc_data[SC_MATKPOT].timer!=-1){ - sd->matk1 += sd->sc_data[SC_MATKPOT].val1; - sd->matk2 += sd->sc_data[SC_MATKPOT].val1; - } - - // ASPD/移動速度?化系 - if(sd->sc_data[SC_TWOHANDQUICKEN].timer != -1 && sd->sc_data[SC_QUAGMIRE].timer == -1 && sd->sc_data[SC_DONTFORGETME].timer == -1) // 2HQ - aspd_rate -= 30; - if(sd->sc_data[SC_ADRENALINE].timer != -1 && sd->sc_data[SC_TWOHANDQUICKEN].timer == -1 && - sd->sc_data[SC_QUAGMIRE].timer == -1 && sd->sc_data[SC_DONTFORGETME].timer == -1) { // アドレナリンラッシュ - if(sd->sc_data[SC_ADRENALINE].val2 || !battle_config.party_skill_penalty) - aspd_rate -= 30; - else - aspd_rate -= 25; - } - if(sd->sc_data[SC_SPEARSQUICKEN].timer != -1 && sd->sc_data[SC_ADRENALINE].timer == -1 && - sd->sc_data[SC_TWOHANDQUICKEN].timer == -1 && sd->sc_data[SC_QUAGMIRE].timer == -1 && sd->sc_data[SC_DONTFORGETME].timer == -1) // スピアクィッケン - aspd_rate -= sd->sc_data[SC_SPEARSQUICKEN].val2; - if(sd->sc_data[SC_ASSNCROS].timer!=-1 && // 夕陽のアサシンクロス - sd->sc_data[SC_TWOHANDQUICKEN].timer==-1 && sd->sc_data[SC_ADRENALINE].timer==-1 && sd->sc_data[SC_SPEARSQUICKEN].timer==-1 && - sd->sc_data[SC_DONTFORGETME].timer == -1) - aspd_rate -= 5+sd->sc_data[SC_ASSNCROS].val1+sd->sc_data[SC_ASSNCROS].val2+sd->sc_data[SC_ASSNCROS].val3; - if(sd->sc_data[SC_DONTFORGETME].timer!=-1){ // 私を忘れないで - aspd_rate += sd->sc_data[SC_DONTFORGETME].val1*3 + sd->sc_data[SC_DONTFORGETME].val2 + (sd->sc_data[SC_DONTFORGETME].val3>>16); - sd->speed= sd->speed*(100+sd->sc_data[SC_DONTFORGETME].val1*2 + sd->sc_data[SC_DONTFORGETME].val2 + (sd->sc_data[SC_DONTFORGETME].val3&0xffff))/100; - } - if( sd->sc_data[i=SC_SPEEDPOTION3].timer!=-1 || - sd->sc_data[i=SC_SPEEDPOTION2].timer!=-1 || - sd->sc_data[i=SC_SPEEDPOTION1].timer!=-1 || - sd->sc_data[i=SC_SPEEDPOTION0].timer!=-1) // ? 速ポ?ション - aspd_rate -= sd->sc_data[i].val2; - if(sd->sc_data[SC_WINDWALK].timer!=-1 && sd->sc_data[SC_INCREASEAGI].timer==-1) //ウィンドウォ?ク暫ヘLv*2%減算 - sd->speed -= sd->speed *(sd->sc_data[SC_WINDWALK].val1*2)/100; - if(sd->sc_data[SC_CARTBOOST].timer!=-1) // カ?トブ?スト - sd->speed -= (DEFAULT_WALK_SPEED * 20)/100; - if(sd->sc_data[SC_BERSERK].timer!=-1) //バ?サ?ク中はIAと同じぐらい速い? - sd->speed -= sd->speed *25/100; - if(sd->sc_data[SC_WEDDING].timer!=-1) //結婚中は?くのが?い - sd->speed = 2*DEFAULT_WALK_SPEED; - - // HIT/FLEE?化系 - if(sd->sc_data[SC_WHISTLE].timer!=-1){ // 口笛 - sd->flee += sd->flee * (sd->sc_data[SC_WHISTLE].val1 - +sd->sc_data[SC_WHISTLE].val2+(sd->sc_data[SC_WHISTLE].val3>>16))/100; - sd->flee2+= (sd->sc_data[SC_WHISTLE].val1+sd->sc_data[SC_WHISTLE].val2+(sd->sc_data[SC_WHISTLE].val3&0xffff)) * 10; - } - if(sd->sc_data[SC_HUMMING].timer!=-1) // ハミング - sd->hit += (sd->sc_data[SC_HUMMING].val1*2+sd->sc_data[SC_HUMMING].val2 - +sd->sc_data[SC_HUMMING].val3) * sd->hit/100; - if(sd->sc_data[SC_VIOLENTGALE].timer!=-1 && sd->def_ele==4){ // バイオレントゲイル - sd->flee += sd->flee*sd->sc_data[SC_VIOLENTGALE].val3/100; - } - if(sd->sc_data[SC_BLIND].timer!=-1){ // 暗? - sd->hit -= sd->hit*25/100; - sd->flee -= sd->flee*25/100; - } - if(sd->sc_data[SC_WINDWALK].timer!=-1) // ウィンドウォ?ク - sd->flee += sd->flee*(sd->sc_data[SC_WINDWALK].val2)/100; - if(sd->sc_data[SC_SPIDERWEB].timer!=-1) //スパイダ?ウェブ - sd->flee -= sd->flee*50/100; - if(sd->sc_data[SC_TRUESIGHT].timer!=-1) //トゥル?サイト - sd->hit += 3*(sd->sc_data[SC_TRUESIGHT].val1); - if(sd->sc_data[SC_CONCENTRATION].timer!=-1) //コンセントレ?ション - sd->hit += (10*(sd->sc_data[SC_CONCENTRATION].val1)); - - // 耐性 - if(sd->sc_data[SC_SIEGFRIED].timer!=-1){ // 不死身のジ?クフリ?ド - sd->subele[1] += sd->sc_data[SC_SIEGFRIED].val2; // 水 - sd->subele[2] += sd->sc_data[SC_SIEGFRIED].val2; // 水 - sd->subele[3] += sd->sc_data[SC_SIEGFRIED].val2; // 火 - sd->subele[4] += sd->sc_data[SC_SIEGFRIED].val2; // 水 - sd->subele[5] += sd->sc_data[SC_SIEGFRIED].val2; // 水 - sd->subele[6] += sd->sc_data[SC_SIEGFRIED].val2; // 水 - sd->subele[7] += sd->sc_data[SC_SIEGFRIED].val2; // 水 - sd->subele[8] += sd->sc_data[SC_SIEGFRIED].val2; // 水 - sd->subele[9] += sd->sc_data[SC_SIEGFRIED].val2; // 水 - } - if(sd->sc_data[SC_PROVIDENCE].timer!=-1){ // プロヴィデンス - sd->subele[6] += sd->sc_data[SC_PROVIDENCE].val2; // ? 聖?性 - sd->subrace[6] += sd->sc_data[SC_PROVIDENCE].val2; // ? ?魔 - } - - // その他 - if(sd->sc_data[SC_APPLEIDUN].timer!=-1){ // イドゥンの林檎 - sd->status.max_hp += ((5+sd->sc_data[SC_APPLEIDUN].val1*2+((sd->sc_data[SC_APPLEIDUN].val2+1)>>1) - +sd->sc_data[SC_APPLEIDUN].val3/10) * sd->status.max_hp)/100; - if(sd->status.max_hp < 0 || sd->status.max_hp > battle_config.max_hp) - 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; - if(sd->status.max_hp < 0 || sd->status.max_hp > battle_config.max_hp) - sd->status.max_hp = battle_config.max_hp; - } - if(sd->sc_data[SC_SERVICE4U].timer!=-1) { // サ?ビスフォ?ユ? - sd->status.max_sp += sd->status.max_sp*(10+sd->sc_data[SC_SERVICE4U].val1+sd->sc_data[SC_SERVICE4U].val2 - +sd->sc_data[SC_SERVICE4U].val3)/100; - if(sd->status.max_sp < 0 || sd->status.max_sp > battle_config.max_sp) - sd->status.max_sp = battle_config.max_sp; - sd->dsprate-=(10+sd->sc_data[SC_SERVICE4U].val1*3+sd->sc_data[SC_SERVICE4U].val2 - +sd->sc_data[SC_SERVICE4U].val3); - if(sd->dsprate<0)sd->dsprate=0; - } - - if(sd->sc_data[SC_FORTUNE].timer!=-1) // 幸運のキス - sd->critical += (10+sd->sc_data[SC_FORTUNE].val1+sd->sc_data[SC_FORTUNE].val2 - +sd->sc_data[SC_FORTUNE].val3)*10; - - if(sd->sc_data[SC_EXPLOSIONSPIRITS].timer!=-1){ // 爆裂波動 - if(s_class.job==23) - sd->critical += sd->sc_data[SC_EXPLOSIONSPIRITS].val1*100; - else - sd->critical += sd->sc_data[SC_EXPLOSIONSPIRITS].val2; - } - - if(sd->sc_data[SC_STEELBODY].timer!=-1){ // 金剛 - sd->def = 90; - sd->mdef = 90; - aspd_rate += 25; - sd->speed = (sd->speed * 125) / 100; - } - if(sd->sc_data[SC_DEFENDER].timer != -1) { - sd->aspd += (550 - sd->sc_data[SC_DEFENDER].val1*50); - // removed as of 12/14's patch [celest] - //sd->speed = (sd->speed * (155 - sd->sc_data[SC_DEFENDER].val1*5)) / 100; - } - if(sd->sc_data[SC_ENCPOISON].timer != -1) - sd->addeff[4] += sd->sc_data[SC_ENCPOISON].val2; - - if( sd->sc_data[SC_DANCING].timer!=-1 ){ // 演奏/ダンス使用中 - sd->speed = (double)sd->speed * (6.- 0.4 * pc_checkskill(sd, ((s_class.job == 19) ? BA_MUSICALLESSON : DC_DANCINGLESSON))); - //sd->speed*=4; - sd->nhealsp = 0; - sd->nshealsp = 0; - sd->nsshealsp = 0; - } - if(sd->sc_data[SC_CURSE].timer!=-1) - sd->speed += 450; - - if(sd->sc_data[SC_TRUESIGHT].timer!=-1) //トゥル?サイト - sd->critical += sd->critical*(sd->sc_data[SC_TRUESIGHT].val1)/100; - -/* if(sd->sc_data[SC_VOLCANO].timer!=-1) // エンチャントポイズン(?性はbattle.cで) - sd->addeff[2]+=sd->sc_data[SC_VOLCANO].val2;//% of granting - if(sd->sc_data[SC_DELUGE].timer!=-1) // エンチャントポイズン(?性はbattle.cで) - sd->addeff[0]+=sd->sc_data[SC_DELUGE].val2;//% of granting - */ - if(sd->sc_data[SC_BERSERK].timer!=-1) { //All Def/MDef reduced to 0 while in Berserk [DracoRPG] - sd->def = sd->def2 = 0; - sd->mdef = sd->mdef2 = 0; - sd->flee -= sd->flee*50/100; - aspd_rate -= 30; - //sd->base_atk *= 3; - } - if(sd->sc_data[SC_KEEPING].timer!=-1) - sd->def = 100; - if(sd->sc_data[SC_BARRIER].timer!=-1) - sd->mdef = 100; - - if(sd->sc_data[SC_GOSPEL].timer!=-1) { - if (sd->sc_data[SC_GOSPEL].val4 == BCT_PARTY){ - switch (sd->sc_data[SC_GOSPEL].val3) - { - case 4: - sd->status.max_hp += sd->status.max_hp * 25 / 100; - if(sd->status.max_hp > battle_config.max_hp) - sd->status.max_hp = battle_config.max_hp; - break; - case 5: - sd->status.max_sp += sd->status.max_sp * 25 / 100; - if(sd->status.max_sp > battle_config.max_sp) - sd->status.max_sp = battle_config.max_sp; - break; - case 11: - sd->def += sd->def * 25 / 100; - sd->def2 += sd->def2 * 25 / 100; - break; - case 12: - sd->base_atk += sd->base_atk * 8 / 100; - break; - case 13: - sd->flee += sd->flee * 5 / 100; - break; - case 14: - sd->hit += sd->hit * 5 / 100; - break; - } - } else if (sd->sc_data[SC_GOSPEL].val4 == BCT_ENEMY){ - switch (sd->sc_data[SC_GOSPEL].val3) - { - case 5: - sd->def = 0; - sd->def2 = 0; - break; - case 6: - sd->base_atk = 0; - sd->watk = 0; - sd->watk2 = 0; - break; - case 7: - sd->flee = 0; - break; - case 8: - sd->speed_rate += 75; - aspd_rate += 75; - break; - } - } - } - } - - if (sd->speed_rate <= 0) - sd->speed_rate = 1; - - if(sd->speed_rate != 100) - sd->speed = sd->speed*sd->speed_rate/100; - if(sd->speed < 1) sd->speed = 1; - if(aspd_rate != 100) - sd->aspd = sd->aspd*aspd_rate/100; - if(pc_isriding(sd)) // 騎兵修練 - sd->aspd = sd->aspd*(100 + 10*(5 - pc_checkskill(sd,KN_CAVALIERMASTERY)))/ 100; - if(sd->aspd < battle_config.max_aspd) sd->aspd = battle_config.max_aspd; - sd->amotion = sd->aspd; - sd->dmotion = 800-sd->paramc[1]*4; - if(sd->dmotion<400) - sd->dmotion = 400; - if(sd->skilltimer != -1 && (skill = pc_checkskill(sd,SA_FREECAST)) > 0) { - sd->prev_speed = sd->speed; - sd->speed = sd->speed*(175 - skill*5)/100; - } - - if(sd->status.hp>sd->status.max_hp) - sd->status.hp=sd->status.max_hp; - if(sd->status.sp>sd->status.max_sp) - sd->status.sp=sd->status.max_sp; - - if(first&4) - return 0; - if(first&3) { - clif_updatestatus(sd,SP_SPEED); - clif_updatestatus(sd,SP_MAXHP); - clif_updatestatus(sd,SP_MAXSP); - if(first&1) { - clif_updatestatus(sd,SP_HP); - clif_updatestatus(sd,SP_SP); - } - return 0; - } - - if(b_class != sd->view_class) { - clif_changelook(&sd->bl,LOOK_BASE,sd->view_class); -#if PACKETVER < 4 - clif_changelook(&sd->bl,LOOK_WEAPON,sd->status.weapon); - clif_changelook(&sd->bl,LOOK_SHIELD,sd->status.shield); -#else - clif_changelook(&sd->bl,LOOK_WEAPON,0); -#endif - } - - if( memcmp(b_skill,sd->status.skill,sizeof(sd->status.skill)) || b_attackrange != sd->attackrange) - clif_skillinfoblock(sd); // スキル送信 - - if(b_speed != sd->speed) - clif_updatestatus(sd,SP_SPEED); - if(b_weight != sd->weight) - clif_updatestatus(sd,SP_WEIGHT); - if(b_max_weight != sd->max_weight) { - clif_updatestatus(sd,SP_MAXWEIGHT); - pc_checkweighticon(sd); - } - for(i=0;i<6;i++) - if(b_paramb[i] + b_parame[i] != sd->paramb[i] + sd->parame[i]) - clif_updatestatus(sd,SP_STR+i); - if(b_hit != sd->hit) - clif_updatestatus(sd,SP_HIT); - if(b_flee != sd->flee) - clif_updatestatus(sd,SP_FLEE1); - if(b_aspd != sd->aspd) - clif_updatestatus(sd,SP_ASPD); - if(b_watk != sd->watk || b_base_atk != sd->base_atk) - clif_updatestatus(sd,SP_ATK1); - if(b_def != sd->def) - clif_updatestatus(sd,SP_DEF1); - if(b_watk2 != sd->watk2) - clif_updatestatus(sd,SP_ATK2); - if(b_def2 != sd->def2) - clif_updatestatus(sd,SP_DEF2); - if(b_flee2 != sd->flee2) - clif_updatestatus(sd,SP_FLEE2); - if(b_critical != sd->critical) - clif_updatestatus(sd,SP_CRITICAL); - if(b_matk1 != sd->matk1) - clif_updatestatus(sd,SP_MATK1); - if(b_matk2 != sd->matk2) - clif_updatestatus(sd,SP_MATK2); - if(b_mdef != sd->mdef) - clif_updatestatus(sd,SP_MDEF1); - if(b_mdef2 != sd->mdef2) - clif_updatestatus(sd,SP_MDEF2); - if(b_attackrange != sd->attackrange) - clif_updatestatus(sd,SP_ATTACKRANGE); - if(b_max_hp != sd->status.max_hp) - clif_updatestatus(sd,SP_MAXHP); - if(b_max_sp != sd->status.max_sp) - clif_updatestatus(sd,SP_MAXSP); - if(b_hp != sd->status.hp) - clif_updatestatus(sd,SP_HP); - if(b_sp != sd->status.sp) - clif_updatestatus(sd,SP_SP); - -/* if(before.cart_num != before.cart_num || before.cart_max_num != before.cart_max_num || - before.cart_weight != before.cart_weight || before.cart_max_weight != before.cart_max_weight ) - clif_updatestatus(sd,SP_CARTINFO);*/ - - //if(sd->status.hp<sd->status.max_hp>>2 && pc_checkskill(sd,SM_AUTOBERSERK)>0 && - if(sd->status.hp<sd->status.max_hp>>2 && sd->sc_data[SC_AUTOBERSERK].timer != -1 && - (sd->sc_data[SC_PROVOKE].timer==-1 || sd->sc_data[SC_PROVOKE].val2==0 ) && !pc_isdead(sd)) - // オ?トバ?サ?ク?動 - skill_status_change_start(&sd->bl,SC_PROVOKE,10,1,0,0,0,0); - - return 0; -} - -/*========================================== - * For quick calculating [Celest] - *------------------------------------------ - */ -int pc_calcspeed (struct map_session_data *sd) -{ - int b_speed, skill; - struct pc_base_job s_class; - - nullpo_retr(0, sd); - - s_class = pc_calc_base_job(sd->status.class_); - - b_speed = sd->speed; - sd->speed = DEFAULT_WALK_SPEED ; - - if(sd->sc_count){ - if(sd->sc_data[SC_INCREASEAGI].timer!=-1 && sd->sc_data[SC_QUAGMIRE].timer == -1 && sd->sc_data[SC_DONTFORGETME].timer == -1){ // 速度?加 - sd->speed -= sd->speed *25/100; - } - if(sd->sc_data[SC_DECREASEAGI].timer!=-1) { - sd->speed = sd->speed *125/100; - } - if(sd->sc_data[SC_CLOAKING].timer!=-1) { - sd->speed = sd->speed * (sd->sc_data[SC_CLOAKING].val3-sd->sc_data[SC_CLOAKING].val1*3) /100; - } - if(sd->sc_data[SC_CHASEWALK].timer!=-1) { - sd->speed = sd->speed * sd->sc_data[SC_CHASEWALK].val3 /100; - } - if(sd->sc_data[SC_QUAGMIRE].timer!=-1){ - sd->speed = sd->speed*3/2; - } - if(sd->sc_data[SC_WINDWALK].timer!=-1 && sd->sc_data[SC_INCREASEAGI].timer==-1) { - sd->speed -= sd->speed *(sd->sc_data[SC_WINDWALK].val1*2)/100; - } - if(sd->sc_data[SC_CARTBOOST].timer!=-1) { - sd->speed -= (DEFAULT_WALK_SPEED * 20)/100; - } - if(sd->sc_data[SC_BERSERK].timer!=-1) { - sd->speed -= sd->speed *25/100; - } - if(sd->sc_data[SC_WEDDING].timer!=-1) { - sd->speed = 2*DEFAULT_WALK_SPEED; - } - if(sd->sc_data[SC_DONTFORGETME].timer!=-1){ - sd->speed= sd->speed*(100+sd->sc_data[SC_DONTFORGETME].val1*2 + sd->sc_data[SC_DONTFORGETME].val2 + (sd->sc_data[SC_DONTFORGETME].val3&0xffff))/100; - } - if(sd->sc_data[SC_STEELBODY].timer!=-1){ - sd->speed = (sd->speed * 125) / 100; - } - if(sd->sc_data[SC_DEFENDER].timer != -1) { - // removed as of 12/14's patch [celest] - //sd->speed = (sd->speed * (155 - sd->sc_data[SC_DEFENDER].val1*5)) / 100; - } - if( sd->sc_data[SC_DANCING].timer!=-1 ){ - sd->speed = (double)sd->speed * (6.- 0.4 * pc_checkskill(sd, ((s_class.job == 19) ? BA_MUSICALLESSON : DC_DANCINGLESSON))); - } - if(sd->sc_data[SC_CURSE].timer!=-1) - sd->speed += 450; - if(sd->sc_data[SC_SLOWDOWN].timer!=-1) - sd->speed = sd->speed*150/100; - if(sd->sc_data[SC_SPEEDUP0].timer!=-1) - sd->speed -= sd->speed*25/100; - } - - if(sd->status.option&2 && (skill = pc_checkskill(sd,RG_TUNNELDRIVE))>0 ) - sd->speed += (1.2*DEFAULT_WALK_SPEED - skill*9); - if (pc_iscarton(sd) && (skill=pc_checkskill(sd,MC_PUSHCART))>0) - sd->speed += (10-skill) * (DEFAULT_WALK_SPEED * 0.1); - else if (pc_isriding(sd)) { - sd->speed -= (0.25 * DEFAULT_WALK_SPEED); + status_change_end(&sd->bl,SC_WEIGHT90,-1); } - if((skill=pc_checkskill(sd,TF_MISS))>0) - if(s_class.job==12) - sd->speed -= sd->speed *(skill*1.5)/100; - - if(sd->speed_rate != 100) - sd->speed = sd->speed*sd->speed_rate/100; - if(sd->speed < 1) sd->speed = 1; - - if(sd->skilltimer != -1 && (skill = pc_checkskill(sd,SA_FREECAST)) > 0) { - sd->prev_speed = sd->speed; - sd->speed = sd->speed*(175 - skill*5)/100; - } - - if(b_speed != sd->speed) - clif_updatestatus(sd,SP_SPEED); - return 0; } @@ -3076,12 +1866,12 @@ int pc_skill(struct map_session_data *sd,int id,int level,int flag) } if(!flag && (sd->status.skill[id].id == id || level == 0)){ // クエスト所得ならここで?件を確認して送信する sd->status.skill[id].lv=level; - pc_calcstatus(sd,0); + status_calc_pc(sd,0); clif_skillinfoblock(sd); } else if(flag==2 && (sd->status.skill[id].id == id || level == 0)){ // クエスト所得ならここで?件を確認して送信する sd->status.skill[id].lv+=level; - pc_calcstatus(sd,0); + status_calc_pc(sd,0); clif_skillinfoblock(sd); } else if(sd->status.skill[id].lv < level){ // ?えられるがlvが小さいなら @@ -3949,19 +2739,19 @@ int pc_setpos(struct map_session_data *sd,char *mapname_org,int x,int y,int clrt if (sd->sc_count) { if(sd->sc_data[SC_TRICKDEAD].timer != -1) - skill_status_change_end(&sd->bl, SC_TRICKDEAD, -1); + status_change_end(&sd->bl, SC_TRICKDEAD, -1); if(sd->sc_data[SC_BLADESTOP].timer!=-1) - skill_status_change_end(&sd->bl,SC_BLADESTOP,-1); + status_change_end(&sd->bl,SC_BLADESTOP,-1); if(sd->sc_data[SC_DANCING].timer!=-1) // clear dance effect when warping [Valaris] skill_stop_dancing(&sd->bl,0); } if(sd->status.option&2) - skill_status_change_end(&sd->bl, SC_HIDING, -1); + status_change_end(&sd->bl, SC_HIDING, -1); if(sd->status.option&4) - skill_status_change_end(&sd->bl, SC_CLOAKING, -1); + status_change_end(&sd->bl, SC_CLOAKING, -1); if(sd->status.option&16386) - skill_status_change_end(&sd->bl, SC_CHASEWALK, -1); + status_change_end(&sd->bl, SC_CHASEWALK, -1); if(sd->status.pet_id > 0 && sd->pd && sd->pet.intimate > 0) { pet_stopattack(sd->pd); @@ -3999,7 +2789,7 @@ int pc_setpos(struct map_session_data *sd,char *mapname_org,int x,int y,int clrt sd->pd = NULL; sd->petDB = NULL; if(battle_config.pet_status_support) - pc_calcstatus(sd,2); + status_calc_pc(sd,2); } else if(sd->pet.intimate > 0) { pet_stopattack(sd->pd); @@ -4056,7 +2846,7 @@ int pc_setpos(struct map_session_data *sd,char *mapname_org,int x,int y,int clrt sd->pd = NULL; sd->petDB = NULL; if(battle_config.pet_status_support) - pc_calcstatus(sd,2); + status_calc_pc(sd,2); pc_makesavestatus(sd); chrif_save(sd); storage_storage_save(sd); @@ -4332,7 +3122,7 @@ static int pc_walk(int tid,unsigned int tick,int id,int data) if ((su = (struct skill_unit *)sd->sc_data[SC_BASILICA].val4)) { struct skill_unit_group *sg; if ((sg = su->group) && sg->src_id == sd->bl.id) { - skill_status_change_end(&sd->bl,SC_BASILICA,-1); + status_change_end(&sd->bl,SC_BASILICA,-1); skill_delunitgroup (sg); } } @@ -4449,7 +3239,7 @@ int pc_stop_walking(struct map_session_data *sd,int type) clif_fixpos(&sd->bl); if(type&0x02 && battle_config.pc_damage_delay) { unsigned int tick = gettick(); - int delay = battle_get_dmotion(&sd->bl); + int delay = status_get_dmotion(&sd->bl); if(sd->canmove_tick < tick) sd->canmove_tick = tick + delay; } @@ -4584,41 +3374,41 @@ int pc_checkallowskill(struct map_session_data *sd) nullpo_retr(0, sd->sc_data); if(!(skill_get_weapontype(KN_TWOHANDQUICKEN)&(1<<sd->status.weapon)) && sd->sc_data[SC_TWOHANDQUICKEN].timer!=-1) { // 2HQ - skill_status_change_end(&sd->bl,SC_TWOHANDQUICKEN,-1); // 2HQを解除 + status_change_end(&sd->bl,SC_TWOHANDQUICKEN,-1); // 2HQを解除 return -1; } if(!(skill_get_weapontype(LK_AURABLADE)&(1<<sd->status.weapon)) && sd->sc_data[SC_AURABLADE].timer!=-1) { /* オ?ラブレ?ド */ - skill_status_change_end(&sd->bl,SC_AURABLADE,-1); /* オ?ラブレ?ドを解除 */ + status_change_end(&sd->bl,SC_AURABLADE,-1); /* オ?ラブレ?ドを解除 */ return -1; } if(!(skill_get_weapontype(LK_PARRYING)&(1<<sd->status.weapon)) && sd->sc_data[SC_PARRYING].timer!=-1) { /* パリイング */ - skill_status_change_end(&sd->bl,SC_PARRYING,-1); /* パリイングを解除 */ + status_change_end(&sd->bl,SC_PARRYING,-1); /* パリイングを解除 */ return -1; } if(!(skill_get_weapontype(LK_CONCENTRATION)&(1<<sd->status.weapon)) && sd->sc_data[SC_CONCENTRATION].timer!=-1) { /* コンセントレ?ション */ - skill_status_change_end(&sd->bl,SC_CONCENTRATION,-1); /* コンセントレ?ションを解除 */ + status_change_end(&sd->bl,SC_CONCENTRATION,-1); /* コンセントレ?ションを解除 */ return -1; } if(!(skill_get_weapontype(CR_SPEARQUICKEN)&(1<<sd->status.weapon)) && sd->sc_data[SC_SPEARSQUICKEN].timer!=-1){ // スピアクィッケン - skill_status_change_end(&sd->bl,SC_SPEARSQUICKEN,-1); // スピアクイッケンを解除 + status_change_end(&sd->bl,SC_SPEARSQUICKEN,-1); // スピアクイッケンを解除 return -1; } if(!(skill_get_weapontype(BS_ADRENALINE)&(1<<sd->status.weapon)) && sd->sc_data[SC_ADRENALINE].timer!=-1){ // アドレナリンラッシュ - skill_status_change_end(&sd->bl,SC_ADRENALINE,-1); // アドレナリンラッシュを解除 + status_change_end(&sd->bl,SC_ADRENALINE,-1); // アドレナリンラッシュを解除 return -1; } if(sd->status.shield <= 0) { if(sd->sc_data[SC_AUTOGUARD].timer!=-1){ // オ?トガ?ド - skill_status_change_end(&sd->bl,SC_AUTOGUARD,-1); + status_change_end(&sd->bl,SC_AUTOGUARD,-1); return -1; } if(sd->sc_data[SC_DEFENDER].timer!=-1){ // ディフェンダ? - skill_status_change_end(&sd->bl,SC_DEFENDER,-1); + status_change_end(&sd->bl,SC_DEFENDER,-1); return -1; } if(sd->sc_data[SC_REFLECTSHIELD].timer!=-1){ //リフレクトシ?ルド - skill_status_change_end(&sd->bl,SC_REFLECTSHIELD,-1); + status_change_end(&sd->bl,SC_REFLECTSHIELD,-1); return -1; } } @@ -4764,11 +3554,11 @@ int pc_attack_timer(int tid,unsigned int tick,int id,int data) return 0; } - //if((opt = battle_get_option(bl)) != NULL && *opt&0x46) - if((opt = battle_get_option(bl)) != NULL && *opt&0x42) + //if((opt = status_get_option(bl)) != NULL && *opt&0x46) + if((opt = status_get_option(bl)) != NULL && *opt&0x42) return 0; - if(((sc_data = battle_get_sc_data(bl)) != NULL && sc_data[SC_TRICKDEAD].timer != -1) || - ((sc_data = battle_get_sc_data(bl)) != NULL && sc_data[SC_BASILICA].timer != -1 )) + if(((sc_data = status_get_sc_data(bl)) != NULL && sc_data[SC_TRICKDEAD].timer != -1) || + ((sc_data = status_get_sc_data(bl)) != NULL && sc_data[SC_BASILICA].timer != -1 )) return 0; if(sd->skilltimer != -1 && pc_checkskill(sd,SA_FREECAST) <= 0) @@ -4808,7 +3598,7 @@ int pc_attack_timer(int tid,unsigned int tick,int id,int data) sd->attacktarget_lv = battle_weapon_attack(&sd->bl,bl,tick,0); // &2 = ? - Celest if(!(battle_config.pc_cloak_check_type&2) && sd->sc_data[SC_CLOAKING].timer != -1) - skill_status_change_end(&sd->bl,SC_CLOAKING,-1); + status_change_end(&sd->bl,SC_CLOAKING,-1); if(sd->status.pet_id > 0 && sd->pd && sd->petDB && battle_config.pet_attack_support) pet_target_check(sd,bl,0); map_freeblock_unlock(); @@ -4969,16 +3759,16 @@ int pc_checkbaselevelup(struct map_session_data *sd) clif_updatestatus(sd,SP_STATUSPOINT); clif_updatestatus(sd,SP_BASELEVEL); clif_updatestatus(sd,SP_NEXTBASEEXP); - pc_calcstatus(sd,0); + status_calc_pc(sd,0); pc_heal(sd,sd->status.max_hp,sd->status.max_sp); //スパノビはキリエ、イムポ、マニピ、グロ、サフラLv1がかかる if(s_class.job == 23){ - skill_status_change_start(&sd->bl,SkillStatusChangeTable[PR_KYRIE],1,0,0,0,skill_get_time(PR_KYRIE,1),0 ); - skill_status_change_start(&sd->bl,SkillStatusChangeTable[PR_IMPOSITIO],1,0,0,0,skill_get_time(PR_IMPOSITIO,1),0 ); - skill_status_change_start(&sd->bl,SkillStatusChangeTable[PR_MAGNIFICAT],1,0,0,0,skill_get_time(PR_MAGNIFICAT,1),0 ); - skill_status_change_start(&sd->bl,SkillStatusChangeTable[PR_GLORIA],1,0,0,0,skill_get_time(PR_GLORIA,1),0 ); - skill_status_change_start(&sd->bl,SkillStatusChangeTable[PR_SUFFRAGIUM],1,0,0,0,skill_get_time(PR_SUFFRAGIUM,1),0 ); + status_change_start(&sd->bl,SkillStatusChangeTable[PR_KYRIE],1,0,0,0,skill_get_time(PR_KYRIE,1),0 ); + status_change_start(&sd->bl,SkillStatusChangeTable[PR_IMPOSITIO],1,0,0,0,skill_get_time(PR_IMPOSITIO,1),0 ); + status_change_start(&sd->bl,SkillStatusChangeTable[PR_MAGNIFICAT],1,0,0,0,skill_get_time(PR_MAGNIFICAT,1),0 ); + status_change_start(&sd->bl,SkillStatusChangeTable[PR_GLORIA],1,0,0,0,skill_get_time(PR_GLORIA,1),0 ); + status_change_start(&sd->bl,SkillStatusChangeTable[PR_SUFFRAGIUM],1,0,0,0,skill_get_time(PR_SUFFRAGIUM,1),0 ); } clif_misceffect(&sd->bl,0); @@ -5005,7 +3795,7 @@ int pc_checkjoblevelup(struct map_session_data *sd) clif_updatestatus(sd,SP_NEXTJOBEXP); sd->status.skill_point ++; clif_updatestatus(sd,SP_SKILLPOINT); - pc_calcstatus(sd,0); + status_calc_pc(sd,0); clif_misceffect(&sd->bl,1); return 1; @@ -5261,7 +4051,7 @@ int pc_statusup(struct map_session_data *sd,int type) } clif_updatestatus(sd,SP_STATUSPOINT); clif_updatestatus(sd,type); - pc_calcstatus(sd,0); + status_calc_pc(sd,0); clif_statusupack(sd,type,1,val); return 0; @@ -5337,7 +4127,7 @@ int pc_statusup2(struct map_session_data *sd,int type,int val) } clif_updatestatus(sd,type-SP_STR+SP_USTR); clif_updatestatus(sd,type); - pc_calcstatus(sd,0); + status_calc_pc(sd,0); clif_statusupack(sd,type,1,val); return 0; @@ -5363,7 +4153,7 @@ int pc_skillup(struct map_session_data *sd,int skill_num) { sd->status.skill[skill_num].lv++; sd->status.skill_point--; - pc_calcstatus(sd,0); + status_calc_pc(sd,0); clif_skillup(sd,skill_num); clif_updatestatus(sd,SP_SKILLPOINT); clif_skillinfoblock(sd); @@ -5421,7 +4211,7 @@ int pc_allskillup(struct map_session_data *sd) } } } - pc_calcstatus(sd,0); + status_calc_pc(sd,0); return 0; } @@ -5506,7 +4296,7 @@ int pc_resetlvl(struct map_session_data* sd,int type) } clif_skillinfoblock(sd); - pc_calcstatus(sd,0); + status_calc_pc(sd,0); return 0; } @@ -5559,7 +4349,7 @@ int pc_resetstate(struct map_session_data* sd) clif_updatestatus(sd,SP_UDEX); clif_updatestatus(sd,SP_ULUK); // End Addition - pc_calcstatus(sd,0); + status_calc_pc(sd,0); return 0; } @@ -5594,7 +4384,7 @@ int pc_resetskill(struct map_session_data* sd) } clif_updatestatus(sd,SP_SKILLPOINT); clif_skillinfoblock(sd); - pc_calcstatus(sd,0); + status_calc_pc(sd,0); return 0; } @@ -5626,7 +4416,7 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage) if (sd->sc_data[SC_ENDURE].timer == -1 && sd->sc_data[SC_BERSERK].timer == -1 && !sd->special_state.infinite_endure) pc_stop_walking(sd,3); else if(sd->sc_data[SC_ENDURE].timer != -1 && (src != NULL && src->type==BL_MOB) && (--sd->sc_data[SC_ENDURE].val2) <= 0) - skill_status_change_end(&sd->bl, SC_ENDURE, -1); + status_change_end(&sd->bl, SC_ENDURE, -1); } else pc_stop_walking(sd,3); @@ -5639,13 +4429,13 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage) pet_target_check(sd,src,1); if (sd->sc_data[SC_TRICKDEAD].timer != -1) - skill_status_change_end(&sd->bl, SC_TRICKDEAD, -1); + status_change_end(&sd->bl, SC_TRICKDEAD, -1); if(sd->status.option&2) - skill_status_change_end(&sd->bl, SC_HIDING, -1); + status_change_end(&sd->bl, SC_HIDING, -1); if(sd->status.option&4) - skill_status_change_end(&sd->bl, SC_CLOAKING, -1); + status_change_end(&sd->bl, SC_CLOAKING, -1); if(sd->status.option&16386) - skill_status_change_end(&sd->bl, SC_CHASEWALK, -1); + status_change_end(&sd->bl, SC_CHASEWALK, -1); if(sd->status.hp>0){ // まだ生きているならHP更新 @@ -5655,7 +4445,7 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage) if(sd->status.hp<sd->status.max_hp>>2 && sd->sc_data[SC_AUTOBERSERK].timer != -1 && (sd->sc_data[SC_PROVOKE].timer==-1 || sd->sc_data[SC_PROVOKE].val2==0 )) // オ?トバ?サ?ク?動 - skill_status_change_start(&sd->bl,SC_PROVOKE,10,1,0,0,0,0); + status_change_start(&sd->bl,SC_PROVOKE,10,1,0,0,0,0); sd->canlog_tick = gettick(); @@ -5686,11 +4476,11 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage) pc_setdead(sd); skill_unit_out_all(&sd->bl,gettick(),1); if(sd->sc_data[SC_BLADESTOP].timer!=-1)//白刃は事前に解除 - skill_status_change_end(&sd->bl,SC_BLADESTOP,-1); + status_change_end(&sd->bl,SC_BLADESTOP,-1); pc_setglobalreg(sd,"PC_DIE_COUNTER",++sd->die_counter); //死にカウンタ?書き?み - skill_status_change_clear(&sd->bl,0); // ステ?タス異常を解除する + status_change_clear(&sd->bl,0); // ステ?タス異常を解除する clif_updatestatus(sd,SP_HP); - pc_calcstatus(sd,0); + status_calc_pc(sd,0); if (sd->state.event_death) { struct npc_data *npc; @@ -5735,7 +4525,7 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage) for(i=0;i<5;i++) if(sd->dev.val1[i]){ - skill_status_change_end(&map_id2sd(sd->dev.val1[i])->bl,SC_DEVOTION,-1); + status_change_end(&map_id2sd(sd->dev.val1[i])->bl,SC_DEVOTION,-1); sd->dev.val1[i] = sd->dev.val2[i]=0; } @@ -5992,7 +4782,7 @@ int pc_setparam(struct map_session_data *sd,int type,int val) clif_updatestatus(sd, SP_NEXTBASEEXP); clif_updatestatus(sd, SP_STATUSPOINT); clif_updatestatus(sd, SP_BASEEXP); - pc_calcstatus(sd, 0); + status_calc_pc(sd, 0); pc_heal(sd, sd->status.max_hp, sd->status.max_sp); break; case SP_JOBLEVEL: @@ -6012,7 +4802,7 @@ int pc_setparam(struct map_session_data *sd,int type,int val) clif_updatestatus(sd, SP_NEXTJOBEXP); clif_updatestatus(sd, SP_JOBEXP); clif_updatestatus(sd, SP_SKILLPOINT); - pc_calcstatus(sd, 0); + status_calc_pc(sd, 0); clif_misceffect(&sd->bl, 1); } else { sd->status.job_level = val; @@ -6020,7 +4810,7 @@ int pc_setparam(struct map_session_data *sd,int type,int val) clif_updatestatus(sd, SP_JOBLEVEL); clif_updatestatus(sd, SP_NEXTJOBEXP); clif_updatestatus(sd, SP_JOBEXP); - pc_calcstatus(sd, 0); + status_calc_pc(sd, 0); } clif_updatestatus(sd,type); break; @@ -6351,7 +5141,7 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper) if(battle_config.muting_players && sd->status.manner < 0) clif_changestatus(&sd->bl,SP_MANNER,sd->status.manner); - pc_calcstatus(sd,0); + status_calc_pc(sd,0); pc_checkallowskill(sd); pc_equiplookall(sd); clif_equiplist(sd); @@ -6439,7 +5229,7 @@ int pc_setoption(struct map_session_data *sd,int type) sd->status.option=type; clif_changeoption(&sd->bl); - pc_calcstatus(sd,0); + status_calc_pc(sd,0); return 0; } @@ -6654,7 +5444,7 @@ int pc_setglobalreg(struct map_session_data *sd,char *reg,int val) //PC_DIE_COUNTERがスクリプトなどで?更された暫フ?理 if(strcmp(reg,"PC_DIE_COUNTER") == 0 && sd->die_counter != val){ sd->die_counter = val; - pc_calcstatus(sd,0); + status_calc_pc(sd,0); } else if(strcmp(reg,"PCDieEvent") == 0){ sd->state.event_death = val; } else if(strcmp(reg,"PCKillEvent") == 0){ @@ -6811,29 +5601,6 @@ int pc_setaccountreg2(struct map_session_data *sd,char *reg,int val) return 1; } -/*========================================== - * 精?成功率 - *------------------------------------------ - */ -int pc_percentrefinery(struct map_session_data *sd,struct item *item) -{ - int percent; - - nullpo_retr(0, item); - percent=percentrefinery[itemdb_wlv(item->nameid)][(int)item->refine]; - - percent += pc_checkskill(sd,BS_WEAPONRESEARCH); // 武器?究スキル所持 - - // 確率の有?範?チェック - if( percent > 100 ){ - percent = 100; - } - if( percent < 0 ){ - percent = 0; - } - - return percent; -} /*========================================== * イベントタイマ??理 @@ -7085,20 +5852,20 @@ int pc_equipitem(struct map_session_data *sd,int n,int pos) clif_arrowequip(sd,arrow); sd->status.inventory[arrow].equip=32768; } - pc_calcstatus(sd,0); + status_calc_pc(sd,0); if(sd->special_state.infinite_endure) { if(sd->sc_data[SC_ENDURE].timer == -1) - skill_status_change_start(&sd->bl,SC_ENDURE,10,1,0,0,0,0); + status_change_start(&sd->bl,SC_ENDURE,10,1,0,0,0,0); } else { if(sd->sc_count && sd->sc_data[SC_ENDURE].timer != -1 && sd->sc_data[SC_ENDURE].val2) - skill_status_change_end(&sd->bl,SC_ENDURE,-1); + status_change_end(&sd->bl,SC_ENDURE,-1); } if(sd->sc_count) { if (sd->sc_data[SC_SIGNUMCRUCIS].timer != -1 && !battle_check_undead(7,sd->def_ele)) - skill_status_change_end(&sd->bl,SC_SIGNUMCRUCIS,-1); + status_change_end(&sd->bl,SC_SIGNUMCRUCIS,-1); if(sd->sc_data[SC_DANCING].timer!=-1 && (sd->status.weapon != 13 && sd->status.weapon !=14)) skill_stop_dancing(&sd->bl,0); } @@ -7162,10 +5929,10 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag) if(sd->sc_count) { if (sd->sc_data[SC_BROKNWEAPON].timer != -1 && sd->status.inventory[n].equip & 0x0002 && sd->status.inventory[n].attribute == 1) - skill_status_change_end(&sd->bl,SC_BROKNWEAPON,-1); + status_change_end(&sd->bl,SC_BROKNWEAPON,-1); if(sd->sc_data[SC_BROKNARMOR].timer != -1 && sd->status.inventory[n].equip & 0x0010 && sd->status.inventory[n].attribute == 1) - skill_status_change_end(&sd->bl,SC_BROKNARMOR,-1); + status_change_end(&sd->bl,SC_BROKNARMOR,-1); } clif_unequipitemack(sd,n,sd->status.inventory[n].equip,1); @@ -7178,9 +5945,9 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag) clif_unequipitemack(sd,n,0,0); } if(flag&1) { - pc_calcstatus(sd,0); + status_calc_pc(sd,0); if(sd->sc_count && sd->sc_data[SC_SIGNUMCRUCIS].timer != -1 && !battle_check_undead(7,sd->def_ele)) - skill_status_change_end(&sd->bl,SC_SIGNUMCRUCIS,-1); + status_change_end(&sd->bl,SC_SIGNUMCRUCIS,-1); } return 0; @@ -7261,7 +6028,7 @@ int pc_checkitem(struct map_session_data *sd) pc_setequipindex(sd); if(calc_flag) - pc_calcstatus(sd,2); + status_calc_pc(sd,2); return 0; } @@ -7980,7 +6747,7 @@ void pc_setstand(struct map_session_data *sd){ nullpo_retv(sd); if(sd->sc_count && sd->sc_data[SC_TENSIONRELAX].timer!=-1) - skill_status_change_end(&sd->bl,SC_TENSIONRELAX,-1); + status_change_end(&sd->bl,SC_TENSIONRELAX,-1); sd->state.dead_sit = 0; } @@ -8042,96 +6809,6 @@ int pc_readdb(void) sprintf(tmp_output,"Done reading '"CL_WHITE"%s"CL_RESET"'.\n","db/exp.txt"); ShowStatus(tmp_output); - // JOB補正?値1 - fp=fopen("db/job_db1.txt","r"); - if(fp==NULL){ - printf("can't read db/job_db1.txt\n"); - return 1; - } - i=0; - while(fgets(line, sizeof(line)-1, fp)){ - char *split[50]; - if(line[0]=='/' && line[1]=='/') - continue; - for(j=0,p=line;j<21 && p;j++){ - split[j]=p; - p=strchr(p,','); - if(p) *p++=0; - } - if(j<21) - continue; - max_weight_base[i]=atoi(split[0]); - hp_coefficient[i]=atoi(split[1]); - hp_coefficient2[i]=atoi(split[2]); - sp_coefficient[i]=atoi(split[3]); - for(j=0;j<17;j++) - aspd_base[i][j]=atoi(split[j+4]); - i++; -// -- moonsoul (below two lines added to accommodate high numbered new class ids) - if(i==24) - i=4001; - if(i==MAX_PC_CLASS) - break; - } - fclose(fp); - sprintf(tmp_output,"Done reading '"CL_WHITE"%s"CL_RESET"'.\n","db/job_db1.txt"); - ShowStatus(tmp_output); - - // JOBボ?ナス - memset(job_bonus,0,sizeof(job_bonus)); - fp=fopen("db/job_db2.txt","r"); - if(fp==NULL){ - printf("can't read db/job_db2.txt\n"); - return 1; - } - i=0; - while(fgets(line, sizeof(line)-1, fp)){ - if(line[0]=='/' && line[1]=='/') - continue; - for(j=0,p=line;j<MAX_LEVEL && p;j++){ - if(sscanf(p,"%d",&k)==0) - break; - job_bonus[0][i][j]=k; - job_bonus[2][i][j]=k; //養子職のボ?ナスは分からないので? - p=strchr(p,','); - if(p) p++; - } - i++; -// -- moonsoul (below two lines added to accommodate high numbered new class ids) - if(i==24) - i=4001; - if(i==MAX_PC_CLASS) - break; - } - fclose(fp); - sprintf(tmp_output,"Done reading '"CL_WHITE"%s"CL_RESET"'.\n","db/job_db2.txt"); - ShowStatus(tmp_output); - - // JOBボ?ナス2 ?生職用 - fp=fopen("db/job_db2-2.txt","r"); - if(fp==NULL){ - printf("can't read db/job_db2-2.txt\n"); - return 1; - } - i=0; - while(fgets(line, sizeof(line)-1, fp)){ - if(line[0]=='/' && line[1]=='/') - continue; - for(j=0,p=line;j<MAX_LEVEL && p;j++){ - if(sscanf(p,"%d",&k)==0) - break; - job_bonus[1][i][j]=k; - p=strchr(p,','); - if(p) p++; - } - i++; - if(i==MAX_PC_CLASS) - break; - } - fclose(fp); - sprintf(tmp_output,"Done reading '"CL_WHITE"%s"CL_RESET"'.\n","db/job_db2-2.txt"); - ShowStatus(tmp_output); - // スキルツリ? memset(skill_tree,0,sizeof(skill_tree)); fp=fopen("db/skill_tree.txt","r"); @@ -8221,88 +6898,6 @@ int pc_readdb(void) sprintf(tmp_output,"Done reading '"CL_WHITE"%s"CL_RESET"'.\n","db/attr_fix.txt"); ShowStatus(tmp_output); - // サイズ補正テ?ブル - for(i=0;i<3;i++) - for(j=0;j<20;j++) - atkmods[i][j]=100; - fp=fopen("db/size_fix.txt","r"); - if(fp==NULL){ - printf("can't read db/size_fix.txt\n"); - return 1; - } - i=0; - while(fgets(line, sizeof(line)-1, fp)){ - char *split[20]; - if(line[0]=='/' && line[1]=='/') - continue; - if(atoi(line)<=0) - continue; - memset(split,0,sizeof(split)); - for(j=0,p=line;j<20 && p;j++){ - split[j]=p; - p=strchr(p,','); - if(p) *p++=0; - } - for(j=0;j<20 && split[j];j++) - atkmods[i][j]=atoi(split[j]); - i++; - } - fclose(fp); - sprintf(tmp_output,"Done reading '"CL_WHITE"%s"CL_RESET"'.\n","db/size_fix.txt"); - ShowStatus(tmp_output); - - // 精?デ?タテ?ブル - for(i=0;i<5;i++){ - for(j=0;j<10;j++) - percentrefinery[i][j]=100; - refinebonus[i][0]=0; - refinebonus[i][1]=0; - refinebonus[i][2]=10; - } - fp=fopen("db/refine_db.txt","r"); - if(fp==NULL){ - printf("can't read db/refine_db.txt\n"); - return 1; - } - i=0; - while(fgets(line, sizeof(line)-1, fp)){ - char *split[16]; - if(line[0]=='/' && line[1]=='/') - continue; - if(atoi(line)<=0) - continue; - memset(split,0,sizeof(split)); - for(j=0,p=line;j<16 && p;j++){ - split[j]=p; - p=strchr(p,','); - if(p) *p++=0; - } - refinebonus[i][0]=atoi(split[0]); // 精?ボ?ナス - refinebonus[i][1]=atoi(split[1]); // 過?精?ボ?ナス - refinebonus[i][2]=atoi(split[2]); // 安全精?限界 - for(j=0;j<10 && split[j];j++) - percentrefinery[i][j]=atoi(split[j+3]); - i++; - } - fclose(fp); //Lupus. close this file!!! - sprintf(tmp_output,"Done reading '"CL_WHITE"%s"CL_RESET"'.\n","db/refine_db.txt"); - ShowStatus(tmp_output); - - return 0; -} - -static int pc_calc_sigma(void) -{ - int i,j,k; - - for(i=0;i<MAX_PC_CLASS;i++) { - memset(hp_sigma_val[i],0,sizeof(hp_sigma_val[i])); - for(k=0,j=2;j<=MAX_LEVEL;j++) { - k += hp_coefficient[i]*j + 50; - k -= k%100; - hp_sigma_val[i][j-1] = k; - } - } return 0; } @@ -8317,12 +6912,12 @@ static void pc_statpointdb(void) if(stp==NULL){ printf("can't read db/statpoint.txt\n"); - return; + return; } - fseek(stp, 0, SEEK_END); - end = ftell(stp); - rewind(stp); + fseek(stp, 0, SEEK_END); + end = ftell(stp); + rewind(stp); buf_stat = (char *) aMallocA (end + 1); l = fread(buf_stat,1,end,stp); @@ -8332,16 +6927,16 @@ static void pc_statpointdb(void) // printf("read db/statpoint.txt done (size=%d)\n",l); for(i=0;i<255;i++) { - j=0; - while (*(buf_stat+k)!='\n') { - statp[i][j]=*(buf_stat+k); - j++;k++; - } - statp[i][j+1]='\0'; - k++; + j=0; + while (*(buf_stat+k)!='\n') { + statp[i][j]=*(buf_stat+k); + j++;k++; + } + statp[i][j+1]='\0'; + k++; } - aFree(buf_stat); + aFree(buf_stat); } /*========================================== @@ -8351,7 +6946,6 @@ static void pc_statpointdb(void) int do_init_pc(void) { pc_readdb(); pc_statpointdb(); - pc_calc_sigma(); // gm_account_db = numdb_init(); diff --git a/src/map/pc.h b/src/map/pc.h index 02dfcb74a..6fe04c946 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -7,6 +7,7 @@ #define OPTION_MASK 0xd7b8 #define CART_MASK 0x788 +#define STATE_BLIND 0x10 #define pc_setdead(sd) ((sd)->state.dead_sit = 1) #define pc_setsit(sd) ((sd)->state.dead_sit = 2) @@ -44,6 +45,7 @@ int pc_checkskill(struct map_session_data *sd,int skill_id); int pc_checkallowskill(struct map_session_data *sd); int pc_checkequip(struct map_session_data *sd,int pos); +int pc_calc_skilltree(struct map_session_data *sd); int pc_calc_skilltree_normalize_job(int c, struct map_session_data *sd); int pc_checkoverhp(struct map_session_data*); @@ -79,8 +81,6 @@ int pc_dropitem(struct map_session_data*,int,int); int pc_checkweighticon(struct map_session_data *sd); -int pc_calcstatus(struct map_session_data*,int); -int pc_calcspeed(struct map_session_data*); // [Celest] int pc_bonus(struct map_session_data*,int,int); int pc_bonus2(struct map_session_data *sd,int,int,int); int pc_bonus3(struct map_session_data *sd,int,int,int,int); @@ -146,7 +146,6 @@ int pc_readaccountreg(struct map_session_data*,char*); int pc_setaccountreg(struct map_session_data*,char*,int); int pc_readaccountreg2(struct map_session_data*,char*); int pc_setaccountreg2(struct map_session_data*,char*,int); -int pc_percentrefinery(struct map_session_data *sd,struct item *item); int pc_addeventtimer(struct map_session_data *sd,int tick,const char *name); int pc_deleventtimer(struct map_session_data *sd,const char *name); diff --git a/src/map/pet.c b/src/map/pet.c index 99f2a4d95..759e2d11b 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -9,6 +9,7 @@ #include "nullpo.h" #include "malloc.h" #include "pc.h" +#include "status.h" #include "map.h" #include "intif.h" #include "clif.h" @@ -202,7 +203,7 @@ static int pet_attack(struct pet_data *pd,unsigned int tick,int data) pd->target_lv = battle_weapon_attack(&pd->bl,&md->bl,tick,0); - pd->attackabletime = tick + battle_get_adelay(&pd->bl); + pd->attackabletime = tick + status_get_adelay(&pd->bl); pd->timer=add_timer(pd->attackabletime,pet_timer,pd->bl.id,0); pd->state.state=MS_ATTACK; @@ -310,7 +311,7 @@ int pet_target_check(struct map_session_data *sd,struct block_list *bl,int type) Assert((pd->msd == 0) || (pd->msd->pd == pd)); - if(bl && pd && bl->type == BL_MOB && sd->pet.intimate > 900 && sd->pet.hungry > 0 && pd->class_ != battle_get_class(bl) + if(bl && pd && bl->type == BL_MOB && sd->pet.intimate > 900 && sd->pet.hungry > 0 && pd->class_ != status_get_class(bl) && pd->state.state != MS_DELAY) { mode=mob_db[pd->class_].mode; race=mob_db[pd->class_].race; @@ -518,9 +519,9 @@ static int pet_hungry(int tid,unsigned int tick,int id,int data) sd->pet.intimate = 0; if(battle_config.pet_status_support && t > 0) { if(sd->bl.prev != NULL) - pc_calcstatus(sd,0); + status_calc_pc(sd,0); else - pc_calcstatus(sd,2); + status_calc_pc(sd,2); } } clif_send_petdata(sd,1,sd->pet.intimate); @@ -672,9 +673,9 @@ int pet_return_egg(struct map_session_data *sd) } if(battle_config.pet_status_support && sd->pet.intimate > 0) { if(sd->bl.prev != NULL) - pc_calcstatus(sd,0); + status_calc_pc(sd,0); else - pc_calcstatus(sd,2); + status_calc_pc(sd,2); } // ルートしたItemを落とさせる pet_lootitem_drop(pd,sd); @@ -821,9 +822,9 @@ int pet_recv_petdata(int account_id,struct s_pet *p,int flag) } if(battle_config.pet_status_support && sd->pet.intimate > 0) { if(sd->bl.prev != NULL) - pc_calcstatus(sd,0); + status_calc_pc(sd,0); else - pc_calcstatus(sd,2); + status_calc_pc(sd,2); } return 0; @@ -995,7 +996,7 @@ int pet_equipitem(struct map_session_data *sd,int index) else { pc_delitem(sd,index,1,0); sd->pet.equip = sd->pd->equip = nameid; - pc_calcstatus(sd,0); + status_calc_pc(sd,0); clif_pet_equip(sd->pd,nameid); } @@ -1016,7 +1017,7 @@ int pet_unequipitem(struct map_session_data *sd) nameid = sd->pet.equip; sd->pet.equip = sd->pd->equip = 0; - pc_calcstatus(sd,0); + status_calc_pc(sd,0); clif_pet_equip(sd->pd,0); memset(&tmp_item,0,sizeof(tmp_item)); tmp_item.nameid = nameid; @@ -1069,9 +1070,9 @@ int pet_food(struct map_session_data *sd) sd->pet.intimate = 0; if(battle_config.pet_status_support && t > 0) { if(sd->bl.prev != NULL) - pc_calcstatus(sd,0); + status_calc_pc(sd,0); else - pc_calcstatus(sd,2); + status_calc_pc(sd,2); } } else if(sd->pet.intimate > 1000) @@ -1096,7 +1097,7 @@ static int pet_randomwalk(struct pet_data *pd,int tick) Assert((pd->msd == 0) || (pd->msd->pd == pd)); - speed = battle_get_speed(&pd->bl); + speed = status_get_speed(&pd->bl); if(DIFF_TICK(pd->next_walktime,tick) < 0){ int i,x,y,c,d=12-pd->move_fail_count; @@ -1201,7 +1202,7 @@ static int pet_ai_sub_hard(struct pet_data *pd,unsigned int tick) pet_unlocktarget(pd); else { i=0; - pd->speed = battle_get_speed(&pd->bl); + pd->speed = status_get_speed(&pd->bl); do { if(i==0) { // 最初はAEGISと同じ方法で検索 dx=md->bl.x - pd->bl.x; @@ -1285,14 +1286,14 @@ static int pet_ai_sub_hard(struct pet_data *pd,unsigned int tick) else { if(dist <= 3 || (pd->timer != -1 && pd->state.state == MS_WALK && distance(pd->to_x,pd->to_y,sd->bl.x,sd->bl.y) < 3) ) return 0; - pd->speed = battle_get_speed(&pd->bl); + pd->speed = status_get_speed(&pd->bl); pet_calc_pos(pd,sd->bl.x,sd->bl.y,sd->dir); if(pet_walktoxy(pd,pd->to_x,pd->to_y)) pet_randomwalk(pd,tick); } } else { - pd->speed = battle_get_speed(&pd->bl); + pd->speed = status_get_speed(&pd->bl); if(pd->state.state == MS_ATTACK) pet_stopattack(pd); pet_randomwalk(pd,tick); @@ -1492,7 +1493,7 @@ int pet_recovery_timer(int tid,unsigned int tick,int id,int data) return 0; if(sd->sc_data[pd->skilltype].timer != -1) - skill_status_change_end(&sd->bl,pd->skilltype,-1); + status_change_end(&sd->bl,pd->skilltype,-1); pd->skillbonustimer=add_timer(gettick()+pd->skilltimer*1000,pet_recovery_timer,sd->bl.id,0); @@ -1543,7 +1544,7 @@ int pet_mag_timer(int tid,unsigned int tick,int id,int data) if(sd->status.hp < sd->status.max_hp * pd->skilltype/100 && sd->status.sp < sd->status.max_sp * pd->skillduration/100) { clif_skill_nodamage(&pd->bl,&sd->bl,PR_MAGNIFICAT,pd->skillval,1); - skill_status_change_start(&sd->bl,SkillStatusChangeTable[PR_MAGNIFICAT],pd->skillval,0,0,0,skill_get_time(PR_MAGNIFICAT,pd->skillval),0 ); + status_change_start(&sd->bl,SkillStatusChangeTable[PR_MAGNIFICAT],pd->skillval,0,0,0,skill_get_time(PR_MAGNIFICAT,pd->skillval),0 ); } pd->skillbonustimer=add_timer(gettick()+pd->skilltimer*1000,pet_mag_timer,sd->bl.id,0); diff --git a/src/map/script.c b/src/map/script.c index 083f3cfd1..0e8a054e7 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -24,6 +24,7 @@ #include "chrif.h" #include "itemdb.h" #include "pc.h" +#include "status.h" #include "script.h" #include "storage.h" #include "mob.h" @@ -3028,7 +3029,7 @@ int buildin_getequippercentrefinery(struct script_state *st) sd=script_rid2sd(st); i=pc_checkequip(sd,equip[num-1]); if(i >= 0) - push_val(st->stack,C_INT,pc_percentrefinery(sd,&sd->status.inventory[i])); + push_val(st->stack,C_INT,status_percentrefinery(sd,&sd->status.inventory[i])); else push_val(st->stack,C_INT,0); @@ -4274,7 +4275,7 @@ int buildin_sc_start(struct script_state *st) if (bl != 0) { if(bl->type == BL_PC && ((struct map_session_data *)bl)->state.potionpitcher_flag) bl = map_id2bl(((struct map_session_data *)bl)->skilltarget); - skill_status_change_start(bl,type,val1,0,0,0,tick,0); + status_change_start(bl,type,val1,0,0,0,tick,0); } return 0; } @@ -4298,7 +4299,7 @@ int buildin_sc_start2(struct script_state *st) if(bl->type == BL_PC && ((struct map_session_data *)bl)->state.potionpitcher_flag) bl = map_id2bl(((struct map_session_data *)bl)->skilltarget); if(rand()%10000 < per) - skill_status_change_start(bl,type,val1,0,0,0,tick,0); + status_change_start(bl,type,val1,0,0,0,tick,0); return 0; } @@ -4314,7 +4315,7 @@ int buildin_sc_end(struct script_state *st) bl = map_id2bl(st->rid); if(bl->type == BL_PC && ((struct map_session_data *)bl)->state.potionpitcher_flag) bl = map_id2bl(((struct map_session_data *)bl)->skilltarget); - skill_status_change_end(bl,type,-1); + status_change_end(bl,type,-1); // if(battle_config.etc_log) // printf("sc_end : %d %d\n",st->rid,type); return 0; @@ -4336,10 +4337,10 @@ int buildin_getscrate(struct script_state *st) else bl = map_id2bl(st->rid); - luk = battle_get_luk(bl); - sc_def_mdef2=100 - (3 + battle_get_mdef(bl) + luk/3); - sc_def_vit2=100 - (3 + battle_get_vit(bl) + luk/3); - sc_def_int2=100 - (3 + battle_get_int(bl) + luk/3); + luk = status_get_luk(bl); + sc_def_mdef2=100 - (3 + status_get_mdef(bl) + luk/3); + sc_def_vit2=100 - (3 + status_get_vit(bl) + luk/3); + sc_def_int2=100 - (3 + status_get_int(bl) + luk/3); sc_def_luk2=100 - (3 + luk); if(type==SC_STONE || type==SC_FREEZE) diff --git a/src/map/skill.c b/src/map/skill.c index b42d3d898..8c2ff23be 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -14,6 +14,7 @@ #include "map.h" #include "clif.h" #include "pc.h" +#include "status.h" #include "pet.h" #include "mob.h" #include "battle.h" @@ -877,7 +878,7 @@ int skill_tree_get_max(int id, int b_class){ int skill_check_condition( struct map_session_data *sd,int type); int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int skillid,int skilllv,unsigned int tick,int flag ); int skill_frostjoke_scream(struct block_list *bl,va_list ap); -int skill_status_change_timer_sub(struct block_list *bl, va_list ap ); +int status_change_timer_sub(struct block_list *bl, va_list ap ); int skill_attack_area(struct block_list *bl,va_list ap); int skill_abra_dataset(int skilllv); int skill_clear_element_field(struct block_list *bl); @@ -1064,16 +1065,16 @@ int skill_additional_effect( struct block_list* src, struct block_list *bl,int s } //?象の耐性 - luk = battle_get_luk(bl); - sc_def_mdef=100 - (3 + battle_get_mdef(bl) + luk/3); - sc_def_vit=100 - (3 + battle_get_vit(bl) + luk/3); - sc_def_int=100 - (3 + battle_get_int(bl) + luk/3); + luk = status_get_luk(bl); + sc_def_mdef=100 - (3 + status_get_mdef(bl) + luk/3); + sc_def_vit=100 - (3 + status_get_vit(bl) + luk/3); + sc_def_int=100 - (3 + status_get_int(bl) + luk/3); sc_def_luk=100 - (3 + luk); //自分の耐性 - luk = battle_get_luk(src); - sc_def_mdef2=100 - (3 + battle_get_mdef(src) + luk/3); - sc_def_vit2=100 - (3 + battle_get_vit(src) + luk/3); - sc_def_int2=100 - (3 + battle_get_int(src) + luk/3); + luk = status_get_luk(src); + sc_def_mdef2=100 - (3 + status_get_mdef(src) + luk/3); + sc_def_vit2=100 - (3 + status_get_vit(src) + luk/3); + sc_def_int2=100 - (3 + status_get_int(src) + luk/3); sc_def_luk2=100 - (3 + luk); if(bl->type==BL_PC) dstsd=(struct map_session_data *)bl; @@ -1120,8 +1121,8 @@ int skill_additional_effect( struct block_list* src, struct block_list *bl,int s } // エンチャントデットリ?ポイズン(猛毒?果) if (sd && sd->sc_data[SC_EDP].timer != -1 && rand() % 10000 < sd->sc_data[SC_EDP].val2 * sc_def_vit) { - int mhp = battle_get_max_hp(bl); - int hp = battle_get_hp(bl); + int mhp = status_get_max_hp(bl); + int hp = status_get_hp(bl); int lvl = sd->sc_data[SC_EDP].val1; int diff; // MHPの1/4以下にはならない @@ -1140,21 +1141,21 @@ int skill_additional_effect( struct block_list* src, struct block_list *bl,int s md->hp = mhp>>2; } } - skill_status_change_start(bl,SC_DPOISON,lvl,0,0,0,skill_get_time2(ASC_EDP,lvl),0); + status_change_start(bl,SC_DPOISON,lvl,0,0,0,skill_get_time2(ASC_EDP,lvl),0); } break; case SM_BASH: /* バッシュ(急所攻?) */ if( sd && (skill=pc_checkskill(sd,SM_FATALBLOW))>0 ){ if( rand()%100 < 6*(skilllv-5)*sc_def_vit/100 ) - skill_status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(SM_FATALBLOW,skilllv),0); + status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(SM_FATALBLOW,skilllv),0); } break; case TF_POISON: /* インベナム */ case AS_SPLASHER: /* ベナムスプラッシャ? */ if(rand()%100< (2*skilllv+10)*sc_def_vit/100 ) - skill_status_change_start(bl,SC_POISON,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_POISON,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); else{ if(sd && skillid==TF_POISON) clif_skill_fail(sd,skillid,0,0); @@ -1163,128 +1164,128 @@ int skill_additional_effect( struct block_list* src, struct block_list *bl,int s case AS_SONICBLOW: /* ソニックブロ? */ if( rand()%100 < (2*skilllv+10)*sc_def_vit/100 ) - skill_status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; case HT_FREEZINGTRAP: /* フリ?ジングトラップ */ rate=skilllv*3+35; if(rand()%100 < rate*sc_def_mdef/100) - skill_status_change_start(bl,SC_FREEZE,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_FREEZE,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; case MG_FROSTDIVER: /* フロストダイバ? */ case WZ_FROSTNOVA: /* フロストノヴァ */ - rate=(skilllv*3+35)*sc_def_mdef/100-(battle_get_int(bl)+battle_get_luk(bl))/15; + rate=(skilllv*3+35)*sc_def_mdef/100-(status_get_int(bl)+status_get_luk(bl))/15; rate=rate<=5?5:rate; if(rand()%100 < rate) - skill_status_change_start(bl,SC_FREEZE,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_FREEZE,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); else if(sd && skillid==MG_FROSTDIVER) clif_skill_fail(sd,skillid,0,0); break; case WZ_STORMGUST: /* スト?ムガスト */ { - struct status_change *sc_data = battle_get_sc_data(bl); + struct status_change *sc_data = status_get_sc_data(bl); if(sc_data) { sc_data[SC_FREEZE].val3++; if(sc_data[SC_FREEZE].val3 >= 3) - skill_status_change_start(bl,SC_FREEZE,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_FREEZE,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); } } break; case HT_LANDMINE: /* ランドマイン */ if( rand()%100 < (5*skilllv+30)*sc_def_vit/100 ) - skill_status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; case HT_SHOCKWAVE: /* ショックウェ?ブトラップ */ if(map[bl->m].flag.pvp && dstsd){ dstsd->status.sp -= dstsd->status.sp*(5+15*skilllv)/100; - pc_calcstatus(dstsd,0); + status_calc_pc(dstsd,0); } break; case HT_SANDMAN: /* サンドマン */ if( rand()%100 < (5*skilllv+30)*sc_def_int/100 ) - skill_status_change_start(bl,SC_SLEEP,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_SLEEP,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; case TF_SPRINKLESAND: /* 砂まき */ if( rand()%100 < 20*sc_def_int/100 ) - skill_status_change_start(bl,SC_BLIND,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_BLIND,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; case TF_THROWSTONE: /* 石投げ */ if( rand()%100 < 7*sc_def_vit/100 ) - skill_status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; case CR_HOLYCROSS: /* ホ?リ?クロス */ if( rand()%100 < 3*skilllv*sc_def_int/100 ) - skill_status_change_start(bl,SC_BLIND,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_BLIND,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; case CR_GRANDCROSS: /* グランドクロス */ case NPC_DARKGRANDCROSS: /*闇グランドクロス*/ { - int race = battle_get_race(bl); - if( (battle_check_undead(race,battle_get_elem_type(bl)) || race == 6) && rand()%100 < 100000*sc_def_int/100) //?制付?だが完全耐性には無? - skill_status_change_start(bl,SC_BLIND,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + int race = status_get_race(bl); + if( (battle_check_undead(race,status_get_elem_type(bl)) || race == 6) && rand()%100 < 100000*sc_def_int/100) //?制付?だが完全耐性には無? + status_change_start(bl,SC_BLIND,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); } break; case AM_ACIDTERROR: if( rand()%100 < (skilllv*3)*sc_def_vit/100 ) - skill_status_change_start(bl,SC_BLEEDING,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_BLEEDING,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; case CR_SHIELDCHARGE: /* シ?ルドチャ?ジ */ if( rand()%100 < (15 + skilllv*5)*sc_def_vit/100 ) - skill_status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; case RG_RAID: /* サプライズアタック */ if( rand()%100 < (10+3*skilllv)*sc_def_vit/100 ) - skill_status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); if( rand()%100 < (10+3*skilllv)*sc_def_int/100 ) - skill_status_change_start(bl,SC_BLIND,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_BLIND,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; case BA_FROSTJOKE: if(rand()%100 < (15+5*skilllv)*sc_def_mdef/100) - skill_status_change_start(bl,SC_FREEZE,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_FREEZE,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; case DC_SCREAM: if( rand()%100 < (25+5*skilllv)*sc_def_vit/100 ) - skill_status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; case BD_LULLABY: /* 子守唄 */ if( rand()%100 < 15*sc_def_int/100 ) - skill_status_change_start(bl,SC_SLEEP,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_SLEEP,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; /* MOBの追加?果付きスキル */ case NPC_PETRIFYATTACK: if(rand()%100 < sc_def_mdef) - skill_status_change_start(bl,sc[skillid-NPC_POISON],skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,sc[skillid-NPC_POISON],skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; case NPC_POISON: case NPC_SILENCEATTACK: case NPC_STUNATTACK: if(rand()%100 < sc_def_vit && src->type!=BL_PET) - skill_status_change_start(bl,sc[skillid-NPC_POISON],skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,sc[skillid-NPC_POISON],skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); if(src->type==BL_PET) - skill_status_change_start(bl,sc[skillid-NPC_POISON],skilllv,0,0,0,skilllv*1000,0); + status_change_start(bl,sc[skillid-NPC_POISON],skilllv,0,0,0,skilllv*1000,0); break; case NPC_CURSEATTACK: if(rand()%100 < sc_def_luk) - skill_status_change_start(bl,sc[skillid-NPC_POISON],skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,sc[skillid-NPC_POISON],skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; case NPC_SLEEPATTACK: case NPC_BLINDATTACK: if(rand()%100 < sc_def_int) - skill_status_change_start(bl,sc[skillid-NPC_POISON],skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,sc[skillid-NPC_POISON],skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; case NPC_MENTALBREAKER: if(dstsd) { @@ -1298,45 +1299,45 @@ int skill_additional_effect( struct block_list* src, struct block_list *bl,int s // case WZ_METEOR: if(rand()%100 < sc_def_vit) - skill_status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; case WZ_VERMILION: if(rand()%100 < sc_def_int) - skill_status_change_start(bl,SC_BLIND,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_BLIND,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; // -- moonsoul (stun ability of new champion skill tigerfist) // case CH_TIGERFIST: if( rand()%100 < (10 + skilllv*10)*sc_def_vit/100 ) { - int sec = skill_get_time2 (skillid,skilllv) - battle_get_agi(bl)/10; - skill_status_change_start(bl,SC_STAN,skilllv,0,0,0,sec,0); + int sec = skill_get_time2 (skillid,skilllv) - status_get_agi(bl)/10; + status_change_start(bl,SC_STAN,skilllv,0,0,0,sec,0); } break; case LK_SPIRALPIERCE: if( rand()%100 < (15 + skilllv*5)*sc_def_vit/100 ) - skill_status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; case ST_REJECTSWORD: /* フリ?ジングトラップ */ if( rand()%100 < (skilllv*15) ) - skill_status_change_start(bl,SC_AUTOCOUNTER,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_AUTOCOUNTER,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; case PF_FOGWALL: /* ホ?リ?クロス */ if(src!=bl && rand()%100 < 3*skilllv*sc_def_int/100 ) - skill_status_change_start(bl,SC_BLIND,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_BLIND,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; case LK_HEADCRUSH: /* ヘッドクラッシュ */ {//?件が良く分からないので適?に - int race=battle_get_race(bl); - if( !(battle_check_undead(race,battle_get_elem_type(bl)) || race == 6) && rand()%100 < (2*skilllv+10)*sc_def_vit/100 ) - skill_status_change_start(bl,SC_HEADCRUSH,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + int race=status_get_race(bl); + if( !(battle_check_undead(race,status_get_elem_type(bl)) || race == 6) && rand()%100 < (2*skilllv+10)*sc_def_vit/100 ) + status_change_start(bl,SC_HEADCRUSH,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); } break; case LK_JOINTBEAT: /* ジョイントビ?ト */ //?件が良く分からないので適?に if( rand()%100 < (2*skilllv+10)*sc_def_vit/100 ) - skill_status_change_start(bl,SC_JOINTBEAT,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_JOINTBEAT,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; case PF_SPIDERWEB: /* スパイダ?ウェッブ */ { @@ -1346,24 +1347,24 @@ int skill_additional_effect( struct block_list* src, struct block_list *bl,int s if(map[src->m].flag.pvp) //PvPでは拘束時間半減? sec = sec/2; battle_stopwalking(bl,1); - skill_status_change_start(bl,SC_SPIDERWEB,skilllv,0,0,0,sec,0); + status_change_start(bl,SC_SPIDERWEB,skilllv,0,0,0,sec,0); } } break; case ASC_METEORASSAULT: /* メテオアサルト */ if( rand()%100 < (15 + skilllv*5)*sc_def_vit/100 ) //?態異常は詳細が分からないので適?に - skill_status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); if( rand()%100 < (10+3*skilllv)*sc_def_int/100 ) - skill_status_change_start(bl,SC_BLIND,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_BLIND,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; case MO_EXTREMITYFIST: /* 阿修羅覇凰拳 */ //阿修羅を使うと5分間自然回復しないようになる - skill_status_change_start(src,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time2(skillid,skilllv),0 ); + status_change_start(src,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time2(skillid,skilllv),0 ); break; case HW_NAPALMVULCAN: /* ナパ?ムバルカン */ // skilllv*5%の確率で呪い if (rand()%10000 < 5*skilllv*sc_def_luk) - skill_status_change_start(bl,SC_CURSE,7,0,0,0,skill_get_time2(NPC_CURSEATTACK,7),0); + status_change_start(bl,SC_CURSE,7,0,0,0,skill_get_time2(NPC_CURSEATTACK,7),0); break; } @@ -1386,14 +1387,14 @@ int skill_additional_effect( struct block_list* src, struct block_list *bl,int s if(rand()%10000 < (sd->addeff[i-SC_STONE])*sc_def_card/100 ){ if(battle_config.battle_log) printf("PC %d skill_addeff: cardによる異常?動 %d %d\n",sd->bl.id,i,sd->addeff[i-SC_STONE]); - skill_status_change_start(bl,i,7,0,0,0,(i==SC_CONFUSION)? 10000+7000:skill_get_time2(sc2[i-SC_STONE],7),0); + status_change_start(bl,i,7,0,0,0,(i==SC_CONFUSION)? 10000+7000:skill_get_time2(sc2[i-SC_STONE],7),0); } } else { if(rand()%10000 < (sd->addeff[i-SC_STONE]+sd->arrow_addeff[i-SC_STONE])*sc_def_card/100 ){ if(battle_config.battle_log) printf("PC %d skill_addeff: cardによる異常?動 %d %d\n",sd->bl.id,i,sd->addeff[i-SC_STONE]); - skill_status_change_start(bl,i,7,0,0,0,(i==SC_CONFUSION)? 10000+7000:skill_get_time2(sc2[i-SC_STONE],7),0); + status_change_start(bl,i,7,0,0,0,(i==SC_CONFUSION)? 10000+7000:skill_get_time2(sc2[i-SC_STONE],7),0); } } //自分に?態異常 @@ -1410,14 +1411,14 @@ int skill_additional_effect( struct block_list* src, struct block_list *bl,int s if(rand()%10000 < (sd->addeff2[i-SC_STONE])*sc_def_card/100 ){ if(battle_config.battle_log) printf("PC %d skill_addeff: cardによる異常?動 %d %d\n",src->id,i,sd->addeff2[i-SC_STONE]); - skill_status_change_start(src,i,7,0,0,0,(i==SC_CONFUSION)? 10000+7000:skill_get_time2(sc2[i-SC_STONE],7),0); + status_change_start(src,i,7,0,0,0,(i==SC_CONFUSION)? 10000+7000:skill_get_time2(sc2[i-SC_STONE],7),0); } } else { if(rand()%10000 < (sd->addeff2[i-SC_STONE]+sd->arrow_addeff2[i-SC_STONE])*sc_def_card/100 ){ if(battle_config.battle_log) printf("PC %d skill_addeff: cardによる異常?動 %d %d\n",src->id,i,sd->addeff2[i-SC_STONE]); - skill_status_change_start(src,i,7,0,0,0,(i==SC_CONFUSION)? 10000+7000:skill_get_time2(sc2[i-SC_STONE],7),0); + status_change_start(src,i,7,0,0,0,(i==SC_CONFUSION)? 10000+7000:skill_get_time2(sc2[i-SC_STONE],7),0); } } } @@ -1457,7 +1458,7 @@ int skill_blown( struct block_list *src, struct block_list *target,int count) dy=target->y-src->y; dy=(dy>0)?1:((dy<0)?-1: 0); } if(dx==0 && dy==0){ - int dir=battle_get_dir(target); + int dir=status_get_dir(target); if(dir>=0 && dir<8){ dx=-dirx[dir]; dy=-diry[dir]; @@ -1509,7 +1510,7 @@ int skill_blown( struct block_list *src, struct block_list *target,int count) if(su){ skill_unit_move_unit_group(su->group,target->m,dx,dy); }else{ -// struct status_change *sc_data=battle_get_sc_data(target); +// struct status_change *sc_data=status_get_sc_data(target); if(moveblock) map_delblock(target); target->x=nx; target->y=ny; @@ -1571,7 +1572,7 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds nullpo_retr(0, dsrc); nullpo_retr(0, bl); - sc_data = battle_get_sc_data(bl); + sc_data = status_get_sc_data(bl); //何もしない判定ここから if(dsrc->m != bl->m) //?象が同じマップにいなければ何もしない @@ -1635,7 +1636,7 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds //マジックロッド?理ここまで if(src->type==BL_PET) { // [Valaris] - dmg.damage=battle_attr_fix(skilllv, skill_get_pl(skillid), battle_get_element(bl) ); + dmg.damage=battle_attr_fix(skilllv, skill_get_pl(skillid), status_get_element(bl) ); dmg.damage2=0; } @@ -1661,12 +1662,12 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds nullpo_retr(0, sd); //連打掌(MO_CHAINCOMBO)ここから if(skillid == MO_CHAINCOMBO) { - int delay = 1000 - 4 * battle_get_agi(src) - 2 * battle_get_dex(src); //基本ディレイの計算 - if(damage < battle_get_hp(bl)) { //ダメ?ジが?象のHPより小さい場合 + int delay = 1000 - 4 * status_get_agi(src) - 2 * status_get_dex(src); //基本ディレイの計算 + if(damage < status_get_hp(bl)) { //ダメ?ジが?象のHPより小さい場合 if(pc_checkskill(sd, MO_COMBOFINISH) > 0 && sd->spiritball > 0) //猛龍拳(MO_COMBOFINISH)取得&?球保持時は+300ms delay += 300 * battle_config.combo_delay_rate /100; //追加ディレイをconfにより調整 - skill_status_change_start(src,SC_COMBO,MO_CHAINCOMBO,skilllv,0,0,delay,0); //コンボ?態に + status_change_start(src,SC_COMBO,MO_CHAINCOMBO,skilllv,0,0,delay,0); //コンボ?態に } sd->attackabletime = sd->canmove_tick = tick + delay; clif_combo_delay(src,delay); //コンボディレイパケットの送信 @@ -1674,8 +1675,8 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds //連打掌(MO_CHAINCOMBO)ここまで //猛龍拳(MO_COMBOFINISH)ここから else if(skillid == MO_COMBOFINISH) { - int delay = 700 - 4 * battle_get_agi(src) - 2 * battle_get_dex(src); - if(damage < battle_get_hp(bl)) { + int delay = 700 - 4 * status_get_agi(src) - 2 * status_get_dex(src); + if(damage < status_get_hp(bl)) { //阿修羅覇凰拳(MO_EXTREMITYFIST)取得&?球4個保持&爆裂波動(MO_EXPLOSIONSPIRITS)?態時は+300ms //伏虎拳(CH_TIGERFIST)取得時も+300ms if((pc_checkskill(sd, MO_EXTREMITYFIST) > 0 && sd->spiritball >= 4 && sd->sc_data[SC_EXPLOSIONSPIRITS].timer != -1) || @@ -1683,7 +1684,7 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds (pc_checkskill(sd, CH_CHAINCRUSH) > 0 && sd->spiritball > 1)) delay += 300 * battle_config.combo_delay_rate /100; //追加ディレイをconfにより調整 - skill_status_change_start(src,SC_COMBO,MO_COMBOFINISH,skilllv,0,0,delay,0); //コンボ?態に + status_change_start(src,SC_COMBO,MO_COMBOFINISH,skilllv,0,0,delay,0); //コンボ?態に } sd->attackabletime = sd->canmove_tick = tick + delay; clif_combo_delay(src,delay); //コンボディレイパケットの送信 @@ -1691,12 +1692,12 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds //猛龍拳(MO_COMBOFINISH)ここまで //伏虎拳(CH_TIGERFIST)ここから else if(skillid == CH_TIGERFIST) { - int delay = 1000 - 4 * battle_get_agi(src) - 2 * battle_get_dex(src); - if(damage < battle_get_hp(bl)) { + int delay = 1000 - 4 * status_get_agi(src) - 2 * status_get_dex(src); + if(damage < status_get_hp(bl)) { if(pc_checkskill(sd, CH_CHAINCRUSH) > 0) //連柱崩?(CH_CHAINCRUSH)取得時は+300ms delay += 300 * battle_config.combo_delay_rate /100; //追加ディレイをconfにより調整 - skill_status_change_start(src,SC_COMBO,CH_TIGERFIST,skilllv,0,0,delay,0); //コンボ?態に + status_change_start(src,SC_COMBO,CH_TIGERFIST,skilllv,0,0,delay,0); //コンボ?態に } sd->attackabletime = sd->canmove_tick = tick + delay; clif_combo_delay(src,delay); //コンボディレイパケットの送信 @@ -1704,13 +1705,13 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds //伏虎拳(CH_TIGERFIST)ここまで //連柱崩?(CH_CHAINCRUSH)ここから else if(skillid == CH_CHAINCRUSH) { - int delay = 1000 - 4 * battle_get_agi(src) - 2 * battle_get_dex(src); - if(damage < battle_get_hp(bl)) { + int delay = 1000 - 4 * status_get_agi(src) - 2 * status_get_dex(src); + if(damage < status_get_hp(bl)) { //阿修羅覇凰拳(MO_EXTREMITYFIST)取得&?球4個保持&爆裂波動(MO_EXPLOSIONSPIRITS)?態時は+300ms if(pc_checkskill(sd, MO_EXTREMITYFIST) > 0 && sd->spiritball >= 4 && sd->sc_data[SC_EXPLOSIONSPIRITS].timer != -1) delay += 300 * battle_config.combo_delay_rate /100; //追加ディレイをconfにより調整 - skill_status_change_start(src,SC_COMBO,CH_CHAINCRUSH,skilllv,0,0,delay,0); //コンボ?態に + status_change_start(src,SC_COMBO,CH_CHAINCRUSH,skilllv,0,0,delay,0); //コンボ?態に } sd->attackabletime = sd->canmove_tick = tick + delay; clif_combo_delay(src,delay); //コンボディレイパケットの送信 @@ -1790,8 +1791,8 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds /* ?際にダメ?ジ?理を行う */ if(skillid || flag) battle_damage(src,bl,damage,0); - if(skillid == RG_INTIMIDATE && damage > 0 && !(battle_get_mode(bl)&0x20) && !map[src->m].flag.gvg ) { - int s_lv = battle_get_lv(src),t_lv = battle_get_lv(bl); + if(skillid == RG_INTIMIDATE && damage > 0 && !(status_get_mode(bl)&0x20) && !map[src->m].flag.gvg ) { + int s_lv = status_get_lv(src),t_lv = status_get_lv(bl); int rate = 50 + skilllv * 5; rate = rate + (s_lv - t_lv); if(rand()%100 < rate) @@ -1875,7 +1876,7 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds if(attack_type&BF_WEAPON && sc_data && sc_data[SC_AUTOCOUNTER].timer != -1 && sc_data[SC_AUTOCOUNTER].val4 > 0) { if(sc_data[SC_AUTOCOUNTER].val3 == dsrc->id) battle_weapon_attack(bl,dsrc,tick,0x8000|sc_data[SC_AUTOCOUNTER].val1); - skill_status_change_end(bl,SC_AUTOCOUNTER,-1); + status_change_end(bl,SC_AUTOCOUNTER,-1); } map_freeblock_unlock(); @@ -2303,7 +2304,7 @@ int skill_cleartimerskill(struct block_list *src) int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int skillid,int skilllv,unsigned int tick,int flag ) { struct map_session_data *sd = NULL; - struct status_change *sc_data = battle_get_sc_data(src); + struct status_change *sc_data = status_get_sc_data(src); int i; if(skillid > 0 && skilllv <= 0) return 0; @@ -2391,9 +2392,9 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s case PA_PRESSURE: /* プレッシャ? */ skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag); if (rand()%100 < 50) - skill_status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(PA_PRESSURE,skilllv),0); + status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(PA_PRESSURE,skilllv),0); else - skill_status_change_start(bl,SC_BLEEDING,skilllv,0,0,0,skill_get_time2(PA_PRESSURE,skilllv),0); + status_change_start(bl,SC_BLEEDING,skilllv,0,0,0,skill_get_time2(PA_PRESSURE,skilllv),0); if (bl->type == BL_PC) { int sp; struct map_session_data *tsd = (struct map_session_data *)bl; @@ -2410,10 +2411,10 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s break; case MO_INVESTIGATE: /* ?勁 */ { - struct status_change *sc_data = battle_get_sc_data(src); + struct status_change *sc_data = status_get_sc_data(src); skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag); if(sc_data && sc_data[SC_BLADESTOP].timer != -1) - skill_status_change_end(src,SC_BLADESTOP,-1); + status_change_end(src,SC_BLADESTOP,-1); } break; case SN_FALCONASSAULT: /* ファルコンアサルト */ @@ -2437,12 +2438,12 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s break; case RG_BACKSTAP: /* バックスタブ */ { - int dir = map_calc_dir(src,bl->x,bl->y),t_dir = battle_get_dir(bl); + int dir = map_calc_dir(src,bl->x,bl->y),t_dir = status_get_dir(bl); int dist = distance(src->x,src->y,bl->x,bl->y); if((dist > 0 && !map_check_dir(dir,t_dir)) || bl->type == BL_SKILL) { - struct status_change *sc_data = battle_get_sc_data(src); + struct status_change *sc_data = status_get_sc_data(src); if(sc_data && sc_data[SC_HIDING].timer != -1) - skill_status_change_end(src, SC_HIDING, -1); // ハイディング解除 + status_change_end(src, SC_HIDING, -1); // ハイディング解除 skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag); dir = dir < 4 ? dir+4 : dir-4; // change direction [Celest] if (bl->type == BL_PC) @@ -2466,7 +2467,7 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s break; case MO_FINGEROFFENSIVE: /* 指? */ { - struct status_change *sc_data = battle_get_sc_data(src); + struct status_change *sc_data = status_get_sc_data(src); if(!battle_config.finger_offensive_type) skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag); @@ -2479,15 +2480,15 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s } } if(sc_data && sc_data[SC_BLADESTOP].timer != -1) - skill_status_change_end(src,SC_BLADESTOP,-1); + status_change_end(src,SC_BLADESTOP,-1); } break; case MO_CHAINCOMBO: /* 連打掌 */ { - struct status_change *sc_data = battle_get_sc_data(src); + struct status_change *sc_data = status_get_sc_data(src); skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag); if(sc_data && sc_data[SC_BLADESTOP].timer != -1) - skill_status_change_end(src,SC_BLADESTOP,-1); + status_change_end(src,SC_BLADESTOP,-1); } break; case MO_COMBOFINISH: /* 猛龍拳 */ @@ -2498,7 +2499,7 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s break; case MO_EXTREMITYFIST: /* 阿修羅覇鳳拳 */ { - struct status_change *sc_data = battle_get_sc_data(src); + struct status_change *sc_data = status_get_sc_data(src); if(sd) { struct walkpath_data wpd; @@ -2530,13 +2531,13 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s if(sd->canact_tick < sd->canmove_tick) sd->canact_tick = sd->canmove_tick; pc_movepos(sd,sd->to_x,sd->to_y); - skill_status_change_end(&sd->bl,SC_COMBO,-1); + status_change_end(&sd->bl,SC_COMBO,-1); } else skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag); - skill_status_change_end(src, SC_EXPLOSIONSPIRITS, -1); + status_change_end(src, SC_EXPLOSIONSPIRITS, -1); if(sc_data && sc_data[SC_BLADESTOP].timer != -1) - skill_status_change_end(src,SC_BLADESTOP,-1); + status_change_end(src,SC_BLADESTOP,-1); } break; /* 武器系範?攻?スキル */ @@ -2559,9 +2560,9 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick, 0x0500|dist ); if (bl->type == BL_MOB && skillid == AS_GRIMTOOTH) { - struct status_change *sc_data = battle_get_sc_data(bl); + struct status_change *sc_data = status_get_sc_data(bl); if (sc_data && sc_data[SC_SLOWDOWN].timer == -1) - skill_status_change_start(bl,SC_SLOWDOWN,0,0,0,0,1000,0); + status_change_start(bl,SC_SLOWDOWN,0,0,0,0,1000,0); } } }else{ @@ -2591,7 +2592,7 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s src,skillid,skilllv,tick, flag|BCT_ENEMY|1, skill_castend_damage_id); if (skillid == SM_MAGNUM) // fire element for 10 seconds - skill_status_change_start(src,SC_FLAMELAUNCHER,0,0,0,0,10000,0); + status_change_start(src,SC_FLAMELAUNCHER,0,0,0,0,10000,0); } break; @@ -2643,7 +2644,7 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s case ALL_RESURRECTION: /* リザレクション */ case PR_TURNUNDEAD: /* タ?ンアンデッド */ - if(bl->type != BL_PC && battle_check_undead(battle_get_race(bl),battle_get_elem_type(bl))) + if(bl->type != BL_PC && battle_check_undead(status_get_race(bl),status_get_elem_type(bl))) skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag); else { map_freeblock_unlock(); @@ -2671,10 +2672,10 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s case MG_FROSTDIVER: /* フロストダイバー */ { - struct status_change *sc_data = battle_get_sc_data(bl); + struct status_change *sc_data = status_get_sc_data(bl); int sc_def_mdef, rate, damage; - sc_def_mdef = 100 - (3 + battle_get_mdef(bl) + battle_get_luk(bl)/3); - rate = (skilllv*3+35)*sc_def_mdef/100-(battle_get_int(bl)+battle_get_luk(bl))/15; + sc_def_mdef = 100 - (3 + status_get_mdef(bl) + status_get_luk(bl)/3); + rate = (skilllv*3+35)*sc_def_mdef/100-(status_get_int(bl)+status_get_luk(bl))/15; rate = rate<=5?5:rate; if (sc_data && sc_data[SC_FREEZE].timer != -1) { skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag); @@ -2683,8 +2684,8 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s break; } damage = skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag); - if (battle_get_hp(bl) > 0 && damage > 0 && rand()%100 < rate) { - skill_status_change_start(bl,SC_FREEZE,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + if (status_get_hp(bl) > 0 && damage > 0 && rand()%100 < rate) { + status_change_start(bl,SC_FREEZE,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); } else if (sd) { clif_skill_fail(sd,skillid,0,0); } @@ -2694,11 +2695,11 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s case WZ_WATERBALL: /* ウォ?タ?ボ?ル */ skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag); if(skilllv>1) - skill_status_change_start(src,SC_WATERBALL,skilllv,bl->id,0,0,0,0); + status_change_start(src,SC_WATERBALL,skilllv,bl->id,0,0,0,0); break; case PR_BENEDICTIO: /* 聖?降福 */ - if(battle_get_race(bl)==1 || battle_get_race(bl)==6) + if(status_get_race(bl)==1 || status_get_race(bl)==6) skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag); break; @@ -2779,7 +2780,7 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s case WZ_SIGHTRASHER: clif_skill_nodamage(src,bl,skillid,skilllv,1); skill_castend_pos2(src,bl->x,bl->y,skillid,skilllv,tick,0); - skill_status_change_end(src,SC_SIGHT,-1); + status_change_end(src,SC_SIGHT,-1); break; /* その他 */ @@ -2838,7 +2839,7 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s sd->status.sp = 0; clif_updatestatus(sd,SP_SP); } - skill_status_change_start(src,SC_BLOCKSKILL,skilllv,0,skillid,0, (skilllv < 5 ? 10000: 15000),0 ); + status_change_start(src,SC_BLOCKSKILL,skilllv,0,skillid,0, (skilllv < 5 ? 10000: 15000),0 ); } break; @@ -2858,7 +2859,7 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s struct mob_data *md; if((md=(struct mob_data *)src)){ skill_area_temp[1]=bl->id; - skill_area_temp[2]=battle_get_hp(src); + skill_area_temp[2]=status_get_hp(src); clif_skill_nodamage(src,src,NPC_SELFDESTRUCTION,-1,1); map_foreachinarea(skill_area_sub, bl->m,bl->x-5,bl->y-5,bl->x+5,bl->y+5,0, @@ -2918,7 +2919,7 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s } if(sc_data) { if (sc_data[SC_MAGICPOWER].timer != -1 && skillid != HW_MAGICPOWER) //マジックパワ?の?果終了 - skill_status_change_end(src,SC_MAGICPOWER,-1); + status_change_end(src,SC_MAGICPOWER,-1); } map_freeblock_unlock(); @@ -2954,11 +2955,11 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int else if(src->type==BL_MOB) md=(struct mob_data *)src; - sc_dex=battle_get_mdef(bl); - sc_luk=battle_get_luk(bl); - sc_def_vit = 100 - (3 + battle_get_vit(bl) + battle_get_luk(bl)/3); - //sc_def_vit = 100 - (3 + battle_get_vit(bl) + battle_get_luk(bl)/3); - sc_def_mdef = 100 - (3 + battle_get_mdef(bl) + battle_get_luk(bl)/3); + sc_dex=status_get_mdef(bl); + sc_luk=status_get_luk(bl); + sc_def_vit = 100 - (3 + status_get_vit(bl) + status_get_luk(bl)/3); + //sc_def_vit = 100 - (3 + status_get_vit(bl) + status_get_luk(bl)/3); + sc_def_mdef = 100 - (3 + status_get_mdef(bl) + status_get_luk(bl)/3); if(bl->type==BL_PC){ nullpo_retr(1, dstsd=(struct map_session_data *)bl); @@ -2980,7 +2981,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int return 1; if(dstsd && pc_isdead(dstsd) && skillid != ALL_RESURRECTION) return 1; - if(battle_get_class(bl) == 1288) + if(status_get_class(bl) == 1288) return 1; if (skillnotok(skillid, (struct map_session_data *)bl)) // [MouseJstr] return 0; @@ -3067,20 +3068,20 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int case AL_DECAGI: /* 速度減少 */ if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage ) break; - if( rand()%100 < (50+skilllv*3+(battle_get_lv(src)+battle_get_int(src)/5)-sc_def_mdef) ) { + if( rand()%100 < (50+skilllv*3+(status_get_lv(src)+status_get_int(src)/5)-sc_def_mdef) ) { clif_skill_nodamage(src,bl,skillid,skilllv,1); - skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0); + status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0); } break; case AL_CRUCIS: if(flag&1) { - int race = battle_get_race(bl),ele = battle_get_elem_type(bl); + int race = status_get_race(bl),ele = status_get_elem_type(bl); if(battle_check_target(src,bl,BCT_ENEMY) && (race == 6 || battle_check_undead(race,ele))) { - int slv=battle_get_lv(src),tlv=battle_get_lv(bl),rate; + int slv=status_get_lv(src),tlv=status_get_lv(bl),rate; rate = 25 + skilllv*2 + slv - tlv; if(rand()%100 < rate) - skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,0,0); + status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,0,0); } } else { @@ -3095,14 +3096,14 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int case PR_LEXDIVINA: /* レックスディビ?ナ */ { - struct status_change *sc_data = battle_get_sc_data(bl); + struct status_change *sc_data = status_get_sc_data(bl); clif_skill_nodamage(src,bl,skillid,skilllv,1); if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage ) break; if(sc_data && sc_data[SC_DIVINA].timer != -1) - skill_status_change_end(bl,SC_DIVINA,-1); + status_change_end(bl,SC_DIVINA,-1); else if( rand()%100 < sc_def_vit ) { - skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0); + status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0); } } break; @@ -3141,7 +3142,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage ) break; if(dstsd) pc_heal(dstsd,dstsd->status.max_hp,dstsd->status.max_sp); - if(dstmd) dstmd->hp=battle_get_max_hp(&dstmd->bl); + if(dstmd) dstmd->hp=status_get_max_hp(&dstmd->bl); break; case SA_SUMMONMONSTER: clif_skill_nodamage(src,bl,skillid,skilllv,1); @@ -3180,7 +3181,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int break; case SA_FORTUNE: clif_skill_nodamage(src,bl,skillid,skilllv,1); - if(sd) pc_getzeny(sd,battle_get_lv(bl)*100); + if(sd) pc_getzeny(sd,status_get_lv(bl)*100); break; case SA_TAMINGMONSTER: clif_skill_nodamage(src,bl,skillid,skilllv,1); @@ -3204,15 +3205,15 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage ){ clif_skill_nodamage(src,bl,skillid,skilllv,1); }else{ - skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); + status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); clif_skill_nodamage(src,bl,skillid,skilllv,1); } break; case CG_MARIONETTE: /* マリオネットコントロ?ル */ if(sd && dstsd){ - struct status_change *sc_data = battle_get_sc_data(src); - struct status_change *tsc_data = battle_get_sc_data(bl); + struct status_change *sc_data = status_get_sc_data(src); + struct status_change *tsc_data = status_get_sc_data(bl); int sc = SkillStatusChangeTable[skillid]; int sc2 = SC_MARIONETTE2; @@ -3226,13 +3227,13 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int } if(sc_data && tsc_data){ if(sc_data[sc].timer == -1 && tsc_data[sc2].timer == -1) { - skill_status_change_start (src,sc,skilllv,0,bl->id,0,skill_get_time(skillid,skilllv),0); - skill_status_change_start (bl,sc2,skilllv,0,src->id,0,skill_get_time(skillid,skilllv),0); + status_change_start (src,sc,skilllv,0,bl->id,0,skill_get_time(skillid,skilllv),0); + status_change_start (bl,sc2,skilllv,0,src->id,0,skill_get_time(skillid,skilllv),0); } else if (sc_data[sc].timer != -1 && tsc_data[sc2].timer != -1 && sc_data[sc].val3 == bl->id && tsc_data[sc2].val3 == src->id) { - skill_status_change_end(src, sc, -1); - skill_status_change_end(bl, sc2, -1); + status_change_end(src, sc, -1); + status_change_end(bl, sc2, -1); } else { clif_skill_fail(sd,skillid,0,0); @@ -3273,7 +3274,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int break; } else { - skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); + status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); clif_skill_nodamage(src,bl,skillid,skilllv,1); } break; @@ -3284,13 +3285,13 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int break; if(bl->type==BL_MOB) break; - skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); + status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); break; case PR_KYRIE: /* キリエエレイソン */ clif_skill_nodamage(bl,bl,skillid,skilllv,1); if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage ) break; - skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); + status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); break; case KN_AUTOCOUNTER: /* オ?トカウンタ? */ case KN_TWOHANDQUICKEN: /* ツ?ハンドクイッケン */ @@ -3319,24 +3320,24 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int case ASC_EDP: // [Celest] case CG_MOONLIT: /* 月明りの泉に落ちる花びら */ clif_skill_nodamage(src,bl,skillid,skilllv,1); - skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); + status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); break; case SM_ENDURE: /* インデュア */ clif_skill_nodamage(src,bl,skillid,skilllv,1); - skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); - skill_status_change_start(src,SC_BLOCKSKILL,skilllv,0,skillid,0,10000,0 ); + status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); + status_change_start(src,SC_BLOCKSKILL,skilllv,0,skillid,0,10000,0 ); break; case SM_AUTOBERSERK: // Celest { - struct status_change *tsc_data = battle_get_sc_data(bl); + struct status_change *tsc_data = status_get_sc_data(bl); int sc=SkillStatusChangeTable[skillid]; clif_skill_nodamage(src,bl,skillid,skilllv,1); if( tsc_data ){ if( tsc_data[sc].timer==-1 ) - skill_status_change_start(bl,sc,skilllv,0,0,0,0,0); + status_change_start(bl,sc,skilllv,0,0,0,0,0); else - skill_status_change_end(bl, sc, -1); + status_change_end(bl, sc, -1); } } break; @@ -3353,17 +3354,17 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int } } clif_skill_nodamage(src,bl,skillid,skilllv,1); - skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); + status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); break; case LK_TENSIONRELAX: /* テンションリラックス */ clif_skill_nodamage(src,bl,skillid,skilllv,1); pc_setsit(sd); clif_sitting(sd); - skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); + status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); break; case LK_BERSERK: /* バ?サ?ク */ clif_skill_nodamage(src,bl,skillid,skilllv,1); - skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); + status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); //sd->status.hp = sd->status.max_hp * 3; break; case MC_CHANGECART: @@ -3373,25 +3374,25 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int { int range = 1; clif_skill_nodamage(src,bl,skillid,skilllv,1); - skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); - map_foreachinarea( skill_status_change_timer_sub, + status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); + map_foreachinarea( status_change_timer_sub, src->m, src->x-range, src->y-range, src->x+range,src->y+range,0, src,SkillStatusChangeTable[skillid],tick); } break; case SM_PROVOKE: /* プロボック */ { - struct status_change *sc_data = battle_get_sc_data(bl); + struct status_change *sc_data = status_get_sc_data(bl); /* MVPmobと不死には?かない */ - if((bl->type==BL_MOB && battle_get_mode(bl)&0x20) || battle_check_undead(battle_get_race(bl),battle_get_elem_type(bl))) //不死には?かない + if((bl->type==BL_MOB && status_get_mode(bl)&0x20) || battle_check_undead(status_get_race(bl),status_get_elem_type(bl))) //不死には?かない { map_freeblock_unlock(); return 1; } clif_skill_nodamage(src,bl,skillid,skilllv,1); - skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); + status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); if(dstmd && dstmd->skilltimer!=-1 && dstmd->state.skillcastcancel) // 詠唱妨害 skill_castcancel(bl,0); @@ -3401,17 +3402,17 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int if(sc_data){ if(sc_data[SC_FREEZE].timer!=-1) - skill_status_change_end(bl,SC_FREEZE,-1); + status_change_end(bl,SC_FREEZE,-1); if(sc_data[SC_STONE].timer!=-1 && sc_data[SC_STONE].val2==0) - skill_status_change_end(bl,SC_STONE,-1); + status_change_end(bl,SC_STONE,-1); if(sc_data[SC_SLEEP].timer!=-1) - skill_status_change_end(bl,SC_SLEEP,-1); + status_change_end(bl,SC_SLEEP,-1); } if(dstmd) { int range = skill_get_range(skillid,skilllv); if(range < 0) - range = battle_get_range(src) - (range + 1); + range = status_get_range(src) - (range + 1); dstmd->state.provoke_flag = src->id; mob_target(dstmd,src,range); } @@ -3449,7 +3450,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int } clif_skill_nodamage(src,bl,skillid,skilllv,1); clif_devotion(sd,bl->id); - skill_status_change_start(bl,SkillStatusChangeTable[skillid],src->id,1,0,0,1000*(15+15*skilllv),0 ); + status_change_start(bl,SkillStatusChangeTable[skillid],src->id,1,0,0,1000*(15+15*skilllv),0 ); } else clif_skill_fail(sd,skillid,0,0); break; @@ -3468,7 +3469,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int break; case MO_BLADESTOP: // 白刃取り clif_skill_nodamage(src,bl,skillid,skilllv,1); - skill_status_change_start(src,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); + status_change_start(src,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); break; case MO_ABSORBSPIRITS: // ?奪 i=0; @@ -3536,7 +3537,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_weapon_damage ) break; if( rand()%100 < (20+ 10*skilllv)*sc_def_vit/100 ) { - skill_status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); } break; @@ -3552,7 +3553,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int src,skillid,skilllv,tick, flag|BCT_ENEMY|1, skill_castend_damage_id); } - skill_status_change_end(src, SC_HIDING, -1); // ハイディング解除 + status_change_end(src, SC_HIDING, -1); // ハイディング解除 break; case KN_BRANDISHSPEAR: /*ブランディッシュスピア*/ @@ -3615,7 +3616,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int clif_skill_nodamage(bl,bl,skillid,skilllv,1); if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage ) break; - skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0); + status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0); } else{ /* パ?ティ全?への?理 */ @@ -3631,7 +3632,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int if(sd == NULL || sd->status.party_id==0 || (flag&1) ){ /* 個別の?理 */ clif_skill_nodamage(bl,bl,skillid,skilllv,1); - skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,(src == bl)? 1:0,0,0,skill_get_time(skillid,skilllv),0); + status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,(src == bl)? 1:0,0,0,skill_get_time(skillid,skilllv),0); } else{ /* パ?ティ全?への?理 */ @@ -3648,60 +3649,60 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int case CR_DEFENDER: /* ディフェンダ? */ case CR_AUTOGUARD: /* オ?トガ?ド */ { - struct status_change *tsc_data = battle_get_sc_data(bl); + struct status_change *tsc_data = status_get_sc_data(bl); int sc=SkillStatusChangeTable[skillid]; clif_skill_nodamage(src,bl,skillid,skilllv,1); if( tsc_data ){ if( tsc_data[sc].timer==-1 ) /* 付加する */ - skill_status_change_start(bl,sc,skilllv,0,0,0,skill_get_time(skillid,skilllv),0); + status_change_start(bl,sc,skilllv,0,0,0,skill_get_time(skillid,skilllv),0); else /* 解除する */ - skill_status_change_end(bl, sc, -1); + status_change_end(bl, sc, -1); } } break; case TF_HIDING: /* ハイディング */ { - struct status_change *tsc_data = battle_get_sc_data(bl); + struct status_change *tsc_data = status_get_sc_data(bl); int sc=SkillStatusChangeTable[skillid]; clif_skill_nodamage(src,bl,skillid,-1,1); if(tsc_data && tsc_data[sc].timer!=-1 ) /* 解除する */ - skill_status_change_end(bl, sc, -1); + status_change_end(bl, sc, -1); else /* 付加する */ - skill_status_change_start(bl,sc,skilllv,0,0,0,skill_get_time(skillid,skilllv),0); + status_change_start(bl,sc,skilllv,0,0,0,skill_get_time(skillid,skilllv),0); } break; case AS_CLOAKING: /* クロ?キング */ { - struct status_change *tsc_data = battle_get_sc_data(bl); + struct status_change *tsc_data = status_get_sc_data(bl); int sc=SkillStatusChangeTable[skillid]; clif_skill_nodamage(src,bl,skillid,skilllv,1); if(tsc_data && tsc_data[sc].timer!=-1 ) /* 解除する */ - skill_status_change_end(bl, sc, -1); + status_change_end(bl, sc, -1); else /* 付加する */ - skill_status_change_start(bl,sc,skilllv,0,0,0,skill_get_time(skillid,skilllv),0); + status_change_start(bl,sc,skilllv,0,0,0,skill_get_time(skillid,skilllv),0); //skill_check_cloaking(bl); } break; case ST_CHASEWALK: /* ハイディング */ { - struct status_change *tsc_data = battle_get_sc_data(bl); + struct status_change *tsc_data = status_get_sc_data(bl); int sc=SkillStatusChangeTable[skillid]; clif_skill_nodamage(src,bl,skillid,-1,1); if(tsc_data && tsc_data[sc].timer!=-1 ) /* 解除する */ - skill_status_change_end(bl, sc, -1); + status_change_end(bl, sc, -1); else /* 付加する */ - skill_status_change_start(bl,sc,skilllv,0,0,0,skill_get_time(skillid,skilllv),0); + status_change_start(bl,sc,skilllv,0,0,0,skill_get_time(skillid,skilllv),0); } break; @@ -3732,20 +3733,20 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int case HP_BASILICA: /* バジリカ */ { // cancel Basilica if already in effect - struct status_change *sc_data = battle_get_sc_data(src); + struct status_change *sc_data = status_get_sc_data(src); if(sc_data && sc_data[SC_BASILICA].timer != -1){ struct skill_unit *su; if ((su = (struct skill_unit *)sc_data[SC_BASILICA].val4)) { struct skill_unit_group *sg; if ((sg = su->group) && sg->src_id == sd->bl.id) { - skill_status_change_end(src,SC_BASILICA,-1); + status_change_end(src,SC_BASILICA,-1); skill_delunitgroup (sg); break; } } } else { // otherwise allow casting - skill_status_change_start(src,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0); + status_change_start(src,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0); skill_clear_unitgroup(src); clif_skill_nodamage(src,bl,skillid,skilllv,1); skill_unitsetting(src,skillid,skilllv,src->x,src->y,0); @@ -3757,12 +3758,12 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int skill_clear_unitgroup(src); clif_skill_nodamage(src,bl,skillid,skilllv,1); skill_unitsetting(src,skillid,skilllv,src->x,src->y,0); - skill_status_change_start(src,SkillStatusChangeTable[skillid],skilllv,0,0,BCT_SELF,skill_get_time(skillid,skilllv),0); + status_change_start(src,SkillStatusChangeTable[skillid],skilllv,0,0,BCT_SELF,skill_get_time(skillid,skilllv),0); break; case BD_ADAPTATION: /* アドリブ */ { - struct status_change *sc_data = battle_get_sc_data(src); + struct status_change *sc_data = status_get_sc_data(src); if(sc_data && sc_data[SC_DANCING].timer!=-1){ clif_skill_nodamage(src,bl,skillid,skilllv,1); skill_stop_dancing(src,0); @@ -3790,7 +3791,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int if(pc_steal_coin(sd,bl)) { int range = skill_get_range(skillid,skilllv); if(range < 0) - range = battle_get_range(src) - (range + 1); + range = status_get_range(src) - (range + 1); clif_skill_nodamage(src,bl,skillid,skilllv,1); mob_target((struct mob_data *)bl,src,range); } @@ -3801,10 +3802,10 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int case MG_STONECURSE: /* スト?ンカ?ス */ { - struct status_change *sc_data = battle_get_sc_data(bl); + struct status_change *sc_data = status_get_sc_data(bl); // Level 6-10 doesn't consume a red gem if it fails [celest] int i, gem_flag = 1; - if (bl->type==BL_MOB && battle_get_mode(bl)&0x20) { + if (bl->type==BL_MOB && status_get_mode(bl)&0x20) { clif_skill_fail(sd,sd->skillid,0,0); break; } @@ -3812,12 +3813,12 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage ) break; if (sc_data && sc_data[SC_STONE].timer != -1) { - skill_status_change_end(bl,SC_STONE,-1); + status_change_end(bl,SC_STONE,-1); if (sd) clif_skill_fail(sd,skillid,0,0); } - else if( rand()%100 < skilllv*4+20 && !battle_check_undead(battle_get_race(bl),battle_get_elem_type(bl))) - skill_status_change_start(bl,SC_STONE,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + else if( rand()%100 < skilllv*4+20 && !battle_check_undead(status_get_race(bl),status_get_elem_type(bl))) + status_change_start(bl,SC_STONE,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); else if(sd) { if (skilllv > 5) gem_flag = 0; clif_skill_fail(sd,skillid,0,0); @@ -3843,18 +3844,18 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int clif_skill_nodamage(src,bl,skillid,skilllv,1); if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage ) break; - skill_status_change_end(bl, SC_SILENCE , -1 ); - skill_status_change_end(bl, SC_BLIND , -1 ); - skill_status_change_end(bl, SC_CONFUSION, -1 ); - if( battle_check_undead(battle_get_race(bl),battle_get_elem_type(bl)) ){//アンデッドなら暗闇?果 - skill_status_change_start(bl, SC_CONFUSION,1,0,0,0,6000,0); + status_change_end(bl, SC_SILENCE , -1 ); + status_change_end(bl, SC_BLIND , -1 ); + status_change_end(bl, SC_CONFUSION, -1 ); + if( battle_check_undead(status_get_race(bl),status_get_elem_type(bl)) ){//アンデッドなら暗闇?果 + status_change_start(bl, SC_CONFUSION,1,0,0,0,6000,0); } break; case TF_DETOXIFY: /* 解毒 */ clif_skill_nodamage(src,bl,skillid,skilllv,1); - skill_status_change_end(bl, SC_POISON , -1 ); - skill_status_change_end(bl, SC_DPOISON , -1 ); + status_change_end(bl, SC_POISON , -1 ); + status_change_end(bl, SC_DPOISON , -1 ); break; case PR_STRECOVERY: /* リカバリ? */ @@ -3862,16 +3863,16 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int clif_skill_nodamage(src,bl,skillid,skilllv,1); if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage ) break; - skill_status_change_end(bl, SC_FREEZE , -1 ); - skill_status_change_end(bl, SC_STONE , -1 ); - skill_status_change_end(bl, SC_SLEEP , -1 ); - skill_status_change_end(bl, SC_STAN , -1 ); - if( battle_check_undead(battle_get_race(bl),battle_get_elem_type(bl)) ){//アンデッドなら暗闇?果 + status_change_end(bl, SC_FREEZE , -1 ); + status_change_end(bl, SC_STONE , -1 ); + status_change_end(bl, SC_SLEEP , -1 ); + status_change_end(bl, SC_STAN , -1 ); + if( battle_check_undead(status_get_race(bl),status_get_elem_type(bl)) ){//アンデッドなら暗闇?果 int blind_time; - //blind_time=30-battle_get_vit(bl)/10-battle_get_int/15; - blind_time=30*(100-(battle_get_int(bl)+battle_get_vit(bl))/2)/100; - if(rand()%100 < (100-(battle_get_int(bl)/2+battle_get_vit(bl)/3+battle_get_luk(bl)/10))) - skill_status_change_start(bl, SC_BLIND,1,0,0,0,blind_time,0); + //blind_time=30-status_get_vit(bl)/10-status_get_int/15; + blind_time=30*(100-(status_get_int(bl)+status_get_vit(bl))/2)/100; + if(rand()%100 < (100-(status_get_int(bl)/2+status_get_vit(bl)/3+status_get_luk(bl)/10))) + status_change_start(bl, SC_BLIND,1,0,0,0,blind_time,0); } if(dstmd){ dstmd->attacked_id=0; @@ -3975,7 +3976,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int case RG_STRIPHELM: /* ストリップヘルム */ case ST_FULLSTRIP: // Celest { - struct status_change *tsc_data = battle_get_sc_data(bl); + struct status_change *tsc_data = status_get_sc_data(bl); int scid, equip, strip_fix, strip_num = 0; scid = SkillStatusChangeTable[skillid]; switch (skillid) { @@ -4002,7 +4003,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int if (tsc_data && tsc_data[scid].timer != -1) break; - strip_fix = battle_get_dex(src) - battle_get_dex(bl); + strip_fix = status_get_dex(src) - status_get_dex(bl); if(strip_fix < 0) strip_fix=0; strip_per = 5+2*skilllv+strip_fix/5; @@ -4022,7 +4023,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int } clif_skill_nodamage(src,bl,skillid,skilllv,1); strip_time = skill_get_time(skillid,skilllv)+strip_fix/2; - skill_status_change_start(bl,scid,skilllv,0,0,0,strip_time,0 ); + status_change_start(bl,scid,skilllv,0,0,0,strip_time,0 ); break; } @@ -4055,7 +4056,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int pc_delitem(sd,i,skill_db[skillid].amount[x],0); sd->state.potionpitcher_flag = 0; if(sd->potion_per_hp > 0 || sd->potion_per_sp > 0) { - hp = battle_get_max_hp(bl) * sd->potion_per_hp / 100; + hp = status_get_max_hp(bl) * sd->potion_per_hp / 100; hp = hp * (100 + pc_checkskill(sd,AM_POTIONPITCHER)*10 + pc_checkskill(sd,AM_LEARNINGPOTION)*5)/100; if(dstsd) { sp = dstsd->status.max_sp * sd->potion_per_sp / 100; @@ -4065,13 +4066,13 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int else { if(sd->potion_hp > 0) { hp = sd->potion_hp * (100 + pc_checkskill(sd,AM_POTIONPITCHER)*10 + pc_checkskill(sd,AM_LEARNINGPOTION)*5)/100; - hp = hp * (100 + (battle_get_vit(bl)<<1)) / 100; + hp = hp * (100 + (status_get_vit(bl)<<1)) / 100; if(dstsd) hp = hp * (100 + pc_checkskill(dstsd,SM_RECOVERY)*10) / 100; } if(sd->potion_sp > 0) { sp = sd->potion_sp * (100 + pc_checkskill(sd,AM_POTIONPITCHER)*10 + pc_checkskill(sd,AM_LEARNINGPOTION)*5)/100; - sp = sp * (100 + (battle_get_int(bl)<<1)) / 100; + sp = sp * (100 + (status_get_int(bl)<<1)) / 100; if(dstsd) sp = sp * (100 + pc_checkskill(dstsd,MG_SRECOVERY)*10) / 100; } @@ -4079,7 +4080,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int } else { hp = (1 + rand()%400) * (100 + skilllv*10) / 100; - hp = hp * (100 + (battle_get_vit(bl)<<1)) / 100; + hp = hp * (100 + (status_get_vit(bl)<<1)) / 100; if(dstsd) hp = hp * (100 + pc_checkskill(dstsd,SM_RECOVERY)*10) / 100; } @@ -4101,11 +4102,11 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int case AM_CP_HELM: { int scid = SC_STRIPWEAPON + (skillid - AM_CP_WEAPON); - struct status_change *tsc_data = battle_get_sc_data(bl); + struct status_change *tsc_data = status_get_sc_data(bl); clif_skill_nodamage(src,bl,skillid,skilllv,1); if(tsc_data && tsc_data[scid].timer != -1) - skill_status_change_end(bl, SC_STRIPWEAPON, -1 ); - skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); + status_change_end(bl, SC_STRIPWEAPON, -1 ); + status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); } break; @@ -4121,7 +4122,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int || i==SC_STRIPHELM || i==SC_CP_WEAPON || i==SC_CP_SHIELD || i==SC_CP_ARMOR || i==SC_CP_HELM || i==SC_COMBO) continue; - skill_status_change_end(bl,i,-1); + status_change_end(bl,i,-1); } } break; @@ -4150,7 +4151,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int break; case SA_SPELLBREAKER: // スペルブレイカ? { - struct status_change *sc_data = battle_get_sc_data(bl); + struct status_change *sc_data = status_get_sc_data(bl); int sp; if(sc_data && sc_data[SC_MAGICROD].timer != -1) { if(dstsd) { @@ -4215,7 +4216,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int case SA_MAGICROD: if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage ) break; - skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); + status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); break; case SA_AUTOSPELL: /* オ?トスペル */ clif_skill_nodamage(src,bl,skillid,skilllv,1); @@ -4246,7 +4247,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int maxlv = 3; } if(spellid > 0) - skill_status_change_start(src,SC_AUTOSPELL,skilllv,spellid,maxlv,0, + status_change_start(src,SC_AUTOSPELL,skilllv,spellid,maxlv,0, skill_get_time(SA_AUTOSPELL,skilllv),0); } break; @@ -4281,7 +4282,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int clif_skill_nodamage(src,bl,skillid,skilllv,1); if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage ) break; - skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); + status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); break; case NPC_KEEPING: @@ -4289,7 +4290,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int { int skill_time = skill_get_time(skillid,skilllv); clif_skill_nodamage(src,bl,skillid,skilllv,1); - skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_time,0 ); + status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_time,0 ); if (src->type == BL_MOB) mob_changestate((struct mob_data *)src,MS_DELAY,skill_time); else if (src->type == BL_PC) @@ -4299,15 +4300,15 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int case NPC_DARKBLESSING: { - int sc_def = 100 - battle_get_mdef(bl); + int sc_def = 100 - status_get_mdef(bl); clif_skill_nodamage(src,bl,skillid,skilllv,1); if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage ) break; - if(battle_get_elem_type(bl) == 7 || battle_get_race(bl) == 6) + if(status_get_elem_type(bl) == 7 || status_get_race(bl) == 6) break; if(rand()%100 < sc_def*(50+skilllv*5)/100) { if(dstsd) { - int hp = battle_get_hp(bl)-1; + int hp = status_get_hp(bl)-1; pc_heal(dstsd,-hp,0); } else if(dstmd) @@ -4318,7 +4319,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int case NPC_SELFDESTRUCTION: /* 自爆 */ case NPC_SELFDESTRUCTION2: /* 自爆2 */ - skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,skillid,0,0,skill_get_time(skillid,skilllv),0); + status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,skillid,0,0,skill_get_time(skillid,skilllv),0); break; case NPC_LICK: clif_skill_nodamage(src,bl,skillid,skilllv,1); @@ -4327,7 +4328,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int if(dstsd) pc_heal(dstsd,0,-100); if(rand()%100 < (skilllv*5)*sc_def_vit/100) - skill_status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); + status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0); break; case NPC_SUICIDE: /* 自決 */ @@ -4470,7 +4471,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int if(su->group->unit_id == 0x91 && su->group->val2){ struct block_list *target=map_id2bl(su->group->val2); if(target && (target->type == BL_PC || target->type == BL_MOB)) - skill_status_change_end(target,SC_ANKLE,-1); + status_change_end(target,SC_ANKLE,-1); } skill_delunit(su); } @@ -4506,25 +4507,25 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int break; case AS_SPLASHER: /* ベナムスプラッシャ? */ - if((double)battle_get_max_hp(bl)*2/3 < battle_get_hp(bl)) //HPが2/3以上?っていたら失敗 + if((double)status_get_max_hp(bl)*2/3 < status_get_hp(bl)) //HPが2/3以上?っていたら失敗 return 1; clif_skill_nodamage(src,bl,skillid,skilllv,1); - skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,skillid,src->id,skill_get_time(skillid,skilllv),1000,0 ); + status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,skillid,src->id,skill_get_time(skillid,skilllv),1000,0 ); break; case PF_MINDBREAKER: /* プロボック */ { - struct status_change *sc_data = battle_get_sc_data(bl); + struct status_change *sc_data = status_get_sc_data(bl); /* MVPmobと不死には?かない */ - if((bl->type==BL_MOB && battle_get_mode(bl)&0x20) || battle_check_undead(battle_get_race(bl),battle_get_elem_type(bl))) //不死には?かない + if((bl->type==BL_MOB && status_get_mode(bl)&0x20) || battle_check_undead(status_get_race(bl),status_get_elem_type(bl))) //不死には?かない { map_freeblock_unlock(); return 1; } clif_skill_nodamage(src,bl,skillid,skilllv,1); - skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); + status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 ); if(dstmd && dstmd->skilltimer!=-1 && dstmd->state.skillcastcancel) // 詠唱妨害 skill_castcancel(bl,0); @@ -4534,17 +4535,17 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int if(sc_data){ if(sc_data[SC_FREEZE].timer!=-1) - skill_status_change_end(bl,SC_FREEZE,-1); + status_change_end(bl,SC_FREEZE,-1); if(sc_data[SC_STONE].timer!=-1 && sc_data[SC_STONE].val2==0) - skill_status_change_end(bl,SC_STONE,-1); + status_change_end(bl,SC_STONE,-1); if(sc_data[SC_SLEEP].timer!=-1) - skill_status_change_end(bl,SC_SLEEP,-1); + status_change_end(bl,SC_SLEEP,-1); } if(bl->type==BL_MOB) { int range = skill_get_range(skillid,skilllv); if(range < 0) - range = battle_get_range(src) - (range + 1); + range = status_get_range(src) - (range + 1); mob_target((struct mob_data *)bl,src,range); } } @@ -4594,7 +4595,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int if (sd && flag&1) { struct block_list tbl; 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; + hp = hp * (100 + (status_get_vit(bl)<<1))/100; if (dstsd) { hp = hp * (100 + pc_checkskill(dstsd,SM_RECOVERY)*10)/100; } @@ -4611,13 +4612,13 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int case CR_FULLPROTECTION: { int i, skilltime; - struct status_change *tsc_data = battle_get_sc_data(bl); + struct status_change *tsc_data = status_get_sc_data(bl); clif_skill_nodamage(src,bl,skillid,skilllv,1); skilltime = skill_get_time(skillid,skilllv); for (i=0; i<4; i++) { if(tsc_data && tsc_data[SC_STRIPWEAPON + i].timer != -1) - skill_status_change_end(bl, SC_STRIPWEAPON + i, -1 ); - skill_status_change_start(bl,SC_CP_WEAPON + i,skilllv,0,0,0,skilltime,0 ); + status_change_end(bl, SC_STRIPWEAPON + i, -1 ); + status_change_start(bl,SC_CP_WEAPON + i,skilllv,0,0,0,skilltime,0 ); } } break; @@ -4638,9 +4639,9 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int case ST_PRESERVE: if (sd){ if (sd->sc_count && sd->sc_data[SC_PRESERVE].timer != -1) - skill_status_change_end(src, SC_PRESERVE, -1 ); + status_change_end(src, SC_PRESERVE, -1 ); else - skill_status_change_start(src,SC_PRESERVE,skilllv,0,0,0,skill_get_time(skillid, skilllv),0 ); + status_change_start(src,SC_PRESERVE,skilllv,0,0,0,skill_get_time(skillid, skilllv),0 ); clif_skill_nodamage(src,src,skillid,skilllv,1); } break; @@ -4657,7 +4658,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int } if(flag&1) { if (dstsd && dstsd->status.guild_id == sd->status.guild_id) { - skill_status_change_start(&dstsd->bl,SC_BATTLEORDERS,skilllv,0,0,0,0,0 ); + status_change_start(&dstsd->bl,SC_BATTLEORDERS,skilllv,0,0,0,0,0 ); } } else if (sd && sd->status.guild_id > 0 && (g = guild_search(sd->status.guild_id)) && @@ -4667,7 +4668,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int src->m,src->x-15,src->y-15,src->x+15,src->y+15,0, src,skillid,skilllv,tick, flag|BCT_ALL|1, skill_castend_nodamage_id); - skill_status_change_start(src,SC_BLOCKSKILL,skilllv,0,skillid,0,300000,0 ); + status_change_start(src,SC_BLOCKSKILL,skilllv,0,skillid,0,300000,0 ); } } break; @@ -4682,7 +4683,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int } if(flag&1) { if (dstsd && dstsd->status.guild_id == sd->status.guild_id) { - skill_status_change_start(&dstsd->bl,SC_REGENERATION,skilllv,0,0,0,0,0 ); + status_change_start(&dstsd->bl,SC_REGENERATION,skilllv,0,0,0,0,0 ); } } else if (sd && sd->status.guild_id > 0 && (g = guild_search(sd->status.guild_id)) && @@ -4692,7 +4693,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int src->m,src->x-15,src->y-15,src->x+15,src->y+15,0, src,skillid,skilllv,tick, flag|BCT_ALL|1, skill_castend_nodamage_id); - skill_status_change_start(src,SC_BLOCKSKILL,skilllv,0,skillid,0,300000,0 ); + status_change_start(src,SC_BLOCKSKILL,skilllv,0,skillid,0,300000,0 ); } } break; @@ -4722,7 +4723,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int src->m,src->x-15,src->y-15,src->x+15,src->y+15,0, src,skillid,skilllv,tick, flag|BCT_ALL|1, skill_castend_nodamage_id); - skill_status_change_start(src,SC_BLOCKSKILL,skilllv,0,skillid,0,300000,0 ); + status_change_start(src,SC_BLOCKSKILL,skilllv,0,skillid,0,300000,0 ); } } break; @@ -4751,7 +4752,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int pc_setpos(dstsd, sd->mapname, sd->bl.x+dx[j], sd->bl.y+dy[j], 2); } } - skill_status_change_start(src,SC_BLOCKSKILL,skilllv,0,skillid,0,300000,0 ); + status_change_start(src,SC_BLOCKSKILL,skilllv,0,skillid,0,300000,0 ); } } break; @@ -4804,7 +4805,7 @@ int skill_castend_id( int tid, unsigned int tick, int id,int data ) } if(sd->skillid == PR_LEXAETERNA) { - struct status_change *sc_data = battle_get_sc_data(bl); + struct status_change *sc_data = status_get_sc_data(bl); if(sc_data && (sc_data[SC_FREEZE].timer != -1 || (sc_data[SC_STONE].timer != -1 && sc_data[SC_STONE].val2 == 0))) { clif_skill_fail(sd,sd->skillid,0,0); sd->canact_tick = tick; @@ -4814,7 +4815,7 @@ int skill_castend_id( int tid, unsigned int tick, int id,int data ) } } else if(sd->skillid == RG_BACKSTAP) { - int dir = map_calc_dir(&sd->bl,bl->x,bl->y),t_dir = battle_get_dir(bl); + int dir = map_calc_dir(&sd->bl,bl->x,bl->y),t_dir = status_get_dir(bl); int dist = distance(sd->bl.x,sd->bl.y,bl->x,bl->y); if(bl->type != BL_SKILL && (dist == 0 || map_check_dir(dir,t_dir))) { clif_skill_fail(sd,sd->skillid,0,0); @@ -4837,7 +4838,7 @@ int skill_castend_id( int tid, unsigned int tick, int id,int data ) int fail_flag = 1; if(inf2 & 0x400 && battle_check_target(&sd->bl,bl, BCT_PARTY) > 0) fail_flag = 0; - if(inf2 & 0x800 && sd->status.guild_id > 0 && sd->status.guild_id == battle_get_guild_id(bl)) + if(inf2 & 0x800 && sd->status.guild_id > 0 && sd->status.guild_id == status_get_guild_id(bl)) fail_flag = 0; if(fail_flag) { clif_skill_fail(sd,sd->skillid,0,0); @@ -4850,7 +4851,7 @@ int skill_castend_id( int tid, unsigned int tick, int id,int data ) range = skill_get_range(sd->skillid,sd->skilllv); if(range < 0) - range = battle_get_range(&sd->bl) - (range + 1); + range = status_get_range(&sd->bl) - (range + 1); range += battle_config.pc_skill_add_range; if((sd->skillid == MO_EXTREMITYFIST && sd->sc_data[SC_COMBO].timer != -1 && sd->sc_data[SC_COMBO].val1 == MO_COMBOFINISH) || (sd->skillid == CH_TIGERFIST && sd->sc_data[SC_COMBO].timer != -1 && sd->sc_data[SC_COMBO].val1 == MO_COMBOFINISH) || @@ -4893,7 +4894,7 @@ int skill_castend_id( int tid, unsigned int tick, int id,int data ) skill_castend_damage_id(&sd->bl,bl,sd->skillid,sd->skilllv,tick,0); break; case 1:/* 支援系 */ - if( (sd->skillid==AL_HEAL || (sd->skillid==ALL_RESURRECTION && bl->type != BL_PC) || sd->skillid==PR_ASPERSIO) && battle_check_undead(battle_get_race(bl),battle_get_elem_type(bl))) + if( (sd->skillid==AL_HEAL || (sd->skillid==ALL_RESURRECTION && bl->type != BL_PC) || sd->skillid==PR_ASPERSIO) && battle_check_undead(status_get_race(bl),status_get_elem_type(bl))) skill_castend_damage_id(&sd->bl,bl,sd->skillid,sd->skilllv,tick,0); else skill_castend_nodamage_id(&sd->bl,bl,sd->skillid,sd->skilllv,tick,0); @@ -4960,7 +4961,7 @@ int skill_castend_pos2( struct block_list *src, int x,int y,int skillid,int skil x+=(src->x-x>0)?-range:range; if(src->y!=y) y+=(src->y-y>0)?-range:range; - map_foreachinarea( skill_status_change_timer_sub, + map_foreachinarea( status_change_timer_sub, src->m, x-range, y-range, x+range,y+range,0, src,SC_SIGHT,tick); } @@ -5060,7 +5061,7 @@ int skill_castend_pos2( struct block_list *src, int x,int y,int skillid,int skil pc_movepos(sd,x,y); }else if( src->type==BL_MOB ) mob_warp((struct mob_data *)src,-1,x,y,0); - skill_status_change_start(src,SC_BLOCKSKILL,skilllv,0,MO_EXTREMITYFIST,0,2000,0 ); + status_change_start(src,SC_BLOCKSKILL,skilllv,0,MO_EXTREMITYFIST,0,2000,0 ); break; case AM_CANNIBALIZE: // バイオプラント if(sd){ @@ -5250,7 +5251,7 @@ struct skill_unit_group *skill_unitsetting( struct block_list *src, int skillid, nullpo_retr(0, src); - sc_data = battle_get_sc_data(src); // for firewall and fogwall - celest + sc_data = status_get_sc_data(src); // for firewall and fogwall - celest switch(skillid){ /* 設定 */ @@ -5460,8 +5461,8 @@ struct skill_unit_group *skill_unitsetting( struct block_list *src, int skillid, target=BCT_NOENEMY; if(src->type == BL_PC) val1 = (pc_checkskill((struct map_session_data *)src,BA_MUSICALLESSON)+1)>>1; - val2 = ((battle_get_agi(src)/10)&0xffff)<<16; - val2 |= (battle_get_luk(src)/10)&0xffff; + val2 = ((status_get_agi(src)/10)&0xffff)<<16; + val2 |= (status_get_luk(src)/10)&0xffff; break; case DC_HUMMING: /* ハミング */ count=49; @@ -5470,7 +5471,7 @@ struct skill_unit_group *skill_unitsetting( struct block_list *src, int skillid, target=BCT_NOENEMY; if(src->type == BL_PC) val1 = (pc_checkskill((struct map_session_data *)src,DC_DANCINGLESSON)+1)>>1; - val2 = battle_get_dex(src)/10; + val2 = status_get_dex(src)/10; break; case BA_DISSONANCE: /* 不協和音 */ @@ -5488,8 +5489,8 @@ struct skill_unit_group *skill_unitsetting( struct block_list *src, int skillid, target=BCT_ENEMY; if(src->type == BL_PC) val1 = (pc_checkskill((struct map_session_data *)src,DC_DANCINGLESSON)+1)>>1; - val2 = ((battle_get_str(src)/20)&0xffff)<<16; - val2 |= (battle_get_agi(src)/10)&0xffff; + val2 = ((status_get_str(src)/20)&0xffff)<<16; + val2 |= (status_get_agi(src)/10)&0xffff; break; case BA_POEMBRAGI: /* ブラギの詩 */ count=49; @@ -5498,8 +5499,8 @@ struct skill_unit_group *skill_unitsetting( struct block_list *src, int skillid, target=BCT_NOENEMY; if(src->type == BL_PC) val1 = pc_checkskill((struct map_session_data *)src,BA_MUSICALLESSON); - val2 = ((battle_get_dex(src)/10)&0xffff)<<16; - val2 |= (battle_get_int(src)/5)&0xffff; + val2 = ((status_get_dex(src)/10)&0xffff)<<16; + val2 |= (status_get_int(src)/5)&0xffff; break; case BA_APPLEIDUN: /* イドゥンの林檎 */ count=49; @@ -5510,7 +5511,7 @@ struct skill_unit_group *skill_unitsetting( struct block_list *src, int skillid, val1 = ((pc_checkskill((struct map_session_data *)src,BA_MUSICALLESSON))&0xffff)<<16; else val1 = 0; - val1 |= (battle_get_vit(src))&0xffff; + val1 |= (status_get_vit(src))&0xffff; val2 = 0;//回復用タイムカウンタ(6秒?に1?加) break; case DC_SERVICEFORYOU: /* サ?ビスフォ?ユ? */ @@ -5520,7 +5521,7 @@ struct skill_unit_group *skill_unitsetting( struct block_list *src, int skillid, target=BCT_PARTY; if(src->type == BL_PC) val1 = (pc_checkskill((struct map_session_data *)src,DC_DANCINGLESSON)+1)>>1; - val2 = battle_get_int(src)/10; + val2 = status_get_int(src)/10; break; case BA_ASSASSINCROSS: /* 夕陽のアサシンクロス */ count=49; @@ -5529,7 +5530,7 @@ struct skill_unit_group *skill_unitsetting( struct block_list *src, int skillid, target=BCT_NOENEMY; if(src->type == BL_PC) val1 = (pc_checkskill((struct map_session_data *)src,BA_MUSICALLESSON)+1)>>1; - val2 = battle_get_agi(src)/20; + val2 = status_get_agi(src)/20; break; case DC_FORTUNEKISS: /* 幸運のキス */ count=49; @@ -5538,7 +5539,7 @@ struct skill_unit_group *skill_unitsetting( struct block_list *src, int skillid, target=BCT_NOENEMY; if(src->type == BL_PC) val1 = (pc_checkskill((struct map_session_data *)src,DC_DANCINGLESSON)+1)>>1; - val2 = battle_get_luk(src)/10; + val2 = status_get_luk(src)/10; break; case AM_DEMONSTRATION: /* デモンストレ?ション */ @@ -5559,7 +5560,7 @@ struct skill_unit_group *skill_unitsetting( struct block_list *src, int skillid, range=3; //Fix to prevent the priest from walking while Basilica is up. battle_stopwalking(src,1); - //skill_status_change_start(src,SC_ANKLE,skilllv,0,0,0,limit,0); + //status_change_start(src,SC_ANKLE,skilllv,0,0,0,limit,0); //sd->canmove_tick = gettick() + limit; // added later [celest] break; @@ -5928,10 +5929,10 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int switch(sg->unit_id){ case 0x83: /* サンクチュアリ */ { - int race=battle_get_race(bl); - int damage_flag = (battle_check_undead(race,battle_get_elem_type(bl)) || race == 6)? 1:0; + int race=status_get_race(bl); + int damage_flag = (battle_check_undead(race,status_get_elem_type(bl)) || race == 6)? 1:0; - if( battle_get_hp(bl)>=battle_get_max_hp(bl) && !damage_flag) + if( status_get_hp(bl)>=status_get_max_hp(bl) && !damage_flag) break; if((sg->val1--)<=0){ @@ -5955,8 +5956,8 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int case 0x84: /* マグヌスエクソシズム */ { - int race=battle_get_race(bl); - int damage_flag = (battle_check_undead(race,battle_get_elem_type(bl)) || race == 6)? 1:0; + int race=status_get_race(bl); + int damage_flag = (battle_check_undead(race,status_get_elem_type(bl)) || race == 6)? 1:0; if(!damage_flag) return 0; @@ -5967,14 +5968,14 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int case 0x85: /* ニュ?マ */ { struct skill_unit *unit2; - struct status_change *sc_data=battle_get_sc_data(bl); + struct status_change *sc_data=status_get_sc_data(bl); int type=SC_PNEUMA; if(sc_data) { if (sc_data[type].timer==-1) - skill_status_change_start(bl,type,sg->skill_lv,(int)src,0,0,0,0); + status_change_start(bl,type,sg->skill_lv,(int)src,0,0,0,0); else if((unit2=(struct skill_unit *)sc_data[type].val2) && unit2 != src ){ if(DIFF_TICK(sg->tick,unit2->group->tick)>0 ) - skill_status_change_start(bl,type,sg->skill_lv,(int)src,0,0,0,0); + status_change_start(bl,type,sg->skill_lv,(int)src,0,0,0,0); ts->tick-=sg->interval; } } @@ -5983,14 +5984,14 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int case 0x7e: /* セイフティウォ?ル */ { struct skill_unit *unit2; - struct status_change *sc_data=battle_get_sc_data(bl); + struct status_change *sc_data=status_get_sc_data(bl); int type=SC_SAFETYWALL; if(sc_data) { if (sc_data[type].timer==-1) - skill_status_change_start(bl,type,sg->skill_lv,(int)src,0,0,0,0); + status_change_start(bl,type,sg->skill_lv,(int)src,0,0,0,0); else if((unit2=(struct skill_unit *)sc_data[type].val2) && unit2 != src ){ if(sg->val1 < unit2->group->val1 ) - skill_status_change_start(bl,type,sg->skill_lv,(int)src,0,0,0,0); + status_change_start(bl,type,sg->skill_lv,(int)src,0,0,0,0); ts->tick-=sg->interval; } } @@ -6060,14 +6061,14 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int case 0x91: /* アンクルスネア */ { - struct status_change *sc_data=battle_get_sc_data(bl); + struct status_change *sc_data=status_get_sc_data(bl); if(sg->val2==0 && sc_data && sc_data[SC_ANKLE].timer==-1){ int moveblock = ( bl->x/BLOCK_SIZE != src->bl.x/BLOCK_SIZE || bl->y/BLOCK_SIZE != src->bl.y/BLOCK_SIZE); - int sec = skill_get_time2(sg->skill_id,sg->skill_lv) - battle_get_agi(bl)/10; - if(battle_get_mode(bl)&0x20) + int sec = skill_get_time2(sg->skill_id,sg->skill_lv) - status_get_agi(bl)/10; + if(status_get_mode(bl)&0x20) sec = sec/5; battle_stopwalking(bl,1); - skill_status_change_start(bl,SC_ANKLE,sg->skill_lv,0,0,0,sec,0); + status_change_start(bl,SC_ANKLE,sg->skill_lv,0,0,0,sec,0); if(moveblock) map_delblock(bl); bl->x = src->bl.x; @@ -6109,20 +6110,20 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int case 0x8e: /* クァグマイア */ { - struct status_change *sc_data=battle_get_sc_data(bl); + struct status_change *sc_data=status_get_sc_data(bl); int type=SkillStatusChangeTable[sg->skill_id]; if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage ) break; if(sc_data && sc_data[type].timer==-1) - skill_status_change_start(bl,type,sg->skill_lv,(int)src,0,0,skill_get_time2(sg->skill_id,sg->skill_lv),0); + status_change_start(bl,type,sg->skill_lv,(int)src,0,0,skill_get_time2(sg->skill_id,sg->skill_lv),0); } break; case 0x92: /* ベノムダスト */ { - struct status_change *sc_data=battle_get_sc_data(bl); + struct status_change *sc_data=status_get_sc_data(bl); int type=SkillStatusChangeTable[sg->skill_id]; if(sc_data && sc_data[type].timer==-1 ) - skill_status_change_start(bl,type,sg->skill_lv,(int)src,0,0,skill_get_time2(sg->skill_id,sg->skill_lv),0); + status_change_start(bl,type,sg->skill_lv,(int)src,0,0,skill_get_time2(sg->skill_id,sg->skill_lv),0); } break; case 0x9a: /* ボルケ?ノ */ @@ -6130,14 +6131,14 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int case 0x9c: /* バイオレントゲイル */ { struct skill_unit *unit2; - struct status_change *sc_data=battle_get_sc_data(bl); + struct status_change *sc_data=status_get_sc_data(bl); int type=SkillStatusChangeTable[sg->skill_id]; if(sc_data) { if (sc_data[type].timer==-1) - skill_status_change_start(bl,type,sg->skill_lv,(int)src,0,0,skill_get_time2(sg->skill_id,sg->skill_lv),0); + status_change_start(bl,type,sg->skill_lv,(int)src,0,0,skill_get_time2(sg->skill_id,sg->skill_lv),0); else if((unit2=(struct skill_unit *)sc_data[type].val2) && unit2 != src ){ if( unit2->group && DIFF_TICK(sg->tick,unit2->group->tick)>0 ) - skill_status_change_start(bl,type,sg->skill_lv,(int)src,0,0,skill_get_time2(sg->skill_id,sg->skill_lv),0); + status_change_start(bl,type,sg->skill_lv,(int)src,0,0,skill_get_time2(sg->skill_id,sg->skill_lv),0); ts->tick-=sg->interval; } } @@ -6164,17 +6165,17 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int // case 0xb6: /* フォグウォ?ル */ { struct skill_unit *unit2; - struct status_change *sc_data=battle_get_sc_data(bl); + struct status_change *sc_data=status_get_sc_data(bl); int type=SkillStatusChangeTable[sg->skill_id]; if(sg->src_id == bl->id) break; if(sc_data) { if (sc_data[type].timer==-1) - skill_status_change_start(bl,type,sg->skill_lv,sg->val1,sg->val2, + status_change_start(bl,type,sg->skill_lv,sg->val1,sg->val2, (int)src,skill_get_time2(sg->skill_id,sg->skill_lv),0); else if( (unit2=(struct skill_unit *)sc_data[type].val4) && unit2 != src ){ if( unit2->group && DIFF_TICK(sg->tick,unit2->group->tick)>0 ) - skill_status_change_start(bl,type,sg->skill_lv,sg->val1,sg->val2, + status_change_start(bl,type,sg->skill_lv,sg->val1,sg->val2, (int)src,skill_get_time2(sg->skill_id,sg->skill_lv),0); ts->tick-=sg->interval; } @@ -6184,17 +6185,17 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int case 0xaa: /* イドゥンの林檎 */ { struct skill_unit *unit2; - struct status_change *sc_data=battle_get_sc_data(bl); + struct status_change *sc_data=status_get_sc_data(bl); int type=SkillStatusChangeTable[sg->skill_id]; if(sg->src_id == bl->id) break; if(sc_data) { if (sc_data[type].timer==-1) - skill_status_change_start(bl,type,sg->skill_lv,(sg->val1)>>16,(sg->val1)&0xffff, + status_change_start(bl,type,sg->skill_lv,(sg->val1)>>16,(sg->val1)&0xffff, (int)src,skill_get_time2(sg->skill_id,sg->skill_lv),0); else if((unit2=(struct skill_unit *)sc_data[type].val4) && unit2 != src ){ if( unit2->group && DIFF_TICK(sg->tick,unit2->group->tick)>0 ) - skill_status_change_start(bl,type,sg->skill_lv,(sg->val1)>>16,(sg->val1)&0xffff, + status_change_start(bl,type,sg->skill_lv,(sg->val1)>>16,(sg->val1)&0xffff, (int)src,skill_get_time2(sg->skill_id,sg->skill_lv),0); ts->tick-=sg->interval; } @@ -6204,17 +6205,17 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int case 0xb6: /* フォグウォ?ル */ { struct skill_unit *unit2; - struct status_change *sc_data=battle_get_sc_data(bl); + struct status_change *sc_data=status_get_sc_data(bl); int type=SkillStatusChangeTable[sg->skill_id]; if(sc_data) { if (sc_data[type].timer==-1) { - skill_status_change_start(bl,type,sg->skill_lv,sg->val1,sg->val2, + status_change_start(bl,type,sg->skill_lv,sg->val1,sg->val2, (int)src,skill_get_time2(sg->skill_id,sg->skill_lv),0); skill_additional_effect(ss,bl,sg->skill_id,sg->skill_lv,BF_MISC,tick); } else if( (unit2=(struct skill_unit *)sc_data[type].val4) && unit2 != src ){ if( unit2->group && DIFF_TICK(sg->tick,unit2->group->tick)>0 ) { - skill_status_change_start(bl,type,sg->skill_lv,sg->val1,sg->val2, + status_change_start(bl,type,sg->skill_lv,sg->val1,sg->val2, (int)src,skill_get_time2(sg->skill_id,sg->skill_lv),0); skill_additional_effect(ss,bl,sg->skill_id,sg->skill_lv,BF_MISC,tick); } @@ -6273,7 +6274,7 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int sd->status.guild_id == srcsd->status.guild_id && sd != srcsd) { sd->state.leadership_flag = (int)src; - pc_calcstatus (sd, 0); + status_calc_pc (sd, 0); } } break; @@ -6284,7 +6285,7 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int sd->status.guild_id == srcsd->status.guild_id && sd != srcsd) { sd->state.glorywounds_flag = (int)src; - pc_calcstatus (sd, 0); + status_calc_pc (sd, 0); } } break; @@ -6295,7 +6296,7 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int sd->status.guild_id == srcsd->status.guild_id && sd != srcsd) { sd->state.soulcold_flag = (int)src; - pc_calcstatus (sd, 0); + status_calc_pc (sd, 0); } } break; @@ -6306,7 +6307,7 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int sd->status.guild_id == srcsd->status.guild_id && sd != srcsd) { sd->state.hawkeyes_flag = (int)src; - pc_calcstatus (sd, 0); + status_calc_pc (sd, 0); } } break; @@ -6355,14 +6356,14 @@ int skill_unit_onout(struct skill_unit *src,struct block_list *bl,unsigned int t case 0x85: /* ニュ?マ */ case 0x8e: /* クァグマイア */ { - struct status_change *sc_data=battle_get_sc_data(bl); + struct status_change *sc_data=status_get_sc_data(bl); int type= (sg->unit_id==0x85)?SC_PNEUMA: ((sg->unit_id==0x7e)?SC_SAFETYWALL: SC_QUAGMIRE); if((type != SC_QUAGMIRE || bl->type != BL_MOB) && sc_data && sc_data[type].timer!=-1 && ((struct skill_unit *)sc_data[type].val2)==src){ - skill_status_change_end(bl,type,-1); + status_change_end(bl,type,-1); } } break; @@ -6370,7 +6371,7 @@ int skill_unit_onout(struct skill_unit *src,struct block_list *bl,unsigned int t { struct block_list *target=map_id2bl(sg->val2); if( target && target==bl ){ - skill_status_change_end(bl,SC_ANKLE,-1); + status_change_end(bl,SC_ANKLE,-1); sg->limit=DIFF_TICK(tick,sg->tick)+1000; } } @@ -6380,19 +6381,19 @@ int skill_unit_onout(struct skill_unit *src,struct block_list *bl,unsigned int t { struct block_list *target=map_id2bl(sg->val2); if( target==bl ) - skill_status_change_end(bl,SC_SPIDERWEB,-1); + status_change_end(bl,SC_SPIDERWEB,-1); sg->limit=DIFF_TICK(tick,sg->tick)+1000; } break; case 0xb6: { struct block_list *target=map_id2bl(sg->val2); - struct status_change *sc_data=battle_get_sc_data(bl); + struct status_change *sc_data=status_get_sc_data(bl); if( target==bl ) { - skill_status_change_end(bl,SC_FOGWALL,-1); + status_change_end(bl,SC_FOGWALL,-1); if (sc_data && sc_data[SC_BLIND].timer!=-1) sc_data[SC_BLIND].timer = add_timer( - gettick() + 30000, skill_status_change_timer, bl->id, 0); + gettick() + 30000, status_change_timer, bl->id, 0); } //sg->limit=DIFF_TICK(tick,sg->tick)+1000; } @@ -6401,11 +6402,11 @@ int skill_unit_onout(struct skill_unit *src,struct block_list *bl,unsigned int t case 0x9b: /* デリュ?ジ */ case 0x9c: /* バイオレントゲイル */ { - struct status_change *sc_data=battle_get_sc_data(bl); + struct status_change *sc_data=status_get_sc_data(bl); struct skill_unit *su; int type=SkillStatusChangeTable[sg->skill_id]; if( sc_data && sc_data[type].timer!=-1 && (su=((struct skill_unit *)sc_data[type].val2)) && su == src ){ - skill_status_change_end(bl,type,-1); + status_change_end(bl,type,-1); } } break; @@ -6430,11 +6431,11 @@ int skill_unit_onout(struct skill_unit *src,struct block_list *bl,unsigned int t case 0xaf: /* サ?ビスフォ?ユ? */ case 0xb4: { - struct status_change *sc_data=battle_get_sc_data(bl); + struct status_change *sc_data=status_get_sc_data(bl); struct skill_unit *su; int type=SkillStatusChangeTable[sg->skill_id]; if( sc_data && sc_data[type].timer!=-1 && (su=((struct skill_unit *)sc_data[type].val4)) && su == src ){ - skill_status_change_end(bl,type,-1); + status_change_end(bl,type,-1); } } break; @@ -6442,7 +6443,7 @@ int skill_unit_onout(struct skill_unit *src,struct block_list *bl,unsigned int t { struct block_list *target=map_id2bl(sg->val2); if( target && target==bl ) - skill_status_change_end(bl,SC_SPIDERWEB,-1); + status_change_end(bl,SC_SPIDERWEB,-1); sg->limit=DIFF_TICK(tick,sg->tick)+1000; } break; @@ -6769,7 +6770,7 @@ int skill_castend_pos( int tid, unsigned int tick, int id,int data ) if(sd->skilllv <= 0) return 0; range = skill_get_range(sd->skillid,sd->skilllv); if(range < 0) - range = battle_get_range(&sd->bl) - (range + 1); + range = status_get_range(&sd->bl) - (range + 1); range += battle_config.pc_skill_add_range; if(battle_config.skill_out_range_consume) { // changed to allow casting when target walks out of range [Valaris] if(range < distance(sd->bl.x,sd->bl.y,sd->skillx,sd->skilly)) { @@ -6905,7 +6906,7 @@ static int skill_check_condition_use_sub(struct block_list *bl,va_list ap) if(sd != ssd && (s_class.job == 4 || s_class.job == 8 || s_class.job == 15) && (sd->bl.x == ssd->bl.x - 1 || sd->bl.x == ssd->bl.x + 1) && sd->status.sp >= 10){ sd->status.sp -= 10; - pc_calcstatus(sd,0); + status_calc_pc(sd,0); (*c)++; } break; @@ -6930,7 +6931,7 @@ static int skill_check_condition_use_sub(struct block_list *bl,va_list ap) ){ ssd->sc_data[SC_DANCING].val4=bl->id; clif_skill_nodamage(bl,src,skillid,skilllv,1); - skill_status_change_start(bl,SC_DANCING,skillid,ssd->sc_data[SC_DANCING].val2,0,src->id,skill_get_time(skillid,skilllv)+1000,0); + status_change_start(bl,SC_DANCING,skillid,ssd->sc_data[SC_DANCING].val2,0,src->id,skill_get_time(skillid,skilllv)+1000,0); sd->skillid_dance=sd->skillid=skillid; sd->skilllv_dance=sd->skilllv=skilllv; (*c)++; @@ -7400,7 +7401,7 @@ int skill_castfix( struct block_list *bl, int time ) if(lv <= 0) return 0; - sc_data = battle_get_sc_data(bl); + sc_data = status_get_sc_data(bl); if (skill > MAX_SKILL_DB || skill < 0) return 0; @@ -7408,14 +7409,14 @@ int skill_castfix( struct block_list *bl, int time ) /* サフラギウム */ if(sc_data && sc_data[SC_SUFFRAGIUM].timer!=-1 ) time=time*(100-sc_data[SC_SUFFRAGIUM].val1*15)/100; - skill_status_change_end( bl, SC_SUFFRAGIUM, -1); + status_change_end( bl, SC_SUFFRAGIUM, -1); if(time==0) return 0; if (sd) { if(!skill_get_castnodex(skill, lv) > 0) { castrate=((struct map_session_data *)bl)->castrate; - time=time*castrate*(battle_config.castrate_dex_scale - battle_get_dex(bl))/(battle_config.castrate_dex_scale * 100); + time=time*castrate*(battle_config.castrate_dex_scale - status_get_dex(bl))/(battle_config.castrate_dex_scale * 100); time=time*battle_config.cast_rate/100; } } @@ -7448,7 +7449,7 @@ int skill_delayfix( struct block_list *bl, int time ) if(lv <= 0) return 0; - sc_data = battle_get_sc_data(bl); + sc_data = status_get_sc_data(bl); if(sd) { delayrate=((struct map_session_data *)bl)->delayrate; @@ -7456,15 +7457,15 @@ int skill_delayfix( struct block_list *bl, int time ) // instant cast attack skills depend on aspd as delay [celest] if (time == 0) { if (skill_db[skill].skill_type == BF_WEAPON) - time = battle_get_adelay (bl)/2; + time = status_get_adelay (bl)/2; else time = 300; // default delay, according to official servers } else if (time < 0) - time = abs(time) + battle_get_adelay (bl)/2; // if set to <0, the aspd delay will be added + time = abs(time) + status_get_adelay (bl)/2; // if set to <0, the aspd delay will be added if(battle_config.delay_dependon_dex && /* dexの影響を計算する */ !skill_get_delaynodex(skill, lv)) // if skill casttime is allowed to be reduced by dex - time = time * (battle_config.castrate_dex_scale - battle_get_dex(bl)) / (battle_config.castrate_dex_scale); + time = time * (battle_config.castrate_dex_scale - status_get_dex(bl)) / (battle_config.castrate_dex_scale); time = time * delayrate * battle_config.delay_rate / 10000; @@ -7552,7 +7553,7 @@ int skill_use_id( struct map_session_data *sd, int target_id, struct skill_unit_group *sg; // if caster is the owner of basilica if ((sg = su->group) && sg->src_id == sd->bl.id) { - // skill_status_change_end(&sd->bl,SC_BASILICA,-1); + // status_change_end(&sd->bl,SC_BASILICA,-1); // skill_delunitgroup (sg); if (skill_num != HP_BASILICA) return 0; } // otherwise... @@ -7669,7 +7670,7 @@ int skill_use_id( struct map_session_data *sd, int target_id, /* 射程と障害物チェック */ range = skill_get_range(skill_num,skill_lv); if(range < 0) - range = battle_get_range(&sd->bl) - (range + 1); + range = status_get_range(&sd->bl) - (range + 1); // be lenient if the skill was cast before we have moved to the correct position [Celest] if (sd->walktimer != -1) range += battle_config.skill_range_leniency; @@ -7706,11 +7707,11 @@ int skill_use_id( struct map_session_data *sd, int target_id, switch(skill_num){ /* 何か特殊な?理が必要 */ // case AL_HEAL: /* ヒ?ル */ -// if(battle_check_undead(battle_get_race(bl),battle_get_elem_type(bl))) +// if(battle_check_undead(status_get_race(bl),status_get_elem_type(bl))) // forcecast=1; /* ヒ?ルアタックなら詠唱エフェクト有り */ // break; case ALL_RESURRECTION: /* リザレクション */ - if(bl->type != BL_PC && battle_check_undead(battle_get_race(bl),battle_get_elem_type(bl))){ /* 敵がアンデッドなら */ + if(bl->type != BL_PC && battle_check_undead(status_get_race(bl),status_get_elem_type(bl))){ /* 敵がアンデッドなら */ forcecast=1; /* タ?ンアンデットと同じ詠唱時間 */ casttime=skill_castfix(&sd->bl, skill_get_cast(PR_TURNUNDEAD,skill_lv) ); } @@ -7759,7 +7760,7 @@ int skill_use_id( struct map_session_data *sd, int target_id, //rangeをもう1回?査 range = skill_get_range(skill_num,skill_lv); if(range < 0) - range = battle_get_range(&sd->bl) - (range + 1); + range = status_get_range(&sd->bl) - (range + 1); if(!battle_check_range(&sd->bl,&p_sd->bl,range)) return 0; } @@ -7767,7 +7768,7 @@ int skill_use_id( struct map_session_data *sd, int target_id, // removed on 12/14's patch [celest] //case AS_SPLASHER: /* ベナムスプラッシャ? */ /* { - struct status_change *t_sc_data = battle_get_sc_data(bl); + struct status_change *t_sc_data = status_get_sc_data(bl); if(t_sc_data && t_sc_data[SC_POISON].timer==-1){ clif_skill_fail(sd,skill_num,0,10); return 0; @@ -7792,7 +7793,7 @@ int skill_use_id( struct map_session_data *sd, int target_id, if(sc_data && sc_data[SC_MEMORIZE].timer != -1 && casttime > 0){ casttime = casttime/2; if((--sc_data[SC_MEMORIZE].val2)<=0) - skill_status_change_end(&sd->bl, SC_MEMORIZE, -1); + status_change_end(&sd->bl, SC_MEMORIZE, -1); } if(battle_config.pc_skill_log) @@ -7824,7 +7825,7 @@ int skill_use_id( struct map_session_data *sd, int target_id, sd->canact_tick = tick + casttime + delay; sd->canmove_tick = tick; if(!(battle_config.pc_cloak_check_type&2) && sc_data && sc_data[SC_CLOAKING].timer != -1 && sd->skillid != AS_CLOAKING) - skill_status_change_end(&sd->bl,SC_CLOAKING,-1); + status_change_end(&sd->bl,SC_CLOAKING,-1); if(casttime > 0) { sd->skilltimer = add_timer( tick+casttime, skill_castend_id, sd->bl.id, 0 ); if((skill = pc_checkskill(sd,SA_FREECAST)) > 0) { @@ -7893,7 +7894,7 @@ int skill_use_pos( struct map_session_data *sd, struct skill_unit_group *sg; // if caster is the owner of basilica if ((sg = su->group) && sg->src_id == sd->bl.id) { - // skill_status_change_end(&sd->bl,SC_BASILICA,-1); + // status_change_end(&sd->bl,SC_BASILICA,-1); // skill_delunitgroup (sg); if (skill_num != HP_BASILICA) return 0; } // otherwise... @@ -7926,7 +7927,7 @@ int skill_use_pos( struct map_session_data *sd, bl.y = skill_y; range = skill_get_range(skill_num,skill_lv); if(range < 0) - range = battle_get_range(&sd->bl) - (range + 1); + range = status_get_range(&sd->bl) - (range + 1); // be lenient if the skill was cast before we have moved to the correct position [Celest] if (sd->walktimer != -1) range += battle_config.skill_range_leniency; @@ -7948,7 +7949,7 @@ int skill_use_pos( struct map_session_data *sd, if(sc_data && sc_data[SC_MEMORIZE].timer != -1 && casttime > 0){ casttime = casttime/3; if((--sc_data[SC_MEMORIZE].val2)<=0) - skill_status_change_end(&sd->bl, SC_MEMORIZE, -1); + status_change_end(&sd->bl, SC_MEMORIZE, -1); } if( casttime>0 ) /* 詠唱が必要 */ @@ -7964,7 +7965,7 @@ int skill_use_pos( struct map_session_data *sd, sd->canact_tick = tick + casttime + delay; sd->canmove_tick = tick; if(!(battle_config.pc_cloak_check_type&2) && sc_data && sc_data[SC_CLOAKING].timer != -1) - skill_status_change_end(&sd->bl,SC_CLOAKING,-1); + status_change_end(&sd->bl,SC_CLOAKING,-1); if(casttime > 0) { sd->skilltimer = add_timer( tick+casttime, skill_castend_pos, sd->bl.id, 0 ); if((skill = pc_checkskill(sd,SA_FREECAST)) > 0) { @@ -7981,7 +7982,7 @@ int skill_use_pos( struct map_session_data *sd, } //マジックパワ?の?果終了 if(sc_data && sc_data[SC_MAGICPOWER].timer != -1 && skill_num != HW_MAGICPOWER) - skill_status_change_end(&sd->bl,SC_MAGICPOWER,-1); + status_change_end(&sd->bl,SC_MAGICPOWER,-1); return 0; } @@ -8246,7 +8247,7 @@ void skill_devotion_end(struct map_session_data *md,struct map_session_data *sd, md->dev.val1[target]=md->dev.val2[target]=0; if(sd && sd->sc_data){ - // skill_status_change_end(sd->bl,SC_DEVOTION,-1); + // status_change_end(sd->bl,SC_DEVOTION,-1); sd->sc_data[SC_DEVOTION].val1=0; sd->sc_data[SC_DEVOTION].val2=0; clif_status_change(&sd->bl,SC_DEVOTION,0); @@ -8288,7 +8289,7 @@ int skill_autospell(struct map_session_data *sd,int skillid) if(maxlv > (lv=pc_checkskill(sd,skillid))) maxlv = lv; - skill_status_change_start(&sd->bl,SC_AUTOSPELL,skilllv,skillid,maxlv,0, // val1:スキルID val2:使用最大Lv + status_change_start(&sd->bl,SC_AUTOSPELL,skilllv,skillid,maxlv,0, // val1:スキルID val2:使用最大Lv skill_get_time(SA_AUTOSPELL,skilllv),0);// にしてみたけどbscriptが書き易い???? return 0; } @@ -8664,994 +8665,6 @@ int skill_trap_splash(struct block_list *bl, va_list ap ) return 0; } -/*---------------------------------------------------------------------------- - * ステ?タス異常 - *---------------------------------------------------------------------------- - */ - -/*========================================== - * ステ?タス異常タイマ?範??理 - *------------------------------------------ - */ -int skill_status_change_timer_sub(struct block_list *bl, va_list ap ) -{ - struct block_list *src; - int type; - unsigned int tick; - - nullpo_retr(0, bl); - nullpo_retr(0, ap); - nullpo_retr(0, src=va_arg(ap,struct block_list*)); - type=va_arg(ap,int); - tick=va_arg(ap,unsigned int); - - if(bl->type!=BL_PC && bl->type!=BL_MOB) - return 0; - - switch( type ){ - case SC_SIGHT: /* サイト */ - case SC_CONCENTRATE: - if( (*battle_get_option(bl))&6 ){ - skill_status_change_end( bl, SC_HIDING, -1); - skill_status_change_end( bl, SC_CLOAKING, -1); - } - break; - case SC_RUWACH: /* ルアフ */ - if( (*battle_get_option(bl))&6 ){ - if(battle_check_target( src,bl, BCT_ENEMY ) > 0) { - struct status_change *sc_data = battle_get_sc_data(bl); // check whether the target is hiding/cloaking [celest] - if (sc_data && (sc_data[SC_HIDING].timer != -1 || // if the target is using a special hiding, i.e not using normal hiding/cloaking, don't bother - sc_data[SC_CLOAKING].timer != -1)) { - skill_status_change_end( bl, SC_HIDING, -1); - skill_status_change_end( bl, SC_CLOAKING, -1); - skill_attack(BF_MAGIC,src,src,bl,AL_RUWACH,sc_data[type].val1,tick,0); - } - } - } - break; - } - return 0; -} - -/*========================================== - * ステ?タス異常終了 - *------------------------------------------ - */ -int skill_status_change_end(struct block_list* bl, int type, int tid) -{ - struct status_change* sc_data; - int opt_flag=0, calc_flag = 0; - short *sc_count, *option, *opt1, *opt2, *opt3; - - nullpo_retr(0, bl); - if(bl->type!=BL_PC && bl->type!=BL_MOB) { - if(battle_config.error_log) - printf("skill_status_change_end: neither MOB nor PC !\n"); - return 0; - } - nullpo_retr(0, sc_data = battle_get_sc_data(bl)); - nullpo_retr(0, sc_count = battle_get_sc_count(bl)); - nullpo_retr(0, option = battle_get_option(bl)); - nullpo_retr(0, opt1 = battle_get_opt1(bl)); - nullpo_retr(0, opt2 = battle_get_opt2(bl)); - nullpo_retr(0, opt3 = battle_get_opt3(bl)); - - if ((*sc_count) > 0 && sc_data[type].timer != -1 && (sc_data[type].timer == tid || tid == -1)) { - - if (tid == -1) // タイマから呼ばれていないならタイマ削除をする - delete_timer(sc_data[type].timer,skill_status_change_timer); - - /* 該?の異常を正常に?す */ - sc_data[type].timer=-1; - (*sc_count)--; - - switch(type){ /* 異常の種類ごとの?理 */ - case SC_PROVOKE: /* プロボック */ - case SC_ENDURE: // celest - case SC_CONCENTRATE: /* 集中力向上 */ - case SC_BLESSING: /* ブレッシング */ - case SC_ANGELUS: /* アンゼルス */ - case SC_INCREASEAGI: /* 速度上昇 */ - case SC_DECREASEAGI: /* 速度減少 */ - case SC_SIGNUMCRUCIS: /* シグナムクルシス */ - case SC_HIDING: - case SC_TWOHANDQUICKEN: /* 2HQ */ - case SC_ADRENALINE: /* アドレナリンラッシュ */ - case SC_ENCPOISON: /* エンチャントポイズン */ - case SC_IMPOSITIO: /* インポシティオマヌス */ - case SC_GLORIA: /* グロリア */ - case SC_LOUD: /* ラウドボイス */ - case SC_QUAGMIRE: /* クァグマイア */ - case SC_PROVIDENCE: /* プロヴィデンス */ - case SC_SPEARSQUICKEN: /* スピアクイッケン */ - case SC_VOLCANO: - case SC_DELUGE: - case SC_VIOLENTGALE: - case SC_ETERNALCHAOS: /* エタ?ナルカオス */ - case SC_DRUMBATTLE: /* ?太鼓の響き */ - case SC_NIBELUNGEN: /* ニ?ベルングの指輪 */ - case SC_SIEGFRIED: /* 不死身のジ?クフリ?ド */ - case SC_WHISTLE: /* 口笛 */ - case SC_ASSNCROS: /* 夕陽のアサシンクロス */ - case SC_HUMMING: /* ハミング */ - case SC_DONTFORGETME: /* 私を忘れないで */ - case SC_FORTUNE: /* 幸運のキス */ - case SC_SERVICE4U: /* サ?ビスフォ?ユ? */ - case SC_EXPLOSIONSPIRITS: // 爆裂波動 - case SC_STEELBODY: // 金剛 - case SC_DEFENDER: - case SC_SPEEDPOTION0: /* ?速ポ?ション */ - case SC_SPEEDPOTION1: - case SC_SPEEDPOTION2: - case SC_SPEEDPOTION3: - case SC_APPLEIDUN: /* イドゥンの林檎 */ - case SC_RIDING: - case SC_BLADESTOP_WAIT: - case SC_AURABLADE: /* オ?ラブレ?ド */ - case SC_PARRYING: /* パリイング */ - case SC_CONCENTRATION: /* コンセントレ?ション */ - case SC_TENSIONRELAX: /* テンションリラックス */ - case SC_ASSUMPTIO: /* アシャンプティオ */ - case SC_WINDWALK: /* ウインドウォ?ク */ - case SC_TRUESIGHT: /* トゥル?サイト */ - case SC_SPIDERWEB: /* スパイダ?ウェッブ */ - case SC_MAGICPOWER: /* 魔法力?幅 */ - case SC_CHASEWALK: - case SC_ATKPOT: /* attack potion [Valaris] */ - case SC_MATKPOT: /* magic attack potion [Valaris] */ - case SC_WEDDING: //結婚用(結婚衣裳になって?くのが?いとか) - case SC_MELTDOWN: /* メルトダウン */ - // Celest - case SC_EDP: - case SC_SLOWDOWN: - case SC_SPEEDUP0: -/* case SC_LEADERSHIP: - case SC_GLORYWOUNDS: - case SC_SOULCOLD: - case SC_HAWKEYES:*/ - case SC_BATTLEORDERS: - case SC_REGENERATION: - calc_flag = 1; - break; - case SC_AUTOBERSERK: - if (sc_data[SC_PROVOKE].timer != -1) - skill_status_change_end(bl,SC_PROVOKE,-1); - break; - case SC_BERSERK: /* バ?サ?ク */ - calc_flag = 1; - clif_status_change(bl,SC_INCREASEAGI,0); /* アイコン消去 */ - break; - case SC_DEVOTION: /* ディボ?ション */ - { - struct map_session_data *md = map_id2sd(sc_data[type].val1); - sc_data[type].val1=sc_data[type].val2=0; - skill_devotion(md,bl->id); - calc_flag = 1; - } - break; - case SC_BLADESTOP: - { - struct status_change *t_sc_data = battle_get_sc_data((struct block_list *)sc_data[type].val4); - //片方が切れたので相手の白刃?態が切れてないのなら解除 - if(t_sc_data && t_sc_data[SC_BLADESTOP].timer!=-1) - skill_status_change_end((struct block_list *)sc_data[type].val4,SC_BLADESTOP,-1); - - if(sc_data[type].val2==2) - clif_bladestop((struct block_list *)sc_data[type].val3,(struct block_list *)sc_data[type].val4,0); - } - break; - case SC_DANCING: - { - struct map_session_data *dsd; - struct status_change *d_sc_data; - if(sc_data[type].val4 && (dsd=map_id2sd(sc_data[type].val4))){ - d_sc_data = dsd->sc_data; - //合奏で相手がいる場合相手のval4を0にする - if(d_sc_data && d_sc_data[type].timer!=-1) - d_sc_data[type].val4=0; - } - } - calc_flag = 1; - break; - case SC_GRAFFITI: - { - struct skill_unit_group *sg=(struct skill_unit_group *)sc_data[type].val4; //val4がグラフィティのgroup_id - if(sg) - skill_delunitgroup(sg); - } - break; - case SC_NOCHAT: //チャット禁止?態 - { - struct map_session_data *sd=NULL; - if(bl->type == BL_PC && (sd=(struct map_session_data *)bl)){ - if (sd->status.manner >= 0) // weeee ^^ [celest] - sd->status.manner = 0; - clif_updatestatus(sd,SP_MANNER); - } - } - break; - case SC_SPLASHER: /* ベナムスプラッシャ? */ - { - struct block_list *src=map_id2bl(sc_data[type].val3); - if(src && tid!=-1){ - //自分にダメ?ジ&周?3*3にダメ?ジ - skill_castend_damage_id(src, bl,sc_data[type].val2,sc_data[type].val1,gettick(),0 ); - } - } - break; - case SC_SELFDESTRUCTION: /* 自爆 */ - { - //自分のダメ?ジは0にして - struct mob_data *md=NULL; - if(bl->type == BL_MOB && (md=(struct mob_data*)bl)) - skill_castend_damage_id(bl, bl,sc_data[type].val2,sc_data[type].val1,gettick(),0 ); - } - break; - /* option1 */ - case SC_FREEZE: - sc_data[type].val3 = 0; - break; - - /* option2 */ - case SC_POISON: /* 毒 */ - case SC_BLIND: /* 暗? */ - case SC_CURSE: - calc_flag = 1; - break; - - // celest - case SC_CONFUSION: - { - struct map_session_data *sd=NULL; - if(bl->type == BL_PC && (sd=(struct map_session_data *)bl)){ - sd->next_walktime = -1; - } - } - break; - - case SC_MARIONETTE: /* マリオネットコントロ?ル */ - case SC_MARIONETTE2: /// Marionette target - { - // check for partner and end their marionette status as well - int type2 = (type == SC_MARIONETTE) ? SC_MARIONETTE2 : SC_MARIONETTE; - struct block_list *pbl = map_id2bl(sc_data[type].val3); - if (pbl) { - struct status_change* sc_data; - if (*battle_get_sc_count(pbl) > 0 && - (sc_data = battle_get_sc_data(pbl)) && - sc_data[type2].timer != -1) - skill_status_change_end(pbl, type2, -1); - } - calc_flag = 1; - } - break; - } - - if(bl->type==BL_PC && - (type<SC_SENDMAX || type==SC_PRESERVE || type==SC_BATTLEORDERS)) - clif_status_change(bl,type,0); /* アイコン消去 */ - - switch(type){ /* 正常に?るときなにか?理が必要 */ - case SC_STONE: - case SC_FREEZE: - case SC_STAN: - case SC_SLEEP: - *opt1 = 0; - opt_flag = 1; - break; - - case SC_POISON: - if (sc_data[SC_DPOISON].timer != -1) // - break; // DPOISON用のオプション - *opt2 &= ~1; // が?用に用意された場合には - opt_flag = 1; // ここは削除する - break; // - case SC_CURSE: - case SC_SILENCE: - case SC_BLIND: - *opt2 &= ~(1<<(type-SC_POISON)); - opt_flag = 1; - break; - case SC_DPOISON: - if (sc_data[SC_POISON].timer != -1) // DPOISON用のオプションが - break; // 用意されたら削除 - *opt2 &= ~1; // 毒?態解除 - opt_flag = 1; - break; - case SC_SIGNUMCRUCIS: - *opt2 &= ~0x40; - opt_flag = 1; - break; - - case SC_HIDING: - case SC_CLOAKING: - *option &= ~((type == SC_HIDING) ? 2 : 4); - calc_flag = 1; // orn - opt_flag = 1 ; - break; - - case SC_CHASEWALK: - *option &= ~16388; - opt_flag = 1 ; - break; - - case SC_SIGHT: - *option &= ~1; - opt_flag = 1; - break; - case SC_WEDDING: //結婚用(結婚衣裳になって?くのが?いとか) - *option &= ~4096; - opt_flag = 1; - break; - case SC_RUWACH: - *option &= ~8192; - opt_flag = 1; - break; - - //opt3 - case SC_TWOHANDQUICKEN: /* 2HQ */ - case SC_SPEARSQUICKEN: /* スピアクイッケン */ - case SC_CONCENTRATION: /* コンセントレ?ション */ - *opt3 &= ~1; - break; - case SC_OVERTHRUST: /* オ?バ?スラスト */ - *opt3 &= ~2; - break; - case SC_ENERGYCOAT: /* エナジ?コ?ト */ - *opt3 &= ~4; - break; - case SC_EXPLOSIONSPIRITS: // 爆裂波動 - *opt3 &= ~8; - break; - case SC_STEELBODY: // 金剛 - *opt3 &= ~16; - break; - case SC_BLADESTOP: /* 白刃取り */ - *opt3 &= ~32; - break; - case SC_BERSERK: /* バ?サ?ク */ - *opt3 &= ~128; - break; - case SC_MARIONETTE: /* マリオネットコントロ?ル */ - case SC_MARIONETTE2: - *opt3 &= ~1024; - break; - case SC_ASSUMPTIO: /* アスムプティオ */ - *opt3 &= ~2048; - break; - } - - if (night_flag == 1 && (*opt2 & STATE_BLIND) == 0 && bl->type == BL_PC && // by [Yor] - !map[bl->m].flag.indoors && battle_config.night_darkness_level <= 0) { // [celest] - *opt2 |= STATE_BLIND; - opt_flag = 1; - } - - if(opt_flag) /* optionの?更を?える */ - clif_changeoption(bl); - - if (bl->type == BL_PC && calc_flag) - pc_calcstatus((struct map_session_data *)bl,0); /* ステ?タス再計算 */ - } - - return 0; -} -/*========================================== - * ステ?タス異常終了タイマ? - *------------------------------------------ - */ -int skill_status_change_timer(int tid, unsigned int tick, int id, int data) -{ - int type=data; - struct block_list *bl; - struct map_session_data *sd=NULL; - struct status_change *sc_data; - //short *sc_count; //使ってない? - - nullpo_retr(0, bl=map_id2bl(id)); - nullpo_retr(0, sc_data=battle_get_sc_data(bl)); - - if(bl->type==BL_PC) - nullpo_retr(0, sd=(struct map_session_data *)bl); - - //sc_count=battle_get_sc_count(bl); //使ってない? - - if(sc_data[type].timer != tid) { - if(battle_config.error_log) - printf("skill_status_change_timer %d != %d\n",tid,sc_data[type].timer); - return 0; - } - - switch(type){ /* 特殊な?理になる場合 */ - case SC_MAXIMIZEPOWER: /* マキシマイズパワ? */ - case SC_CLOAKING: - if(sd){ - if( sd->status.sp > 0 ){ /* SP切れるまで持? */ - sd->status.sp--; - clif_updatestatus(sd,SP_SP); - sc_data[type].timer=add_timer( /* タイマ?再設定 */ - sc_data[type].val2+tick, skill_status_change_timer, bl->id, data); - return 0; - } - } - break; - - case SC_CHASEWALK: - if(sd){ - 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[SC_CHASEWALK].val4++; - if (sc_data[SC_CHASEWALK].val4 > 3) - sc_data[SC_CHASEWALK].val4 = 0; - pc_calcstatus (sd, 0); - return 0; - } - } - break; - - case SC_HIDING: /* ハイディング */ - if(sd){ /* SPがあって、時間制限の間は持? */ - if( sd->status.sp > 0 && (--sc_data[type].val2)>0 ){ - if(sc_data[type].val2 % (sc_data[type].val1+3) ==0 ){ - sd->status.sp--; - clif_updatestatus(sd,SP_SP); - } - sc_data[type].timer=add_timer( /* タイマ?再設定 */ - 1000+tick, skill_status_change_timer, - bl->id, data); - return 0; - } - } - break; - - case SC_SIGHT: /* サイト */ - case SC_RUWACH: /* ルアフ */ - { - int range = 5; - if ( type == SC_SIGHT ) range = 7; - map_foreachinarea( skill_status_change_timer_sub, - bl->m, bl->x-range, bl->y-range, bl->x+range,bl->y+range,0, - bl,type,tick); - - if( (--sc_data[type].val2)>0 ){ - sc_data[type].timer=add_timer( /* タイマ?再設定 */ - 250+tick, skill_status_change_timer, - bl->id, data); - return 0; - } - } - break; - - case SC_SIGNUMCRUCIS: /* シグナムクルシス */ - { - int race = battle_get_race(bl); - if(race == 6 || battle_check_undead(race,battle_get_elem_type(bl))) { - sc_data[type].timer=add_timer(1000*600+tick,skill_status_change_timer, bl->id, data ); - return 0; - } - } - break; - - case SC_PROVOKE: /* プロボック/オ?トバ?サ?ク */ - if(sc_data[type].val2!=0){ /* オ?トバ?サ?ク(1秒ごとにHPチェック) */ - if(sd && sd->status.hp>sd->status.max_hp>>2) /* 停止 */ - break; - sc_data[type].timer=add_timer( 1000+tick,skill_status_change_timer, bl->id, data ); - return 0; - } - break; - - case SC_WATERBALL: /* ウォ?タ?ボ?ル */ - { - struct block_list *target=map_id2bl(sc_data[type].val2); - nullpo_retb(target); - nullpo_retb(target->prev); - skill_attack(BF_MAGIC,bl,bl,target,WZ_WATERBALL,sc_data[type].val1,tick,0); - if((--sc_data[type].val3)>0) { - sc_data[type].timer=add_timer( 150+tick,skill_status_change_timer, bl->id, data ); - return 0; - } - } - break; - - case SC_ENDURE: /* インデュア */ - case SC_AUTOBERSERK: // Celest - if(sd && sd->special_state.infinite_endure) { -#ifdef TWILIGHT - sc_data[type].timer=add_timer( 1000*600+tick,skill_status_change_timer, bl->id, data ); -#else - sc_data[type].timer=add_timer( 1000*60+tick,skill_status_change_timer, bl->id, data ); -#endif - //sc_data[type].val2=1; - return 0; - } - break; - - case SC_DISSONANCE: /* 不協和音 */ - if( (--sc_data[type].val2)>0){ - struct skill_unit *unit= - (struct skill_unit *)sc_data[type].val4; - struct block_list *src; - /*if(!unit || !unit->group) - break; - src=map_id2bl(unit->group->src_id); - if(!src) - break;*/ - nullpo_retb(unit); - nullpo_retb(unit->group); - nullpo_retr(0, src=map_id2bl(unit->group->src_id)); - skill_attack(BF_MISC,src,&unit->bl,bl,unit->group->skill_id,sc_data[type].val1,tick,0); - sc_data[type].timer=add_timer(skill_get_time2(unit->group->skill_id,unit->group->skill_lv)+tick, - skill_status_change_timer, bl->id, data ); - return 0; - } - break; - - case SC_LULLABY: /* 子守唄 */ - if( (--sc_data[type].val2)>0){ - struct skill_unit *unit= - (struct skill_unit *)sc_data[type].val4; - nullpo_retb(unit); - nullpo_retb(unit->group); - if(unit->group->src_id == bl->id) - break; - skill_additional_effect(bl,bl,unit->group->skill_id,sc_data[type].val1,BF_LONG|BF_SKILL|BF_MISC,tick); - if (unit->group != 0) - sc_data[type].timer=add_timer(skill_get_time(unit->group->skill_id,unit->group->skill_lv)/10+tick, - skill_status_change_timer, bl->id, data ); - return 0; - } - break; - - case SC_STONE: - if(sc_data[type].val2 != 0) { - short *opt1 = battle_get_opt1(bl); - sc_data[type].val2 = 0; - sc_data[type].val4 = 0; - battle_stopwalking(bl,1); - if(opt1) { - *opt1 = 1; - clif_changeoption(bl); - } - sc_data[type].timer=add_timer(1000+tick,skill_status_change_timer, bl->id, data ); - return 0; - } - else if( (--sc_data[type].val3) > 0) { - int hp = battle_get_max_hp(bl); - if((++sc_data[type].val4)%5 == 0 && battle_get_hp(bl) > hp>>2) { - hp = hp/100; - if(hp < 1) hp = 1; - if(sd) - pc_heal(sd,-hp,0); - else if(bl->type == BL_MOB){ - struct mob_data *md; - if((md=((struct mob_data *)bl)) == NULL) - break; - md->hp -= hp; - } - } - sc_data[type].timer=add_timer(1000+tick,skill_status_change_timer, bl->id, data ); - return 0; - } - break; - case SC_POISON: - if(sc_data[SC_SLOWPOISON].timer == -1) { - if( (--sc_data[type].val3) > 0) { - int hp = battle_get_max_hp(bl); - if(battle_get_hp(bl) > hp>>2) { - if(bl->type == BL_PC) { - hp = 3 + hp*3/200; - pc_heal((struct map_session_data *)bl,-hp,0); - } - else if(bl->type == BL_MOB) { - struct mob_data *md; - nullpo_retr(0, md=(struct mob_data *)bl); - /*if((md=((struct mob_data *)bl)) == NULL) - break;*/ - hp = 3 + hp/200; - md->hp -= hp; - } - } - sc_data[type].timer=add_timer(1000+tick,skill_status_change_timer, bl->id, data ); - } - } - else - sc_data[type].timer=add_timer(1000+tick,skill_status_change_timer, bl->id, data ); - break; - case SC_DPOISON: - if (sc_data[SC_SLOWPOISON].timer == -1 && (--sc_data[type].val3) > 0) { - int hp = battle_get_max_hp(bl); - if (battle_get_hp(bl) > hp>>2) { - if(sd) { - hp = 3 + hp/50; - pc_heal(sd, -hp, 0); - } else if (bl->type == BL_MOB) { - struct mob_data *md; - nullpo_retr(0, md=(struct mob_data *)bl); - /*if ((md=((struct mob_data *)bl)) == NULL) - break;*/ - hp = 3 + hp/100; - md->hp -= hp; - } - } - } - if (sc_data[type].val3 > 0) - sc_data[type].timer=add_timer(1000+tick,skill_status_change_timer, bl->id, data ); - break; - - case SC_TENSIONRELAX: /* テンションリラックス */ - if(sd){ /* SPがあって、HPが?タンでなければ?? */ - if( sd->status.sp > 12 && sd->status.max_hp > sd->status.hp ){ -/* if(sc_data[type].val2 % (sc_data[type].val1+3) ==0 ){ - sd->status.sp -= 12; - clif_updatestatus(sd,SP_SP); - } */ - sc_data[type].timer=add_timer( /* タイマ?再設定 */ - 10000+tick, skill_status_change_timer, - bl->id, data); - return 0; - } - if(sd->status.max_hp <= sd->status.hp) - skill_status_change_end(&sd->bl,SC_TENSIONRELAX,-1); - } - break; - case SC_HEADCRUSH: // temporary damage [celest] -// case SC_BLEEDING: - if((--sc_data[type].val3) > 0) { - int hp = battle_get_max_hp(bl); - if(sd) { - hp = 3 + hp*3/200; - pc_heal(sd,-hp,0); - } - else if(bl->type == BL_MOB) { - struct mob_data *md; - nullpo_retr(0, md=(struct mob_data *)bl); - /*if((md=((struct mob_data *)bl)) == NULL) - break;*/ - hp = 3 + hp/200; - md->hp -= hp; - } - sc_data[type].timer=add_timer(1000+tick,skill_status_change_timer, bl->id, data ); - } - break; - - /* 時間切れ無し?? */ - case SC_AETERNA: - case SC_TRICKDEAD: - case SC_RIDING: - case SC_FALCON: - case SC_WEIGHT50: - case SC_WEIGHT90: - case SC_MAGICPOWER: /* 魔法力?幅 */ - case SC_REJECTSWORD: /* リジェクトソ?ド */ - case SC_MEMORIZE: /* メモライズ */ - case SC_BROKNWEAPON: - case SC_BROKNARMOR: - case SC_SACRIFICE: -// if(sc_data[type].timer==tid) - sc_data[type].timer=add_timer( 1000*600+tick,skill_status_change_timer, bl->id, data ); - return 0; - - case SC_DANCING: //ダンススキルの時間SP消費 - { - int s=0; - if(sd){ - if(sd->status.sp > 0 && (--sc_data[type].val3)>0){ - switch(sc_data[type].val1){ - case BD_RICHMANKIM: /* ニヨルドの宴 3秒にSP1 */ - case BD_DRUMBATTLEFIELD: /* ?太鼓の響き 3秒にSP1 */ - case BD_RINGNIBELUNGEN: /* ニ?ベルングの指輪 3秒にSP1 */ - case BD_SIEGFRIED: /* 不死身のジ?クフリ?ド 3秒にSP1 */ - case BA_DISSONANCE: /* 不協和音 3秒でSP1 */ - case BA_ASSASSINCROSS: /* 夕陽のアサシンクロス 3秒でSP1 */ - case DC_UGLYDANCE: /* 自分勝手なダンス 3秒でSP1 */ - s=3; - break; - case BD_LULLABY: /* 子守歌 4秒にSP1 */ - case BD_ETERNALCHAOS: /* 永遠の混沌 4秒にSP1 */ - case BD_ROKISWEIL: /* ロキの叫び 4秒にSP1 */ - case DC_FORTUNEKISS: /* 幸運のキス 4秒でSP1 */ - s=4; - break; - case BD_INTOABYSS: /* 深淵の中に 5秒にSP1 */ - case BA_WHISTLE: /* 口笛 5秒でSP1 */ - case DC_HUMMING: /* ハミング 5秒でSP1 */ - case BA_POEMBRAGI: /* ブラギの詩 5秒でSP1 */ - case DC_SERVICEFORYOU: /* サ?ビスフォ?ユ? 5秒でSP1 */ - s=5; - break; - case BA_APPLEIDUN: /* イドゥンの林檎 6秒でSP1 */ - s=6; - break; - case DC_DONTFORGETME: /* 私を忘れないで… 10秒でSP1 */ - case CG_MOONLIT: /* 月明りの泉に落ちる花びら 10秒でSP1? */ - s=10; - break; - } - if(s && ((sc_data[type].val3 % s) == 0)){ - sd->status.sp--; - clif_updatestatus(sd,SP_SP); - } - sc_data[type].timer=add_timer( /* タイマ?再設定 */ - 1000+tick, skill_status_change_timer, - bl->id, data); - return 0; - } - } - } - break; - case SC_BERSERK: /* バ?サ?ク */ - if(sd){ /* HPが100以上なら?? */ - if( (sd->status.hp - sd->status.max_hp*5/100) > 100 ){ // 5% every 10 seconds [DracoRPG] - sd->status.hp -= sd->status.max_hp*5/100; // changed to max hp [celest] - clif_updatestatus(sd,SP_HP); - sc_data[type].timer = add_timer( /* タイマ?再設定 */ - 10000+tick, skill_status_change_timer, - bl->id, data); - return 0; - } - } - break; - case SC_WEDDING: //結婚用(結婚衣裳になって?くのが?いとか) - if(sd){ - time_t timer; - if(time(&timer) < ((sc_data[type].val2) + 3600)){ //1時間たっていないので?? - sc_data[type].timer=add_timer( /* タイマ?再設定 */ - 10000+tick, skill_status_change_timer, - bl->id, data); - return 0; - } - } - break; - case SC_NOCHAT: //チャット禁止?態 - if(sd && battle_config.muting_players){ - time_t timer; - if((++sd->status.manner) && time(&timer) < ((sc_data[type].val2) + 60*(0-sd->status.manner))){ //開始からstatus.manner分?ってないので?? - clif_updatestatus(sd,SP_MANNER); - sc_data[type].timer=add_timer( /* タイマ?再設定(60秒) */ - 60000+tick, skill_status_change_timer, - bl->id, data); - return 0; - } - } - break; - case SC_SELFDESTRUCTION: /* 自爆 */ - if(--sc_data[type].val3>0){ - struct mob_data *md; - if(bl->type==BL_MOB && (md=(struct mob_data *)bl) && md->speed > 250){ - md->speed -= 250; - md->next_walktime=tick; - } - sc_data[type].timer=add_timer( /* タイマ?再設定 */ - 1000+tick, skill_status_change_timer, - bl->id, data); - return 0; - } - break; - - case SC_SPLASHER: - if (sc_data[type].val4 % 1000 == 0) { - char timer[2]; - sprintf (timer, "%d", sc_data[type].val4/1000); - clif_message(bl, timer); - } - if((sc_data[type].val4 -= 500) > 0) { - sc_data[type].timer = add_timer( - 500 + tick, skill_status_change_timer, - bl->id, data); - return 0; - } - break; - - case SC_MARIONETTE: /* マリオネットコントロ?ル */ - case SC_MARIONETTE2: - { - struct block_list *pbl = map_id2bl(sc_data[type].val3); - if (pbl && battle_check_range(bl, pbl, 7) && - (sc_data[type].val2 -= 1000)>0) { - sc_data[type].timer = add_timer( - 1000 + tick, skill_status_change_timer, - bl->id, data); - return 0; - } - } - break; - -/* case SC_LEADERSHIP: - case SC_GLORYWOUNDS: - case SC_SOULCOLD: - case SC_HAWKEYES: - if (sd) { - sc_data[type].timer = add_timer( - 1000+tick, skill_status_change_timer, - bl->id, data); - } - break;*/ - - // Celest - case SC_CONFUSION: - { - int i = 3000; - //struct mob_data *md; - if (sd) { - pc_randomwalk (sd, gettick()); - sd->next_walktime = tick + (i=1000 + rand()%1000); - } /*else if (bl->type==BL_MOB && (md=(struct mob_data *)bl) && md->mode&1 && mob_can_move(md)) { - md->state.state=MS_WALK; - if( DIFF_TICK(md->next_walktime,tick) > + 7000 && - (md->walkpath.path_len==0 || md->walkpath.path_pos>=md->walkpath.path_len) ) - md->next_walktime = tick + 3000*rand()%2000; - mob_randomwalk(md,tick); - }*/ - if ((sc_data[type].val2 -= 1000) > 0) { - sc_data[type].timer = add_timer( - i + tick, skill_status_change_timer, - bl->id, data); - return 0; - } - } - break; - - case SC_GOSPEL: - { - int calc_flag = 0; - if (sc_data[type].val3 > 0) { - sc_data[type].val3 = 0; - calc_flag = 1; - } - if(sd && sc_data[type].val4 == BCT_SELF){ - int hp, sp; - hp = (sc_data[type].val1 > 5) ? 45 : 30; - sp = (sc_data[type].val1 > 5) ? 35 : 20; - if(sd->status.hp - hp > 0 && - sd->status.sp - sp > 0){ - sd->status.hp -= hp; - sd->status.sp -= sp; - clif_updatestatus(sd,SP_HP); - clif_updatestatus(sd,SP_SP); - if ((sc_data[type].val2 -= 10000) > 0) { - sc_data[type].timer = add_timer( - 10000+tick, skill_status_change_timer, - bl->id, data); - return 0; - } - } - } else if (sd && sc_data[type].val4 == BCT_PARTY) { - int i; - switch ((i = rand() % 12)) { - case 1: // heal between 100-1000 - { - struct block_list tbl; - int heal = rand() % 900 + 100; - tbl.id = 0; - tbl.m = bl->m; - tbl.x = bl->x; - tbl.y = bl->y; - clif_skill_nodamage(&tbl,bl,AL_HEAL,heal,1); - battle_heal(NULL,bl,heal,0,0); - } - break; - case 2: // end negative status - { - int j; - for (j=0; j<4; j++) - if(sc_data[i + SC_POISON].timer!=-1) { - skill_status_change_end(bl,j,-1); - break; - } - } - break; - case 3: // +25% resistance to negative status - case 4: // +25% max hp - case 5: // +25% max sp - case 6: // +2 to all stats - case 11: // +25% armor and vit def - case 12: // +8% atk - case 13: // +5% flee - case 14: // +5% hit - sc_data[type].val3 = i; - if (i == 6 || - (i >= 11 && i <= 14)) - calc_flag = 1; - break; - case 7: // level 5 bless - { - struct block_list tbl; - tbl.id = 0; - tbl.m = bl->m; - tbl.x = bl->x; - tbl.y = bl->y; - clif_skill_nodamage(&tbl,bl,AL_BLESSING,5,1); - skill_status_change_start(bl,SkillStatusChangeTable[AL_BLESSING],5,0,0,0,10000,0 ); - } - break; - case 8: // level 5 increase agility - { - struct block_list tbl; - tbl.id = 0; - tbl.m = bl->m; - tbl.x = bl->x; - tbl.y = bl->y; - clif_skill_nodamage(&tbl,bl,AL_INCAGI,5,1); - skill_status_change_start(bl,SkillStatusChangeTable[AL_INCAGI],5,0,0,0,10000,0 ); - } - break; - case 9: // holy element to weapon - { - struct block_list tbl; - tbl.id = 0; - tbl.m = bl->m; - tbl.x = bl->x; - tbl.y = bl->y; - clif_skill_nodamage(&tbl,bl,PR_ASPERSIO,1,1); - skill_status_change_start(bl,SkillStatusChangeTable[PR_ASPERSIO],1,0,0,0,10000,0 ); - } - break; - case 10: // holy element to armour - { - struct block_list tbl; - tbl.id = 0; - tbl.m = bl->m; - tbl.x = bl->x; - tbl.y = bl->y; - clif_skill_nodamage(&tbl,bl,PR_BENEDICTIO,1,1); - skill_status_change_start(bl,SkillStatusChangeTable[PR_BENEDICTIO],1,0,0,0,10000,0 ); - } - break; - default: - break; - } - } else if (sc_data[type].val4 == BCT_ENEMY) { - int i; - switch ((i = rand() % 8)) { - case 1: // damage between 300-800 - case 2: // damage between 150-550 (ignore def) - battle_damage(NULL, bl, rand() % 500,0); // temporary damage - break; - case 3: // random status effect - { - int effect[3] = { - SC_CURSE, - SC_BLIND, - SC_POISON }; - skill_status_change_start(bl,effect[rand()%3],1,0,0,0,10000,0 ); - } - break; - case 4: // level 10 provoke - { - struct block_list tbl; - tbl.id = 0; - tbl.m = bl->m; - tbl.x = bl->x; - tbl.y = bl->y; - clif_skill_nodamage(&tbl,bl,SM_PROVOKE,1,1); - skill_status_change_start(bl,SkillStatusChangeTable[SM_PROVOKE],10,0,0,0,10000,0 ); - } - break; - case 5: // 0 def - case 6: // 0 atk - case 7: // 0 flee - case 8: // -75% move speed and aspd - sc_data[type].val3 = i; - calc_flag = 1; - break; - default: - break; - } - } - if (sd && calc_flag) - pc_calcstatus (sd, 0); - } - break; - } - - return skill_status_change_end( bl,type,tid ); -} /*========================================== * ステ?タス異常終了 @@ -9662,979 +8675,20 @@ int skill_encchant_eremental_end(struct block_list *bl,int type) struct status_change *sc_data; nullpo_retr(0, bl); - nullpo_retr(0, sc_data=battle_get_sc_data(bl)); + nullpo_retr(0, sc_data=status_get_sc_data(bl)); if( type!=SC_ENCPOISON && sc_data[SC_ENCPOISON].timer!=-1 ) /* エンチャントポイズン解除 */ - skill_status_change_end(bl,SC_ENCPOISON,-1); + status_change_end(bl,SC_ENCPOISON,-1); if( type!=SC_ASPERSIO && sc_data[SC_ASPERSIO].timer!=-1 ) /* アスペルシオ解除 */ - skill_status_change_end(bl,SC_ASPERSIO,-1); + status_change_end(bl,SC_ASPERSIO,-1); if( type!=SC_FLAMELAUNCHER && sc_data[SC_FLAMELAUNCHER].timer!=-1 ) /* フレイムランチャ解除 */ - skill_status_change_end(bl,SC_FLAMELAUNCHER,-1); + status_change_end(bl,SC_FLAMELAUNCHER,-1); if( type!=SC_FROSTWEAPON && sc_data[SC_FROSTWEAPON].timer!=-1 ) /* フロストウェポン解除 */ - skill_status_change_end(bl,SC_FROSTWEAPON,-1); + status_change_end(bl,SC_FROSTWEAPON,-1); if( type!=SC_LIGHTNINGLOADER && sc_data[SC_LIGHTNINGLOADER].timer!=-1 ) /* ライトニングロ?ダ?解除 */ - skill_status_change_end(bl,SC_LIGHTNINGLOADER,-1); + status_change_end(bl,SC_LIGHTNINGLOADER,-1); if( type!=SC_SEISMICWEAPON && sc_data[SC_SEISMICWEAPON].timer!=-1 ) /* サイスミックウェポン解除 */ - skill_status_change_end(bl,SC_SEISMICWEAPON,-1); - - return 0; -} -/*========================================== - * ステ?タス異常開始 - *------------------------------------------ - */ -int skill_status_change_start(struct block_list *bl, int type, int val1, int val2, int val3, int val4, int tick, int flag) -{ - struct map_session_data *sd = NULL; - struct status_change* sc_data; - short *sc_count, *option, *opt1, *opt2, *opt3; - int opt_flag = 0, calc_flag = 0,updateflag = 0, save_flag = 0, race, mode, elem, undead_flag; - int scdef=0; - - nullpo_retr(0, bl); - if(bl->type == BL_SKILL) - return 0; - nullpo_retr(0, sc_data=battle_get_sc_data(bl)); - nullpo_retr(0, sc_count=battle_get_sc_count(bl)); - nullpo_retr(0, option=battle_get_option(bl)); - nullpo_retr(0, opt1=battle_get_opt1(bl)); - nullpo_retr(0, opt2=battle_get_opt2(bl)); - nullpo_retr(0, opt3=battle_get_opt3(bl)); - - - race=battle_get_race(bl); - mode=battle_get_mode(bl); - elem=battle_get_elem_type(bl); - undead_flag=battle_check_undead(race,elem); - - if(type == SC_AETERNA && (sc_data[SC_STONE].timer != -1 || sc_data[SC_FREEZE].timer != -1) ) - return 0; - - switch(type){ - case SC_STONE: - case SC_FREEZE: - scdef=3+battle_get_mdef(bl)+battle_get_luk(bl)/3; - break; - case SC_STAN: - case SC_SILENCE: - case SC_POISON: - case SC_DPOISON: - scdef=3+battle_get_vit(bl)+battle_get_luk(bl)/3; - break; - case SC_SLEEP: - case SC_BLIND: - scdef=3+battle_get_int(bl)+battle_get_luk(bl)/3; - break; - case SC_CURSE: - scdef=3+battle_get_luk(bl); - break; - -// case SC_CONFUSION: - default: - scdef=0; - } - if(scdef>=100) - return 0; - if(bl->type==BL_PC){ - sd=(struct map_session_data *)bl; - if( sd && type == SC_ADRENALINE && !(skill_get_weapontype(BS_ADRENALINE)&(1<<sd->status.weapon))) - return 0; - - if(SC_STONE<=type && type<=SC_BLIND){ /* カ?ドによる耐性 */ - if( sd && sd->reseff[type-SC_STONE] > 0 && rand()%10000<sd->reseff[type-SC_STONE]){ - if(battle_config.battle_log) - printf("PC %d skill_sc_start: cardによる異常耐性?動\n",sd->bl.id); - return 0; - } - } - } - else if(bl->type == BL_MOB) { - } - else { - if(battle_config.error_log) - printf("skill_status_change_start: neither MOB nor PC !\n"); - return 0; - } - - if(type==SC_FREEZE && undead_flag && !(flag&1)) - return 0; - - if((type == SC_ADRENALINE || type == SC_WEAPONPERFECTION || type == SC_OVERTHRUST) && - sc_data[type].timer != -1 && sc_data[type].val2 && !val2) - return 0; - - if(mode & 0x20 && (type==SC_STONE || type==SC_FREEZE || - type==SC_STAN || type==SC_SLEEP || type==SC_SILENCE || type==SC_QUAGMIRE || type == SC_DECREASEAGI || type == SC_SIGNUMCRUCIS || type == SC_PROVOKE || - (type == SC_BLESSING && (undead_flag || race == 6))) && !(flag&1)){ - /* ボスには?かない(ただしカ?ドによる?果は適用される) */ - return 0; - } - if(type==SC_FREEZE || type==SC_STAN || type==SC_SLEEP) - battle_stopwalking(bl,1); - - if(sc_data[type].timer != -1){ /* すでに同じ異常になっている場合タイマ解除 */ - if(sc_data[type].val1 > val1 && type != SC_COMBO && type != SC_DANCING && type != SC_DEVOTION && - type != SC_SPEEDPOTION0 && type != SC_SPEEDPOTION1 && type != SC_SPEEDPOTION2 && type != SC_SPEEDPOTION3 - && type != SC_ATKPOT && type != SC_MATKPOT) // added atk and matk potions [Valaris] - return 0; - if ((type >=SC_STAN && type <= SC_BLIND) || type == SC_DPOISON) - return 0;/* ?ぎ足しができない?態異常である時は?態異常を行わない */ - if(type == SC_GRAFFITI){ //異常中にもう一度?態異常になった時に解除してから再度かかる - skill_status_change_end(bl,type,-1); - } else { - (*sc_count)--; - delete_timer(sc_data[type].timer, skill_status_change_timer); - sc_data[type].timer = -1; - } - } - - switch(type){ /* 異常の種類ごとの?理 */ - case SC_PROVOKE: /* プロボック */ - calc_flag = 1; - if(tick <= 0) tick = 1000; /* (オ?トバ?サ?ク) */ - break; - case SC_ENDURE: /* インデュア */ - if(tick <= 0) tick = 1000 * 60; - calc_flag = 1; // for updating mdef - val2 = 7; // [Celest] - break; - case SC_AUTOBERSERK: - { - tick = 60*1000; - if (bl->type == BL_PC && sd->status.hp<sd->status.max_hp>>2 && - (sc_data[SC_PROVOKE].timer==-1 || sc_data[SC_PROVOKE].val2==0)) - skill_status_change_start(bl,SC_PROVOKE,10,1,0,0,0,0); - } - break; - case SC_CONCENTRATE: /* 集中力向上 */ - calc_flag = 1; - break; - case SC_BLESSING: /* ブレッシング */ - { - if(bl->type == BL_PC || (!undead_flag && race != 6)) { - if(sc_data[SC_CURSE].timer!=-1 ) - skill_status_change_end(bl,SC_CURSE,-1); - if(sc_data[SC_STONE].timer!=-1 && sc_data[SC_STONE].val2 == 0) - skill_status_change_end(bl,SC_STONE,-1); - } - calc_flag = 1; - } - break; - case SC_ANGELUS: /* アンゼルス */ - calc_flag = 1; - break; - case SC_INCREASEAGI: /* 速度上昇 */ - calc_flag = 1; - if(sc_data[SC_DECREASEAGI].timer!=-1 ) - skill_status_change_end(bl,SC_DECREASEAGI,-1); - // the effect will still remain [celest] -// if(sc_data[SC_WINDWALK].timer!=-1 ) /* ウインドウォ?ク */ -// skill_status_change_end(bl,SC_WINDWALK,-1); - break; - case SC_DECREASEAGI: /* 速度減少 */ - if (bl->type == BL_PC) // Celest - tick>>=1; - calc_flag = 1; - if(sc_data[SC_INCREASEAGI].timer!=-1 ) - skill_status_change_end(bl,SC_INCREASEAGI,-1); - if(sc_data[SC_ADRENALINE].timer!=-1 ) - skill_status_change_end(bl,SC_ADRENALINE,-1); - if(sc_data[SC_SPEARSQUICKEN].timer!=-1 ) - skill_status_change_end(bl,SC_SPEARSQUICKEN,-1); - if(sc_data[SC_TWOHANDQUICKEN].timer!=-1 ) - skill_status_change_end(bl,SC_TWOHANDQUICKEN,-1); - break; - case SC_SIGNUMCRUCIS: /* シグナムクルシス */ - calc_flag = 1; -// val2 = 14 + val1; - val2 = 10 + val1*2; - tick = 600*1000; - clif_emotion(bl,4); - break; - case SC_SLOWPOISON: - if (sc_data[SC_POISON].timer == -1 && sc_data[SC_DPOISON].timer == -1) - return 0; - break; - case SC_TWOHANDQUICKEN: /* 2HQ */ - if(sc_data[SC_DECREASEAGI].timer!=-1) - return 0; - *opt3 |= 1; - calc_flag = 1; - break; - case SC_ADRENALINE: /* アドレナリンラッシュ */ - if(sc_data[SC_DECREASEAGI].timer!=-1) - return 0; - calc_flag = 1; - break; - case SC_WEAPONPERFECTION: /* ウェポンパ?フェクション */ - // Lasting time penalties have been removed on sakray as of 12/14 [celest] - //if(battle_config.party_skill_penalty && !val2) tick /= 5; - break; - case SC_OVERTHRUST: /* オ?バ?スラスト */ - *opt3 |= 2; - // Lasting time penalties have been removed on sakray as of 12/14 [celest] - //if(battle_config.party_skill_penalty && !val2) tick /= 10; - break; - case SC_MAXIMIZEPOWER: /* マキシマイズパワ?(SPが1減る時間,val2にも) */ - if(bl->type == BL_PC) - val2 = tick; - else - tick = 5000*val1; - break; - case SC_ENCPOISON: /* エンチャントポイズン */ - calc_flag = 1; - val2=(((val1 - 1) / 2) + 3)*100; /* 毒付?確率 */ - skill_encchant_eremental_end(bl,SC_ENCPOISON); - break; - case SC_EDP: // [Celest] - val2 = val1 + 2; /* 猛毒付?確率(%) */ - calc_flag = 1; - break; - case SC_POISONREACT: /* ポイズンリアクト */ - val2=val1/2 + val1%2; // [Celest] - break; - case SC_IMPOSITIO: /* インポシティオマヌス */ - calc_flag = 1; - break; - case SC_ASPERSIO: /* アスペルシオ */ - skill_encchant_eremental_end(bl,SC_ASPERSIO); - break; - case SC_SUFFRAGIUM: /* サフラギム */ - case SC_BENEDICTIO: /* 聖? */ - case SC_MAGNIFICAT: /* マグニフィカ?ト */ - case SC_AETERNA: /* エ?テルナ */ - break; - case SC_ENERGYCOAT: /* エナジ?コ?ト */ - *opt3 |= 4; - break; - case SC_MAGICROD: - val2 = val1*20; - break; - case SC_KYRIE: /* キリエエレイソン */ - val2 = battle_get_max_hp(bl) * (val1 * 2 + 10) / 100;/* 耐久度 */ - val3 = (val1 / 2 + 5); /* 回? */ -// -- moonsoul (added to undo assumptio status if target has it) - if(sc_data[SC_ASSUMPTIO].timer!=-1 ) - skill_status_change_end(bl,SC_ASSUMPTIO,-1); - break; - case SC_MINDBREAKER: - calc_flag = 1; - if(tick <= 0) tick = 1000; /* (オ?トバ?サ?ク) */ - case SC_GLORIA: /* グロリア */ - calc_flag = 1; - break; - case SC_LOUD: /* ラウドボイス */ - calc_flag = 1; - break; - case SC_TRICKDEAD: /* 死んだふり */ - if (bl->type == BL_PC) { - pc_stopattack((struct map_session_data *)sd); - } - break; - case SC_QUAGMIRE: /* クァグマイア */ - calc_flag = 1; - if(sc_data[SC_CONCENTRATE].timer!=-1 ) /* 集中力向上解除 */ - skill_status_change_end(bl,SC_CONCENTRATE,-1); - if(sc_data[SC_INCREASEAGI].timer!=-1 ) /* 速度上昇解除 */ - skill_status_change_end(bl,SC_INCREASEAGI,-1); - if(sc_data[SC_TWOHANDQUICKEN].timer!=-1 ) - skill_status_change_end(bl,SC_TWOHANDQUICKEN,-1); - if(sc_data[SC_SPEARSQUICKEN].timer!=-1 ) - skill_status_change_end(bl,SC_SPEARSQUICKEN,-1); - if(sc_data[SC_ADRENALINE].timer!=-1 ) - skill_status_change_end(bl,SC_ADRENALINE,-1); - if(sc_data[SC_LOUD].timer!=-1 ) - skill_status_change_end(bl,SC_LOUD,-1); - if(sc_data[SC_TRUESIGHT].timer!=-1 ) /* トゥル?サイト */ - skill_status_change_end(bl,SC_TRUESIGHT,-1); - if(sc_data[SC_WINDWALK].timer!=-1 ) /* ウインドウォ?ク */ - skill_status_change_end(bl,SC_WINDWALK,-1); - if(sc_data[SC_CARTBOOST].timer!=-1 ) /* カ?トブ?スト */ - skill_status_change_end(bl,SC_CARTBOOST,-1); - break; - case SC_MAGICPOWER: - calc_flag = 1; - val2 = 1; - break; - case SC_SACRIFICE: - val2 = 5; - break; - case SC_FLAMELAUNCHER: /* フレ?ムランチャ? */ - skill_encchant_eremental_end(bl,SC_FLAMELAUNCHER); - break; - case SC_FROSTWEAPON: /* フロストウェポン */ - skill_encchant_eremental_end(bl,SC_FROSTWEAPON); - break; - case SC_LIGHTNINGLOADER: /* ライトニングロ?ダ? */ - skill_encchant_eremental_end(bl,SC_LIGHTNINGLOADER); - break; - case SC_SEISMICWEAPON: /* サイズミックウェポン */ - skill_encchant_eremental_end(bl,SC_SEISMICWEAPON); - break; - case SC_DEVOTION: /* ディボ?ション */ - calc_flag = 1; - break; - case SC_PROVIDENCE: /* プロヴィデンス */ - calc_flag = 1; - val2=val1*5; - break; - case SC_REFLECTSHIELD: - val2=10+val1*3; - break; - case SC_STRIPWEAPON: - if (val2==0) val2=90; - break; - case SC_STRIPSHIELD: - if (val2==0) val2=85; - break; - case SC_STRIPARMOR: - case SC_STRIPHELM: - case SC_CP_WEAPON: - case SC_CP_SHIELD: - case SC_CP_ARMOR: - case SC_CP_HELM: - break; - - case SC_AUTOSPELL: /* オ?トスペル */ - val4 = 5 + val1*2; - break; - - case SC_VOLCANO: - calc_flag = 1; - val3 = val1*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 ) ) ); - break; - case SC_VIOLENTGALE: - calc_flag = 1; - val3 = val1*3; - val4 = val1>=5?20: (val1==4?19: (val1==3?17: ( val1==2?14:10 ) ) ); - break; - - case SC_SPEARSQUICKEN: /* スピアクイッケン */ - calc_flag = 1; - val2 = 20+val1; - *opt3 |= 1; - break; - case SC_COMBO: - break; - case SC_BLADESTOP_WAIT: /* 白刃取り(待ち) */ - break; - case SC_BLADESTOP: /* 白刃取り */ - if(val2==2) clif_bladestop((struct block_list *)val3,(struct block_list *)val4,1); - *opt3 |= 32; - break; - - case SC_LULLABY: /* 子守唄 */ - val2 = 11; - break; - case SC_RICHMANKIM: - break; - case SC_ETERNALCHAOS: /* エタ?ナルカオス */ - calc_flag = 1; - break; - case SC_DRUMBATTLE: /* ?太鼓の響き */ - calc_flag = 1; - val2 = (val1+1)*25; - val3 = (val1+1)*2; - break; - case SC_NIBELUNGEN: /* ニ?ベルングの指輪 */ - calc_flag = 1; - //val2 = (val1+2)*50; - val3 = (val1+2)*25; - break; - case SC_ROKISWEIL: /* ロキの叫び */ - break; - case SC_INTOABYSS: /* 深淵の中に */ - break; - case SC_SIEGFRIED: /* 不死身のジ?クフリ?ド */ - calc_flag = 1; - val2 = 55 + val1*5; - val3 = val1*10; - break; - case SC_DISSONANCE: /* 不協和音 */ - val2 = 10; - break; - case SC_WHISTLE: /* 口笛 */ - calc_flag = 1; - break; - case SC_ASSNCROS: /* 夕陽のアサシンクロス */ - calc_flag = 1; - break; - case SC_POEMBRAGI: /* ブラギの詩 */ - break; - case SC_APPLEIDUN: /* イドゥンの林檎 */ - calc_flag = 1; - break; - case SC_UGLYDANCE: /* 自分勝手なダンス */ - val2 = 10; - break; - case SC_HUMMING: /* ハミング */ - calc_flag = 1; - break; - case SC_DONTFORGETME: /* 私を忘れないで */ - calc_flag = 1; - if(sc_data[SC_INCREASEAGI].timer!=-1 ) /* 速度上昇解除 */ - skill_status_change_end(bl,SC_INCREASEAGI,-1); - if(sc_data[SC_TWOHANDQUICKEN].timer!=-1 ) - skill_status_change_end(bl,SC_TWOHANDQUICKEN,-1); - if(sc_data[SC_SPEARSQUICKEN].timer!=-1 ) - skill_status_change_end(bl,SC_SPEARSQUICKEN,-1); - if(sc_data[SC_ADRENALINE].timer!=-1 ) - skill_status_change_end(bl,SC_ADRENALINE,-1); - if(sc_data[SC_ASSNCROS].timer!=-1 ) - skill_status_change_end(bl,SC_ASSNCROS,-1); - if(sc_data[SC_TRUESIGHT].timer!=-1 ) /* トゥル?サイト */ - skill_status_change_end(bl,SC_TRUESIGHT,-1); - if(sc_data[SC_WINDWALK].timer!=-1 ) /* ウインドウォ?ク */ - skill_status_change_end(bl,SC_WINDWALK,-1); - if(sc_data[SC_CARTBOOST].timer!=-1 ) /* カ?トブ?スト */ - skill_status_change_end(bl,SC_CARTBOOST,-1); - break; - case SC_FORTUNE: /* 幸運のキス */ - calc_flag = 1; - break; - case SC_SERVICE4U: /* サ?ビスフォ?ユ? */ - calc_flag = 1; - break; - case SC_MOONLIT: - val2 = bl->id; - break; - case SC_DANCING: /* ダンス/演奏中 */ - calc_flag = 1; - val3= tick / 1000; - tick = 1000; - break; - - case SC_EXPLOSIONSPIRITS: // 爆裂波動 - calc_flag = 1; - val2 = 75 + 25*val1; - *opt3 |= 8; - break; - case SC_STEELBODY: // 金剛 - calc_flag = 1; - *opt3 |= 16; - break; - case SC_EXTREMITYFIST: /* 阿修羅覇凰拳 */ - break; - case SC_AUTOCOUNTER: - val3 = val4 = 0; - break; - - case SC_SPEEDPOTION0: /* ?速ポ?ション */ - case SC_SPEEDPOTION1: - case SC_SPEEDPOTION2: - case SC_SPEEDPOTION3: - calc_flag = 1; - tick = 1000 * tick; - val2 = 5*(2+type-SC_SPEEDPOTION0); - break; - - /* atk & matk potions [Valaris] */ - case SC_ATKPOT: - case SC_MATKPOT: - calc_flag = 1; - tick = 1000 * tick; - break; - case SC_WEDDING: //結婚用(結婚衣裳になって?くのが?いとか) - { - time_t timer; - - calc_flag = 1; - tick = 10000; - if(!val2) - val2 = time(&timer); - } - break; - case SC_NOCHAT: //チャット禁止?態 - { - time_t timer; - - if(!battle_config.muting_players) - break; - - tick = 60000; - if(!val2) - val2 = time(&timer); - updateflag = SP_MANNER; - save_flag = 1; // celest - } - break; - case SC_SELFDESTRUCTION: //自爆 - clif_skillcasting(bl,bl->id, bl->id,0,0,331,skill_get_time(val2,val1)); - val3 = tick / 1000; - tick = 1000; - break; - - /* option1 */ - case SC_STONE: /* 石化 */ - if(!(flag&2)) { - int sc_def = battle_get_mdef(bl)*200; - tick = tick - sc_def; - } - val3 = tick/1000; - if(val3 < 1) val3 = 1; - tick = 5000; - val2 = 1; - break; - case SC_SLEEP: /* 睡眠 */ - if(!(flag&2)) { -// int sc_def = 100 - (battle_get_int(bl) + battle_get_luk(bl)/3); -// tick = tick * sc_def / 100; -// if(tick < 1000) tick = 1000; - tick = 30000;//睡眠はステ?タス耐性に?わらず30秒 - } - break; - case SC_FREEZE: /* 凍結 */ - if(!(flag&2)) { - int sc_def = 100 - battle_get_mdef(bl); - tick = tick * sc_def / 100; - } - break; - case SC_STAN: /* スタン(val2にミリ秒セット) */ - if(!(flag&2)) { - int sc_def = 100 - (battle_get_vit(bl) + battle_get_luk(bl)/3); - tick = tick * sc_def / 100; - } - break; - - /* option2 */ - case SC_DPOISON: /* 猛毒 */ - { - int mhp = battle_get_max_hp(bl); - int hp = battle_get_hp(bl); - // MHP?1/4???????? - if (hp > mhp>>2) { - if(bl->type == BL_PC) { - int diff = mhp*10/100; - if (hp - diff < mhp>>2) - hp = hp - (mhp>>2); - pc_heal((struct map_session_data *)bl, -hp, 0); - } else if(bl->type == BL_MOB) { - struct mob_data *md = (struct mob_data *)bl; - hp -= mhp*15/100; - if (hp > mhp>>2) - md->hp = hp; - else - md->hp = mhp>>2; - } - } - } // fall through - case SC_POISON: /* 毒 */ - calc_flag = 1; - if(!(flag&2)) { - int sc_def = 100 - (battle_get_vit(bl) + battle_get_luk(bl)/5); - tick = tick * sc_def / 100; - } - val3 = tick/1000; - if(val3 < 1) val3 = 1; - tick = 1000; - break; - case SC_SILENCE: /* 沈?(レックスデビ?ナ) */ - if(!(flag&2)) { - int sc_def = 100 - battle_get_vit(bl); - tick = tick * sc_def / 100; - } - break; - case SC_CONFUSION: - val2 = tick; - tick = 100; - clif_emotion(bl,1); - if (sd) { - pc_stop_walking (sd, 0); - } - break; - case SC_BLIND: /* 暗? */ - calc_flag = 1; - if(!(flag&2)) { - int sc_def = battle_get_lv(bl)/10 + battle_get_int(bl)/15; - tick = 30000 - sc_def; - } - break; - case SC_CURSE: - calc_flag = 1; - if(!(flag&2)) { - int sc_def = 100 - battle_get_vit(bl); - tick = tick * sc_def / 100; - } - break; - - /* option */ - case SC_HIDING: /* ハイディング */ - calc_flag = 1; - if(bl->type == BL_PC) { - val2 = tick / 1000; /* 持?時間 */ - tick = 1000; - } - break; - case SC_CHASEWALK: - case SC_CLOAKING: /* クロ?キング */ - if(bl->type == BL_PC) { - calc_flag = 1; // [Celest] - val2 = tick; - val3 = type==SC_CLOAKING ? 130-val1*3 : 135-val1*5; - } - else - tick = 5000*val1; - break; - case SC_SIGHT: /* サイト/ルアフ */ - case SC_RUWACH: - val2 = tick/250; - tick = 10; - break; - - /* セ?フティウォ?ル、ニュ?マ */ - case SC_SAFETYWALL: case SC_PNEUMA: - tick=((struct skill_unit *)val2)->group->limit; - break; - - /* アンクル */ - case SC_ANKLE: - break; - - /* ウォ?タ?ボ?ル */ - case SC_WATERBALL: - tick=150; - if(val1>5) //レベルが5以上の場合は25?に制限(1?目はすでに打ってるので-1) - val3=5*5-1; - else - val3= (val1|1)*(val1|1)-1; - break; - - /* スキルじゃない/時間に?係しない */ - case SC_RIDING: - calc_flag = 1; - tick = 600*1000; - break; - case SC_FALCON: - case SC_WEIGHT50: - case SC_WEIGHT90: - case SC_BROKNWEAPON: - case SC_BROKNARMOR: - tick=600*1000; - break; - - case SC_AUTOGUARD: - { - int i,t; - for(i=val2=0;i<val1;i++) { - t = 5-(i>>1); - val2 += (t < 0)? 1:t; - } - } - break; - - case SC_DEFENDER: - calc_flag = 1; - val2 = 5 + val1*15; - break; - - case SC_KEEPING: - case SC_BARRIER: - calc_flag = 1; - - case SC_HALLUCINATION: - break; - - case SC_CONCENTRATION: /* コンセントレ?ション */ - *opt3 |= 1; - calc_flag = 1; - break; - - case SC_TENSIONRELAX: /* テンションリラックス */ - calc_flag = 1; - if(bl->type == BL_PC) { - tick = 10000; - } - break; - - case SC_AURABLADE: /* オ?ラブレ?ド */ - case SC_PARRYING: /* パリイング */ -// case SC_ASSUMPTIO: /* */ - case SC_HEADCRUSH: /* ヘッドクラッシュ */ - case SC_JOINTBEAT: /* ジョイントビ?ト */ -// case SC_MARIONETTE: /* マリオネットコントロ?ル */ - - //とりあえず手?き - break; - -// -- moonsoul (for new upper class related skill status effects) -/* - case SC_AURABLADE: - val2 = val1*10; - break; - case SC_PARRYING: - val2=val1*3; - break; - case SC_CONCENTRATION: - calc_flag=1; - val2=val1*10; - val3=val1*5; - break; - case SC_TENSIONRELAX: -// val2 = 10; -// val3 = 15; - break; - case SC_BERSERK: - calc_flag=1; - break; - case SC_ASSUMPTIO: - if(sc_data[SC_KYRIE].timer!=-1 ) - skill_status_change_end(bl,SC_KYRIE,-1); - break;*/ - - case SC_WINDWALK: /* ウインドウォ?ク */ - calc_flag = 1; - val2 = (val1 / 2); //Flee上昇率 - break; - - case SC_BERSERK: /* バ?サ?ク */ - if(sd){ - sd->status.hp = sd->status.max_hp * 3; - sd->status.sp = 0; - clif_updatestatus(sd,SP_HP); - clif_updatestatus(sd,SP_SP); - clif_status_change(bl,SC_INCREASEAGI,1); /* アイコン表示 */ - sd->canregen_tick = gettick() + 300000; - } - *opt3 |= 128; - tick = 10000; - calc_flag = 1; - break; - - case SC_ASSUMPTIO: /* アスムプティオ */ - if(sc_data[SC_KYRIE].timer!=-1 ) - skill_status_change_end(bl,SC_KYRIE,-1); - break; - *opt3 |= 2048; - break; - - case SC_BASILICA: // [celest] - break; - - case SC_GOSPEL: - if (val4 == BCT_SELF) { // self effect - int i; - if (sd) { - sd->canact_tick += tick; - sd->canmove_tick += tick; - } - val2 = tick; - tick = 1000; - for (i=0; i<=26; i++) { - if(sc_data[i].timer!=-1) - skill_status_change_end(bl,i,-1); - } - for (i=58; i<=62; i++) { - if(sc_data[i].timer!=-1) - skill_status_change_end(bl,i,-1); - } - for (i=132; i<=136; i++) { - if(sc_data[i].timer!=-1) - skill_status_change_end(bl,i,-1); - } - } - break; - - case SC_MARIONETTE: /* マリオネットコントロ?ル */ - case SC_MARIONETTE2: - val2 = tick; - if (!val3) - return 0; - tick = 1000; - calc_flag = 1; - *opt3 |= 1024; - break; - - case SC_MELTDOWN: /* メルトダウン */ - case SC_CARTBOOST: /* カ?トブ?スト */ - case SC_TRUESIGHT: /* トゥル?サイト */ - case SC_SPIDERWEB: /* スパイダ?ウェッブ */ - calc_flag = 1; - break; - - case SC_REJECTSWORD: /* リジェクトソ?ド */ - val2 = 3; //3回攻?を跳ね返す - break; - - case SC_MEMORIZE: /* メモライズ */ - val2 = 3; //3回詠唱を1/3にする - break; - - case SC_GRAFFITI: /* グラフィティ */ - { - struct skill_unit_group *sg = skill_unitsetting(bl,RG_GRAFFITI,val1,val2,val3,0); - if(sg) - val4 = (int)sg; - } - break; - - case SC_SPLASHER: /* ベナムスプラッシャ? */ - break; - - case SC_FOGWALL: - val2 = 75; - // calc_flag = 1; // not sure of effects yet [celest] - break; - - case SC_PRESERVE: - break; - - case SC_BLOCKSKILL: - if (!tick) tick = 60000; - if (!val3) val3 = -1; - break; - - case SC_SLOWDOWN: - case SC_SPEEDUP0: - calc_flag = 1; - break; - - case SC_REGENERATION: - val1 = 2; - case SC_BATTLEORDERS: - tick = 60000; // 1 minute - calc_flag = 1; - break; - - default: - if(battle_config.error_log) - printf("UnknownStatusChange [%d]\n", type); - return 0; - } - - if(bl->type==BL_PC && - (type<SC_SENDMAX || type==SC_PRESERVE || type==SC_BATTLEORDERS)) - clif_status_change(bl,type,1); /* アイコン表示 */ - - /* optionの?更 */ - switch(type){ - case SC_STONE: - case SC_FREEZE: - case SC_STAN: - case SC_SLEEP: - battle_stopattack(bl); /* 攻?停止 */ - skill_stop_dancing(bl,0); /* 演奏/ダンスの中? */ - { /* 同時に掛からないステ?タス異常を解除 */ - int i; - for(i = SC_STONE; i <= SC_SLEEP; i++){ - if(sc_data[i].timer != -1){ - (*sc_count)--; - delete_timer(sc_data[i].timer, skill_status_change_timer); - sc_data[i].timer = -1; - } - } - } - if(type == SC_STONE) - *opt1 = 6; - else - *opt1 = type - SC_STONE + 1; - opt_flag = 1; - break; - case SC_POISON: - case SC_CURSE: - case SC_SILENCE: - case SC_BLIND: - *opt2 |= 1<<(type-SC_POISON); - opt_flag = 1; - break; - case SC_DPOISON: // 暫定で毒のエフェクトを使用 - *opt2 |= 1; - opt_flag = 1; - break; - case SC_SIGNUMCRUCIS: - *opt2 |= 0x40; - opt_flag = 1; - break; - case SC_HIDING: - case SC_CLOAKING: - battle_stopattack(bl); /* 攻?停止 */ - *option |= ((type==SC_HIDING)?2:4); - opt_flag =1 ; - break; - case SC_CHASEWALK: - battle_stopattack(bl); /* 攻?停止 */ - *option |= 16388; - opt_flag =1 ; - break; - case SC_SIGHT: - *option |= 1; - opt_flag = 1; - break; - case SC_RUWACH: - *option |= 8192; - opt_flag = 1; - break; - case SC_WEDDING: - *option |= 4096; - opt_flag = 1; - } - - if(opt_flag) /* optionの?更 */ - clif_changeoption(bl); - - (*sc_count)++; /* ステ?タス異常の? */ - - sc_data[type].val1 = val1; - sc_data[type].val2 = val2; - sc_data[type].val3 = val3; - sc_data[type].val4 = val4; - /* タイマ?設定 */ - sc_data[type].timer = add_timer( - gettick() + tick, skill_status_change_timer, bl->id, type); - - if(bl->type==BL_PC && calc_flag) - pc_calcstatus(sd,0); /* ステ?タス再計算 */ - - if(bl->type==BL_PC && save_flag) - chrif_save(sd); // save the player status - - if(bl->type==BL_PC && updateflag) - clif_updatestatus(sd,updateflag); /* ステ?タスをクライアントに送る */ - - return 0; -} -/*========================================== - * ステ?タス異常全解除 - *------------------------------------------ - */ -int skill_status_change_clear(struct block_list *bl, int type) -{ - struct status_change* sc_data; - short *sc_count, *option, *opt1, *opt2, *opt3; - int i; - - nullpo_retr(0, bl); - nullpo_retr(0, sc_data = battle_get_sc_data(bl)); - nullpo_retr(0, sc_count = battle_get_sc_count(bl)); - nullpo_retr(0, option = battle_get_option(bl)); - nullpo_retr(0, opt1 = battle_get_opt1(bl)); - nullpo_retr(0, opt2 = battle_get_opt2(bl)); - nullpo_retr(0, opt3 = battle_get_opt3(bl)); - - if (*sc_count == 0) - return 0; - for(i = 0; i < MAX_STATUSCHANGE; i++){ - if(sc_data[i].timer != -1){ /* 異常があるならタイマ?を削除する */ - skill_status_change_end(bl, i, -1); - } - } - *sc_count = 0; - *opt1 = 0; - *opt2 = 0; - *opt3 = 0; - *option &= OPTION_MASK; - - if (night_flag == 1 && type == BL_PC && !map[bl->m].flag.indoors && // by [Yor] - !map[bl->m].flag.indoors && battle_config.night_darkness_level <= 0) // [celest] - *opt2 |= STATE_BLIND; - - if(!type || type&2) - clif_changeoption(bl); + status_change_end(bl,SC_SEISMICWEAPON,-1); return 0; } @@ -10663,18 +8717,18 @@ int skill_check_cloaking(struct block_list *bl) } if(end){ if ((bl->type == BL_PC && pc_checkskill(sd,AS_CLOAKING)<3) || bl->type == BL_MOB) { - skill_status_change_end(bl, SC_CLOAKING, -1); - *battle_get_option(bl)&=~4; /* 念のための?理 */ + status_change_end(bl, SC_CLOAKING, -1); + *status_get_option(bl)&=~4; /* 念のための?理 */ } else if (bl->type == BL_PC && sd->sc_data[SC_CLOAKING].val3 != 130) { sd->sc_data[SC_CLOAKING].val3 = 130; - pc_calcspeed (sd); + status_calc_speed (sd); } } else { if (bl->type == BL_PC && sd->sc_data[SC_CLOAKING].val3 != 103) { sd->sc_data[SC_CLOAKING].val3 = 103; - pc_calcspeed (sd); + status_calc_speed (sd); } } return end; @@ -10760,8 +8814,8 @@ void skill_stop_dancing(struct block_list *src, int flag) short* sc_count; nullpo_retv(src); - nullpo_retv(sc_data = battle_get_sc_data(src)); - nullpo_retv(sc_count = battle_get_sc_count(src)); + nullpo_retv(sc_data = status_get_sc_data(src)); + nullpo_retv(sc_count = status_get_sc_count(src)); if((*sc_count)>0 && sc_data[SC_DANCING].timer != -1) { group=(struct skill_unit_group *)sc_data[SC_DANCING].val2; //ダンスのスキルユニットIDはval2に入ってる @@ -10780,15 +8834,15 @@ void skill_stop_dancing(struct block_list *src, int flag) if(flag&2) //ハエ飛びなど return; //合奏もダンス?態も終了させない&スキルユニットは置いてけぼり } - skill_status_change_end(src,SC_DANCING,-1);//自分のステ?タスを終了させる + status_change_end(src,SC_DANCING,-1);//自分のステ?タスを終了させる //そしてグル?プは消さない&消さないのでステ?タス計算もいらない? return; }else{ if(dsd && src->id == group->src_id){ //グル?プを持ってるPCが止める - skill_status_change_end((struct block_list *)dsd,SC_DANCING,-1);//相手のステ?タスを終了させる + status_change_end((struct block_list *)dsd,SC_DANCING,-1);//相手のステ?タスを終了させる } if(dsd && dsd->bl.id == group->src_id){ //相方がグル?プを持っているPCが止める(自分はグル?プを持っていない) - skill_status_change_end(src,SC_DANCING,-1);//自分のステ?タスを終了させる + status_change_end(src,SC_DANCING,-1);//自分のステ?タスを終了させる } } } @@ -10799,7 +8853,7 @@ void skill_stop_dancing(struct block_list *src, int flag) } skill_delunitgroup(group); if(src->type==BL_PC) - pc_calcstatus((struct map_session_data *)src,0); + status_calc_pc((struct map_session_data *)src,0); } } @@ -10917,8 +8971,8 @@ struct skill_unit_group *skill_initunitgroup(struct block_list *src, } group->src_id=src->id; - group->party_id=battle_get_party_id(src); - group->guild_id=battle_get_guild_id(src); + group->party_id=status_get_party_id(src); + group->guild_id=status_get_guild_id(src); group->group_id=skill_unit_group_newid++; if(skill_unit_group_newid<=0) skill_unit_group_newid=10; @@ -10941,7 +8995,7 @@ struct skill_unit_group *skill_initunitgroup(struct block_list *src, sd->skillid_dance=skillid; sd->skilllv_dance=skilllv; } - skill_status_change_start(src,SC_DANCING,skillid,(int)group,0,0,skill_get_time(skillid,skilllv)+1000,0); + status_change_start(src,SC_DANCING,skillid,(int)group,0,0,skill_get_time(skillid,skilllv)+1000,0); switch(skillid){ //合奏スキルは相方をダンス?態にする case BD_LULLABY: /* 子守歌 */ case BD_RICHMANKIM: /* ニヨルドの宴 */ @@ -10983,7 +9037,7 @@ int skill_delunitgroup(struct skill_unit_group *group) src=map_id2bl(group->src_id); if( skill_is_danceskill(group->skill_id) ){ //ダンススキルはダンス?態を解除する if(src) - skill_status_change_end(src,SC_DANCING,-1); + status_change_end(src,SC_DANCING,-1); } group->alive_count=0; @@ -12382,7 +10436,6 @@ int do_init_skill(void) add_timer_func_list(skill_castend_id,"skill_castend_id"); add_timer_func_list(skill_castend_pos,"skill_castend_pos"); add_timer_func_list(skill_timerskill,"skill_timerskill"); - add_timer_func_list(skill_status_change_timer,"skill_status_change_timer"); add_timer_interval(gettick()+SKILLUNITTIMER_INVERVAL,skill_unit_timer,0,0,SKILLUNITTIMER_INVERVAL); return 0; diff --git a/src/map/skill.h b/src/map/skill.h index 44ea5ca22..9187b0d67 100644 --- a/src/map/skill.h +++ b/src/map/skill.h @@ -145,7 +145,7 @@ void skill_devotion2(struct block_list *bl,int crusader); int skill_devotion3(struct block_list *bl,int target); void skill_devotion_end(struct map_session_data *md,struct map_session_data *sd,int target); -#define skill_calc_heal(bl,skill_lv) (( battle_get_lv(bl)+battle_get_int(bl) )/8 *(4+ skill_lv*8)) +#define skill_calc_heal(bl,skill_lv) (( status_get_lv(bl)+status_get_int(bl) )/8 *(4+ skill_lv*8)) // その他 int skill_check_cloaking(struct block_list *bl); @@ -153,11 +153,7 @@ int skill_type_cloaking(struct block_list *bl); int skill_is_danceskill(int id); // ステ?タス異常 -int skill_status_change_start(struct block_list *bl,int type,int val1,int val2,int val3,int val4,int tick,int flag); -int skill_status_change_timer(int tid, unsigned int tick, int id, int data); int skill_encchant_eremental_end(struct block_list *bl, int type); -int skill_status_change_end( struct block_list* bl , int type,int tid ); -int skill_status_change_clear(struct block_list *bl,int type); int skillnotok(int skillid, struct map_session_data *sd); // アイテム作成 diff --git a/src/map/status.c b/src/map/status.c new file mode 100644 index 000000000..f3c022fe0 --- /dev/null +++ b/src/map/status.c @@ -0,0 +1,4699 @@ +
+// ステータス計算、状態異常処理
+#include <time.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <memory.h>
+
+#include "pc.h"
+#include "map.h"
+#include "pet.h"
+#include "mob.h"
+#include "clif.h"
+#include "guild.h"
+#include "skill.h"
+#include "itemdb.h"
+#include "battle.h"
+#include "chrif.h"
+#include "status.h"
+
+#include "timer.h"
+#include "nullpo.h"
+#include "script.h"
+#include "showmsg.h"
+
+static int max_weight_base[MAX_PC_CLASS];
+static int hp_coefficient[MAX_PC_CLASS];
+static int hp_coefficient2[MAX_PC_CLASS];
+static int hp_sigma_val[MAX_PC_CLASS][MAX_LEVEL];
+static int sp_coefficient[MAX_PC_CLASS];
+static int aspd_base[MAX_PC_CLASS][20];
+static int refinebonus[5][3]; // 精錬ボーナステーブル(refine_db.txt)
+int percentrefinery[5][10]; // 精錬成功率(refine_db.txt)
+static int atkmods[3][20]; // 武器ATKサイズ修正(size_fix.txt)
+static char job_bonus[3][MAX_PC_CLASS][MAX_LEVEL];
+
+/*==========================================
+ * 精錬ボーナス
+ *------------------------------------------
+ */
+int status_getrefinebonus(int lv,int type)
+{
+ if (lv >= 0 && lv < 5 && type >= 0 && type < 3)
+ return refinebonus[lv][type];
+ return 0;
+}
+
+/*==========================================
+ * 精錬成功率
+ *------------------------------------------
+ */
+int status_percentrefinery(struct map_session_data *sd,struct item *item)
+{
+ int percent;
+
+ nullpo_retr(0, item);
+ percent=percentrefinery[itemdb_wlv(item->nameid)][(int)item->refine];
+
+ percent += pc_checkskill(sd,BS_WEAPONRESEARCH); // 武器研究スキル所持
+
+ // 確率の有効範囲チェック
+ if( percent > 100 ){
+ percent = 100;
+ }
+ if( percent < 0 ){
+ percent = 0;
+ }
+
+ return percent;
+}
+
+/*==========================================
+ * パラメータ計算
+ * first==0の時、計算対象のパラメータが呼び出し前から
+ * 変 化した場合自動でsendするが、
+ * 能動的に変化させたパラメータは自前でsendするように
+ *------------------------------------------
+ */
+
+int status_calc_pc(struct map_session_data* sd,int first)
+{
+ int b_speed,b_max_hp,b_max_sp,b_hp,b_sp,b_weight,b_max_weight,b_paramb[6],b_parame[6],b_hit,b_flee;
+ int b_aspd,b_watk,b_def,b_watk2,b_def2,b_flee2,b_critical,b_attackrange,b_matk1,b_matk2,b_mdef,b_mdef2,b_class;
+ int b_base_atk;
+ struct skill b_skill[MAX_SKILL];
+ int i,bl,index;
+ int skill,aspd_rate,wele,wele_,def_ele,refinedef=0;
+ int pele=0,pdef_ele=0;
+ int str,dstr,dex;
+ struct pc_base_job s_class;
+
+ nullpo_retr(0, sd);
+
+ //?生や養子の場合の元の職業を算出する
+ s_class = pc_calc_base_job(sd->status.class_);
+
+ b_speed = sd->speed;
+ b_max_hp = sd->status.max_hp;
+ b_max_sp = sd->status.max_sp;
+ b_hp = sd->status.hp;
+ b_sp = sd->status.sp;
+ b_weight = sd->weight;
+ b_max_weight = sd->max_weight;
+ memcpy(b_paramb,&sd->paramb,sizeof(b_paramb));
+ memcpy(b_parame,&sd->paramc,sizeof(b_parame));
+ memcpy(b_skill,&sd->status.skill,sizeof(b_skill));
+ b_hit = sd->hit;
+ b_flee = sd->flee;
+ b_aspd = sd->aspd;
+ b_watk = sd->watk;
+ b_def = sd->def;
+ b_watk2 = sd->watk2;
+ b_def2 = sd->def2;
+ b_flee2 = sd->flee2;
+ b_critical = sd->critical;
+ b_attackrange = sd->attackrange;
+ b_matk1 = sd->matk1;
+ b_matk2 = sd->matk2;
+ b_mdef = sd->mdef;
+ b_mdef2 = sd->mdef2;
+ b_class = sd->view_class;
+ sd->view_class = sd->status.class_;
+ b_base_atk = sd->base_atk;
+
+ pc_calc_skilltree(sd); // スキルツリ?の計算
+
+ sd->max_weight = max_weight_base[s_class.job]+sd->status.str*300;
+
+ if(first&1) {
+ sd->weight=0;
+ for(i=0;i<MAX_INVENTORY;i++){
+ if(sd->status.inventory[i].nameid==0 || sd->inventory_data[i] == NULL)
+ continue;
+ sd->weight += sd->inventory_data[i]->weight*sd->status.inventory[i].amount;
+ }
+ sd->cart_max_weight=battle_config.max_cart_weight;
+ sd->cart_weight=0;
+ sd->cart_max_num=MAX_CART;
+ sd->cart_num=0;
+ for(i=0;i<MAX_CART;i++){
+ if(sd->status.cart[i].nameid==0)
+ continue;
+ sd->cart_weight+=itemdb_weight(sd->status.cart[i].nameid)*sd->status.cart[i].amount;
+ sd->cart_num++;
+ }
+ }
+
+ memset(sd->paramb,0,sizeof(sd->paramb));
+ memset(sd->parame,0,sizeof(sd->parame));
+ sd->hit = 0;
+ sd->flee = 0;
+ sd->flee2 = 0;
+ sd->critical = 0;
+ sd->aspd = 0;
+ sd->watk = 0;
+ sd->def = 0;
+ sd->mdef = 0;
+ sd->watk2 = 0;
+ sd->def2 = 0;
+ sd->mdef2 = 0;
+ sd->status.max_hp = 0;
+ sd->status.max_sp = 0;
+ sd->attackrange = 0;
+ sd->attackrange_ = 0;
+ sd->atk_ele = 0;
+ sd->def_ele = 0;
+ sd->star =0;
+ sd->overrefine =0;
+ sd->matk1 =0;
+ sd->matk2 =0;
+ sd->speed = DEFAULT_WALK_SPEED ;
+ sd->hprate=battle_config.hp_rate;
+ sd->sprate=battle_config.sp_rate;
+ sd->castrate=100;
+ sd->delayrate=100;
+ sd->dsprate=100;
+ sd->base_atk=0;
+ sd->arrow_atk=0;
+ sd->arrow_ele=0;
+ sd->arrow_hit=0;
+ sd->arrow_range=0;
+ sd->nhealhp=sd->nhealsp=sd->nshealhp=sd->nshealsp=sd->nsshealhp=sd->nsshealsp=0;
+ memset(sd->addele,0,sizeof(sd->addele));
+ memset(sd->addrace,0,sizeof(sd->addrace));
+ memset(sd->addsize,0,sizeof(sd->addsize));
+ memset(sd->addele_,0,sizeof(sd->addele_));
+ memset(sd->addrace_,0,sizeof(sd->addrace_));
+ memset(sd->addsize_,0,sizeof(sd->addsize_));
+ memset(sd->subele,0,sizeof(sd->subele));
+ memset(sd->subrace,0,sizeof(sd->subrace));
+ memset(sd->addeff,0,sizeof(sd->addeff));
+ memset(sd->addeff2,0,sizeof(sd->addeff2));
+ memset(sd->reseff,0,sizeof(sd->reseff));
+ memset(&sd->special_state,0,sizeof(sd->special_state));
+ memset(sd->weapon_coma_ele,0,sizeof(sd->weapon_coma_ele));
+ memset(sd->weapon_coma_race,0,sizeof(sd->weapon_coma_race));
+ memset(sd->weapon_atk,0,sizeof(sd->weapon_atk));
+ memset(sd->weapon_atk_rate,0,sizeof(sd->weapon_atk_rate));
+
+ sd->watk_ = 0; //二刀流用(?)
+ sd->watk_2 = 0;
+ sd->atk_ele_ = 0;
+ sd->star_ = 0;
+ sd->overrefine_ = 0;
+
+ sd->aspd_rate = 100;
+ sd->speed_rate = 100;
+ sd->hprecov_rate = 100;
+ sd->sprecov_rate = 100;
+ sd->critical_def = 0;
+ sd->double_rate = 0;
+ sd->near_attack_def_rate = sd->long_attack_def_rate = 0;
+ sd->atk_rate = sd->matk_rate = 100;
+ sd->ignore_def_ele = sd->ignore_def_race = 0;
+ sd->ignore_def_ele_ = sd->ignore_def_race_ = 0;
+ sd->ignore_mdef_ele = sd->ignore_mdef_race = 0;
+ sd->arrow_cri = 0;
+ sd->magic_def_rate = sd->misc_def_rate = 0;
+ memset(sd->arrow_addele,0,sizeof(sd->arrow_addele));
+ memset(sd->arrow_addrace,0,sizeof(sd->arrow_addrace));
+ memset(sd->arrow_addsize,0,sizeof(sd->arrow_addsize));
+ memset(sd->arrow_addeff,0,sizeof(sd->arrow_addeff));
+ memset(sd->arrow_addeff2,0,sizeof(sd->arrow_addeff2));
+ memset(sd->magic_addele,0,sizeof(sd->magic_addele));
+ memset(sd->magic_addrace,0,sizeof(sd->magic_addrace));
+ memset(sd->magic_subrace,0,sizeof(sd->magic_subrace));
+ sd->perfect_hit = 0;
+ sd->critical_rate = sd->hit_rate = sd->flee_rate = sd->flee2_rate = 100;
+ sd->def_rate = sd->def2_rate = sd->mdef_rate = sd->mdef2_rate = 100;
+ sd->def_ratio_atk_ele = sd->def_ratio_atk_ele_ = 0;
+ sd->def_ratio_atk_race = sd->def_ratio_atk_race_ = 0;
+ sd->get_zeny_num = 0;
+ sd->add_damage_class_count = sd->add_damage_class_count_ = sd->add_magic_damage_class_count = 0;
+ sd->add_def_class_count = sd->add_mdef_class_count = 0;
+ sd->monster_drop_item_count = 0;
+ memset(sd->add_damage_classrate,0,sizeof(sd->add_damage_classrate));
+ memset(sd->add_damage_classrate_,0,sizeof(sd->add_damage_classrate_));
+ memset(sd->add_magic_damage_classrate,0,sizeof(sd->add_magic_damage_classrate));
+ memset(sd->add_def_classrate,0,sizeof(sd->add_def_classrate));
+ memset(sd->add_mdef_classrate,0,sizeof(sd->add_mdef_classrate));
+ memset(sd->monster_drop_race,0,sizeof(sd->monster_drop_race));
+ memset(sd->monster_drop_itemrate,0,sizeof(sd->monster_drop_itemrate));
+ sd->speed_add_rate = sd->aspd_add_rate = 100;
+ sd->double_add_rate = sd->perfect_hit_add = sd->get_zeny_add_num = 0;
+ sd->splash_range = sd->splash_add_range = 0;
+ sd->autospell_id = sd->autospell_lv = sd->autospell_rate = 0;
+ sd->hp_drain_rate = sd->hp_drain_per = sd->sp_drain_rate = sd->sp_drain_per = 0;
+ sd->hp_drain_rate_ = sd->hp_drain_per_ = sd->sp_drain_rate_ = sd->sp_drain_per_ = 0;
+ sd->short_weapon_damage_return = sd->long_weapon_damage_return = 0;
+ sd->magic_damage_return = 0; //AppleGirl Was Here
+ sd->random_attack_increase_add = sd->random_attack_increase_per = 0;
+ sd->hp_drain_value = sd->hp_drain_value_ = sd->sp_drain_value = sd->sp_drain_value_ = 0;
+ sd->unbreakable_equip = 0;
+
+
+ if(!sd->disguiseflag && sd->disguise) {
+ sd->disguise=0;
+ clif_changelook(&sd->bl,LOOK_WEAPON,sd->status.weapon);
+ clif_changelook(&sd->bl,LOOK_SHIELD,sd->status.shield);
+ clif_changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom);
+ clif_changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top);
+ clif_changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid);
+ clif_clearchar(&sd->bl, 9);
+ pc_setpos(sd, sd->mapname, sd->bl.x, sd->bl.y, 3);
+ }
+
+ for(i=0;i<10;i++) {
+ index = sd->equip_index[i];
+ if(index < 0)
+ continue;
+ if(i == 9 && sd->equip_index[8] == index)
+ continue;
+ if(i == 5 && sd->equip_index[4] == index)
+ continue;
+ if(i == 6 && (sd->equip_index[5] == index || sd->equip_index[4] == index))
+ continue;
+
+ if(sd->inventory_data[index]) {
+ if(sd->inventory_data[index]->type == 4) {
+ if(sd->status.inventory[index].card[0]!=0x00ff && sd->status.inventory[index].card[0]!=0x00fe && sd->status.inventory[index].card[0]!=(short)0xff00) {
+ int j;
+ for(j=0;j<sd->inventory_data[index]->slot;j++){ // カ?ド
+ int c=sd->status.inventory[index].card[j];
+ if(c>0){
+ if(i == 8 && sd->status.inventory[index].equip == 0x20)
+ sd->state.lr_flag = 1;
+ run_script(itemdb_equipscript(c),0,sd->bl.id,0);
+ sd->state.lr_flag = 0;
+ }
+ }
+ }
+ }
+ else if(sd->inventory_data[index]->type==5){ // 防具
+ if(sd->status.inventory[index].card[0]!=0x00ff && sd->status.inventory[index].card[0]!=0x00fe && sd->status.inventory[index].card[0]!=(short)0xff00) {
+ int j;
+ for(j=0;j<sd->inventory_data[index]->slot;j++){ // カ?ド
+ int c=sd->status.inventory[index].card[j];
+ if(c>0)
+ run_script(itemdb_equipscript(c),0,sd->bl.id,0);
+ }
+ }
+ }
+ }
+ }
+ wele = sd->atk_ele;
+ wele_ = sd->atk_ele_;
+ def_ele = sd->def_ele;
+ if(sd->status.pet_id > 0) {
+ struct pet_data *pd=sd->pd;
+ if((pd && battle_config.pet_status_support==1) && (battle_config.pet_equip_required==0 || (battle_config.pet_equip_required && pd->equip > 0))) {
+ if(sd->status.pet_id > 0 && sd->petDB && sd->pet.intimate > 0)
+ run_script(sd->petDB->script,0,sd->bl.id,0);
+ pele = sd->atk_ele;
+ pdef_ele = sd->def_ele;
+ sd->atk_ele = sd->def_ele = 0;
+ }
+ }
+ memcpy(sd->paramcard,sd->parame,sizeof(sd->paramcard));
+
+ // ?備品によるステ?タス?化はここで?行
+ for(i=0;i<10;i++) {
+ index = sd->equip_index[i];
+ if(index < 0)
+ continue;
+ if(i == 9 && sd->equip_index[8] == index)
+ continue;
+ if(i == 5 && sd->equip_index[4] == index)
+ continue;
+ if(i == 6 && (sd->equip_index[5] == index || sd->equip_index[4] == index))
+ continue;
+ if(sd->inventory_data[index]) {
+ sd->def += sd->inventory_data[index]->def;
+ if(sd->inventory_data[index]->type == 4) {
+ int r,wlv = sd->inventory_data[index]->wlv;
+ if(i == 8 && sd->status.inventory[index].equip == 0x20) {
+ //二刀流用デ?タ入力
+ sd->watk_ += sd->inventory_data[index]->atk;
+ sd->watk_2 = (r=sd->status.inventory[index].refine)* // 精?攻?力
+ refinebonus[wlv][0];
+ if( (r-=refinebonus[wlv][2])>0 ) // 過?精?ボ?ナス
+ sd->overrefine_ = r*refinebonus[wlv][1];
+
+ if(sd->status.inventory[index].card[0]==0x00ff){ // 製造武器
+ sd->star_ = (sd->status.inventory[index].card[1]>>8); // 星のかけら
+ wele_= (sd->status.inventory[index].card[1]&0x0f); // ? 性
+ }
+ sd->attackrange_ += sd->inventory_data[index]->range;
+ sd->state.lr_flag = 1;
+ run_script(sd->inventory_data[index]->equip_script,0,sd->bl.id,0);
+ sd->state.lr_flag = 0;
+ }
+ else { //二刀流武器以外
+ sd->watk += sd->inventory_data[index]->atk;
+ sd->watk2 += (r=sd->status.inventory[index].refine)* // 精?攻?力
+ refinebonus[wlv][0];
+ if( (r-=refinebonus[wlv][2])>0 ) // 過?精?ボ?ナス
+ sd->overrefine += r*refinebonus[wlv][1];
+
+ if(sd->status.inventory[index].card[0]==0x00ff){ // 製造武器
+ sd->star += (sd->status.inventory[index].card[1]>>8); // 星のかけら
+ wele = (sd->status.inventory[index].card[1]&0x0f); // ? 性
+ }
+ sd->attackrange += sd->inventory_data[index]->range;
+ run_script(sd->inventory_data[index]->equip_script,0,sd->bl.id,0);
+ }
+ }
+ else if(sd->inventory_data[index]->type == 5) {
+ sd->watk += sd->inventory_data[index]->atk;
+ refinedef += sd->status.inventory[index].refine*refinebonus[0][0];
+ run_script(sd->inventory_data[index]->equip_script,0,sd->bl.id,0);
+ }
+ }
+ }
+
+ if(sd->equip_index[10] >= 0){ // 矢
+ index = sd->equip_index[10];
+ if(sd->inventory_data[index]){ //まだ?性が入っていない
+ sd->state.lr_flag = 2;
+ run_script(sd->inventory_data[index]->equip_script,0,sd->bl.id,0);
+ sd->state.lr_flag = 0;
+ sd->arrow_atk += sd->inventory_data[index]->atk;
+ }
+ }
+ sd->def += (refinedef+50)/100;
+
+ if(sd->attackrange < 1) sd->attackrange = 1;
+ if(sd->attackrange_ < 1) sd->attackrange_ = 1;
+ if(sd->attackrange < sd->attackrange_)
+ sd->attackrange = sd->attackrange_;
+ if(sd->status.weapon == 11)
+ sd->attackrange += sd->arrow_range;
+ if(wele > 0)
+ sd->atk_ele = wele;
+ if(wele_ > 0)
+ sd->atk_ele_ = wele_;
+ if(def_ele > 0)
+ sd->def_ele = def_ele;
+ if(battle_config.pet_status_support) {
+ if(pele > 0 && !sd->atk_ele)
+ sd->atk_ele = pele;
+ if(pdef_ele > 0 && !sd->def_ele)
+ sd->def_ele = pdef_ele;
+ }
+ sd->double_rate += sd->double_add_rate;
+ sd->perfect_hit += sd->perfect_hit_add;
+ sd->get_zeny_num += sd->get_zeny_add_num;
+ sd->splash_range += sd->splash_add_range;
+ if(sd->speed_add_rate != 100)
+ sd->speed_rate += sd->speed_add_rate - 100;
+ if(sd->aspd_add_rate != 100)
+ sd->aspd_rate += sd->aspd_add_rate - 100;
+
+ // 武器ATKサイズ補正 (右手)
+ sd->atkmods[0] = atkmods[0][sd->weapontype1];
+ sd->atkmods[1] = atkmods[1][sd->weapontype1];
+ sd->atkmods[2] = atkmods[2][sd->weapontype1];
+ //武器ATKサイズ補正 (左手)
+ sd->atkmods_[0] = atkmods[0][sd->weapontype2];
+ sd->atkmods_[1] = atkmods[1][sd->weapontype2];
+ sd->atkmods_[2] = atkmods[2][sd->weapontype2];
+
+ // jobボ?ナス分
+ for(i=0;i<sd->status.job_level && i<MAX_LEVEL;i++){
+ if(job_bonus[s_class.upper][s_class.job][i])
+ sd->paramb[job_bonus[s_class.upper][s_class.job][i]-1]++;
+ }
+
+ if( (skill=pc_checkskill(sd,MC_INCCARRY))>0 ) // skill can be used with an item now, thanks to orn [Valaris]
+ sd->max_weight += skill*2000;
+
+ if( (skill=pc_checkskill(sd,AC_OWL))>0 ) // ふくろうの目
+ sd->paramb[4] += skill;
+
+ if((skill=pc_checkskill(sd,BS_HILTBINDING))>0) { // Hilt binding gives +1 str +4 atk
+ sd->paramb[0] ++;
+ sd->base_atk += 4;
+ }
+ if((skill=pc_checkskill(sd,SA_DRAGONOLOGY))>0 ){ // Dragonology increases +1 int every 2 levels
+ sd->paramb[3] += (skill+1)*0.5;
+ }
+
+ // New guild skills - Celest
+ if (sd->status.guild_id > 0 && !(first&4)) {
+ struct guild *g;
+ if ((g = guild_search(sd->status.guild_id)) && strcmp(sd->status.name,g->master)==0) {
+ if (!sd->state.leadership_flag && guild_checkskill(g, GD_LEADERSHIP)>0) {
+ skill_unitsetting(&sd->bl,GD_LEADERSHIP,1,sd->bl.x,sd->bl.y,0);
+ }
+ if (!sd->state.glorywounds_flag && guild_checkskill(g, GD_GLORYWOUNDS)>0) {
+ skill_unitsetting(&sd->bl,GD_GLORYWOUNDS,1,sd->bl.x,sd->bl.y,0);
+ }
+ if (!sd->state.soulcold_flag && guild_checkskill(g, GD_SOULCOLD)>0) {
+ skill_unitsetting(&sd->bl,GD_SOULCOLD,1,sd->bl.x,sd->bl.y,0);
+ }
+ if (!sd->state.hawkeyes_flag && guild_checkskill(g, GD_HAWKEYES)>0) {
+ skill_unitsetting(&sd->bl,GD_HAWKEYES,1,sd->bl.x,sd->bl.y,0);
+ }
+ }
+ else if (g) {
+ if (sd->sc_count && sd->sc_data[SC_BATTLEORDERS].timer != -1) {
+ sd->paramb[0]+= 5;
+ sd->paramb[3]+= 5;
+ sd->paramb[4]+= 5;
+ }
+ if (sd->state.leadership_flag)
+ sd->paramb[0] += 2;
+ if (sd->state.glorywounds_flag)
+ sd->paramb[2] += 2;
+ if (sd->state.soulcold_flag)
+ sd->paramb[1] += 2;
+ if (sd->state.hawkeyes_flag)
+ sd->paramb[4] += 2;
+ }
+ }
+
+ // ステ?タス?化による基本パラメ?タ補正
+ if(sd->sc_count){
+ if(sd->sc_data[SC_CONCENTRATE].timer!=-1 && sd->sc_data[SC_QUAGMIRE].timer == -1){ // 集中力向上
+ sd->paramb[1]+= (sd->status.agi+sd->paramb[1]+sd->parame[1]-sd->paramcard[1])*(2+sd->sc_data[SC_CONCENTRATE].val1)/100;
+ sd->paramb[4]+= (sd->status.dex+sd->paramb[4]+sd->parame[4]-sd->paramcard[4])*(2+sd->sc_data[SC_CONCENTRATE].val1)/100;
+ }
+ if(sd->sc_data[SC_INCREASEAGI].timer!=-1 && sd->sc_data[SC_QUAGMIRE].timer == -1 && sd->sc_data[SC_DONTFORGETME].timer == -1){ // 速度?加
+ sd->paramb[1]+= 2+sd->sc_data[SC_INCREASEAGI].val1;
+ sd->speed -= sd->speed *25/100;
+ }
+ if(sd->sc_data[SC_DECREASEAGI].timer!=-1) // 速度減少(agiはbattle.cで)
+ sd->speed = sd->speed *125/100;
+ 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;
+ }
+ 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_SLOWDOWN].timer!=-1)
+ sd->speed = sd->speed*150/100;
+ if(sd->sc_data[SC_SPEEDUP0].timer!=-1)
+ sd->speed -= sd->speed*25/100;
+ 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;
+ sd->paramb[4]+= sd->sc_data[SC_BLESSING].val1;
+ }
+ if(sd->sc_data[SC_GLORIA].timer!=-1) // グロリア
+ sd->paramb[5]+= 30;
+ if(sd->sc_data[SC_LOUD].timer!=-1 && sd->sc_data[SC_QUAGMIRE].timer == -1) // ラウドボイス
+ sd->paramb[0]+= 4;
+ if(sd->sc_data[SC_QUAGMIRE].timer!=-1){ // クァグマイア
+ //int agib = (sd->status.agi+sd->paramb[1]+sd->parame[1])*(sd->sc_data[SC_QUAGMIRE].val1*10)/100;
+ //int dexb = (sd->status.dex+sd->paramb[4]+sd->parame[4])*(sd->sc_data[SC_QUAGMIRE].val1*10)/100;
+ //sd->paramb[1]-= agib > 50 ? 50 : agib;
+ //sd->paramb[4]-= dexb > 50 ? 50 : dexb;
+ sd->paramb[1]-= sd->sc_data[SC_QUAGMIRE].val1*5;
+ sd->paramb[4]-= sd->sc_data[SC_QUAGMIRE].val1*5;
+ sd->speed = sd->speed*3/2;
+ }
+ if(sd->sc_data[SC_TRUESIGHT].timer!=-1){ // トゥル?サイト
+ sd->paramb[0]+= 5;
+ sd->paramb[1]+= 5;
+ sd->paramb[2]+= 5;
+ sd->paramb[3]+= 5;
+ sd->paramb[4]+= 5;
+ sd->paramb[5]+= 5;
+ }
+ if(sd->sc_data[SC_MARIONETTE].timer!=-1){
+ struct map_session_data *psd = map_id2sd(sd->sc_data[SC_MARIONETTE2].val3);
+ if (psd) { // if partner is found
+ sd->paramb[0]-= sd->status.str/2; // bonuses not included
+ sd->paramb[1]-= sd->status.agi/2;
+ sd->paramb[2]-= sd->status.vit/2;
+ sd->paramb[3]-= sd->status.int_/2;
+ sd->paramb[4]-= sd->status.dex/2;
+ sd->paramb[5]-= sd->status.luk/2;
+ }
+ }
+ else if(sd->sc_data[SC_MARIONETTE2].timer!=-1){
+ struct map_session_data *psd = map_id2sd(sd->sc_data[SC_MARIONETTE2].val3);
+ if (psd) { // if partner is found
+ sd->paramb[0] += sd->status.str+psd->status.str/2 > 99 ? 99-sd->status.str : psd->status.str/2;
+ sd->paramb[1] += sd->status.agi+psd->status.agi/2 > 99 ? 99-sd->status.agi : psd->status.agi/2;
+ sd->paramb[2] += sd->status.vit+psd->status.vit/2 > 99 ? 99-sd->status.vit : psd->status.vit/2;
+ sd->paramb[3] += sd->status.int_+psd->status.int_/2 > 99 ? 99-sd->status.int_ : psd->status.int_/2;
+ sd->paramb[4] += sd->status.dex+psd->status.dex/2 > 99 ? 99-sd->status.dex : psd->status.dex/2;
+ sd->paramb[5] += sd->status.luk+psd->status.luk/2 > 99 ? 99-sd->status.luk : psd->status.luk/2;
+ }
+ }
+ if(sd->sc_data[SC_GOSPEL].timer!=-1 && sd->sc_data[SC_GOSPEL].val4 == BCT_PARTY){
+ if (sd->sc_data[SC_GOSPEL].val3 == 6) {
+ sd->paramb[0]+= 2;
+ sd->paramb[1]+= 2;
+ sd->paramb[2]+= 2;
+ sd->paramb[3]+= 2;
+ sd->paramb[4]+= 2;
+ sd->paramb[5]+= 2;
+ }
+ }
+ }
+
+ //1度も死んでないJob70スパノビに+10
+ if(s_class.job == 23 && sd->die_counter == 0 && sd->status.job_level >= 70){
+ sd->paramb[0]+= 15;
+ sd->paramb[1]+= 15;
+ sd->paramb[2]+= 15;
+ sd->paramb[3]+= 15;
+ sd->paramb[4]+= 15;
+ sd->paramb[5]+= 15;
+ }
+ sd->paramc[0]=sd->status.str+sd->paramb[0]+sd->parame[0];
+ sd->paramc[1]=sd->status.agi+sd->paramb[1]+sd->parame[1];
+ sd->paramc[2]=sd->status.vit+sd->paramb[2]+sd->parame[2];
+ sd->paramc[3]=sd->status.int_+sd->paramb[3]+sd->parame[3];
+ sd->paramc[4]=sd->status.dex+sd->paramb[4]+sd->parame[4];
+ sd->paramc[5]=sd->status.luk+sd->paramb[5]+sd->parame[5];
+ for(i=0;i<6;i++)
+ if(sd->paramc[i] < 0) sd->paramc[i] = 0;
+
+ if(sd->status.weapon == 11 || sd->status.weapon == 13 || sd->status.weapon == 14) {
+ str = sd->paramc[4];
+ dex = sd->paramc[0];
+ }
+ else {
+ str = sd->paramc[0];
+ dex = sd->paramc[4];
+ }
+ dstr = str/10;
+ sd->base_atk += str + dstr*dstr + dex/5 + sd->paramc[5]/5;
+ sd->matk1 += sd->paramc[3]+(sd->paramc[3]/5)*(sd->paramc[3]/5);
+ sd->matk2 += sd->paramc[3]+(sd->paramc[3]/7)*(sd->paramc[3]/7);
+ if(sd->matk1 < sd->matk2) {
+ int temp = sd->matk2;
+ sd->matk2 = sd->matk1;
+ sd->matk1 = temp;
+ }
+ sd->hit += sd->paramc[4] + sd->status.base_level;
+ sd->flee += sd->paramc[1] + sd->status.base_level;
+ sd->def2 += sd->paramc[2];
+ sd->mdef2 += sd->paramc[3];
+ sd->flee2 += sd->paramc[5]+10;
+ sd->critical += (sd->paramc[5]*3)+10;
+
+ if(sd->base_atk < 1)
+ sd->base_atk = 1;
+ if(sd->critical_rate != 100)
+ sd->critical = (sd->critical*sd->critical_rate)/100;
+ if(sd->critical < 10) sd->critical = 10;
+ if(sd->hit_rate != 100)
+ sd->hit = (sd->hit*sd->hit_rate)/100;
+ if(sd->hit < 1) sd->hit = 1;
+ if(sd->flee_rate != 100)
+ sd->flee = (sd->flee*sd->flee_rate)/100;
+ if(sd->flee < 1) sd->flee = 1;
+ if(sd->flee2_rate != 100)
+ sd->flee2 = (sd->flee2*sd->flee2_rate)/100;
+ if(sd->flee2 < 10) sd->flee2 = 10;
+ if(sd->def_rate != 100)
+ sd->def = (sd->def*sd->def_rate)/100;
+ if(sd->def < 0) sd->def = 0;
+ if(sd->def2_rate != 100)
+ sd->def2 = (sd->def2*sd->def2_rate)/100;
+ if(sd->def2 < 1) sd->def2 = 1;
+ if(sd->mdef_rate != 100)
+ sd->mdef = (sd->mdef*sd->mdef_rate)/100;
+ if(sd->mdef < 0) sd->mdef = 0;
+ if(sd->mdef2_rate != 100)
+ sd->mdef2 = (sd->mdef2*sd->mdef2_rate)/100;
+ if(sd->mdef2 < 1) sd->mdef2 = 1;
+
+ // 二刀流 ASPD 修正
+ if (sd->status.weapon <= 16)
+ sd->aspd += aspd_base[s_class.job][sd->status.weapon]-(sd->paramc[1]*4+sd->paramc[4])*aspd_base[s_class.job][sd->status.weapon]/1000;
+ else
+ sd->aspd += (
+ (aspd_base[s_class.job][sd->weapontype1]-(sd->paramc[1]*4+sd->paramc[4])*aspd_base[s_class.job][sd->weapontype1]/1000) +
+ (aspd_base[s_class.job][sd->weapontype2]-(sd->paramc[1]*4+sd->paramc[4])*aspd_base[s_class.job][sd->weapontype2]/1000)
+ ) * 140 / 200;
+
+ aspd_rate = sd->aspd_rate;
+
+ //攻?速度?加
+
+ if((skill=pc_checkskill(sd,AC_VULTURE))>0){ // ワシの目
+ sd->hit += skill;
+ if(sd->status.weapon == 11)
+ sd->attackrange += skill;
+ }
+
+ if( (skill=pc_checkskill(sd,BS_WEAPONRESEARCH))>0) // 武器?究の命中率?加
+ sd->hit += skill*2;
+ if(sd->status.option&2 && (skill = pc_checkskill(sd,RG_TUNNELDRIVE))>0 ) // トンネルドライブ // トンネルドライブ
+ sd->speed += (1.2*DEFAULT_WALK_SPEED - skill*9);
+ if (pc_iscarton(sd) && (skill=pc_checkskill(sd,MC_PUSHCART))>0) // カ?トによる速度低下
+ sd->speed += (10-skill) * (DEFAULT_WALK_SPEED * 0.1);
+ else if (pc_isriding(sd)) { // ペコペコ?りによる速度?加
+ sd->speed -= (0.25 * DEFAULT_WALK_SPEED);
+ sd->max_weight += 10000;
+ }
+ if((skill=pc_checkskill(sd,CR_TRUST))>0) { // フェイス
+ sd->status.max_hp += skill*200;
+ sd->subele[6] += skill*5;
+ }
+ if((skill=pc_checkskill(sd,BS_SKINTEMPER))>0) {
+ sd->subele[0] += skill;
+ sd->subele[3] += skill*5;
+ }
+ if((skill=pc_checkskill(sd,SA_ADVANCEDBOOK))>0 )
+ aspd_rate -= skill*0.5;
+
+ bl=sd->status.base_level;
+
+ sd->status.max_hp += (3500 + bl*hp_coefficient2[s_class.job] + hp_sigma_val[s_class.job][(bl > 0)? bl-1:0])/100 * (100 + sd->paramc[2])/100 + (sd->parame[2] - sd->paramcard[2]);
+ if (s_class.upper==1) // [MouseJstr]
+ sd->status.max_hp = sd->status.max_hp * 130/100;
+ else if (s_class.upper==2)
+ sd->status.max_hp = sd->status.max_hp * 70/100;
+
+ if(sd->hprate!=100)
+ sd->status.max_hp = sd->status.max_hp*sd->hprate/100;
+
+ if(sd->sc_count && sd->sc_data[SC_BERSERK].timer!=-1){ // バ?サ?ク
+ sd->status.max_hp = sd->status.max_hp * 3;
+ // sd->status.hp = sd->status.hp * 3;
+ if(sd->status.max_hp > battle_config.max_hp) // removed negative max hp bug by Valaris
+ sd->status.max_hp = battle_config.max_hp;
+ if(sd->status.hp > battle_config.max_hp) // removed negative max hp bug by Valaris
+ sd->status.hp = battle_config.max_hp;
+ }
+ if(s_class.job == 23 && sd->status.base_level >= 99){
+ sd->status.max_hp = sd->status.max_hp + 2000;
+ }
+
+ if(sd->status.max_hp > battle_config.max_hp) // removed negative max hp bug by Valaris
+ sd->status.max_hp = battle_config.max_hp;
+ if(sd->status.max_hp <= 0) sd->status.max_hp = 1; // end
+
+ // 最大SP計算
+ sd->status.max_sp += ((sp_coefficient[s_class.job] * bl) + 1000)/100 * (100 + sd->paramc[3])/100 + (sd->parame[3] - sd->paramcard[3]);
+ if (s_class.upper==1) // [MouseJstr]
+ sd->status.max_sp = sd->status.max_sp * 130/100;
+ else if (s_class.upper==2)
+ sd->status.max_sp = sd->status.max_sp * 70/100;
+ if(sd->sprate!=100)
+ sd->status.max_sp = sd->status.max_sp*sd->sprate/100;
+
+ if((skill=pc_checkskill(sd,HP_MEDITATIO))>0) // メディテイティオ
+ sd->status.max_sp += sd->status.max_sp*skill/100;
+ if((skill=pc_checkskill(sd,HW_SOULDRAIN))>0) /* ソウルドレイン */
+ sd->status.max_sp += sd->status.max_sp*2*skill/100;
+
+ if(sd->status.max_sp < 0 || sd->status.max_sp > battle_config.max_sp)
+ sd->status.max_sp = battle_config.max_sp;
+
+ //自然回復HP
+ sd->nhealhp = 1 + (sd->paramc[2]/5) + (sd->status.max_hp/200);
+ if((skill=pc_checkskill(sd,SM_RECOVERY)) > 0) { /* HP回復力向上 */
+ sd->nshealhp = skill*5 + (sd->status.max_hp*skill/500);
+ if(sd->nshealhp > 0x7fff) sd->nshealhp = 0x7fff;
+ }
+ //自然回復SP
+ sd->nhealsp = 1 + (sd->paramc[3]/6) + (sd->status.max_sp/100);
+ if(sd->paramc[3] >= 120)
+ sd->nhealsp += ((sd->paramc[3]-120)>>1) + 4;
+ if((skill=pc_checkskill(sd,MG_SRECOVERY)) > 0) { /* SP回復力向上 */
+ sd->nshealsp = skill*3 + (sd->status.max_sp*skill/500);
+ if(sd->nshealsp > 0x7fff) sd->nshealsp = 0x7fff;
+ }
+
+ if((skill = pc_checkskill(sd,MO_SPIRITSRECOVERY)) > 0) {
+ sd->nsshealhp = skill*4 + (sd->status.max_hp*skill/500);
+ sd->nsshealsp = skill*2 + (sd->status.max_sp*skill/500);
+ if(sd->nsshealhp > 0x7fff) sd->nsshealhp = 0x7fff;
+ if(sd->nsshealsp > 0x7fff) sd->nsshealsp = 0x7fff;
+ }
+ if(sd->hprecov_rate != 100) {
+ sd->nhealhp = sd->nhealhp*sd->hprecov_rate/100;
+ if(sd->nhealhp < 1) sd->nhealhp = 1;
+ }
+ if(sd->sprecov_rate != 100) {
+ sd->nhealsp = sd->nhealsp*sd->sprecov_rate/100;
+ if(sd->nhealsp < 1) sd->nhealsp = 1;
+ }
+ /* if((skill=pc_checkskill(sd,HP_MEDITATIO)) > 0) { // f?fffBfefCfefBfI,I'SPR,A*,I',E`,。ゥZ((c)。ョR「カn~.ゥォ,E',(c),(c),e'
+ sd->nhealsp += 3*skill*(sd->status.max_sp)/100;
+ if(sd->nhealsp > 0x7fff) sd->nhealsp = 0x7fff;
+ } Increase natural SP regen instead of colossal SP Recovery effect [DracoRPG]*/
+
+ // 種族耐性(これでいいの? ディバインプロテクションと同じ?理がいるかも)
+ if( (skill=pc_checkskill(sd,SA_DRAGONOLOGY))>0 ){ // ドラゴノロジ?
+ skill = skill*4;
+ sd->addrace[9]+=skill;
+ sd->addrace_[9]+=skill;
+ sd->subrace[9]+=skill;
+ sd->magic_addrace[9]+=skill;
+ sd->magic_subrace[9]-=skill;
+ }
+
+ //Flee上昇
+ if( (skill=pc_checkskill(sd,TF_MISS))>0 ){ // 回避率?加
+ if(sd->status.class_==6||sd->status.class_==4007 || sd->status.class_==23){
+ sd->flee += skill*3;
+ }
+ if(sd->status.class_==12||sd->status.class_==17||sd->status.class_==4013||sd->status.class_==4018)
+ sd->flee += skill*4;
+ if(sd->status.class_==12||sd->status.class_==4013)
+ sd->speed -= sd->speed *(skill*1.5)/100;
+ }
+ if( (skill=pc_checkskill(sd,MO_DODGE))>0 ) // 見切り
+ sd->flee += (skill*3)>>1;
+
+ // スキルやステ?タス異常による?りのパラメ?タ補正
+ if(sd->sc_count){
+ // ATK/DEF?化形
+ if(sd->sc_data[SC_ANGELUS].timer!=-1) // エンジェラス
+ sd->def2 = sd->def2*(110+5*sd->sc_data[SC_ANGELUS].val1)/100;
+ if(sd->sc_data[SC_IMPOSITIO].timer!=-1) {// インポシティオマヌス
+ sd->watk += sd->sc_data[SC_IMPOSITIO].val1*5;
+ index = sd->equip_index[8];
+ if(index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->type == 4)
+ sd->watk_ += sd->sc_data[SC_IMPOSITIO].val1*5;
+ }
+ if(sd->sc_data[SC_PROVOKE].timer!=-1){ // プロボック
+ sd->def2 = sd->def2*(100-6*sd->sc_data[SC_PROVOKE].val1)/100;
+ sd->base_atk = sd->base_atk*(100+2*sd->sc_data[SC_PROVOKE].val1)/100;
+ sd->watk = sd->watk*(100+2*sd->sc_data[SC_PROVOKE].val1)/100;
+ index = sd->equip_index[8];
+ if(index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->type == 4)
+ sd->watk_ = sd->watk_*(100+2*sd->sc_data[SC_PROVOKE].val1)/100;
+ }
+ if(sd->sc_data[SC_ENDURE].timer!=-1)
+ sd->mdef2 += sd->sc_data[SC_ENDURE].val1;
+ if(sd->sc_data[SC_MINDBREAKER].timer!=-1){ // プロボック
+ sd->mdef2 = sd->mdef2*(100-6*sd->sc_data[SC_MINDBREAKER].val1)/100;
+ sd->matk1 = sd->matk1*(100+2*sd->sc_data[SC_MINDBREAKER].val1)/100;
+ sd->matk2 = sd->matk2*(100+2*sd->sc_data[SC_MINDBREAKER].val1)/100;
+ }
+ if(sd->sc_data[SC_POISON].timer!=-1) // 毒?態
+ sd->def2 = sd->def2*75/100;
+ if(sd->sc_data[SC_CURSE].timer!=-1){
+ sd->base_atk = sd->base_atk*75/100;
+ sd->watk = sd->watk*75/100;
+ index = sd->equip_index[8];
+ if(index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->type == 4)
+ sd->watk_ = sd->watk_*75/100;
+ }
+ if(sd->sc_data[SC_DRUMBATTLE].timer!=-1){ // ?太鼓の響き
+ sd->watk += sd->sc_data[SC_DRUMBATTLE].val2;
+ sd->def += sd->sc_data[SC_DRUMBATTLE].val3;
+ index = sd->equip_index[8];
+ if(index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->type == 4)
+ sd->watk_ += sd->sc_data[SC_DRUMBATTLE].val2;
+ }
+ if(sd->sc_data[SC_NIBELUNGEN].timer!=-1) { // ニ?ベルングの指輪
+ index = sd->equip_index[9];
+ /*if(index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->wlv == 3)
+ sd->watk += sd->sc_data[SC_NIBELUNGEN].val3;
+ index = sd->equip_index[8];
+ if(index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->wlv == 3)
+ sd->watk_ += sd->sc_data[SC_NIBELUNGEN].val3;
+ index = sd->equip_index[9];*/
+ if(index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->wlv == 4)
+ sd->watk2 += sd->sc_data[SC_NIBELUNGEN].val3;
+ index = sd->equip_index[8];
+ if(index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->wlv == 4)
+ sd->watk_2 += sd->sc_data[SC_NIBELUNGEN].val3;
+ }
+
+ if(sd->sc_data[SC_VOLCANO].timer!=-1 && sd->def_ele==3){ // ボルケ?ノ
+ sd->watk += sd->sc_data[SC_VIOLENTGALE].val3;
+ }
+
+ if(sd->sc_data[SC_SIGNUMCRUCIS].timer!=-1)
+ sd->def = sd->def * (100 - sd->sc_data[SC_SIGNUMCRUCIS].val2)/100;
+ if(sd->sc_data[SC_ETERNALCHAOS].timer!=-1) // エタ?ナルカオス
+ sd->def=0;
+
+ if(sd->sc_data[SC_CONCENTRATION].timer!=-1){ //コンセントレ?ション
+ sd->watk = sd->watk * (100 + 5*sd->sc_data[SC_CONCENTRATION].val1)/100;
+ index = sd->equip_index[8];
+ if(index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->type == 4)
+ sd->watk_ = sd->watk * (100 + 5*sd->sc_data[SC_CONCENTRATION].val1)/100;
+ sd->def = sd->def * (100 - 5*sd->sc_data[SC_CONCENTRATION].val1)/100;
+ }
+
+ if(sd->sc_data[SC_MAGICPOWER].timer!=-1){ //魔法力?幅
+ sd->matk1 = sd->matk1*(100+5*sd->sc_data[SC_MAGICPOWER].val1)/100;
+ sd->matk2 = sd->matk2*(100+5*sd->sc_data[SC_MAGICPOWER].val1)/100;
+ }
+ if(sd->sc_data[SC_ATKPOT].timer!=-1)
+ sd->watk += sd->sc_data[SC_ATKPOT].val1;
+ if(sd->sc_data[SC_MATKPOT].timer!=-1){
+ sd->matk1 += sd->sc_data[SC_MATKPOT].val1;
+ sd->matk2 += sd->sc_data[SC_MATKPOT].val1;
+ }
+
+ // ASPD/移動速度?化系
+ if(sd->sc_data[SC_TWOHANDQUICKEN].timer != -1 && sd->sc_data[SC_QUAGMIRE].timer == -1 && sd->sc_data[SC_DONTFORGETME].timer == -1) // 2HQ
+ aspd_rate -= 30;
+ if(sd->sc_data[SC_ADRENALINE].timer != -1 && sd->sc_data[SC_TWOHANDQUICKEN].timer == -1 &&
+ sd->sc_data[SC_QUAGMIRE].timer == -1 && sd->sc_data[SC_DONTFORGETME].timer == -1) { // アドレナリンラッシュ
+ if(sd->sc_data[SC_ADRENALINE].val2 || !battle_config.party_skill_penalty)
+ aspd_rate -= 30;
+ else
+ aspd_rate -= 25;
+ }
+ if(sd->sc_data[SC_SPEARSQUICKEN].timer != -1 && sd->sc_data[SC_ADRENALINE].timer == -1 &&
+ sd->sc_data[SC_TWOHANDQUICKEN].timer == -1 && sd->sc_data[SC_QUAGMIRE].timer == -1 && sd->sc_data[SC_DONTFORGETME].timer == -1) // スピアクィッケン
+ aspd_rate -= sd->sc_data[SC_SPEARSQUICKEN].val2;
+ if(sd->sc_data[SC_ASSNCROS].timer!=-1 && // 夕陽のアサシンクロス
+ sd->sc_data[SC_TWOHANDQUICKEN].timer==-1 && sd->sc_data[SC_ADRENALINE].timer==-1 && sd->sc_data[SC_SPEARSQUICKEN].timer==-1 &&
+ sd->sc_data[SC_DONTFORGETME].timer == -1)
+ aspd_rate -= 5+sd->sc_data[SC_ASSNCROS].val1+sd->sc_data[SC_ASSNCROS].val2+sd->sc_data[SC_ASSNCROS].val3;
+ if(sd->sc_data[SC_DONTFORGETME].timer!=-1){ // 私を忘れないで
+ aspd_rate += sd->sc_data[SC_DONTFORGETME].val1*3 + sd->sc_data[SC_DONTFORGETME].val2 + (sd->sc_data[SC_DONTFORGETME].val3>>16);
+ sd->speed= sd->speed*(100+sd->sc_data[SC_DONTFORGETME].val1*2 + sd->sc_data[SC_DONTFORGETME].val2 + (sd->sc_data[SC_DONTFORGETME].val3&0xffff))/100;
+ }
+ if( sd->sc_data[i=SC_SPEEDPOTION3].timer!=-1 ||
+ sd->sc_data[i=SC_SPEEDPOTION2].timer!=-1 ||
+ sd->sc_data[i=SC_SPEEDPOTION1].timer!=-1 ||
+ sd->sc_data[i=SC_SPEEDPOTION0].timer!=-1) // ? 速ポ?ション
+ aspd_rate -= sd->sc_data[i].val2;
+ if(sd->sc_data[SC_WINDWALK].timer!=-1 && sd->sc_data[SC_INCREASEAGI].timer==-1) //ウィンドウォ?ク暫ヘLv*2%減算
+ sd->speed -= sd->speed *(sd->sc_data[SC_WINDWALK].val1*2)/100;
+ if(sd->sc_data[SC_CARTBOOST].timer!=-1) // カ?トブ?スト
+ sd->speed -= (DEFAULT_WALK_SPEED * 20)/100;
+ if(sd->sc_data[SC_BERSERK].timer!=-1) //バ?サ?ク中はIAと同じぐらい速い?
+ sd->speed -= sd->speed *25/100;
+ if(sd->sc_data[SC_WEDDING].timer!=-1) //結婚中は?くのが?い
+ sd->speed = 2*DEFAULT_WALK_SPEED;
+
+ // HIT/FLEE?化系
+ if(sd->sc_data[SC_WHISTLE].timer!=-1){ // 口笛
+ sd->flee += sd->flee * (sd->sc_data[SC_WHISTLE].val1
+ +sd->sc_data[SC_WHISTLE].val2+(sd->sc_data[SC_WHISTLE].val3>>16))/100;
+ sd->flee2+= (sd->sc_data[SC_WHISTLE].val1+sd->sc_data[SC_WHISTLE].val2+(sd->sc_data[SC_WHISTLE].val3&0xffff)) * 10;
+ }
+ if(sd->sc_data[SC_HUMMING].timer!=-1) // ハミング
+ sd->hit += (sd->sc_data[SC_HUMMING].val1*2+sd->sc_data[SC_HUMMING].val2
+ +sd->sc_data[SC_HUMMING].val3) * sd->hit/100;
+ if(sd->sc_data[SC_VIOLENTGALE].timer!=-1 && sd->def_ele==4){ // バイオレントゲイル
+ sd->flee += sd->flee*sd->sc_data[SC_VIOLENTGALE].val3/100;
+ }
+ if(sd->sc_data[SC_BLIND].timer!=-1){ // 暗?
+ sd->hit -= sd->hit*25/100;
+ sd->flee -= sd->flee*25/100;
+ }
+ if(sd->sc_data[SC_WINDWALK].timer!=-1) // ウィンドウォ?ク
+ sd->flee += sd->flee*(sd->sc_data[SC_WINDWALK].val2)/100;
+ if(sd->sc_data[SC_SPIDERWEB].timer!=-1) //スパイダ?ウェブ
+ sd->flee -= sd->flee*50/100;
+ if(sd->sc_data[SC_TRUESIGHT].timer!=-1) //トゥル?サイト
+ sd->hit += 3*(sd->sc_data[SC_TRUESIGHT].val1);
+ if(sd->sc_data[SC_CONCENTRATION].timer!=-1) //コンセントレ?ション
+ sd->hit += (10*(sd->sc_data[SC_CONCENTRATION].val1));
+
+ // 耐性
+ if(sd->sc_data[SC_SIEGFRIED].timer!=-1){ // 不死身のジ?クフリ?ド
+ sd->subele[1] += sd->sc_data[SC_SIEGFRIED].val2; // 水
+ sd->subele[2] += sd->sc_data[SC_SIEGFRIED].val2; // 水
+ sd->subele[3] += sd->sc_data[SC_SIEGFRIED].val2; // 火
+ sd->subele[4] += sd->sc_data[SC_SIEGFRIED].val2; // 水
+ sd->subele[5] += sd->sc_data[SC_SIEGFRIED].val2; // 水
+ sd->subele[6] += sd->sc_data[SC_SIEGFRIED].val2; // 水
+ sd->subele[7] += sd->sc_data[SC_SIEGFRIED].val2; // 水
+ sd->subele[8] += sd->sc_data[SC_SIEGFRIED].val2; // 水
+ sd->subele[9] += sd->sc_data[SC_SIEGFRIED].val2; // 水
+ }
+ if(sd->sc_data[SC_PROVIDENCE].timer!=-1){ // プロヴィデンス
+ sd->subele[6] += sd->sc_data[SC_PROVIDENCE].val2; // ? 聖?性
+ sd->subrace[6] += sd->sc_data[SC_PROVIDENCE].val2; // ? ?魔
+ }
+
+ // その他
+ if(sd->sc_data[SC_APPLEIDUN].timer!=-1){ // イドゥンの林檎
+ sd->status.max_hp += ((5+sd->sc_data[SC_APPLEIDUN].val1*2+((sd->sc_data[SC_APPLEIDUN].val2+1)>>1)
+ +sd->sc_data[SC_APPLEIDUN].val3/10) * sd->status.max_hp)/100;
+ if(sd->status.max_hp < 0 || sd->status.max_hp > battle_config.max_hp)
+ 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;
+ if(sd->status.max_hp < 0 || sd->status.max_hp > battle_config.max_hp)
+ sd->status.max_hp = battle_config.max_hp;
+ }
+ if(sd->sc_data[SC_SERVICE4U].timer!=-1) { // サ?ビスフォ?ユ?
+ sd->status.max_sp += sd->status.max_sp*(10+sd->sc_data[SC_SERVICE4U].val1+sd->sc_data[SC_SERVICE4U].val2
+ +sd->sc_data[SC_SERVICE4U].val3)/100;
+ if(sd->status.max_sp < 0 || sd->status.max_sp > battle_config.max_sp)
+ sd->status.max_sp = battle_config.max_sp;
+ sd->dsprate-=(10+sd->sc_data[SC_SERVICE4U].val1*3+sd->sc_data[SC_SERVICE4U].val2
+ +sd->sc_data[SC_SERVICE4U].val3);
+ if(sd->dsprate<0)sd->dsprate=0;
+ }
+
+ if(sd->sc_data[SC_FORTUNE].timer!=-1) // 幸運のキス
+ sd->critical += (10+sd->sc_data[SC_FORTUNE].val1+sd->sc_data[SC_FORTUNE].val2
+ +sd->sc_data[SC_FORTUNE].val3)*10;
+
+ if(sd->sc_data[SC_EXPLOSIONSPIRITS].timer!=-1){ // 爆裂波動
+ if(s_class.job==23)
+ sd->critical += sd->sc_data[SC_EXPLOSIONSPIRITS].val1*100;
+ else
+ sd->critical += sd->sc_data[SC_EXPLOSIONSPIRITS].val2;
+ }
+
+ if(sd->sc_data[SC_STEELBODY].timer!=-1){ // 金剛
+ sd->def = 90;
+ sd->mdef = 90;
+ aspd_rate += 25;
+ sd->speed = (sd->speed * 125) / 100;
+ }
+ if(sd->sc_data[SC_DEFENDER].timer != -1) {
+ sd->aspd += (550 - sd->sc_data[SC_DEFENDER].val1*50);
+ // removed as of 12/14's patch [celest]
+ //sd->speed = (sd->speed * (155 - sd->sc_data[SC_DEFENDER].val1*5)) / 100;
+ }
+ if(sd->sc_data[SC_ENCPOISON].timer != -1)
+ sd->addeff[4] += sd->sc_data[SC_ENCPOISON].val2;
+
+ if( sd->sc_data[SC_DANCING].timer!=-1 ){ // 演奏/ダンス使用中
+ sd->speed = (double)sd->speed * (6.- 0.4 * pc_checkskill(sd, ((s_class.job == 19) ? BA_MUSICALLESSON : DC_DANCINGLESSON)));
+ //sd->speed*=4;
+ sd->nhealsp = 0;
+ sd->nshealsp = 0;
+ sd->nsshealsp = 0;
+ }
+ if(sd->sc_data[SC_CURSE].timer!=-1)
+ sd->speed += 450;
+
+ if(sd->sc_data[SC_TRUESIGHT].timer!=-1) //トゥル?サイト
+ sd->critical += sd->critical*(sd->sc_data[SC_TRUESIGHT].val1)/100;
+
+/* if(sd->sc_data[SC_VOLCANO].timer!=-1) // エンチャントポイズン(?性はbattle.cで)
+ sd->addeff[2]+=sd->sc_data[SC_VOLCANO].val2;//% of granting
+ if(sd->sc_data[SC_DELUGE].timer!=-1) // エンチャントポイズン(?性はbattle.cで)
+ sd->addeff[0]+=sd->sc_data[SC_DELUGE].val2;//% of granting
+ */
+ if(sd->sc_data[SC_BERSERK].timer!=-1) { //All Def/MDef reduced to 0 while in Berserk [DracoRPG]
+ sd->def = sd->def2 = 0;
+ sd->mdef = sd->mdef2 = 0;
+ sd->flee -= sd->flee*50/100;
+ aspd_rate -= 30;
+ //sd->base_atk *= 3;
+ }
+ if(sd->sc_data[SC_KEEPING].timer!=-1)
+ sd->def = 100;
+ if(sd->sc_data[SC_BARRIER].timer!=-1)
+ sd->mdef = 100;
+
+ if(sd->sc_data[SC_GOSPEL].timer!=-1) {
+ if (sd->sc_data[SC_GOSPEL].val4 == BCT_PARTY){
+ switch (sd->sc_data[SC_GOSPEL].val3)
+ {
+ case 4:
+ sd->status.max_hp += sd->status.max_hp * 25 / 100;
+ if(sd->status.max_hp > battle_config.max_hp)
+ sd->status.max_hp = battle_config.max_hp;
+ break;
+ case 5:
+ sd->status.max_sp += sd->status.max_sp * 25 / 100;
+ if(sd->status.max_sp > battle_config.max_sp)
+ sd->status.max_sp = battle_config.max_sp;
+ break;
+ case 11:
+ sd->def += sd->def * 25 / 100;
+ sd->def2 += sd->def2 * 25 / 100;
+ break;
+ case 12:
+ sd->base_atk += sd->base_atk * 8 / 100;
+ break;
+ case 13:
+ sd->flee += sd->flee * 5 / 100;
+ break;
+ case 14:
+ sd->hit += sd->hit * 5 / 100;
+ break;
+ }
+ } else if (sd->sc_data[SC_GOSPEL].val4 == BCT_ENEMY){
+ switch (sd->sc_data[SC_GOSPEL].val3)
+ {
+ case 5:
+ sd->def = 0;
+ sd->def2 = 0;
+ break;
+ case 6:
+ sd->base_atk = 0;
+ sd->watk = 0;
+ sd->watk2 = 0;
+ break;
+ case 7:
+ sd->flee = 0;
+ break;
+ case 8:
+ sd->speed_rate += 75;
+ aspd_rate += 75;
+ break;
+ }
+ }
+ }
+ }
+
+ if (sd->speed_rate <= 0)
+ sd->speed_rate = 1;
+
+ if(sd->speed_rate != 100)
+ sd->speed = sd->speed*sd->speed_rate/100;
+ if(sd->speed < 1) sd->speed = 1;
+ if(aspd_rate != 100)
+ sd->aspd = sd->aspd*aspd_rate/100;
+ if(pc_isriding(sd)) // 騎兵修練
+ sd->aspd = sd->aspd*(100 + 10*(5 - pc_checkskill(sd,KN_CAVALIERMASTERY)))/ 100;
+ if(sd->aspd < battle_config.max_aspd) sd->aspd = battle_config.max_aspd;
+ sd->amotion = sd->aspd;
+ sd->dmotion = 800-sd->paramc[1]*4;
+ if(sd->dmotion<400)
+ sd->dmotion = 400;
+ if(sd->skilltimer != -1 && (skill = pc_checkskill(sd,SA_FREECAST)) > 0) {
+ sd->prev_speed = sd->speed;
+ sd->speed = sd->speed*(175 - skill*5)/100;
+ }
+
+ if(sd->status.hp>sd->status.max_hp)
+ sd->status.hp=sd->status.max_hp;
+ if(sd->status.sp>sd->status.max_sp)
+ sd->status.sp=sd->status.max_sp;
+
+ if(first&4)
+ return 0;
+ if(first&3) {
+ clif_updatestatus(sd,SP_SPEED);
+ clif_updatestatus(sd,SP_MAXHP);
+ clif_updatestatus(sd,SP_MAXSP);
+ if(first&1) {
+ clif_updatestatus(sd,SP_HP);
+ clif_updatestatus(sd,SP_SP);
+ }
+ return 0;
+ }
+
+ if(b_class != sd->view_class) {
+ clif_changelook(&sd->bl,LOOK_BASE,sd->view_class);
+#if PACKETVER < 4
+ clif_changelook(&sd->bl,LOOK_WEAPON,sd->status.weapon);
+ clif_changelook(&sd->bl,LOOK_SHIELD,sd->status.shield);
+#else
+ clif_changelook(&sd->bl,LOOK_WEAPON,0);
+#endif
+ }
+
+ if( memcmp(b_skill,sd->status.skill,sizeof(sd->status.skill)) || b_attackrange != sd->attackrange)
+ clif_skillinfoblock(sd); // スキル送信
+
+ if(b_speed != sd->speed)
+ clif_updatestatus(sd,SP_SPEED);
+ if(b_weight != sd->weight)
+ clif_updatestatus(sd,SP_WEIGHT);
+ if(b_max_weight != sd->max_weight) {
+ clif_updatestatus(sd,SP_MAXWEIGHT);
+ pc_checkweighticon(sd);
+ }
+ for(i=0;i<6;i++)
+ if(b_paramb[i] + b_parame[i] != sd->paramb[i] + sd->parame[i])
+ clif_updatestatus(sd,SP_STR+i);
+ if(b_hit != sd->hit)
+ clif_updatestatus(sd,SP_HIT);
+ if(b_flee != sd->flee)
+ clif_updatestatus(sd,SP_FLEE1);
+ if(b_aspd != sd->aspd)
+ clif_updatestatus(sd,SP_ASPD);
+ if(b_watk != sd->watk || b_base_atk != sd->base_atk)
+ clif_updatestatus(sd,SP_ATK1);
+ if(b_def != sd->def)
+ clif_updatestatus(sd,SP_DEF1);
+ if(b_watk2 != sd->watk2)
+ clif_updatestatus(sd,SP_ATK2);
+ if(b_def2 != sd->def2)
+ clif_updatestatus(sd,SP_DEF2);
+ if(b_flee2 != sd->flee2)
+ clif_updatestatus(sd,SP_FLEE2);
+ if(b_critical != sd->critical)
+ clif_updatestatus(sd,SP_CRITICAL);
+ if(b_matk1 != sd->matk1)
+ clif_updatestatus(sd,SP_MATK1);
+ if(b_matk2 != sd->matk2)
+ clif_updatestatus(sd,SP_MATK2);
+ if(b_mdef != sd->mdef)
+ clif_updatestatus(sd,SP_MDEF1);
+ if(b_mdef2 != sd->mdef2)
+ clif_updatestatus(sd,SP_MDEF2);
+ if(b_attackrange != sd->attackrange)
+ clif_updatestatus(sd,SP_ATTACKRANGE);
+ if(b_max_hp != sd->status.max_hp)
+ clif_updatestatus(sd,SP_MAXHP);
+ if(b_max_sp != sd->status.max_sp)
+ clif_updatestatus(sd,SP_MAXSP);
+ if(b_hp != sd->status.hp)
+ clif_updatestatus(sd,SP_HP);
+ if(b_sp != sd->status.sp)
+ clif_updatestatus(sd,SP_SP);
+
+/* if(before.cart_num != before.cart_num || before.cart_max_num != before.cart_max_num ||
+ before.cart_weight != before.cart_weight || before.cart_max_weight != before.cart_max_weight )
+ clif_updatestatus(sd,SP_CARTINFO);*/
+
+ //if(sd->status.hp<sd->status.max_hp>>2 && pc_checkskill(sd,SM_AUTOBERSERK)>0 &&
+ if(sd->status.hp<sd->status.max_hp>>2 && sd->sc_data[SC_AUTOBERSERK].timer != -1 &&
+ (sd->sc_data[SC_PROVOKE].timer==-1 || sd->sc_data[SC_PROVOKE].val2==0 ) && !pc_isdead(sd))
+ // オ?トバ?サ?ク?動
+ status_change_start(&sd->bl,SC_PROVOKE,10,1,0,0,0,0);
+
+ return 0;
+}
+
+/*==========================================
+ * For quick calculating [Celest]
+ *------------------------------------------
+ */
+int status_calc_speed (struct map_session_data *sd)
+{
+ int b_speed, skill;
+ struct pc_base_job s_class;
+
+ nullpo_retr(0, sd);
+
+ s_class = pc_calc_base_job(sd->status.class_);
+
+ b_speed = sd->speed;
+ sd->speed = DEFAULT_WALK_SPEED ;
+
+ if(sd->sc_count){
+ if(sd->sc_data[SC_INCREASEAGI].timer!=-1 && sd->sc_data[SC_QUAGMIRE].timer == -1 && sd->sc_data[SC_DONTFORGETME].timer == -1){ // 速度?加
+ sd->speed -= sd->speed *25/100;
+ }
+ if(sd->sc_data[SC_DECREASEAGI].timer!=-1) {
+ sd->speed = sd->speed *125/100;
+ }
+ if(sd->sc_data[SC_CLOAKING].timer!=-1) {
+ sd->speed = sd->speed * (sd->sc_data[SC_CLOAKING].val3-sd->sc_data[SC_CLOAKING].val1*3) /100;
+ }
+ if(sd->sc_data[SC_CHASEWALK].timer!=-1) {
+ sd->speed = sd->speed * sd->sc_data[SC_CHASEWALK].val3 /100;
+ }
+ if(sd->sc_data[SC_QUAGMIRE].timer!=-1){
+ sd->speed = sd->speed*3/2;
+ }
+ if(sd->sc_data[SC_WINDWALK].timer!=-1 && sd->sc_data[SC_INCREASEAGI].timer==-1) {
+ sd->speed -= sd->speed *(sd->sc_data[SC_WINDWALK].val1*2)/100;
+ }
+ if(sd->sc_data[SC_CARTBOOST].timer!=-1) {
+ sd->speed -= (DEFAULT_WALK_SPEED * 20)/100;
+ }
+ if(sd->sc_data[SC_BERSERK].timer!=-1) {
+ sd->speed -= sd->speed *25/100;
+ }
+ if(sd->sc_data[SC_WEDDING].timer!=-1) {
+ sd->speed = 2*DEFAULT_WALK_SPEED;
+ }
+ if(sd->sc_data[SC_DONTFORGETME].timer!=-1){
+ sd->speed= sd->speed*(100+sd->sc_data[SC_DONTFORGETME].val1*2 + sd->sc_data[SC_DONTFORGETME].val2 + (sd->sc_data[SC_DONTFORGETME].val3&0xffff))/100;
+ }
+ if(sd->sc_data[SC_STEELBODY].timer!=-1){
+ sd->speed = (sd->speed * 125) / 100;
+ }
+ if(sd->sc_data[SC_DEFENDER].timer != -1) {
+ // removed as of 12/14's patch [celest]
+ //sd->speed = (sd->speed * (155 - sd->sc_data[SC_DEFENDER].val1*5)) / 100;
+ }
+ if( sd->sc_data[SC_DANCING].timer!=-1 ){
+ sd->speed = (double)sd->speed * (6.- 0.4 * pc_checkskill(sd, ((s_class.job == 19) ? BA_MUSICALLESSON : DC_DANCINGLESSON)));
+ }
+ if(sd->sc_data[SC_CURSE].timer!=-1)
+ sd->speed += 450;
+ if(sd->sc_data[SC_SLOWDOWN].timer!=-1)
+ sd->speed = sd->speed*150/100;
+ if(sd->sc_data[SC_SPEEDUP0].timer!=-1)
+ sd->speed -= sd->speed*25/100;
+ }
+
+ if(sd->status.option&2 && (skill = pc_checkskill(sd,RG_TUNNELDRIVE))>0 )
+ sd->speed += (1.2*DEFAULT_WALK_SPEED - skill*9);
+ if (pc_iscarton(sd) && (skill=pc_checkskill(sd,MC_PUSHCART))>0)
+ sd->speed += (10-skill) * (DEFAULT_WALK_SPEED * 0.1);
+ else if (pc_isriding(sd)) {
+ sd->speed -= (0.25 * DEFAULT_WALK_SPEED);
+ }
+ if((skill=pc_checkskill(sd,TF_MISS))>0)
+ if(s_class.job==12)
+ sd->speed -= sd->speed *(skill*1.5)/100;
+
+ if(sd->speed_rate != 100)
+ sd->speed = sd->speed*sd->speed_rate/100;
+ if(sd->speed < 1) sd->speed = 1;
+
+ if(sd->skilltimer != -1 && (skill = pc_checkskill(sd,SA_FREECAST)) > 0) {
+ sd->prev_speed = sd->speed;
+ sd->speed = sd->speed*(175 - skill*5)/100;
+ }
+
+ if(b_speed != sd->speed)
+ clif_updatestatus(sd,SP_SPEED);
+
+ return 0;
+}
+
+/*==========================================
+ * 対象のClassを返す(汎用)
+ * 戻りは整数で0以上
+ *------------------------------------------
+ */
+int status_get_class(struct block_list *bl)
+{
+ nullpo_retr(0, bl);
+ if(bl->type==BL_MOB && (struct mob_data *)bl)
+ return ((struct mob_data *)bl)->class_;
+ else if(bl->type==BL_PC && (struct map_session_data *)bl)
+ return ((struct map_session_data *)bl)->status.class_;
+ else if(bl->type==BL_PET && (struct pet_data *)bl)
+ return ((struct pet_data *)bl)->class_;
+ else
+ return 0;
+}
+/*==========================================
+ * 対象の方向を返す(汎用)
+ * 戻りは整数で0以上
+ *------------------------------------------
+ */
+int status_get_dir(struct block_list *bl)
+{
+ nullpo_retr(0, bl);
+ if(bl->type==BL_MOB && (struct mob_data *)bl)
+ return ((struct mob_data *)bl)->dir;
+ else if(bl->type==BL_PC && (struct map_session_data *)bl)
+ return ((struct map_session_data *)bl)->dir;
+ else if(bl->type==BL_PET && (struct pet_data *)bl)
+ return ((struct pet_data *)bl)->dir;
+ else
+ return 0;
+}
+/*==========================================
+ * 対象のレベルを返す(汎用)
+ * 戻りは整数で0以上
+ *------------------------------------------
+ */
+int status_get_lv(struct block_list *bl)
+{
+ nullpo_retr(0, bl);
+ if(bl->type==BL_MOB && (struct mob_data *)bl)
+ return ((struct mob_data *)bl)->level;
+ else if(bl->type==BL_PC && (struct map_session_data *)bl)
+ return ((struct map_session_data *)bl)->status.base_level;
+ else if(bl->type==BL_PET && (struct pet_data *)bl)
+ return ((struct pet_data *)bl)->msd->pet.level;
+ else
+ return 0;
+}
+
+/*==========================================
+ * 対象の射程を返す(汎用)
+ * 戻りは整数で0以上
+ *------------------------------------------
+ */
+int status_get_range(struct block_list *bl)
+{
+ nullpo_retr(0, bl);
+ if(bl->type==BL_MOB && (struct mob_data *)bl)
+ return mob_db[((struct mob_data *)bl)->class_].range;
+ else if(bl->type==BL_PC && (struct map_session_data *)bl)
+ return ((struct map_session_data *)bl)->attackrange;
+ else if(bl->type==BL_PET && (struct pet_data *)bl)
+ return mob_db[((struct pet_data *)bl)->class_].range;
+ else
+ return 0;
+}
+/*==========================================
+ * 対象のHPを返す(汎用)
+ * 戻りは整数で0以上
+ *------------------------------------------
+ */
+int status_get_hp(struct block_list *bl)
+{
+ nullpo_retr(1, bl);
+ if(bl->type==BL_MOB && (struct mob_data *)bl)
+ return ((struct mob_data *)bl)->hp;
+ else if(bl->type==BL_PC && (struct map_session_data *)bl)
+ return ((struct map_session_data *)bl)->status.hp;
+ else
+ return 1;
+}
+/*==========================================
+ * 対象のMHPを返す(汎用)
+ * 戻りは整数で0以上
+ *------------------------------------------
+ */
+int status_get_max_hp(struct block_list *bl)
+{
+ nullpo_retr(1, bl);
+ if(bl->type==BL_PC && ((struct map_session_data *)bl))
+ return ((struct map_session_data *)bl)->status.max_hp;
+ else {
+ struct status_change *sc_data=status_get_sc_data(bl);
+ int max_hp=1;
+ if(bl->type==BL_MOB && ((struct mob_data*)bl)) {
+ max_hp = mob_db[((struct mob_data*)bl)->class_].max_hp;
+ if(battle_config.mobs_level_up) // mobs leveling up increase [Valaris]
+ max_hp+=(((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class_].lv)*status_get_vit(bl);
+ if(mob_db[((struct mob_data*)bl)->class_].mexp > 0) {
+ if(battle_config.mvp_hp_rate != 100)
+ max_hp = (max_hp * battle_config.mvp_hp_rate)/100;
+ }
+ else {
+ if(battle_config.monster_hp_rate != 100)
+ max_hp = (max_hp * battle_config.monster_hp_rate)/100;
+ }
+ }
+ else if(bl->type==BL_PET && ((struct pet_data*)bl)) {
+ max_hp = mob_db[((struct pet_data*)bl)->class_].max_hp;
+ if(mob_db[((struct pet_data*)bl)->class_].mexp > 0) {
+ if(battle_config.mvp_hp_rate != 100)
+ max_hp = (max_hp * battle_config.mvp_hp_rate)/100;
+ }
+ else {
+ if(battle_config.monster_hp_rate != 100)
+ max_hp = (max_hp * battle_config.monster_hp_rate)/100;
+ }
+ }
+ if(sc_data) {
+ if(sc_data[SC_APPLEIDUN].timer!=-1)
+ max_hp += ((5+sc_data[SC_APPLEIDUN].val1*2+((sc_data[SC_APPLEIDUN].val2+1)>>1)
+ +sc_data[SC_APPLEIDUN].val3/10) * max_hp)/100;
+ if(sc_data[SC_GOSPEL].timer!=-1 &&
+ sc_data[SC_GOSPEL].val4 == BCT_PARTY &&
+ sc_data[SC_GOSPEL].val3 == 4)
+ max_hp += max_hp * 25 / 100;
+ }
+ if(max_hp < 1) max_hp = 1;
+ return max_hp;
+ }
+ return 1;
+}
+/*==========================================
+ * 対象のStrを返す(汎用)
+ * 戻りは整数で0以上
+ *------------------------------------------
+ */
+int status_get_str(struct block_list *bl)
+{
+ int str=0;
+ struct status_change *sc_data;
+
+ nullpo_retr(0, bl);
+ sc_data=status_get_sc_data(bl);
+ if(bl->type==BL_MOB && ((struct mob_data *)bl)) {
+ str = mob_db[((struct mob_data *)bl)->class_].str;
+ if(battle_config.mobs_level_up) // mobs leveling up increase [Valaris]
+ str+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class_].lv;
+ }
+ else if(bl->type==BL_PC && ((struct map_session_data *)bl))
+ return ((struct map_session_data *)bl)->paramc[0];
+ else if(bl->type==BL_PET && ((struct pet_data *)bl))
+ str = mob_db[((struct pet_data *)bl)->class_].str;
+
+ if(sc_data) {
+ if(sc_data[SC_LOUD].timer!=-1 && sc_data[SC_QUAGMIRE].timer == -1 && bl->type != BL_PC)
+ str += 4;
+ if( sc_data[SC_BLESSING].timer != -1 && bl->type != BL_PC){ // ブレッシング
+ int race=status_get_race(bl);
+ if(battle_check_undead(race,status_get_elem_type(bl)) || race==6 ) str >>= 1; // 悪 魔/不死
+ else str += sc_data[SC_BLESSING].val1; // その他
+ }
+ if(sc_data[SC_TRUESIGHT].timer!=-1 && bl->type != BL_PC) // トゥルーサイト
+ str += 5;
+ }
+ if(str < 0) str = 0;
+ return str;
+}
+/*==========================================
+ * 対象のAgiを返す(汎用)
+ * 戻りは整数で0以上
+ *------------------------------------------
+ */
+
+int status_get_agi(struct block_list *bl)
+{
+ int agi=0;
+ struct status_change *sc_data;
+
+ nullpo_retr(0, bl);
+ sc_data=status_get_sc_data(bl);
+ if(bl->type==BL_MOB && (struct mob_data *)bl) {
+ agi=mob_db[((struct mob_data *)bl)->class_].agi;
+ if(battle_config.mobs_level_up) // increase of mobs leveling up [Valaris]
+ agi+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class_].lv;
+ }
+ else if(bl->type==BL_PC && (struct map_session_data *)bl)
+ agi=((struct map_session_data *)bl)->paramc[1];
+ else if(bl->type==BL_PET && (struct pet_data *)bl)
+ agi=mob_db[((struct pet_data *)bl)->class_].agi;
+
+ if(sc_data) {
+ if( sc_data[SC_INCREASEAGI].timer!=-1 && sc_data[SC_QUAGMIRE].timer == -1 && sc_data[SC_DONTFORGETME].timer == -1 &&
+ bl->type != BL_PC) // 速度増加(PCはpc.cで)
+ agi += 2+sc_data[SC_INCREASEAGI].val1;
+
+ if(sc_data[SC_CONCENTRATE].timer!=-1 && sc_data[SC_QUAGMIRE].timer == -1 && bl->type != BL_PC)
+ agi += agi*(2+sc_data[SC_CONCENTRATE].val1)/100;
+
+ if(sc_data[SC_DECREASEAGI].timer!=-1) // 速度減少
+ agi -= 2+sc_data[SC_DECREASEAGI].val1;
+
+ if(sc_data[SC_QUAGMIRE].timer!=-1 ) { // クァグマイア
+ //agi >>= 1;
+ //int agib = agi*(sc_data[SC_QUAGMIRE].val1*10)/100;
+ //agi -= agib > 50 ? 50 : agib;
+ agi -= (bl->type == BL_PC) ? sc_data[SC_QUAGMIRE].val1*5 : sc_data[SC_QUAGMIRE].val1*10;
+ }
+ if(sc_data[SC_TRUESIGHT].timer!=-1 && bl->type != BL_PC) // トゥルーサイト
+ agi += 5;
+ }
+ if(agi < 0) agi = 0;
+ return agi;
+}
+/*==========================================
+ * 対象のVitを返す(汎用)
+ * 戻りは整数で0以上
+ *------------------------------------------
+ */
+int status_get_vit(struct block_list *bl)
+{
+ int vit=0;
+ struct status_change *sc_data;
+
+ nullpo_retr(0, bl);
+ sc_data=status_get_sc_data(bl);
+ if(bl->type==BL_MOB && (struct mob_data *)bl) {
+ vit=mob_db[((struct mob_data *)bl)->class_].vit;
+ if(battle_config.mobs_level_up) // increase from mobs leveling up [Valaris]
+ vit+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class_].lv;
+ }
+ else if(bl->type==BL_PC && (struct map_session_data *)bl)
+ vit=((struct map_session_data *)bl)->paramc[2];
+ else if(bl->type==BL_PET && (struct pet_data *)bl)
+ vit=mob_db[((struct pet_data *)bl)->class_].vit;
+ if(sc_data) {
+ if(sc_data[SC_STRIPARMOR].timer != -1 && bl->type!=BL_PC)
+ vit = vit*60/100;
+ if(sc_data[SC_TRUESIGHT].timer!=-1 && bl->type != BL_PC) // トゥルーサイト
+ vit += 5;
+ }
+
+ if(vit < 0) vit = 0;
+ return vit;
+}
+/*==========================================
+ * 対象のIntを返す(汎用)
+ * 戻りは整数で0以上
+ *------------------------------------------
+ */
+int status_get_int(struct block_list *bl)
+{
+ int int_=0;
+ struct status_change *sc_data;
+
+ nullpo_retr(0, bl);
+ sc_data=status_get_sc_data(bl);
+ if(bl->type==BL_MOB && (struct mob_data *)bl){
+ int_=mob_db[((struct mob_data *)bl)->class_].int_;
+ if(battle_config.mobs_level_up) // increase from mobs leveling up [Valaris]
+ int_+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class_].lv;
+ }
+ else if(bl->type==BL_PC && (struct map_session_data *)bl)
+ int_=((struct map_session_data *)bl)->paramc[3];
+ else if(bl->type==BL_PET && (struct pet_data *)bl)
+ int_=mob_db[((struct pet_data *)bl)->class_].int_;
+
+ if(sc_data) {
+ if( sc_data[SC_BLESSING].timer != -1 && bl->type != BL_PC){ // ブレッシング
+ int race=status_get_race(bl);
+ if(battle_check_undead(race,status_get_elem_type(bl)) || race==6 ) int_ >>= 1; // 悪 魔/不死
+ else int_ += sc_data[SC_BLESSING].val1; // その他
+ }
+ if( sc_data[SC_STRIPHELM].timer != -1 && bl->type != BL_PC)
+ int_ = int_*60/100;
+ if(sc_data[SC_TRUESIGHT].timer!=-1 && bl->type != BL_PC) // トゥルーサイト
+ int_ += 5;
+ }
+ if(int_ < 0) int_ = 0;
+ return int_;
+}
+/*==========================================
+ * 対象のDexを返す(汎用)
+ * 戻りは整数で0以上
+ *------------------------------------------
+ */
+int status_get_dex(struct block_list *bl)
+{
+ int dex=0;
+ struct status_change *sc_data;
+
+ nullpo_retr(0, bl);
+ sc_data=status_get_sc_data(bl);
+ if(bl->type==BL_MOB && (struct mob_data *)bl) {
+ dex=mob_db[((struct mob_data *)bl)->class_].dex;
+ if(battle_config.mobs_level_up) // increase from mobs leveling up [Valaris]
+ dex+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class_].lv;
+ }
+ else if(bl->type==BL_PC && (struct map_session_data *)bl)
+ dex=((struct map_session_data *)bl)->paramc[4];
+ else if(bl->type==BL_PET && (struct pet_data *)bl)
+ dex=mob_db[((struct pet_data *)bl)->class_].dex;
+
+ if(sc_data) {
+ if(sc_data[SC_CONCENTRATE].timer!=-1 && sc_data[SC_QUAGMIRE].timer == -1 && bl->type != BL_PC)
+ dex += dex*(2+sc_data[SC_CONCENTRATE].val1)/100;
+
+ if( sc_data[SC_BLESSING].timer != -1 && bl->type != BL_PC){ // ブレッシング
+ int race=status_get_race(bl);
+ if(battle_check_undead(race,status_get_elem_type(bl)) || race==6 ) dex >>= 1; // 悪 魔/不死
+ else dex += sc_data[SC_BLESSING].val1; // その他
+ }
+
+ if(sc_data[SC_QUAGMIRE].timer!=-1 ) { // クァグマイア
+ // dex >>= 1;
+ //int dexb = dex*(sc_data[SC_QUAGMIRE].val1*10)/100;
+ //dex -= dexb > 50 ? 50 : dexb;
+ dex -= (bl->type == BL_PC) ? sc_data[SC_QUAGMIRE].val1*5 : sc_data[SC_QUAGMIRE].val1*10;
+ }
+ if(sc_data[SC_TRUESIGHT].timer!=-1 && bl->type != BL_PC) // トゥルーサイト
+ dex += 5;
+ }
+ if(dex < 0) dex = 0;
+ return dex;
+}
+/*==========================================
+ * 対象のLukを返す(汎用)
+ * 戻りは整数で0以上
+ *------------------------------------------
+ */
+int status_get_luk(struct block_list *bl)
+{
+ int luk=0;
+ struct status_change *sc_data;
+
+ nullpo_retr(0, bl);
+ sc_data=status_get_sc_data(bl);
+ if(bl->type==BL_MOB && (struct mob_data *)bl) {
+ luk=mob_db[((struct mob_data *)bl)->class_].luk;
+ if(battle_config.mobs_level_up) // increase from mobs leveling up [Valaris]
+ luk+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class_].lv;
+ }
+ else if(bl->type==BL_PC && (struct map_session_data *)bl)
+ luk=((struct map_session_data *)bl)->paramc[5];
+ else if(bl->type==BL_PET && (struct pet_data *)bl)
+ luk=mob_db[((struct pet_data *)bl)->class_].luk;
+
+ if(sc_data) {
+ if(sc_data[SC_GLORIA].timer!=-1 && bl->type != BL_PC) // グロリア(PCはpc.cで)
+ luk += 30;
+ if(sc_data[SC_CURSE].timer!=-1 ) // 呪い
+ luk=0;
+ if(sc_data[SC_TRUESIGHT].timer!=-1 && bl->type != BL_PC) // トゥルーサイト
+ luk += 5;
+ }
+ if(luk < 0) luk = 0;
+ return luk;
+}
+
+/*==========================================
+ * 対象のFleeを返す(汎用)
+ * 戻りは整数で1以上
+ *------------------------------------------
+ */
+int status_get_flee(struct block_list *bl)
+{
+ int flee=1;
+ struct status_change *sc_data;
+
+ nullpo_retr(1, bl);
+ sc_data=status_get_sc_data(bl);
+ if(bl->type==BL_PC && (struct map_session_data *)bl)
+ flee=((struct map_session_data *)bl)->flee;
+ else
+ flee=status_get_agi(bl) + status_get_lv(bl);
+
+ if(bl->type != BL_PC && sc_data){
+ if(sc_data[SC_WHISTLE].timer!=-1)
+ flee += flee*(sc_data[SC_WHISTLE].val1+sc_data[SC_WHISTLE].val2
+ +(sc_data[SC_WHISTLE].val3>>16))/100;
+ if(sc_data[SC_BLIND].timer!=-1)
+ flee -= flee*25/100;
+ if(sc_data[SC_WINDWALK].timer!=-1) // ウィンドウォーク
+ flee += flee*(sc_data[SC_WINDWALK].val2)/100;
+ if(sc_data[SC_SPIDERWEB].timer!=-1) //スパイダーウェブ
+ flee -= flee*50/100;
+ if(sc_data[SC_GOSPEL].timer!=-1) {
+ if (sc_data[SC_GOSPEL].val4 == BCT_PARTY &&
+ sc_data[SC_GOSPEL].val3 == 13)
+ flee += flee*5/100;
+ else if (sc_data[SC_GOSPEL].val4 == BCT_ENEMY &&
+ sc_data[SC_GOSPEL].val3 == 7)
+ flee = 0;
+ }
+ }
+ if(flee < 1) flee = 1;
+ return flee;
+}
+/*==========================================
+ * 対象のHitを返す(汎用)
+ * 戻りは整数で1以上
+ *------------------------------------------
+ */
+int status_get_hit(struct block_list *bl)
+{
+ int hit=1;
+ struct status_change *sc_data;
+
+ nullpo_retr(1, bl);
+ sc_data=status_get_sc_data(bl);
+ if(bl->type==BL_PC && (struct map_session_data *)bl)
+ hit=((struct map_session_data *)bl)->hit;
+ else
+ hit=status_get_dex(bl) + status_get_lv(bl);
+
+ if(bl->type != BL_PC && sc_data) {
+ if(sc_data[SC_HUMMING].timer!=-1) //
+ hit += hit*(sc_data[SC_HUMMING].val1*2+sc_data[SC_HUMMING].val2
+ +sc_data[SC_HUMMING].val3)/100;
+ if(sc_data[SC_BLIND].timer!=-1) // 呪い
+ hit -= hit*25/100;
+ if(sc_data[SC_TRUESIGHT].timer!=-1) // トゥルーサイト
+ hit += 3*(sc_data[SC_TRUESIGHT].val1);
+ if(sc_data[SC_CONCENTRATION].timer!=-1) //コンセントレーション
+ hit += (hit*(10*(sc_data[SC_CONCENTRATION].val1)))/100;
+ if(sc_data[SC_GOSPEL].timer!=-1 &&
+ sc_data[SC_GOSPEL].val4 == BCT_PARTY &&
+ sc_data[SC_GOSPEL].val3 == 14)
+ hit += hit*5/100;
+ }
+ if(hit < 1) hit = 1;
+ return hit;
+}
+/*==========================================
+ * 対象の完全回避を返す(汎用)
+ * 戻りは整数で1以上
+ *------------------------------------------
+ */
+int status_get_flee2(struct block_list *bl)
+{
+ int flee2=1;
+ struct status_change *sc_data;
+
+ nullpo_retr(1, bl);
+ sc_data=status_get_sc_data(bl);
+ if(bl->type==BL_PC && (struct map_session_data *)bl){
+ flee2 = status_get_luk(bl) + 10;
+ flee2 += ((struct map_session_data *)bl)->flee2 - (((struct map_session_data *)bl)->paramc[5] + 10);
+ }
+ else
+ flee2=status_get_luk(bl)+1;
+
+ if(sc_data) {
+ if(sc_data[SC_WHISTLE].timer!=-1 && bl->type != BL_PC)
+ flee2 += (sc_data[SC_WHISTLE].val1+sc_data[SC_WHISTLE].val2
+ +(sc_data[SC_WHISTLE].val3&0xffff))*10;
+ }
+ if(flee2 < 1) flee2 = 1;
+ return flee2;
+}
+/*==========================================
+ * 対象のクリティカルを返す(汎用)
+ * 戻りは整数で1以上
+ *------------------------------------------
+ */
+int status_get_critical(struct block_list *bl)
+{
+ int critical=1;
+ struct status_change *sc_data;
+
+ nullpo_retr(1, bl);
+ sc_data=status_get_sc_data(bl);
+ if(bl->type==BL_PC && (struct map_session_data *)bl){
+ critical = status_get_luk(bl)*3 + 10;
+ critical += ((struct map_session_data *)bl)->critical - ((((struct map_session_data *)bl)->paramc[5]*3) + 10);
+ }
+ else
+ critical=status_get_luk(bl)*3 + 1;
+
+ if(sc_data) {
+ if(sc_data[SC_FORTUNE].timer!=-1 && bl->type != BL_PC)
+ critical += (10+sc_data[SC_FORTUNE].val1+sc_data[SC_FORTUNE].val2
+ +sc_data[SC_FORTUNE].val3)*10;
+ if(sc_data[SC_EXPLOSIONSPIRITS].timer!=-1 && bl->type != BL_PC)
+ critical += sc_data[SC_EXPLOSIONSPIRITS].val2;
+ if(sc_data[SC_TRUESIGHT].timer!=-1 && bl->type != BL_PC) //トゥルーサイト
+ critical += critical*sc_data[SC_TRUESIGHT].val1/100;
+ }
+ if(critical < 1) critical = 1;
+ return critical;
+}
+/*==========================================
+ * base_atkの取得
+ * 戻りは整数で1以上
+ *------------------------------------------
+ */
+int status_get_baseatk(struct block_list *bl)
+{
+ struct status_change *sc_data;
+ int batk=1;
+
+ nullpo_retr(1, bl);
+ sc_data=status_get_sc_data(bl);
+ if(bl->type==BL_PC && (struct map_session_data *)bl) {
+ batk = ((struct map_session_data *)bl)->base_atk; //設定されているbase_atk
+ if (((struct map_session_data *)bl)->status.weapon < 16)
+ batk += ((struct map_session_data *)bl)->weapon_atk[((struct map_session_data *)bl)->status.weapon];
+ } else { //それ以外なら
+ int str,dstr;
+ str = status_get_str(bl); //STR
+ dstr = str/10;
+ batk = dstr*dstr + str; //base_atkを計算する
+ }
+ if(sc_data) { //状態異常あり
+ if(sc_data[SC_PROVOKE].timer!=-1 && bl->type != BL_PC) //PCでプロボック(SM_PROVOKE)状態
+ batk = batk*(100+2*sc_data[SC_PROVOKE].val1)/100; //base_atk増加
+ if(sc_data[SC_CURSE].timer!=-1 ) //呪われていたら
+ batk -= batk*25/100; //base_atkが25%減少
+ if(sc_data[SC_CONCENTRATION].timer!=-1 && bl->type != BL_PC) //コンセントレーション
+ batk += batk*(5*sc_data[SC_CONCENTRATION].val1)/100;
+ }
+ if(batk < 1) batk = 1; //base_atkは最低でも1
+ return batk;
+}
+/*==========================================
+ * 対象のAtkを返す(汎用)
+ * 戻りは整数で0以上
+ *------------------------------------------
+ */
+int status_get_atk(struct block_list *bl)
+{
+ struct status_change *sc_data;
+ int atk=0;
+
+ nullpo_retr(0, bl);
+ sc_data=status_get_sc_data(bl);
+ if(bl->type==BL_PC && (struct map_session_data *)bl)
+ atk = ((struct map_session_data*)bl)->watk;
+ else if(bl->type==BL_MOB && (struct mob_data *)bl)
+ atk = mob_db[((struct mob_data*)bl)->class_].atk1;
+ else if(bl->type==BL_PET && (struct pet_data *)bl)
+ atk = mob_db[((struct pet_data*)bl)->class_].atk1;
+
+ if(bl->type != BL_PC && sc_data) {
+ if(sc_data[SC_PROVOKE].timer!=-1)
+ atk = atk*(100+2*sc_data[SC_PROVOKE].val1)/100;
+ if(sc_data[SC_CURSE].timer!=-1)
+ atk -= atk*25/100;
+ if(sc_data[SC_CONCENTRATION].timer!=-1) //コンセントレーション
+ atk += atk*(5*sc_data[SC_CONCENTRATION].val1)/100;
+
+ if(sc_data[SC_GOSPEL].timer!=-1) {
+ if (sc_data[SC_GOSPEL].val4 == BCT_PARTY &&
+ sc_data[SC_GOSPEL].val3 == 12)
+ atk += atk*8/100;
+ else if (sc_data[SC_GOSPEL].val4 == BCT_ENEMY &&
+ sc_data[SC_GOSPEL].val3 == 6)
+ atk = 0;
+ }
+ }
+ if(atk < 0) atk = 0;
+ return atk;
+}
+/*==========================================
+ * 対象の左手Atkを返す(汎用)
+ * 戻りは整数で0以上
+ *------------------------------------------
+ */
+int status_get_atk_(struct block_list *bl)
+{
+ nullpo_retr(0, bl);
+ if(bl->type==BL_PC && (struct map_session_data *)bl){
+ int atk=((struct map_session_data*)bl)->watk_;
+ return atk;
+ }
+ else
+ return 0;
+}
+/*==========================================
+ * 対象のAtk2を返す(汎用)
+ * 戻りは整数で0以上
+ *------------------------------------------
+ */
+int status_get_atk2(struct block_list *bl)
+{
+ nullpo_retr(0, bl);
+ if(bl->type==BL_PC && (struct map_session_data *)bl)
+ return ((struct map_session_data*)bl)->watk2;
+ else {
+ struct status_change *sc_data=status_get_sc_data(bl);
+ int atk2=0;
+ if(bl->type==BL_MOB && (struct mob_data *)bl)
+ atk2 = mob_db[((struct mob_data*)bl)->class_].atk2;
+ else if(bl->type==BL_PET && (struct pet_data *)bl)
+ atk2 = mob_db[((struct pet_data*)bl)->class_].atk2;
+ if(sc_data) {
+ if( sc_data[SC_IMPOSITIO].timer!=-1)
+ atk2 += sc_data[SC_IMPOSITIO].val1*5;
+ if( sc_data[SC_PROVOKE].timer!=-1 )
+ atk2 = atk2*(100+2*sc_data[SC_PROVOKE].val1)/100;
+ if( sc_data[SC_CURSE].timer!=-1 )
+ atk2 -= atk2*25/100;
+ if(sc_data[SC_DRUMBATTLE].timer!=-1)
+ atk2 += sc_data[SC_DRUMBATTLE].val2;
+ if(sc_data[SC_NIBELUNGEN].timer!=-1 && (status_get_element(bl)/10) >= 8 )
+ atk2 += sc_data[SC_NIBELUNGEN].val3;
+ if(sc_data[SC_STRIPWEAPON].timer!=-1)
+ atk2 = atk2*sc_data[SC_STRIPWEAPON].val2/100;
+ if(sc_data[SC_CONCENTRATION].timer!=-1) //コンセントレーション
+ atk2 += atk2*(5*sc_data[SC_CONCENTRATION].val1)/100;
+ }
+ if(atk2 < 0) atk2 = 0;
+ return atk2;
+ }
+ return 0;
+}
+/*==========================================
+ * 対象の左手Atk2を返す(汎用)
+ * 戻りは整数で0以上
+ *------------------------------------------
+ */
+int status_get_atk_2(struct block_list *bl)
+{
+ nullpo_retr(0, bl);
+ if(bl->type==BL_PC && (struct map_session_data *)bl)
+ return ((struct map_session_data*)bl)->watk_2;
+ else
+ return 0;
+}
+/*==========================================
+ * 対象のMAtk1を返す(汎用)
+ * 戻りは整数で0以上
+ *------------------------------------------
+ */
+int status_get_matk1(struct block_list *bl)
+{
+ struct status_change *sc_data;
+ nullpo_retr(0, bl);
+ sc_data=status_get_sc_data(bl);
+ if(bl->type==BL_MOB){
+ int matk,int_=status_get_int(bl);
+ matk = int_+(int_/5)*(int_/5);
+
+ if(sc_data)
+ if(sc_data[SC_MINDBREAKER].timer!=-1 && bl->type != BL_PC)
+ matk = matk*(100+2*sc_data[SC_MINDBREAKER].val1)/100;
+ return matk;
+ }
+ else if(bl->type==BL_PC && (struct map_session_data *)bl)
+ return ((struct map_session_data *)bl)->matk1;
+ else if(bl->type==BL_PET){
+ int matk,int_=status_get_int(bl);
+ matk = int_+(int_/5)*(int_/5);
+
+ if(sc_data)
+ if(sc_data[SC_MINDBREAKER].timer!=-1 && bl->type != BL_PC)
+ matk = matk*(100+2*sc_data[SC_MINDBREAKER].val1)/100;
+ return matk;
+ }
+ else
+ return 0;
+}
+/*==========================================
+ * 対象のMAtk2を返す(汎用)
+ * 戻りは整数で0以上
+ *------------------------------------------
+ */
+int status_get_matk2(struct block_list *bl)
+{
+ struct status_change *sc_data=status_get_sc_data(bl);
+ nullpo_retr(0, bl);
+ if(bl->type==BL_MOB){
+ int matk,int_=status_get_int(bl);
+ matk = int_+(int_/7)*(int_/7);
+
+ if(sc_data)
+ if(sc_data[SC_MINDBREAKER].timer!=-1 && bl->type != BL_PC)
+ matk = matk*(100+2*sc_data[SC_MINDBREAKER].val1)/100;
+ return matk;
+ }
+ else if(bl->type==BL_PC && (struct map_session_data *)bl)
+ return ((struct map_session_data *)bl)->matk2;
+ else if(bl->type==BL_PET){
+ int matk,int_=status_get_int(bl);
+ matk = int_+(int_/7)*(int_/7);
+ if(sc_data)
+ if(sc_data[SC_MINDBREAKER].timer!=-1 && bl->type != BL_PC)
+ matk = matk*(100+2*sc_data[SC_MINDBREAKER].val1)/100;
+ return matk;
+ }
+ else
+ return 0;
+}
+/*==========================================
+ * 対象のDefを返す(汎用)
+ * 戻りは整数で0以上
+ *------------------------------------------
+ */
+int status_get_def(struct block_list *bl)
+{
+ struct status_change *sc_data;
+ int def=0,skilltimer=-1,skillid=0;
+
+ nullpo_retr(0, bl);
+ sc_data=status_get_sc_data(bl);
+ if(bl->type==BL_PC && (struct map_session_data *)bl){
+ def = ((struct map_session_data *)bl)->def;
+ skilltimer = ((struct map_session_data *)bl)->skilltimer;
+ skillid = ((struct map_session_data *)bl)->skillid;
+ }
+ else if(bl->type==BL_MOB && (struct mob_data *)bl) {
+ def = mob_db[((struct mob_data *)bl)->class_].def;
+ skilltimer = ((struct mob_data *)bl)->skilltimer;
+ skillid = ((struct mob_data *)bl)->skillid;
+ }
+ else if(bl->type==BL_PET && (struct pet_data *)bl)
+ def = mob_db[((struct pet_data *)bl)->class_].def;
+
+ if(def < 1000000) {
+ if(sc_data) {
+ //凍結、石化時は右シフト
+ if(sc_data[SC_FREEZE].timer != -1 || (sc_data[SC_STONE].timer != -1 && sc_data[SC_STONE].val2 == 0))
+ def >>= 1;
+
+ if (bl->type != BL_PC) {
+ //キーピング時はDEF100
+ if( sc_data[SC_KEEPING].timer!=-1)
+ def = 100;
+ //プロボック時は減算
+ if( sc_data[SC_PROVOKE].timer!=-1)
+ def = (def*(100 - 6*sc_data[SC_PROVOKE].val1)+50)/100;
+ //戦太鼓の響き時は加算
+ if( sc_data[SC_DRUMBATTLE].timer!=-1)
+ def += sc_data[SC_DRUMBATTLE].val3;
+ //毒にかかっている時は減算
+ if(sc_data[SC_POISON].timer!=-1)
+ def = def*75/100;
+ //ストリップシールド時は減算
+ if(sc_data[SC_STRIPSHIELD].timer!=-1)
+ def = def*sc_data[SC_STRIPSHIELD].val2/100;
+ //シグナムクルシス時は減算
+ if(sc_data[SC_SIGNUMCRUCIS].timer!=-1)
+ def = def * (100 - sc_data[SC_SIGNUMCRUCIS].val2)/100;
+ //永遠の混沌時はDEF0になる
+ if(sc_data[SC_ETERNALCHAOS].timer!=-1)
+ def = 0;
+ //コンセントレーション時は減算
+ if( sc_data[SC_CONCENTRATION].timer!=-1)
+ def = (def*(100 - 5*sc_data[SC_CONCENTRATION].val1))/100;
+
+ if(sc_data[SC_GOSPEL].timer!=-1) {
+ if (sc_data[SC_GOSPEL].val4 == BCT_PARTY &&
+ sc_data[SC_GOSPEL].val3 == 11)
+ def += def*25/100;
+ else if (sc_data[SC_GOSPEL].val4 == BCT_ENEMY &&
+ sc_data[SC_GOSPEL].val3 == 5)
+ def = 0;
+ }
+ }
+ }
+ //詠唱中は詠唱時減算率に基づいて減算
+ if(skilltimer != -1) {
+ int def_rate = skill_get_castdef(skillid);
+ if(def_rate != 0)
+ def = (def * (100 - def_rate))/100;
+ }
+ }
+ if(def < 0) def = 0;
+ return def;
+}
+/*==========================================
+ * 対象のMDefを返す(汎用)
+ * 戻りは整数で0以上
+ *------------------------------------------
+ */
+int status_get_mdef(struct block_list *bl)
+{
+ struct status_change *sc_data;
+ int mdef=0;
+
+ nullpo_retr(0, bl);
+ sc_data=status_get_sc_data(bl);
+ if(bl->type==BL_PC && (struct map_session_data *)bl)
+ mdef = ((struct map_session_data *)bl)->mdef;
+ else if(bl->type==BL_MOB && (struct mob_data *)bl)
+ mdef = mob_db[((struct mob_data *)bl)->class_].mdef;
+ else if(bl->type==BL_PET && (struct pet_data *)bl)
+ mdef = mob_db[((struct pet_data *)bl)->class_].mdef;
+
+ if(mdef < 1000000) {
+ if(sc_data) {
+ //バリアー状態時はMDEF100
+ if(sc_data[SC_BARRIER].timer != -1)
+ mdef = 100;
+ //凍結、石化時は1.25倍
+ if(sc_data[SC_FREEZE].timer != -1 || (sc_data[SC_STONE].timer != -1 && sc_data[SC_STONE].val2 == 0))
+ mdef = mdef*125/100;
+ if( sc_data[SC_MINDBREAKER].timer!=-1 && bl->type != BL_PC)
+ mdef -= (mdef*6*sc_data[SC_MINDBREAKER].val1)/100;
+ }
+ }
+ if(mdef < 0) mdef = 0;
+ return mdef;
+}
+/*==========================================
+ * 対象のDef2を返す(汎用)
+ * 戻りは整数で1以上
+ *------------------------------------------
+ */
+int status_get_def2(struct block_list *bl)
+{
+ struct status_change *sc_data;
+ int def2=1;
+
+ nullpo_retr(1, bl);
+ sc_data=status_get_sc_data(bl);
+ if(bl->type==BL_PC)
+ def2 = ((struct map_session_data *)bl)->def2;
+ else if(bl->type==BL_MOB)
+ def2 = mob_db[((struct mob_data *)bl)->class_].vit;
+ else if(bl->type==BL_PET)
+ def2 = mob_db[((struct pet_data *)bl)->class_].vit;
+
+ if(bl->type != BL_PC && sc_data) {
+ if( sc_data[SC_ANGELUS].timer!=-1)
+ def2 = def2*(110+5*sc_data[SC_ANGELUS].val1)/100;
+ if( sc_data[SC_PROVOKE].timer!=-1)
+ def2 = (def2*(100 - 6*sc_data[SC_PROVOKE].val1)+50)/100;
+ if(sc_data[SC_POISON].timer!=-1)
+ def2 = def2*75/100;
+ //コンセントレーション時は減算
+ if( sc_data[SC_CONCENTRATION].timer!=-1)
+ def2 = def2*(100 - 5*sc_data[SC_CONCENTRATION].val1)/100;
+
+ if(sc_data[SC_GOSPEL].timer!=-1) {
+ if (sc_data[SC_GOSPEL].val4 == BCT_PARTY &&
+ sc_data[SC_GOSPEL].val3 == 11)
+ def2 += def2*25/100;
+ else if (sc_data[SC_GOSPEL].val4 == BCT_ENEMY &&
+ sc_data[SC_GOSPEL].val3 == 5)
+ def2 = 0;
+ }
+ }
+ if(def2 < 1) def2 = 1;
+ return def2;
+}
+/*==========================================
+ * 対象のMDef2を返す(汎用)
+ * 戻りは整数で0以上
+ *------------------------------------------
+ */
+int status_get_mdef2(struct block_list *bl)
+{
+ int mdef2=0;
+ struct status_change *sc_data=status_get_sc_data(bl);
+
+ nullpo_retr(0, bl);
+ if(bl->type==BL_MOB)
+ mdef2 = mob_db[((struct mob_data *)bl)->class_].int_ + (mob_db[((struct mob_data *)bl)->class_].vit>>1);
+ else if(bl->type==BL_PC)
+ mdef2 = ((struct map_session_data *)bl)->mdef2 + (((struct map_session_data *)bl)->paramc[2]>>1);
+ else if(bl->type==BL_PET)
+ mdef2 = mob_db[((struct pet_data *)bl)->class_].int_ + (mob_db[((struct pet_data *)bl)->class_].vit>>1);
+ if(sc_data) {
+ if( sc_data[SC_MINDBREAKER].timer!=-1 && bl->type != BL_PC)
+ mdef2 -= (mdef2*6*sc_data[SC_MINDBREAKER].val1)/100;
+ }
+ if(mdef2 < 0) mdef2 = 0;
+ return mdef2;
+}
+/*==========================================
+ * 対象のSpeed(移動速度)を返す(汎用)
+ * 戻りは整数で1以上
+ * Speedは小さいほうが移動速度が速い
+ *------------------------------------------
+ */
+int status_get_speed(struct block_list *bl)
+{
+ nullpo_retr(1000, bl);
+ if(bl->type==BL_PC && (struct map_session_data *)bl)
+ return ((struct map_session_data *)bl)->speed;
+ else {
+ struct status_change *sc_data=status_get_sc_data(bl);
+ int speed = 1000;
+ if(bl->type==BL_MOB && (struct mob_data *)bl) {
+ speed = ((struct mob_data *)bl)->speed;
+ if(battle_config.mobs_level_up) // increase from mobs leveling up [Valaris]
+ speed-=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class_].lv;
+ }
+ else if(bl->type==BL_PET && (struct pet_data *)bl)
+ speed = ((struct pet_data *)bl)->msd->petDB->speed;
+
+ if(sc_data) {
+ //速度増加時は25%減算
+ if(sc_data[SC_INCREASEAGI].timer!=-1 && sc_data[SC_DONTFORGETME].timer == -1)
+ speed -= speed*25/100;
+ //速度減少時は25%加算
+ if(sc_data[SC_DECREASEAGI].timer!=-1)
+ speed = speed*125/100;
+ //クァグマイア時は50%加算
+ if(sc_data[SC_QUAGMIRE].timer!=-1)
+ speed = speed*3/2;
+ //私を忘れないで…時は加算
+ if(sc_data[SC_DONTFORGETME].timer!=-1)
+ speed = speed*(100+sc_data[SC_DONTFORGETME].val1*2 + sc_data[SC_DONTFORGETME].val2 + (sc_data[SC_DONTFORGETME].val3&0xffff))/100;
+ //金剛時は25%加算
+ if(sc_data[SC_STEELBODY].timer!=-1)
+ speed = speed*125/100;
+ //ディフェンダー時は加算
+ // removed as of 12/14's patch [celest]
+ /*if(sc_data[SC_DEFENDER].timer!=-1)
+ speed = (speed * (155 - sc_data[SC_DEFENDER].val1*5)) / 100;*/
+ //踊り状態は4倍遅い
+ if(sc_data[SC_DANCING].timer!=-1 )
+ speed *= 6;
+ //呪い時は450加算
+ if(sc_data[SC_CURSE].timer!=-1)
+ speed = speed + 450;
+ //ウィンドウォーク時はLv*2%減算
+ if(sc_data[SC_WINDWALK].timer!=-1 && sc_data[SC_INCREASEAGI].timer==-1)
+ speed -= (speed*(sc_data[SC_WINDWALK].val1*2))/100;
+ if(sc_data[SC_SLOWDOWN].timer!=-1)
+ speed = speed*150/100;
+ if(sc_data[SC_SPEEDUP0].timer!=-1)
+ speed -= speed*25/100;
+ if(sc_data[SC_GOSPEL].timer!=-1 &&
+ sc_data[SC_GOSPEL].val4 == BCT_ENEMY &&
+ sc_data[SC_GOSPEL].val3 == 8)
+ speed = speed*125/100;
+ }
+ if(speed < 1) speed = 1;
+ return speed;
+ }
+
+ return 1000;
+}
+/*==========================================
+ * 対象のaDelay(攻撃時ディレイ)を返す(汎用)
+ * aDelayは小さいほうが攻撃速度が速い
+ *------------------------------------------
+ */
+int status_get_adelay(struct block_list *bl)
+{
+ nullpo_retr(4000, bl);
+ if(bl->type==BL_PC && (struct map_session_data *)bl)
+ return (((struct map_session_data *)bl)->aspd<<1);
+ else {
+ struct status_change *sc_data=status_get_sc_data(bl);
+ int adelay=4000,aspd_rate = 100,i;
+ if(bl->type==BL_MOB && (struct mob_data *)bl)
+ adelay = mob_db[((struct mob_data *)bl)->class_].adelay;
+ else if(bl->type==BL_PET && (struct pet_data *)bl)
+ adelay = mob_db[((struct pet_data *)bl)->class_].adelay;
+
+ if(sc_data) {
+ //ツーハンドクイッケン使用時でクァグマイアでも私を忘れないで…でもない時は3割減算
+ if(sc_data[SC_TWOHANDQUICKEN].timer != -1 && sc_data[SC_QUAGMIRE].timer == -1 && sc_data[SC_DONTFORGETME].timer == -1) // 2HQ
+ aspd_rate -= 30;
+ //アドレナリンラッシュ使用時でツーハンドクイッケンでもクァグマイアでも私を忘れないで…でもない時は
+ if(sc_data[SC_ADRENALINE].timer != -1 && sc_data[SC_TWOHANDQUICKEN].timer == -1 &&
+ sc_data[SC_QUAGMIRE].timer == -1 && sc_data[SC_DONTFORGETME].timer == -1) { // アドレナリンラッシュ
+ //使用者とパーティメンバーで格差が出る設定でなければ3割減算
+ if(sc_data[SC_ADRENALINE].val2 || !battle_config.party_skill_penalty)
+ aspd_rate -= 30;
+ //そうでなければ2.5割減算
+ else
+ aspd_rate -= 25;
+ }
+ //スピアクィッケン時は減算
+ if(sc_data[SC_SPEARSQUICKEN].timer != -1 && sc_data[SC_ADRENALINE].timer == -1 &&
+ sc_data[SC_TWOHANDQUICKEN].timer == -1 && sc_data[SC_QUAGMIRE].timer == -1 && sc_data[SC_DONTFORGETME].timer == -1) // スピアクィッケン
+ aspd_rate -= sc_data[SC_SPEARSQUICKEN].val2;
+ //夕日のアサシンクロス時は減算
+ if(sc_data[SC_ASSNCROS].timer!=-1 && // 夕陽のアサシンクロス
+ sc_data[SC_TWOHANDQUICKEN].timer==-1 && sc_data[SC_ADRENALINE].timer==-1 && sc_data[SC_SPEARSQUICKEN].timer==-1 &&
+ sc_data[SC_DONTFORGETME].timer == -1)
+ aspd_rate -= 5+sc_data[SC_ASSNCROS].val1+sc_data[SC_ASSNCROS].val2+sc_data[SC_ASSNCROS].val3;
+ //私を忘れないで…時は加算
+ if(sc_data[SC_DONTFORGETME].timer!=-1) // 私を忘れないで
+ aspd_rate += sc_data[SC_DONTFORGETME].val1*3 + sc_data[SC_DONTFORGETME].val2 + (sc_data[SC_DONTFORGETME].val3>>16);
+ //金剛時25%加算
+ if(sc_data[SC_STEELBODY].timer!=-1) // 金剛
+ aspd_rate += 25;
+ //増速ポーション使用時は減算
+ if( sc_data[i=SC_SPEEDPOTION3].timer!=-1 || sc_data[i=SC_SPEEDPOTION2].timer!=-1 || sc_data[i=SC_SPEEDPOTION1].timer!=-1 || sc_data[i=SC_SPEEDPOTION0].timer!=-1)
+ aspd_rate -= sc_data[i].val2;
+ //ディフェンダー時は加算
+ if(sc_data[SC_DEFENDER].timer != -1)
+ adelay += (1100 - sc_data[SC_DEFENDER].val1*100);
+ if(sc_data[SC_GOSPEL].timer!=-1 &&
+ sc_data[SC_GOSPEL].val4 == BCT_ENEMY &&
+ sc_data[SC_GOSPEL].val3 == 8)
+ aspd_rate = aspd_rate*125/100;
+ }
+ if(aspd_rate != 100)
+ adelay = adelay*aspd_rate/100;
+ if(adelay < battle_config.monster_max_aspd<<1) adelay = battle_config.monster_max_aspd<<1;
+ return adelay;
+ }
+ return 4000;
+}
+int status_get_amotion(struct block_list *bl)
+{
+ nullpo_retr(2000, bl);
+ if(bl->type==BL_PC && (struct map_session_data *)bl)
+ return ((struct map_session_data *)bl)->amotion;
+ else {
+ struct status_change *sc_data=status_get_sc_data(bl);
+ int amotion=2000,aspd_rate = 100,i;
+ if(bl->type==BL_MOB && (struct mob_data *)bl)
+ amotion = mob_db[((struct mob_data *)bl)->class_].amotion;
+ else if(bl->type==BL_PET && (struct pet_data *)bl)
+ amotion = mob_db[((struct pet_data *)bl)->class_].amotion;
+
+ if(sc_data) {
+ if(sc_data[SC_TWOHANDQUICKEN].timer != -1 && sc_data[SC_QUAGMIRE].timer == -1 && sc_data[SC_DONTFORGETME].timer == -1) // 2HQ
+ aspd_rate -= 30;
+ if(sc_data[SC_ADRENALINE].timer != -1 && sc_data[SC_TWOHANDQUICKEN].timer == -1 &&
+ sc_data[SC_QUAGMIRE].timer == -1 && sc_data[SC_DONTFORGETME].timer == -1) { // アドレナリンラッシュ
+ if(sc_data[SC_ADRENALINE].val2 || !battle_config.party_skill_penalty)
+ aspd_rate -= 30;
+ else
+ aspd_rate -= 25;
+ }
+ if(sc_data[SC_SPEARSQUICKEN].timer != -1 && sc_data[SC_ADRENALINE].timer == -1 &&
+ sc_data[SC_TWOHANDQUICKEN].timer == -1 && sc_data[SC_QUAGMIRE].timer == -1 && sc_data[SC_DONTFORGETME].timer == -1) // スピアクィッケン
+ aspd_rate -= sc_data[SC_SPEARSQUICKEN].val2;
+ if(sc_data[SC_ASSNCROS].timer!=-1 && // 夕陽のアサシンクロス
+ sc_data[SC_TWOHANDQUICKEN].timer==-1 && sc_data[SC_ADRENALINE].timer==-1 && sc_data[SC_SPEARSQUICKEN].timer==-1 &&
+ sc_data[SC_DONTFORGETME].timer == -1)
+ aspd_rate -= 5+sc_data[SC_ASSNCROS].val1+sc_data[SC_ASSNCROS].val2+sc_data[SC_ASSNCROS].val3;
+ if(sc_data[SC_DONTFORGETME].timer!=-1) // 私を忘れないで
+ aspd_rate += sc_data[SC_DONTFORGETME].val1*3 + sc_data[SC_DONTFORGETME].val2 + (sc_data[SC_DONTFORGETME].val3>>16);
+ if(sc_data[SC_STEELBODY].timer!=-1) // 金剛
+ aspd_rate += 25;
+ if( sc_data[i=SC_SPEEDPOTION3].timer!=-1 || sc_data[i=SC_SPEEDPOTION2].timer!=-1 || sc_data[i=SC_SPEEDPOTION1].timer!=-1 || sc_data[i=SC_SPEEDPOTION0].timer!=-1)
+ aspd_rate -= sc_data[i].val2;
+ if(sc_data[SC_DEFENDER].timer != -1)
+ amotion += (550 - sc_data[SC_DEFENDER].val1*50);
+ }
+ if(aspd_rate != 100)
+ amotion = amotion*aspd_rate/100;
+ if(amotion < battle_config.monster_max_aspd) amotion = battle_config.monster_max_aspd;
+ return amotion;
+ }
+ return 2000;
+}
+int status_get_dmotion(struct block_list *bl)
+{
+ int ret;
+ struct status_change *sc_data;
+
+ nullpo_retr(0, bl);
+ sc_data = status_get_sc_data(bl);
+ if(bl->type==BL_MOB && (struct mob_data *)bl){
+ ret=mob_db[((struct mob_data *)bl)->class_].dmotion;
+ if(battle_config.monster_damage_delay_rate != 100)
+ ret = ret*battle_config.monster_damage_delay_rate/400;
+ }
+ else if(bl->type==BL_PC && (struct map_session_data *)bl){
+ ret=((struct map_session_data *)bl)->dmotion;
+ if(battle_config.pc_damage_delay_rate != 100)
+ ret = ret*battle_config.pc_damage_delay_rate/400;
+ }
+ else if(bl->type==BL_PET && (struct pet_data *)bl)
+ ret=mob_db[((struct pet_data *)bl)->class_].dmotion;
+ else
+ return 2000;
+
+ if((sc_data && (sc_data[SC_ENDURE].timer!=-1 || sc_data[SC_BERSERK].timer!=-1)) ||
+ (bl->type == BL_PC && ((struct map_session_data *)bl)->special_state.infinite_endure))
+ ret=0;
+
+ return ret;
+}
+int status_get_element(struct block_list *bl)
+{
+ int ret = 20;
+ struct status_change *sc_data;
+
+ nullpo_retr(ret, bl);
+ sc_data = status_get_sc_data(bl);
+ if(bl->type==BL_MOB && (struct mob_data *)bl) // 10の位=Lv*2、1の位=属性
+ ret=((struct mob_data *)bl)->def_ele;
+ else if(bl->type==BL_PC && (struct map_session_data *)bl)
+ ret=20+((struct map_session_data *)bl)->def_ele; // 防御属性Lv1
+ else if(bl->type==BL_PET && (struct pet_data *)bl)
+ ret = mob_db[((struct pet_data *)bl)->class_].element;
+
+ if(sc_data) {
+ if( sc_data[SC_BENEDICTIO].timer!=-1 ) // 聖体降福
+ ret=26;
+ if( sc_data[SC_FREEZE].timer!=-1 ) // 凍結
+ ret=21;
+ if( sc_data[SC_STONE].timer!=-1 && sc_data[SC_STONE].val2==0)
+ ret=22;
+ }
+
+ return ret;
+}
+
+int status_get_attack_element(struct block_list *bl)
+{
+ int ret = 0;
+ struct status_change *sc_data=status_get_sc_data(bl);
+
+ nullpo_retr(0, bl);
+ if(bl->type==BL_MOB && (struct mob_data *)bl)
+ ret=0;
+ else if(bl->type==BL_PC && (struct map_session_data *)bl)
+ ret=((struct map_session_data *)bl)->atk_ele;
+ else if(bl->type==BL_PET && (struct pet_data *)bl)
+ ret=0;
+
+ if(sc_data) {
+ if( sc_data[SC_FROSTWEAPON].timer!=-1) // フロストウェポン
+ ret=1;
+ if( sc_data[SC_SEISMICWEAPON].timer!=-1) // サイズミックウェポン
+ ret=2;
+ if( sc_data[SC_FLAMELAUNCHER].timer!=-1) // フレームランチャー
+ ret=3;
+ if( sc_data[SC_LIGHTNINGLOADER].timer!=-1) // ライトニングローダー
+ ret=4;
+ if( sc_data[SC_ENCPOISON].timer!=-1) // エンチャントポイズン
+ ret=5;
+ if( sc_data[SC_ASPERSIO].timer!=-1) // アスペルシオ
+ ret=6;
+ }
+
+ return ret;
+}
+int status_get_attack_element2(struct block_list *bl)
+{
+ nullpo_retr(0, bl);
+ if(bl->type==BL_PC && (struct map_session_data *)bl) {
+ int ret = ((struct map_session_data *)bl)->atk_ele_;
+ struct status_change *sc_data = ((struct map_session_data *)bl)->sc_data;
+
+ if(sc_data) {
+ if( sc_data[SC_FROSTWEAPON].timer!=-1) // フロストウェポン
+ ret=1;
+ if( sc_data[SC_SEISMICWEAPON].timer!=-1) // サイズミックウェポン
+ ret=2;
+ if( sc_data[SC_FLAMELAUNCHER].timer!=-1) // フレームランチャー
+ ret=3;
+ if( sc_data[SC_LIGHTNINGLOADER].timer!=-1) // ライトニングローダー
+ ret=4;
+ if( sc_data[SC_ENCPOISON].timer!=-1) // エンチャントポイズン
+ ret=5;
+ if( sc_data[SC_ASPERSIO].timer!=-1) // アスペルシオ
+ ret=6;
+ }
+ return ret;
+ }
+ return 0;
+}
+int status_get_party_id(struct block_list *bl)
+{
+ nullpo_retr(0, bl);
+ if(bl->type==BL_PC && (struct map_session_data *)bl)
+ return ((struct map_session_data *)bl)->status.party_id;
+ else if(bl->type==BL_MOB && (struct mob_data *)bl){
+ struct mob_data *md=(struct mob_data *)bl;
+ if( md->master_id>0 )
+ return -md->master_id;
+ return -md->bl.id;
+ }
+ else if(bl->type==BL_SKILL && (struct skill_unit *)bl)
+ return ((struct skill_unit *)bl)->group->party_id;
+ else
+ return 0;
+}
+int status_get_guild_id(struct block_list *bl)
+{
+ nullpo_retr(0, bl);
+ if(bl->type==BL_PC && (struct map_session_data *)bl)
+ return ((struct map_session_data *)bl)->status.guild_id;
+ else if(bl->type==BL_MOB && (struct mob_data *)bl)
+ return ((struct mob_data *)bl)->class_;
+ else if(bl->type==BL_SKILL && (struct skill_unit *)bl)
+ return ((struct skill_unit *)bl)->group->guild_id;
+ else
+ return 0;
+}
+int status_get_race(struct block_list *bl)
+{
+ nullpo_retr(0, bl);
+ if(bl->type==BL_MOB && (struct mob_data *)bl)
+ return mob_db[((struct mob_data *)bl)->class_].race;
+ else if(bl->type==BL_PC && (struct map_session_data *)bl)
+ return 7;
+ else if(bl->type==BL_PET && (struct pet_data *)bl)
+ return mob_db[((struct pet_data *)bl)->class_].race;
+ else
+ return 0;
+}
+int status_get_size(struct block_list *bl)
+{
+ nullpo_retr(1, bl);
+ if(bl->type==BL_MOB && (struct mob_data *)bl)
+ return mob_db[((struct mob_data *)bl)->class_].size;
+ else if(bl->type==BL_PC && (struct map_session_data *)bl)
+ return 1;
+ else if(bl->type==BL_PET && (struct pet_data *)bl)
+ return mob_db[((struct pet_data *)bl)->class_].size;
+ else
+ return 1;
+}
+int status_get_mode(struct block_list *bl)
+{
+ nullpo_retr(0x01, bl);
+ if(bl->type==BL_MOB && (struct mob_data *)bl)
+ return mob_db[((struct mob_data *)bl)->class_].mode;
+ else if(bl->type==BL_PET && (struct pet_data *)bl)
+ return mob_db[((struct pet_data *)bl)->class_].mode;
+ else
+ return 0x01; // とりあえず動くということで1
+}
+
+int status_get_mexp(struct block_list *bl)
+{
+ nullpo_retr(0, bl);
+ if(bl->type==BL_MOB && (struct mob_data *)bl)
+ return mob_db[((struct mob_data *)bl)->class_].mexp;
+ else if(bl->type==BL_PET && (struct pet_data *)bl)
+ return mob_db[((struct pet_data *)bl)->class_].mexp;
+ else
+ return 0;
+}
+
+// StatusChange系の所得
+struct status_change *status_get_sc_data(struct block_list *bl)
+{
+ nullpo_retr(NULL, bl);
+ if(bl->type==BL_MOB && (struct mob_data *)bl)
+ return ((struct mob_data*)bl)->sc_data;
+ else if(bl->type==BL_PC && (struct map_session_data *)bl)
+ return ((struct map_session_data*)bl)->sc_data;
+ return NULL;
+}
+short *status_get_sc_count(struct block_list *bl)
+{
+ nullpo_retr(NULL, bl);
+ if(bl->type==BL_MOB && (struct mob_data *)bl)
+ return &((struct mob_data*)bl)->sc_count;
+ else if(bl->type==BL_PC && (struct map_session_data *)bl)
+ return &((struct map_session_data*)bl)->sc_count;
+ return NULL;
+}
+short *status_get_opt1(struct block_list *bl)
+{
+ nullpo_retr(0, bl);
+ if(bl->type==BL_MOB && (struct mob_data *)bl)
+ return &((struct mob_data*)bl)->opt1;
+ else if(bl->type==BL_PC && (struct map_session_data *)bl)
+ return &((struct map_session_data*)bl)->opt1;
+ else if(bl->type==BL_NPC && (struct npc_data *)bl)
+ return &((struct npc_data*)bl)->opt1;
+ return 0;
+}
+short *status_get_opt2(struct block_list *bl)
+{
+ nullpo_retr(0, bl);
+ if(bl->type==BL_MOB && (struct mob_data *)bl)
+ return &((struct mob_data*)bl)->opt2;
+ else if(bl->type==BL_PC && (struct map_session_data *)bl)
+ return &((struct map_session_data*)bl)->opt2;
+ else if(bl->type==BL_NPC && (struct npc_data *)bl)
+ return &((struct npc_data*)bl)->opt2;
+ return 0;
+}
+short *status_get_opt3(struct block_list *bl)
+{
+ nullpo_retr(0, bl);
+ if(bl->type==BL_MOB && (struct mob_data *)bl)
+ return &((struct mob_data*)bl)->opt3;
+ else if(bl->type==BL_PC && (struct map_session_data *)bl)
+ return &((struct map_session_data*)bl)->opt3;
+ else if(bl->type==BL_NPC && (struct npc_data *)bl)
+ return &((struct npc_data*)bl)->opt3;
+ return 0;
+}
+short *status_get_option(struct block_list *bl)
+{
+ nullpo_retr(0, bl);
+ if(bl->type==BL_MOB && (struct mob_data *)bl)
+ return &((struct mob_data*)bl)->option;
+ else if(bl->type==BL_PC && (struct map_session_data *)bl)
+ return &((struct map_session_data*)bl)->status.option;
+ else if(bl->type==BL_NPC && (struct npc_data *)bl)
+ return &((struct npc_data*)bl)->option;
+ return 0;
+}
+
+/*==========================================
+ * ステータス異常開始
+ *------------------------------------------
+ */
+int status_change_start(struct block_list *bl,int type,int val1,int val2,int val3,int val4,int tick,int flag)
+{
+ struct map_session_data *sd = NULL;
+ struct status_change* sc_data;
+ short *sc_count, *option, *opt1, *opt2, *opt3;
+ int opt_flag = 0, calc_flag = 0,updateflag = 0, save_flag = 0, race, mode, elem, undead_flag;
+ int scdef=0;
+
+ nullpo_retr(0, bl);
+ if(bl->type == BL_SKILL)
+ return 0;
+ nullpo_retr(0, sc_data=status_get_sc_data(bl));
+ nullpo_retr(0, sc_count=status_get_sc_count(bl));
+ nullpo_retr(0, option=status_get_option(bl));
+ nullpo_retr(0, opt1=status_get_opt1(bl));
+ nullpo_retr(0, opt2=status_get_opt2(bl));
+ nullpo_retr(0, opt3=status_get_opt3(bl));
+
+
+ race=status_get_race(bl);
+ mode=status_get_mode(bl);
+ elem=status_get_elem_type(bl);
+ undead_flag=battle_check_undead(race,elem);
+
+ if(type == SC_AETERNA && (sc_data[SC_STONE].timer != -1 || sc_data[SC_FREEZE].timer != -1) )
+ return 0;
+
+ switch(type){
+ case SC_STONE:
+ case SC_FREEZE:
+ scdef=3+status_get_mdef(bl)+status_get_luk(bl)/3;
+ break;
+ case SC_STAN:
+ case SC_SILENCE:
+ case SC_POISON:
+ case SC_DPOISON:
+ scdef=3+status_get_vit(bl)+status_get_luk(bl)/3;
+ break;
+ case SC_SLEEP:
+ case SC_BLIND:
+ scdef=3+status_get_int(bl)+status_get_luk(bl)/3;
+ break;
+ case SC_CURSE:
+ scdef=3+status_get_luk(bl);
+ break;
+
+// case SC_CONFUSION:
+ default:
+ scdef=0;
+ }
+ if(scdef>=100)
+ return 0;
+ if(bl->type==BL_PC){
+ sd=(struct map_session_data *)bl;
+ if( sd && type == SC_ADRENALINE && !(skill_get_weapontype(BS_ADRENALINE)&(1<<sd->status.weapon)))
+ return 0;
+
+ if(SC_STONE<=type && type<=SC_BLIND){ /* カ?ドによる耐性 */
+ if( sd && sd->reseff[type-SC_STONE] > 0 && rand()%10000<sd->reseff[type-SC_STONE]){
+ if(battle_config.battle_log)
+ printf("PC %d skill_sc_start: cardによる異常耐性?動\n",sd->bl.id);
+ return 0;
+ }
+ }
+ }
+ else if(bl->type == BL_MOB) {
+ }
+ else {
+ if(battle_config.error_log)
+ printf("status_change_start: neither MOB nor PC !\n");
+ return 0;
+ }
+
+ if(type==SC_FREEZE && undead_flag && !(flag&1))
+ return 0;
+
+ if((type == SC_ADRENALINE || type == SC_WEAPONPERFECTION || type == SC_OVERTHRUST) &&
+ sc_data[type].timer != -1 && sc_data[type].val2 && !val2)
+ return 0;
+
+ if(mode & 0x20 && (type==SC_STONE || type==SC_FREEZE ||
+ type==SC_STAN || type==SC_SLEEP || type==SC_SILENCE || type==SC_QUAGMIRE || type == SC_DECREASEAGI || type == SC_SIGNUMCRUCIS || type == SC_PROVOKE ||
+ (type == SC_BLESSING && (undead_flag || race == 6))) && !(flag&1)){
+ /* ボスには?かない(ただしカ?ドによる?果は適用される) */
+ return 0;
+ }
+ if(type==SC_FREEZE || type==SC_STAN || type==SC_SLEEP)
+ battle_stopwalking(bl,1);
+
+ if(sc_data[type].timer != -1){ /* すでに同じ異常になっている場合タイマ解除 */
+ if(sc_data[type].val1 > val1 && type != SC_COMBO && type != SC_DANCING && type != SC_DEVOTION &&
+ type != SC_SPEEDPOTION0 && type != SC_SPEEDPOTION1 && type != SC_SPEEDPOTION2 && type != SC_SPEEDPOTION3
+ && type != SC_ATKPOT && type != SC_MATKPOT) // added atk and matk potions [Valaris]
+ return 0;
+ if ((type >=SC_STAN && type <= SC_BLIND) || type == SC_DPOISON)
+ return 0;/* ?ぎ足しができない?態異常である時は?態異常を行わない */
+ if(type == SC_GRAFFITI){ //異常中にもう一度?態異常になった時に解除してから再度かかる
+ status_change_end(bl,type,-1);
+ } else {
+ (*sc_count)--;
+ delete_timer(sc_data[type].timer, status_change_timer);
+ sc_data[type].timer = -1;
+ }
+ }
+
+ switch(type){ /* 異常の種類ごとの?理 */
+ case SC_PROVOKE: /* プロボック */
+ calc_flag = 1;
+ if(tick <= 0) tick = 1000; /* (オ?トバ?サ?ク) */
+ break;
+ case SC_ENDURE: /* インデュア */
+ if(tick <= 0) tick = 1000 * 60;
+ calc_flag = 1; // for updating mdef
+ val2 = 7; // [Celest]
+ break;
+ case SC_AUTOBERSERK:
+ {
+ tick = 60*1000;
+ if (bl->type == BL_PC && sd->status.hp<sd->status.max_hp>>2 &&
+ (sc_data[SC_PROVOKE].timer==-1 || sc_data[SC_PROVOKE].val2==0))
+ status_change_start(bl,SC_PROVOKE,10,1,0,0,0,0);
+ }
+ break;
+ case SC_CONCENTRATE: /* 集中力向上 */
+ calc_flag = 1;
+ break;
+ case SC_BLESSING: /* ブレッシング */
+ {
+ if(bl->type == BL_PC || (!undead_flag && race != 6)) {
+ if(sc_data[SC_CURSE].timer!=-1 )
+ status_change_end(bl,SC_CURSE,-1);
+ if(sc_data[SC_STONE].timer!=-1 && sc_data[SC_STONE].val2 == 0)
+ status_change_end(bl,SC_STONE,-1);
+ }
+ calc_flag = 1;
+ }
+ break;
+ case SC_ANGELUS: /* アンゼルス */
+ calc_flag = 1;
+ break;
+ case SC_INCREASEAGI: /* 速度上昇 */
+ calc_flag = 1;
+ if(sc_data[SC_DECREASEAGI].timer!=-1 )
+ status_change_end(bl,SC_DECREASEAGI,-1);
+ // the effect will still remain [celest]
+// if(sc_data[SC_WINDWALK].timer!=-1 ) /* ウインドウォ?ク */
+// status_change_end(bl,SC_WINDWALK,-1);
+ break;
+ case SC_DECREASEAGI: /* 速度減少 */
+ if (bl->type == BL_PC) // Celest
+ tick>>=1;
+ calc_flag = 1;
+ if(sc_data[SC_INCREASEAGI].timer!=-1 )
+ status_change_end(bl,SC_INCREASEAGI,-1);
+ if(sc_data[SC_ADRENALINE].timer!=-1 )
+ status_change_end(bl,SC_ADRENALINE,-1);
+ if(sc_data[SC_SPEARSQUICKEN].timer!=-1 )
+ status_change_end(bl,SC_SPEARSQUICKEN,-1);
+ if(sc_data[SC_TWOHANDQUICKEN].timer!=-1 )
+ status_change_end(bl,SC_TWOHANDQUICKEN,-1);
+ break;
+ case SC_SIGNUMCRUCIS: /* シグナムクルシス */
+ calc_flag = 1;
+// val2 = 14 + val1;
+ val2 = 10 + val1*2;
+ tick = 600*1000;
+ clif_emotion(bl,4);
+ break;
+ case SC_SLOWPOISON:
+ if (sc_data[SC_POISON].timer == -1 && sc_data[SC_DPOISON].timer == -1)
+ return 0;
+ break;
+ case SC_TWOHANDQUICKEN: /* 2HQ */
+ if(sc_data[SC_DECREASEAGI].timer!=-1)
+ return 0;
+ *opt3 |= 1;
+ calc_flag = 1;
+ break;
+ case SC_ADRENALINE: /* アドレナリンラッシュ */
+ if(sc_data[SC_DECREASEAGI].timer!=-1)
+ return 0;
+ calc_flag = 1;
+ break;
+ case SC_WEAPONPERFECTION: /* ウェポンパ?フェクション */
+ // Lasting time penalties have been removed on sakray as of 12/14 [celest]
+ //if(battle_config.party_skill_penalty && !val2) tick /= 5;
+ break;
+ case SC_OVERTHRUST: /* オ?バ?スラスト */
+ *opt3 |= 2;
+ // Lasting time penalties have been removed on sakray as of 12/14 [celest]
+ //if(battle_config.party_skill_penalty && !val2) tick /= 10;
+ break;
+ case SC_MAXIMIZEPOWER: /* マキシマイズパワ?(SPが1減る時間,val2にも) */
+ if(bl->type == BL_PC)
+ val2 = tick;
+ else
+ tick = 5000*val1;
+ break;
+ case SC_ENCPOISON: /* エンチャントポイズン */
+ calc_flag = 1;
+ val2=(((val1 - 1) / 2) + 3)*100; /* 毒付?確率 */
+ skill_encchant_eremental_end(bl,SC_ENCPOISON);
+ break;
+ case SC_EDP: // [Celest]
+ val2 = val1 + 2; /* 猛毒付?確率(%) */
+ calc_flag = 1;
+ break;
+ case SC_POISONREACT: /* ポイズンリアクト */
+ val2=val1/2 + val1%2; // [Celest]
+ break;
+ case SC_IMPOSITIO: /* インポシティオマヌス */
+ calc_flag = 1;
+ break;
+ case SC_ASPERSIO: /* アスペルシオ */
+ skill_encchant_eremental_end(bl,SC_ASPERSIO);
+ break;
+ case SC_SUFFRAGIUM: /* サフラギム */
+ case SC_BENEDICTIO: /* 聖? */
+ case SC_MAGNIFICAT: /* マグニフィカ?ト */
+ case SC_AETERNA: /* エ?テルナ */
+ break;
+ case SC_ENERGYCOAT: /* エナジ?コ?ト */
+ *opt3 |= 4;
+ break;
+ case SC_MAGICROD:
+ val2 = val1*20;
+ break;
+ case SC_KYRIE: /* キリエエレイソン */
+ val2 = status_get_max_hp(bl) * (val1 * 2 + 10) / 100;/* 耐久度 */
+ val3 = (val1 / 2 + 5); /* 回? */
+// -- moonsoul (added to undo assumptio status if target has it)
+ if(sc_data[SC_ASSUMPTIO].timer!=-1 )
+ status_change_end(bl,SC_ASSUMPTIO,-1);
+ break;
+ case SC_MINDBREAKER:
+ calc_flag = 1;
+ if(tick <= 0) tick = 1000; /* (オ?トバ?サ?ク) */
+ case SC_GLORIA: /* グロリア */
+ calc_flag = 1;
+ break;
+ case SC_LOUD: /* ラウドボイス */
+ calc_flag = 1;
+ break;
+ case SC_TRICKDEAD: /* 死んだふり */
+ if (bl->type == BL_PC) {
+ pc_stopattack((struct map_session_data *)sd);
+ }
+ break;
+ case SC_QUAGMIRE: /* クァグマイア */
+ calc_flag = 1;
+ if(sc_data[SC_CONCENTRATE].timer!=-1 ) /* 集中力向上解除 */
+ status_change_end(bl,SC_CONCENTRATE,-1);
+ if(sc_data[SC_INCREASEAGI].timer!=-1 ) /* 速度上昇解除 */
+ status_change_end(bl,SC_INCREASEAGI,-1);
+ if(sc_data[SC_TWOHANDQUICKEN].timer!=-1 )
+ status_change_end(bl,SC_TWOHANDQUICKEN,-1);
+ if(sc_data[SC_SPEARSQUICKEN].timer!=-1 )
+ status_change_end(bl,SC_SPEARSQUICKEN,-1);
+ if(sc_data[SC_ADRENALINE].timer!=-1 )
+ status_change_end(bl,SC_ADRENALINE,-1);
+ if(sc_data[SC_LOUD].timer!=-1 )
+ status_change_end(bl,SC_LOUD,-1);
+ if(sc_data[SC_TRUESIGHT].timer!=-1 ) /* トゥル?サイト */
+ status_change_end(bl,SC_TRUESIGHT,-1);
+ if(sc_data[SC_WINDWALK].timer!=-1 ) /* ウインドウォ?ク */
+ status_change_end(bl,SC_WINDWALK,-1);
+ if(sc_data[SC_CARTBOOST].timer!=-1 ) /* カ?トブ?スト */
+ status_change_end(bl,SC_CARTBOOST,-1);
+ break;
+ case SC_MAGICPOWER:
+ calc_flag = 1;
+ val2 = 1;
+ break;
+ case SC_SACRIFICE:
+ val2 = 5;
+ break;
+ case SC_FLAMELAUNCHER: /* フレ?ムランチャ? */
+ skill_encchant_eremental_end(bl,SC_FLAMELAUNCHER);
+ break;
+ case SC_FROSTWEAPON: /* フロストウェポン */
+ skill_encchant_eremental_end(bl,SC_FROSTWEAPON);
+ break;
+ case SC_LIGHTNINGLOADER: /* ライトニングロ?ダ? */
+ skill_encchant_eremental_end(bl,SC_LIGHTNINGLOADER);
+ break;
+ case SC_SEISMICWEAPON: /* サイズミックウェポン */
+ skill_encchant_eremental_end(bl,SC_SEISMICWEAPON);
+ break;
+ case SC_DEVOTION: /* ディボ?ション */
+ calc_flag = 1;
+ break;
+ case SC_PROVIDENCE: /* プロヴィデンス */
+ calc_flag = 1;
+ val2=val1*5;
+ break;
+ case SC_REFLECTSHIELD:
+ val2=10+val1*3;
+ break;
+ case SC_STRIPWEAPON:
+ if (val2==0) val2=90;
+ break;
+ case SC_STRIPSHIELD:
+ if (val2==0) val2=85;
+ break;
+ case SC_STRIPARMOR:
+ case SC_STRIPHELM:
+ case SC_CP_WEAPON:
+ case SC_CP_SHIELD:
+ case SC_CP_ARMOR:
+ case SC_CP_HELM:
+ break;
+
+ case SC_AUTOSPELL: /* オ?トスペル */
+ val4 = 5 + val1*2;
+ break;
+
+ case SC_VOLCANO:
+ calc_flag = 1;
+ val3 = val1*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 ) ) );
+ break;
+ case SC_VIOLENTGALE:
+ calc_flag = 1;
+ val3 = val1*3;
+ val4 = val1>=5?20: (val1==4?19: (val1==3?17: ( val1==2?14:10 ) ) );
+ break;
+
+ case SC_SPEARSQUICKEN: /* スピアクイッケン */
+ calc_flag = 1;
+ val2 = 20+val1;
+ *opt3 |= 1;
+ break;
+ case SC_COMBO:
+ break;
+ case SC_BLADESTOP_WAIT: /* 白刃取り(待ち) */
+ break;
+ case SC_BLADESTOP: /* 白刃取り */
+ if(val2==2) clif_bladestop((struct block_list *)val3,(struct block_list *)val4,1);
+ *opt3 |= 32;
+ break;
+
+ case SC_LULLABY: /* 子守唄 */
+ val2 = 11;
+ break;
+ case SC_RICHMANKIM:
+ break;
+ case SC_ETERNALCHAOS: /* エタ?ナルカオス */
+ calc_flag = 1;
+ break;
+ case SC_DRUMBATTLE: /* ?太鼓の響き */
+ calc_flag = 1;
+ val2 = (val1+1)*25;
+ val3 = (val1+1)*2;
+ break;
+ case SC_NIBELUNGEN: /* ニ?ベルングの指輪 */
+ calc_flag = 1;
+ //val2 = (val1+2)*50;
+ val3 = (val1+2)*25;
+ break;
+ case SC_ROKISWEIL: /* ロキの叫び */
+ break;
+ case SC_INTOABYSS: /* 深淵の中に */
+ break;
+ case SC_SIEGFRIED: /* 不死身のジ?クフリ?ド */
+ calc_flag = 1;
+ val2 = 55 + val1*5;
+ val3 = val1*10;
+ break;
+ case SC_DISSONANCE: /* 不協和音 */
+ val2 = 10;
+ break;
+ case SC_WHISTLE: /* 口笛 */
+ calc_flag = 1;
+ break;
+ case SC_ASSNCROS: /* 夕陽のアサシンクロス */
+ calc_flag = 1;
+ break;
+ case SC_POEMBRAGI: /* ブラギの詩 */
+ break;
+ case SC_APPLEIDUN: /* イドゥンの林檎 */
+ calc_flag = 1;
+ break;
+ case SC_UGLYDANCE: /* 自分勝手なダンス */
+ val2 = 10;
+ break;
+ case SC_HUMMING: /* ハミング */
+ calc_flag = 1;
+ break;
+ case SC_DONTFORGETME: /* 私を忘れないで */
+ calc_flag = 1;
+ if(sc_data[SC_INCREASEAGI].timer!=-1 ) /* 速度上昇解除 */
+ status_change_end(bl,SC_INCREASEAGI,-1);
+ if(sc_data[SC_TWOHANDQUICKEN].timer!=-1 )
+ status_change_end(bl,SC_TWOHANDQUICKEN,-1);
+ if(sc_data[SC_SPEARSQUICKEN].timer!=-1 )
+ status_change_end(bl,SC_SPEARSQUICKEN,-1);
+ if(sc_data[SC_ADRENALINE].timer!=-1 )
+ status_change_end(bl,SC_ADRENALINE,-1);
+ if(sc_data[SC_ASSNCROS].timer!=-1 )
+ status_change_end(bl,SC_ASSNCROS,-1);
+ if(sc_data[SC_TRUESIGHT].timer!=-1 ) /* トゥル?サイト */
+ status_change_end(bl,SC_TRUESIGHT,-1);
+ if(sc_data[SC_WINDWALK].timer!=-1 ) /* ウインドウォ?ク */
+ status_change_end(bl,SC_WINDWALK,-1);
+ if(sc_data[SC_CARTBOOST].timer!=-1 ) /* カ?トブ?スト */
+ status_change_end(bl,SC_CARTBOOST,-1);
+ break;
+ case SC_FORTUNE: /* 幸運のキス */
+ calc_flag = 1;
+ break;
+ case SC_SERVICE4U: /* サ?ビスフォ?ユ? */
+ calc_flag = 1;
+ break;
+ case SC_MOONLIT:
+ val2 = bl->id;
+ break;
+ case SC_DANCING: /* ダンス/演奏中 */
+ calc_flag = 1;
+ val3= tick / 1000;
+ tick = 1000;
+ break;
+
+ case SC_EXPLOSIONSPIRITS: // 爆裂波動
+ calc_flag = 1;
+ val2 = 75 + 25*val1;
+ *opt3 |= 8;
+ break;
+ case SC_STEELBODY: // 金剛
+ calc_flag = 1;
+ *opt3 |= 16;
+ break;
+ case SC_EXTREMITYFIST: /* 阿修羅覇凰拳 */
+ break;
+ case SC_AUTOCOUNTER:
+ val3 = val4 = 0;
+ break;
+
+ case SC_SPEEDPOTION0: /* ?速ポ?ション */
+ case SC_SPEEDPOTION1:
+ case SC_SPEEDPOTION2:
+ case SC_SPEEDPOTION3:
+ calc_flag = 1;
+ tick = 1000 * tick;
+ val2 = 5*(2+type-SC_SPEEDPOTION0);
+ break;
+
+ /* atk & matk potions [Valaris] */
+ case SC_ATKPOT:
+ case SC_MATKPOT:
+ calc_flag = 1;
+ tick = 1000 * tick;
+ break;
+ case SC_WEDDING: //結婚用(結婚衣裳になって?くのが?いとか)
+ {
+ time_t timer;
+
+ calc_flag = 1;
+ tick = 10000;
+ if(!val2)
+ val2 = time(&timer);
+ }
+ break;
+ case SC_NOCHAT: //チャット禁止?態
+ {
+ time_t timer;
+
+ if(!battle_config.muting_players)
+ break;
+
+ tick = 60000;
+ if(!val2)
+ val2 = time(&timer);
+ updateflag = SP_MANNER;
+ save_flag = 1; // celest
+ }
+ break;
+ case SC_SELFDESTRUCTION: //自爆
+ clif_skillcasting(bl,bl->id, bl->id,0,0,331,skill_get_time(val2,val1));
+ val3 = tick / 1000;
+ tick = 1000;
+ break;
+
+ /* option1 */
+ case SC_STONE: /* 石化 */
+ if(!(flag&2)) {
+ int sc_def = status_get_mdef(bl)*200;
+ tick = tick - sc_def;
+ }
+ val3 = tick/1000;
+ if(val3 < 1) val3 = 1;
+ tick = 5000;
+ val2 = 1;
+ break;
+ case SC_SLEEP: /* 睡眠 */
+ if(!(flag&2)) {
+// int sc_def = 100 - (status_get_int(bl) + status_get_luk(bl)/3);
+// tick = tick * sc_def / 100;
+// if(tick < 1000) tick = 1000;
+ tick = 30000;//睡眠はステ?タス耐性に?わらず30秒
+ }
+ break;
+ case SC_FREEZE: /* 凍結 */
+ if(!(flag&2)) {
+ int sc_def = 100 - status_get_mdef(bl);
+ tick = tick * sc_def / 100;
+ }
+ break;
+ case SC_STAN: /* スタン(val2にミリ秒セット) */
+ if(!(flag&2)) {
+ int sc_def = 100 - (status_get_vit(bl) + status_get_luk(bl)/3);
+ tick = tick * sc_def / 100;
+ }
+ break;
+
+ /* option2 */
+ case SC_DPOISON: /* 猛毒 */
+ {
+ int mhp = status_get_max_hp(bl);
+ int hp = status_get_hp(bl);
+ // MHP?1/4????????
+ if (hp > mhp>>2) {
+ if(bl->type == BL_PC) {
+ int diff = mhp*10/100;
+ if (hp - diff < mhp>>2)
+ hp = hp - (mhp>>2);
+ pc_heal((struct map_session_data *)bl, -hp, 0);
+ } else if(bl->type == BL_MOB) {
+ struct mob_data *md = (struct mob_data *)bl;
+ hp -= mhp*15/100;
+ if (hp > mhp>>2)
+ md->hp = hp;
+ else
+ md->hp = mhp>>2;
+ }
+ }
+ } // fall through
+ case SC_POISON: /* 毒 */
+ calc_flag = 1;
+ if(!(flag&2)) {
+ int sc_def = 100 - (status_get_vit(bl) + status_get_luk(bl)/5);
+ tick = tick * sc_def / 100;
+ }
+ val3 = tick/1000;
+ if(val3 < 1) val3 = 1;
+ tick = 1000;
+ break;
+ case SC_SILENCE: /* 沈?(レックスデビ?ナ) */
+ if(!(flag&2)) {
+ int sc_def = 100 - status_get_vit(bl);
+ tick = tick * sc_def / 100;
+ }
+ break;
+ case SC_CONFUSION:
+ val2 = tick;
+ tick = 100;
+ clif_emotion(bl,1);
+ if (sd) {
+ pc_stop_walking (sd, 0);
+ }
+ break;
+ case SC_BLIND: /* 暗? */
+ calc_flag = 1;
+ if(!(flag&2)) {
+ int sc_def = status_get_lv(bl)/10 + status_get_int(bl)/15;
+ tick = 30000 - sc_def;
+ }
+ break;
+ case SC_CURSE:
+ calc_flag = 1;
+ if(!(flag&2)) {
+ int sc_def = 100 - status_get_vit(bl);
+ tick = tick * sc_def / 100;
+ }
+ break;
+
+ /* option */
+ case SC_HIDING: /* ハイディング */
+ calc_flag = 1;
+ if(bl->type == BL_PC) {
+ val2 = tick / 1000; /* 持?時間 */
+ tick = 1000;
+ }
+ break;
+ case SC_CHASEWALK:
+ case SC_CLOAKING: /* クロ?キング */
+ if(bl->type == BL_PC) {
+ calc_flag = 1; // [Celest]
+ val2 = tick;
+ val3 = type==SC_CLOAKING ? 130-val1*3 : 135-val1*5;
+ }
+ else
+ tick = 5000*val1;
+ break;
+ case SC_SIGHT: /* サイト/ルアフ */
+ case SC_RUWACH:
+ val2 = tick/250;
+ tick = 10;
+ break;
+
+ /* セ?フティウォ?ル、ニュ?マ */
+ case SC_SAFETYWALL: case SC_PNEUMA:
+ tick=((struct skill_unit *)val2)->group->limit;
+ break;
+
+ /* アンクル */
+ case SC_ANKLE:
+ break;
+
+ /* ウォ?タ?ボ?ル */
+ case SC_WATERBALL:
+ tick=150;
+ if(val1>5) //レベルが5以上の場合は25?に制限(1?目はすでに打ってるので-1)
+ val3=5*5-1;
+ else
+ val3= (val1|1)*(val1|1)-1;
+ break;
+
+ /* スキルじゃない/時間に?係しない */
+ case SC_RIDING:
+ calc_flag = 1;
+ tick = 600*1000;
+ break;
+ case SC_FALCON:
+ case SC_WEIGHT50:
+ case SC_WEIGHT90:
+ case SC_BROKNWEAPON:
+ case SC_BROKNARMOR:
+ tick=600*1000;
+ break;
+
+ case SC_AUTOGUARD:
+ {
+ int i,t;
+ for(i=val2=0;i<val1;i++) {
+ t = 5-(i>>1);
+ val2 += (t < 0)? 1:t;
+ }
+ }
+ break;
+
+ case SC_DEFENDER:
+ calc_flag = 1;
+ val2 = 5 + val1*15;
+ break;
+
+ case SC_KEEPING:
+ case SC_BARRIER:
+ calc_flag = 1;
+
+ case SC_HALLUCINATION:
+ break;
+
+ case SC_CONCENTRATION: /* コンセントレ?ション */
+ *opt3 |= 1;
+ calc_flag = 1;
+ break;
+
+ case SC_TENSIONRELAX: /* テンションリラックス */
+ calc_flag = 1;
+ if(bl->type == BL_PC) {
+ tick = 10000;
+ }
+ break;
+
+ case SC_AURABLADE: /* オ?ラブレ?ド */
+ case SC_PARRYING: /* パリイング */
+// case SC_ASSUMPTIO: /* */
+ case SC_HEADCRUSH: /* ヘッドクラッシュ */
+ case SC_JOINTBEAT: /* ジョイントビ?ト */
+// case SC_MARIONETTE: /* マリオネットコントロ?ル */
+
+ //とりあえず手?き
+ break;
+
+// -- moonsoul (for new upper class related skill status effects)
+/*
+ case SC_AURABLADE:
+ val2 = val1*10;
+ break;
+ case SC_PARRYING:
+ val2=val1*3;
+ break;
+ case SC_CONCENTRATION:
+ calc_flag=1;
+ val2=val1*10;
+ val3=val1*5;
+ break;
+ case SC_TENSIONRELAX:
+// val2 = 10;
+// val3 = 15;
+ break;
+ case SC_BERSERK:
+ calc_flag=1;
+ break;
+ case SC_ASSUMPTIO:
+ if(sc_data[SC_KYRIE].timer!=-1 )
+ status_change_end(bl,SC_KYRIE,-1);
+ break;*/
+
+ case SC_WINDWALK: /* ウインドウォ?ク */
+ calc_flag = 1;
+ val2 = (val1 / 2); //Flee上昇率
+ break;
+
+ case SC_BERSERK: /* バ?サ?ク */
+ if(sd){
+ sd->status.hp = sd->status.max_hp * 3;
+ sd->status.sp = 0;
+ clif_updatestatus(sd,SP_HP);
+ clif_updatestatus(sd,SP_SP);
+ clif_status_change(bl,SC_INCREASEAGI,1); /* アイコン表示 */
+ sd->canregen_tick = gettick() + 300000;
+ }
+ *opt3 |= 128;
+ tick = 10000;
+ calc_flag = 1;
+ break;
+
+ case SC_ASSUMPTIO: /* アスムプティオ */
+ if(sc_data[SC_KYRIE].timer!=-1 )
+ status_change_end(bl,SC_KYRIE,-1);
+ break;
+ *opt3 |= 2048;
+ break;
+
+ case SC_BASILICA: // [celest]
+ break;
+
+ case SC_GOSPEL:
+ if (val4 == BCT_SELF) { // self effect
+ int i;
+ if (sd) {
+ sd->canact_tick += tick;
+ sd->canmove_tick += tick;
+ }
+ val2 = tick;
+ tick = 1000;
+ for (i=0; i<=26; i++) {
+ if(sc_data[i].timer!=-1)
+ status_change_end(bl,i,-1);
+ }
+ for (i=58; i<=62; i++) {
+ if(sc_data[i].timer!=-1)
+ status_change_end(bl,i,-1);
+ }
+ for (i=132; i<=136; i++) {
+ if(sc_data[i].timer!=-1)
+ status_change_end(bl,i,-1);
+ }
+ }
+ break;
+
+ case SC_MARIONETTE: /* マリオネットコントロ?ル */
+ case SC_MARIONETTE2:
+ val2 = tick;
+ if (!val3)
+ return 0;
+ tick = 1000;
+ calc_flag = 1;
+ *opt3 |= 1024;
+ break;
+
+ case SC_MELTDOWN: /* メルトダウン */
+ case SC_CARTBOOST: /* カ?トブ?スト */
+ case SC_TRUESIGHT: /* トゥル?サイト */
+ case SC_SPIDERWEB: /* スパイダ?ウェッブ */
+ calc_flag = 1;
+ break;
+
+ case SC_REJECTSWORD: /* リジェクトソ?ド */
+ val2 = 3; //3回攻?を跳ね返す
+ break;
+
+ case SC_MEMORIZE: /* メモライズ */
+ val2 = 3; //3回詠唱を1/3にする
+ break;
+
+ case SC_GRAFFITI: /* グラフィティ */
+ {
+ struct skill_unit_group *sg = skill_unitsetting(bl,RG_GRAFFITI,val1,val2,val3,0);
+ if(sg)
+ val4 = (int)sg;
+ }
+ break;
+
+ case SC_SPLASHER: /* ベナムスプラッシャ? */
+ break;
+
+ case SC_FOGWALL:
+ val2 = 75;
+ // calc_flag = 1; // not sure of effects yet [celest]
+ break;
+
+ case SC_PRESERVE:
+ break;
+
+ case SC_BLOCKSKILL:
+ if (!tick) tick = 60000;
+ if (!val3) val3 = -1;
+ break;
+
+ case SC_SLOWDOWN:
+ case SC_SPEEDUP0:
+ calc_flag = 1;
+ break;
+
+ case SC_REGENERATION:
+ val1 = 2;
+ case SC_BATTLEORDERS:
+ tick = 60000; // 1 minute
+ calc_flag = 1;
+ break;
+
+ default:
+ if(battle_config.error_log)
+ printf("UnknownStatusChange [%d]\n", type);
+ return 0;
+ }
+
+ if(bl->type==BL_PC &&
+ (type<SC_SENDMAX || type==SC_PRESERVE || type==SC_BATTLEORDERS))
+ clif_status_change(bl,type,1); /* アイコン表示 */
+
+ /* optionの?更 */
+ switch(type){
+ case SC_STONE:
+ case SC_FREEZE:
+ case SC_STAN:
+ case SC_SLEEP:
+ battle_stopattack(bl); /* 攻?停止 */
+ skill_stop_dancing(bl,0); /* 演奏/ダンスの中? */
+ { /* 同時に掛からないステ?タス異常を解除 */
+ int i;
+ for(i = SC_STONE; i <= SC_SLEEP; i++){
+ if(sc_data[i].timer != -1){
+ (*sc_count)--;
+ delete_timer(sc_data[i].timer, status_change_timer);
+ sc_data[i].timer = -1;
+ }
+ }
+ }
+ if(type == SC_STONE)
+ *opt1 = 6;
+ else
+ *opt1 = type - SC_STONE + 1;
+ opt_flag = 1;
+ break;
+ case SC_POISON:
+ case SC_CURSE:
+ case SC_SILENCE:
+ case SC_BLIND:
+ *opt2 |= 1<<(type-SC_POISON);
+ opt_flag = 1;
+ break;
+ case SC_DPOISON: // 暫定で毒のエフェクトを使用
+ *opt2 |= 1;
+ opt_flag = 1;
+ break;
+ case SC_SIGNUMCRUCIS:
+ *opt2 |= 0x40;
+ opt_flag = 1;
+ break;
+ case SC_HIDING:
+ case SC_CLOAKING:
+ battle_stopattack(bl); /* 攻?停止 */
+ *option |= ((type==SC_HIDING)?2:4);
+ opt_flag =1 ;
+ break;
+ case SC_CHASEWALK:
+ battle_stopattack(bl); /* 攻?停止 */
+ *option |= 16388;
+ opt_flag =1 ;
+ break;
+ case SC_SIGHT:
+ *option |= 1;
+ opt_flag = 1;
+ break;
+ case SC_RUWACH:
+ *option |= 8192;
+ opt_flag = 1;
+ break;
+ case SC_WEDDING:
+ *option |= 4096;
+ opt_flag = 1;
+ }
+
+ if(opt_flag) /* optionの?更 */
+ clif_changeoption(bl);
+
+ (*sc_count)++; /* ステ?タス異常の? */
+
+ sc_data[type].val1 = val1;
+ sc_data[type].val2 = val2;
+ sc_data[type].val3 = val3;
+ sc_data[type].val4 = val4;
+ /* タイマ?設定 */
+ sc_data[type].timer = add_timer(
+ gettick() + tick, status_change_timer, bl->id, type);
+
+ if(bl->type==BL_PC && calc_flag)
+ status_calc_pc(sd,0); /* ステ?タス再計算 */
+
+ if(bl->type==BL_PC && save_flag)
+ chrif_save(sd); // save the player status
+
+ if(bl->type==BL_PC && updateflag)
+ clif_updatestatus(sd,updateflag); /* ステ?タスをクライアントに送る */
+
+ return 0;
+}
+/*==========================================
+ * ステータス異常全解除
+ *------------------------------------------
+ */
+int status_change_clear(struct block_list *bl,int type)
+{
+ struct status_change* sc_data;
+ short *sc_count, *option, *opt1, *opt2, *opt3;
+ int i;
+
+ nullpo_retr(0, bl);
+ nullpo_retr(0, sc_data = status_get_sc_data(bl));
+ nullpo_retr(0, sc_count = status_get_sc_count(bl));
+ nullpo_retr(0, option = status_get_option(bl));
+ nullpo_retr(0, opt1 = status_get_opt1(bl));
+ nullpo_retr(0, opt2 = status_get_opt2(bl));
+ nullpo_retr(0, opt3 = status_get_opt3(bl));
+
+ if (*sc_count == 0)
+ return 0;
+ for(i = 0; i < MAX_STATUSCHANGE; i++){
+ if(sc_data[i].timer != -1){ /* 異常があるならタイマ?を削除する */
+ status_change_end(bl, i, -1);
+ }
+ }
+ *sc_count = 0;
+ *opt1 = 0;
+ *opt2 = 0;
+ *opt3 = 0;
+ *option &= OPTION_MASK;
+
+ if (night_flag == 1 && type == BL_PC && !map[bl->m].flag.indoors && // by [Yor]
+ !map[bl->m].flag.indoors && battle_config.night_darkness_level <= 0) // [celest]
+ *opt2 |= STATE_BLIND;
+
+ if(!type || type&2)
+ clif_changeoption(bl);
+
+ return 0;
+}
+
+/*==========================================
+ * ステータス異常終了
+ *------------------------------------------
+ */
+int status_change_end( struct block_list* bl , int type,int tid )
+{
+ struct status_change* sc_data;
+ int opt_flag=0, calc_flag = 0;
+ short *sc_count, *option, *opt1, *opt2, *opt3;
+
+ nullpo_retr(0, bl);
+ if(bl->type!=BL_PC && bl->type!=BL_MOB) {
+ if(battle_config.error_log)
+ printf("status_change_end: neither MOB nor PC !\n");
+ return 0;
+ }
+ nullpo_retr(0, sc_data = status_get_sc_data(bl));
+ nullpo_retr(0, sc_count = status_get_sc_count(bl));
+ nullpo_retr(0, option = status_get_option(bl));
+ nullpo_retr(0, opt1 = status_get_opt1(bl));
+ nullpo_retr(0, opt2 = status_get_opt2(bl));
+ nullpo_retr(0, opt3 = status_get_opt3(bl));
+
+ if ((*sc_count) > 0 && sc_data[type].timer != -1 && (sc_data[type].timer == tid || tid == -1)) {
+
+ if (tid == -1) // タイマから呼ばれていないならタイマ削除をする
+ delete_timer(sc_data[type].timer,status_change_timer);
+
+ /* 該?の異常を正常に?す */
+ sc_data[type].timer=-1;
+ (*sc_count)--;
+
+ switch(type){ /* 異常の種類ごとの?理 */
+ case SC_PROVOKE: /* プロボック */
+ case SC_ENDURE: // celest
+ case SC_CONCENTRATE: /* 集中力向上 */
+ case SC_BLESSING: /* ブレッシング */
+ case SC_ANGELUS: /* アンゼルス */
+ case SC_INCREASEAGI: /* 速度上昇 */
+ case SC_DECREASEAGI: /* 速度減少 */
+ case SC_SIGNUMCRUCIS: /* シグナムクルシス */
+ case SC_HIDING:
+ case SC_TWOHANDQUICKEN: /* 2HQ */
+ case SC_ADRENALINE: /* アドレナリンラッシュ */
+ case SC_ENCPOISON: /* エンチャントポイズン */
+ case SC_IMPOSITIO: /* インポシティオマヌス */
+ case SC_GLORIA: /* グロリア */
+ case SC_LOUD: /* ラウドボイス */
+ case SC_QUAGMIRE: /* クァグマイア */
+ case SC_PROVIDENCE: /* プロヴィデンス */
+ case SC_SPEARSQUICKEN: /* スピアクイッケン */
+ case SC_VOLCANO:
+ case SC_DELUGE:
+ case SC_VIOLENTGALE:
+ case SC_ETERNALCHAOS: /* エタ?ナルカオス */
+ case SC_DRUMBATTLE: /* ?太鼓の響き */
+ case SC_NIBELUNGEN: /* ニ?ベルングの指輪 */
+ case SC_SIEGFRIED: /* 不死身のジ?クフリ?ド */
+ case SC_WHISTLE: /* 口笛 */
+ case SC_ASSNCROS: /* 夕陽のアサシンクロス */
+ case SC_HUMMING: /* ハミング */
+ case SC_DONTFORGETME: /* 私を忘れないで */
+ case SC_FORTUNE: /* 幸運のキス */
+ case SC_SERVICE4U: /* サ?ビスフォ?ユ? */
+ case SC_EXPLOSIONSPIRITS: // 爆裂波動
+ case SC_STEELBODY: // 金剛
+ case SC_DEFENDER:
+ case SC_SPEEDPOTION0: /* ?速ポ?ション */
+ case SC_SPEEDPOTION1:
+ case SC_SPEEDPOTION2:
+ case SC_SPEEDPOTION3:
+ case SC_APPLEIDUN: /* イドゥンの林檎 */
+ case SC_RIDING:
+ case SC_BLADESTOP_WAIT:
+ case SC_AURABLADE: /* オ?ラブレ?ド */
+ case SC_PARRYING: /* パリイング */
+ case SC_CONCENTRATION: /* コンセントレ?ション */
+ case SC_TENSIONRELAX: /* テンションリラックス */
+ case SC_ASSUMPTIO: /* アシャンプティオ */
+ case SC_WINDWALK: /* ウインドウォ?ク */
+ case SC_TRUESIGHT: /* トゥル?サイト */
+ case SC_SPIDERWEB: /* スパイダ?ウェッブ */
+ case SC_MAGICPOWER: /* 魔法力?幅 */
+ case SC_CHASEWALK:
+ case SC_ATKPOT: /* attack potion [Valaris] */
+ case SC_MATKPOT: /* magic attack potion [Valaris] */
+ case SC_WEDDING: //結婚用(結婚衣裳になって?くのが?いとか)
+ case SC_MELTDOWN: /* メルトダウン */
+ // Celest
+ case SC_EDP:
+ case SC_SLOWDOWN:
+ case SC_SPEEDUP0:
+/* case SC_LEADERSHIP:
+ case SC_GLORYWOUNDS:
+ case SC_SOULCOLD:
+ case SC_HAWKEYES:*/
+ case SC_BATTLEORDERS:
+ case SC_REGENERATION:
+ calc_flag = 1;
+ break;
+ case SC_AUTOBERSERK:
+ if (sc_data[SC_PROVOKE].timer != -1)
+ status_change_end(bl,SC_PROVOKE,-1);
+ break;
+ case SC_BERSERK: /* バ?サ?ク */
+ calc_flag = 1;
+ clif_status_change(bl,SC_INCREASEAGI,0); /* アイコン消去 */
+ break;
+ case SC_DEVOTION: /* ディボ?ション */
+ {
+ struct map_session_data *md = map_id2sd(sc_data[type].val1);
+ sc_data[type].val1=sc_data[type].val2=0;
+ skill_devotion(md,bl->id);
+ calc_flag = 1;
+ }
+ break;
+ case SC_BLADESTOP:
+ {
+ struct status_change *t_sc_data = status_get_sc_data((struct block_list *)sc_data[type].val4);
+ //片方が切れたので相手の白刃?態が切れてないのなら解除
+ if(t_sc_data && t_sc_data[SC_BLADESTOP].timer!=-1)
+ status_change_end((struct block_list *)sc_data[type].val4,SC_BLADESTOP,-1);
+
+ if(sc_data[type].val2==2)
+ clif_bladestop((struct block_list *)sc_data[type].val3,(struct block_list *)sc_data[type].val4,0);
+ }
+ break;
+ case SC_DANCING:
+ {
+ struct map_session_data *dsd;
+ struct status_change *d_sc_data;
+ if(sc_data[type].val4 && (dsd=map_id2sd(sc_data[type].val4))){
+ d_sc_data = dsd->sc_data;
+ //合奏で相手がいる場合相手のval4を0にする
+ if(d_sc_data && d_sc_data[type].timer!=-1)
+ d_sc_data[type].val4=0;
+ }
+ }
+ calc_flag = 1;
+ break;
+ case SC_GRAFFITI:
+ {
+ struct skill_unit_group *sg=(struct skill_unit_group *)sc_data[type].val4; //val4がグラフィティのgroup_id
+ if(sg)
+ skill_delunitgroup(sg);
+ }
+ break;
+ case SC_NOCHAT: //チャット禁止?態
+ {
+ struct map_session_data *sd=NULL;
+ if(bl->type == BL_PC && (sd=(struct map_session_data *)bl)){
+ if (sd->status.manner >= 0) // weeee ^^ [celest]
+ sd->status.manner = 0;
+ clif_updatestatus(sd,SP_MANNER);
+ }
+ }
+ break;
+ case SC_SPLASHER: /* ベナムスプラッシャ? */
+ {
+ struct block_list *src=map_id2bl(sc_data[type].val3);
+ if(src && tid!=-1){
+ //自分にダメ?ジ&周?3*3にダメ?ジ
+ skill_castend_damage_id(src, bl,sc_data[type].val2,sc_data[type].val1,gettick(),0 );
+ }
+ }
+ break;
+ case SC_SELFDESTRUCTION: /* 自爆 */
+ {
+ //自分のダメ?ジは0にして
+ struct mob_data *md=NULL;
+ if(bl->type == BL_MOB && (md=(struct mob_data*)bl))
+ skill_castend_damage_id(bl, bl,sc_data[type].val2,sc_data[type].val1,gettick(),0 );
+ }
+ break;
+ /* option1 */
+ case SC_FREEZE:
+ sc_data[type].val3 = 0;
+ break;
+
+ /* option2 */
+ case SC_POISON: /* 毒 */
+ case SC_BLIND: /* 暗? */
+ case SC_CURSE:
+ calc_flag = 1;
+ break;
+
+ // celest
+ case SC_CONFUSION:
+ {
+ struct map_session_data *sd=NULL;
+ if(bl->type == BL_PC && (sd=(struct map_session_data *)bl)){
+ sd->next_walktime = -1;
+ }
+ }
+ break;
+
+ case SC_MARIONETTE: /* マリオネットコントロ?ル */
+ case SC_MARIONETTE2: /// Marionette target
+ {
+ // check for partner and end their marionette status as well
+ int type2 = (type == SC_MARIONETTE) ? SC_MARIONETTE2 : SC_MARIONETTE;
+ struct block_list *pbl = map_id2bl(sc_data[type].val3);
+ if (pbl) {
+ struct status_change* sc_data;
+ if (*status_get_sc_count(pbl) > 0 &&
+ (sc_data = status_get_sc_data(pbl)) &&
+ sc_data[type2].timer != -1)
+ status_change_end(pbl, type2, -1);
+ }
+ calc_flag = 1;
+ }
+ break;
+ }
+
+ if(bl->type==BL_PC &&
+ (type<SC_SENDMAX || type==SC_PRESERVE || type==SC_BATTLEORDERS))
+ clif_status_change(bl,type,0); /* アイコン消去 */
+
+ switch(type){ /* 正常に?るときなにか?理が必要 */
+ case SC_STONE:
+ case SC_FREEZE:
+ case SC_STAN:
+ case SC_SLEEP:
+ *opt1 = 0;
+ opt_flag = 1;
+ break;
+
+ case SC_POISON:
+ if (sc_data[SC_DPOISON].timer != -1) //
+ break; // DPOISON用のオプション
+ *opt2 &= ~1; // が?用に用意された場合には
+ opt_flag = 1; // ここは削除する
+ break; //
+ case SC_CURSE:
+ case SC_SILENCE:
+ case SC_BLIND:
+ *opt2 &= ~(1<<(type-SC_POISON));
+ opt_flag = 1;
+ break;
+ case SC_DPOISON:
+ if (sc_data[SC_POISON].timer != -1) // DPOISON用のオプションが
+ break; // 用意されたら削除
+ *opt2 &= ~1; // 毒?態解除
+ opt_flag = 1;
+ break;
+ case SC_SIGNUMCRUCIS:
+ *opt2 &= ~0x40;
+ opt_flag = 1;
+ break;
+
+ case SC_HIDING:
+ case SC_CLOAKING:
+ *option &= ~((type == SC_HIDING) ? 2 : 4);
+ calc_flag = 1; // orn
+ opt_flag = 1 ;
+ break;
+
+ case SC_CHASEWALK:
+ *option &= ~16388;
+ opt_flag = 1 ;
+ break;
+
+ case SC_SIGHT:
+ *option &= ~1;
+ opt_flag = 1;
+ break;
+ case SC_WEDDING: //結婚用(結婚衣裳になって?くのが?いとか)
+ *option &= ~4096;
+ opt_flag = 1;
+ break;
+ case SC_RUWACH:
+ *option &= ~8192;
+ opt_flag = 1;
+ break;
+
+ //opt3
+ case SC_TWOHANDQUICKEN: /* 2HQ */
+ case SC_SPEARSQUICKEN: /* スピアクイッケン */
+ case SC_CONCENTRATION: /* コンセントレ?ション */
+ *opt3 &= ~1;
+ break;
+ case SC_OVERTHRUST: /* オ?バ?スラスト */
+ *opt3 &= ~2;
+ break;
+ case SC_ENERGYCOAT: /* エナジ?コ?ト */
+ *opt3 &= ~4;
+ break;
+ case SC_EXPLOSIONSPIRITS: // 爆裂波動
+ *opt3 &= ~8;
+ break;
+ case SC_STEELBODY: // 金剛
+ *opt3 &= ~16;
+ break;
+ case SC_BLADESTOP: /* 白刃取り */
+ *opt3 &= ~32;
+ break;
+ case SC_BERSERK: /* バ?サ?ク */
+ *opt3 &= ~128;
+ break;
+ case SC_MARIONETTE: /* マリオネットコントロ?ル */
+ case SC_MARIONETTE2:
+ *opt3 &= ~1024;
+ break;
+ case SC_ASSUMPTIO: /* アスムプティオ */
+ *opt3 &= ~2048;
+ break;
+ }
+
+ if (night_flag == 1 && (*opt2 & STATE_BLIND) == 0 && bl->type == BL_PC && // by [Yor]
+ !map[bl->m].flag.indoors && battle_config.night_darkness_level <= 0) { // [celest]
+ *opt2 |= STATE_BLIND;
+ opt_flag = 1;
+ }
+
+ if(opt_flag) /* optionの?更を?える */
+ clif_changeoption(bl);
+
+ if (bl->type == BL_PC && calc_flag)
+ status_calc_pc((struct map_session_data *)bl,0); /* ステ?タス再計算 */
+ }
+
+ return 0;
+}
+
+
+/*==========================================
+ * ステータス異常終了タイマー
+ *------------------------------------------
+ */
+int status_change_timer(int tid, unsigned int tick, int id, int data)
+{
+ int type=data;
+ struct block_list *bl;
+ struct map_session_data *sd=NULL;
+ struct status_change *sc_data;
+ //short *sc_count; //使ってない?
+
+ nullpo_retr(0, bl=map_id2bl(id));
+ nullpo_retr(0, sc_data=status_get_sc_data(bl));
+
+ if(bl->type==BL_PC)
+ nullpo_retr(0, sd=(struct map_session_data *)bl);
+
+ //sc_count=status_get_sc_count(bl); //使ってない?
+
+ if(sc_data[type].timer != tid) {
+ if(battle_config.error_log)
+ printf("status_change_timer %d != %d\n",tid,sc_data[type].timer);
+ return 0;
+ }
+
+ switch(type){ /* 特殊な?理になる場合 */
+ case SC_MAXIMIZEPOWER: /* マキシマイズパワ? */
+ case SC_CLOAKING:
+ if(sd){
+ if( sd->status.sp > 0 ){ /* SP切れるまで持? */
+ sd->status.sp--;
+ clif_updatestatus(sd,SP_SP);
+ sc_data[type].timer=add_timer( /* タイマ?再設定 */
+ sc_data[type].val2+tick, status_change_timer, bl->id, data);
+ return 0;
+ }
+ }
+ break;
+
+ case SC_CHASEWALK:
+ if(sd){
+ 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, status_change_timer, bl->id, data);
+ sc_data[SC_CHASEWALK].val4++;
+ if (sc_data[SC_CHASEWALK].val4 > 3)
+ sc_data[SC_CHASEWALK].val4 = 0;
+ status_calc_pc (sd, 0);
+ return 0;
+ }
+ }
+ break;
+
+ case SC_HIDING: /* ハイディング */
+ if(sd){ /* SPがあって、時間制限の間は持? */
+ if( sd->status.sp > 0 && (--sc_data[type].val2)>0 ){
+ if(sc_data[type].val2 % (sc_data[type].val1+3) ==0 ){
+ sd->status.sp--;
+ clif_updatestatus(sd,SP_SP);
+ }
+ sc_data[type].timer=add_timer( /* タイマ?再設定 */
+ 1000+tick, status_change_timer,
+ bl->id, data);
+ return 0;
+ }
+ }
+ break;
+
+ case SC_SIGHT: /* サイト */
+ case SC_RUWACH: /* ルアフ */
+ {
+ int range = 5;
+ if ( type == SC_SIGHT ) range = 7;
+ map_foreachinarea( status_change_timer_sub,
+ bl->m, bl->x-range, bl->y-range, bl->x+range,bl->y+range,0,
+ bl,type,tick);
+
+ if( (--sc_data[type].val2)>0 ){
+ sc_data[type].timer=add_timer( /* タイマ?再設定 */
+ 250+tick, status_change_timer,
+ bl->id, data);
+ return 0;
+ }
+ }
+ break;
+
+ case SC_SIGNUMCRUCIS: /* シグナムクルシス */
+ {
+ int race = status_get_race(bl);
+ if(race == 6 || battle_check_undead(race,status_get_elem_type(bl))) {
+ sc_data[type].timer=add_timer(1000*600+tick,status_change_timer, bl->id, data );
+ return 0;
+ }
+ }
+ break;
+
+ case SC_PROVOKE: /* プロボック/オ?トバ?サ?ク */
+ if(sc_data[type].val2!=0){ /* オ?トバ?サ?ク(1秒ごとにHPチェック) */
+ if(sd && sd->status.hp>sd->status.max_hp>>2) /* 停止 */
+ break;
+ sc_data[type].timer=add_timer( 1000+tick,status_change_timer, bl->id, data );
+ return 0;
+ }
+ break;
+
+ case SC_WATERBALL: /* ウォ?タ?ボ?ル */
+ {
+ struct block_list *target=map_id2bl(sc_data[type].val2);
+ nullpo_retb(target);
+ nullpo_retb(target->prev);
+ skill_attack(BF_MAGIC,bl,bl,target,WZ_WATERBALL,sc_data[type].val1,tick,0);
+ if((--sc_data[type].val3)>0) {
+ sc_data[type].timer=add_timer( 150+tick,status_change_timer, bl->id, data );
+ return 0;
+ }
+ }
+ break;
+
+ case SC_ENDURE: /* インデュア */
+ case SC_AUTOBERSERK: // Celest
+ if(sd && sd->special_state.infinite_endure) {
+#ifdef TWILIGHT
+ sc_data[type].timer=add_timer( 1000*600+tick,status_change_timer, bl->id, data );
+#else
+ sc_data[type].timer=add_timer( 1000*60+tick,status_change_timer, bl->id, data );
+#endif
+ //sc_data[type].val2=1;
+ return 0;
+ }
+ break;
+
+ case SC_DISSONANCE: /* 不協和音 */
+ if( (--sc_data[type].val2)>0){
+ struct skill_unit *unit=
+ (struct skill_unit *)sc_data[type].val4;
+ struct block_list *src;
+ /*if(!unit || !unit->group)
+ break;
+ src=map_id2bl(unit->group->src_id);
+ if(!src)
+ break;*/
+ nullpo_retb(unit);
+ nullpo_retb(unit->group);
+ nullpo_retr(0, src=map_id2bl(unit->group->src_id));
+ skill_attack(BF_MISC,src,&unit->bl,bl,unit->group->skill_id,sc_data[type].val1,tick,0);
+ sc_data[type].timer=add_timer(skill_get_time2(unit->group->skill_id,unit->group->skill_lv)+tick,
+ status_change_timer, bl->id, data );
+ return 0;
+ }
+ break;
+
+ case SC_LULLABY: /* 子守唄 */
+ if( (--sc_data[type].val2)>0){
+ struct skill_unit *unit=
+ (struct skill_unit *)sc_data[type].val4;
+ nullpo_retb(unit);
+ nullpo_retb(unit->group);
+ if(unit->group->src_id == bl->id)
+ break;
+ skill_additional_effect(bl,bl,unit->group->skill_id,sc_data[type].val1,BF_LONG|BF_SKILL|BF_MISC,tick);
+ if (unit->group != 0)
+ sc_data[type].timer=add_timer(skill_get_time(unit->group->skill_id,unit->group->skill_lv)/10+tick,
+ status_change_timer, bl->id, data );
+ return 0;
+ }
+ break;
+
+ case SC_STONE:
+ if(sc_data[type].val2 != 0) {
+ short *opt1 = status_get_opt1(bl);
+ sc_data[type].val2 = 0;
+ sc_data[type].val4 = 0;
+ battle_stopwalking(bl,1);
+ if(opt1) {
+ *opt1 = 1;
+ clif_changeoption(bl);
+ }
+ sc_data[type].timer=add_timer(1000+tick,status_change_timer, bl->id, data );
+ return 0;
+ }
+ else if( (--sc_data[type].val3) > 0) {
+ int hp = status_get_max_hp(bl);
+ if((++sc_data[type].val4)%5 == 0 && status_get_hp(bl) > hp>>2) {
+ hp = hp/100;
+ if(hp < 1) hp = 1;
+ if(sd)
+ pc_heal(sd,-hp,0);
+ else if(bl->type == BL_MOB){
+ struct mob_data *md;
+ if((md=((struct mob_data *)bl)) == NULL)
+ break;
+ md->hp -= hp;
+ }
+ }
+ sc_data[type].timer=add_timer(1000+tick,status_change_timer, bl->id, data );
+ return 0;
+ }
+ break;
+ case SC_POISON:
+ if(sc_data[SC_SLOWPOISON].timer == -1) {
+ if( (--sc_data[type].val3) > 0) {
+ int hp = status_get_max_hp(bl);
+ if(status_get_hp(bl) > hp>>2) {
+ if(bl->type == BL_PC) {
+ hp = 3 + hp*3/200;
+ pc_heal((struct map_session_data *)bl,-hp,0);
+ }
+ else if(bl->type == BL_MOB) {
+ struct mob_data *md;
+ nullpo_retr(0, md=(struct mob_data *)bl);
+ /*if((md=((struct mob_data *)bl)) == NULL)
+ break;*/
+ hp = 3 + hp/200;
+ md->hp -= hp;
+ }
+ }
+ sc_data[type].timer=add_timer(1000+tick,status_change_timer, bl->id, data );
+ }
+ }
+ else
+ sc_data[type].timer=add_timer(1000+tick,status_change_timer, bl->id, data );
+ break;
+ case SC_DPOISON:
+ if (sc_data[SC_SLOWPOISON].timer == -1 && (--sc_data[type].val3) > 0) {
+ int hp = status_get_max_hp(bl);
+ if (status_get_hp(bl) > hp>>2) {
+ if(sd) {
+ hp = 3 + hp/50;
+ pc_heal(sd, -hp, 0);
+ } else if (bl->type == BL_MOB) {
+ struct mob_data *md;
+ nullpo_retr(0, md=(struct mob_data *)bl);
+ /*if ((md=((struct mob_data *)bl)) == NULL)
+ break;*/
+ hp = 3 + hp/100;
+ md->hp -= hp;
+ }
+ }
+ }
+ if (sc_data[type].val3 > 0)
+ sc_data[type].timer=add_timer(1000+tick,status_change_timer, bl->id, data );
+ break;
+
+ case SC_TENSIONRELAX: /* テンションリラックス */
+ if(sd){ /* SPがあって、HPが?タンでなければ?? */
+ if( sd->status.sp > 12 && sd->status.max_hp > sd->status.hp ){
+/* if(sc_data[type].val2 % (sc_data[type].val1+3) ==0 ){
+ sd->status.sp -= 12;
+ clif_updatestatus(sd,SP_SP);
+ } */
+ sc_data[type].timer=add_timer( /* タイマ?再設定 */
+ 10000+tick, status_change_timer,
+ bl->id, data);
+ return 0;
+ }
+ if(sd->status.max_hp <= sd->status.hp)
+ status_change_end(&sd->bl,SC_TENSIONRELAX,-1);
+ }
+ break;
+ case SC_HEADCRUSH: // temporary damage [celest]
+// case SC_BLEEDING:
+ if((--sc_data[type].val3) > 0) {
+ int hp = status_get_max_hp(bl);
+ if(sd) {
+ hp = 3 + hp*3/200;
+ pc_heal(sd,-hp,0);
+ }
+ else if(bl->type == BL_MOB) {
+ struct mob_data *md;
+ nullpo_retr(0, md=(struct mob_data *)bl);
+ /*if((md=((struct mob_data *)bl)) == NULL)
+ break;*/
+ hp = 3 + hp/200;
+ md->hp -= hp;
+ }
+ sc_data[type].timer=add_timer(1000+tick,status_change_timer, bl->id, data );
+ }
+ break;
+
+ /* 時間切れ無し?? */
+ case SC_AETERNA:
+ case SC_TRICKDEAD:
+ case SC_RIDING:
+ case SC_FALCON:
+ case SC_WEIGHT50:
+ case SC_WEIGHT90:
+ case SC_MAGICPOWER: /* 魔法力?幅 */
+ case SC_REJECTSWORD: /* リジェクトソ?ド */
+ case SC_MEMORIZE: /* メモライズ */
+ case SC_BROKNWEAPON:
+ case SC_BROKNARMOR:
+ case SC_SACRIFICE:
+// if(sc_data[type].timer==tid)
+ sc_data[type].timer=add_timer( 1000*600+tick,status_change_timer, bl->id, data );
+ return 0;
+
+ case SC_DANCING: //ダンススキルの時間SP消費
+ {
+ int s=0;
+ if(sd){
+ if(sd->status.sp > 0 && (--sc_data[type].val3)>0){
+ switch(sc_data[type].val1){
+ case BD_RICHMANKIM: /* ニヨルドの宴 3秒にSP1 */
+ case BD_DRUMBATTLEFIELD: /* ?太鼓の響き 3秒にSP1 */
+ case BD_RINGNIBELUNGEN: /* ニ?ベルングの指輪 3秒にSP1 */
+ case BD_SIEGFRIED: /* 不死身のジ?クフリ?ド 3秒にSP1 */
+ case BA_DISSONANCE: /* 不協和音 3秒でSP1 */
+ case BA_ASSASSINCROSS: /* 夕陽のアサシンクロス 3秒でSP1 */
+ case DC_UGLYDANCE: /* 自分勝手なダンス 3秒でSP1 */
+ s=3;
+ break;
+ case BD_LULLABY: /* 子守歌 4秒にSP1 */
+ case BD_ETERNALCHAOS: /* 永遠の混沌 4秒にSP1 */
+ case BD_ROKISWEIL: /* ロキの叫び 4秒にSP1 */
+ case DC_FORTUNEKISS: /* 幸運のキス 4秒でSP1 */
+ s=4;
+ break;
+ case BD_INTOABYSS: /* 深淵の中に 5秒にSP1 */
+ case BA_WHISTLE: /* 口笛 5秒でSP1 */
+ case DC_HUMMING: /* ハミング 5秒でSP1 */
+ case BA_POEMBRAGI: /* ブラギの詩 5秒でSP1 */
+ case DC_SERVICEFORYOU: /* サ?ビスフォ?ユ? 5秒でSP1 */
+ s=5;
+ break;
+ case BA_APPLEIDUN: /* イドゥンの林檎 6秒でSP1 */
+ s=6;
+ break;
+ case DC_DONTFORGETME: /* 私を忘れないで… 10秒でSP1 */
+ case CG_MOONLIT: /* 月明りの泉に落ちる花びら 10秒でSP1? */
+ s=10;
+ break;
+ }
+ if(s && ((sc_data[type].val3 % s) == 0)){
+ sd->status.sp--;
+ clif_updatestatus(sd,SP_SP);
+ }
+ sc_data[type].timer=add_timer( /* タイマ?再設定 */
+ 1000+tick, status_change_timer,
+ bl->id, data);
+ return 0;
+ }
+ }
+ }
+ break;
+ case SC_BERSERK: /* バ?サ?ク */
+ if(sd){ /* HPが100以上なら?? */
+ if( (sd->status.hp - sd->status.max_hp*5/100) > 100 ){ // 5% every 10 seconds [DracoRPG]
+ sd->status.hp -= sd->status.max_hp*5/100; // changed to max hp [celest]
+ clif_updatestatus(sd,SP_HP);
+ sc_data[type].timer = add_timer( /* タイマ?再設定 */
+ 10000+tick, status_change_timer,
+ bl->id, data);
+ return 0;
+ }
+ }
+ break;
+ case SC_WEDDING: //結婚用(結婚衣裳になって?くのが?いとか)
+ if(sd){
+ time_t timer;
+ if(time(&timer) < ((sc_data[type].val2) + 3600)){ //1時間たっていないので??
+ sc_data[type].timer=add_timer( /* タイマ?再設定 */
+ 10000+tick, status_change_timer,
+ bl->id, data);
+ return 0;
+ }
+ }
+ break;
+ case SC_NOCHAT: //チャット禁止?態
+ if(sd && battle_config.muting_players){
+ time_t timer;
+ if((++sd->status.manner) && time(&timer) < ((sc_data[type].val2) + 60*(0-sd->status.manner))){ //開始からstatus.manner分?ってないので??
+ clif_updatestatus(sd,SP_MANNER);
+ sc_data[type].timer=add_timer( /* タイマ?再設定(60秒) */
+ 60000+tick, status_change_timer,
+ bl->id, data);
+ return 0;
+ }
+ }
+ break;
+ case SC_SELFDESTRUCTION: /* 自爆 */
+ if(--sc_data[type].val3>0){
+ struct mob_data *md;
+ if(bl->type==BL_MOB && (md=(struct mob_data *)bl) && md->speed > 250){
+ md->speed -= 250;
+ md->next_walktime=tick;
+ }
+ sc_data[type].timer=add_timer( /* タイマ?再設定 */
+ 1000+tick, status_change_timer,
+ bl->id, data);
+ return 0;
+ }
+ break;
+
+ case SC_SPLASHER:
+ if (sc_data[type].val4 % 1000 == 0) {
+ char timer[2];
+ sprintf (timer, "%d", sc_data[type].val4/1000);
+ clif_message(bl, timer);
+ }
+ if((sc_data[type].val4 -= 500) > 0) {
+ sc_data[type].timer = add_timer(
+ 500 + tick, status_change_timer,
+ bl->id, data);
+ return 0;
+ }
+ break;
+
+ case SC_MARIONETTE: /* マリオネットコントロ?ル */
+ case SC_MARIONETTE2:
+ {
+ struct block_list *pbl = map_id2bl(sc_data[type].val3);
+ if (pbl && battle_check_range(bl, pbl, 7) &&
+ (sc_data[type].val2 -= 1000)>0) {
+ sc_data[type].timer = add_timer(
+ 1000 + tick, status_change_timer,
+ bl->id, data);
+ return 0;
+ }
+ }
+ break;
+
+/* case SC_LEADERSHIP:
+ case SC_GLORYWOUNDS:
+ case SC_SOULCOLD:
+ case SC_HAWKEYES:
+ if (sd) {
+ sc_data[type].timer = add_timer(
+ 1000+tick, status_change_timer,
+ bl->id, data);
+ }
+ break;*/
+
+ // Celest
+ case SC_CONFUSION:
+ {
+ int i = 3000;
+ //struct mob_data *md;
+ if (sd) {
+ pc_randomwalk (sd, gettick());
+ sd->next_walktime = tick + (i=1000 + rand()%1000);
+ } /*else if (bl->type==BL_MOB && (md=(struct mob_data *)bl) && md->mode&1 && mob_can_move(md)) {
+ md->state.state=MS_WALK;
+ if( DIFF_TICK(md->next_walktime,tick) > + 7000 &&
+ (md->walkpath.path_len==0 || md->walkpath.path_pos>=md->walkpath.path_len) )
+ md->next_walktime = tick + 3000*rand()%2000;
+ mob_randomwalk(md,tick);
+ }*/
+ if ((sc_data[type].val2 -= 1000) > 0) {
+ sc_data[type].timer = add_timer(
+ i + tick, status_change_timer,
+ bl->id, data);
+ return 0;
+ }
+ }
+ break;
+
+ case SC_GOSPEL:
+ {
+ int calc_flag = 0;
+ if (sc_data[type].val3 > 0) {
+ sc_data[type].val3 = 0;
+ calc_flag = 1;
+ }
+ if(sd && sc_data[type].val4 == BCT_SELF){
+ int hp, sp;
+ hp = (sc_data[type].val1 > 5) ? 45 : 30;
+ sp = (sc_data[type].val1 > 5) ? 35 : 20;
+ if(sd->status.hp - hp > 0 &&
+ sd->status.sp - sp > 0){
+ sd->status.hp -= hp;
+ sd->status.sp -= sp;
+ clif_updatestatus(sd,SP_HP);
+ clif_updatestatus(sd,SP_SP);
+ if ((sc_data[type].val2 -= 10000) > 0) {
+ sc_data[type].timer = add_timer(
+ 10000+tick, status_change_timer,
+ bl->id, data);
+ return 0;
+ }
+ }
+ } else if (sd && sc_data[type].val4 == BCT_PARTY) {
+ int i;
+ switch ((i = rand() % 12)) {
+ case 1: // heal between 100-1000
+ {
+ struct block_list tbl;
+ int heal = rand() % 900 + 100;
+ tbl.id = 0;
+ tbl.m = bl->m;
+ tbl.x = bl->x;
+ tbl.y = bl->y;
+ clif_skill_nodamage(&tbl,bl,AL_HEAL,heal,1);
+ battle_heal(NULL,bl,heal,0,0);
+ }
+ break;
+ case 2: // end negative status
+ {
+ int j;
+ for (j=0; j<4; j++)
+ if(sc_data[i + SC_POISON].timer!=-1) {
+ status_change_end(bl,j,-1);
+ break;
+ }
+ }
+ break;
+ case 3: // +25% resistance to negative status
+ case 4: // +25% max hp
+ case 5: // +25% max sp
+ case 6: // +2 to all stats
+ case 11: // +25% armor and vit def
+ case 12: // +8% atk
+ case 13: // +5% flee
+ case 14: // +5% hit
+ sc_data[type].val3 = i;
+ if (i == 6 ||
+ (i >= 11 && i <= 14))
+ calc_flag = 1;
+ break;
+ case 7: // level 5 bless
+ {
+ struct block_list tbl;
+ tbl.id = 0;
+ tbl.m = bl->m;
+ tbl.x = bl->x;
+ tbl.y = bl->y;
+ clif_skill_nodamage(&tbl,bl,AL_BLESSING,5,1);
+ status_change_start(bl,SkillStatusChangeTable[AL_BLESSING],5,0,0,0,10000,0 );
+ }
+ break;
+ case 8: // level 5 increase agility
+ {
+ struct block_list tbl;
+ tbl.id = 0;
+ tbl.m = bl->m;
+ tbl.x = bl->x;
+ tbl.y = bl->y;
+ clif_skill_nodamage(&tbl,bl,AL_INCAGI,5,1);
+ status_change_start(bl,SkillStatusChangeTable[AL_INCAGI],5,0,0,0,10000,0 );
+ }
+ break;
+ case 9: // holy element to weapon
+ {
+ struct block_list tbl;
+ tbl.id = 0;
+ tbl.m = bl->m;
+ tbl.x = bl->x;
+ tbl.y = bl->y;
+ clif_skill_nodamage(&tbl,bl,PR_ASPERSIO,1,1);
+ status_change_start(bl,SkillStatusChangeTable[PR_ASPERSIO],1,0,0,0,10000,0 );
+ }
+ break;
+ case 10: // holy element to armour
+ {
+ struct block_list tbl;
+ tbl.id = 0;
+ tbl.m = bl->m;
+ tbl.x = bl->x;
+ tbl.y = bl->y;
+ clif_skill_nodamage(&tbl,bl,PR_BENEDICTIO,1,1);
+ status_change_start(bl,SkillStatusChangeTable[PR_BENEDICTIO],1,0,0,0,10000,0 );
+ }
+ break;
+ default:
+ break;
+ }
+ } else if (sc_data[type].val4 == BCT_ENEMY) {
+ int i;
+ switch ((i = rand() % 8)) {
+ case 1: // damage between 300-800
+ case 2: // damage between 150-550 (ignore def)
+ battle_damage(NULL, bl, rand() % 500,0); // temporary damage
+ break;
+ case 3: // random status effect
+ {
+ int effect[3] = {
+ SC_CURSE,
+ SC_BLIND,
+ SC_POISON };
+ status_change_start(bl,effect[rand()%3],1,0,0,0,10000,0 );
+ }
+ break;
+ case 4: // level 10 provoke
+ {
+ struct block_list tbl;
+ tbl.id = 0;
+ tbl.m = bl->m;
+ tbl.x = bl->x;
+ tbl.y = bl->y;
+ clif_skill_nodamage(&tbl,bl,SM_PROVOKE,1,1);
+ status_change_start(bl,SkillStatusChangeTable[SM_PROVOKE],10,0,0,0,10000,0 );
+ }
+ break;
+ case 5: // 0 def
+ case 6: // 0 atk
+ case 7: // 0 flee
+ case 8: // -75% move speed and aspd
+ sc_data[type].val3 = i;
+ calc_flag = 1;
+ break;
+ default:
+ break;
+ }
+ }
+ if (sd && calc_flag)
+ status_calc_pc (sd, 0);
+ }
+ break;
+ }
+
+ return status_change_end( bl,type,tid );
+}
+
+/*==========================================
+ * ステータス異常タイマー範囲処理
+ *------------------------------------------
+ */
+int status_change_timer_sub(struct block_list *bl, va_list ap )
+{
+ struct block_list *src;
+ int type;
+ unsigned int tick;
+
+ nullpo_retr(0, bl);
+ nullpo_retr(0, ap);
+ nullpo_retr(0, src=va_arg(ap,struct block_list*));
+ type=va_arg(ap,int);
+ tick=va_arg(ap,unsigned int);
+
+ if(bl->type!=BL_PC && bl->type!=BL_MOB)
+ return 0;
+
+ switch( type ){
+ case SC_SIGHT: /* サイト */
+ case SC_CONCENTRATE:
+ if( (*status_get_option(bl))&6 ){
+ status_change_end( bl, SC_HIDING, -1);
+ status_change_end( bl, SC_CLOAKING, -1);
+ }
+ break;
+ case SC_RUWACH: /* ルアフ */
+ if( (*status_get_option(bl))&6 ){
+ if(battle_check_target( src,bl, BCT_ENEMY ) > 0) {
+ struct status_change *sc_data = status_get_sc_data(bl); // check whether the target is hiding/cloaking [celest]
+ if (sc_data && (sc_data[SC_HIDING].timer != -1 || // if the target is using a special hiding, i.e not using normal hiding/cloaking, don't bother
+ sc_data[SC_CLOAKING].timer != -1)) {
+ status_change_end( bl, SC_HIDING, -1);
+ status_change_end( bl, SC_CLOAKING, -1);
+ skill_attack(BF_MAGIC,src,src,bl,AL_RUWACH,sc_data[type].val1,tick,0);
+ }
+ }
+ }
+ break;
+ }
+ return 0;
+}
+
+
+static int status_calc_sigma(void)
+{
+ int i,j,k;
+
+ for(i=0;i<MAX_PC_CLASS;i++) {
+ memset(hp_sigma_val[i],0,sizeof(hp_sigma_val[i]));
+ for(k=0,j=2;j<=MAX_LEVEL;j++) {
+ k += hp_coefficient[i]*j + 50;
+ k -= k%100;
+ hp_sigma_val[i][j-1] = k;
+ }
+ }
+ return 0;
+}
+
+int status_readdb(void) {
+ int i,j,k;
+ FILE *fp;
+ char line[1024],*p;
+
+ // JOB補正?値1
+ fp=fopen("db/job_db1.txt","r");
+ if(fp==NULL){
+ printf("can't read db/job_db1.txt\n");
+ return 1;
+ }
+ i=0;
+ while(fgets(line, sizeof(line)-1, fp)){
+ char *split[50];
+ if(line[0]=='/' && line[1]=='/')
+ continue;
+ for(j=0,p=line;j<21 && p;j++){
+ split[j]=p;
+ p=strchr(p,',');
+ if(p) *p++=0;
+ }
+ if(j<21)
+ continue;
+ max_weight_base[i]=atoi(split[0]);
+ hp_coefficient[i]=atoi(split[1]);
+ hp_coefficient2[i]=atoi(split[2]);
+ sp_coefficient[i]=atoi(split[3]);
+ for(j=0;j<17;j++)
+ aspd_base[i][j]=atoi(split[j+4]);
+ i++;
+// -- moonsoul (below two lines added to accommodate high numbered new class ids)
+ if(i==24)
+ i=4001;
+ if(i==MAX_PC_CLASS)
+ break;
+ }
+ fclose(fp);
+ sprintf(tmp_output,"Done reading '"CL_WHITE"%s"CL_RESET"'.\n","db/job_db1.txt");
+ ShowStatus(tmp_output);
+
+ // JOBボ?ナス
+ memset(job_bonus,0,sizeof(job_bonus));
+ fp=fopen("db/job_db2.txt","r");
+ if(fp==NULL){
+ printf("can't read db/job_db2.txt\n");
+ return 1;
+ }
+ i=0;
+ while(fgets(line, sizeof(line)-1, fp)){
+ if(line[0]=='/' && line[1]=='/')
+ continue;
+ for(j=0,p=line;j<MAX_LEVEL && p;j++){
+ if(sscanf(p,"%d",&k)==0)
+ break;
+ job_bonus[0][i][j]=k;
+ job_bonus[2][i][j]=k; //養子職のボ?ナスは分からないので?
+ p=strchr(p,',');
+ if(p) p++;
+ }
+ i++;
+// -- moonsoul (below two lines added to accommodate high numbered new class ids)
+ if(i==24)
+ i=4001;
+ if(i==MAX_PC_CLASS)
+ break;
+ }
+ fclose(fp);
+ sprintf(tmp_output,"Done reading '"CL_WHITE"%s"CL_RESET"'.\n","db/job_db2.txt");
+ ShowStatus(tmp_output);
+
+ // JOBボ?ナス2 ?生職用
+ fp=fopen("db/job_db2-2.txt","r");
+ if(fp==NULL){
+ printf("can't read db/job_db2-2.txt\n");
+ return 1;
+ }
+ i=0;
+ while(fgets(line, sizeof(line)-1, fp)){
+ if(line[0]=='/' && line[1]=='/')
+ continue;
+ for(j=0,p=line;j<MAX_LEVEL && p;j++){
+ if(sscanf(p,"%d",&k)==0)
+ break;
+ job_bonus[1][i][j]=k;
+ p=strchr(p,',');
+ if(p) p++;
+ }
+ i++;
+ if(i==MAX_PC_CLASS)
+ break;
+ }
+ fclose(fp);
+ sprintf(tmp_output,"Done reading '"CL_WHITE"%s"CL_RESET"'.\n","db/job_db2-2.txt");
+ ShowStatus(tmp_output);
+
+ // サイズ補正テ?ブル
+ for(i=0;i<3;i++)
+ for(j=0;j<20;j++)
+ atkmods[i][j]=100;
+ fp=fopen("db/size_fix.txt","r");
+ if(fp==NULL){
+ printf("can't read db/size_fix.txt\n");
+ return 1;
+ }
+ i=0;
+ while(fgets(line, sizeof(line)-1, fp)){
+ char *split[20];
+ if(line[0]=='/' && line[1]=='/')
+ continue;
+ if(atoi(line)<=0)
+ continue;
+ memset(split,0,sizeof(split));
+ for(j=0,p=line;j<20 && p;j++){
+ split[j]=p;
+ p=strchr(p,',');
+ if(p) *p++=0;
+ }
+ for(j=0;j<20 && split[j];j++)
+ atkmods[i][j]=atoi(split[j]);
+ i++;
+ }
+ fclose(fp);
+ sprintf(tmp_output,"Done reading '"CL_WHITE"%s"CL_RESET"'.\n","db/size_fix.txt");
+ ShowStatus(tmp_output);
+
+ // 精?デ?タテ?ブル
+ for(i=0;i<5;i++){
+ for(j=0;j<10;j++)
+ percentrefinery[i][j]=100;
+ refinebonus[i][0]=0;
+ refinebonus[i][1]=0;
+ refinebonus[i][2]=10;
+ }
+ fp=fopen("db/refine_db.txt","r");
+ if(fp==NULL){
+ printf("can't read db/refine_db.txt\n");
+ return 1;
+ }
+ i=0;
+ while(fgets(line, sizeof(line)-1, fp)){
+ char *split[16];
+ if(line[0]=='/' && line[1]=='/')
+ continue;
+ if(atoi(line)<=0)
+ continue;
+ memset(split,0,sizeof(split));
+ for(j=0,p=line;j<16 && p;j++){
+ split[j]=p;
+ p=strchr(p,',');
+ if(p) *p++=0;
+ }
+ refinebonus[i][0]=atoi(split[0]); // 精?ボ?ナス
+ refinebonus[i][1]=atoi(split[1]); // 過?精?ボ?ナス
+ refinebonus[i][2]=atoi(split[2]); // 安全精?限界
+ for(j=0;j<10 && split[j];j++)
+ percentrefinery[i][j]=atoi(split[j+3]);
+ i++;
+ }
+ fclose(fp); //Lupus. close this file!!!
+ sprintf(tmp_output,"Done reading '"CL_WHITE"%s"CL_RESET"'.\n","db/refine_db.txt");
+ ShowStatus(tmp_output);
+
+ return 0;
+}
+
+/*==========================================
+ * スキル関係初期化処理
+ *------------------------------------------
+ */
+int do_init_status(void)
+{
+ add_timer_func_list(status_change_timer,"status_change_timer");
+ status_readdb();
+ status_calc_sigma();
+ return 0;
+}
diff --git a/src/map/status.h b/src/map/status.h new file mode 100644 index 000000000..513458822 --- /dev/null +++ b/src/map/status.h @@ -0,0 +1,75 @@ +#ifndef _STATUS_H_
+#define _STATUS_H_
+
+// パラメータ所得系 battle.c より移動
+int status_get_class(struct block_list *bl);
+int status_get_dir(struct block_list *bl);
+int status_get_lv(struct block_list *bl);
+int status_get_range(struct block_list *bl);
+int status_get_hp(struct block_list *bl);
+int status_get_max_hp(struct block_list *bl);
+int status_get_str(struct block_list *bl);
+int status_get_agi(struct block_list *bl);
+int status_get_vit(struct block_list *bl);
+int status_get_int(struct block_list *bl);
+int status_get_dex(struct block_list *bl);
+int status_get_luk(struct block_list *bl);
+int status_get_hit(struct block_list *bl);
+int status_get_flee(struct block_list *bl);
+int status_get_def(struct block_list *bl);
+int status_get_mdef(struct block_list *bl);
+int status_get_flee2(struct block_list *bl);
+int status_get_def2(struct block_list *bl);
+int status_get_mdef2(struct block_list *bl);
+int status_get_baseatk(struct block_list *bl);
+int status_get_atk(struct block_list *bl);
+int status_get_atk2(struct block_list *bl);
+int status_get_speed(struct block_list *bl);
+int status_get_adelay(struct block_list *bl);
+int status_get_amotion(struct block_list *bl);
+int status_get_dmotion(struct block_list *bl);
+int status_get_element(struct block_list *bl);
+int status_get_attack_element(struct block_list *bl);
+int status_get_attack_element2(struct block_list *bl); //左手武器属性取得
+#define status_get_elem_type(bl) (status_get_element(bl)%10)
+#define status_get_elem_level(bl) (status_get_element(bl)/10/2)
+int status_get_party_id(struct block_list *bl);
+int status_get_guild_id(struct block_list *bl);
+int status_get_race(struct block_list *bl);
+int status_get_size(struct block_list *bl);
+int status_get_mode(struct block_list *bl);
+int status_get_mexp(struct block_list *bl);
+
+struct status_change *status_get_sc_data(struct block_list *bl);
+short *status_get_sc_count(struct block_list *bl);
+short *status_get_opt1(struct block_list *bl);
+short *status_get_opt2(struct block_list *bl);
+short *status_get_opt3(struct block_list *bl);
+short *status_get_option(struct block_list *bl);
+
+int status_get_matk1(struct block_list *bl);
+int status_get_matk2(struct block_list *bl);
+int status_get_critical(struct block_list *bl);
+int status_get_atk_(struct block_list *bl);
+int status_get_atk_2(struct block_list *bl);
+int status_get_atk2(struct block_list *bl);
+
+// 状態異常関連 skill.c より移動
+int status_change_start(struct block_list *bl,int type,int val1,int val2,int val3,int val4,int tick,int flag);
+int status_change_end( struct block_list* bl , int type,int tid );
+int status_change_timer(int tid, unsigned int tick, int id, int data);
+int status_change_timer_sub(struct block_list *bl, va_list ap );
+int status_change_clear(struct block_list *bl,int type);
+
+// ステータス計算 pc.c から分離
+// pc_calcstatus
+int status_calc_pc(struct map_session_data* sd,int first);
+int status_calc_speed(struct map_session_data*); // [Celest]
+// int status_calc_skilltree(struct map_session_data *sd);
+int status_getrefinebonus(int lv,int type);
+int status_percentrefinery(struct map_session_data *sd,struct item *item);
+extern int percentrefinery[5][10];
+
+int do_init_status(void);
+
+#endif
|