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

Programming Contest Voting


Marsh
 Share

Recommended Posts

Vote for your two favorite entries! Thanks for entering everyone and good luck.

* * *

**Prizes**
**1st - $40 Cash Prize
2nd - Custom UserGroup name and color for 3 months
3rd - Custom name color selection in profile**

**Quintensky**

>! **THIS TUTORIAL IS FOR DROPPING EVERY ITEM ON DEATH!**
**Server side**
>! first of all, in Modplayer find this:
>! ```
' Drop all worn items
    For i = 1 To Equipment.Equipment_Count - 1
        If GetPlayerEquipment(index, i) > 0 Then
            PlayerMapDropItem index, GetPlayerEquipment(index, i), 0
        End If
    Next
```it does not work anyway so no harm done… it supposed to make you drop items on death...
>! no place that full chunk of code with this:
```
'Drop inventory items
    For i = 1 To MAX_INV
    PlayerMapDropItem index, i, GetPlayerInvItemValue(index, i)
    Next
>!     'Send all equiped items to the inventory to be dumped.
    For i = 1 To Equipment.Equipment_Count - 1
        If GetPlayerEquipment(index, i) > 0 Then
            PlayerMapDropItem index, GetPlayerEquipment(index, i), 0
        End If

        'Send Weapon
        GiveInvItem index, GetPlayerEquipment(index, Weapon), 0
        SetPlayerEquipment index, 0, Weapon
        'Send Armor
        GiveInvItem index, GetPlayerEquipment(index, Armor), 0
        SetPlayerEquipment index, 0, Armor
        'Send Shield
        GiveInvItem index, GetPlayerEquipment(index, Shield), 0
        SetPlayerEquipment index, 0, Shield
        'Send Helmet
        GiveInvItem index, GetPlayerEquipment(index, Helmet), 0
        SetPlayerEquipment index, 0, Helmet

    Next
>!     'Drop *equipped* inventory items
    For i = 1 To MAX_INV
        PlayerMapDropItem index, i, 0
    Next
```Okay, what this does is: it takes all your inventory items, then unequips all you equipment and puts them on the spot where you died, in PK your attacker can pick them up, if you die from an NPC, you can just run back and pick them up

**Scott**

>! My small entry is simple, if an item is rarity 1 or above it will display the items name on the ground in the same color as the item name in the hover over description.
>! Place this at the bottom of modText
```
Public Sub DrawItemName(ByVal ItemX As Long, ByVal ItemY As Long, ByVal ItemNumber As Long)
Dim TextX As Long
Dim TextY As Long
Dim color As Long
Dim Name As String

    ' If debug mode, handle error then exit out
  If Options.Debug = 1 Then On Error GoTo errorhandler

        Select Case Item(ItemNumber).Rarity
            Case 0 ' white
              color = RGB(255, 255, 255)
            Case 1 ' green
              color = RGB(117, 198, 92)
            Case 2 ' blue
              color = RGB(103, 140, 224)
            Case 3 ' maroon
              color = RGB(205, 34, 0)
            Case 4 ' purple
              color = RGB(193, 104, 204)
            Case 5 ' orange
              color = RGB(217, 150, 64)
        End Select

    Name = Trim$(Item(ItemNumber).Name)

    TextX = ((ConvertMapX(ItemX * PIC_X)) - 4) + (PIC_X * 0.5) - getWidth(TexthDC, (Trim$(Name)))
    TextY = ((ConvertMapY(ItemY * PIC_Y)) - PIC_Y) + (PIC_Y * 0.5)

    ' Draw name
  Call DrawText(TexthDC, TextX, TextY, Name, color)

    ' Error handler
  Exit Sub
errorhandler:
    HandleError "DrawItemName", "modText", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub

End Sub 
```In modDirectDraw7 find
```
' draw npc names
  For i = 1 To Npc_HighIndex
        If MapNpc(i).num > 0 Then
            Call DrawNpcName(i)
        End If
    Next
```
Under add
```
  'Draw ItemNames on map
  If NumItems > 0 Then
        For i = 1 To MAX_MAP_ITEMS
            If MapItem(i).num > 0 Then
                If Item(MapItem(i).num).Rarity > 0 Then
                    Call DrawItemName(MapItem(i).x, MapItem(i).y, MapItem(i).num)
                End If
            End If
        Next
    End If
```

**Jcsnider**
http://www.touchofdeathforums.com/smf2/index.php/topic,80490.msg861647.html#msg861647

**General-Pony**
http://www.touchofdeathforums.com/smf2/index.php/topic,80617.msg863114.html#msg863114

**Duck**
http://www.touchofdeathforums.com/smf2/index.php/topic,80543.0.html
Link to comment
Share on other sites

  • 2 weeks later...

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...