viewing paste topic/7161- item_mob_data.diff | Diff

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
 src/common/HPMi.h | 15 +++++++++++++++
 src/map/HPMmap.c  | 12 ++++++++++++
 src/map/itemdb.h  |  4 ++++
 src/map/mob.h     |  8 ++++++++
 4 files changed, 39 insertions(+)
 
diff --git a/src/common/HPMi.h b/src/common/HPMi.h
index 478cfbd..464794c 100644
--- a/src/common/HPMi.h
+++ b/src/common/HPMi.h
@@ -79,6 +79,9 @@ enum HPluginDataTypes {
    HPDT_INSTANCE,
    HPDT_GUILD,
    HPDT_PARTY,
+   HPDT_MOBDB,
+   HPDT_MOBDATA,
+   HPDT_ITEMDATA,
 };
 
 /* used in macros and conf storage */
@@ -124,6 +127,18 @@ enum HPluginConfType {
 #define addToINSTD(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_INSTANCE,HPMi->pid,(ptr),(data),(index),(autofree)))
 #define getFromINSTD(ptr,index) (HPMi->getFromHPData(HPDT_INSTANCE,HPMi->pid,(ptr),(index)))
 #define removeFromINSTD(ptr,index) (HPMi->removeFromHPData(HPDT_INSTANCE,HPMi->pid,(ptr),(index)))
+/* mob_db */
+#define addToMOBDB(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_MOBDB,HPMi->pid,(ptr),(data),(index),(autofree)))
+#define getFromMOBDB(ptr,index) (HPMi->getFromHPData(HPDT_MOBDB,HPMi->pid,(ptr),(index)))
+#define removeFromMOBDB(ptr,index) (HPMi->removeFromHPData(HPDT_MOBDB,HPMi->pid,(ptr),(index)))
+/* mob_data */
+#define addToMOBDATA(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_MOBDATA,HPMi->pid,(ptr),(data),(index),(autofree)))
+#define getFromMOBDATA(ptr,index) (HPMi->getFromHPData(HPDT_MOBDATA,HPMi->pid,(ptr),(index)))
+#define removeFromMOBDATA(ptr,index) (HPMi->removeFromHPData(HPDT_MOBDATA,HPMi->pid,(ptr),(index)))
+/* item_data */
+#define addToITEMDATA(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_ITEMDATA,HPMi->pid,(ptr),(data),(index),(autofree)))
+#define getFromITEMDATA(ptr,index) (HPMi->getFromHPData(HPDT_ITEMDATA,HPMi->pid,(ptr),(index)))
+#define removeFromITEMDATA(ptr,index) (HPMi->removeFromHPData(HPDT_ITEMDATA,HPMi->pid,(ptr),(index)))
 
 /* HPMi->addCommand */
 #define addAtcommand(cname,funcname) \
diff --git a/src/map/HPMmap.c b/src/map/HPMmap.c
index cb8c979..ef5a939 100644
--- a/src/map/HPMmap.c
+++ b/src/map/HPMmap.c
@@ -106,6 +106,18 @@ bool HPM_map_grabHPData(struct HPDataOperationStorage *ret, enum HPluginDataType
            ret->HPDataSRCPtr = (void**)(&((struct instance_data *)ptr)->hdata);
            ret->hdatac = &((struct instance_data *)ptr)->hdatac;
            break;
+       case HPDT_MOBDB:
+           ret->HPDataSRCPtr = (void**)(&((struct mob_db *)ptr)->hdata);
+           ret->hdatac = &((struct mob_db *)ptr)->hdatac;
+           break;
+       case HPDT_MOBDATA:
+           ret->HPDataSRCPtr = (void**)(&((struct mob_data *)ptr)->hdata);
+           ret->hdatac = &((struct mob_data *)ptr)->hdatac;
+           break;
+       case HPDT_ITEMDATA:
+           ret->HPDataSRCPtr = (void**)(&((struct item_data *)ptr)->hdata);
+           ret->hdatac = &((struct item_data *)ptr)->hdatac;
+           break;
        default:
            return false;
    }
diff --git a/src/map/itemdb.h b/src/map/itemdb.h
index 198d7a5..0f33259 100644
--- a/src/map/itemdb.h
+++ b/src/map/itemdb.h
@@ -431,6 +431,10 @@ struct item_data {
    /* TODO add a pointer to some sort of (struct extra) and gather all the not-common vals into it to save memory */
    struct item_group *group;
    struct item_package *package;
+
+   /* HPM Custom Struct */
+   struct HPluginData **hdata;
+   unsigned int hdatac;
 };
 
 struct item_combo {
diff --git a/src/map/mob.h b/src/map/mob.h
index 728f3d8..12ef6ac 100644
--- a/src/map/mob.h
+++ b/src/map/mob.h
@@ -115,6 +115,10 @@ struct mob_db {
    int maxskill;
    struct mob_skill skill[MAX_MOBSKILL];
    struct spawn_info spawn[10];
+
+   /* HPM Custom Struct */
+   struct HPluginData **hdata;
+   unsigned int hdatac;
 };
 
 struct mob_data {
@@ -185,6 +189,10 @@ struct mob_data {
     * MvP Tombstone NPC ID
     **/
    int tomb_nid;
+
+   /* HPM Custom Struct */
+   struct HPluginData **hdata;
+   unsigned int hdatac;
 };
 
 
 
Viewed 1503 times, submitted by AnnieRuru.