Allow NPC view data modifications (#4385)

* Fixes #4289.
* Updated script commands setunitdata and getunitdata to support the modification of NPC view data.
* Converted mob_avail database to YAML.
Thanks to @Lemongrass3110, @4144, @exneval, @Balferian, @cahya1992 and @teededung!
Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
This commit is contained in:
Aleos
2019-12-22 10:27:43 -05:00
committed by GitHub
parent f2a1b6e784
commit b0119631a4
19 changed files with 971 additions and 160 deletions

View File

@@ -3134,6 +3134,26 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file,
return 1;
}
/**
* Refresh the area with a change in display of a unit.
* @bl: Object to update
*/
void unit_refresh(struct block_list *bl) {
nullpo_retv(bl);
if (bl->m < 0)
return;
struct map_data *mapdata = map_getmapdata(bl->m);
// Using CLR_TRICKDEAD because other flags show effects
// Probably need to use another flag or other way to refresh it
if (mapdata->users) {
clif_clearunit_area(bl, CLR_TRICKDEAD); // Fade out
clif_spawn(bl); // Fade in
}
}
/**
* Removes units of a master when the master is removed from map
* @param sd: Player