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

[EO] Crafting, Blacksmithing, Alchemy, Ect. v.2.0.0


DJMaxus
 Share

Recommended Posts

  • Replies 137
  • Created
  • Last Reply

Top Posters In This Topic

Lol… Good to know. I was searching mod by mod and did not notice I could search by the whole project.

I did finaly find it in the modplayer though.

I am a little slow but I will hopefully get it at some point. :)

Thanks again for all your help.
Link to comment
Share on other sites

  • 4 weeks later...
  • 4 weeks later...
```
Case ITEM_TYPE_RECIPE
                ' Get the recipe information
                Item1 = Item(GetPlayerInvItemNum(Index, invNum)).Data1
                Item2 = Item(GetPlayerInvItemNum(Index, invNum)).Data2
                Result = Item(GetPlayerInvItemNum(Index, invNum)).Data3

                ' Perform Recipe checks
                If Item1 <= 0 Or Item2 <= 0 Or Result <= 0 Then
                    Call PlayerMsg(Index, "This is an incomplete recipe...", White)
                    Exit Sub
                End If

                If GetPlayerEquipment(Index, Weapon) <= 0 Then
                    Call PlayerMsg(Index, "You don't have the proper tool equipped!", White)
                    Exit Sub
                End If

                If Item(GetPlayerEquipment(Index, Weapon)).Tool = Item(GetPlayerInvItemNum(Index, invNum)).ToolReq Then
                    ' Give the resulting item
                    If HasItem(Index, Item1) And HasItem(Index, Item2) Then
                        Call TakeInvItem(Index, Item1, 1)
                        Call TakeInvItem(Index, Item2, 1)
                        Call GiveInvItem(Index, Result, 1)
                        Call TakeInvItem(Index, GetPlayerInvItemNum(Index, invNum), 0)
                        Call PlayerMsg(Index, "You have successfully created " & Trim(Item(Result).Name) & ".", White)
                    Else
                        Call PlayerMsg(Index, "You do not have all of the ingredients.", White)
                        Exit Sub
                    End If
                Else
                    Call PlayerMsg(Index, "This is not the tool used in this recipe.", White)
                    Exit Sub
                End If

```
I cleaned this part of it up for you. :)
Link to comment
Share on other sites

  • 3 weeks later...
For those who're using Eclipse Origins v2b

SKIP this part of the tutorial.

> In **modGameLogic**
> Find the **UpdateDescWindow** sub
>
> Near the top of the sub, find:
> ```
> Dim Name As String
> ```
> Add this below:
> ```
> Dim Item1 As Long
> Dim Item2 As Long
> ```
> Within the same sub, find:
> ```
> ' Currency
> ```
> Add this Above:
> ```
> If Item(itemnum).Type = ITEM_TYPE_WEAPON Then
>             .lblItemDescStats.Caption = "Damage: " & Item(itemnum).Data2
>             Select Case Item(itemnum).Tool
>                 Case 0
>                     .lblItemDescType = "None."
>                 Case 1
>                     .lblItemDescType = "Crafting Tool"
>                 Case 2
>                     .lblItemDescType = "Alchemy Tool"
>             End Select
>         End If
>        
>         If Item(itemnum).Type = ITEM_TYPE_RECIPE Then
>             .lblItemDescStats.Caption = "A " & Trim$(Item(Item1).Name) & " and " & Trim$(Item(Item2).Name)
>             Select Case Item(itemnum).ToolReq
>                 Case 0
>                     .lblItemDescType = "No tool required."
>                 Case 1
>                     .lblItemDescType = "Crafting Tool"
>                 Case 2
>                     .lblItemDescType = "Alchemy Tool"
>             End Select
>         End If
> ```
Link to comment
Share on other sites

EDIT: Combined a few checks in the Case ITEM_TYPE_RECIPE.

**Server Side Modifications**

modTypes -> _Private Type ItemRec_ (Before End Type)

Add:
```
Tool As Long
ToolReq As Long

```
modConstants -> Under Line: Public Const ITEM_TYPE_SPELL As Byte = 8 (Default EO2 Value)

Add:
```
Public Const ITEM_TYPE_RECIPE As Byte = 9

```
modPlayer -> _Public Sub UseItem_

Below:
```
Set Buffer = Nothing

```
Add:
```
Dim Item1 As Long, Item2, Result

```
Also, towards the bottom of the sub Find:
```
End Select

```
Before that Add:
```
Case ITEM_TYPE_RECIPE
                ' Get the recipe information
                Item1 = Item(GetPlayerInvItemNum(Index, invNum)).Data1
                Item2 = Item(GetPlayerInvItemNum(Index, invNum)).Data2
                Result = Item(GetPlayerInvItemNum(Index, invNum)).Data3

                ' Perform Recipe checks
                If Item1 <= 0 Or Item2 <= 0 Or Result <= 0 Then
                    Call PlayerMsg(Index, "This is an incomplete recipe...", White)
                    Exit Sub
                End If

                If GetPlayerEquipment(Index, Weapon) <= 0 Then
                    Call PlayerMsg(Index, "You don't have the proper tool equipped!", White)
                    Exit Sub
                End If

                If Item(GetPlayerEquipment(Index, Weapon)).Tool = Item(GetPlayerInvItemNum(Index, invNum)).ToolReq Then
                    ' Give the resulting item
                    If HasItem(Index, Item1) And HasItem(Index, Item2) Then
                        Call TakeInvItem(Index, Item1, 1)
                        Call TakeInvItem(Index, Item2, 1)
                        Call GiveInvItem(Index, Result, 1)
                        Call TakeInvItem(Index, GetPlayerInvItemNum(Index, invNum), 0)
                        Call PlayerMsg(Index, "You have successfully created " & Trim(Item(Result).Name) & ".", White)
                    Else
                        Call PlayerMsg(Index, "You do not have all of the ingredients.", White)
                        Exit Sub
                    End If
                Else
                    Call PlayerMsg(Index, "This is not the tool used in this recipe.", White)
                    Exit Sub
                End If

```
End of **Server Side Modifications**

**Client Side Modifications**

modTypes -> _Private Type ItemRec_ (Before End Type)

Add:
```
Tool As Long
ToolReq As Long

```
modConstants -> Under Line: Public Const ITEM_TYPE_SPELL As Byte = 8 (Default EO2 Value)

Add:
```
Public Const ITEM_TYPE_RECIPE As Byte = 9

```
modGameEditors -> Find:
```
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

```
Below Add:
```
If (frmEditor_Item.cmbType.ListIndex = ITEM_TYPE_RECIPE) Then
            frmEditor_Item.fraRecipe.Visible = True
            frmEditor_Item.scrlItem1.Value = .Data1
            frmEditor_Item.scrlItem2.Value = .Data2
            frmEditor_Item.scrlResult.Value = .Data3
            frmEditor_Item.cmbCToolReq.ListIndex = .ToolReq
        Else
            frmEditor_Item.fraRecipe.Visible = False
        End If

```
Go to the OP for the form work. It's very easy to follow.
Link to comment
Share on other sites

And don't overwrite your EO 2.0 forms with the ones attached to the OP, like I did lol.

The problem I'm getting, is that it says "You don't have the proper tool equipped". I've followed the tutorial correctly and tried to fix this but I can't seem to figure it out. I've set it so that the tool required is "None" in the item editor.
Link to comment
Share on other sites

I have a problem with this scrypt. I am doing everything as expected but when I make a recipe, for example, ore + ore = sword it, nothing happens when I click on the recipe. Could someone write a complete tutorial, step by step how to do alchemy for EO v.2.0.0?
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...