summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2008-10-30 02:12:16 +0000
committerJared Adams <jaxad0127@gmail.com>2008-10-30 02:12:16 +0000
commitadf0d0506d653340849f0caf6cb4ec85dea2fd56 (patch)
tree782a40f1c027033d11ce62d7254041b4b2c52d22
parent10092dd0bba68c903784bea3e527bdc07f5e5318 (diff)
downloadtmwa-adf0d0506d653340849f0caf6cb4ec85dea2fd56.tar.gz
tmwa-adf0d0506d653340849f0caf6cb4ec85dea2fd56.tar.bz2
tmwa-adf0d0506d653340849f0caf6cb4ec85dea2fd56.tar.xz
tmwa-adf0d0506d653340849f0caf6cb4ec85dea2fd56.zip
Commit Mantis 519: `pow' function for eAthena scripting
-rw-r--r--src/map/script.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 9e476c0..c28467d 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -104,6 +104,7 @@ int buildin_close(struct script_state *st);
int buildin_close2(struct script_state *st);
int buildin_menu(struct script_state *st);
int buildin_rand(struct script_state *st);
+int buildin_pow(struct script_state *st);
int buildin_warp(struct script_state *st);
int buildin_areawarp(struct script_state *st);
int buildin_heal(struct script_state *st);
@@ -333,6 +334,7 @@ struct {
{buildin_itemheal,"itemheal","ii"},
{buildin_percentheal,"percentheal","ii"},
{buildin_rand,"rand","i*"},
+ {buildin_pow,"pow","ii"},
{buildin_countitem,"countitem","i"},
{buildin_checkweight,"checkweight","ii"},
{buildin_readparam,"readparam","i*"},
@@ -1707,6 +1709,22 @@ int buildin_rand(struct script_state *st)
*
*------------------------------------------
*/
+int buildin_pow(struct script_state *st)
+{
+ int a, b;
+
+ a = conv_num(st,& (st->stack->stack_data[st->start+2]));
+ b = conv_num(st,& (st->stack->stack_data[st->start+3]));
+
+ push_val(st->stack, C_INT, (int) pow(a * 0.001, b));
+
+ return 0;
+}
+
+/*==========================================
+ *
+ *------------------------------------------
+ */
int buildin_warp(struct script_state *st)
{
int x,y;