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

Spell Type AMMO/ARROW question


DarkDino
 Share

Recommended Posts

Hello EO, have a question. I edit this system [http://www.eclipseorigins.com/community/index.php?/topic/132401-eo-spell-type-item-creation/](http://www.eclipseorigins.com/community/index.php?/topic/132401-eo-spell-type-item-creation/) . I need that when you use a spell, spend one quantity of that item, i edit the Spell_Type_DamageHP code:

When i no have arrows, I can keep using the spell.

```

    Ammo = Spell(spellnum).GItemValue
    Amount = Spell(spellnum).GItemValue

    If Spell(spellnum).Type = SPELL_TYPE_DAMAGEHP Then
    If GetPlayerInvItemNum(index, 1) Then
    TakeInvItem Ammo, Spell(spellnum).GItemNum, Spell(spellnum).GItemValue
    Vital = Vital + Round((GetPlayerStat(index, Stats.intelligence) * 0.6))
    Else
    Call PlayerMsg(index, "NO HAY FLECHAS.", BrightRed)
    Vital = -1
    End If
    End If
    End If
```

The problem is this " If GetPlayerInvItemNum(index, 1) Then " what variable i need use?.
Link to comment
Share on other sites

Don't Work :/ 

```
Ammo = Spell(spellnum).GItemValue
Amount = Spell(spellnum).GItemValue

If Spell(spellnum).Type = SPELL_TYPE_DAMAGEHP Then
If GetPlayerInvItemNum(index, Ammo) Then
If GetPlayerInvItemNum(index, Ammo) <= 0 Then Exit Sub
'If GetPlayerEquipment(index, 4) Then
TakeInvItem Ammo, Spell(spellnum).GItemNum, Spell(spellnum).GItemValue
Vital = Vital + Round((GetPlayerStat(index, Stats.intelligence) * 0.6))
Else
Call PlayerMsg(index, "NO HAY FLECHAS.", BrightRed)
Vital = -1
End If
End If
End If

```
I can use the spell without having the arrows, just by putting an item in inventory slot 1
Link to comment
Share on other sites

  • 2 weeks later...
Thanks! but is not all. I needed change "If GetPlayerInvItemNum" to

```
If Spell(spellnum).Type = SPELL_TYPE_AMMO Then
If HasItem(index, Ammo) <= Amount Then
'Call PlayerMsg(index, "You Dont Have Any Arrows!", BrightRed)
SendActionMsg mapnum, "No Arrows" & "!", Cyan, ACTIONMSG_SCROLL, GetPlayerX(index) * 32, GetPlayerY(index) * 31
Call SendCooldown(index, spellslot)
Exit Sub
End If
Vital = Vital + Round((GetPlayerStat(index, Stats.intelligence) * 0.6))
Call TakeInvItem(index, Ammo, Amount)
End If

```
This solved.
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...