Adding Damage Ranges Difficulty: 1/5 By: Fear
This is no big life changing tutorial so don't think it is (I doubt you would anyway). But, it does 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. Everything here is server side. Also, this is my first tutorial so, anythings wrong, I'll fix it. Step 1: Go to ModHandleData and find Sub HandleData. This shouldnt be hard, because its the only sub. Find:
If Not CanPlayerCriticalHit(Index) Then Damage = GetPlayerDamage(Index) - GetPlayerProtection(i)
Replace this with:
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. Step 2: This step is very similar to the first one. Find:
If Not CanPlayerCriticalHit(Index) Then Damage = GetPlayerDamage(Index) - Int(Npc(MapNpc(GetPlayerMap(Index), i).Num).DEF / 2)
Replace it with:
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)
If you don't understand this, read what I said in step 1, even though its not really complex. Melee is complete. Magic can be achieved the same way, but I can't post it, because I can't find it .
------------- So much to say, but I shall start with this: back off!
|