Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
#20 moving code to modProcessEvents
Browse files Browse the repository at this point in the history
  • Loading branch information
clowenhg committed Feb 9, 2014
1 parent 97809e7 commit c99fe2d
Show file tree
Hide file tree
Showing 2 changed files with 259 additions and 215 deletions.
223 changes: 8 additions & 215 deletions DirectXClient/DirectXClient/modProcess.bas
Original file line number Diff line number Diff line change
Expand Up @@ -123,226 +123,19 @@ Sub ProcessString(PacketID As Long, St As String)
modProcessEvents.Say St

Case 12 'You joined map
If Len(St) = 13 Then
If MapEdit = True Then CloseMapEdit
'Destroy Projectiles
For A = 1 To MaxProjectiles
DestroyEffect A
Next A
For A = 1 To MaxFloatText
ClearFloatText A
Next A
For A = 1 To MaxUsers
Player(A).HP = 0
Next A

'If Map = 0 then we're just logging in
If CMap = 0 Then
Tick = timeGetTime
Character.LastMove = Tick
St1 = vbNullString
B = 0
For A = 1 To MaxUsers
With Player(A)
If .Sprite > 0 And A <> Character.index And Not .status = 25 Then
B = B + 1
St1 = St1 + ", " + .name
End If
End With
Next A
Character.IsDead = False
SetHP GetMaxHP
SetEnergy GetMaxEnergy
SetMana GetMaxMana

LoadOptions
Load frmMain

If B > 0 Then
St1 = Mid$(St1, 2)
PrintChat "Welcome to the Odyssey Online Classic!", 15
PrintChat "There are " + CStr(B) + " other players online:", 15
PrintChat St1, 15
Else
PrintChat "Welcome to the Odyssey Online Classic!", 15
PrintChat "There are no other users currently online.", 15
End If
PrintChat MOTDText, 11
End If

SetMap Asc(Mid$(St, 1, 1)) * 256 + Asc(Mid$(St, 2, 1))
CX = Asc(Mid$(St, 3, 1))
CY = Asc(Mid$(St, 4, 1))
CDir = Asc(Mid$(St, 5, 1))
CXO = CX * 32
CYO = CY * 32
For A = 0 To MaxMonsters
Map.Monster(A).Monster = 0
Next A
For A = 0 To MaxMapObjects
Map.Object(A).Object = 0
Map.Object(A).ItemPrefix = 0
Map.Object(A).ItemSuffix = 0
Next A
For A = 0 To 9
Map.Door(A).Att = 0
Next A
For A = 1 To MaxUsers
Player(A).Map = 0
Next A
ClearLighting
Freeze = True
LoadMapFromCache CMap
If RequestedMap = False Then
If Map.Version <> Asc(Mid$(St, 6, 1)) * 16777216 + Asc(Mid$(St, 7, 1)) * 65536 + Asc(Mid$(St, 8, 1)) * 256& + Asc(Mid$(St, 9, 1)) Or CheckSum(MapData) <> Asc(Mid$(St, 10, 1)) * 16777216 + Asc(Mid$(St, 11, 1)) * 65536 + Asc(Mid$(St, 12, 1)) * 256& + Asc(Mid$(St, 13, 1)) Then
RequestedMap = True
SendSocket Chr$(45)
Else
ShowMap
End If
End If
End If
modProcessEvents.JoinMap St

Case 13 'Error creating character
If frmWait_Loaded = True Then Unload frmWait
frmNewCharacter.Show
MsgBox "That name is already in use, please try another!", vbOKOnly + vbExclamation, TitleString

modProcessEvents.ErrorCreatingCharacter St

Case 14 'New Map Object
If Len(St) = 11 Then
A = Asc(Mid$(St, 1, 1))
If A <= MaxMapObjects Then
With Map.Object(A)
.Object = GetInt(Mid$(St, 2, 2))
.X = Asc(Mid$(St, 4, 1))
.Y = Asc(Mid$(St, 5, 1))
.ItemPrefix = Asc(Mid$(St, 6, 1))
.ItemSuffix = Asc(Mid$(St, 7, 1))
B = Int(Rnd * 9)
.XOffset = B
B = Int(Rnd * 9)
.YOffset = B
.value = Asc(Mid$(St, 8, 1)) * 16777216 + Asc(Mid$(St, 9, 1)) * 65536 + Asc(Mid$(St, 10, 1)) * 256& + Asc(Mid$(St, 11, 1))
.PickedUp = 0
RedrawMapTile CLng(.X), CLng(.Y)
End With
End If
End If

modProcessEvents.NewMapObject St

Case 15 'Erase Map Object
If Len(St) = 1 Then
A = Asc(Mid$(St, 1, 1))
If A <= MaxMapObjects Then
With Map.Object(A)
.Object = 0
.ItemPrefix = 0
.ItemSuffix = 0
.value = 0
.PickedUp = 0
RedrawMapTile CLng(.X), CLng(.Y)
End With
End If
End If
modProcessEvents.EraseMapObject St

Case 16 'Error messages
If Len(St) >= 1 Then
Select Case Asc(Mid$(St, 1, 1))
Case 0 'Custom
If Len(St) > 2 Then
PrintChat Mid$(St, 2), 7
End If
Case 1 'Inv full
PrintChat "Your inventory is full!", 7
Case 2 'Map full
PrintChat "There is too much already on the ground here to drop that.", 7
Case 3 'No such object
PrintChat "No such object.", 7
Case 4 'No such player
PrintChat "No such player.", 7
Case 5 'No such monster
PrintChat "No such monster.", 7
Case 6 'Player is too far away
PrintChat "Player is too far away.", 7
Case 7 'Monster is too far away
PrintChat "Monster is too far away.", 7
Case 8 'You cannot use that
PrintChat "You cannot use that object.", 7
Case 9 'Friendly Zone - can't attack
PrintChat "This is a friendly area, you cannot attack here!", 7
Case 10 'Cannot attack immortal
PrintChat "You may not attack an immortal!", 7
Case 11 'You are an immortal
PrintChat "Immortals may not attack other players!", 7
Case 12 'Can't attack monsters here
PrintChat "You cannot attack these monsters!", 7
Case 13 'Ban list full
PrintChat "The ban list is full!", 7
Case 14 'Not invited to join
PrintChat "You have not been invited to join any guild.", 7
Case 15 'Not enough cash
PrintChat "You do not have enough gold to do that!", 7
Case 16 'Guild name in use
PrintChat "That name is already used either by another player or guild. Please try another.", 7
Case 17 'Guild full
PrintChat "That guild is full!", 7
Case 18 'too many guilds
PrintChat "Too many guilds already exist. You may join another guild or try again later.", 7
Case 19 'cannot attack player -- he is not in guild
PrintChat "That player is not in a guild -- you may not attack non-guild players.", 7
Case 20 'cannot attack player -- you are not in guild
PrintChat "You must be a member of a guild to attack other players.", 7
Case 21 'not in a hall
PrintChat "You are not in a guild hall!", 7
Case 22 'hall already owned
PrintChat "This hall is already owned by another guild.", 7
Case 23 'already have hall
PrintChat "Your guild already owns a hall. You must move out of your old hall before you may purchase a new one.", 7
Case 24 'don't have enough money to buy hall
PrintChat "Your guild does not have enough money in its bank account to buy this hall. Type /guild hallinfo for the price information of this hall.", 7
Case 25 'do not own a guild hall
PrintChat "Your guild does not own a hall.", 7
Case 26 'need 5 members
PrintChat "You must have atleast 5 members in your guild before you may do that.", 7
Case 27 'Can't afford that
PrintChat "You do not have the items required to purchase that!", 7
Case 28 'Not in a bank
PrintChat "You are not in a bank!", 7
Case 29 'too far away
PrintChat "That player is too far away to hit!", 7
Case 30 'must be Level # to join guild
PrintChat "You must be at least Level " + CStr(World.GuildJoinLevel) + " to join a guild!", 7
Case 32 'Must be in a smithy shop
PrintChat "You are not in a blacksmithy shop!", 7
Case 33 'Do not have enough money
PrintChat "You do not have enough money to repair this object!", 7
Case 34 'Do not have specified object
PrintChat "You do not have the object to be repaired!", 7
Case 35 'Not high enough stats
PrintChat "You do not meet the requirements to use this item!", 7
Case 36 'Ammo
PrintChat "This ammo must be used with a projectile weapon!", 7
Case 37 'Ammo
PrintChat "This ammo is not used with this weapon!", 7
Case 40 'Can't use
PrintChat "Your class cannot use this object!", 7
Case 41 'Squelched or Jailed
PrintChat "Nobody hears your pitiful cries.", 7
Case 42 'New Day
PrintChat "A new day dawns in the land of Odyssey!", 7
Case 43 'No Guild MOTD
PrintChat "Your guild does not currently have a message of the day. If you are a lord or a founder, you can set this by typing /guild motd <message>.", 7
Case 44 'Bank is Full
PrintChat "Your bank is full!", 7
Case 45 'E-mail is already saved
PrintChat "Your account already has an e-mail address saved!", 7
Case 46 'E-mail updated
PrintChat "Your e-mail address has been stored!", 7
Case 47 'E-mail needed
PrintChat "You have not entered an email address for your account. Type /email to enter it. This is the only way to recover your account if it is lost or stolen!", 7
Case 48 'Server is being backed up
PrintChat "Server is being backed up.", 7
End Select
End If
Case 16 'Messages
modProcessEvents.Message St

Case 17 'New Inv Object
If Len(St) = 9 Then
Expand Down
Loading

0 comments on commit c99fe2d

Please sign in to comment.