Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Travel System
#1
I just finished programming my travel system. Here you have a screenshot how it looks:
[Image: travelpl8.png]
Just see how simple it is to program, took me like 10 minutes to complete this and the other parts for it. Smile
Code:
Private Sub HandleSMsgTravel(ByVal index As Long, ByVal StartAddr As Long, ByVal ByteLen As Long, ByVal ExtraVar As Long)
Dim Buffer() As Byte
  Dim Destination As Byte, i As Long
  
  Buffer = FillBuffer(StartAddr, ByteLen)
  
  Destination = GetByteFromBuffer(Buffer, True)
  
  If Destination < 1 Or Destination > 3 Then Exit Sub
  
  If Destination = 1 Then
        If TakeGold(index, 1, 40) = True Then
            Call PlayerWarp(index, 15, 16, 9)
            If RandomNumber(1, 10) = 1 Then
                Call TakeItem(index, 1, 20)
            Else
                Call BattleMsg(index, "The ship got you there saftly.", Yellow, 0)
            End If
        Else
            Call BattleMsg(index, "You do not have 40 gold.", Red, 0)
        End If
  ElseIf Destination = 2 Then
        If GetPlayerLevel(index) >= 20 Then
            If TakeGold(index, 1, 40) = True Then
                Call PlayerWarp(index, 60, 6, 10)
                If RandomNumber(1, 10) = 1 Then
                Call TakeItem(index, 1, 20)
            Else
                Call BattleMsg(index, "The ship got you there saftly.", Yellow, 0)
            End If
            Else
                Call BattleMsg(index, "You do not have 40 gold.", Red, 0)
            End If
        Else
            Call BattleMsg(index, "You need to be level 20 or above to travel to this location.", Red, 0)
        End If
  ElseIf Destination = 3 Then
        If GetPlayerLevel(index) >= 35 Then
            If TakeGold(index, 1, 40) = True Then
                Call PlayerWarp(index, 124, 10, 10)
                If RandomNumber(1, 10) = 1 Then
                Call TakeItem(index, 1, 20)
            Else
                Call BattleMsg(index, "The ship got you there saftly.", Yellow, 0)
            End If
            Else
                Call BattleMsg(index, "You do not have 40 gold.", Red, 0)
            End If
        Else
            Call BattleMsg(index, "You need to be level 35 or above to travel to this location.", Red, 0)
        End If
  End If
End Sub
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)