Mirage Engine
Damage Ranges - Printable Version

+- Mirage Engine (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49)
+---- Thread: Damage Ranges (/showthread.php?tid=45)



Damage Ranges - Tutorial Bot - 01-06-2006

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!