Updated damagetaken (#7372)
Save damagetaken in mob_data for mob controller
This commit is contained in:
parent
4a5b8e33dc
commit
53d5fc609a
@ -8584,6 +8584,7 @@ Parameters (indexes) for monsters are:
|
|||||||
UMOB_IGNORE_CELL_STACK_LIMIT
|
UMOB_IGNORE_CELL_STACK_LIMIT
|
||||||
UMOB_RES
|
UMOB_RES
|
||||||
UMOB_MRES
|
UMOB_MRES
|
||||||
|
UMOB_DAMAGETAKEN
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
@ -1845,8 +1845,8 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
|
|||||||
if (bl->type == BL_MOB) { // Reduces damage received for Green Aura MVP
|
if (bl->type == BL_MOB) { // Reduces damage received for Green Aura MVP
|
||||||
mob_data *md = BL_CAST(BL_MOB, bl);
|
mob_data *md = BL_CAST(BL_MOB, bl);
|
||||||
|
|
||||||
if (md && md->db->damagetaken != 100)
|
if (md && md->damagetaken != 100)
|
||||||
damage = i64max(damage * md->db->damagetaken / 100, 1);
|
damage = i64max(damage * md->damagetaken / 100, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return damage;
|
return damage;
|
||||||
|
@ -380,6 +380,7 @@ struct mob_data {
|
|||||||
* MvP Tombstone NPC ID
|
* MvP Tombstone NPC ID
|
||||||
**/
|
**/
|
||||||
int tomb_nid;
|
int tomb_nid;
|
||||||
|
uint16 damagetaken;
|
||||||
|
|
||||||
e_mob_bosstype get_bosstype();
|
e_mob_bosstype get_bosstype();
|
||||||
};
|
};
|
||||||
|
@ -18741,6 +18741,7 @@ BUILDIN_FUNC(getunitdata)
|
|||||||
getunitdata_sub(UMOB_IGNORE_CELL_STACK_LIMIT, md->ud.state.ignore_cell_stack_limit);
|
getunitdata_sub(UMOB_IGNORE_CELL_STACK_LIMIT, md->ud.state.ignore_cell_stack_limit);
|
||||||
getunitdata_sub(UMOB_RES, md->status.res);
|
getunitdata_sub(UMOB_RES, md->status.res);
|
||||||
getunitdata_sub(UMOB_MRES, md->status.mres);
|
getunitdata_sub(UMOB_MRES, md->status.mres);
|
||||||
|
getunitdata_sub(UMOB_DAMAGETAKEN, md->damagetaken);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BL_HOM:
|
case BL_HOM:
|
||||||
@ -19148,6 +19149,7 @@ BUILDIN_FUNC(setunitdata)
|
|||||||
case UMOB_IGNORE_CELL_STACK_LIMIT: md->ud.state.ignore_cell_stack_limit = value > 0; break;
|
case UMOB_IGNORE_CELL_STACK_LIMIT: md->ud.state.ignore_cell_stack_limit = value > 0; break;
|
||||||
case UMOB_RES: md->base_status->res = (short)value; calc_status = true; break;
|
case UMOB_RES: md->base_status->res = (short)value; calc_status = true; break;
|
||||||
case UMOB_MRES: md->base_status->mres = (short)value; calc_status = true; break;
|
case UMOB_MRES: md->base_status->mres = (short)value; calc_status = true; break;
|
||||||
|
case UMOB_DAMAGETAKEN: md->damagetaken = (unsigned short)value; break;
|
||||||
default:
|
default:
|
||||||
ShowError("buildin_setunitdata: Unknown data identifier %d for BL_MOB.\n", type);
|
ShowError("buildin_setunitdata: Unknown data identifier %d for BL_MOB.\n", type);
|
||||||
return SCRIPT_CMD_FAILURE;
|
return SCRIPT_CMD_FAILURE;
|
||||||
|
@ -494,6 +494,7 @@ enum unitdata_mobtypes {
|
|||||||
UMOB_IGNORE_CELL_STACK_LIMIT,
|
UMOB_IGNORE_CELL_STACK_LIMIT,
|
||||||
UMOB_RES,
|
UMOB_RES,
|
||||||
UMOB_MRES,
|
UMOB_MRES,
|
||||||
|
UMOB_DAMAGETAKEN,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum unitdata_homuntypes {
|
enum unitdata_homuntypes {
|
||||||
|
@ -4685,6 +4685,7 @@
|
|||||||
export_constant(UMOB_IGNORE_CELL_STACK_LIMIT);
|
export_constant(UMOB_IGNORE_CELL_STACK_LIMIT);
|
||||||
export_constant(UMOB_RES);
|
export_constant(UMOB_RES);
|
||||||
export_constant(UMOB_MRES);
|
export_constant(UMOB_MRES);
|
||||||
|
export_constant(UMOB_DAMAGETAKEN);
|
||||||
|
|
||||||
/* unit control - homunculus */
|
/* unit control - homunculus */
|
||||||
export_constant(UHOM_SIZE);
|
export_constant(UHOM_SIZE);
|
||||||
|
@ -2602,6 +2602,7 @@ int status_calc_mob_(struct mob_data* md, uint8 opt)
|
|||||||
;
|
;
|
||||||
else
|
else
|
||||||
md->level = md->db->lv;
|
md->level = md->db->lv;
|
||||||
|
md->damagetaken = md->db->damagetaken;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if we need custom base-status
|
// Check if we need custom base-status
|
||||||
|
Loading…
x
Reference in New Issue
Block a user