viewing paste re_homun | 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 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
Index: src/map/status.c
===================================================================
--- src/map/status.c    (revision 17269)
+++ src/map/status.c    (working copy)
@@ -1893,10 +1893,19 @@
    //Normally only players have base-atk, but homunc have a different batk
    // equation, hinting that perhaps non-players should use this for batk.
    // [Skotlex]
-   dstr = str/10;
-   str += dstr*dstr;
-   if (bl->type == BL_PC)
+   if (bl->type == BL_HOM) {
 #ifdef RENEWAL
+       //str = ((rstr + dex + status->luk) / 3) + (((TBL_HOM*)bl)->homunculus.level / 10);
+       str = ((rstr + dex + status->luk) / 3) + (((TBL_HOM*)bl)->homunculus.level / 10)*3; //Because Renewal ATK isn't implemented we adjust the actual ATK until it is
+#else
+       dstr = str/10;
+       str += dstr*dstr;
+#endif
+   } else if (bl->type != BL_PC) {
+       dstr = str/10;
+       str += dstr*dstr;
+   } else
+#ifdef RENEWAL
        str = (rstr*10 + dex*10/5 + status->luk*10/3 + ((TBL_PC*)bl)->status.base_level*10/4)/10;
 #else
        str+= dex/5 + status->luk/5;
@@ -1925,6 +1934,9 @@
    if (bl->type == BL_MOB) {
        status->hit += level + status->dex + 175;
        status->flee += level + status->agi + 100;
+   } else if (bl->type == BL_HOM) {
+       status->hit = level + status->dex + 150; //base level + dex + 150
+       status->flee = level + status->agi + level/10; //base level + agi + base level/10
    } else {
        status->hit += level + status->dex + status->luk/3 + 175; //base level + ( every 1 dex = +1 hit ) + (every 3 luk = +1 hit) + 175
        status->flee += level + status->agi + status->luk/5 + 100; //base level + ( every 1 agi = +1 flee ) + (every 5 luk = +1 flee) + 100
@@ -3188,12 +3200,27 @@
        status->hp = 1;
        status->sp = 1;
    }
+
+   status->aspd_rate = 1000;
+
+#ifdef RENEWAL
+   status->def = (status->vit + (hom->level / 10)) + ((status->agi + (hom->level / 10)) / 2);
+   status->mdef = status->int_ + ((status->int_ + status->dex + status->luk) / 3) + (hom->level / 10) * 2;
+
+   amotion = (1000 -2*status->agi -status->dex) * hd->homunculusDB->baseASPD/1000;
+#else
    skill = hom->level/10 + status->vit/5;
    status->def = cap_value(skill, 0, 99);
 
    skill = hom->level/10 + status->int_/5;
    status->mdef = cap_value(skill, 0, 99);
 
+   amotion = (1000 -4*status->agi -status->dex) * hd->homunculusDB->baseASPD/1000;
+#endif
+
+   status->amotion = cap_value(amotion,battle_config.max_aspd,2000);
+   status->adelay = status->amotion; //It seems adelay = amotion for Homunculus.
+
    status->max_hp = hom->max_hp ;
    status->max_sp = hom->max_sp ;
 
@@ -3221,15 +3248,11 @@
            sc_start(&hd->bl,&hd->bl, SC_STYLE_CHANGE, 100, MH_MD_FIGHTING, -1);
    }
 
+#ifndef RENEWAL
    status->rhw.atk = status->dex;
    status->rhw.atk2 = status->str + hom->level;
+#endif
 
-   status->aspd_rate = 1000;
-
-   amotion = (1000 -4*status->agi -status->dex) * hd->homunculusDB->baseASPD/1000;
-   status->amotion = cap_value(amotion,battle_config.max_aspd,2000);
-   status->adelay = status->amotion; //It seems adelay = amotion for Homunculus.
-
    status_calc_misc(&hd->bl, status, hom->level);
 
 #ifdef RENEWAL
@@ -3946,8 +3975,7 @@
 
    if(flag&SCB_ASPD) {
        int amotion;
-       if( bl->type&BL_PC )
-       {
+       if( bl->type&BL_PC ) {
            amotion = status_base_amotion_pc(sd,status);
 #ifndef RENEWAL_ASPD
            status->aspd_rate = status_calc_aspd_rate(bl, sc, b_status->aspd_rate);
@@ -3969,11 +3997,12 @@
            status->amotion = cap_value(amotion,((sd->class_&JOBL_THIRD) ? battle_config.max_third_aspd : battle_config.max_aspd),2000);
 
            status->adelay = 2*status->amotion;
-       }
-       else
-       if( bl->type&BL_HOM )
-       {
+       } else if( bl->type&BL_HOM ) {
+#ifdef RENEWAL
+           amotion = (1000 -2*status->agi -status->dex) * ((TBL_HOM*)bl)->homunculusDB->baseASPD/1000;
+#else
            amotion = (1000 -4*status->agi -status->dex) * ((TBL_HOM*)bl)->homunculusDB->baseASPD/1000;
+#endif
            status->aspd_rate = status_calc_aspd_rate(bl, sc, b_status->aspd_rate);
 
            if(status->aspd_rate != 1000)
@@ -3983,9 +4012,7 @@
            status->amotion = cap_value(amotion,battle_config.max_aspd,2000);
 
            status->adelay = status->amotion;
-       }
-       else // mercenary and mobs
-       {
+       } else { // mercenary and mobs
            amotion = b_status->amotion;
            status->aspd_rate = status_calc_aspd_rate(bl, sc, b_status->aspd_rate);
 
@@ -8724,7 +8751,7 @@
            val2 = 3*val1; //activation chance
            break;
        case SC_PYROCLASTIC:
-           val2 += 10*val1*status_get_lv(src); //atk bonus
+           val2 += 10*val1+status_get_lv(src); //atk bonus
            val3 = 2*val1;//Chance To AutoCast Hammer Fall %
            break;
        case SC_PARALYSIS: //[Lighta] need real info
Viewed 902 times, submitted by Guest.