summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/emap/init.c1
-rw-r--r--src/emap/script_buildins.c29
-rw-r--r--src/emap/script_buildins.h1
3 files changed, 31 insertions, 0 deletions
diff --git a/src/emap/init.c b/src/emap/init.c
index a52e97d..76910fb 100644
--- a/src/emap/init.c
+++ b/src/emap/init.c
@@ -219,6 +219,7 @@ HPExport void plugin_init (void)
addScriptCommand("getguildnxp","i",getguildnxp);
addScriptCommand("setguildrole","iiiis",setguildrole);
addScriptCommand("getguildmember","i?",getguildmember);
+ addScriptCommand("gethomunexp","i",gethomunexp);
do_init_langs();
diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c
index ff33a5f..01982a8 100644
--- a/src/emap/script_buildins.c
+++ b/src/emap/script_buildins.c
@@ -15,6 +15,7 @@
#include "map/chat.h"
#include "map/chrif.h"
#include "map/guild.h"
+#include "map/homunculus.h"
#include "map/instance.h"
#include "map/mapreg.h"
#include "map/npc.h"
@@ -2541,3 +2542,31 @@ BUILDIN(getguildmember)
return true;
}
+/*==========================================
+ * Give homunculus exp
+ *------------------------------------------*/
+BUILDIN(gethomunexp)
+{
+ int base=0;
+ struct map_session_data *sd = script->rid2sd(st);
+ if (sd == NULL || sd->hd == NULL)
+ return true;
+
+ base = script_getnum(st,2);
+ if (base < 0)
+ return true;
+
+ // Cannot give EXP to inactive homunculus
+ /*
+ if (sd->hd->homunculus.vaporize == HOM_ST_ACTIVE)
+ return true;
+ */
+
+ //pc->gainexp(sd, &sd->bl, base, job, true);
+ homun->gainexp(sd->hd, base);
+ // send_homun_exp(sd->hd, base);
+
+ return true;
+}
+
+
diff --git a/src/emap/script_buildins.h b/src/emap/script_buildins.h
index b93b302..19c3b30 100644
--- a/src/emap/script_buildins.h
+++ b/src/emap/script_buildins.h
@@ -108,5 +108,6 @@ BUILDIN(getguildexp);
BUILDIN(getguildnxp);
BUILDIN(setguildrole);
BUILDIN(getguildmember);
+BUILDIN(gethomunexp);
#endif // EVOL_MAP_SCRIPT_BUILDINS