summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-08-17 20:31:03 -0300
committerJesusaves <cpntb1@ymail.com>2019-08-17 20:31:03 -0300
commite81f9d181143d788038334f33d53e997f2abbafd (patch)
treeb959254255291f950e46cea2e3a2815e9f98f0ed
parent7b99973735a7f216b1862da0dcc2cef430bfb6cd (diff)
downloadevol-hercules-e81f9d181143d788038334f33d53e997f2abbafd.tar.gz
evol-hercules-e81f9d181143d788038334f33d53e997f2abbafd.tar.bz2
evol-hercules-e81f9d181143d788038334f33d53e997f2abbafd.tar.xz
evol-hercules-e81f9d181143d788038334f33d53e997f2abbafd.zip
Get Homunculus EXP command (Homunculus need to be alive)
-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