Mirage Source

Free ORPG making software.
It is currently Fri Mar 29, 2024 10:48 am

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Fri Oct 30, 2009 1:05 am 
Offline
Knowledgeable

Joined: Fri May 18, 2007 9:54 pm
Posts: 234
Code:
 If CanPlayerCriticalHit(Index) = False Then
                        Damage = GetPlayerDamage(Index) - Int(Npc(MapNpc(GetPlayerMap(Index), i).num).DEF / 2) + (Rnd * 5) - 2
                        'Call SendDataToMap(GetPlayerMap(Index), SOUND_CHAR & SEP_CHAR & "Blow" & Int(Rnd * 7) + 1 & END_CHAR)
                        Call SendSound(Index, ATTACK_SOUND, SDTM)
                    Else
                    Agi = GetPlayerAgil(Index)
Spd = GetPlayerSPEED(Index)
lvl = GetPlayerLevel(Index)
STR = GetPlayerSTR(Index)

Num1 = (500 + lvl) / (Agi + Spd) + (lvl / 90)

Rand = Random(1, Num1 + (Num1 * 2))


                        N = GetPlayerDamage(Index)
                        'Damage = N + (Random((str + ((str / 2) + Num1)), ((str + ((str / 2) + Num1))) * 2)) - Int(Npc(MapNpc(GetPlayerMap(index), i).num).DEF / 2) + (Rnd * 5) - 2
                        Damage = N + (Random((STR + ((STR / 2) + Num1)), ((STR + ((STR / 2) + Num1))) * 2))
                        Call BattleMsg(Index, "You feel a surge of energy upon swinging!", BrightCyan, 0)


The CanPlayerCriticalHit Function is

Code:
Function CanPlayerCriticalHit(ByVal Index As Long) As Boolean
    Dim i As Long, N As Long
Dim Num1 As Long
Dim Agi As Long
Dim Spd As Long
Dim lvl As Long
Dim STR As Long

Dim Rand As Long

CanPlayerCriticalHit = False


Agi = GetPlayerAgil(Index)
Spd = GetPlayerSPEED(Index)
lvl = GetPlayerLevel(Index)
STR = GetPlayerSTR(Index)

Num1 = (500 + lvl) / (Agi + Spd) + (lvl / 90)

Rand = Random(1, Num1 + (Num1 * 2))



    If GetPlayerWeaponSlot(Index) > 0 Then
        N = Rand

        If N > 6 Then
        CanPlayerCriticalHit = False

            If N <= 6 Then
                CanPlayerCriticalHit = True
            End If
        End If
    Call PlayerMsg(Index, N, White)
    End If

End Function


I made it send a message in the function to see what the number was I was getting. They were all less then 6 which is what it takes for Can Player critical hit = True, but it never critical hits and I dont know why.

_________________
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group