/*
VOCATION SKILL MULTIPLIERS
Knights: 1.1
Paladins: 1.2
Druids: 1.8
Sorcerers and Rookies: 2
VOCATION MAGICLEVEL MULTIPLIER
Mages: 1.1
Paladins: 1.4
Knights: 3
*/
void __usercall TPlayer::SetProfession(TPlayer *const this@<ebx>, char *a2@<eax>, int prof, unsigned __int8 a4)
{
int profession; // ebx@1
int *v5; // eax@8
int v6; // edx@8
int *v7; // eax@12
int v8; // edx@12
char *v9; // eax@17
int v10; // eax@19
signed int v11; // [sp+4h] [bp-24h]@8
signed int v12; // [sp+4h] [bp-24h]@12
const char *v13; // [sp+30h] [bp+8h]@6
TCombat *v14; // [sp+30h] [bp+8h]@22
int v15; // [sp+34h] [bp+Ch]@6
profession = prof;
if ( a4 == 10 )
{
v9 = (char *)*(_BYTE *)(prof + 790);
if ( (_BYTE)v9 )
{
if ( (unsigned __int8)v9 <= 9u )
{
*(_BYTE *)(prof + 790) = (_BYTE)v9 + 10;
TCombat::CheckCombatValues((TCombat *const )prof);
*(_DWORD *)(*(_DWORD *)(prof + 92) + 24) = 200;
v10 = (*(int (__cdecl **)(_DWORD))(**(_DWORD **)(prof + 92) + 52))(*(_DWORD *)(prof + 92));
if ( v10 > 14 )
TSkillBase::SetTimer((TSkillBase *const )(prof + 4), 0x16u, (v10 - 1) / 15 + 1, (v10 - 1) % 15 + 1, 15, -1);
return;
}
v14 = (TCombat *)"TPlayer::SetProfession: Spieler hat seinen Beruf schon veredelt.\n";
}
else
{
v14 = (TCombat *)&unk_8104220;
}
error(v9, v14);
return;
}
if ( *(_BYTE *)(prof + 790) )
{
v13 = "TPlayer::SetProfession: Player '%s' hat bereits einen Beruf!\n";
v15 = profession + 532;
goto LABEL_7;
}
a2 = (char *)a4;
if ( a4 == 2 )
{
//SKILLRATES FOR PALADIN
(*(void (__cdecl **)(_DWORD, signed int, signed int))(**(_DWORD **)(prof + 36) + 28))(
*(_DWORD *)(prof + 36),
1200, //VOC SKILL MULTIPLIER
50); //RATE
(*(void (__cdecl **)(_DWORD, signed int, signed int))(**(_DWORD **)(prof + 44) + 28))(
*(_DWORD *)(prof + 44),
1200,
50);
(*(void (__cdecl **)(_DWORD, signed int, signed int))(**(_DWORD **)(prof + 40) + 28))(
*(_DWORD *)(prof + 40),
1200,
50);
(*(void (__cdecl **)(_DWORD, signed int, signed int))(**(_DWORD **)(prof + 48) + 28))(
*(_DWORD *)(prof + 48),
1200,
50);
(*(void (__cdecl **)(_DWORD, signed int, signed int))(**(_DWORD **)(prof + 32) + 28))(
*(_DWORD *)(prof + 32),
1100,
30);
(*(void (__cdecl **)(_DWORD, signed int, signed int))(**(_DWORD **)(prof + 28) + 28))(
*(_DWORD *)(prof + 28),
1100,
100);
*(_DWORD *)(*(_DWORD *)(prof + 12) + 68) = 10; //Hp per level (Paladin)
*(_DWORD *)(*(_DWORD *)(prof + 24) + 68) = 20; //Cap per level (Paladin)
*(_DWORD *)(*(_DWORD *)(prof + 16) + 68) = 15; //MP per level (Paladin)
v5 = *(int **)(prof + 8);
v6 = *v5;
v11 = 1400; //MANA REQUIREMENT MULTIPLIER TO ADVANCE
}
else if ( (signed int)a4 > 2 )
{
if ( a4 == 3 )
{
//SKILLRATES FOR SORC & NOVOC
(*(void (__cdecl **)(_DWORD, signed int, signed int))(**(_DWORD **)(prof + 36) + 28))(
*(_DWORD *)(prof + 36),
2000,
50);
(*(void (__cdecl **)(_DWORD, signed int, signed int))(**(_DWORD **)(prof + 44) + 28))(
*(_DWORD *)(prof + 44),
2000,
50);
(*(void (__cdecl **)(_DWORD, signed int, signed int))(**(_DWORD **)(prof + 40) + 28))(
*(_DWORD *)(prof + 40),
2000,
50);
(*(void (__cdecl **)(_DWORD, signed int, signed int))(**(_DWORD **)(prof + 48) + 28))(
*(_DWORD *)(prof + 48),
1500,
50);
v7 = *(int **)(prof + 32);
v8 = *v7;
v12 = 2000; //VOC SKILL MULTIPLIER FOR THE UNSPECIFIED?
}
else
{
//SKILLRATES FOR DRUID
if ( a4 != 4 )
goto LABEL_6;
(*(void (__cdecl **)(_DWORD, signed int, signed int))(**(_DWORD **)(prof + 36) + 28))(
*(_DWORD *)(prof + 36),
1800,
50);
(*(void (__cdecl **)(_DWORD, signed int, signed int))(**(_DWORD **)(prof + 44) + 28))(
*(_DWORD *)(prof + 44),
1800,
50);
(*(void (__cdecl **)(_DWORD, signed int, signed int))(**(_DWORD **)(prof + 40) + 28))(
*(_DWORD *)(prof + 40),
1800,
50);
(*(void (__cdecl **)(_DWORD, signed int, signed int))(**(_DWORD **)(prof + 48) + 28))(
*(_DWORD *)(prof + 48),
1500,
50);
v7 = *(int **)(prof + 32);
v8 = *v7;
v12 = 1800; //VOC SKILL MULTIPLIER FOR THE UNSPECIFIED?
}
(*(void (__cdecl **)(int *, signed int, signed int))(v8 + 28))(v7, v12, 30);
(*(void (__cdecl **)(_DWORD, signed int, signed int))(**(_DWORD **)(prof + 28) + 28))(
*(_DWORD *)(prof + 28),
1500,
100);
*(_DWORD *)(*(_DWORD *)(prof + 12) + 68) = 5; //HP per level (Sorc & Druid & NoVoc)
*(_DWORD *)(*(_DWORD *)(prof + 24) + 68) = 10; //Cap per level
*(_DWORD *)(*(_DWORD *)(prof + 16) + 68) = 30; //Mana per level
v5 = *(int **)(prof + 8);
v6 = *v5;
v11 = 1100; //MANA REQUIREMENT MULTIPLIER TO ADVANCE MLVL (MAGES SORC & DRUID)
}
else
{
a2 = (char *)(a4 - 1);
if ( a4 != 1 )
{
LABEL_6:
v13 = "TPlayer::SetProfession: Beruf %d existiert nicht!\n";
v15 = a4;
LABEL_7:
error(a2, v13, v15);
return;
}
//SKILLRATES FOR KNIGHT
(*(void (__cdecl **)(_DWORD, signed int, signed int))(**(_DWORD **)(prof + 36) + 28))(
*(_DWORD *)(prof + 36),
1100,
50);
(*(void (__cdecl **)(_DWORD, signed int, signed int))(**(_DWORD **)(prof + 44) + 28))(
*(_DWORD *)(prof + 44),
1100,
50);
(*(void (__cdecl **)(_DWORD, signed int, signed int))(**(_DWORD **)(prof + 40) + 28))(
*(_DWORD *)(prof + 40),
1100,
50);
(*(void (__cdecl **)(_DWORD, signed int, signed int))(**(_DWORD **)(prof + 48) + 28))(
*(_DWORD *)(prof + 48),
1100,
50);
(*(void (__cdecl **)(_DWORD, signed int, signed int))(**(_DWORD **)(prof + 32) + 28))(
*(_DWORD *)(prof + 32),
1400,
30);
(*(void (__cdecl **)(_DWORD, signed int, signed int))(**(_DWORD **)(prof + 28) + 28))(
*(_DWORD *)(prof + 28),
1100,
100);
*(_DWORD *)(*(_DWORD *)(prof + 12) + 68) = 15; // Hp per level (KNIGHT)
*(_DWORD *)(*(_DWORD *)(prof + 24) + 68) = 25; // Cap per level
*(_DWORD *)(*(_DWORD *)(prof + 16) + 68) = 5; // Mana per level
v5 = *(int **)(prof + 8);
v6 = *v5;
v11 = 3000; //MANA REQUIREMENT MULTIPLIER TO ADVANCE MLVL
}
(*(void (__cdecl **)(int *, signed int, signed int))(v6 + 28))(v5, v11, 1600);
*(_BYTE *)(prof + 790) = a4;
TCombat::CheckCombatValues((TCombat *const )prof);
DecrementNewbiesOnline();
}