Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Sicarii

Members
  • Posts

    131
  • Joined

  • Last visited

    Never

Everything posted by Sicarii

  1. Did you do the bit in Sub UseItem for each Select Case of equipment? (In your case specifically the weapon case)
  2. hmmm…i only added the code...i'll start googling
  3. there is always the option of yourself learning vb. Its not really that hard and there is tons of help through tutorials and knowledgeable members plus google.
  4. ok…so the text width of "Random Forest" = 96 pixels however the textout size along with textout giving the black shadow effect is 99 pixels. This is how I came up with a solution...as always I'm a beginner so there may be a better way. Client - modGameLogic - UpdateDrawMapName ``` DrawMapNameX = Camera.Right ``` Client - modText - (Declarations) Add this to bottom: ``` Private Declare Function GetTextExtentPoint32 Lib "gdi32" Alias "GetTextExtentPoint32" (ByVal hDC As Long, ByVal lpsz As String, ByVal cbString As Long, lpSize As SIZE) As Long Private Type SIZE x As Long y As Long End Type ``` Client - modText - Public Sub DrawText add: ``` Dim textSize As SIZE ``` after… ``` Call SetTextColor(hDC, 0) ``` …replace the rest of the call lines to this: ``` Call GetTextExtentPoint32(hDC, text, Len(Trim$(text)), textSize) If x = 512 Then Call TextOut(hDC, x - textSize.x, y + 1, text, Len(text)) Call SetTextColor(hDC, color) Call TextOut(hDC, x - (textSize.x + 1), y, text, Len(text)) Else Call TextOut(hDC, x + 1, y + 1, text, Len(text)) Call SetTextColor(hDC, color) Call TextOut(hDC, x, y, text, Len(text)) End If ```
  5. i spent last night working on this instead of my stackable items. You cant use the textwidth because the drawn text font is a different pixel size than normal plus you also have the shadow effect of the drawn text. Im reading on the gettextextentpoint32….i believe either this or something like it is needed to do what you want correctly. Oh well at least im learning a lot about textout.
  6. Just an idea….instead of checking inventory for a potion, you could make the popup ask something along the lines of Respawn or Wait. This would allow flexibility to not only use a potion but to also code in a resurrection spell.
  7. hmmm…I'm out of ideas as it works fine for me that way. Like I said, there will be one space of blankness there but regardless of map name the space is the same.
  8. i believe it is slightly different from your original post…you will have a space between last letter and map edge but regardless of map name the space is always calculated correctly and equal. Im no math expert but your original post is saying, for example 5 - 2 * 8 where as this says 5 - (2 * 8) which changes the result.
  9. ``` DrawMapNameX = Camera.Right - (Len(Trim$((Map.Name)))*8) ```
  10. **updated original post** Server - modGameLogic - Sub PlayerUnequipItem find: ``` GiveInvItem Index, GetPlayerEquipment(Index, EqSlot), 0 ``` replace that 0 with a 1 Server - modPlayer - Function FindOpenBankSlot replace this ``` If GetPlayerBankItemValue(Index, i) > 0 Then ``` with ``` If GetPlayerBankItemValue(Index, i) > 0 and GetPlayerBankItemNum(Index, i) = ItemNum Then ``` do the same thing (essentially) to FindOpenInvSlot Server - modPlayer - Sub UseItem under each case of equipment type (armor, weapon, helmet, shield) there are two lines where you need to replace a 0 with a 1…they are: ``` TakeInvItem Index, ItemNum, 0 ```and ``` GiveInvItem Index, tempItem, 0 ' give back the stored item ```
  11. looks more like a dagger than a sword
  12. what modifications have you done to the code?
  13. @Justn: no not as it is right now because I was stupid making this. I was so focused on trying to figure it out that I failed to do it with multiple item types. I believe it's just going to take an edit of the Find Next Inventory sections. @Ryoku: you may be right; I'm no expert in vb, I'm just starting out learning. It **is** more than just stackable items however, it has a limit. So you can't treat items just like currency…which would take a lot less code. This has to be able to handle an item stack of say 5 and you have 3 in your inventory and a player trade gives you 7 more for example.
  14. known issues: 1\. equip/unequip equipment 2\. multiple item types in inventory so dont bother using this yet i guess. I'll try getting these fixed up within a couple days.
  15. **known issues: 1\. Small fix needed for Shops to work correctly…should be updated 03/24/12** I don't know if there is a better way to do this but this does work. It was a major learning process. I've tried to debug as much as possible and I haven't been able to make anything screw up so figured I'd share it. This will allow you to have all items stack to a limit that you set. **FORM** **Client - frmEditor_Item - (View Object)** Add a label entitled "lblStackLimit" with a caption of "Stack Limit: 0" Add a horizontal scroll bar entitled "scrlStackLimit" with a Min of 0 and a Max of 25 (This is where you set the maximum amount) (Refer to attachment for form screenshot) **CLIENT** **Client - frmEditor_Item - Private Sub cmbType_Click** Below this… ``` If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub ``` …add this: ``` If cmbType.ListIndex ITEM_TYPE_CURRENCY Then frmEditor_Item.lblStackLimit.Visible = True frmEditor_Item.scrlStackLimit.Visible = True lblStackLimit.Caption = "Stack Limit: " & scrlStackLimit.Value End If ``` Below this… ``` If (cmbType.ListIndex = ITEM_TYPE_SPELL) Then fraSpell.Visible = True Else fraSpell.Visible = False End If ``` …add this: ``` If cmbType.ListIndex = ITEM_TYPE_CURRENCY Then frmEditor_Item.scrlStackLimit.Visible = False frmEditor_Item.lblStackLimit.Visible = False End If ``` **Client - frmEditor_Item - Private Sub scrlStackLimit_Change** ``` Private Sub scrlStackLimit_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub lblStackLimit.Caption = "Stack Limit: " & scrlStackLimit.Value Item(EditorIndex).StackLimit = scrlStackLimit.Value ' Error handler Exit Sub errorhandler: HandleError "scrlStackLimit_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub ``` **Client - frmEditor_Map - Private Sub scrlMapItem_Change** Replace this… ``` If Item(scrlMapItem.Value).Type = ITEM_TYPE_CURRENCY Then scrlMapItemValue.Enabled = True Else scrlMapItemValue.Value = 1 scrlMapItemValue.Enabled = False End If ``` …with this: ``` scrlMapItemValue.Enabled = True ``` **Client - frmMain - Private Sub lblCurrencyOK_Click** If you have applied the 'Currency menu overflow' fix: ``` If Val(txtCurrency.text) > GetPlayerInvItemValue(MyIndex, tmpCurrencyItem) Then txtCurrency.text = GetPlayerInvItemValue(MyIndex, tmpCurrencyItem) ``` You'll need to take it out. I just commented it out and planned on coming back to address the issue at a later date. **Client - frmMain - Private Sub picBank_DblClick** Replace this… ``` If Item(GetBankItemNum(bankNum)).Type = ITEM_TYPE_CURRENCY Then CurrencyMenu = 3 ' withdraw lblCurrency.Caption = "How many do you want to withdraw?" tmpCurrencyItem = bankNum txtCurrency.text = vbNullString picCurrency.Visible = True txtCurrency.SetFocus Exit Sub End If ``` …with this: ``` CurrencyMenu = 3 ' withdraw lblCurrency.Caption = "How many do you want to withdraw?" tmpCurrencyItem = bankNum txtCurrency.text = vbNullString picCurrency.Visible = True txtCurrency.SetFocus Exit Sub ``` **Client - frmMain - Private Sub picInventory_DblClick** Replace this… ``` If Item(GetPlayerInvItemNum(MyIndex, InvNum)).Type = ITEM_TYPE_CURRENCY Then CurrencyMenu = 2 ' deposit lblCurrency.Caption = "How many do you want to deposit?" tmpCurrencyItem = InvNum txtCurrency.text = vbNullString picCurrency.Visible = True txtCurrency.SetFocus Exit Sub End If ``` …with this: ``` CurrencyMenu = 2 ' deposit lblCurrency.Caption = "How many do you want to deposit?" tmpCurrencyItem = InvNum txtCurrency.text = vbNullString picCurrency.Visible = True txtCurrency.SetFocus Exit Sub ``` Replace this… ``` If Item(GetPlayerInvItemNum(MyIndex, TradeYourOffer(i).num)).Type = ITEM_TYPE_CURRENCY Then ' only exit out if we're offering all of it If TradeYourOffer(i).Value = GetPlayerInvItemValue(MyIndex, TradeYourOffer(i).num) Then Exit Sub End If Else Exit Sub End If ``` …with this: ``` If TradeYourOffer(i).Value = GetPlayerInvItemValue(MyIndex, TradeYourOffer(i).num) Then Exit Sub End If ``` Replace this… ``` If Item(GetPlayerInvItemNum(MyIndex, InvNum)).Type = ITEM_TYPE_CURRENCY Then CurrencyMenu = 4 ' offer in trade lblCurrency.Caption = "How many do you want to trade?" tmpCurrencyItem = InvNum txtCurrency.text = vbNullString picCurrency.Visible = True txtCurrency.SetFocus Exit Sub End If ``` …with this: ``` CurrencyMenu = 4 ' offer in trade lblCurrency.Caption = "How many do you want to trade?" tmpCurrencyItem = InvNum txtCurrency.text = vbNullString picCurrency.Visible = True txtCurrency.SetFocus Exit Sub ``` **Client - frmMain - Private Sub picInventory_MouseDown** Replace this… ``` If Item(GetPlayerInvItemNum(MyIndex, InvNum)).Type = ITEM_TYPE_CURRENCY Then If GetPlayerInvItemValue(MyIndex, InvNum) > 0 Then CurrencyMenu = 1 ' drop lblCurrency.Caption = "How many do you want to drop?" tmpCurrencyItem = InvNum txtCurrency.text = vbNullString picCurrency.Visible = True txtCurrency.SetFocus End If Else Call SendDropItem(InvNum, 0) End If ``` …with this: ``` If GetPlayerInvItemValue(MyIndex, InvNum) > 0 Then CurrencyMenu = 1 ' drop lblCurrency.Caption = "How many do you want to drop?" tmpCurrencyItem = InvNum txtCurrency.text = vbNullString picCurrency.Visible = True txtCurrency.SetFocus End If ``` **Client - frmMain - Private Sub picInventory_MouseMove** Replace this… ``` If Item(GetPlayerInvItemNum(MyIndex, TradeYourOffer(i).num)).Type = ITEM_TYPE_CURRENCY Then ' only exit out if we're offering all of it If TradeYourOffer(i).Value = GetPlayerInvItemValue(MyIndex, TradeYourOffer(i).num) Then Exit Sub End If Else Exit Sub End If ``` …with this: ``` If TradeYourOffer(i).Value = GetPlayerInvItemValue(MyIndex, TradeYourOffer(i).num) Then Exit Sub End If ``` **Client - frmMain - Private Sub scrlAItem_Change** Replace this… ``` If Item(scrlAItem.Value).Type = ITEM_TYPE_CURRENCY Then scrlAAmount.Enabled = True Exit Sub End If ``` …with this: ``` scrlAAmount.Enabled = True Exit Sub ``` **Client - modClientTCP - Public Sub SendDropItem** Replace this… ``` If Item(GetPlayerInvItemNum(MyIndex, InvNum)).Type = ITEM_TYPE_CURRENCY Then If Amount < 1 Or Amount > PlayerInv(InvNum).Value Then Exit Sub End If ``` …with this: ``` If Amount < 1 Or Amount > PlayerInv(InvNum).Value Then Exit Sub ``` **Client - modDirectDraw7 - Sub BltInventory** Replace this… ``` If Not Item(tmpItem).Type = ITEM_TYPE_CURRENCY Then ' normal item, exit out GoTo NextLoop Else ' if amount = all currency, remove from inventory If TradeYourOffer(x).Value = GetPlayerInvItemValue(MyIndex, i) Then GoTo NextLoop Else ' not all, change modifier to show change in currency count amountModifier = TradeYourOffer(x).Value End If End If ``` …with this: ``` If TradeYourOffer(x).Value = GetPlayerInvItemValue(MyIndex, i) Then GoTo NextLoop Else ' not all, change modifier to show change in currency count amountModifier = TradeYourOffer(x).Value End If ``` **Client - modGameEditors - Public Sub ItemEditorInit** Below this… ``` If (frmEditor_Item.cmbType.ListIndex = ITEM_TYPE_SPELL) Then frmEditor_Item.fraSpell.Visible = True frmEditor_Item.scrlSpell.Value = .Data1 Else frmEditor_Item.fraSpell.Visible = False End If ``` …add this: ``` If (frmEditor_Item.cmbType.ListIndex ITEM_TYPE_CURRENCY) Then frmEditor_Item.lblStackLimit.Visible = True frmEditor_Item.scrlStackLimit.Visible = True Else frmEditor_Item.scrlStackLimit.Visible = False frmEditor_Item.lblStackLimit.Visible = False End If ``` Below this… ``` frmEditor_Item.scrlRarity.Value = .Rarity ``` …add this: ``` frmEditor_Item.scrlStackLimit.Value = .StackLimit ``` **Client - modTypes - Private Type ItemRec** Below this… ``` instaCast as Byte ``` …add this ``` StackLimit As Long ``` **SERVER** **Server - modGameLogic - Sub PlayerUnequipItem** Replace this… ``` GiveInvItem Index, GetPlayerEquipment(Index, EqSlot), 0 ``` …with this: ``` GiveInvItem Index, GetPlayerEquipment(Index, EqSlot), 1 ``` **Server - modGameLogic - Sub SpawnMapItems** Replace this… ``` If Item(Map(mapNum).Tile(x, y).Data1).Type = ITEM_TYPE_CURRENCY And Map(mapNum).Tile(x, y).Data2 GetPlayerInvItemValue(Index, invNum) Then Exit Sub ``` **Server - modHandleData - Sub HandleTradeItem** Replace this… ``` If Item(itemnum).Type = ITEM_TYPE_CURRENCY Then ' check if already offering same currency item For i = 1 To MAX_INV If TempPlayer(index).TradeOffer(i).Num = invSlot Then ' add amount TempPlayer(index).TradeOffer(i).Value = TempPlayer(index).TradeOffer(i).Value + amount ' clamp to limits If TempPlayer(index).TradeOffer(i).Value > GetPlayerInvItemValue(index, invSlot) Then TempPlayer(index).TradeOffer(i).Value = GetPlayerInvItemValue(index, invSlot) End If ' cancel any trade agreement TempPlayer(index).AcceptTrade = False TempPlayer(TempPlayer(index).InTrade).AcceptTrade = False SendTradeStatus index, 0 SendTradeStatus TempPlayer(index).InTrade, 0 SendTradeUpdate index, 0 SendTradeUpdate TempPlayer(index).InTrade, 1 ' exit early Exit Sub End If Next Else ' make sure they're not already offering it For i = 1 To MAX_INV If TempPlayer(index).TradeOffer(i).Num = invSlot Then PlayerMsg index, "You've already offered this item.", BrightRed Exit Sub End If Next End If ``` …with this: ``` For i = 1 To MAX_INV If TempPlayer(Index).TradeOffer(i).Num = invSlot Then ' add amount TempPlayer(Index).TradeOffer(i).Value = TempPlayer(Index).TradeOffer(i).Value + amount ' clamp to limits If TempPlayer(Index).TradeOffer(i).Value > GetPlayerInvItemValue(Index, invSlot) Then TempPlayer(Index).TradeOffer(i).Value = GetPlayerInvItemValue(Index, invSlot) End If ' cancel any trade agreement TempPlayer(Index).AcceptTrade = False TempPlayer(TempPlayer(Index).InTrade).AcceptTrade = False SendTradeStatus Index, 0 SendTradeStatus TempPlayer(Index).InTrade, 0 SendTradeUpdate Index, 0 SendTradeUpdate TempPlayer(Index).InTrade, 1 ' exit early Exit Sub End If Next ``` **Server - modPlayer - Function FindOpenBankSlot** Replace this… ``` For i = 1 To MAX_BANK If GetPlayerBankItemNum(index, i) = itemnum Then FindOpenBankSlot = i Exit Function End If Next i ``` …with this: ``` If Item(ItemNum).Type = ITEM_TYPE_CURRENCY Then For i = 1 To MAX_BANK If GetPlayerBankItemNum(Index, i) = ItemNum Then FindOpenBankSlot = i Exit Function End If Next End If For i = 1 To MAX_BANK If Item(ItemNum).Type ITEM_TYPE_CURRENCY Then If GetPlayerBankItemValue(Index, i) > 0 And GetPlayerBankItemNum(Index, i) = ItemNum Then If GetPlayerBankItemValue(Index, i) < Item(GetPlayerBankItemNum(Index, i)).StackLimit Then FindOpenBankSlot = i Exit Function End If End If End If Next ``` **Server - modPlayer - Function FindOpenInvSlot** After this… ``` If Item(itemnum).Type = ITEM_TYPE_CURRENCY Then ' If currency then check to see if they already have an instance of the item and add it to that For i = 1 To MAX_INV If GetPlayerInvItemNum(index, i) = itemnum Then FindOpenInvSlot = i Exit Function End If Next End If ``` …insert this: ``` For i = 1 To MAX_INV If Item(ItemNum).Type ITEM_TYPE_CURRENCY Then If GetPlayerInvItemValue(Index, i) > 0 And GetPlayerInvItemNum(Index, i) = ItemNum Then If GetPlayerInvItemValue(Index, i) < Item(GetPlayerInvItemNum(Index, i)).StackLimit Then FindOpenInvSlot = i Exit Function End If End If End If Next ``` **Server - modPlayer - Sub GiveBankItem** Replace this… ``` BankSlot = FindOpenBankSlot(index, GetPlayerInvItemNum(index, invSlot)) If BankSlot > 0 Then If Item(GetPlayerInvItemNum(index, invSlot)).Type = ITEM_TYPE_CURRENCY Then If GetPlayerBankItemNum(index, BankSlot) = GetPlayerInvItemNum(index, invSlot) Then Call SetPlayerBankItemValue(index, BankSlot, GetPlayerBankItemValue(index, BankSlot) + amount) Call TakeInvItem(index, GetPlayerInvItemNum(index, invSlot), amount) Else Call SetPlayerBankItemNum(index, BankSlot, GetPlayerInvItemNum(index, invSlot)) Call SetPlayerBankItemValue(index, BankSlot, amount) Call TakeInvItem(index, GetPlayerInvItemNum(index, invSlot), amount) End If Else If GetPlayerBankItemNum(index, BankSlot) = GetPlayerInvItemNum(index, invSlot) Then Call SetPlayerBankItemValue(index, BankSlot, GetPlayerBankItemValue(index, BankSlot) + 1) Call TakeInvItem(index, GetPlayerInvItemNum(index, invSlot), 0) Else Call SetPlayerBankItemNum(index, BankSlot, GetPlayerInvItemNum(index, invSlot)) Call SetPlayerBankItemValue(index, BankSlot, 1) Call TakeInvItem(index, GetPlayerInvItemNum(index, invSlot), 0) End If End If End If ``` …with this: ``` FindAnotherGiveBankItemSlot: BankSlot = FindOpenBankSlot(Index, GetPlayerInvItemNum(Index, invSlot)) If BankSlot > 0 Then If Item(GetPlayerInvItemNum(Index, invSlot)).Type = ITEM_TYPE_CURRENCY Then If GetPlayerBankItemNum(Index, BankSlot) = GetPlayerInvItemNum(Index, invSlot) Then Call SetPlayerBankItemValue(Index, BankSlot, GetPlayerBankItemValue(Index, BankSlot) + amount) Call TakeInvItem(Index, GetPlayerInvItemNum(Index, invSlot), amount) Else Call SetPlayerBankItemNum(Index, BankSlot, GetPlayerInvItemNum(Index, invSlot)) Call SetPlayerBankItemValue(Index, BankSlot, amount) Call TakeInvItem(Index, GetPlayerInvItemNum(Index, invSlot), amount) End If Else If Item(GetPlayerInvItemNum(Index, invSlot)).Type ITEM_TYPE_CURRENCY Then If GetPlayerBankItemValue(Index, BankSlot) >= 1 Then If amount + GetPlayerBankItemValue(Index, BankSlot) Item(GetPlayerInvItemNum(Index, invSlot)).StackLimit Then amount = amount - (Item(GetPlayerInvItemNum(Index, invSlot)).StackLimit - GetPlayerBankItemValue(Index, BankSlot)) Call SetPlayerInvItemValue(Index, invSlot, GetPlayerInvItemValue(Index, invSlot) - (Item(GetPlayerInvItemNum(Index, invSlot)).StackLimit - GetPlayerBankItemValue(Index, BankSlot))) Call SendInventoryUpdate(Index, invSlot) Call SetPlayerBankItemValue(Index, BankSlot, Item(GetPlayerInvItemNum(Index, invSlot)).StackLimit) GoTo FindAnotherGiveBankItemSlot End If End If Else If GetPlayerBankItemValue(Index, BankSlot) = 0 Then If amount = 1 Then ItemVal = ItemVal - 1 Call SetPlayerInvItemNum(Index, i, ItemNum) Call SetPlayerInvItemValue(Index, i, GetPlayerInvItemValue(Index, i) + 1) If sendUpdate Then Call SendInventoryUpdate(Index, i) GiveInvItem = True GoTo FindAnotherGiveInvItemSlot Else Call SetPlayerInvItemNum(Index, i, ItemNum) Call SetPlayerInvItemValue(Index, i, GetPlayerInvItemValue(Index, i) + ItemVal) If sendUpdate Then Call SendInventoryUpdate(Index, i) GiveInvItem = True End If Else If GetPlayerInvItemValue(Index, i) > 0 Then If GetPlayerInvItemValue(Index, i) + ItemVal Item(GetPlayerInvItemNum(Index, i)).StackLimit Then ItemVal = ItemVal - (Item(GetPlayerInvItemNum(Index, i)).StackLimit - GetPlayerInvItemValue(Index, i)) Call SetPlayerInvItemNum(Index, i, ItemNum) Call SetPlayerInvItemValue(Index, i, Item(GetPlayerInvItemNum(Index, i)).StackLimit) If sendUpdate Then Call SendInventoryUpdate(Index, i) GiveInvItem = True GoTo FindAnotherGiveInvItemSlot End If End If End If End If Else Call PlayerMsg(Index, "Your inventory is full.", BrightRed) GiveInvItem = False End If ``` **Server - modPlayer - Function HasItem** Replace this… ``` If Item(itemnum).Type = ITEM_TYPE_CURRENCY Then HasItem = GetPlayerInvItemValue(index, i) Else HasItem = 1 End If ``` …with this: ``` HasItem = GetPlayerInvItemValue(Index, i) ``` **Server - modPlayer - Sub PlayerMapDropItem** Replace this… ``` If Item(GetPlayerInvItemNum(index, invNum)).Type = ITEM_TYPE_CURRENCY Then ' Check if its more then they have and if so drop it all If amount >= GetPlayerInvItemValue(index, invNum) Then MapItem(GetPlayerMap(index), i).Value = GetPlayerInvItemValue(index, invNum) Call MapMsg(GetPlayerMap(index), GetPlayerName(index) & " drops " & GetPlayerInvItemValue(index, invNum) & " " & Trim$(Item(GetPlayerInvItemNum(index, invNum)).Name) & ".", Yellow) Call SetPlayerInvItemNum(index, invNum, 0) Call SetPlayerInvItemValue(index, invNum, 0) Else MapItem(GetPlayerMap(index), i).Value = amount Call MapMsg(GetPlayerMap(index), GetPlayerName(index) & " drops " & amount & " " & Trim$(Item(GetPlayerInvItemNum(index, invNum)).Name) & ".", Yellow) Call SetPlayerInvItemValue(index, invNum, GetPlayerInvItemValue(index, invNum) - amount) End If Else ' Its not a currency object so this is easy MapItem(GetPlayerMap(index), i).Value = 0 ' send message Call MapMsg(GetPlayerMap(index), GetPlayerName(index) & " drops " & CheckGrammar(Trim$(Item(GetPlayerInvItemNum(index, invNum)).Name)) & ".", Yellow) Call SetPlayerInvItemNum(index, invNum, 0) Call SetPlayerInvItemValue(index, invNum, 0) End If ``` …with this: ``` If amount >= GetPlayerInvItemValue(Index, invNum) Then MapItem(GetPlayerMap(Index), i).Value = GetPlayerInvItemValue(Index, invNum) Call MapMsg(GetPlayerMap(Index), GetPlayerName(Index) & " drops " & GetPlayerInvItemValue(Index, invNum) & " " & Trim$(Item(GetPlayerInvItemNum(Index, invNum)).Name) & ".", Yellow) Call SetPlayerInvItemNum(Index, invNum, 0) Call SetPlayerInvItemValue(Index, invNum, 0) Else MapItem(GetPlayerMap(Index), i).Value = amount Call MapMsg(GetPlayerMap(Index), GetPlayerName(Index) & " drops " & amount & " " & Trim$(Item(GetPlayerInvItemNum(Index, invNum)).Name) & ".", Yellow) Call SetPlayerInvItemValue(Index, invNum, GetPlayerInvItemValue(Index, invNum) - amount) End If ``` **Server - modPlayer - Sub PlayerMapGetItem** Below this… ``` If (MapItem(mapNum, i).y = GetPlayerY(index)) Then ``` …add this: ``` FindAnotherPlayerMapGetItemSlot: ``` Replace this… ``` If Item(GetPlayerInvItemNum(index, n)).Type = ITEM_TYPE_CURRENCY Then Call SetPlayerInvItemValue(index, n, GetPlayerInvItemValue(index, n) + MapItem(mapNum, i).Value) Msg = MapItem(mapNum, i).Value & " " & Trim$(Item(GetPlayerInvItemNum(index, n)).Name) Else Call SetPlayerInvItemValue(index, n, 0) Msg = Trim$(Item(GetPlayerInvItemNum(index, n)).Name) End If ``` …with this: ``` If Item(GetPlayerInvItemNum(Index, n)).Type = ITEM_TYPE_CURRENCY Then Call SetPlayerInvItemValue(Index, n, GetPlayerInvItemValue(Index, n) + MapItem(mapNum, i).Value) Msg = MapItem(mapNum, i).Value & " " & Trim$(Item(GetPlayerInvItemNum(Index, n)).Name) End If If Item(GetPlayerInvItemNum(Index, n)).Type ITEM_TYPE_CURRENCY Then If GetPlayerInvItemValue(Index, n) + MapItem(mapNum, i).Value Item(GetPlayerInvItemNum(Index, n)).StackLimit Then MapItem(mapNum, i).Value = MapItem(mapNum, i).Value - (Item(GetPlayerInvItemNum(Index, n)).StackLimit - GetPlayerInvItemValue(Index, n)) Call SetPlayerInvItemValue(Index, n, GetPlayerInvItemValue(Index, n) + (Item(GetPlayerInvItemNum(Index, n)).StackLimit - GetPlayerInvItemValue(Index, n))) Call SendInventoryUpdate(Index, n) GoTo FindAnotherPlayerMapGetItemSlot End If End If End If ``` **Server - modPlayer - Sub TakeBankItem** Replace this… ``` invSlot = FindOpenInvSlot(index, GetPlayerBankItemNum(index, BankSlot)) If invSlot > 0 Then If Item(GetPlayerBankItemNum(index, BankSlot)).Type = ITEM_TYPE_CURRENCY Then Call GiveInvItem(index, GetPlayerBankItemNum(index, BankSlot), amount) Call SetPlayerBankItemValue(index, BankSlot, GetPlayerBankItemValue(index, BankSlot) - amount) If GetPlayerBankItemValue(index, BankSlot) 1 Then Call GiveInvItem(index, GetPlayerBankItemNum(index, BankSlot), 0) Call SetPlayerBankItemValue(index, BankSlot, GetPlayerBankItemValue(index, BankSlot) - 1) Else Call GiveInvItem(index, GetPlayerBankItemNum(index, BankSlot), 0) Call SetPlayerBankItemNum(index, BankSlot, 0) Call SetPlayerBankItemValue(index, BankSlot, 0) End If End If End If ``` …with this: ``` FindAnotherTakeBankItemSlot: invSlot = FindOpenInvSlot(Index, GetPlayerBankItemNum(Index, BankSlot)) If invSlot > 0 Then If Item(GetPlayerBankItemNum(Index, BankSlot)).Type = ITEM_TYPE_CURRENCY Then Call GiveInvItem(Index, GetPlayerBankItemNum(Index, BankSlot), amount) Call SetPlayerBankItemValue(Index, BankSlot, GetPlayerBankItemValue(Index, BankSlot) - amount) If GetPlayerBankItemValue(Index, BankSlot) = 1 Then If amount + GetPlayerInvItemValue(Index, invSlot) GetPlayerInvItemValue(Index, invSlot) Then Exit Function End If ' Check to see if the player has the item If invSlot > 0 Then If ItemVal >= GetPlayerInvItemValue(Index, invSlot) Then TakeInvItem = True Else Call SetPlayerInvItemValue(Index, invSlot, GetPlayerInvItemValue(Index, invSlot) - ItemVal) Call SendInventoryUpdate(Index, invSlot) End If If TakeInvItem Then Call SetPlayerInvItemNum(Index, invSlot, 0) Call SetPlayerInvItemValue(Index, invSlot, 0) ' Send the inventory update Call SendInventoryUpdate(Index, invSlot) Exit Function End If End If End Function ``` **Server - modPlayer - TakeInvSlot** Replace this… ``` If Item(itemnum).Type = ITEM_TYPE_CURRENCY Then ' Is what we are trying to take away more then what they have? If so just set it to zero If ItemVal >= GetPlayerInvItemValue(index, invSlot) Then TakeInvSlot = True Else Call SetPlayerInvItemValue(index, invSlot, GetPlayerInvItemValue(index, invSlot) - ItemVal) End If Else TakeInvSlot = True End If ``` …with this: ``` If ItemVal >= GetPlayerInvItemValue(Index, invSlot) Then TakeInvSlot = True Else Call SetPlayerInvItemValue(Index, invSlot, GetPlayerInvItemValue(Index, invSlot) - ItemVal) End If ``` **Server - modPlayer - Public Sub UseItem** Replace this… ``` Call TakeInvItem(index, Player(index).Inv(invNum).Num, 0) ``` …with this: ``` Call TakeInvItem(Index, invNum, 1) ``` For each case of equipment type (Armor, Weapon, Helmet, Shield) Replace this… ``` TakeInvItem Index, ItemNum, 0 If tempItem > 0 Then GiveInvItem Index, tempItem, 0 ' give back the stored item tempItem = 0 End If ``` …with this: ``` TakeInvItem Index, invNum, 1 If tempItem > 0 Then GiveInvItem Index, tempItem, 1 ' give back the stored item tempItem = 0 End If ``` **Server - modServerTCP - Sub SendTradeUpdate** Replace this… ``` If Item(TempPlayer(index).TradeOffer(i).Num).Type = ITEM_TYPE_CURRENCY Then totalWorth = totalWorth + (Item(GetPlayerInvItemNum(index, TempPlayer(index).TradeOffer(i).Num)).price * TempPlayer(index).TradeOffer(i).Value) Else totalWorth = totalWorth + Item(GetPlayerInvItemNum(index, TempPlayer(index).TradeOffer(i).Num)).price End If ``` …with this: ``` totalWorth = totalWorth + (Item(GetPlayerInvItemNum(Index, TempPlayer(Index).TradeOffer(i).Num)).price * TempPlayer(Index).TradeOffer(i).Value) ``` **Server - modTypes - Private Type ItemRec** Below this… ``` instaCast As Byte ``` …add this: ``` StackLimit As Long ```
  16. but not when there are spaces in map name…you could do an if spaces in name then make it be x else be the 8
  17. maybe try changing the static 8 to a different number?
  18. im a beginner but one way… ``` For i = 1 To Len(Map.Name) If Mid$(text, i, 1) = " " Then count = count + 1 Next ``` ``` DrawMapNameX = Camera.Right - (Len(MapName)-count) * 8 ``` just off top of my head….edit nvm that would prob just cut off the se in base...ill shut up now since im on my phone and not at a pc sorry
  19. ahhh…so it looks like the extra space is exactly two spaces....the amount of spaces inbetween words in your map title. Id bet if you made it mitserayarmybase (all one word) itd look fine...if so then you need to code to accomodate spaces within title
  20. i wont be in front of vb until tonight but doesnt it have to do with the DrawMapNameX bit (remove the '-100')? Edit: err with frmMain.Picture1.Visible being false/true…hence making the change.
  21. nes - contra, metroid, river city ransom commodore 64 - gunship, jetboot jack dos - quest for glory, space quest, police quest, kings quest, gabrial knight, legend of kyrandia arcade - zookeeper atari - combat, frogger, pitfall, mousetrap (believe was on coleco vision) and probably more ive forgotten
  22. Sicarii

    Agility

    maybe this can help you with balancing stats? www.touchofdeathforums.com/smf/index.php/topic,73201.0/nowap.html
×
×
  • Create New...