From 8cc9012eb7e064677d2c9fa74fe1d1a09f90b581 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sun, 5 May 2013 17:39:47 -0300 Subject: 3rd Class Effects Update http://hercules.ws/board/topic/561-3rd-class-effects-update/ Signed-off-by: shennetsind --- src/map/status.c | 131 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 115 insertions(+), 16 deletions(-) (limited to 'src/map/status.c') diff --git a/src/map/status.c b/src/map/status.c index fec23cb55..3524430e5 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -55,9 +55,9 @@ static int hp_coefficient2[CLASS_COUNT]; static int hp_sigma_val[CLASS_COUNT][MAX_LEVEL+1]; static int sp_coefficient[CLASS_COUNT]; #ifdef RENEWAL_ASPD -static int aspd_base[CLASS_COUNT][MAX_WEAPON_TYPE+1]; + static int aspd_base[CLASS_COUNT][MAX_WEAPON_TYPE+1]; #else -static int aspd_base[CLASS_COUNT][MAX_WEAPON_TYPE]; //[blackhole89] + static int aspd_base[CLASS_COUNT][MAX_WEAPON_TYPE]; //[blackhole89] #endif // bonus values and upgrade chances for refining equipment @@ -78,13 +78,6 @@ int current_equip_card_id; //To prevent card-stacking (from jA) [Skotlex] //we need it for new cards 15 Feb 2005, to check if the combo cards are insrerted into the CURRENT weapon only //to avoid cards exploits -static sc_type SkillStatusChangeTable[MAX_SKILL]; // skill -> status -static int StatusIconChangeTable[SC_MAX]; // status -> "icon" (icon is a bit of a misnomer, since there exist values with no icon associated) -static unsigned int StatusChangeFlagTable[SC_MAX]; // status -> flags -static int StatusSkillChangeTable[SC_MAX]; // status -> skill -static int StatusRelevantBLTypes[SI_MAX]; // "icon" -> enum bl_type (for clif->status_change to identify for which bl types to send packets) - - /** * Returns the status change associated with a skill. * @param skill The skill to look up @@ -184,7 +177,7 @@ void initChangeTables(void) { memset(StatusSkillChangeTable, 0, sizeof(StatusSkillChangeTable)); memset(StatusChangeFlagTable, 0, sizeof(StatusChangeFlagTable)); - + memset(StatusDisplayType, 0, sizeof(StatusDisplayType)); //First we define the skill for common ailments. These are used in skill_additional_effect through sc cards. [Skotlex] set_sc( NPC_PETRIFYATTACK , SC_STONE , SI_BLANK , SCB_DEF_ELE|SCB_DEF|SCB_MDEF ); @@ -988,6 +981,30 @@ void initChangeTables(void) { StatusChangeFlagTable[SC_ALL_RIDING] = SCB_SPEED; + /* StatusDisplayType Table [Ind/Hercules] */ + StatusDisplayType[SC_ALL_RIDING] = true; + StatusDisplayType[SC_PUSH_CART] = true; + StatusDisplayType[SC_SPHERE_1] = true; + StatusDisplayType[SC_SPHERE_2] = true; + StatusDisplayType[SC_SPHERE_3] = true; + StatusDisplayType[SC_SPHERE_4] = true; + StatusDisplayType[SC_SPHERE_5] = true; + StatusDisplayType[SC_CAMOUFLAGE] = true; + StatusDisplayType[SC_DUPLELIGHT] = true; + StatusDisplayType[SC_ORATIO] = true; + StatusDisplayType[SC_FREEZING] = true; + StatusDisplayType[SC_VENOMIMPRESS] = true; + StatusDisplayType[SC_HALLUCINATIONWALK] = true; + StatusDisplayType[SC_ROLLINGCUTTER] = true; + StatusDisplayType[SC_BANDING] = true; + StatusDisplayType[SC_CRYSTALIZE] = true; + StatusDisplayType[SC_DEEPSLEEP] = true; + StatusDisplayType[SC_CURSEDCIRCLE_ATKER]= true; + StatusDisplayType[SC_CURSEDCIRCLE_TARGET]= true; + StatusDisplayType[SC_BLOODSUCKER] = true; + StatusDisplayType[SC__SHADOWFORM] = true; + StatusDisplayType[SC__MANHOLE] = true; + #ifdef RENEWAL_EDP // renewal EDP increases your weapon atk StatusChangeFlagTable[SC_EDP] |= SCB_WATK; @@ -6350,7 +6367,50 @@ int status_get_sc_def(struct block_list *bl, enum sc_type type, int rate, int ti return tick; } - +/* [Ind/Hercules] fast-checkin sc-display array */ +void status_display_add(struct map_session_data *sd, enum sc_type type, int dval1, int dval2, int dval3) { + struct sc_display_entry *entry = ers_alloc(pc_sc_display_ers, struct sc_display_entry); + + entry->type = type; + entry->val1 = dval1; + entry->val2 = dval2; + entry->val3 = dval3; + + RECREATE(sd->sc_display, struct sc_display_entry *, ++sd->sc_display_count); + sd->sc_display[ sd->sc_display_count - 1 ] = entry; +} +void status_display_remove(struct map_session_data *sd, enum sc_type type) { + int i; + + for( i = 0; i < sd->sc_display_count; i++ ) { + if( sd->sc_display[i]->type == type ) + break; + } + + if( i != sd->sc_display_count ) { + int cursor; + + ers_free(pc_sc_display_ers, sd->sc_display[i]); + sd->sc_display[i] = NULL; + + /* the all-mighty compact-o-matic */ + for( i = 0, cursor = 0; i < sd->sc_display_count; i++ ) { + if( sd->sc_display[i] == NULL ) + continue; + + if( i != cursor ) { + sd->sc_display[cursor] = sd->sc_display[i]; + } + + cursor++; + } + + if( !(sd->sc_display_count = cursor) ) { + aFree(sd->sc_display); + sd->sc_display = NULL; + } + } +} /*========================================== * Starts a status change. * 'type' = type, 'val1~4' depend on the type. @@ -6362,8 +6422,7 @@ int status_get_sc_def(struct block_list *bl, enum sc_type type, int rate, int ti * &4: sc_data loaded, no value has to be altered. * &8: rate should not be reduced *------------------------------------------*/ -int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val1,int val2,int val3,int val4,int tick,int flag) -{ +int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val1,int val2,int val3,int val4,int tick,int flag) { struct map_session_data *sd = NULL; struct status_change* sc; struct status_change_entry* sce; @@ -8562,6 +8621,42 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val break; } } + + /* [Ind/Hercules] */ + if( sd && StatusDisplayType[type] ) { + int dval1 = 0, dval2 = 0, dval3 = 0; + switch( type ) { + case SC_ALL_RIDING: + dval1 = 1; + break; + case SC_SPHERE_1: + case SC_SPHERE_2: + case SC_SPHERE_3: + case SC_SPHERE_4: + case SC_SPHERE_5: + case SC_PUSH_CART: + case SC_CAMOUFLAGE: + case SC_DUPLELIGHT: + case SC_ORATIO: + case SC_FREEZING: + case SC_VENOMIMPRESS: + case SC_HALLUCINATIONWALK: + case SC_ROLLINGCUTTER: + case SC_BANDING: + case SC_CRYSTALIZE: + case SC_DEEPSLEEP: + case SC_CURSEDCIRCLE_ATKER: + case SC_CURSEDCIRCLE_TARGET: + case SC_BLOODSUCKER: + case SC__SHADOWFORM: + case SC__MANHOLE: + dval1 = val1; + break; + /* handle */ + default: break; + } + status_display_add(sd,type,dval1,dval2,dval3); + } //Those that make you stop attacking/walking.... switch (type) { @@ -8797,7 +8892,8 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val calc_flag&=~SCB_DYE; } - clif->status_change(bl,StatusIconChangeTable[type],1,tick,(val_flag&1)?val1:1,(val_flag&2)?val2:0,(val_flag&4)?val3:0); + if( !(flag&4 && StatusDisplayType[type]) ) + clif->status_change(bl,StatusIconChangeTable[type],1,tick,(val_flag&1)?val1:1,(val_flag&2)?val2:0,(val_flag&4)?val3:0); /** * used as temporary storage for scs with interval ticks, so that the actual duration is sent to the client first. @@ -9025,8 +9121,7 @@ int status_change_clear(struct block_list* bl, int type) { /*========================================== * Special condition we want to effectuate, check before ending a status. *------------------------------------------*/ -int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const char* file, int line) -{ +int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const char* file, int line) { struct map_session_data *sd; struct status_change *sc; struct status_change_entry *sce; @@ -9078,6 +9173,10 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const sc->data[type] = NULL; + if( sd && StatusDisplayType[type] ) { + status_display_remove(sd,type); + } + vd = status_get_viewdata(bl); calc_flag = StatusChangeFlagTable[type]; switch(type){ -- cgit v1.2.3-70-g09d2