viewing paste skill_cond_update | C

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
Index: skill.c
===================================================================
--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -4073,6 +4073,7 @@
    struct status_data *sstatus, *tstatus;
    struct status_change *tsc;
    struct status_change_entry *tsce;
+        struct skill_condition require;
 
    int i;
    enum sc_type type;
@@ -4104,6 +4105,8 @@
    tstatus = status_get_status_data(bl);
    sstatus = status_get_status_data(src);
 
+        require = skill_get_requirement(sd,skillid,skilllv);
+
    //Check for undead skills that convert a no-damage skill into a damage one. [Skotlex]
    switch (skillid) {
        case HLIF_HEAL: //[orn]
@@ -5547,14 +5550,14 @@
            if( sd )
            {
                x = skilllv%11 - 1;
-               i = pc_search_inventory(sd,skill_db[skillid].itemid[x]);
-               if(i < 0 || skill_db[skillid].itemid[x] <= 0)
+               i = pc_search_inventory(sd,require.itemid[x]);
+               if(i < 0 || require.itemid[x] <= 0)
                {
                    clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0);
                    map_freeblock_unlock();
                    return 1;
                }
-               if(sd->inventory_data[i] == NULL || sd->status.inventory[i].amount < skill_db[skillid].amount[x])
+               if(sd->inventory_data[i] == NULL || sd->status.inventory[i].amount < require.amount[x])
                {
                    clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0);
                    map_freeblock_unlock();
@@ -6346,7 +6349,7 @@
                map_freeblock_unlock();
                return 0;
            }
-           status_zap(src,0,skill_db[skill_get_index(skillid)].sp[skilllv]); // consume sp only if succeeded [Inkfish]
+           status_zap(src,0,require.sp); // consume sp only if succeeded [Inkfish]
            do {
                eff = rnd() % 14;
                clif_specialeffect(bl, 523 + eff, AREA);
@@ -7989,6 +7992,7 @@
    struct status_change_entry *sce;
    struct skill_unit_group* sg;
    enum sc_type type;
+        struct skill_condition require;
    int i;
 
    //if(skilllv <= 0) return 0;
@@ -8005,6 +8009,8 @@
    type = status_skill2sc(skillid);
    sce = (sc && type != -1)?sc->data[type]:NULL;
 
+        require = skill_get_requirement(sd,skillid,skilllv);
+        
    switch (skillid) { //Skill effect.
        case WZ_METEOR:
        case MO_BODYRELOCATION:
@@ -8258,8 +8264,8 @@
    case CR_SLIMPITCHER:
        if (sd) {
            int i = skilllv%11 - 1;
-           int j = pc_search_inventory(sd,skill_db[skillid].itemid[i]);
-           if( j < 0 || skill_db[skillid].itemid[i] <= 0 || sd->inventory_data[j] == NULL || sd->status.inventory[j].amount < skill_db[skillid].amount[i] )
+           int j = pc_search_inventory(sd,require.itemid[i]);
+           if( j < 0 || require.itemid[i] <= 0 || sd->inventory_data[j] == NULL || sd->status.inventory[j].amount < require.amount[i] )
            {
                clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0);
                return 1;
@@ -8288,7 +8294,7 @@
        } else {
            int i = skilllv%11 - 1;
            struct item_data *item;
-           i = skill_db[skillid].itemid[i];
+           i = require.itemid[i];
            item = itemdb_search(i);
            potion_flag = 1;
            potion_hp = 0;
Viewed 1191 times, submitted by lighta.