Ruby Please help me

Join Discord

xoyovvvvy

LOMCN n00bie
Jan 19, 2016
4
0
12
QQ??20160121133422.png Please help me

---------- Post Merged at 05:38 AM ---------- Previous Post was at 05:37 AM ----------

Excuse me, there is a problem, thank you!
 
Last edited:

Ardbeg

Legend
Legendary
Aug 8, 2004
3,211
1
144
260
Southern England
It's failing to connect to your SQL database.
Make sure it's all up and running and that all setup files have accurate info for server name, password, IP, etc.

If all entries are correct, it could be a problem with field count in the item table.
The number of fields has changed over the years.
 
Last edited:
Upvote 0

xoyovvvvy

LOMCN n00bie
Jan 19, 2016
4
0
12
thank you

---------- Post Merged on 28-01-2016 at 09:11 AM ---------- Previous Post was on 21-01-2016 at 11:09 PM ----------

Server, 2012.SA SQL password is all right. Or the question. Not solve. consult
 
Upvote 0

Ardbeg

Legend
Legendary
Aug 8, 2004
3,211
1
144
260
Southern England
thank you

---------- Post Merged on 28-01-2016 at 09:11 AM ---------- Previous Post was on 21-01-2016 at 11:09 PM ----------

Server, 2012.SA SQL password is all right. Or the question. Not solve. consult

Not really sure what you're saying but if its connecting to the database, often people get this wrong.
Make sure your database name is in the format . .
YOURPCNAME-PC\SQLEXPRESS

If not, a few more screenshots or information about how far you're getting.
 
Upvote 0

xoyovvvvy

LOMCN n00bie
Jan 19, 2016
4
0
12
  1. procedure TMerchant.UpgradeWapon(User:TPlayObject); //004A0920
  2. procedure sub_4A0218(ItemList:TList;var btDc:Byte;var btSc:Byte;var btMc:Byte;var btDura:Byte);
  3. var
  4. I,II: Integer;
  5. DuraList:TList;
  6. UserItem:pTUserItem;
  7. StdItem:TItem;
  8. StdItem80:TStdItem;
  9. DelItemList:TStringList;
  10. nDc,nSc,nMc,nDcMin,nDcMax,nScMin,nScMax,nMcMin,nMcMax,nDura,nItemCount:Integer;
  11. begin
  12. nDcMin:=0;
  13. nDcMax:=0;
  14. nScMin:=0;
  15. nScMax:=0;
  16. nMcMin:=0;
  17. nMcMax:=0;
  18. nDura:=0;
  19. nItemCount:=0;
  20. DelItemList:=nil;
  21. DuraList:=TList.Create;
  22. for I := ItemList.Count - 1 downto 0 do begin
  23. UserItem:=ItemList.Items;
    [*] if UserEngine.GetStdItemName(UserItem.wIndex) = g_Config.sBlackStone then begin
    [*] DuraList.Add(Pointer(ROUND(UserItem.Dura / 1000 {1.0e3})));
    [*] if DelItemList = nil then DelItemList:=TStringList.Create;
    [*] DelItemList.AddObject(g_Config.sBlackStone,TObject(UserItem.MakeIndex));
    [*] DisPose(UserItem);
    [*] ItemList.Delete(I);
    [*] end else begin
    [*] if IsAccessory(UserItem.wIndex) then begin
    [*] StdItem:=UserEngine.GetStdItem(UserItem.wIndex);
    [*] if StdItem <> nil then begin
    [*] StdItem.GetStandardItem(StdItem80);
    [*] StdItem.GetItemAddValue(UserItem,StdItem80);
    [*] nDc:=0;
    [*] nSc:=0;
    [*] nMc:=0;
    [*] case StdItem80.StdMode of
    [*] 19,20,21: begin //004A0421
    [*] nDc:=HiWord(StdItem80.DC) + LoWord(StdItem80.DC);
    [*] nSc:=HiWord(StdItem80.SC) + LoWord(StdItem80.SC);
    [*] nMc:=HiWord(StdItem80.MC) + LoWord(StdItem80.MC);
    [*] end;
    [*] 22,23: begin //004A046E
    [*] nDc:=HiWord(StdItem80.DC) + LoWord(StdItem80.DC);
    [*] nSc:=HiWord(StdItem80.SC) + LoWord(StdItem80.SC);
    [*] nMc:=HiWord(StdItem80.MC) + LoWord(StdItem80.MC);
    [*] end;
    [*] 24,26: begin
    [*] nDc:=HiWord(StdItem80.DC) + LoWord(StdItem80.DC) + 1;
    [*] nSc:=HiWord(StdItem80.SC) + LoWord(StdItem80.SC) + 1;
    [*] nMc:=HiWord(StdItem80.MC) + LoWord(StdItem80.MC) + 1;
    [*] end;
    [*] end;
    [*] if nDcMin < nDc then begin
    [*] nDcMax:=nDcMin;
    [*] nDcMin:=nDc;
    [*] end else begin
    [*] if nDcMax < nDc then nDcMax:=nDc;
    [*] end;
    [*] if nScMin < nSc then begin
    [*] nScMax:=nScMin;
    [*] nScMin:=nSc;
    [*] end else begin
    [*] if nScMax < nSc then nScMax:=nSc;
    [*] end;
    [*] if nMcMin < nMc then begin
    [*] nMcMax:=nMcMin;
    [*] nMcMin:=nMc;
    [*] end else begin
    [*] if nMcMax < nMc then nMcMax:=nMc;
    [*] end;
    [*] if DelItemList = nil then DelItemList:=TStringList.Create;
    [*] DelItemList.AddObject(StdItem.Name,TObject(UserItem.MakeIndex));
    [*] //004A06DB
    [*] if StdItem.NeedIdentify = 1 then
    [*] AddGameDataLog('26' + #9 +
    [*] User.m_sMapName + #9 +
    [*] IntToStr(User.m_nCurrX) + #9 +
    [*] IntToStr(User.m_nCurrY) + #9 +
    [*] User.m_sCharName + #9 +
    [*] //UserEngine.GetStdItemName(UserItem.wIndex) + #9 +
    [*] StdItem.Name + #9 +
    [*] IntToStr(UserItem.MakeIndex) + #9 +
    [*] '1' + #9 +
    [*] '0');
    [*] DisPose(UserItem);
    [*] ItemList.Delete(I);
    [*] end;
    [*] end;
    [*] end;
    [*] end; // for
    [*] for I := 0 to DuraList.Count - 1 do begin
    [*] for II := DuraList.Count -1 downto i + 1 do begin
    [*] if Integer(DuraList.Items[II]) > Integer(DuraList.Items[II- 1]) then
    [*] DuraList.Exchange(II,II-1);
    [*] end; // for
    [*] end; // for
    [*] for I := 0 to DuraList.Count - 1 do begin
    [*] nDura:=nDura + Integer(DuraList.Items);
    [*] Inc(nItemCount);
    [*] if nItemCount >= 5 then break;
    [*] end;
    [*] btDura:=ROUND(_MIN(5,nItemCount) + _MIN(5,nItemCount) * ((nDura /nItemCount) / 5.0));
    [*] btDc:=nDcMin div 5 + nDcMax div 3;
    [*] btSc:=nScMin div 5 + nScMax div 3;
    [*] btMc:=nMcMin div 5 + nMcMax div 3;
    [*] if DelItemList <> nil then
    [*] User.SendMsg(Self,RM_SENDDELITEMLIST,0,Integer(DelItemList),0,0,'');
    [*]
    [*] if DuraList <> nil then DuraList.Free;
    [*]
    [*] end;
    [*]var
    [*] I: Integer;
    [*] bo0D:Boolean;
    [*] UpgradeInfo:pTUpgradeInfo;
    [*] StdItem:TItem;
    [*]begin
    [*] bo0D:=False;
    [*] for I := 0 to m_UpgradeWeaponList.Count - 1 do begin
    [*] UpgradeInfo:=m_UpgradeWeaponList.Items;
    [*] if UpgradeInfo.sUserName = User.m_sCharName then begin
    [*] GotoLable(User,sUPGRADEING,False);
    [*] exit;
    [*] end;
    [*] end;
    [*] if (User.m_UseItems[U_WEAPON].wIndex <> 0) and (User.m_nGold >= g_Config.nUpgradeWeaponPrice) and
    [*] (User.CheckItems(g_Config.sBlackStone) <> nil) then begin
    [*] User.DecGold(g_Config.nUpgradeWeaponPrice);
    [*]// if m_boCastle or g_Config.boGetAllNpcTax then UserCastle.IncRateGold(g_Config.nUpgradeWeaponPrice);
    [*] if m_boCastle or g_Config.boGetAllNpcTax then begin
    [*] if m_Castle <> nil then begin
    [*] TUserCastle(m_Castle).IncRateGold(g_Config.nUpgradeWeaponPrice);
    [*] end else
    [*] if g_Config.boGetAllNpcTax then begin
    [*] g_CastleManager.IncRateGold(g_Config.nUpgradeWeaponPrice);
    [*] end;
    [*] end;
    [*] User.GoldChanged();
    [*] New(UpgradeInfo);
    [*] UpgradeInfo.sUserName:=User.m_sCharName;
    [*] UpgradeInfo.UserItem:=User.m_UseItems[U_WEAPON];
    [*] StdItem:=UserEngine.GetStdItem(User.m_UseItems[U_WEAPON].wIndex);
    [*]
    [*] //004A0B2F
    [*] if StdItem.NeedIdentify = 1 then
    [*] AddGameDataLog('25' + #9 +
    [*] User.m_sMapName + #9 +
    [*] IntToStr(User.m_nCurrX) + #9 +
    [*] IntToStr(User.m_nCurrY) + #9 +
    [*] User.m_sCharName + #9 +
    [*] //UserEngine.GetStdItemName(User.m_UseItems[U_WEAPON].wIndex) + #9 +
    [*] StdItem.Name + #9 +
    [*] IntToStr(User.m_UseItems[U_WEAPON].MakeIndex) + #9 +
    [*] '1' + #9 +
    [*] '0');
    [*] User.SendDelItems(@User.m_UseItems[U_WEAPON]);
    [*] User.m_UseItems[U_WEAPON].wIndex:=0;
    [*] User.RecalcAbilitys();
    [*] User.FeatureChanged();
    [*] User.SendMsg(User,RM_ABILITY,0,0,0,0,'');
    [*] sub_4A0218(User.m_ItemList,UpgradeInfo.btDc,UpgradeInfo.btSc,UpgradeInfo.btMc,UpgradeInfo.btDura);
    [*] UpgradeInfo.dtTime:=Now();
    [*] UpgradeInfo.dwGetBackTick:=GetTickCount();
    [*] m_UpgradeWeaponList.Add(UpgradeInfo);
    [*] SaveUpgradingList();
    [*] bo0D:=True;
    [*] end;
    [*] if bo0D then GotoLable(User,sUPGRADEOK,False)
    [*] else GotoLable(User,sUPGRADEFAIL,False);
    [*]end;
    [*]procedure TMerchant.GetBackupgWeapon(User:TPlayObject); //004A0CB8
    [*]var
    [*] I: Integer;
    [*] UpgradeInfo:pTUpgradeInfo;
    [*] n10,n18,n1C,n90:Integer;
    [*] UserItem:pTUserItem;
    [*] StdItem:TItem;
    [*]begin
    [*] n18:=0;
    [*] UpgradeInfo:=nil;
    [*] if not User.IsEnoughBag then begin
    [*]// User.SysMsg('你的背包已经满了,无法再携带任何物品了!!!',0);
    [*] GotoLable(User,sGETBACKUPGFULL,False);
    [*] exit;
    [*] end;
    [*] for I := 0 to m_UpgradeWeaponList.Count - 1 do begin
    [*] if pTUpgradeInfo(m_UpgradeWeaponList.Items).sUserName = User.m_sCharName then begin
    [*] n18:=1;
    [*] if ((GetTickCount - pTUpgradeInfo(m_UpgradeWeaponList.Items).dwGetBackTick) > g_Config.dwUPgradeWeaponGetBackTime) or (User.m_btPermission >= 4) then begin
    [*] UpgradeInfo:=m_UpgradeWeaponList.Items;
    [*] m_UpgradeWeaponList.Delete(I);
    [*] SaveUpgradingList();
    [*] n18:=2;
    [*] break;
    [*] end;
    [*] end;
    [*] end;
    [*] //004A0DC2
    [*] if UpgradeInfo <> nil then begin
    [*] case UpgradeInfo.btDura of //
    [*] 0..8: begin //004A0DE5
    [*]// n14:=_MAX(3000,UpgradeInfo.UserItem.DuraMax shr 1);
    [*] if UpgradeInfo.UserItem.DuraMax > 3000 then begin
    [*] Dec(UpgradeInfo.UserItem.DuraMax,3000);
    [*] end else begin
    [*] UpgradeInfo.UserItem.DuraMax:=UpgradeInfo.UserItem.DuraMax shr 1;
    [*] end;
    [*] if UpgradeInfo.UserItem.Dura > UpgradeInfo.UserItem.DuraMax then
    [*] UpgradeInfo.UserItem.Dura:=UpgradeInfo.UserItem.DuraMax;
    [*] end;
    [*] 9..15: begin //004A0E41
    [*] if Random(UpgradeInfo.btDura) < 6 then begin
    [*] if UpgradeInfo.UserItem.DuraMax > 1000 then
    [*] Dec(UpgradeInfo.UserItem.DuraMax,1000);
    [*] if UpgradeInfo.UserItem.Dura > UpgradeInfo.UserItem.DuraMax then
    [*] UpgradeInfo.UserItem.Dura:=UpgradeInfo.UserItem.DuraMax;
    [*] end;
    [*]
    [*] end;
    [*] 18..255: begin
    [*] case Random(UpgradeInfo.btDura - 18) of
    [*] 1..4: Inc(UpgradeInfo.UserItem.DuraMax,1000);
    [*] 5..7: Inc(UpgradeInfo.UserItem.DuraMax,2000);
    [*] 8..255: Inc(UpgradeInfo.UserItem.DuraMax,4000)
    [*] end;
    [*] end;
    [*] end; // case
    [*] if (UpgradeInfo.btDc = UpgradeInfo.btMc) and (UpgradeInfo.btMc = UpgradeInfo.btSc) then begin
    [*] n1C:=Random(3);
    [*] end else begin
    [*] n1C:= -1;
    [*] end;
    [*] if ((UpgradeInfo.btDc >= UpgradeInfo.btMc) and (UpgradeInfo.btDc >= UpgradeInfo.btSc)) or
    [*] (n1C = 0) then begin
    [*] n90:=_MIN(11,UpgradeInfo.btDc);
    [*] n10:=_MIN(85,n90 shl 3 - n90 + 10 + UpgradeInfo.UserItem.btValue[3] - UpgradeInfo.UserItem.btValue[4] + User.m_nBodyLuckLevel);
    [*]// n10:=_MIN(85,n90 * 8 - n90 + 10 + UpgradeInfo.UserItem.btValue[3] - UpgradeInfo.UserItem.btValue[4] + User.m_nBodyLuckLevel);
    [*]
    [*] if Random(g_Config.nUpgradeWeaponDCRate) < n10 then begin//if Random(100) < n10 then begin
    [*] UpgradeInfo.UserItem.btValue[10]:=10;
    [*]
    [*] if (n10 > 63) and (Random(g_Config.nUpgradeWeaponDCTwoPointRate) = 0) then//if (n10 > 63) and (Random(30) = 0) then
    [*] UpgradeInfo.UserItem.btValue[10]:= 11;
    [*]
    [*] if (n10 > 79) and (Random(g_Config.nUpgradeWeaponDCThreePointRate) = 0) then//if (n10 > 79) and (Random(200) = 0) then
    [*] UpgradeInfo.UserItem.btValue[10]:= 12;
    [*] end else UpgradeInfo.UserItem.btValue[10]:=1; //004A0F89
    [*] end;


---------- Post Merged at 01:42 PM ---------- Previous Post was at 01:28 PM ----------

nDc := HiWord(StdItem80.DC) + LoWord(StdItem80.DC);
if nDcMin < nDc then begin
nDcMax := nDcMin;
nDcMin := nDc;
end else begin
if nDcMax < nDc then nDcMax := nDc;
btDc := nDcMin div 5 + nDcMax div 3;
n90 := _MIN(11, UpgradeInfo.btDc)

What does this mean? What formula to upgrade weapons +N90

---------- Post Merged at 01:47 PM ---------- Previous Post was at 01:42 PM ----------

Make sure your database name is in the format . .
me zhaofu-PC

---------- Post Merged at 01:49 PM ---------- Previous Post was at 01:47 PM ----------

Not really sure what you're saying but if its connecting to the database, often people get this wrong.
Make sure your database name is in the format . .
YOURPCNAME-PC\SQLEXPRESS

If not, a few more screenshots or information about how far you're getting.


me SQL 2012 ZHAOFU_PC SA PRG

---------- Post Merged at 01:56 PM ---------- Previous Post was at 01:49 PM ----------

What does it mean to ask the code
 
Upvote 0