From 9e28e286682dc0c958de4db57483483a460e93de Mon Sep 17 00:00:00 2001 From: remoitnane Date: Mon, 5 Jul 2010 01:25:40 -0700 Subject: Add new map flag and condition for mob skills Signed-off-by: Jared Adams --- src/map/map.h | 1 + src/map/mob.c | 5 +++++ src/map/mob.h | 1 + src/map/npc.c | 6 +++++- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/map/map.h b/src/map/map.h index d7c0d44..9934fdf 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -594,6 +594,7 @@ struct map_data unsigned leaves:1; // [Valaris] unsigned rain:1; // [Valaris] unsigned no_player_drops:1; // [Jaxad0127] + unsigned town:1; // [remoitnane] } flag; struct point save; struct npc_data *npc[MAX_NPC_PER_MAP]; diff --git a/src/map/mob.c b/src/map/mob.c index f36d60e..d8e6ef8 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -4256,6 +4256,9 @@ int mobskill_use (struct mob_data *md, unsigned int tick, int event) mob_getfriendstatus (md, ms[i].cond1, ms[i].cond2)) != NULL); break; + case MSC_NOTINTOWN: // Only outside of towns. + flag = !map[md->bl.m].flag.town; + break; case MSC_SLAVELT: // slave < num flag = (mob_countslave (md) < c2); break; @@ -4836,6 +4839,8 @@ static int mob_readskilldb (void) { "friendstatusoff", MSC_FRIENDSTATUSOFF}, { + "notintown", MSC_NOTINTOWN}, + { "attackpcgt", MSC_ATTACKPCGT}, { "attackpcge", MSC_ATTACKPCGE}, diff --git a/src/map/mob.h b/src/map/mob.h index 14c359c..7351f2e 100644 --- a/src/map/mob.h +++ b/src/map/mob.h @@ -70,6 +70,7 @@ enum MSC_MYSTATUSOFF = 0x0021, MSC_FRIENDSTATUSON = 0x0030, MSC_FRIENDSTATUSOFF = 0x0031, + MSC_NOTINTOWN = 0x0032, MSC_ATTACKPCGT = 0x0100, MSC_ATTACKPCGE = 0x0101, diff --git a/src/map/npc.c b/src/map/npc.c index fc994f5..d302fe8 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -2133,9 +2133,13 @@ static int npc_parse_mapflag (char *w1, char *w2, char *w3, char *w4) map[m].flag.rain = 1; } else if (strcmpi (w3, "no_player_drops") == 0) - { // rain [Valaris] + { // no player drops [Jaxad0127] map[m].flag.no_player_drops = 1; } + else if (strcmpi (w3, "town") == 0) + { // town/safe zone [remoitnane] + map[m].flag.town = 1; + } return 0; } -- cgit v1.2.3-60-g2f50