diff options
author | shennetsind <ind@henn.et> | 2013-04-02 20:38:36 -0300 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-04-02 20:38:36 -0300 |
commit | 98b26ebbe6b4df336cfccc38821b7a52d5980d01 (patch) | |
tree | 7a2bd4150ad36a5e2475a8e63a254b27a6ec72bc | |
parent | 18e72749f736e05a7a40b25383faa5c9d12f815e (diff) | |
download | hercules-98b26ebbe6b4df336cfccc38821b7a52d5980d01.tar.gz hercules-98b26ebbe6b4df336cfccc38821b7a52d5980d01.tar.bz2 hercules-98b26ebbe6b4df336cfccc38821b7a52d5980d01.tar.xz hercules-98b26ebbe6b4df336cfccc38821b7a52d5980d01.zip |
Introducing New/Official mapflag: invincible_time_inc
Used officially in gvg maps (Implemented under GvG zone)
Special Thanks to Muad_Dib!
Signed-off-by: shennetsind <ind@henn.et>
-rw-r--r-- | db/pre-re/map_zone_db.conf | 4 | ||||
-rw-r--r-- | db/re/map_zone_db.conf | 4 | ||||
-rw-r--r-- | src/map/clif.c | 5 | ||||
-rw-r--r-- | src/map/map.c | 2 | ||||
-rw-r--r-- | src/map/map.h | 3 | ||||
-rw-r--r-- | src/map/npc.c | 7 | ||||
-rw-r--r-- | src/map/pc.c | 5 |
7 files changed, 19 insertions, 11 deletions
diff --git a/db/pre-re/map_zone_db.conf b/db/pre-re/map_zone_db.conf index 738e4d3da..36659ac87 100644 --- a/db/pre-re/map_zone_db.conf +++ b/db/pre-re/map_zone_db.conf @@ -17,6 +17,8 @@ //= '<map name><tab>mapflag<tab>zone<tab><zone name>' //== available types for 'disabled_skills': //= PLAYER, HOMUN, MERCENARY, MONSTER, ALL and NONE +//== More on +//= http://hercules.ws/board/topic/302-introducing-hercules-map-zone-database/ zones: ( { /* Normal zone is applied to all maps that are not pkable (where players cant fight each other) */ @@ -78,6 +80,8 @@ zones: ( Greed_Scroll: true Pty_Assumptio_Scroll: true } + /* 5 second duration increase on GvG */ + mapflags: ( "invincible_time_inc 5000" ) }, { /* Battlegrounds zone is applied to all maps with a battlegrounds mapflag */ diff --git a/db/re/map_zone_db.conf b/db/re/map_zone_db.conf index 738e4d3da..36659ac87 100644 --- a/db/re/map_zone_db.conf +++ b/db/re/map_zone_db.conf @@ -17,6 +17,8 @@ //= '<map name><tab>mapflag<tab>zone<tab><zone name>' //== available types for 'disabled_skills': //= PLAYER, HOMUN, MERCENARY, MONSTER, ALL and NONE +//== More on +//= http://hercules.ws/board/topic/302-introducing-hercules-map-zone-database/ zones: ( { /* Normal zone is applied to all maps that are not pkable (where players cant fight each other) */ @@ -78,6 +80,8 @@ zones: ( Greed_Scroll: true Pty_Assumptio_Scroll: true } + /* 5 second duration increase on GvG */ + mapflags: ( "invincible_time_inc 5000" ) }, { /* Battlegrounds zone is applied to all maps with a battlegrounds mapflag */ diff --git a/src/map/clif.c b/src/map/clif.c index 1192fcf8f..588f6a853 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9197,10 +9197,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) guild_send_memberinfoshort(sd,1); if(battle_config.pc_invincible_time > 0) { - if(map_flag_gvg(sd->bl.m)) - pc_setinvincibletimer(sd,battle_config.pc_invincible_time<<1); - else - pc_setinvincibletimer(sd,battle_config.pc_invincible_time); + pc_setinvincibletimer(sd,battle_config.pc_invincible_time); } if( map[sd->bl.m].users++ == 0 && battle_config.dynamic_mobs ) diff --git a/src/map/map.c b/src/map/map.c index acfdd643b..d6804a150 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -3019,6 +3019,8 @@ void map_flags_init(void) { map[i].flag.pvp = 1; // make all maps pvp for pk_mode [Valaris] /* align with 'All' zone */ map[i].zone = &map_zone_all; + + map[i].invincible_time_inc = 0; } } diff --git a/src/map/map.h b/src/map/map.h index 7af3a184c..148c4ac0f 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -624,6 +624,9 @@ struct map_data { /* Hercules Local Chat */ struct hChSysCh *channel; + + /* invincible_time_inc mapflag */ + unsigned int invincible_time_inc; }; /// Stores information about a remote map (for multi-mapserver setups). diff --git a/src/map/npc.c b/src/map/npc.c index fe2e769db..b9bc28eaa 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -3361,11 +3361,6 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char map[m].flag.sakura=state; else if (!strcmpi(w3,"leaves")) map[m].flag.leaves=state; - /** - * No longer available, keeping here just in case it's back someday. [Ind] - **/ - //else if (!strcmpi(w3,"rain")) - // map[m].flag.rain=state; else if (!strcmpi(w3,"nightenabled")) map[m].flag.nightenabled=state; else if (!strcmpi(w3,"nogo")) @@ -3463,6 +3458,8 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char } } else if ( !strcmpi(w3,"nomapchannelautojoin") ) { map[m].flag.chsysnolocalaj = state; + } else if ( !strcmpi(w3,"invincible_time_inc") ) { + map[m].invincible_time_inc = (state) ? atoi(w4) : 0; } else ShowError("npc_parse_mapflag: unrecognized mapflag '%s' (file '%s', line '%d').\n", w3, filepath, strline(buffer,start-buffer)); diff --git a/src/map/pc.c b/src/map/pc.c index 6fb45bcfe..104e5829f 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -124,10 +124,11 @@ static int pc_invincible_timer(int tid, unsigned int tick, int id, intptr_t data return 0; } -void pc_setinvincibletimer(struct map_session_data* sd, int val) -{ +void pc_setinvincibletimer(struct map_session_data* sd, int val) { nullpo_retv(sd); + val += map[sd->bl.m].invincible_time_inc; + if( sd->invincible_timer != INVALID_TIMER ) delete_timer(sd->invincible_timer,pc_invincible_timer); sd->invincible_timer = add_timer(gettick()+val,pc_invincible_timer,sd->bl.id,0); |