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

Spell AoE


Alerd
 Share

Recommended Posts

Hi all i have small problem with AoE spell

as you can see it is not easy charm that would appear to have been in the middle of a spell

```
Function InUseArea(ByVal index As Long, ByVal SpellNum As Long)
Dim i As Long, n As Byte
Dim Mapa As Long, x As Byte, y As Byte

    n = Spell(SpellNum).AoE
    Mapa = GetPlayerMap(index)

    For x = 0 To n
        For y = 0 To n
            SendAnimation Mapa, Spell(SpellNum).SpellAnim, GetPlayerX(index) - x, GetPlayerY(index) + y
            SendAnimation Mapa, Spell(SpellNum).SpellAnim, GetPlayerX(index) + x, GetPlayerY(index) + y
            SendAnimation Mapa, Spell(SpellNum).SpellAnim, GetPlayerX(index) - x, GetPlayerY(index) - y
            SendAnimation Mapa, Spell(SpellNum).SpellAnim, GetPlayerX(index) + x, GetPlayerY(index) - y
        Next
    Next

    For i = 1 To MAX_MAP_NPCS
        If MapNpc(Mapa).NPC(i).x = x Then
            If MapNpc(Mapa).NPC(i).y = y Then
                PlayerAttackNpc index, i, Spell(SpellNum).Vital
            End If
        End If
    Next

    For i = 1 To Player_HighIndex
        If i = GetPlayerMap(index) Then Exit Function

        If GetPlayerMap(i) = Mapa Then
            If GetPlayerX(i) = x Then
                If GetPlayerY(i) = y Then
                    PlayerAttackPlayer index, i, Spell(SpellNum).Vital, SpellNum
                End If
            End If
        End If
    Next
End Function
```

![](http://img843.imageshack.us/img843/9446/yd4f.png)
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...