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

[EO] Finishing Skill System


Matt
 Share

Recommended Posts

This finishing skill system merges with the shop system. By following this tutorial, you will have five finishing skills in your game. These skills will be Smithing, Cooking, Fletching, and Crafting. This has only been tested on 2.0\. I apologize if the explanation at the end is a bit confusing.

Lets get started!

First off, _**MAKE A BACKUP OF YOUR ENGINE**_

Download this and put it into your \gui\main folder

[http://www.freemmorp…79e0f943128.jpg](http://www.freemmorpgmaker.com/files/imagehost/pics/ba076be40b65b5d37157679e0f943128.jpg)

Now lets go to the server. Go to modTypes and look for Private Type PlayerRec. At the bottom of the rec, put there this.

```

SmithingXP As Long

CookingXP As Long

FletchingXP As Long

CraftingXP As Long

```

Now lets go to Private Type ItemRec. At the bottom of the rec, put there this.

```

SmXP As Long

CoXP As Long

FlXP As Long

CrXP As Long

SmRew As Long

CoRew As Long

FlRew As Long

CrRew As Long

```

Now lets go to Private Type ShopRec. At the bottom of the rec, put there this.

```

ShopType As Byte

```

Look for```

Function GetPlayerAccess(ByVal index As Long) As Long

```

and above it put there this

```

Function GetPlayerSmithingXP(ByVal index As Long) As Long

If index > MAX_PLAYERS Then Exit Function

GetPlayerSmithingXP = Player(index).SmithingXP

End Function

Function GetPlayerCookingXP(ByVal index As Long) As Long

If index > MAX_PLAYERS Then Exit Function

GetPlayerCookingXP = Player(index).CookingXP

End Function

Function GetPlayerFletchingXP(ByVal index As Long) As Long

If index > MAX_PLAYERS Then Exit Function

GetPlayerFletchingXP = Player(index).FletchingXP

End Function

Function GetPlayerCraftingXP(ByVal index As Long) As Long

If index > MAX_PLAYERS Then Exit Function

GetPlayerCraftingXP = Player(index).CraftingXP

End Function

```

Now look for this```

Player(index).Level = 1

```Underneath it put there this

```

Player(index).SmithingXP = 1

Player(index).CookingXP = 1

Player(index).FletchingXP = 1

Player(index).CraftingXP = 1

```

Now look for this```

Buffer.WriteLong GetPlayerPK(index)

```

Underneath it put there this```

Buffer.WriteLong GetPlayerSmithingXP(index)

Buffer.WriteLong GetPlayerCookingXP(index)

Buffer.WriteLong GetPlayerFletchingXP(index)

Buffer.WriteLong GetPlayerCraftingXP(index)

```

Now look for this sub

```

Sub HandleBuyItem(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)

```

In this sub should be code that looks like this

```

With Shop(shopNum).TradeItem(shopslot)

' check trade exists

If .Item < 1 Then Exit Sub

' check has the cost item

itemamount = HasItem(index, .costitem)

If itemamount = 0 Or itemamount < .costvalue Then

PlayerMsg index, "You do not have enough to purchase this item.", BrightRed

Exit Sub

End If

' it's fine, let's go ahead

TakeInvItem index, .costitem, .costvalue

GiveInvItem index, .Item, .ItemValue

End With

```

Replace that with this

```

With Shop(shopNum).TradeItem(shopslot)

' check trade exists

If .Item < 1 Then Exit Sub

' check has the cost item

itemamount = HasItem(index, .costitem)

If itemamount = 0 Or itemamount < .costvalue Then

' finishing skill

If Shop(shopNum).ShopType = 0 Then

PlayerMsg index, "You do not have enough to purchase this item.", BrightRed

Else

PlayerMsg index, "You do not have enough to make this item.", BrightRed

End If

Exit Sub

End If

' finishing skill

If Shop(shopNum).ShopType > 0 Then

If Item(Shop(shopNum).TradeItem(shopslot).Item).SmXP > Player(index).SmithingXP Then

PlayerMsg index, "You need " & Item(Shop(shopNum).TradeItem(shopslot).Item).SmXP - Player(index).SmithingXP & " more smithing experience to make this item.", BrightRed

Exit Sub

End If

If Item(Shop(shopNum).TradeItem(shopslot).Item).CoXP > Player(index).CookingXP Then

PlayerMsg index, "You need " & Item(Shop(shopNum).TradeItem(shopslot).Item).CoXP - Player(index).CookingXP & " more cooking experience to make this item.", BrightRed

Exit Sub

End If

If Item(Shop(shopNum).TradeItem(shopslot).Item).FlXP > Player(index).FletchingXP Then

PlayerMsg index, "You need " & Item(Shop(shopNum).TradeItem(shopslot).Item).FlXP - Player(index).FletchingXP & " more fletching experience to make this item.", BrightRed

Exit Sub

End If

If Item(Shop(shopNum).TradeItem(shopslot).Item).CrXP > Player(index).CraftingXP Then

PlayerMsg index, "You need " & Item(Shop(shopNum).TradeItem(shopslot).Item).CoXP - Player(index).CraftingXP & " more crafting experience to make this item.", BrightRed

Exit Sub

End If

If Item(Shop(shopNum).TradeItem(shopslot).Item).SmRew > 0 Then

Player(index).SmithingXP = Player(index).SmithingXP + Item(Shop(shopNum).TradeItem(shopslot).Item).SmRew

End If

If Item(Shop(shopNum).TradeItem(shopslot).Item).CoRew > 0 Then

Player(index).CookingXP = Player(index).CookingXP + Item(Shop(shopNum).TradeItem(shopslot).Item).CoRew

End If

If Item(Shop(shopNum).TradeItem(shopslot).Item).FlRew > 0 Then

Player(index).FletchingXP = Player(index).FletchingXP + Item(Shop(shopNum).TradeItem(shopslot).Item).FlRew

End If

If Item(Shop(shopNum).TradeItem(shopslot).Item).CrRew > 0 Then

Player(index).CraftingXP = Player(index).CraftingXP + Item(Shop(shopNum).TradeItem(shopslot).Item).CrRew

End If

SendPlayerData (index)

End If

TakeInvItem index, .costitem, .costvalue

GiveInvItem index, .Item, .ItemValue

end with

```

At the bottom of the same sub should be this```

' send confirmation message & reset their shop action

PlayerMsg index, "Trade successful.", BrightGreen

```

Replace that with this.

```

If Shop(shopNum).ShopType = 0 Then

' send confirmation message & reset their shop action

PlayerMsg index, "Trade successful.", BrightGreen

Else

PlayerMsg index, "Item made.", BrightGreen

End If

```

I believe that should be it, so save and compile.

Now to the client!

Go to modTypes and look for Private Type PlayerRec. At the bottom of the rec, put there this.

```

SmithingXP As Long

CookingXP As Long

FletchingXP As Long

CraftingXP As Long

```

Now lets go to Private Type ItemRec. At the bottom of the rec, put there this.

```

SmXP As Long

CoXP As Long

FlXP As Long

CrXP As Long

SmRew As Long

CoRew As Long

FlRew As Long

CrRew As Long

```

Now lets go to Private Type ShopRec. At the bottom of the rec, put there this.

```

ShopType As Byte

```

Look for```

Call SetPlayerPK(i, Buffer.ReadLong)

```

and put it underneath it this

```

Call SetPlayerSmithingXP(i, Buffer.ReadLong)

Call SetPlayerCookingXP(i, Buffer.ReadLong)

Call SetPlayerFletchingXP(i, Buffer.ReadLong)

Call SetPlayerCraftingXP(i, Buffer.ReadLong)

```

Now look for```

Sub SetPlayerExp(ByVal Index As Long, ByVal EXP As Long)

```

And put this above it

```

Sub SetPlayerSmithingXP(ByVal Index As Long, ByVal SmithingXP As Long)

If Index > MAX_PLAYERS Then Exit Sub

Player(Index).SmithingXP = SmithingXP

End Sub

Sub SetPlayerCookingXP(ByVal Index As Long, ByVal CookingXP As Long)

If Index > MAX_PLAYERS Then Exit Sub

Player(Index).CookingXP = CookingXP

End Sub

Sub SetPlayerFletchingXP(ByVal Index As Long, ByVal FletchingXP As Long)

If Index > MAX_PLAYERS Then Exit Sub

Player(Index).FletchingXP = FletchingXP

End Sub

Sub SetPlayerCraftingXP(ByVal Index As Long, ByVal CraftingXP As Long)

If Index > MAX_PLAYERS Then Exit Sub

Player(Index).CraftingXP = CraftingXP

End Sub

```

Now go to```

Private Sub picShopItems_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)

```

In this sub should be code like this```

If shopItem > 0 Then

Select Case ShopAction

Case 0 ' no action, give cost

With Shop(InShop).TradeItem(shopItem)

AddText "You can buy this item for " & .CostValue & " " & Trim$(Item(.CostItem).Name) & ".", White

End With

Case 1 ' buy item

' buy item code

BuyItem shopItem

End Select

End If

```

Replace it with this

```

If shopItem > 0 Then

Select Case ShopAction

Case 0 ' no action, give cost

If Shop(InShop).ShopType = 0 Then

With Shop(InShop).TradeItem(shopItem)

AddText "You can buy this item for " & .CostValue & " " & Trim$(Item(.CostItem).Name) & ".", White

End With

End If

If Shop(InShop).ShopType = 1 Then

With Shop(InShop).TradeItem(shopItem)

AddText "You can make this item with " & .CostValue & " " & Trim$(Item(.CostItem).Name) & ".", White

End With

End If

Case 1 ' buy item

' buy item code

BuyItem shopItem

End Select

End If

```

Now look for```

Public Sub OpenShop(ByVal shopnum As Long)

```

And replace this```

InShop = shopnum

ShopAction = 0

frmMain.picCover.Visible = True

frmMain.picShop.Visible = True

BltShop

```

With this```

InShop = shopnum

ShopAction = 0

frmMain.picShop.Picture = Nothing

If Shop(shopnum).ShopType = 0 Then

frmMain.picShop.Picture = LoadPicture(App.Path & "\data files\graphics\gui\main\shop.jpg")

frmMain.imgShopSell.Visible = True

End If

If Shop(shopnum).ShopType = 1 Then

frmMain.picShop.Picture = LoadPicture(App.Path & "\data files\graphics\gui\main\anvil.jpg")

frmMain.imgShopSell.Visible = False

End If

frmMain.picCover.Visible = True

frmMain.picShop.Visible = True

BltShop

```

Lets go to the forms now.

Go to the shop editor form.

Make a new scroll bar and label. Name the label lblShopType, and name the scrollbar scrlShopType. Double click the scrollbar and put there this code.

```

' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo errorhandler

Select Case scrlShopType.Value

Case 0

lblShopType.Caption = "Shop Type: Shop"

Case 1

lblShopType.Caption = "Shop Type: Anvil"

Case Else

lblShopType.Caption = "Shop Type: None"

End Select

Shop(EditorIndex).ShopType = scrlShopType.Value

' Error handler

Exit Sub

errorhandler:

HandleError "scrlBuy_Change", "frmEditor_Shop", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub

```

Now go to ShopEditorInit and look for this```

If frmEditor_Shop.Visible = False Then Exit Sub

EditorIndex = frmEditor_Shop.lstIndex.ListIndex + 1

```and place under it this```

frmEditor_Shop.scrlShopType.Value = Shop(EditorIndex).ShopType

```

Now go to the item editor. Make 8 labels and 8 scrollbars. Name 1 label lblSmithing, name another lblCooking, another lblFletching, and another lblCrafting. As for the last 4 labels, name one lblSmithingRew, name another lblCookingRew, name another lblFletchingRew, and name the last lblCraftingRew.

As for the scrollbars, name one scrlSmithing, another scrlCooking, another scrlFletching, another scrlCrafting, another scrlSmithingRew, another scrlCookingRew, another scrlFletchingRew, and the last scrlCraftingRew.

Go into the code of your item editor form and put there this.

```

Private Sub scrlSmithing_Change()

' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo errorhandler

lblSmithing.Caption = "Smithing: " & scrlSmithing.Value

Item(EditorIndex).SmXP = scrlSmithing.Value

' Error handler

Exit Sub

errorhandler:

HandleError "scrlSmithing_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub

End Sub

Private Sub scrlCooking_Change()

' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo errorhandler

lblCooking.Caption = "Cooking: " & scrlCooking.Value

Item(EditorIndex).CoXP = scrlCooking.Value

' Error handler

Exit Sub

errorhandler:

HandleError "scrlCooking_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub

End Sub

Private Sub scrlFletching_Change()

' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo errorhandler

lblFletching.Caption = "Fletching: " & scrlFletching.Value

Item(EditorIndex).FlXP = scrlFletching.Value

' Error handler

Exit Sub

errorhandler:

HandleError "scrlFletching_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub

End Sub

Private Sub scrlCrafting_Change()

' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo errorhandler

lblCrafting.Caption = "Crafting: " & scrlCrafting.Value

Item(EditorIndex).CrXP = scrlCrafting.Value

' Error handler

Exit Sub

errorhandler:

HandleError "scrlCrafting_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub

End Sub

Private Sub scrlSmithingRew_Change()

' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo errorhandler

lblSmithingRew.Caption = "Smithing: " & scrlSmithingRew.Value

Item(EditorIndex).SmRew = scrlSmithingRew.Value

' Error handler

Exit Sub

errorhandler:

HandleError "scrlSmithingRew_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub

End Sub

Private Sub scrlCookingRew_Change()

' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo errorhandler

lblCookingRew.Caption = "Cooking: " & scrlCookingRew.Value

Item(EditorIndex).CoRew = scrlCookingRew.Value

' Error handler

Exit Sub

errorhandler:

HandleError "scrlCookingRew_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub

End Sub

Private Sub scrlFletchingRew_Change()

' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo errorhandler

lblFletchingRew.Caption = "Fletching: " & scrlFletchingRew.Value

Item(EditorIndex).FlRew = scrlFletchingRew.Value

' Error handler

Exit Sub

errorhandler:

HandleError "scrlFletchingRew_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub

End Sub

Private Sub scrlCraftingRew_Change()

' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo errorhandler

lblCraftingRew.Caption = "Crafting: " & scrlCraftingRew.Value

Item(EditorIndex).CrRew = scrlCraftingRew.Value

' Error handler

Exit Sub

errorhandler:

HandleError "scrlCraftingRew_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub

End Sub

```

Lastly, go into ItemEditorInit and put there this```

frmEditor_Item.scrlSmithing.Value = .SmXP

frmEditor_Item.scrlCooking.Value = .CoXP

frmEditor_Item.scrlFletching.Value = .FlXP

frmEditor_Item.scrlCrafting.Value = .CrXP

frmEditor_Item.scrlSmithingRew.Value = .SmRew

frmEditor_Item.scrlCookingRew.Value = .CoRew

frmEditor_Item.scrlFletchingRew.Value = .FlRew

frmEditor_Item.scrlCraftingRew.Value = .CrRew

```

under this```

frmEditor_Item.scrlRarity.Value = .Rarity

```

Now let me explain what you should know about this. You can add various different interfaces for your finishing skills. I put there an interface called "anvil" as a default. I'll provide a download link for the image so you can try it out. When you're making items with your finishing skill, you shouldn't be able to sell the item (as it shouldn't be a store). So I made it so that when the skill interface is shown, the selling button is invisible. When the shop interface is shown, the button becomes visible.

To set a new interface for a shop (for your finishing skill) is similar to adding a new item object type.

Double click on the shop scrlShopType and add there a new case.

Go to```

Private Sub picShopItems_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)

```And add in a message to appear upon clicking an item in the shop/skill interface.

Lastly, go to```

Public Sub OpenShop(ByVal shopnum As Long)

```and code in the gui you want for the interface.

You may have noticed you have two types of scrollbars; skill xp requirement (scrlSKILLNAMEHERE) and skill xp reward (scrlSKILLNAMEHERErew).

The xp requirement is the requirement to "make" an item (in reality buying it from a shop), and the xp reward is the amount of xp rewarded for successfully "making" (buying) an item in the skill interface (shop).

And that should be it! Save, compile, and enjoy.
Link to comment
Share on other sites

> What do you mean about Finishing Skill System?

My other tutorial for a skill system is for gathering. These skills are Woodcutting, Fishing, and Mining. Once you have wood, what do you do with it? Once you have raw fish, what do you do with it? Once you have ore, what do you do with it? I made this "finishing skill system" so that these gathering skills can enable the player to do more with the items they've gotten from the gathering skills.
Link to comment
Share on other sites

What changes (if any) would need to be made to make this compatible with 3.0 Nightly?

UPDATE: Installedit ondragon Eclips (3.0 Nightly) and it works fine (IN TEST-COMPILE only, while trying to actually compile it i gt an rror) without and revisions with the exception of one

error:

i recieve a sub or function not defined at

```

BltShop

```
in ModGameLogic

(provided below for rference)

```

Public Sub OpenShop(ByVal shopnum As Long)

' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo errorhandler

InShop = shopnum

ShopAction = 0

frmMain.picShop.Picture = Nothing

If Shop(shopnum).ShopType = 0 Then

frmMain.picShop.Picture = LoadPicture(App.Path & "\data files\graphics\gui\main\shop.jpg")

frmMain.imgShopSell.Visible = True

End If

If Shop(shopnum).ShopType = 1 Then

frmMain.picShop.Picture = LoadPicture(App.Path & "\data files\graphics\gui\main\anvil.jpg")

frmMain.imgShopSell.Visible = False

End If

frmMain.picCover.Visible = True

frmMain.picShop.Visible = True

BltShop

frmMain.picShopItems.Refresh

' Error handler

Exit Sub

errorhandler:

HandleError "OpenShop", "modGameLogic", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub

End Sub

```

(the line highlighted is the first one: (Private Sub scrlCraftingRew_Change())

```

Private Sub scrlCraftingRew_Change()

' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo errorhandler

lblCraftingRew.Caption = "Crafting: " & scrlCraftingRew.Value

Item(EditorIndex).CrRew = scrlCraftingRew.Value

' Error handler

Exit Sub

errorhandler:

HandleError "scrlCraftingRew_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub

End Sub

Private LastIndex As Long

```

UPDATE: I deleted 'Private LastIndex As Long'

and i couldnt find anything in the tutorial about it - not sure what it was… is/was it important? it works without it.
Link to comment
Share on other sites

> What changes (if any) would need to be made to make this compatible with 3.0 Nightly?
>
> UPDATE: Installedit ondragon Eclips (3.0 Nightly) and it works fine (IN TEST-COMPILE only, while trying to actually compile it i gt an rror) without and revisions with the exception of one
>
> error:
>
> i recieve a sub or function not defined at
>
> ```
>
> BltShop
>
> ```
> in ModGameLogic
>
> (provided below for rference)
>
> ```
>
> Public Sub OpenShop(ByVal shopnum As Long)
>
> ' If debug mode, handle error then exit out
>
> If Options.Debug = 1 Then On Error GoTo errorhandler
>
> InShop = shopnum
>
> ShopAction = 0
>
> frmMain.picShop.Picture = Nothing
>
> If Shop(shopnum).ShopType = 0 Then
>
> frmMain.picShop.Picture = LoadPicture(App.Path & "\data files\graphics\gui\main\shop.jpg")
>
> frmMain.imgShopSell.Visible = True
>
> End If
>
> If Shop(shopnum).ShopType = 1 Then
>
> frmMain.picShop.Picture = LoadPicture(App.Path & "\data files\graphics\gui\main\anvil.jpg")
>
> frmMain.imgShopSell.Visible = False
>
> End If
>
> frmMain.picCover.Visible = True
>
> frmMain.picShop.Visible = True
>
> BltShop
>
> frmMain.picShopItems.Refresh
>
> ' Error handler
>
> Exit Sub
>
> errorhandler:
>
> HandleError "OpenShop", "modGameLogic", Err.Number, Err.Description, Err.Source, Err.HelpContext
>
> Err.Clear
>
> Exit Sub
>
> End Sub
>
> ```
>
> (the line highlighted is the first one: (Private Sub scrlCraftingRew_Change())
>
> ```
>
> Private Sub scrlCraftingRew_Change()
>
> ' If debug mode, handle error then exit out
>
> If Options.Debug = 1 Then On Error GoTo errorhandler
>
> lblCraftingRew.Caption = "Crafting: " & scrlCraftingRew.Value
>
> Item(EditorIndex).CrRew = scrlCraftingRew.Value
>
> ' Error handler
>
> Exit Sub
>
> errorhandler:
>
> HandleError "scrlCraftingRew_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext
>
> Err.Clear
>
> Exit Sub
>
> End Sub
>
> Private LastIndex As Long
>
> ```
>
> UPDATE: I deleted 'Private LastIndex As Long'
>
> and i couldnt find anything in the tutorial about it - not sure what it was… is/was it important? it works without it.

Private LastIndex as Long isn't in the tutorial at all.

In your old OpenShop sub, look for something referring to DD8 (I assume nightly uses this) and shops. Use that instead of BltShops. If there isn't anything, then remove BltShop.
Link to comment
Share on other sites

Thanks for your response (as well as this and pas contributions as well) -

I removed bltshop +

I now get a method or data member not found at .scrlShopType in 'modeditorscode' in:

(highlighted is ".scrlShopType")

(UPDATE: might have missed a few things (forgot to create label as well as to properly name the scrollbar (both in scrlShopType) -

It now compiles so i will try it out and see how it goes, on a quick note - how do i utilize the items once they are made?

```

' /////////////////

' // Shop Editor //

' /////////////////

Public Sub ShopEditorInit()

Dim i As Long

' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo errorhandler

If frmEditor_Shop.Visible = False Then Exit Sub

frmEditor_Shop.scrlShopType.Value = Shop(EditorIndex).ShopType

EditorIndex = frmEditor_Shop.lstIndex.ListIndex + 1

frmEditor_Shop.txtName.text = Trim$(Shop(EditorIndex).Name)

If Shop(EditorIndex).BuyRate > 0 Then

frmEditor_Shop.scrlBuy.Value = Shop(EditorIndex).BuyRate

Else

frmEditor_Shop.scrlBuy.Value = 100

End If

frmEditor_Shop.cmbItem.Clear

frmEditor_Shop.cmbItem.AddItem "None"

frmEditor_Shop.cmbCostItem.Clear

frmEditor_Shop.cmbCostItem.AddItem "None"

For i = 1 To MAX_ITEMS

frmEditor_Shop.cmbItem.AddItem i & ": " & Trim$(Item(i).Name)

frmEditor_Shop.cmbCostItem.AddItem i & ": " & Trim$(Item(i).Name)

Next

frmEditor_Shop.cmbItem.ListIndex = 0

frmEditor_Shop.cmbCostItem.ListIndex = 0

UpdateShopTrade

Shop_Changed(EditorIndex) = True

' Error handler

Exit Sub

errorhandler:

HandleError "ShopEditorInit", "modGameEditors", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub

End Sub

```
Link to comment
Share on other sites

> It now compiles so i will try it out and see how it goes, on a quick note - how do i utilize the items once they are made?

Ah yes! I forgot to add this information.

You may have noticed you have two types of scrollbars; skill xp requirement (scrlSKILLNAMEHERE) and skill xp reward (scrlSKILLNAMEHERErew).

The xp requirement is the requirement to "make" an item (in reality buying it from a shop), and the xp reward is the amount of xp rewarded for successfully "making" (buying) an item in the skill interface (shop). Hope that sheds some light on your question. I'll add this bit to the tutorial now.

EDIT:

Just realized I missed out something important.

Go to sub HandleBuyItem (server sided) and replace your entire With Shop(shopNum).tradeitem(shopslot) with this

```

With Shop(shopNum).TradeItem(shopslot)

' check trade exists

If .Item < 1 Then Exit Sub

' check has the cost item

itemamount = HasItem(index, .costitem)

If itemamount = 0 Or itemamount < .costvalue Then

' finishing skill

If Shop(shopNum).ShopType = 0 Then

PlayerMsg index, "You do not have enough to purchase this item.", BrightRed

Else

PlayerMsg index, "You do not have enough to make this item.", BrightRed

End If

Exit Sub

End If

' finishing skill

If Shop(shopNum).ShopType > 0 Then

If Item(Shop(shopNum).TradeItem(shopslot).Item).SmXP > Player(index).SmithingXP Then

PlayerMsg index, "You need " & Item(Shop(shopNum).TradeItem(shopslot).Item).SmXP - Player(index).SmithingXP & " more smithing experience to make this item.", BrightRed

Exit Sub

End If

If Item(Shop(shopNum).TradeItem(shopslot).Item).CoXP > Player(index).CookingXP Then

PlayerMsg index, "You need " & Item(Shop(shopNum).TradeItem(shopslot).Item).CoXP - Player(index).CookingXP & " more cooking experience to make this item.", BrightRed

Exit Sub

End If

If Item(Shop(shopNum).TradeItem(shopslot).Item).FlXP > Player(index).FletchingXP Then

PlayerMsg index, "You need " & Item(Shop(shopNum).TradeItem(shopslot).Item).FlXP - Player(index).FletchingXP & " more fletching experience to make this item.", BrightRed

Exit Sub

End If

If Item(Shop(shopNum).TradeItem(shopslot).Item).CrXP > Player(index).CraftingXP Then

PlayerMsg index, "You need " & Item(Shop(shopNum).TradeItem(shopslot).Item).CoXP - Player(index).CraftingXP & " more crafting experience to make this item.", BrightRed

Exit Sub

End If

If Item(Shop(shopNum).TradeItem(shopslot).Item).SmRew > 0 Then

Player(index).SmithingXP = Player(index).SmithingXP + Item(Shop(shopNum).TradeItem(shopslot).Item).SmRew

End If

If Item(Shop(shopNum).TradeItem(shopslot).Item).CoRew > 0 Then

Player(index).CookingXP = Player(index).CookingXP + Item(Shop(shopNum).TradeItem(shopslot).Item).CoRew

End If

If Item(Shop(shopNum).TradeItem(shopslot).Item).FlRew > 0 Then

Player(index).FletchingXP = Player(index).FletchingXP + Item(Shop(shopNum).TradeItem(shopslot).Item).FlRew

End If

If Item(Shop(shopNum).TradeItem(shopslot).Item).CrRew > 0 Then

Player(index).CraftingXP = Player(index).CraftingXP + Item(Shop(shopNum).TradeItem(shopslot).Item).CrRew

End If

SendPlayerData (index)

End If

TakeInvItem index, .costitem, .costvalue

GiveInvItem index, .Item, .ItemValue

end with

```

The main tutorial has been fixed as well.
Link to comment
Share on other sites

encountered a subscript out of range when trying to cmbine a two items.

(highligheted (in modHandleData)```

If Item(Shop(shopNum).TradeItem(.Item).Item).SmXP > Player(index).SmithingXP Then

```

Aside from that the only other bug is the fact that gold doesn't exist and cant be created or used/traded in shops.
Link to comment
Share on other sites

  • 2 months later...
![](http://www.freemmorpgmaker.com/files/imagehost/pics/93278456366dea9e1369ec879f22819e.png)

I tried many times correcting the bug and do all over again your tutorial but none of my effort is success

plz help me to fix it ![:D](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/biggrin.png)
Link to comment
Share on other sites

> I tried many times correcting the bug and do all over again your tutorial but none of my effort is success
>
> plz help me to fix it ![:D](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/biggrin.png)

Well, its saying that the value does not exist. Are you sure the scrollbar is called scrlSmithing?
Link to comment
Share on other sites

> Really good tutorial! Works wonderfully on Eclipse Nightly!

Thank you! ![^_^](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/happy.png) Let me know if you run into any problems!
Link to comment
Share on other sites

> Let me know what happens.

As you have replied to me about the scrl- code, I've relized that I missplacing between the combo box and the scroll bar XD

So for the conclusion;

all the value without "Rew" at the back is the lvl needed to harvest the resources

and all the value with "Rew" at the back is the EXP will receive when harvest the resources

great tut anyway but I have some suggestion;

why don't you make tut of system that will use two types of items to get one product?

it would be epic!
Link to comment
Share on other sites

> As you have replied to me about the scrl- code, I've relized that I missplacing between the combo box and the scroll bar XD
>
> So for the conclusion;
>
> all the value without "Rew" at the back is the lvl needed to harvest the resources
>
> and all the value with "Rew" at the back is the EXP will receive when harvest the resources
>
> great tut anyway but I have some suggestion;
>
> why don't you make tut of system that will use two types of items to get one product?
>
> it would be epic!

*ahum*

[http://www.touchofde…em/#entry870781](http://www.touchofdeathforums.com/community/index.php?/topic/130991-eo-shop-multiple-item-cost-system/#entry870781)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...