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

[EO 2.0] Consume Give-backs


Matt
 Share

Recommended Posts

Ever want to make that cake of yours to take four bites to finish? Or that potion to have multiple doses? This is the tutorial for you. Using this, consume items will give back a selected item enabling you to make multiple piece consumable items. This was made for EO 2.0, but I'd imagine it should work with other engines.

Lets start in client.

Go to frmEditor_Item, and in the consume tab make a new label and scrollbar. Go to```

Private Sub Form_Load()

```and put there this in the sub.

```

scrlItem.Max = MAX_ITEMS

```

Now go back to your new scrollbar and label. Name the scrollbar scrlItem, and name your label lblItem.

Double click on the scrollbar and put there this.

```

If scrlItem.Value = 0 Then

lblItem.Caption = "Item: None"

Exit Sub

End If

lblItem.Caption = "Item: " & Item(scrlItem.Value).Name

Item(EditorIndex).ConsumeItem = scrlItem.Value

```

Change the caption to your new label to "Item: None".

Now go to modTypes and look for```

Private Type ItemRec

```

At the bottom of the rec, put there this.

```

ConsumeItem As Long

```

Lastly, go to sub ItemEditorInit and look for```

If frmEditor_Item.cmbType.ListIndex = ITEM_TYPE_CONSUME Then

```

In that if statement, put there this```

frmEditor_Item.scrlItem.Value = .ConsumeItem

```

Save and compile.

Now to the server!

Go to```

Private Type ItemRec

```and at the bottom put there

```

ConsumeItem As Long

```

Now look for```

Case ITEM_TYPE_KEY

```and above it put there this.

```

If Item(itemnum).ConsumeItem <> 0 Then

GiveInvItem index, Item(itemnum).ConsumeItem, 1

End If

```

Save, compile, and enjoy. ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)
Link to comment
Share on other sites

> I do not quite understand what this does, could explain better?

If you use a "potion" for example that gives you 10 HP, with this add-on, it will give 10 HP, but it can be used 4-5 times before dissapearing from inventory, at least that's what i understood.
Link to comment
Share on other sites

> I do not quite understand what this does, could explain better?

This edit can give consume type items a "give-back" item. When the item is eaten, if the give-back isn't zero, it gives the player the item selected in the editor. This way you could make the illusion that a potion, for example, has multiple doses.

For a more in depth example, make five different items in your item editor; Potion 5/5, potion 4/5, potion 3/5, potion 2/5 and potion 1/5\. Set the give-back item for potion 5/5 to be "potion 4/5". For potion 4/5, make it "potion 3/5". Do this for all of them, except leave Potion 1/5's giveback as "None".

Now if you spawn yourself a Potion 5/5, and consume it, you will get potion 4/5\. If you eat that, you get a potion 3/5\. If you eat the potion 1/5, you will not receive an item back because you finished the potion.
Link to comment
Share on other sites

  • 3 months later...
> This looks good. Useful if for consumable foods like cakes, pies and stuff.

Exactly!

> Thanks!, this work in EO 3.0! ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)

You're welcome ![^_^](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/happy.png) Enjoy!
Link to comment
Share on other sites

> I dont have this in Eclipse Advanced Server…why ? :s
>
> **Now look for**
>
> **Case ITEM_TYPE_KEY**
>
> **and above it put there this.**

Becouse in EA there isn't any ITEM_TYPE_KEY ![:D](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/biggrin.png)
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...