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

A little script help! (New)


aeronx
 Share

Recommended Posts

Hello guys! I've been trying to add full animation for AoE spells.
It doesnt give me any compile error, but aparently it doesnt do anything.
Any ideas why?
Everything on modcombat:

Castpell sub:
```
  If Spell(SpellNum).Type = SPELL_TYPE_DAMAGEHP Then

       If Spell(SpellNum).IsAoE = True Then
           InUseArea index, SpellNum
           DidCast = True
       End If
   End If
```
At the end of modcombat:
```
   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
```

Thanks for your time!
Link to comment
Share on other sites

Yes, there is. But that option doesnt work as intended. If you set it to take 100 items, it will take up to 100, it doesnt check if you have 100 or 2.
What i need is to check 100 items, if player has 99, should not work and do any other thing.
Link to comment
Share on other sites

Thanks all, i did solve it the problem, thanks to GoranM!

I've been thinking on adding a restriction to spells. Like Cast spell 1 to be able to cast spell 2.

Is there any "easy" way to do it? I think that would help many ppl, since with that you can acomplish combo with spells and
it could be a nice feature. Anyone has anything on it? thanks for your time guys!
Link to comment
Share on other sites

Thanks for your fast answer baron! But i think ill need a bit more help than that since i dont know how to actually writte code, i can just modify or add something already written xD
Yep, im that sad XD

* * *

Out of topic.

I've been working on a code for npcs stay in range if they can cast spells or throw projectiles. Basically i want npcs to run away from me if i get close to them.
Maybe you can point me in the right direction, and thanks for your time guys, really appreciate it.

```
If MapNpc(mapnum).NPC(x).y > targetY And  "Npc_behaviour_walkaway" And NPC(NPCNum).range > 0 And Not didwalk Then

                                            If CanNpcMove(mapnum, x, DIR_DOWN) Then

                                                Call NpcMove(mapnum, x, DIR_DOWN, MOVING_WALKING)

                                                didwalk = True

                                            End If

                                        End If

```
Link to comment
Share on other sites

  • 2 weeks later...

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