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

Ammunition for Ranged projectile / Spells [3.0]


Exxsamuari
 Share

Recommended Posts

**CHECK OUT** [oǝɹo](http://www.touchofdeathforums.com/community/index.php?/user/67363-o%C7%9D%C9%B9o/) **VERSION FOR NON HARD CODED VERSION OF THIS SCRIPT [HERE](http://www.touchofdeathforums.com/community/index.php?/topic/129037-ammo-for-range-projectiles-30-not-hardcoded/)**

ok i made a easy script to make your projectiles take ammunition like arrows and spells to have runes

THIS IS ALL DONE SERVER SIDE

Make Sure Item 2 Is Projectile Ammunition

Make Sure Item 3 Is Spell Ammunition

Make sure the Ammunition is Currency so you can stack it

–-Projectile---

In Private Sub HandleProjecTileAttack

Under

Dim curProjecTile As Long, i As Long, CurEquipment As Long

Add

If HasItem(Index, 2) <= 0 Then

Call PlayerMsg(Index, "You Dont Have Any Arrows!", BrightRed)

Exit Sub

End If

Call TakeInvItem(Index, 2, 1)

---Spell---

In Public Sub BufferSpell

Under

' make sure the classreq > 0

If ClassReq > 0 Then ' 0 = no req

If ClassReq <> GetPlayerClass(Index) Then

Call PlayerMsg(Index, "Only " & CheckGrammar(Trim$(Class(ClassReq).Name)) & " can use this spell.", BrightRed)

Exit Sub

End If

End If

Add

If HasItem(Index, 3) <= 0 Then

Call PlayerMsg(Index, "you Dont Have Any Runes!", BrightRed)

Exit Sub

End If

Call TakeInvItem(Index, 3, 1)

And Easy as that you have Ammo For spells Or Projectiles =)
Link to comment
Share on other sites

Yeah i was searching for this a long time ago, thank you bro! ![:D](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/biggrin.png)

But

> Nice addition, is there a way to add a checkbox to the spell editor to confirm whether or not it uses ammo?

And can make special Ammu for only one item choose, and no one ammu for all items. Thanks. =)
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...