Introducing Hercules' Map Zone Database Hello~! - What?!
1st, it is a merge from item_noequip.txt and skill_nocast_db.txt functionality.
2nd, it is a major improvement on what these features did in both performance and usability.
map_zone_db.txt format sample
{
name: "My Zone"
inherit: ( "My Other Zone" )
disabled_skills: {
AL_HEAL: "PLAYER | MONSTER | ELEMENTAL"
AL_TELEPORT: "MONSTER"
MG_FIREBOLT: "NONE"
//MG_NAPALMBEAT: "PLAYER"
//ID11: "PLAYER"
}
disabled_items: {
Assumptio_5_Scroll: false
//Apple: true
//ID501: true
}
mapflags: (
"adjust_skill_damage MG_FIREBOLT 250",
"adjust_unit_duration PR_SANCTUARY 50"
)
/* "command:min-group-lv-to-override" e.g. "heal: 70" */
disabled_commands: {
//Example Below makes @heal be used in maps within this zone only by those group lv 70 and above
//heal: 70
}
skill_damage_cap: {
//Exemple Below caps firebolt damage in maps within this zone to a maximum 50 damage,
// (depends on HMAP_ZONE_DAMAGE_CAP_TYPE in src/config/core.h)
// when cast vs players and monsters.
//MG_COLDBOLT: (50,"PLAYER | MONSTER")
}
}
Notes on the format
In disabled_skills the var following the name (: "PLAYER | MONSTER | HOMUN | MERCENARY | ELEMENTAL | PET | CLONE | MOB_BOSS") is what allows a zone to know what unit types should have this skill disabled. In the sample above, for example, in My Zone, player, monster and elemental unit types are unable to cast heal, while only monsters are unable to cast teleport. this variable may also be used to ignore skills from inheritance, for example if My Other Zone disabled a number of skills, including MG_FIREBOLT, in My Zone all of them will be disabled as well, except for MG_FIREBOLT since it is set as NONE.
In disabled_items the var following the name (: true or : false) is what allows a zone to override what it inherited, for example if My Other Zone disables a number of items, including Assumptio_5_Scroll, in My Zone all of them will be disabled as well, except Assumptio_5_Scroll since it is as false.
A zone may enforce an unlimited number of mapflags on all its maps, by using this sample all maps under My Zone will have Fire Bolt damage increased by 2.5x and Sanctuary will have its duration halved.
A unlimited number of maps may be linked to a specific zone through a mapflag
'<map name><tab>mapflag<tab>zone<tab><zone name>'
Changes
The mf_restrict (restrict) was dropped.
item_noequip.txt and skill_nocast_db.txt were dropped, replaced by map_zone_db.txt.
setmapflag script command was modified to support the new zones.
@mapinfo was modified to support the new zones, also modified the formatting and made it include the amount of vendings.
Improvements
As opposed to item_noequip.txt and skill_nocast_db.txt, map_zone_db.txt supports an unlimited number of zones.
map_zone_db.txt implementation surpasses the ones from item_noequip.txt and skill_nocast_db.txt, making item equipping (pc_useitem/status_calc_pc) and skill using (previously skillnotok, now status_check_skilluse) processing much faster and efficient.
@mapinfo performance was improved (was doing chat room dbmap lookups without even checking if player was on the map in question)
Special Thanks
to Muad_Dib <3.
to lighta for discussing the feature with me and helping design the unit-based restrictions on skills
to Bahmut and Emistry for ideas on how to format the file.
to kyeme for feature ideas.
Links~!
Commit
Commit 2 (update)
Map Zone Database File