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

[EO 2.0] Two-Handed Weapon [Updated]


Matt
 Share

Recommended Posts

A massive thank you to Growlith1223 and Soul for helping me :)
This tutorial will give you the option to make weapons as a two handed weapons. This will unequip shields if one is worn and unequip two handed weapons if a shield is equipped.
This is the updated version.

Client side:

Go to FrmEditorItem and place a checkbox wherever you want. Name it: ChkTwoh.
Double click on it. Paste this:

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

    If chkTwoh.Value = 0 Then
        Item(EditorIndex).istwohander = False
    Else
        Item(EditorIndex).istwohander = True
    End If

    ' Error handler
    Exit Sub
errorhandler:
    HandleError "chkTwoh", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
```
Now we will go to modTypes and at the bottom of

```
Private Type ItemRec
    Name As String * NAME_LENGTH
    Desc As String * 255
    Sound As String * NAME_LENGTH

    Pic As Long
    Type As Byte
    Data1 As Long
    Data2 As Long
    Data3 As Long
    ClassReq As Long
    AccessReq As Long
    LevelReq As Long
    Mastery As Byte
    Price As Long
    Add_Stat(1 To Stats.Stat_Count - 1) As Byte
    Rarity As Byte
    Speed As Long
    Handed As Long
    BindType As Byte
    Stat_Req(1 To Stats.Stat_Count - 1) As Byte
    Animation As Long
    Paperdoll As Long
```
we will put there

```
    istwohander As Boolean
```
Now we head on over to modGameEditors.
Find:```
Public Sub ItemEditorInit()
```
Under```
        ' Type specific settings
        If (frmEditor_Item.cmbType.ListIndex >= ITEM_TYPE_WEAPON) And (frmEditor_Item.cmbType.ListIndex <= ITEM_TYPE_SHIELD) Then
            frmEditor_Item.fraEquipment.Visible = True
            frmEditor_Item.scrlDamage.Value = .Data2
            frmEditor_Item.cmbTool.ListIndex = .Data3

            If .Speed < 100 Then .Speed = 100
            frmEditor_Item.scrlSpeed.Value = .Speed
```
we'll put there```
            If Item(EditorIndex).istwohander Then
            frmEditor_Item.chkTwoh.Value = 1
        Else
            frmEditor_Item.chkTwoh.Value = 0
        End If
```
Save and compile.

Server:

Go to modTypes and at the bottom of

```
Private Type ItemRec
    Name As String * NAME_LENGTH
    Desc As String * 255
    Sound As String * NAME_LENGTH

    Pic As Long
    Type As Byte
    Data1 As Long
    Data2 As Long
    Data3 As Long
    ClassReq As Long
    AccessReq As Long
    LevelReq As Long
    Mastery As Byte
    Price As Long
    Add_Stat(1 To Stats.Stat_Count - 1) As Byte
    Rarity As Byte
    Speed As Long
    Handed As Long
    BindType As Byte
    Stat_Req(1 To Stats.Stat_Count - 1) As Byte
    Animation As Long
    Paperdoll As Long
```
we will put there

```
    istwohander As Boolean
```
Now we go to ModPlayer

```
Dim n As Long, i As Long, tempItem As Long, x As Long, y As Long, itemnum As Long
```This is the second line of code in that sub. We will add on to that this```
, b As Long, j As Long
```
Right under what we just pasted, put there```
    For j = 1 To MAX_INV
    Next

    b = FindOpenInvSlot(index, j)
```
find:```
Case ITEM_TYPE_WEAPON
```in mod player. Right under```
' access requirement
                If Not GetPlayerAccess(index) >= Item(itemnum).AccessReq Then
                    PlayerMsg index, "You do not meet the access requirement to equip this item.", BrightRed
                    Exit Sub
                End If
```
We will put there```
If Item(itemnum).istwohander = True Then
                    If GetPlayerEquipment(index, Shield) > 0 Then
                        If GetPlayerEquipment(index, Weapon) > 0 Then
                            If b < 1 Then
                                Call PlayerMsg(index, "You have no room in your inventory.", BrightRed)
                                Exit Sub
                                End If
                            End If
                        End If
                    End If
```
Scroll further down (still in the case weapon) and find```
Call SendWornEquipment(index)
                Call SendMapEquipment(index)
```
Right under that, we will put there```
If Item(itemnum).istwohander = True Then
                If GetPlayerEquipment(index, Shield) > 0 Then
                GiveInvItem index, GetPlayerEquipment(index, Shield), 0
                SetPlayerEquipment index, 0, Shield
                End If
                End If

                Call SendWornEquipment(index)
                Call SendMapEquipment(index)
```
now find```
Call SendWornEquipment(index)
                Call SendMapEquipment(index)
```in```
Case ITEM_TYPE_SHIELD
```
Right under that we will put there

```
If GetPlayerEquipment(index, Weapon) > 0 Then
                    If Item(GetPlayerEquipment(index, Weapon)).istwohander = True Then
                GiveInvItem index, GetPlayerEquipment(index, Weapon), 0
                SetPlayerEquipment index, 0, Weapon
                End If
                End If

                Call SendWornEquipment(index)
                Call SendMapEquipment(index)
```

Save, compile, and enjoy.
Link to comment
Share on other sites

this code doing this - if you equip weapon that have value istwohander checked it will unequip equiped shield and equiped weapon and equip that 2handed weapon, thats all

its not code for double weapons like if u equip dagger, u will have dagger in left and right hand.

U can edit this code to make that if u equip for example dagger it will give that item to weapon slot and to shield slot too and make paperdoll that has dagger in left and right hand
Link to comment
Share on other sites

Deathbeam, I know that it will auto un-equip shield slot and equip item slot. And I also know it is possible for doing a dagger in two hands. But my question was will the paperdoll appear as the character is holding one hand with the weapon or 2 hands. Well Zetasis answered my question. And Sigridunset double weapons can be made possibile with a certain type of weapon equiped in the weapon slot. That way there is no worry about double points because not all weapons will give this stat. 

P.S Deathbeam are you Tsulny?
Link to comment
Share on other sites

yes im tslusny and im now trying to make if you equip a weapon that have dagger stat it will equip that weapon to weapon slot and if u equip another dagger it will check if weapon slot is free and if not it will unequip shield and equip that dagger on shield slot. Im modifing PlayerUnequipItem sub and UseItem sub.
Link to comment
Share on other sites

@Zetasis:

> If you're using paperdolled items just make two weapons for the paperdolled image. It's that simple.

+ 1 to you. No tutorial is neccesary. Just make the item image two daggers and the paperdoll two daggers.
Link to comment
Share on other sites

Ok i maked this (i will add tutorial in few minutes) - if u equip weapon that has dagger attribute checked, it will equip it on weapon slot, and if u have equipped weapon and shield , it will unequip weapon and equip dagger on that slot and if u equip another dagger, it will unequip shield and equip that dagger on shield slot.

But i need help with paperdolling. I tried to make this - if dagger is equipped on shield slot, it will change DaggerEq boolean to true ( and i added DaggerEq to ItemRec) and on client side i tried to add scrollbar similar do Paperdoll scrollbar, but it will give atribute Item(EditorIndex).DaggerPaperdoll and i tried to add DaggerPaperdoll as Long attribute to ItemRec

on sub BltPaperdoll i tried to add check

If Item(GetPlayerEquipment(Index, PaperdollOrder(I)))).DaggerEq = True Then
Call BltPaperdoll(x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(I))).DaggerPaperdoll, Anim, SpriteTop)
Else
Call BltPaperdoll(x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(I))).Paperdoll, Anim, SpriteTop)

But it dont worked
Link to comment
Share on other sites

@Deathbeam:

> Ok i maked this (i will add tutorial in few minutes) - if u equip weapon that has dagger attribute checked, it will equip it on weapon slot, and if u have equipped weapon and shield , it will unequip weapon and equip dagger on that slot and if u equip another dagger, it will unequip shield and equip that dagger on shield slot.
>
> But i need help with paperdolling. I tried to make this - if dagger is equipped on shield slot, it will change DaggerEq boolean to true ( and i added DaggerEq to ItemRec) and on client side i tried to add scrollbar similar do Paperdoll scrollbar, but it will give atribute Item(EditorIndex).DaggerPaperdoll and i tried to add DaggerPaperdoll as Long attribute to ItemRec
>
> on sub BltPaperdoll i tried to add check
>
> If Item(GetPlayerEquipment(Index, PaperdollOrder(I)))).DaggerEq = True Then
> Call BltPaperdoll(x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(I))).DaggerPaperdoll, Anim, SpriteTop)
> Else
> Call BltPaperdoll(x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(I))).Paperdoll, Anim, SpriteTop)
>
> But it dont worked

Why are you posting your progress on a completely different tutorial on my tutorial?
Link to comment
Share on other sites

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