FANDOM


Function Main()

    Player = Actor()
    Target = ContextActor()

    ;Check for valid target, PvP?
    If(Target = 0)
        Output(Player, "Selected target invalid")
        Return
    EndIf

    ;Check enough mana
    ManaLevel = Attribute(Player, "Mana")
    If(ManaLevel < 10)
        Output(Player, "Insufficient mana, spell failed")
        Return
    EndIf
   
    SetAttribute(Player, "Mana", ManaLevel -10)

    ;Particles and casting animation
    AnimateActor(Player, "Magic Cast", 0.05, 1)

    ;Fire projectile
    FireProjectile(Player, Target, "Fireball")

End Function