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

[eo] Chest Attribute


kibbelz
 Share

Recommended Posts

  • Replies 65
  • Created
  • Last Reply

Top Posters In This Topic

Honestly, you can't even follow a very basic tutorial :/ The reason why optchest isn't visible is because you just dragged optchest onto fraattributes. you must create it ON fraattributes :/ Is is that hard to understand >.>
Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...
No need to double post, there is an Edit button for that.

For your problem, check if this:
```
Public Sub ChkDir(ByVal tDir As String, ByVal tName As String)
    If LCase$(Dir(tDir & tName, vbDirectory)) <> tName Then Call MkDir(tDir & tName)
End Sub
```
in **modDatabase**
Link to comment
Share on other sites

  • 2 months later...
@Domino_:

> Found Bug EO 2.0 when you pick up money it gives you this money but that what you had disapears.
> example you have 200g in chest is 50g , you open chest and you dont have 250g but only 50g ….

I have this bug.  Does anyone have a code fix for it?
Link to comment
Share on other sites

@Ryoku:

> that's because this code was made poorly and doesn't use the correct way to give to your inventory.
>
> "Sub HandleMapGetItem" and the data storage should be rewritten for this .

*Coughs*
Care to read this before you make any assumptions:

@kibbelz:

> Hey, This is just a conversion of the chest attribute system from [ES].
Link to comment
Share on other sites

@Ryoku:

> No one said it had to be you.

That's just kibbelz freaking out cause someone pointed out a bug in his tutorial he did the same when someone found a bug in his zelda grass mod. Anyways this still works great for items other than currency. =)
Link to comment
Share on other sites

@Justn:

> That's just kibbelz freaking out cause someone pointed out a bug in his tutorial he did the same when someone found a bug in his zelda grass mod. Anyways this still works great for items other than currency. =)

I remember this. I think it was SpicyWolf or whatever.
Link to comment
Share on other sites

  • 4 weeks later...
@Growlith1223:

> Hey i got a glitch…When trying to use this with Currency, it literally changes the amount you have, it doesnt add it..
> for example you have like 400 Currency and the currency found is like 7 currency, it changes it to 7...
> Someone plz help D:

Take a look at Function GetPlayerItemInvValue.
Link to comment
Share on other sites

Dear lord that is written terrible, you made new functions for the INI files which already exist? Say whaaaaat? Assigning values that aren't used in all states as well.. /bashes head into a wall.

Anyhow, here's my quick rewrite of the thing:
```
Sub HandleMapGetItem(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddR As Long, ByVal ExtraVar As Long)
    Dim b As Long

    If Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).Type = TILE_TYPE_CHEST Then
        If Val(GetVar("data\chests\" & Trim(GetPlayerName(index)) & ".ini", "Chests_Map_" & Trim(STR(GetPlayerMap(index))), Trim(STR(GetPlayerX(index))) & "_" & Trim(STR(GetPlayerY(index))))) = 0 Then
            b = FindOpenInvSlot(index, Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).data1)
            Call PlayerMsg(index, "You opened the chest and found " & Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).data2 & " " & Item(Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).data1).Name, White)
            Call SetPlayerInvItemNum(index, b, Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).data1)
            Call SetPlayerInvItemValue(index, b, GetPlayerInvItemValue(index, b) + Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).data2)
            Call PutVar("data\chests\" & Trim(GetPlayerName(index)) & ".ini", "Chests_Map_" & Trim(STR(GetPlayerMap(index))), Trim(STR(GetPlayerX(index))) & "_" & Trim(STR(GetPlayerY(index))), "1")
            Call SendInventoryUpdate(index, b)
        Else
            Call PlayerMsg(index, "You have already looted this chest!", BrightRed)
        End If
    Else
        Call PlayerMapGetItem(index)
    End If
End Sub
```
Just make sure to make a new folder in your server\data folder called Chests.. Should work fine, haven't tested it though. And this should also fix the issue of it not adding to, but replacing currencies.

EDIT: Fixed a typo.
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...