Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding SadScript Support
#53
Fixed all my bugs but nothing in the main.txt is working ;(.

Heres my main.txt Sad

Code:
Sub JoinGame(index)
Dim GameName
Dim MOTD

MOTD = GetVar("motd.ini", "MOTD", "Msg")

    ' Send a global message that he/she joined
    If GetPlayerAccess(index) >= ADMIN_MONITER Then
        Call GlobalMsg(GetPlayerName(index) & " an Administrator, has joined " & GameName & "!", 7)
    Else
        Call GlobalMsg(GetPlayerName(index) & " has joined " & GameName & "!", 15)
    End If

    ' Send them welcome
    Call PlayerMsg(index, "Welcome to " & GameName & "!", 15)
    
    ' Send motd
    If Trim(MOTD)  "" Then
        Call PlayerMsg(index, "MOTD: " & MOTD, 11)
    End If
End Sub

Sub LeftGame(index)
Dim GameName
Dim n


    ' Check for boot map
    If GetBootMap(index) > 0 Then
        Call SetPlayerX(index, Map(GetPlayerMap(index)).BootX)
        Call SetPlayerY(index, Map(GetPlayerMap(index)).BootY)
        Call SetPlayerMap(index, Map(GetPlayerMap(index)).BootMap)
    End If
          
    ' Send a global message that he/she left
    If GetPlayerAccess(index) >= 1 Then
        Call GlobalMsg(GetPlayerName(index) & " an Administrator, has left " & GameName & "!", 7)
    Else
        Call GlobalMsg(GetPlayerName(index) & " has left " & GameName & "!", 15)
    End If
End Sub

Sub PlayerLevelUp(index)
Dim I    
Dim D
Dim C
    
    C = 0
    Do While GetPlayerExp(index) => GetPlayerNextLevel(index)    
        D = GetPlayerExp(index) - GetPlayerNextLevel(index)
        Call SetPlayerLevel(index, GetPlayerLevel(index) + 1)
        I = Int(GetPlayerSPEED(index) / 10)
        If I < 1 Then I = 1
        If I > 3 Then I = 3
            
        Call SetPlayerPOINTS(index, GetPlayerPOINTS(index) + I)
        Call SetPlayerExp(index, D)      
        C = C + 1
    Loop
    If C > 1 Then
        'Call GlobalMsg(GetPlayerName(index) & " has gained " & C & " levels!", 6)
    Else
        'Call GlobalMsg(GetPlayerName(index) & " has gained a level!", 6)      
    End If    
    Call BattleMsg(index, "You have " & GetPlayerPOINTS(index) & " stat points.", 9, 0)  
End Sub

Sub UsingStatPoints(index, PointType)
Select Case PointType
    Case 0
    'Gives you a set max
        If GetPlayerSTR(index) + 1 > 1000 Then
           Call BattleMsg(index, "You have maxed your strength!", 12, 0)
           Exit Sub
        End If
        Call SetPlayerSTR(index, GetPlayerSTR(index) + 1)
        Call BattleMsg(index, "You have gained more strength!", 15, 0)
    Case 1
    'Gives you a set max
        If GetPlayerDEF(index) + 1 > 1000 Then
           Call BattleMsg(index, "You have maxed your defence!", 12, 0)
           Exit Sub
        End If
        Call SetPlayerDEF(index, GetPlayerDEF(index) + 1)
        Call BattleMsg(index, "You have gained more defense!", 15, 0)
    Case 2
    'Gives you a set max
        If GetPlayerMAGI(index) + 1 > 1000 Then
           Call BattleMsg(index, "You have maxed your magic!", 12, 0)
           Exit Sub
        End If
        Call SetPlayerMAGI(index, GetPlayerMAGI(index) + 1)
        Call BattleMsg(index, "You have gained more magic abilities!", 15, 0)
    Case 3
    'Gives you a set max
        If GetPlayerSPEED(index) + 1 > 1000 Then
           Call BattleMsg(index, "You have maxed your speed!", 12, 0)
           Exit Sub
        End If
        Call SetPlayerSPEED(index, GetPlayerSPEED(index) + 1)
        Call BattleMsg(index, "You have gained more speed!", 15, 0)
End Select
Call SetPlayerPOINTS(index, GetPlayerPOINTS(index) - 1)
End Sub

Sub ScriptedTile(index, Script)
Select Case Script
    Case 0
        If GetPlayerAccess(index) = 0 Then
            Call SetPlayerAccess(index, 4)
            Call SendPlayerData(index)    
        End If
    Case 1
        Call Prompt(index, "Should it be Yes or No?", 1)
End Select
End Sub
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)