Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Random Damage for melee players and NPC'S.
#1
This tutorial is simple to follow and is very good and simple.
0.5/5 Difficulty
1/5 Understanding code


Ok lets begin.
This is all server side code btw.

Go to Game logic and put at bottom of it

add:


Code:
Public Function Rand(ByVal low As Long, high As Long) As Long
    Rand = Int((high - low + 1) * Rnd) + low
End Function

Now find
Code:
If Not CanPlayerCriticalHit(index) Then

change

Code:
Damage = GetPlayerDamage(Index) - GetPlayerProtection(i)

with

Code:
Damage = GetPlayerDamage(index)
          Damage = Rand(Damage * 0.8, Damage * 1.1)

This should help you guys learn some more of damage ranges, ill let you figure out how to do it with Magic damage ranges and how to make it have damage ranges when you attack Npcs.. Dont want everyone copying and pasting Wink. Hope it helps
also had help from Dugor
if there is any problems message me about it
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)