summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-07-09 21:03:52 +0300
committerAndrei Karas <akaras@inbox.ru>2016-07-09 21:03:52 +0300
commitcdab2778ae73dcad36fbeac8d827732440a321e3 (patch)
treeaa2d0b4c53a66f61956e973cad49edc25f2acadb
parent3a59570a1c21f4b5903842b0ba8639e79aae7174 (diff)
downloadplugin-cdab2778ae73dcad36fbeac8d827732440a321e3.tar.gz
plugin-cdab2778ae73dcad36fbeac8d827732440a321e3.tar.bz2
plugin-cdab2778ae73dcad36fbeac8d827732440a321e3.tar.xz
plugin-cdab2778ae73dcad36fbeac8d827732440a321e3.zip
Add array and functions for skill extended data.
-rw-r--r--src/Makefile.am4
-rw-r--r--src/emap/const/skilldmaxeffects.h9
-rw-r--r--src/emap/data/skilld.c38
-rw-r--r--src/emap/data/skilld.h13
-rw-r--r--src/emap/init.c4
-rw-r--r--src/emap/struct/skilldext.h14
6 files changed, 82 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 072c20c..8dea93b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -89,6 +89,7 @@ MAP_SRC = emap/atcommand.c \
emap/unit.c \
emap/unit.h \
emap/const/craft.h \
+ emap/const/skilldmaxeffects.h \
emap/data/bgd.c \
emap/data/bgd.h \
emap/data/itemd.c \
@@ -101,6 +102,8 @@ MAP_SRC = emap/atcommand.c \
emap/data/npcd.h \
emap/data/session.c \
emap/data/session.h \
+ emap/data/skilld.c \
+ emap/data/skilld.h \
emap/struct/bgdext.h \
emap/struct/craft.h \
emap/struct/itemdext.h \
@@ -108,6 +111,7 @@ MAP_SRC = emap/atcommand.c \
emap/struct/mobdext.h \
emap/struct/npcdext.h \
emap/struct/sessionext.h \
+ emap/struct/skilldext.h \
emap/utils/formatutils.c \
emap/utils/formatutils.h \
ecommon/config.c \
diff --git a/src/emap/const/skilldmaxeffects.h b/src/emap/const/skilldmaxeffects.h
new file mode 100644
index 0000000..94c0814
--- /dev/null
+++ b/src/emap/const/skilldmaxeffects.h
@@ -0,0 +1,9 @@
+// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// Copyright (c) 2014 - 2015 Evol developers
+
+#ifndef EVOL_MAP_CONST_CRAFT_SKILLDMAXMISCEFFECTS
+#define EVOL_MAP_CONST_CRAFT_SKILLDMAXMISCEFFECTS
+
+#define SKILLD_MAXMISCEFFECTS 2
+
+#endif // EVOL_MAP_CONST_CRAFT_SKILLDMAXMISCEFFECTS
diff --git a/src/emap/data/skilld.c b/src/emap/data/skilld.c
new file mode 100644
index 0000000..ce39993
--- /dev/null
+++ b/src/emap/data/skilld.c
@@ -0,0 +1,38 @@
+// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// Copyright (c) 2014 - 2015 Evol developers
+
+#include "common/hercules.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "common/HPMi.h"
+#include "common/memmgr.h"
+#include "common/mmo.h"
+#include "common/nullpo.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "map/skill.h"
+
+#include "emap/data/skilld.h"
+#include "emap/struct/skilldext.h"
+
+struct SkilldExt skilld_arr[MAX_SKILL_DB];
+
+struct SkilldExt *skilld_init(void)
+{
+ for (int f = 0; f < MAX_SKILL_DB; f ++)
+ {
+ for (int d = 0; d < SKILLD_MAXMISCEFFECTS; d ++)
+ {
+ skilld_arr[f].miscEffects[d] = -1;
+ }
+ }
+}
+
+struct SkilldExt *skilld_get(const int skill_idx)
+{
+ Assert_retr(NULL, skill_idx >= 0 && skill_idx < MAX_SKILL_DB);
+ return &skilld_arr[skill_idx];
+}
diff --git a/src/emap/data/skilld.h b/src/emap/data/skilld.h
new file mode 100644
index 0000000..0039c47
--- /dev/null
+++ b/src/emap/data/skilld.h
@@ -0,0 +1,13 @@
+// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// Copyright (c) 2014 - 2015 Evol developers
+
+#ifndef EVOL_MAP_SKILLD
+#define EVOL_MAP_SKILLD
+
+struct SkilldExt;
+
+struct SkilldExt *skilld_init(void);
+
+struct SkilldExt *skilld_get(const int skill_idx);
+
+#endif // EVOL_MAP_SKILLD
diff --git a/src/emap/init.c b/src/emap/init.c
index 8f2de51..a8a8ecd 100644
--- a/src/emap/init.c
+++ b/src/emap/init.c
@@ -66,6 +66,8 @@
#include "emap/skill.h"
#include "emap/status.h"
+#include "emap/data/skilld.h"
+
#include "plugins/HPMHooking.h"
#include "common/HPMDataCheck.h" /* should always be the last file included! (if you don't make it last, it'll intentionally break compile time) */
@@ -85,6 +87,7 @@ HPExport void plugin_init (void)
{
isInit = false;
htreg_init();
+ skilld_init();
addAtcommand("setskill", setSkill);
addAtcommand("slide", slide);
@@ -304,6 +307,7 @@ HPExport void plugin_init (void)
skill->check_condition_castend_unknown = eskill_check_condition_castend_unknown;
skill->get_requirement_unknown = eskill_get_requirement_unknown;
skill->castend_pos2_unknown = eskill_castend_pos2_unknown;
+ skill->validate_additional_fields = eskill_validate_additional_fields;
langScriptId = script->add_str("Lang");
mountScriptId = script->add_str("mount");
diff --git a/src/emap/struct/skilldext.h b/src/emap/struct/skilldext.h
new file mode 100644
index 0000000..f7dd52e
--- /dev/null
+++ b/src/emap/struct/skilldext.h
@@ -0,0 +1,14 @@
+// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// Copyright (c) 2014 - 2015 Evol developers
+
+#ifndef EVOL_MAP_SKILLDEXT
+#define EVOL_MAP_SKILLDEXT
+
+#include "emap/const/skilldmaxeffects.h"
+
+struct SkilldExt
+{
+ int miscEffects[SKILLD_MAXMISCEFFECTS];
+};
+
+#endif // EVOL_MAP_SKILLDEXT