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

Multiple item req in crafting


Domino_
 Share

Recommended Posts

I'm working on this almost a week and slowly realising that im a noob in whole vb6 language… so can you eclipsers please give me tips whats wrong in this source, dont give me full codes(corrects), just a give me some tips about what to do and hot to make it work correctly…
I'm trying to make requestable items form 1 to 3 with different value and if value = 0 then exit item check(server side) also with 1 to 2 reward items with ammo so as in Aegis online when players asked could get back bottle or vial where mixed some alchemy or alcahol.. ^^
**My source code in fresh eo_2.0**

http://www.freemmorpgmaker.com/files/imagehost/pics/b61c55995ebe9f914f07ef9781bba486.rar

p.s. I have already done most of this, need to fix value req cuz it takes only 1 not as example 2 or 3… also give item value need to fix.
Link to comment
Share on other sites

Whats wrong in this code..? :(

>! ```
Case ITEM_TYPE_RECIPE
          ' Get the recipe information
                For i = 1 To MAX_ITEMS
                Items(i) = Item(GetPlayerInvItemNum(Index, invNum)).RecipeItem(i)
                ItemNeed(i) = Item(itemnum).RecipeItemValue(i)
                Result(i) = Item(GetPlayerInvItemNum(Index, invNum)).Result(i)
                ResultValue(i) = Item(itemnum).ResultValue(i)
                Next

                If Item(GetPlayerInvItemNum(Index, invNum)).ToolReq > 0 Then
                    If GetPlayerEquipment(Index, Weapon) <> Item(GetPlayerInvItemNum(Index, invNum)).ToolReq Then
                        Call PlayerMsg(Index, "You don't have the proper tool equipped!", White)
                        Exit Sub
                    Else

                        For i = 1 To MAX_ITEMS

                        If ItemNeed(i) >= 1 Then ' Or if not itemneed(i) = 1 then smtn.. ^^

                                    If HasItem(Index, Items(i)) >= 1 Then
                                    Call TakeInvItem(Index, Items(i), ItemNeed(i))
                                    Else
                                    Exit Sub
                                    End If
                        Else
                        Exit Sub

                        End If

                            Call GiveInvItem(Index, Result(i), ResultValue(i))
                            Call TakeInvItem(Index, GetPlayerInvItemNum(Index, invNum), 1)
                            Call PlayerMsg(Index, "You have successfully created " & Trim(Item(Result(1)).Name) & ".", White)

                            Next
                    End If
                End If
```

Its not checking for ammo needed for items and makes recipe even without items but when have needed item he takes it but not all just one not requested as example 5 …. >.>
Link to comment
Share on other sites

Are the items you're taking currency? Because TakeInvItem only takes items from a single inventory slot no matter how much you tell it to take away. So unless it's a currency(and thus a stacking value) it will not take more than one from your inventory.
Link to comment
Share on other sites

@Scypher:

> Write your own sub to search for and take away amounts of items that aren't currencies.. Or simply make your crafting materials currencies and do it the lazy way.

The lazy way will make lots of problems in game.. xD
Thanks for tip. ;)
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...