Algorithme d'expérience

De T4C Tech
Aller à la navigation Aller à la recherche

Calcul de l'expérience en fonction d'un niveau

Sur cette page vous expose l'algorithmes de calcul d'expérience en fonction d'un niveau définit.

Reverse

.text:00413460 ?InitXPchart@Character@@SAXXZ proc near ; CODE XREF: sub_472D90+97�p
.text:00413460
.text:00413460 var_8           = dword ptr -8
.text:00413460 var_4           = dword ptr -4
.text:00413460
.text:00413460                 push    ebp
.text:00413461                 mov     ebp, esp
.text:00413463                 sub     esp, 8
.text:00413466                 push    ebx
.text:00413467                 push    esi
.text:00413468                 push    edi
.text:00413469                 push    offset ?AutoConfigUpdate@Character@@CAXXZ ; Character::AutoConfigUpdate(void)
.text:0041346E                 call    sub_407670
.text:00413473                 add     esp, 4
.text:00413476                 call    ?AutoConfigUpdate@Character@@CAXXZ ; Character::AutoConfigUpdate(void)
.text:0041347B                 xor     esi, esi
.text:0041347D                 mov     edi, 0Ah
.text:00413482                 mov     ?sm_n64XPchart@Character@@2PA_JA, esi ; __int64 * Character::sm_n64XPchart
.text:00413488                 mov     dword_511B1C, esi
.text:0041348E                 mov     [ebp+var_4], 1
.text:00413495                 mov     ebx, offset unk_511B20
.text:0041349A
.text:0041349A loc_41349A:                             ; CODE XREF: Character::InitXPchart(void)+1CF�j
.text:0041349A                 cmp     ebx, offset unk_511C60
.text:004134A0                 jg      short loc_4134CA
.text:004134A2                 fild    [ebp+var_4]
.text:004134A5                 fld     ds:dbl_4DE880
.text:004134AB                 call    _CIpow
.text:004134B0                 lea     eax, [esi+3E8h]
.text:004134B6                 mov     [ebp+var_8], eax
.text:004134B9                 fild    [ebp+var_8]
.text:004134BC                 fmulp   st(1), st
.text:004134BE                 call    _ftol
.text:004134C3                 add     esi, edi
.text:004134C5                 jmp     loc_41361A
.text:004134CA ; ---------------------------------------------------------------------------
.text:004134CA
.text:004134CA loc_4134CA:                             ; CODE XREF: Character::InitXPchart(void)+40�j
.text:004134CA                 cmp     ebx, offset unk_511DA0
.text:004134D0                 jg      short loc_4134FB
.text:004134D2                 fild    [ebp+var_4]
.text:004134D5                 fld     ds:dbl_4DE880
.text:004134DB                 call    _CIpow
.text:004134E0                 lea     ecx, [esi+3E8h]
.text:004134E6                 mov     [ebp+var_8], ecx
.text:004134E9                 fild    [ebp+var_8]
.text:004134EC                 fmulp   st(1), st
.text:004134EE                 call    _ftol
.text:004134F3                 add     esi, edi
.text:004134F5                 inc     edi
.text:004134F6                 jmp     loc_41361A
.text:004134FB ; ---------------------------------------------------------------------------
.text:004134FB
.text:004134FB loc_4134FB:                             ; CODE XREF: Character::InitXPchart(void)+70�j
.text:004134FB                 cmp     ebx, offset unk_511EE0
.text:00413501                 jg      short loc_41352E
.text:00413503                 fild    [ebp+var_4]
.text:00413506                 fld     ds:dbl_4DE880
.text:0041350C                 call    _CIpow
.text:00413511                 lea     edx, [esi+3E8h]
.text:00413517                 mov     [ebp+var_8], edx
.text:0041351A                 fild    [ebp+var_8]
.text:0041351D                 fmulp   st(1), st
.text:0041351F                 call    _ftol
.text:00413524                 add     esi, edi
.text:00413526                 add     edi, 4
.text:00413529                 jmp     loc_41361A
.text:0041352E ; ---------------------------------------------------------------------------
.text:0041352E
.text:0041352E loc_41352E:                             ; CODE XREF: Character::InitXPchart(void)+A1�j
.text:0041352E                 cmp     ebx, offset unk_511F80
.text:00413534                 jg      short loc_413561
.text:00413536                 fild    [ebp+var_4]
.text:00413539                 fld     ds:dbl_4DE880
.text:0041353F                 call    _CIpow
.text:00413544                 lea     eax, [esi+3E8h]
.text:0041354A                 mov     [ebp+var_8], eax
.text:0041354D                 fild    [ebp+var_8]
.text:00413550                 fmulp   st(1), st
.text:00413552                 call    _ftol
.text:00413557                 add     esi, edi
.text:00413559                 add     edi, 10h
.text:0041355C                 jmp     loc_41361A
.text:00413561 ; ---------------------------------------------------------------------------
.text:00413561
.text:00413561 loc_413561:                             ; CODE XREF: Character::InitXPchart(void)+D4�j
.text:00413561                 cmp     ebx, offset unk_512020
.text:00413567                 jg      short loc_413594
.text:00413569                 fild    [ebp+var_4]
.text:0041356C                 fld     ds:dbl_4DE880
.text:00413572                 call    _CIpow
.text:00413577                 lea     ecx, [esi+3E8h]
.text:0041357D                 mov     [ebp+var_8], ecx
.text:00413580                 fild    [ebp+var_8]
.text:00413583                 fmulp   st(1), st
.text:00413585                 call    _ftol
.text:0041358A                 add     esi, edi
.text:0041358C                 add     edi, 40h
.text:0041358F                 jmp     loc_41361A
.text:00413594 ; ---------------------------------------------------------------------------
.text:00413594
.text:00413594 loc_413594:                             ; CODE XREF: Character::InitXPchart(void)+107�j
.text:00413594                 cmp     ebx, offset unk_5120C0
.text:0041359A                 jg      short loc_4135C7
.text:0041359C                 fild    [ebp+var_4]
.text:0041359F                 fld     ds:dbl_4DE880
.text:004135A5                 call    _CIpow
.text:004135AA                 lea     edx, [esi+3E8h]
.text:004135B0                 mov     [ebp+var_8], edx
.text:004135B3                 fild    [ebp+var_8]
.text:004135B6                 fmulp   st(1), st
.text:004135B8                 call    _ftol
.text:004135BD                 add     esi, edi
.text:004135BF                 add     edi, 100h
.text:004135C5                 jmp     short loc_41361A
.text:004135C7 ; ---------------------------------------------------------------------------
.text:004135C7
.text:004135C7 loc_4135C7:                             ; CODE XREF: Character::InitXPchart(void)+13A�j
.text:004135C7                 cmp     ebx, offset unk_512110
.text:004135CD                 fild    [ebp+var_4]
.text:004135D0                 fld     ds:dbl_4DE880
.text:004135D6                 jg      short loc_4135FA
.text:004135D8                 call    _CIpow
.text:004135DD                 lea     eax, [esi+3E8h]
.text:004135E3                 mov     [ebp+var_8], eax
.text:004135E6                 fild    [ebp+var_8]
.text:004135E9                 fmulp   st(1), st
.text:004135EB                 call    _ftol
.text:004135F0                 add     esi, edi
.text:004135F2                 add     edi, 400h
.text:004135F8                 jmp     short loc_41361A
.text:004135FA ; ---------------------------------------------------------------------------
.text:004135FA
.text:004135FA loc_4135FA:                             ; CODE XREF: Character::InitXPchart(void)+176�j
.text:004135FA                 call    _CIpow
.text:004135FF                 lea     ecx, [esi+3E8h]
.text:00413605                 mov     [ebp+var_8], ecx
.text:00413608                 fild    [ebp+var_8]
.text:0041360B                 fmulp   st(1), st
.text:0041360D                 call    _ftol
.text:00413612                 add     esi, edi
.text:00413614                 add     edi, 1000h
.text:0041361A
.text:0041361A loc_41361A:                             ; CODE XREF: Character::InitXPchart(void)+65�j
.text:0041361A                                         ; Character::InitXPchart(void)+96�j ...
.text:0041361A                 mov     [ebx], eax
.text:0041361C                 mov     [ebx+4], edx
.text:0041361F                 mov     edx, [ebp+var_4]
.text:00413622                 inc     edx
.text:00413623                 add     ebx, 8
.text:00413626                 cmp     ebx, offset dword_512158
.text:0041362C                 mov     [ebp+var_4], edx
.text:0041362F                 jl      loc_41349A
.text:00413635                 pop     edi
.text:00413636                 pop     esi
.text:00413637                 pop     ebx
.text:00413638                 mov     esp, ebp
.text:0041363A                 pop     ebp
.text:0041363B                 retn
.text:0041363B ?InitXPchart@Character@@SAXXZ endp
.text:0041363B
.text:00413460 ?InitXPchart@Character@@SAXXZ proc near ; CODE XREF: sub_472D90+97�p
.text:00413460
.text:00413460 var_8           = dword ptr -8
.text:00413460 var_4           = dword ptr -4
.text:00413460
.text:00413460                 push    ebp
.text:00413461                 mov     ebp, esp
.text:00413463                 sub     esp, 8
.text:00413466                 push    ebx
.text:00413467                 push    esi
.text:00413468                 push    edi
.text:00413469                 push    offset ?AutoConfigUpdate@Character@@CAXXZ ; Character::AutoConfigUpdate(void)
.text:0041346E                 call    sub_407670
.text:00413473                 add     esp, 4
.text:00413476                 call    ?AutoConfigUpdate@Character@@CAXXZ ; Character::AutoConfigUpdate(void)
.text:0041347B                 xor     esi, esi
.text:0041347D                 mov     edi, 0Ah
.text:00413482                 mov     ?sm_n64XPchart@Character@@2PA_JA, esi ; __int64 * Character::sm_n64XPchart
.text:00413488                 mov     dword_511B1C, esi
.text:0041348E                 mov     [ebp+var_4], 1
.text:00413495                 mov     ebx, offset unk_511B20
.text:0041349A
.text:0041349A loc_41349A:                             ; CODE XREF: Character::InitXPchart(void)+1CF�j
.text:0041349A                 cmp     ebx, offset unk_511C60
.text:004134A0                 jg      short loc_4134CA
.text:004134A2                 fild    [ebp+var_4]
.text:004134A5                 fld     ds:dbl_4DE880
.text:004134AB                 call    _CIpow
.text:004134B0                 lea     eax, [esi+3E8h]
.text:004134B6                 mov     [ebp+var_8], eax
.text:004134B9                 fild    [ebp+var_8]
.text:004134BC                 fmulp   st(1), st
.text:004134BE                 call    _ftol
.text:004134C3                 add     esi, edi
.text:004134C5                 jmp     loc_41361A
.text:004134CA ; ---------------------------------------------------------------------------
.text:004134CA
.text:004134CA loc_4134CA:                             ; CODE XREF: Character::InitXPchart(void)+40�j
.text:004134CA                 cmp     ebx, offset unk_511DA0
.text:004134D0                 jg      short loc_4134FB
.text:004134D2                 fild    [ebp+var_4]
.text:004134D5                 fld     ds:dbl_4DE880
.text:004134DB                 call    _CIpow
.text:004134E0                 lea     ecx, [esi+3E8h]
.text:004134E6                 mov     [ebp+var_8], ecx
.text:004134E9                 fild    [ebp+var_8]
.text:004134EC                 fmulp   st(1), st
.text:004134EE                 call    _ftol
.text:004134F3                 add     esi, edi
.text:004134F5                 inc     edi
.text:004134F6                 jmp     loc_41361A
.text:004134FB ; ---------------------------------------------------------------------------
.text:004134FB
.text:004134FB loc_4134FB:                             ; CODE XREF: Character::InitXPchart(void)+70�j
.text:004134FB                 cmp     ebx, offset unk_511EE0
.text:00413501                 jg      short loc_41352E
.text:00413503                 fild    [ebp+var_4]
.text:00413506                 fld     ds:dbl_4DE880
.text:0041350C                 call    _CIpow
.text:00413511                 lea     edx, [esi+3E8h]
.text:00413517                 mov     [ebp+var_8], edx
.text:0041351A                 fild    [ebp+var_8]
.text:0041351D                 fmulp   st(1), st
.text:0041351F                 call    _ftol
.text:00413524                 add     esi, edi
.text:00413526                 add     edi, 4
.text:00413529                 jmp     loc_41361A
.text:0041352E ; ---------------------------------------------------------------------------
.text:0041352E
.text:0041352E loc_41352E:                             ; CODE XREF: Character::InitXPchart(void)+A1�j
.text:0041352E                 cmp     ebx, offset unk_511F80
.text:00413534                 jg      short loc_413561
.text:00413536                 fild    [ebp+var_4]
.text:00413539                 fld     ds:dbl_4DE880
.text:0041353F                 call    _CIpow
.text:00413544                 lea     eax, [esi+3E8h]
.text:0041354A                 mov     [ebp+var_8], eax
.text:0041354D                 fild    [ebp+var_8]
.text:00413550                 fmulp   st(1), st
.text:00413552                 call    _ftol
.text:00413557                 add     esi, edi
.text:00413559                 add     edi, 10h
.text:0041355C                 jmp     loc_41361A
.text:00413561 ; ---------------------------------------------------------------------------
.text:00413561
.text:00413561 loc_413561:                             ; CODE XREF: Character::InitXPchart(void)+D4�j
.text:00413561                 cmp     ebx, offset unk_512020
.text:00413567                 jg      short loc_413594
.text:00413569                 fild    [ebp+var_4]
.text:0041356C                 fld     ds:dbl_4DE880
.text:00413572                 call    _CIpow
.text:00413577                 lea     ecx, [esi+3E8h]
.text:0041357D                 mov     [ebp+var_8], ecx
.text:00413580                 fild    [ebp+var_8]
.text:00413583                 fmulp   st(1), st
.text:00413585                 call    _ftol
.text:0041358A                 add     esi, edi
.text:0041358C                 add     edi, 40h
.text:0041358F                 jmp     loc_41361A
.text:00413594 ; ---------------------------------------------------------------------------
.text:00413594
.text:00413594 loc_413594:                             ; CODE XREF: Character::InitXPchart(void)+107�j
.text:00413594                 cmp     ebx, offset unk_5120C0
.text:0041359A                 jg      short loc_4135C7
.text:0041359C                 fild    [ebp+var_4]
.text:0041359F                 fld     ds:dbl_4DE880
.text:004135A5                 call    _CIpow
.text:004135AA                 lea     edx, [esi+3E8h]
.text:004135B0                 mov     [ebp+var_8], edx
.text:004135B3                 fild    [ebp+var_8]
.text:004135B6                 fmulp   st(1), st
.text:004135B8                 call    _ftol
.text:004135BD                 add     esi, edi
.text:004135BF                 add     edi, 100h
.text:004135C5                 jmp     short loc_41361A
.text:004135C7 ; ---------------------------------------------------------------------------
.text:004135C7
.text:004135C7 loc_4135C7:                             ; CODE XREF: Character::InitXPchart(void)+13A�j
.text:004135C7                 cmp     ebx, offset unk_512110
.text:004135CD                 fild    [ebp+var_4]
.text:004135D0                 fld     ds:dbl_4DE880
.text:004135D6                 jg      short loc_4135FA
.text:004135D8                 call    _CIpow
.text:004135DD                 lea     eax, [esi+3E8h]
.text:004135E3                 mov     [ebp+var_8], eax
.text:004135E6                 fild    [ebp+var_8]
.text:004135E9                 fmulp   st(1), st
.text:004135EB                 call    _ftol
.text:004135F0                 add     esi, edi
.text:004135F2                 add     edi, 400h
.text:004135F8                 jmp     short loc_41361A
.text:004135FA ; ---------------------------------------------------------------------------
.text:004135FA
.text:004135FA loc_4135FA:                             ; CODE XREF: Character::InitXPchart(void)+176�j
.text:004135FA                 call    _CIpow
.text:004135FF                 lea     ecx, [esi+3E8h]
.text:00413605                 mov     [ebp+var_8], ecx
.text:00413608                 fild    [ebp+var_8]
.text:0041360B                 fmulp   st(1), st
.text:0041360D                 call    _ftol
.text:00413612                 add     esi, edi
.text:00413614                 add     edi, 1000h
.text:0041361A
.text:0041361A loc_41361A:                             ; CODE XREF: Character::InitXPchart(void)+65�j
.text:0041361A                                         ; Character::InitXPchart(void)+96�j ...
.text:0041361A                 mov     [ebx], eax
.text:0041361C                 mov     [ebx+4], edx
.text:0041361F                 mov     edx, [ebp+var_4]
.text:00413622                 inc     edx
.text:00413623                 add     ebx, 8
.text:00413626                 cmp     ebx, offset dword_512158
.text:0041362C                 mov     [ebp+var_4], edx
.text:0041362F                 jl      loc_41349A
.text:00413635                 pop     edi
.text:00413636                 pop     esi
.text:00413637                 pop     ebx
.text:00413638                 mov     esp, ebp
.text:0041363A                 pop     ebp
.text:0041363B                 retn
.text:0041363B ?InitXPchart@Character@@SAXXZ endp

Algorithme du calcul de l'expérience

#include <cstdlib>
#include <iostream>
#include <math.h>

using namespace std;

int coefp(int x) {
    int coco;
    int tmp;
    if (x == 1) coco = 10;
    else {
        if (x > 192) tmp = 4096; else
        if (x > 182) tmp = 1024; else
        if (x > 162) tmp = 256; else
        if (x > 142) tmp = 64; else
        if (x > 122) tmp = 16; else
        if (x > 82) tmp = 4; else
        if (x > 42) tmp = 1; else tmp = 0;
        coco = coefp(x - 1) + tmp;
    }
    return coco;
}

int coef(int x) {
    int n = 0;
    int i;
    for (i = 2; i <= x; i++) n += coefp(i - 1);
    return 1000 + n;
}

__int64 xp(int level) {
  return coef(level - 1) * pow(level - 1, 2.5);
}

int main(int argc, char *argv[])
{
    for (int i = 2; i <= 200; i++) cout << "niveau " << i-1 << ":\t" << xp(i) << "\t" << "\n";
    system("PAUSE");
    return EXIT_SUCCESS;
}

--Mestoph 17 mars 2008 à 01:53 (MSK)