summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTAW Dev <tawdev@taw>2009-07-17 04:57:26 -0400
committerTAW Dev <tawdev@taw>2009-07-17 04:57:26 -0400
commit6bf003a2fe176a36f5a752a9cc53379875282b85 (patch)
treee13f8a418503ebe484db87f32f61b2f79f534c37
parentaa0bb68d762f72d8abb2b71079e98a8e27969412 (diff)
parent84783931d0944049590dd8359770657ad971be25 (diff)
downloadtmwa-6bf003a2fe176a36f5a752a9cc53379875282b85.tar.gz
tmwa-6bf003a2fe176a36f5a752a9cc53379875282b85.tar.bz2
tmwa-6bf003a2fe176a36f5a752a9cc53379875282b85.tar.xz
tmwa-6bf003a2fe176a36f5a752a9cc53379875282b85.zip
Merge branch 'master' of git://gitorious.org/tmw-eathena/mainline
-rw-r--r--src/map/magic-expr.c8
-rw-r--r--src/map/script.c26
2 files changed, 33 insertions, 1 deletions
diff --git a/src/map/magic-expr.c b/src/map/magic-expr.c
index 1f7f408..2f52be5 100644
--- a/src/map/magic-expr.c
+++ b/src/map/magic-expr.c
@@ -954,6 +954,13 @@ fun_running_status_update(env_t *env, int args_nr, val_t *result, val_t *args)
}
static int
+fun_is_gm_invisible(env_t *env, int args_nr, val_t *result, val_t *args)
+{
+ RESULTINT = ((((struct map_session_data *)ARGENTITY(0))->status.option & 4096) != 0);
+ return 0;
+}
+
+static int
fun_element(env_t *env, int args_nr, val_t *result, val_t *args)
{
RESULTINT = battle_get_element(ARGENTITY(0)) % 10;
@@ -1179,6 +1186,7 @@ static fun_t functions[] = {
{ "count_item", "e.", 'i', fun_count_item },
{ "line_of_sight", "ll", 'i', fun_line_of_sight },
{ "running_status_update", "ei", 'i', fun_running_status_update },
+ { "is_gm_invisible", "e", 'i', fun_is_gm_invisible },
{ "element", "e", 'i', fun_element },
{ "element_level", "e", 'i', fun_element_level },
{ "has_shroud", "e", 'i', fun_has_shroud },
diff --git a/src/map/script.c b/src/map/script.c
index 218c3f3..40fcd62 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -285,6 +285,7 @@ int buildin_isin(struct script_state *st); // [Jaxad0127]
int buildin_shop(struct script_state *st); // [MadCamel]
int buildin_isdead(struct script_state *st); // [Jaxad0127]
int buildin_fakenpcname(struct script_state *st); //[Kage]
+int buildin_unequip_by_id(struct script_state *st); // [Freeyorp]
void push_val(struct script_stack *stack,int type,int val);
int run_func(struct script_state *st);
@@ -490,7 +491,9 @@ struct {
{buildin_isin,"isin","siiii"},
{buildin_shop,"shop","s"},
{buildin_isdead,"isdead","i"},
- {buildin_fakenpcname,"fakenpcname","ssi"}, //End Additions
+ {buildin_fakenpcname,"fakenpcname","ssi"},
+ {buildin_unequip_by_id,"unequipbyid","i"}, // [Freeyorp]
+ // End Additions
{NULL,NULL,NULL},
};
int buildin_message(struct script_state *st); // [MouseJstr]
@@ -5666,6 +5669,27 @@ int buildin_nude(struct script_state *st)
}
/*==========================================
+ * UnequipById [Freeyorp]
+ *------------------------------------------
+ */
+
+int buildin_unequip_by_id(struct script_state *st)
+{
+ struct map_session_data *sd=script_rid2sd(st);
+ if(sd==NULL)
+ return 0;
+
+ int slot_id = conv_num(st,& (st->stack->stack_data[st->start+2]));
+
+ if(slot_id>=0 && slot_id<11 && sd->equip_index[slot_id] >= 0)
+ pc_unequipitem(sd,sd->equip_index[slot_id], slot_id);
+
+ pc_calcstatus(sd, 0);
+
+ return 0;
+}
+
+/*==========================================
* gmcommand [MouseJstr]
*
* suggested on the forums...