FANDOM


Created by Piysta on the RealmCrafte: Community Edition forum.

Using "RC_Core.rcm"
; Shards of Antharia
; Date/Time: 10:24:53 AM on 3/5/2012
; By Dillan Cobb on COBB-PC

Function Main()
; AOE spell test!

Player = Actor()
Target = NextActorInZone(Player)

CreateEmitter(Player, "Aoe", 10, 500)

If Target <> Player
    Repeat
        Dmgtrue% = 0
        DistCheck# = ActorDistance(Player, Target)
        If DistCheck < 13.5
            Dmgtrue% = 1
        EndIf
        TargetFaction$ = HomeFaction(Target)
        FactionRate% = FactionRating(Player, TargetFaction)
        If FactionRate > 0
            DmgTrue% = 0
        EndIf
        If DmgTrue = 1
            EnemyHealth% = Attribute(Target, "Health")
            DamageAmount% = Rand (1, 40) + 500
            DamageDealt% = EnemyHealth - DamageAmount
            TargetsTarget = ActorTarget(Target)
            If TargetsTarget > 0
                AggroCal = Rand (1, 4)
                If AggroCal = 1
                    SetActorTarget(Target, Player)
                    SetActorAIState(Target, 3)
                EndIf
            EndIf
            If TargetsTarget = 0
                SetActorTarget(Target, Player)
                SetActorAIState(Target, 3)
            EndIf
            If DamageAmount < EnemyHealth
                SetAttribute(Target, "Health", DamageDealt)
                EnemyName$ = Name(Target)
                Output(Player, EnemyName + " received " + DamageAmount + " damage.", 255, 255, 255)
            Else
                KillActor(Target, Player)
                Target = NextActorInZone(Player)
            EndIf
        EndIf
        Target = NextActorInZone(Target)
    Until Player = Target
EndIf
End Function