summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-20 20:56:55 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-20 20:56:55 +0000
commitb720934d03f18b4858029a38faf142cf656774cc (patch)
tree0ef63a2572ba329984a0d040e1d699ad0f04361e /src/map/mob.c
parent270ea9d6ada343b9d05e4c5d6d2616759efb02f9 (diff)
downloadhercules-b720934d03f18b4858029a38faf142cf656774cc.tar.gz
hercules-b720934d03f18b4858029a38faf142cf656774cc.tar.bz2
hercules-b720934d03f18b4858029a38faf142cf656774cc.tar.xz
hercules-b720934d03f18b4858029a38faf142cf656774cc.zip
- Added SC_ARMOR_RESIST, used by Undead Scroll, gives you resistance against elements and it's can be used with Resist Potions.
- SC_ARMOR_RESIST and SC_BENEDICTIO ends if you change your armor. Tested on iRO. - If you call SC_ELEMENTALCHANGE with val3 = 1 it will use the level in val 1, and not a random value. * Barricades: - Fixed a bug when @reloadscript. Barricades should be destroyed too. - Unbreakable barricades are only wall type (not shootable) According to Doddler info. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12407 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 36efd6614..87b4377ef 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -525,6 +525,7 @@ short mob_barricade_build(short m, short x, short y, short count, short dir, boo
barricade->m = m;
safestrncpy(barricade->npc_event, event, sizeof(barricade->npc_event));
barricade->amount = 0;
+ barricade->killable = killable;
ShowInfo("New Barricade: %s.\n", barricade->npc_event);
@@ -544,8 +545,8 @@ short mob_barricade_build(short m, short x, short y, short count, short dir, boo
md->barricade = barricade;
}
- map_setgatcell(m, x1, y1, 5);
- clif_changemapcell(0, m, x1, y1, 5, ALL_SAMEMAP);
+ map_setgatcell(m, x1, y1, (killable ? 5 : 1));
+ clif_changemapcell(0, m, x1, y1, (killable ? 5 : 1), ALL_SAMEMAP);
}
barricade->count = i;
@@ -557,7 +558,7 @@ short mob_barricade_build(short m, short x, short y, short count, short dir, boo
}
void mob_barricade_get(struct map_session_data *sd)
-{
+{ // Update Barricade cell in client - Required only on changemap
struct barricade_data *barricade;
DBIterator* iter;
DBKey key;
@@ -577,7 +578,7 @@ void mob_barricade_get(struct map_session_data *sd)
{
x1 = barricade->dir ? barricade->x + i : barricade->x;
y1 = barricade->dir ? barricade->y : barricade->y + i;
- clif_changemapcell(sd->fd, barricade->m, x1, y1, 5, SELF);
+ clif_changemapcell(sd->fd, barricade->m, x1, y1, (barricade->killable ? 5 : 1), SELF);
}
}
iter->destroy(iter);
@@ -631,6 +632,31 @@ void mob_barricade_destroy(short m, const char *event)
map_foreachinmap(mob_barricade_destroy_sub, m, BL_MOB, event, 0);
}
+void mod_barricade_clearall(void)
+{
+ struct barricade_data *barricade;
+ DBIterator* iter;
+ DBKey key;
+ short x1, y1;
+ int i;
+
+ iter = barricade_db->iterator(barricade_db);
+ for( barricade = iter->first(iter,&key); iter->exists(iter); barricade = iter->next(iter,&key) )
+ {
+ for( i = 0; i < barricade->count; i++ )
+ {
+ x1 = barricade->dir ? barricade->x + i : barricade->x;
+ y1 = barricade->dir ? barricade->y : barricade->y + i;
+
+ map_setgatcell(barricade->m, x1, y1, 0);
+ clif_changemapcell(0, barricade->m, x1, y1, 0, ALL_SAMEMAP);
+ }
+ }
+ iter->destroy(iter);
+
+ barricade_db->clear(barricade_db, NULL);
+}
+
/*==========================================
* Set a Guardian's guild data [Skotlex]
*------------------------------------------*/