summaryrefslogtreecommitdiff
path: root/src/map/npc.cpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-02-13 23:30:32 -0800
committerBen Longbons <b.r.longbons@gmail.com>2014-02-13 23:30:32 -0800
commit8508f94daeeb49b6ccf3ee1a346f1dc9f9c56802 (patch)
treeb1c838e845949ebf9093f381f4c8d2e67d8b3be5 /src/map/npc.cpp
parent730e5dde39333cb2f63c72a7d7152bee5c4dbb05 (diff)
downloadtmwa-8508f94daeeb49b6ccf3ee1a346f1dc9f9c56802.tar.gz
tmwa-8508f94daeeb49b6ccf3ee1a346f1dc9f9c56802.tar.bz2
tmwa-8508f94daeeb49b6ccf3ee1a346f1dc9f9c56802.tar.xz
tmwa-8508f94daeeb49b6ccf3ee1a346f1dc9f9c56802.zip
Name and number mapflags better
Diffstat (limited to 'src/map/npc.cpp')
-rw-r--r--src/map/npc.cpp104
1 files changed, 13 insertions, 91 deletions
diff --git a/src/map/npc.cpp b/src/map/npc.cpp
index 788d785..a939c74 100644
--- a/src/map/npc.cpp
+++ b/src/map/npc.cpp
@@ -1526,7 +1526,18 @@ int npc_parse_mapflag(XString w1, XString, XString w3, ZString w4)
if (m == nullptr)
return 1;
- if (w3 == "nosave")
+ MapFlag mf;
+ if (!extract(w3, &mf))
+ return 1;
+
+ if (battle_config.pk_mode && mf == MapFlag::NOPVP)
+ {
+ m->flag.nopvp = 1;
+ m->flag.pvp = 0;
+ return 0;
+ }
+
+ if (mf == MapFlag::NOSAVE)
{
if (w4 == "SavePoint")
{
@@ -1540,97 +1551,8 @@ int npc_parse_mapflag(XString w1, XString, XString w3, ZString w4)
m->save.x = savex;
m->save.y = savey;
}
- m->flag.nosave = 1;
- }
- else if (w3 == "nomemo")
- {
- m->flag.nomemo = 1;
- }
- else if (w3 == "noteleport")
- {
- m->flag.noteleport = 1;
- }
- else if (w3 == "nowarp")
- {
- m->flag.nowarp = 1;
- }
- else if (w3 == "nowarpto")
- {
- m->flag.nowarpto = 1;
- }
- else if (w3 == "noreturn")
- {
- m->flag.noreturn = 1;
- }
- else if (w3 == "monster_noteleport")
- {
- m->flag.monster_noteleport = 1;
- }
- else if (w3 == "nobranch")
- {
- m->flag.nobranch = 1;
- }
- else if (w3 == "nopenalty")
- {
- m->flag.nopenalty = 1;
- }
- else if (w3 == "pvp")
- {
- m->flag.pvp = 1;
- }
- else if (w3 == "pvp_noparty")
- {
- m->flag.pvp_noparty = 1;
- }
- else if (w3 == "pvp_nocalcrank")
- {
- m->flag.pvp_nocalcrank = 1;
- }
- else if (w3 == "nozenypenalty")
- {
- m->flag.nozenypenalty = 1;
- }
- else if (w3 == "notrade")
- {
- m->flag.notrade = 1;
- }
- else if (battle_config.pk_mode && w3 == "nopvp")
- { // nopvp for pk mode [Valaris]
- m->flag.nopvp = 1;
- m->flag.pvp = 0;
- }
- else if (w3 == "noicewall")
- { // noicewall [Valaris]
- m->flag.noicewall = 1;
- }
- else if (w3 == "snow")
- { // snow [Valaris]
- m->flag.snow = 1;
- }
- else if (w3 == "fog")
- { // fog [Valaris]
- m->flag.fog = 1;
- }
- else if (w3 == "sakura")
- { // sakura [Valaris]
- m->flag.sakura = 1;
- }
- else if (w3 == "leaves")
- { // leaves [Valaris]
- m->flag.leaves = 1;
- }
- else if (w3 == "rain")
- { // rain [Valaris]
- m->flag.rain = 1;
- }
- else if (w3 == "no_player_drops")
- { // no player drops [Jaxad0127]
- m->flag.no_player_drops = 1;
- }
- else if (w3 == "town")
- { // town/safe zone [remoitnane]
- m->flag.town = 1;
}
+ m->flag.set(mf, true);
return 0;
}