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

I can't find out an NPC's Def in scripting can somebody help?


Syner
 Share

Recommended Posts

Sub OnAttack(Index, Damage)
Dim Target
Dim Range
Dim Level
Dim Power

If Int(GetPlayerTarget(index))  > 0 Then
    Range = Rand(Int(GetPlayerSTR(index) + Int(Damage)) + GetPlayerLevel(Target), Int(GetPlayerSTR(index)+ Int(Damage))  - GetPlayerDef(Target))
End If
If Int(GetPlayerTarget(index)) < 0 Then
    Range = Rand(Int(GetPlayerSTR(index) + Int(Damage)) + GetPlayerLevel(index), Int(GetPlayerSTR(index)+ Int(Damage)) - GetPlayerLevel(index))
End If

  If Int(Range) > 0 Then
      If Int(GetPlayerTarget(Index)) > 0 Then
        Target = GetPlayerTarget(Index)
        Call DamagePlayer(Index, Target, Range)
      Else
        Target = GetPlayerTargetNPC(Index)
        Call DamageNPC(Index, Target, Range)
      End If
  Else
      If Int(GetPlayerTarget(Index)) > 0 Then
        Target = GetPlayerTarget(Index)
        Call DamagePlayer(Index, Target, 0)
      Else
        Target = GetPlayerTargetNPC(Index)
        Call DamageNPC(Index, Target, 0)
      End If

  End If
End Sub

I'm trying to change up somebody's damage range skill and incorporate def in the equation for NPC and players but I can't get the scripts to return the NPC def to givew the damage
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...