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

Spells missing


TWIN BLADEZ
 Share

Recommended Posts

In my project, Im making it so you can walk and cast spells at the same time. Now what I want to so is make it so when you walk you have a 25% chance of missing but i don't know the commands to do it. I found where to put it:

```
  If PlayerSpells(spellslot) > 0 Then
        If GetTickCount > Player(MyIndex).AttackTimer + 1000 Then
            If Player(MyIndex).Moving = 0 Then
                Set Buffer = New clsBuffer
                Buffer.WriteLong CCast
                Buffer.WriteLong spellslot
                SendData Buffer.ToArray()
                Set Buffer = Nothing
                SpellBuffer = spellslot
                SpellBufferTimer = GetTickCount
            Else
                [u]Call AddText("Cannot cast while walking!", BrightRed)[/u]
            End If
        End If
```
But as I said before. I have no idea what to put there. Also i'm sorry it sounds like i want you to spoon feed me but this little feature will make a huge different.

Thanks in Advance
Link to comment
Share on other sites

  • 2 weeks later...
In the case else, which would be the character moving, simply place something like:

```
dim Rnum
rnum = rand(100,1)
if Rnum => 25 then
Set Buffer = New clsBuffer
                Buffer.WriteLong CCast
                Buffer.WriteLong spellslot
                SendData Buffer.ToArray()
                Set Buffer = Nothing
                SpellBuffer = spellslot
                SpellBufferTimer = GetTickCount
                exit sub
elseif Rnum < 25 then
Call AddText("Your attempt to cast the spell has failed!", BrightRed)
end if

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