summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c59
1 files changed, 42 insertions, 17 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 74b2571e1..df79cee74 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -2598,12 +2598,29 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
}
/* we've got combos to process */
- if( sd->combos.count ) {
- for( i = 0; i < sd->combos.count; i++ ) {
- script->run(sd->combos.bonus[i],0,sd->bl.id,0);
- if (!calculating) //Abort, script->run retriggered this.
- return 1;
+ for( i = 0; i < sd->combo_count; i++ ) {
+ struct item_combo *combo = itemdb->id2combo(sd->combos[i].id);
+ unsigned char j;
+
+ /**
+ * ensure combo usage is allowed at this location
+ **/
+ for(j = 0; j < combo->count; j++) {
+ for(k = 0; k < map->list[sd->bl.m].zone->disabled_items_count; k++) {
+ if( map->list[sd->bl.m].zone->disabled_items[k] == combo->nameid[j] ) {
+ break;
+ }
+ }
+ if( k != map->list[sd->bl.m].zone->disabled_items_count )
+ break;
}
+
+ if( j != combo->count )
+ continue;
+
+ script->run(sd->combos[i].bonus,0,sd->bl.id,0);
+ if (!calculating) //Abort, script->run retriggered this.
+ return 1;
}
//Store equipment script bonuses
@@ -5529,12 +5546,14 @@ short status_calc_aspd_rate(struct block_list *bl, struct status_change *sc, int
}
unsigned short status_calc_dmotion(struct block_list *bl, struct status_change *sc, int dmotion) {
+ // It has been confirmed on official servers that MvP mobs have no dmotion even without endure
+ if( bl->type == BL_MOB && (((TBL_MOB*)bl)->status.mode&MD_BOSS) )
+ return 0;
+
if( !sc || !sc->count || map_flag_gvg2(bl->m) || map->list[bl->m].flag.battleground )
return cap_value(dmotion,0,USHRT_MAX);
- /**
- * It has been confirmed on official servers that MvP mobs have no dmotion even without endure
- **/
- if( sc->data[SC_ENDURE] || ( bl->type == BL_MOB && (((TBL_MOB*)bl)->status.mode&MD_BOSS) ) )
+
+ if( sc->data[SC_ENDURE] )
return 0;
if( sc->data[SC_RUN] || sc->data[SC_WUGDASH] )
return 0;
@@ -8416,12 +8435,12 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
tick = -1; //endless duration in the client
break;
case SC_EXEEDBREAK:
- val1 *= 150; // 150 * skill_lv
- if( sd && sd->inventory_data[sd->equip_index[EQI_HAND_R]] ) { // Chars.
- val1 += (sd->inventory_data[sd->equip_index[EQI_HAND_R]]->weight/10 * sd->inventory_data[sd->equip_index[EQI_HAND_R]]->wlv * status->get_lv(bl) / 100);
- val1 += 15 * (sd ? sd->status.job_level:50) + 100;
- } else // Mobs
- val1 += (400 * status->get_lv(bl) / 100) + (15 * (status->get_lv(bl) / 2)); // About 1138% at mob_lvl 99. Is an aproximation to a standard weapon. [pakpil]
+ if( sd ){
+ short index = sd->equip_index[EQI_HAND_R];
+ val1 = 15 * (sd->status.job_level + val1 * 10);
+ if( index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->type == IT_WEAPON )
+ val1 += (sd->inventory_data[index]->weight / 10 * sd->inventory_data[index]->wlv) * status->get_lv(bl) / 100;
+ }
break;
case SC_PRESTIGE: // Based on suggested formula in iRO Wiki and some test, still need more test. [pakpil]
val2 = ((st->int_ + st->luk) / 6) + 5; // Chance to evade magic damage.
@@ -9123,8 +9142,11 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
sce->val4 = val4;
if (tick >= 0)
sce->timer = timer->add(timer->gettick() + tick, status->change_timer, bl->id, type);
- else
+ else {
sce->timer = INVALID_TIMER; //Infinite duration
+ if( sd )
+ chrif->save_scdata_single(sd->status.account_id,sd->status.char_id,type,sce);
+ }
if (calc_flag)
status_calc_bl(bl,calc_flag);
@@ -9305,6 +9327,9 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
if (sce->timer != tid && tid != INVALID_TIMER)
return 0;
+ if( sd && sce->timer == INVALID_TIMER )
+ chrif->del_scdata_single(sd->status.account_id,sd->status.char_id,type);
+
if (tid == INVALID_TIMER) {
if (type == SC_ENDURE && sce->val4)
//Do not end infinite endure.
@@ -9658,7 +9683,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
* 3rd Stuff
**/
case SC_MILLENNIUMSHIELD:
- clif->millenniumshield(sd,0);
+ clif->millenniumshield(bl,0);
break;
case SC_HALLUCINATIONWALK:
sc_start(bl,SC_HALLUCINATIONWALK_POSTDELAY,100,sce->val1,skill->get_time2(GC_HALLUCINATIONWALK,sce->val1));