PTS Glory Days

Yes, I removed this extender in previous tests as well. I just raised the possibility that even after removal, it still crashes. Could it also be due to insufficient memory? I'm just exploring other potential issues.
btw speaking about memory. Check L2Server.ini file for IOBufferCount setting. It's set to 8000 from the box. I've set mine to 80000 like any other retail build. Haven't got a single crash so far.
 

btw speaking about memory. Check L2Server.ini file for IOBufferCount setting. It's set to 8000 from the box. I've set mine to 80000 like any other retail build. Haven't got a single crash so far.
Could I please ask about the server configuration you are using and how long you have managed to keep it running continuously?
 

Вложения

  • L2Server.zip
    1,7 КБ · Просмотры: 9
Thank you, but 4 days is too short. Can you try running continuously for 10 days?
 
Может кто в курсе. Нашел интересный скилл 9369. Это с футболки Мафр. Поднимает общий шанс заточки вещей. В эффекте значится вот это p_lucky_enchant_rate;15;3;0.
Из того, что нашел в сети, что она поднимает шанс заточки на 15%, но не более 3% от базы. Пробовал поиграться с цифрами, но складывается ощущение, что этот скилл не работает от слова совсем.
 
Может кто в курсе. Нашел интересный скилл 9369. Это с футболки Мафр. Поднимает общий шанс заточки вещей. В эффекте значится вот это p_lucky_enchant_rate;15;3;0.
Из того, что нашел в сети, что она поднимает шанс заточки на 15%, но не более 3% от базы. Пробовал поиграться с цифрами, но складывается ощущение, что этот скилл не работает от слова совсем.
Код:
void __fastcall CSkillEffect_p_lucky_enchant_rate::CSkillEffect_p_lucky_enchant_rate(
        CSkillEffect_p_lucky_enchant_rate *this,
        int EnchantIncreaseRate,
        int MaxEnchantIncreaseRate,
        int Option,
        SkillFxChangeType sfct)
{
  int v5; // r9d

  *(_QWORD *)&this->nUnitTick = 0i64;
  this->effectCondList._Mypair._Myval2._Myfirst = 0i64;
  this->effectCondList._Mypair._Myval2._Mylast = 0i64;
  this->effectCondList._Mypair._Myval2._Myend = 0i64;
  this->__vftable = (CSkillEffect_p_lucky_enchant_rate_vtbl *)&CSkillEffect_p_lucky_enchant_rate::`vftable';
  this->m_sfct = sfct;
  *(_QWORD *)&this->m_nWeaponEnchantIncreaseRate = 0i64;
  this->m_nMaxEnchantIncreaseRate = MaxEnchantIncreaseRate;
  this->m_nEnchantRateOption = Option;
  if ( Option )
  {
    v5 = Option - 1;
    if ( !v5 )
    {
      this->m_nWeaponEnchantIncreaseRate = EnchantIncreaseRate;
      return;
    }
    if ( v5 != 1 )
      return;
  }
  else
  {
    this->m_nWeaponEnchantIncreaseRate = EnchantIncreaseRate;
  }
  this->m_nArmorEnchantIncreaseRate = EnchantIncreaseRate;
}

Код:
char __fastcall CSkillEffect_p_lucky_enchant_rate::Pump(
        CSkillEffect_p_lucky_enchant_rate *this,
        CCreature *pTarget,
        const CSkillInfo *pSkillInfo,
        int sourceId)
{
  TshirtOptionType m_nEnchantOption; // ecx
  __int32 v7; // ecx

  if ( pTarget && pTarget->IsPC(pTarget) )
  {
    m_nEnchantOption = pTarget->m_SkillMod.m_nEnchantOption;
    if ( m_nEnchantOption )
    {
      v7 = m_nEnchantOption - 1;
      if ( v7 )
      {
        if ( v7 == 1 )
          pTarget->m_SkillMod.m_nArmorEnchantRate += this->m_nArmorEnchantIncreaseRate;
        goto LABEL_9;
      }
    }
    else
    {
      pTarget->m_SkillMod.m_nArmorEnchantRate += this->m_nArmorEnchantIncreaseRate;
    }
    pTarget->m_SkillMod.m_nWeaponEnchantRate += this->m_nWeaponEnchantIncreaseRate;
LABEL_9:
    pTarget->m_SkillMod.m_nMaxEnchantIncreaseRate += this->m_nMaxEnchantIncreaseRate;
    pTarget->m_SkillMod.m_nEnchantOption = this->m_nEnchantRateOption;
    pTarget->m_SkillMod.m_EnchantType = this->m_sfct;
    return 1;
  }
  return 0;
}
Код:
bool __fastcall CSkillEffect_i_add_enchant_weapon_level_inc::Instant(
        CSkillEffect_i_add_enchant_weapon_level_inc *this,
        User *pSkillUser,
        CWorldObject *pTarget,
        const CSkillInfo *pSkillInfo)
{
  CItem *PendingUseETCItem; // r14
  CItem *v8; // rbp
  UserNPCLogType v9; // ebx
  double v10; // xmm0_8
  double v11; // xmm1_8
  double v12; // xmm0_8
  double v13; // xmm1_8
  bool result; // al

  PendingUseETCItem = User::GetPendingUseETCItem(pSkillUser, PUIT_ENCHANT);
  v8 = User::GetPendingUseETCItem(pSkillUser, PUIT_INC_ENCHANT_PROP);
  if ( !pTarget->IsItem(pTarget) || !pTarget->IsWeapon(pTarget) || !PendingUseETCItem || !v8 )
    return 0;
  v9 = USER_NPC_LOG_QUEST_HUNT;
  v10 = genrand64_real1();
  v11 = this->m_dBonusProb[0];
  v12 = v10 * 100.0 + 0.0;
  if ( v11 < v12 )
  {
    v13 = v11 + this->m_dBonusProb[1];
    if ( v13 < v12 )
    {
      if ( v13 + this->m_dBonusProb[2] >= v12 )
        v9 = this->m_nBonusLevel[2];
    }
    else
    {
      v9 = this->m_nBonusLevel[1];
    }
  }
  else
  {
    v9 = this->m_nBonusLevel[0];
  }
  result = 1;
  if ( v9 < USER_NPC_LOG_QUEST_HUNT )
    v9 = USER_NPC_LOG_QUEST_HUNT;
  pSkillUser->m_EnchantBonusOptions[2] = v9;
  return result;
}
Код:
bool __fastcall CSkillEffect_i_add_enchant_armor_level_inc::Instant(
        CSkillEffect_i_add_enchant_armor_level_inc *this,
        User *pSkillUser,
        CWorldObject *pTarget,
        const CSkillInfo *pSkillInfo)
{
  CItem *PendingUseETCItem; // r14
  CItem *v8; // rbp
  UserNPCLogType v9; // ebx
  double v10; // xmm0_8
  double v11; // xmm1_8
  double v12; // xmm0_8
  double v13; // xmm1_8
  bool result; // al

  PendingUseETCItem = User::GetPendingUseETCItem(pSkillUser, PUIT_ENCHANT);
  v8 = User::GetPendingUseETCItem(pSkillUser, PUIT_INC_ENCHANT_PROP);
  if ( !pTarget->IsItem(pTarget)
    || !pTarget->IsArmor(pTarget) && !pTarget->IsAccessary(pTarget)
    || !PendingUseETCItem
    || !v8 )
  {
    return 0;
  }
  v9 = USER_NPC_LOG_QUEST_HUNT;
  v10 = genrand64_real1();
  v11 = this->m_dBonusProb[0];
  v12 = v10 * 100.0 + 0.0;
  if ( v11 < v12 )
  {
    v13 = v11 + this->m_dBonusProb[1];
    if ( v13 < v12 )
    {
      if ( v13 + this->m_dBonusProb[2] >= v12 )
        v9 = this->m_nBonusLevel[2];
    }
    else
    {
      v9 = this->m_nBonusLevel[1];
    }
  }
  else
  {
    v9 = this->m_nBonusLevel[0];
  }
  result = 1;
  if ( v9 < USER_NPC_LOG_QUEST_HUNT )
    v9 = USER_NPC_LOG_QUEST_HUNT;
  pSkillUser->m_EnchantBonusOptions[2] = v9;
  return result;
}
 
Код:
void __fastcall CSkillEffect_p_lucky_enchant_rate::CSkillEffect_p_lucky_enchant_rate(
        CSkillEffect_p_lucky_enchant_rate *this,
        int EnchantIncreaseRate,
        int MaxEnchantIncreaseRate,
        int Option,
        SkillFxChangeType sfct)
{
  int v5; // r9d

  *(_QWORD *)&this->nUnitTick = 0i64;
  this->effectCondList._Mypair._Myval2._Myfirst = 0i64;
  this->effectCondList._Mypair._Myval2._Mylast = 0i64;
  this->effectCondList._Mypair._Myval2._Myend = 0i64;
  this->__vftable = (CSkillEffect_p_lucky_enchant_rate_vtbl *)&CSkillEffect_p_lucky_enchant_rate::`vftable';
  this->m_sfct = sfct;
  *(_QWORD *)&this->m_nWeaponEnchantIncreaseRate = 0i64;
  this->m_nMaxEnchantIncreaseRate = MaxEnchantIncreaseRate;
  this->m_nEnchantRateOption = Option;
  if ( Option )
  {
    v5 = Option - 1;
    if ( !v5 )
    {
      this->m_nWeaponEnchantIncreaseRate = EnchantIncreaseRate;
      return;
    }
    if ( v5 != 1 )
      return;
  }
  else
  {
    this->m_nWeaponEnchantIncreaseRate = EnchantIncreaseRate;
  }
  this->m_nArmorEnchantIncreaseRate = EnchantIncreaseRate;
}

Код:
char __fastcall CSkillEffect_p_lucky_enchant_rate::Pump(
        CSkillEffect_p_lucky_enchant_rate *this,
        CCreature *pTarget,
        const CSkillInfo *pSkillInfo,
        int sourceId)
{
  TshirtOptionType m_nEnchantOption; // ecx
  __int32 v7; // ecx

  if ( pTarget && pTarget->IsPC(pTarget) )
  {
    m_nEnchantOption = pTarget->m_SkillMod.m_nEnchantOption;
    if ( m_nEnchantOption )
    {
      v7 = m_nEnchantOption - 1;
      if ( v7 )
      {
        if ( v7 == 1 )
          pTarget->m_SkillMod.m_nArmorEnchantRate += this->m_nArmorEnchantIncreaseRate;
        goto LABEL_9;
      }
    }
    else
    {
      pTarget->m_SkillMod.m_nArmorEnchantRate += this->m_nArmorEnchantIncreaseRate;
    }
    pTarget->m_SkillMod.m_nWeaponEnchantRate += this->m_nWeaponEnchantIncreaseRate;
LABEL_9:
    pTarget->m_SkillMod.m_nMaxEnchantIncreaseRate += this->m_nMaxEnchantIncreaseRate;
    pTarget->m_SkillMod.m_nEnchantOption = this->m_nEnchantRateOption;
    pTarget->m_SkillMod.m_EnchantType = this->m_sfct;
    return 1;
  }
  return 0;
}
Код:
bool __fastcall CSkillEffect_i_add_enchant_weapon_level_inc::Instant(
        CSkillEffect_i_add_enchant_weapon_level_inc *this,
        User *pSkillUser,
        CWorldObject *pTarget,
        const CSkillInfo *pSkillInfo)
{
  CItem *PendingUseETCItem; // r14
  CItem *v8; // rbp
  UserNPCLogType v9; // ebx
  double v10; // xmm0_8
  double v11; // xmm1_8
  double v12; // xmm0_8
  double v13; // xmm1_8
  bool result; // al

  PendingUseETCItem = User::GetPendingUseETCItem(pSkillUser, PUIT_ENCHANT);
  v8 = User::GetPendingUseETCItem(pSkillUser, PUIT_INC_ENCHANT_PROP);
  if ( !pTarget->IsItem(pTarget) || !pTarget->IsWeapon(pTarget) || !PendingUseETCItem || !v8 )
    return 0;
  v9 = USER_NPC_LOG_QUEST_HUNT;
  v10 = genrand64_real1();
  v11 = this->m_dBonusProb[0];
  v12 = v10 * 100.0 + 0.0;
  if ( v11 < v12 )
  {
    v13 = v11 + this->m_dBonusProb[1];
    if ( v13 < v12 )
    {
      if ( v13 + this->m_dBonusProb[2] >= v12 )
        v9 = this->m_nBonusLevel[2];
    }
    else
    {
      v9 = this->m_nBonusLevel[1];
    }
  }
  else
  {
    v9 = this->m_nBonusLevel[0];
  }
  result = 1;
  if ( v9 < USER_NPC_LOG_QUEST_HUNT )
    v9 = USER_NPC_LOG_QUEST_HUNT;
  pSkillUser->m_EnchantBonusOptions[2] = v9;
  return result;
}
Код:
bool __fastcall CSkillEffect_i_add_enchant_armor_level_inc::Instant(
        CSkillEffect_i_add_enchant_armor_level_inc *this,
        User *pSkillUser,
        CWorldObject *pTarget,
        const CSkillInfo *pSkillInfo)
{
  CItem *PendingUseETCItem; // r14
  CItem *v8; // rbp
  UserNPCLogType v9; // ebx
  double v10; // xmm0_8
  double v11; // xmm1_8
  double v12; // xmm0_8
  double v13; // xmm1_8
  bool result; // al

  PendingUseETCItem = User::GetPendingUseETCItem(pSkillUser, PUIT_ENCHANT);
  v8 = User::GetPendingUseETCItem(pSkillUser, PUIT_INC_ENCHANT_PROP);
  if ( !pTarget->IsItem(pTarget)
    || !pTarget->IsArmor(pTarget) && !pTarget->IsAccessary(pTarget)
    || !PendingUseETCItem
    || !v8 )
  {
    return 0;
  }
  v9 = USER_NPC_LOG_QUEST_HUNT;
  v10 = genrand64_real1();
  v11 = this->m_dBonusProb[0];
  v12 = v10 * 100.0 + 0.0;
  if ( v11 < v12 )
  {
    v13 = v11 + this->m_dBonusProb[1];
    if ( v13 < v12 )
    {
      if ( v13 + this->m_dBonusProb[2] >= v12 )
        v9 = this->m_nBonusLevel[2];
    }
    else
    {
      v9 = this->m_nBonusLevel[1];
    }
  }
  else
  {
    v9 = this->m_nBonusLevel[0];
  }
  result = 1;
  if ( v9 < USER_NPC_LOG_QUEST_HUNT )
    v9 = USER_NPC_LOG_QUEST_HUNT;
  pSkillUser->m_EnchantBonusOptions[2] = v9;
  return result;
}
Спасибо огромное. Я так понимаю это взято с L2Server.exe? Тогда дополню вопрос, почему при установке p_lucky_enchant_rate;100;100;0 вещи так же ломаются после +3? В моем случае физ оружие, шанс на который должен быть 70% до +15. На всякий случай поднял параметр до p_lucky_enchant_rate;300;300;0, но не помогает.
ChatGPT пишет, что должно работать, но что то не то.
 
Спасибо огромное. Я так понимаю это взято с L2Server.exe? Тогда дополню вопрос, почему при установке p_lucky_enchant_rate;100;100;0 вещи так же ломаются после +3? В моем случае физ оружие, шанс на который должен быть 70% до +15. На всякий случай поднял параметр до p_lucky_enchant_rate;300;300;0, но не помогает.
ChatGPT пишет, что должно работать, но что то не то.
Я даже хз. Нет ПТС Глори рабочего, чтобы поковырять более въедливо. Вот я еще общая функция заточки итема, но тут нужно более детально вникать.


Код:
char __fastcall CItem::EnchantItem(
        CItem *this,
        CItem *pTargetItem,
        User *pUser,
        SkillFxChangeType bonusType,
        long double bonusValue,
        int nEnchantNumber)
{
  int CrystalizeCount; // ebx
  double EnchantSuccessRate; // xmm6_8
  CSharedItemData *m_data; // rax
  __int64 m_nEnchanted; // rsi
  bool v15; // r12
  double v16; // xmm10_8
  double v17; // xmm9_8
  double m_nMaxEnchantIncreaseRate; // xmm12_8
  bool v19; // bp
  double v20; // xmm8_8
  CItem *PendingUseETCItem; // rax
  CEnchantOptionDB *v22; // rbp
  int v23; // eax
  bool v24; // cc
  CItem_vtbl *v25; // rax
  int v26; // eax
  CSharedItemConstant *m_const; // rcx
  int m_Crystal; // eax
  int v29; // ecx
  double v30; // xmm6_8
  double v31; // xmm0_8
  double v32; // xmm0_8
  int v33; // ecx
  double v34; // xmm6_8
  double v35; // xmm0_8
  double v36; // xmm6_8
  double v37; // xmm0_8
  CItem *v38; // r15
  int v39; // r12d
  CUserSocket *v40; // rax
  EtcItemType m_EtcitemType; // ecx
  CSharedItemConstant *v42; // r8
  __int64 v43; // rcx
  int CrystalType; // esi
  CUserSocket *v45; // rax
  CUserSocket *v46; // rax
  int CrystalCount; // [rsp+30h] [rbp-198h]
  bool nEnchantProb; // [rsp+38h] [rbp-190h]
  int v49; // [rsp+40h] [rbp-188h]
  CItem *pSupportItem; // [rsp+48h] [rbp-180h]
  SkillFxChangeType m_EnchantType; // [rsp+50h] [rbp-178h]
  TshirtOptionType m_nEnchantOption; // [rsp+54h] [rbp-174h]
  int v53; // [rsp+58h] [rbp-170h]
  wchar_t _Buffer[100]; // [rsp+60h] [rbp-168h] BYREF
  bool bLuckEnchant; // [rsp+1D8h] [rbp+10h]

  CrystalizeCount = 0;
  if ( !pTargetItem || !pUser )
    return 0;
  EnchantSuccessRate = DOUBLE_30_0;
  m_nEnchantOption = pUser->m_SkillMod.m_nEnchantOption;
  m_EnchantType = pUser->m_SkillMod.m_EnchantType;
  m_data = pTargetItem->m_data;
  m_nEnchanted = m_data->m_nEnchanted;
  v15 = (m_data->m_Slot & 0x8000) != 0;
  v16 = (double)pUser->m_SkillMod.m_nWeaponEnchantRate / 100.0;
  v17 = (double)pUser->m_SkillMod.m_nArmorEnchantRate / 100.0;
  m_nMaxEnchantIncreaseRate = (double)pUser->m_SkillMod.m_nMaxEnchantIncreaseRate;
  v53 = -1;
  bLuckEnchant = User::EventByLuckyStat(pUser, 0);
  v49 = 0;
  v19 = bLuckEnchant;
  v20 = 0.0;
  PendingUseETCItem = User::GetPendingUseETCItem(pUser, PUIT_INC_ENCHANT_PROP);
  pSupportItem = PendingUseETCItem;
  if ( !bLuckEnchant )
  {
    if ( PendingUseETCItem )
    {
      v49 = pUser->m_EnchantBonusOptions[2];
      v53 = pUser->m_EnchantBonusOptions[1];
      v20 = (double)pUser->m_EnchantBonusOptions[0];
    }
    v22 = CEnchantOptionDB::Inst();
    v23 = pTargetItem->GetClassId(pTargetItem);
    v24 = (int)CEnchantOptionDB::GetMaxEnchantLevel(v22, v23) <= 0;
    v25 = pTargetItem->__vftable;
    if ( !v24 )
    {
      v26 = v25->GetClassId(pTargetItem);
      EnchantSuccessRate = (double)(int)CEnchantOptionDB::GetEnchantSuccessRate(v22, v26, m_nEnchanted);
      goto LABEL_42;
    }
    if ( v25->IsWeapon(pTargetItem) )
    {
      m_const = pTargetItem->m_const;
      m_Crystal = m_const->m_Crystal;
      if ( m_Crystal >= 2 && m_const->m_bIsMagicWeapon )
      {
        if ( (int)m_nEnchanted >= 3 )
        {
          if ( (unsigned int)(m_Crystal - 8) > 2 )
          {
            v30 = DOUBLE_49_0;
            if ( (int)m_nEnchanted >= 15 )
              v30 = DOUBLE_24_5;
          }
          else
          {
            v29 = m_nEnchanted;
            if ( (int)m_nEnchanted > 15 )
              v29 = 15;
            v30 = 1.0 / (double)((v29 + 3) / 3) * 100.0 / 1.4285;
          }
          EnchantSuccessRate = v30 + v20;
          if ( bonusType )
          {
            if ( bonusType != SFCT_DIFF )
              goto LABEL_24;
            v31 = bonusValue * 100.0 + EnchantSuccessRate;
          }
          else
          {
            v31 = (bonusValue / 100.0 + 1.0) * EnchantSuccessRate;
          }
          EnchantSuccessRate = v31;
LABEL_24:
          if ( m_EnchantType != SFCT_PER_DISTRICT || (unsigned int)m_nEnchantOption > WP )
            goto LABEL_42;
          v32 = fmin(EnchantSuccessRate * v16, m_nMaxEnchantIncreaseRate);
          goto LABEL_40;
        }
      }
      else if ( (int)m_nEnchanted >= 3 )
      {
        if ( (unsigned int)(m_Crystal - 8) > 2 )
        {
          v34 = DOUBLE_70_0;
          if ( (int)m_nEnchanted >= 15 )
            v34 = DOUBLE_35_0;
          EnchantSuccessRate = v34 + v20;
          if ( m_EnchantType == SFCT_PER_DISTRICT && (unsigned int)m_nEnchantOption <= WP )
            EnchantSuccessRate = EnchantSuccessRate + fmin(EnchantSuccessRate * v16, m_nMaxEnchantIncreaseRate);
        }
        else
        {
          v33 = m_nEnchanted;
          if ( (int)m_nEnchanted > 15 )
            v33 = 15;
          EnchantSuccessRate = 1.0 / (double)((v33 + 3) / 3) * 100.0 + v20;
        }
        if ( bonusType == SFCT_PER )
        {
          EnchantSuccessRate = EnchantSuccessRate * (bonusValue / 100.0 + 1.0);
          goto LABEL_42;
        }
        if ( bonusType != SFCT_DIFF )
        {
LABEL_42:
          v19 = EnchantSuccessRate >= genrand64_real1() * 100.0 + 0.0;
LABEL_63:
          v38 = pSupportItem;
          v39 = v49;
          goto LABEL_67;
        }
        v32 = bonusValue * 100.0;
LABEL_40:
        EnchantSuccessRate = EnchantSuccessRate + v32;
        goto LABEL_42;
      }
    }
    else if ( (int)m_nEnchanted >= 3 )
    {
      if ( (int)m_nEnchanted >= 20 )
      {
        v36 = 0.0;
      }
      else
      {
        if ( v15 )
          v35 = OnePieceEnchantFailTable[m_nEnchanted];
        else
          v35 = ArmorEnchantFailTable[m_nEnchanted];
        v36 = 100.0 - v35 * 100.0;
      }
      if ( (int)m_nEnchanted >= 15 )
        v36 = v36 * 0.5;
      EnchantSuccessRate = v36 + v20;
      if ( bonusType )
      {
        if ( bonusType == SFCT_DIFF )
          EnchantSuccessRate = EnchantSuccessRate + bonusValue * 100.0;
      }
      else
      {
        EnchantSuccessRate = EnchantSuccessRate * (bonusValue / 100.0 + 1.0);
      }
      if ( m_EnchantType == SFCT_PER_DISTRICT && (m_nEnchantOption & 0xFFFFFFFD) == 0 )
        EnchantSuccessRate = EnchantSuccessRate + fmin(EnchantSuccessRate * v17, m_nMaxEnchantIncreaseRate);
      v37 = genrand64_real1() * 100.0 + 0.0;
      if ( (int)m_nEnchanted >= 20 || (v19 = 1, EnchantSuccessRate < v37) )
        v19 = 0;
      goto LABEL_63;
    }
    v19 = 1;
    EnchantSuccessRate = DOUBLE_100_0;
    goto LABEL_63;
  }
  v38 = PendingUseETCItem;
  if ( PendingUseETCItem )
    v39 = pUser->m_EnchantBonusOptions[2];
  else
    v39 = 0;
LABEL_67:
  if ( g_L2ServerType == DEV && User::IsBuilder(pUser) )
  {
    _snwprintf_s<100>(
      (wchar_t (*)[100])_Buffer,
      0x63ui64,
      L"EnchantScrollItem [Prob:%d])",
      (unsigned int)(int)EnchantSuccessRate);
    v40 = pUser->GetSocket(pUser);
    v40->SendSystemMessage(v40, L"SYS", _Buffer);
  }
  if ( !v19 )
  {
    if ( v53 )
    {
      if ( v53 > 0 )
      {
        LODWORD(m_nEnchanted) = m_nEnchanted - v53;
        if ( (int)m_nEnchanted < 0 )
          LODWORD(m_nEnchanted) = 0;
        goto LABEL_74;
      }
      m_EtcitemType = this->m_const->m_EtcitemType;
      if ( (unsigned int)(m_EtcitemType - 21) > 1 && m_EtcitemType != EIT_BLESS_ENCHT_AG )
      {
        if ( (unsigned int)(m_EtcitemType - 32) > 1 && m_EtcitemType != EIT_ANCIENT_CRYSTAL_ENCHANT_AG )
        {
          v42 = pTargetItem->m_const;
          v43 = v42->m_Crystal;
          CrystalType = *((_DWORD *)&loc_87CD80 + v43 + 0x100000);
          if ( (unsigned int)(v43 - 1) <= 9 && v42->m_nCrystalCount > 0 )
            CrystalizeCount = CItem::GetCrystalizeCount(pTargetItem, 2);
          CDB::RequestEnchantItemFail(
            &db,
            this,
            v38,
            pTargetItem,
            pUser,
            CrystalType,
            CrystalizeCount,
            (int)EnchantSuccessRate);
          return 1;
        }
        v45 = pUser->GetSocket(pUser);
        CUserSocket::SendSystemMessage(v45, 6004);
        goto LABEL_74;
      }
      v46 = pUser->GetSocket(pUser);
      CUserSocket::SendSystemMessage(v46, 1517);
      nEnchantProb = bLuckEnchant;
      CrystalCount = (int)EnchantSuccessRate;
    }
    else
    {
      nEnchantProb = bLuckEnchant;
      CrystalCount = (int)EnchantSuccessRate;
    }
    CDB::RequestEnchantItem(&db, this, v38, pTargetItem, 0, pUser, CrystalCount, nEnchantProb);
    return 1;
  }
  LODWORD(m_nEnchanted) = nEnchantNumber + v39 + m_nEnchanted;
  if ( pTargetItem->IsArmor(pTargetItem) && (int)m_nEnchanted > 20 )
    LODWORD(m_nEnchanted) = 20;
LABEL_74:
  CDB::RequestEnchantItem(&db, this, v38, pTargetItem, m_nEnchanted, pUser, (int)EnchantSuccessRate, bLuckEnchant);
  return 1;
}

Код:
__int64 __fastcall CEnchantOptionDB::GetEnchantSuccessRate(CEnchantOptionDB *this, int itemClassId, int enchantLevel)
{
  std::_Tree_node<std::pair<int const ,CItemEnchantOption *>,void *> *Myhead; // rcx
  std::_Tree_node<std::pair<int const ,CItemEnchantOption *>,void *> *v6; // rax
  std::_Tree_node<std::pair<int const ,CItemEnchantOption *>,void *> *Parent; // rdx
  CItemEnchantOption *second; // rax

  if ( enchantLevel < 0 )
    return 0i64;
  Myhead = this->m_ItemEnchantOptionMap._Mypair._Myval2._Myval2._Myhead;
  v6 = Myhead;
  Parent = Myhead->_Parent;
  while ( !Parent->_Isnil )
  {
    if ( Parent->_Myval.first >= itemClassId )
    {
      v6 = Parent;
      Parent = Parent->_Left;
    }
    else
    {
      Parent = Parent->_Right;
    }
  }
  if ( v6 == Myhead || itemClassId < v6->_Myval.first )
    v6 = Myhead;
  if ( v6 == Myhead )
    return 0xFFFFFFFFi64;
  second = v6->_Myval.second;
  if ( enchantLevel >= second->m_EnchantSuccessInfo.echantMaxLevel )
    return 0xFFFFFFFFi64;
  else
    return (unsigned int)second->m_EnchantSuccessInfo.successRate[enchantLevel];
}
 
Aristo, Спасибо большое за ответы. Вы как волшебник, каждый раз даете подробный ответ :)
 
Я даже хз. Нет ПТС Глори рабочего, чтобы поковырять более въедливо. Вот я еще общая функция заточки итема, но тут нужно более детально вникать.
в классик2 прот. 166 такой скилл есть, и да, сделал 100,100 - ломается оружие
 
Назад
Сверху Снизу