Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Damage Ranges
#1
Author: Fear
Difficulty: 1/5

This is no big life changing tutorial, so don't think it is (I doubt you would anyway). It does, however, add a nice change to the game, because you don't always do the same damage. You do anywhere from 80% to 100% of it.

:: SERVER SIDE ::
Go to ModHandleData and find Sub HandleData.

Find:
Code:
If Not CanPlayerCriticalHit(Index) Then
            Damage = GetPlayerDamage(Index) - GetPlayerProtection(i)
Replace this with:
Code:
If Not CanPlayerCriticalHit(Index) Then
            n = Int((((GetPlayerDamage(Index) / 5) * 4) * Rnd) + 1)
              If n < (n * 4 / 5) Then

                  n = (n * 4 / 5)

              End If
            Damage = n - GetPlayerProtection(i)
All the new code does, is randomize possible damage from 80% to 100%, and then subtracts your foes armor from it. Simple enough, PvP now has damage ranges.

Find:
Code:
If Not CanPlayerCriticalHit(Index) Then
            Damage = GetPlayerDamage(Index) -  
              Int(Npc(MapNpc(GetPlayerMap(Index), i).Num).DEF / 2)

Replace it with:
Code:
If Not CanPlayerCriticalHit(Index) Then
            n = Int((((GetPlayerDamage(Index) / 5) * 4) * Rnd) + 1)
              If n < (n * 4 / 5) Then

                  n = (n * 4 / 5)

              End If
               Damage = n -  
            Int(Npc(MapNpc(GetPlayerMap(Index), n).Num).DEF / 2)
That's all!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)