Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Data Collecting: Mob Damage/Defense Formula
#12
Okay guys, im almost finished! below is a beta algorithm I made in c# that calculated the damage recieved based on the character's level, standardPDD,def,str,int,luk,dex and a random value. note that the formula, as I said, is very complicated, and is being splitted into many paths. so for this to succeed, your character's def must be lower than the standardPDD for it.

I tested it on a level 10 beginner with 429 str 50 dex 400 int 57 luk and 7 def. It's recommended to do the same because as i said its still only a first version and there might be some bugs here and there. Ill post it in a new topic along with explanations and non-programmed formulas when im finished with it.

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace defense
{
    class Program
    {
        static int Main(string[] args)
        {
            int def = 7;
            int level = 10;
            int StandardPDD = 19; //can be found in Base.wz. it's 19 for a lvl 10 beginner
            int str = 429;
            int inte = 400; //lol i cant make a variable called "int" =\
            int dex = 50;
            int luk = 57;
            int arg6 = 82; //monster's weapon att
            uint arg3 = 0xBB6CABC0; //randomization value
            int local3 = 0;
            int local5 = 0;
            int arg5 = 0;

            float local6 = arg6;
            float local4 = local6 * (float)0.85;
            float local8 = local6 * (float)0.8;
            //float temp2 = local8;
            //float temp = local4 - local8;
            //int eax = arg3 / 0x989680;
            local8 = (((((local4 - local8) * (arg3 % 0x989680)) / 10000000) + local8) * local6) / 100; //or in other words, local8 = ((((((watt * 0.85) - (watt * 0.8)) * (random % 0x989680)) / 10000000) + (watt * 0.8)) * watt) / 100
            arg6 = def;
            if (arg6 > 0x7df)
                arg6 = 0x7df; //apperantly max defense possible is 0x7df (2015)...
            int value = 0; //one of these values i have no idea what they mean
            int local1 = 0; //i have no idea what is that one too... seems like its always 0
            if (local1 == 1)
            {
                //some different formula here, will extract it if i see a case when local1 != 0
            }
            else
            {
                local3 = str;
                local5 = dex;
                local1 = inte;
                arg5 = luk;
                arg5 = (int)((arg5 * 0.25) + (local5 * 0.2857142857142857) + (local3 * 0.4) + (local1 * 0.1111111111111111));
            }
            int arg1 = 15; //lolwut? i have no idea what is it again.
            if (def >= StandardPDD)
            {
                //some different formula here, will extract it later
            }
            else
            {
                if (level < arg1)
                {
                    local6 = (float)(arg5 * 0.00125);
                    int edi = def - StandardPDD;
                    float temp = (float)(((level * 0.001818181818181818 + local6 + 0.28) * edi * 1.3) + ((local6 + 0.28) * def));
                    float FinalDamage = local8 - temp;
                    return (int)FinalDamage;
                }
                else
                {
                    //more annoying formulas...
                }
            }
            return 0;
        }
    }
}
Reply


Messages In This Thread
Data Collecting: Mob Damage/Defense Formula - by Kortestanov - 2009-07-08, 11:14 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)