DarkDino Posted August 25, 2013 Author Share Posted August 25, 2013 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 More sharing options...
hisherwin Posted August 26, 2013 Share Posted August 26, 2013 I made that tutorial , and ask Shino to post it for me.. what seems to be the problem there?and you just need to have a Main check if they have the item or notlike:```If GetPlayerInvItem(index, AmmoNum) <= 0 Then Exit Sub``` Link to comment Share on other sites More sharing options...
DarkDino Posted August 26, 2013 Author Share Posted August 26, 2013 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 More sharing options...
hisherwin Posted August 26, 2013 Share Posted August 26, 2013 ??Ammo = Spell(spellnum).GItemValueIt's value , you must change it on Itemnum Link to comment Share on other sites More sharing options...
DarkDino Posted September 9, 2013 Author Share Posted September 9, 2013 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now