Print Page | Close Window

Damage Ranges

Printed From: Mirage Source
Category: Tutorials
Forum Name: Submitted Tutorials
Forum Discription: Tutorial submissions for MSE are posted here, waiting for approval
URL: http://ms.shannaracorp.com/backup-forums/forum_posts.asp?TID=522
Printed Date: 20 December 2006 at 6:07pm
Software Version: Web Wiz Forums 8.01 - http://www.webwizforums.com


Topic: Damage Ranges
Posted By: Fear
Subject: Damage Ranges
Date Posted: 22 March 2006 at 3:39pm
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!



Print Page | Close Window

Bulletin Board Software by Web Wiz Forums version 8.01 - http://www.webwizforums.com
Copyright ©2001-2006 Web Wiz Guide - http://www.webwizguide.info