ko4life-net / ko

Open source development of the game Knight Online. This is a reversed engineered old version of the game aiming to replicate the nostalgic experience we all once had <3
MIT License
52 stars 21 forks source link

"Reduced" item stat check and hover over details needs to be implemented #177

Open srmeier opened 1 year ago

srmeier commented 1 year ago

Description

Currently the reduce amounts for KO items is not implemented. For the moment we are filling these reduce quantities with empty strings when the player hovers over an item (see PR #175).

Screenshots

image

Files

Tasks

We need to recreate the check they have here:

      ::_LoadStringFromResource(4538, &szStr);  // Required Dexterity : %d %s
      if ( CUIImageTooltipDlg::SetTooltipTextColor(
             v111[26],
             (unsigned __int8)spItem->pItemBasic->byNeedDexterity + spItem->pItemExt->siNeedDexterity) )
      {
        CN3UIString::SetColor((_DWORD *)this->m_pStr[iIndex], this->m_CWhite);
      }
      else
      {
        CN3UIString::SetColor((_DWORD *)this->m_pStr[iIndex], this->m_CRed);
      }
      v126 = spItem->pItemExt;
      v127 = v126->byMagicOrRare;
      if ( v127 == 4 || v127 == 5 )
      {
        if ( v126->siNeedStrength < 0
          || v126->siNeedStamina < 0
          || v126->siNeedDexterity < 0
          || SLOWORD(v126->siNeedInteli) < 0
          || v126->siNeedInteli < 0 )
        {
          std::string::ctor(v271, &v264);
          LOBYTE(v281) = 13;
          ::_LoadStringFromResource(4554, v271);// (Reduce)
          szReduce = exception::what((exception *)v271);
          iRequiredDex_1 = (unsigned __int8)spItem->pItemBasic->byNeedDexterity + spItem->pItemExt->siNeedDexterity;
          szFmtStr = exception::what((exception *)&szStr);
          sprintf(szBuff, szFmtStr, iRequiredDex_1, szReduce);
          LOBYTE(v281) = 1;
          v129 = v271;
        }
        else
        {
          str::string::equalOperator(v270, &EmptyString, &v264);
          LOBYTE(v281) = 14;
          szEmptyStr = exception::what((exception *)v270);
          iRequiredDex = (unsigned __int8)spItem->pItemBasic->byNeedDexterity + spItem->pItemExt->siNeedDexterity;
          szFmtStr_1 = exception::what((exception *)&szStr);
          sprintf(szBuff, szFmtStr_1, iRequiredDex, szEmptyStr);
          LOBYTE(v281) = 1;
          v129 = v270;
        }
stevewgr commented 1 year ago

Nice! Thanks for creating this one. It's also worth mentioning that this is somewhat related to Anvil and items upgrading in general. In the official client there is a scroll called Reduce something that one can use to upgrade in order to reduce the item level requirements. Similarly with Unique Items, before one can upgrade a unique item, Elemental Scroll is required to be used to get it from no level to +1: image

The checks there simply check if the siNeed* variables are less than zero, and if they do, if it's true, then append (Reudce) to item level require tooltip.