summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt4
-rw-r--r--conf-tmpl/battle/skill.conf6
-rw-r--r--src/map/battle.c2
-rw-r--r--src/map/battle.h1
-rw-r--r--src/map/clif.c5
-rw-r--r--src/map/pc.c2
-rw-r--r--src/map/skill.c28
-rw-r--r--src/map/skill.h2
8 files changed, 39 insertions, 11 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index d291f08d4..a5615d153 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -3,6 +3,10 @@ Date Added
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/04/25
+ * Added battle config traps_setting to determine how traps should behave.
+ With &1 traps are invisible if you didn't see them get set up. With &2
+ traps will be removed after changing maps. The default is 2.
+ (battle/skill.conf) [Skotlex]
* Cleaned up a bit the implementation of SC_MAXIMIZEPOWER, SC_CHASEWALK and
SC_CLOAKING to prevent infinite looping timers. [Skotlex]
* Fixed NPC_SUICIDE dropping items. [Skotlex]
diff --git a/conf-tmpl/battle/skill.conf b/conf-tmpl/battle/skill.conf
index 5fbab1d40..14d4d6f4f 100644
--- a/conf-tmpl/battle/skill.conf
+++ b/conf-tmpl/battle/skill.conf
@@ -113,6 +113,12 @@ skill_nofootset: 1
// Default on official servers: yes for player-traps
gvg_traps_target_all: 1
+// Some traps settings (add as necessary):
+// 1: Traps are invisible to those who come into view of it. When unset, all traps are visible at all times.
+// (Invisible traps can be revealed through Hunter's Detecting skill)
+// 2: Traps are removed on map-change. When unset, traps last until they time-out.
+traps_setting: 2
+
// Whether placed down skills will check walls (Note 1)
// (Makes it so that Storm Gust/Lord of Vermillion/etc when casted next to a wall, won't hit on the other side)
skill_wall_check: yes
diff --git a/src/map/battle.c b/src/map/battle.c
index 9976d3d9b..77c1981a2 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3599,6 +3599,7 @@ static const struct battle_data_short {
{ "player_damage_delay_rate", &battle_config.pc_damage_delay_rate },
{ "defunit_not_enemy", &battle_config.defnotenemy },
{ "gvg_traps_target_all", &battle_config.vs_traps_bctall },
+ { "traps_setting", &battle_config.traps_setting },
{ "clear_skills_on_death", &battle_config.clear_unit_ondeath },
{ "random_monster_checklv", &battle_config.random_monster_checklv },
{ "attribute_recover", &battle_config.attr_recover },
@@ -3974,6 +3975,7 @@ void battle_set_defaults() {
battle_config.pc_damage_delay_rate=100;
battle_config.defnotenemy=0;
battle_config.vs_traps_bctall=BL_PC;
+ battle_config.traps_setting=0;
battle_config.clear_unit_ondeath=BL_ALL;
battle_config.random_monster_checklv=1;
battle_config.attr_recover=1;
diff --git a/src/map/battle.h b/src/map/battle.h
index 4918fc0a1..9bd6fc2d0 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -109,6 +109,7 @@ extern struct Battle_Config {
unsigned short pc_damage_delay_rate;
unsigned short defnotenemy;
unsigned short vs_traps_bctall;
+ unsigned short traps_setting;
unsigned short clear_unit_ondeath; //[Skotlex]
unsigned short random_monster_checklv;
unsigned short attr_recover;
diff --git a/src/map/clif.c b/src/map/clif.c
index bdc81724d..8429b3d23 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -3887,7 +3887,10 @@ int clif_getareachar_skillunit(struct map_session_data *sd,struct skill_unit *un
WFIFOW(fd,10)=unit->bl.x;
WFIFOW(fd,12)=unit->bl.y;
//Use invisible unit id for traps.
- WFIFOB(fd,14)=(skill_get_inf2(unit->group->skill_id)&INF2_TRAP?UNT_ATTACK_SKILLS:unit->group->unit_id);
+ if (battle_config.traps_setting&1 && skill_get_inf2(unit->group->skill_id)&INF2_TRAP)
+ WFIFOB(fd,14)=UNT_ATTACK_SKILLS;
+ else
+ WFIFOB(fd,14)=unit->group->unit_id;
WFIFOB(fd,15)=0;
WFIFOSET(fd,packet_len_table[0x11f]);
diff --git a/src/map/pc.c b/src/map/pc.c
index d3b023e0b..9ba9f9bf0 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -3055,7 +3055,7 @@ int pc_setpos(struct map_session_data *sd,unsigned short mapindex,int x,int y,in
{ //Misc map-changing settings
party_send_dot_remove(sd); //minimap dot fix [Kevin]
guild_send_dot_remove(sd);
- skill_clear_element_field(&sd->bl);
+ skill_clear_group(&sd->bl, 1|(battle_config.traps_setting&2));
if (sd->sc.count)
{ //Cancel some map related stuff.
if (sd->sc.data[SC_WARM].timer != -1)
diff --git a/src/map/skill.c b/src/map/skill.c
index e1f5b52ac..e17af7e23 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -6402,7 +6402,7 @@ struct skill_unit_group *skill_unitsetting( struct block_list *src, int skillid,
if (limit < 0) //This can happen...
limit = skill_get_time(skillid,skilllv);
}
- skill_clear_element_field(src);
+ skill_clear_group(src,1);
}
break;
}
@@ -8915,27 +8915,39 @@ int skill_attack_area(struct block_list *bl,va_list ap)
*
*------------------------------------------
*/
-int skill_clear_element_field(struct block_list *bl)
+int skill_clear_group(struct block_list *bl, int flag)
{
struct unit_data *ud = unit_bl2ud(bl);
- int i;
+ struct skill_unit_group *group[MAX_SKILLUNITGROUP];
+ int i, count=0;
nullpo_retr(0, bl);
if (!ud) return 0;
-
- for (i=0;i<MAX_SKILLUNITGROUP && ud->skillunit[i];i++) {
+
+ //All groups to be deleted are first stored on an array since the array elements shift around when you delete them. [Skotlex]
+ for (i=0;i<MAX_SKILLUNITGROUP && ud->skillunit[i];i++)
+ {
switch (ud->skillunit[i]->skill_id) {
case SA_DELUGE:
case SA_VOLCANO:
case SA_VIOLENTGALE:
case SA_LANDPROTECTOR:
case NJ_SUITON:
- skill_delunitgroup(bl, ud->skillunit[i]);
+ if (flag&1)
+ group[count++]= ud->skillunit[i];
+ break;
+ default:
+ if (flag&2 && skill_get_inf2(ud->skillunit[i]->skill_id)&INF2_TRAP)
+ group[count++]= ud->skillunit[i];
+ break;
}
+
}
- return 1;
+ for (i=0;i<count;i++);
+ skill_delunitgroup(bl, group[i]);
+ return count;
}
-
+
/*==========================================
* Returns the first element field found [Skotlex]
*------------------------------------------
diff --git a/src/map/skill.h b/src/map/skill.h
index 054cd1c71..5e1dbb22f 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -189,7 +189,7 @@ struct skill_unit_group *skill_initunitgroup(struct block_list *src,
int count,int skillid,int skilllv,int unit_id, int limit, int interval);
int skill_delunitgroup(struct block_list *src, struct skill_unit_group *group);
int skill_clear_unitgroup(struct block_list *src);
-int skill_clear_element_field(struct block_list *bl);
+int skill_clear_group(struct block_list *bl, int flag);
int skill_unit_ondamaged(struct skill_unit *src,struct block_list *bl,
int damage,unsigned int tick);