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

Took about 3 mins to implement into my game in EO 2 its not hard make sure you read the whole topic before you start changing things in your game and before you start bashing a great programer and a great piece of code. Thanks for the great contribution :)
Link to comment
Share on other sites

  • 1 month later...
  • Replies 137
  • Created
  • Last Reply

Top Posters In This Topic

@Ansonla:

> -picture-

@DJMaxus:

> In **modHandleData**
> Find the **HandleUseItem** sub.
>
> Near the top of the sub, find:
> ```
> Set Buffer = Nothing
> ```
> Add this below:
> ```
> Dim Item1 As Long
>     Dim Item2 As Long
>     Dim Result As Long
> ```
Link to comment
Share on other sites

  • 4 weeks later...
~~Quick question…. so i add  "Dim Item1 As Long, Item2, Result"
after "setbuffer = nothing"    in  modhandledata->sub handleuseitem
                                                                  or
                                                modplayer->sub useitem
im using eo2.0 and i checked in modplayer and cant find the setbuffer = nothing in that module except for the sub playerwarp and im sure thats not it is it?~~

i think i found it out cause im not getting any compile errors or any errors at all , but idk how to use this recipe, i made a recipe that wood chips and metal peices would make a ragged axe , but when i double click on the recipe nothing happens , i also recognized its not saving whatever i put in cmbCToolReq box , any ideas?
Link to comment
Share on other sites

This is really  great thing to have in a server, however im new to this and im trying to find the last "end select" in the **HandleUseItem** to insert this:

>! 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 Then
                    Call PlayerMsg(Index, "This is an incomplete recipe…", White)
                    Exit Sub
                End If

                If Item2 <= 0 Then
                    Call PlayerMsg(Index, "This is an incomplete recipe...", White)
                    Exit Sub
                End If

                If 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) Then
                            If 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, "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

Basicaly what i have in the whole **modhandledata** is

>! End Sub
>! ' :::::::::::::::::::::
' :: Use item packet ::
' :::::::::::::::::::::
Sub HandleUseItem(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
Dim invNum As Long
Dim Buffer As clsBuffer

    ' get inventory slot number
    Set Buffer = New clsBuffer
    Buffer.WriteBytes Data()
    invNum = Buffer.ReadLong
    Set Buffer = Nothing
Dim Item1 As Long
    Dim Item2 As Long
    Dim Result As Long
>!     UseItem Index, invNum
>! End Sub
___________________________________________
' ::::::::::::::::::::::::::
' :: Player attack packet ::
' ::::::::::::::::::::::::::
Sub HandleAttack(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
    Dim i As Long
    Dim n As Long
    Dim Damage As Long
    Dim TempIndex As Long
    Dim x As Long, y As Long

    ' can't attack whilst casting
    If TempPlayer(Index).spellBuffer.Spell > 0 Then Exit Sub

    ' can't attack whilst stunned
    If TempPlayer(Index).StunDuration > 0 Then Exit Sub
>!     ' Send this packet so they can see the person attacking
    'SendAttack Index
>!     ' Try to attack a player
    For i = 1 To Player_HighIndex
        TempIndex = i
>!         ' Make sure we dont try to attack ourselves
        If TempIndex <> Index Then
            TryPlayerAttackPlayer Index, i
        End If
    Next
>!     ' Try to attack a npc
    For i = 1 To MAX_MAP_NPCS
        TryPlayerAttackNpc Index, i
    Next
>!     ' Check tradeskills
    Select Case GetPlayerDir(Index)
        Case DIR_UP
>!             If GetPlayerY(Index) = 0 Then Exit Sub
            x = GetPlayerX(Index)
            y = GetPlayerY(Index) - 1
        Case DIR_DOWN
>!             If GetPlayerY(Index) = Map(GetPlayerMap(Index)).MaxY Then Exit Sub
            x = GetPlayerX(Index)
            y = GetPlayerY(Index) + 1
        Case DIR_LEFT
>!             If GetPlayerX(Index) = 0 Then Exit Sub
            x = GetPlayerX(Index) - 1
            y = GetPlayerY(Index)
        Case DIR_RIGHT
>!             If GetPlayerX(Index) = Map(GetPlayerMap(Index)).MaxX Then Exit Sub
            x = GetPlayerX(Index) + 1
            y = GetPlayerY(Index)

    **End Select**

    CheckResource Index, x, y
End **Sub**
____________________________________________
' ::::::::::::::::::::::
' :: Use stats packet ::
' ::::::::::::::::::::::
Sub HandleUseStatPoint(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
Dim PointType As Byte
Dim Buffer As clsBuffer

So basicaly, i cant locate "end select" in handleuseitem sub.

any help appreciated :/
Link to comment
Share on other sites

@Wilauzaz:

> So basicaly, i cant locate "end select" in handleuseitem sub.
> any help appreciated :/

Everytime I read people asking questions about where to put stuff in these fool proof tutorials 90% of the time if they would just read the entire thread they will clearly see the answers to their questions =/

@Erwin:

> You put it in UseItem, not HandleUseItem
Link to comment
Share on other sites

@Peter112:

> works with EO2.0?

@Forgotten:

> Rose posted on how to do it for version 2.0 [http://www.touchofdeathforums.com/smf/index.php/topic,64806.msg754735.html#msg754735](http://www.touchofdeathforums.com/smf/index.php/topic,64806.msg754735.html#msg754735)
Link to comment
Share on other sites

  • 2 weeks later...
Very Nice !
~~Say do you have a compiled version? (Just asking please don't be mad)
If you haven't well I'll just do the manual way.~~

EDIT: Nevermind.

(Server)
EDIT2: Darn where can I find "Set Buffer = Nothing" in modPlayer Public Sub UseItem?
I can't seem to find it in EO2

EDIT3: Okay guys the server is getting worst and worst now VB6 said that in the log file :
Line 27: Cannot load control Socket; license not found.
And VB6 pin-pointed the frmServer.show thing. Any fix on this?
Link to comment
Share on other sites

@knightgrader:

> Very Nice !
> ~~Say do you have a compiled version? (Just asking please don't be mad)
> If you haven't well I'll just do the manual way.~~
>
> EDIT: Nevermind.
>
> (Server)
> EDIT2: Darn where can I find "Set Buffer = Nothing" in modPlayer Public Sub UseItem?
> I can't seem to find it in EO2
>
> EDIT3: Okay guys the server is getting worst and worst now VB6 said that in the log file :
> Line 27: Cannot load control Socket; license not found.
> And VB6 pin-pointed the frmServer.show thing. Any fix on this?

Read the guide on Installing VB6\. You've messed your source up and you'll have to redownload it.
Link to comment
Share on other sites

@Soul:

> Read the guide on Installing VB6\. You've messed your source up and you'll have to redownload it.

Fixed it up… I think Visual Basic 6 Portable ain't gonna work with EOv2

To anyone who is nice and kind. Please create another version of this for EO2 and also make it less difficult if possible. I read the whole topic none of them seemed to be working. I give credit to the user who makes one. Thanks in advanced.
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...