viewing paste Unknown #5858 | 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
Index: src/map/skill.c
===================================================================
--- src/map/skill.c (revision 17326)
+++ src/map/skill.c (working copy)
@@ -5119,11 +5119,11 @@
            do {
                i = rnd() % MAX_SKILL_ABRA_DB;
                abra_skill_id = skill_abra_db[i].skill_id;
+               abra_skill_lv = min(skill_lv, skill_get_max(abra_skill_id));
            } while (abra_skill_id == 0 ||
-               skill_abra_db[i].req_lv > skill_lv || //Required lv for it to appear
-               rnd()%10000 >= skill_abra_db[i].per
+               rnd()%10000 >= skill_abra_db[i].per[abra_skill_lv]
            );
-           abra_skill_lv = min(skill_lv, skill_get_max(abra_skill_id));
+
            clif_skill_nodamage (src, bl, skill_id, skill_lv, 1);
 
            if( sd )
@@ -17582,7 +17582,7 @@
                        static const int dx[] = {-1,-1,-1,-1, 0, 0, 0, 0, 1, 1, 1, 1,
                                     -5,-5,-5,-5,-4,-4,-4,-4,-3,-3,-3,-3,-2,-2,-2,-2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5,
                                     -1,-1,-1, 0, 0, 0, 1, 1, 1};
-                       static const int dy[] = { 0,-1,-2,-3, 0,-1,-2,-3, 0,-1,-2,-3, 
+                       static const int dy[] = { 0,-1,-2,-3, 0,-1,-2,-3, 0,-1,-2,-3,
                                      0,-1,-2,-3, 0,-1,-2,-3, 0,-1,-2,-3, 0,-1,-2,-3, 0,-1,-2,-3, 0,-1,-2,-3, 0,-1,-2,-3, 0,-1,-2,-3,
                                     -4,-5,-6,-4,-5,-6,-4,-5,-6};
                        skill_unit_layout[pos].count = 53;
@@ -18166,7 +18166,7 @@
 
 
 static bool skill_parse_row_abradb(char* split[], int columns, int current)
-{// skill_id,DummyName,RequiredHocusPocusLevel,Rate
+{// skill_id,DummyName,RatePerLvl
    uint16 skill_id = atoi(split[0]);
    if( !skill_get_index(skill_id) || !skill_get_max(skill_id) )
    {
@@ -18180,8 +18180,8 @@
    }
 
    skill_abra_db[current].skill_id = skill_id;
-   skill_abra_db[current].req_lv = atoi(split[2]);
-   skill_abra_db[current].per = atoi(split[3]);
+   safestrncpy(skill_abra_db[current].name, trim(split[1]), sizeof(skill_abra_db[current].name)); //store dummyname
+   skill_split_atoi(split[2],skill_abra_db[current].per);
 
    return true;
 }
Index: src/map/skill.h
===================================================================
--- src/map/skill.h (revision 17326)
+++ src/map/skill.h (working copy)
@@ -217,8 +217,8 @@
 
 struct s_skill_abra_db {
    uint16 skill_id;
-   int req_lv;
-   int per;
+   char name[NAME_LENGTH];
+   int per[MAX_SKILL_LEVEL];
 };
 extern struct s_skill_abra_db skill_abra_db[MAX_SKILL_ABRA_DB];
Viewed 1259 times, submitted by lighta.