Valentine90 Posted December 21, 2012 Author Share Posted December 21, 2012 **Sorry my english**Hello friends, I think we all know how a system of rank, something essential for a true MMORPG, know that there are some systems rank around and perhaps many of you already have, but this is a simple and complete do- so, system fully tested and approved.**Open Client****1 -** In frmMain, create a Picturebox called **picRank**![](http://img824.imageshack.us/img824/4513/57744486.png)**2 -** Within the picRank create a ListBox called **lstRank**![](http://img811.imageshack.us/img811/9121/60970805.png)**3 -** Create a button called **cmdRefresh**![](http://img543.imageshack.us/img543/7374/54104775.png)**Obs.:** It should stay like this:![](http://img5.imageshack.us/img5/3637/imgahp.png)**4 -** Select the Option Visible False in the picRank![](http://img442.imageshack.us/img442/3285/69569137.png)**5 -** In same button **cmdRefresh**, double-click and replace:```Private Sub cmdRefresh_Click()End Sub```**6 -** By:```Private Sub cmdRefresh_Click()' If debug mode, handle error then exit outIf Options.Debug = 1 Then On Error GoTo errorhandlerSendRequestRank' Error handlerExit Suberrorhandler:HandleError "cmdRefresh_Click", "frmMain", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit SubEnd Sub```**7 -** In **modConstants**, search for:```Public Const MAX_PARTY_MEMBERS As Long = 4```**8 -** Below add:```Public Const MAX_RANK As Long = 10```**9 -** At the end of **modClientTCP**, add:```Public Sub SendRequestRank()Dim Buffer As clsBuffer' If debug mode, handle error then exit outIf Options.Debug = 1 Then On Error GoTo errorhandlerSet Buffer = New clsBufferBuffer.WriteLong CRequestRankSendData Buffer.ToArray()Set Buffer = Nothing' Error handlerExit Suberrorhandler:HandleError "SendRequestRank", "modClientTCP", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit SubEnd Sub```**10 -** In **modEnumerations**, search for:```' Make sure CMSG_COUNT is below everything else```**11 -** Above this line and below of:```CPartyLeave```**12 -** Add:```CRequestRank```**Obs.:**It should stay like this:![](http://img826.imageshack.us/img826/4250/27115231.png)**13 -** Still in **modEnumerations**, search for:```' Make sure SMSG_COUNT is below everything else```**14 -** Above this line and below of:```SPartyVitals```**15 -** Add:```SRankUpdate```**16 -** In **modHandleData**, search for:```HandleDataSub(SPartyVitals) = GetAddress(AddressOf HandlePartyVitals)```**17 -** Below add:```HandleDataSub(SRankUpdate) = GetAddress(AddressOf HandleRankUpdate)```**18 -** At the end of **modHandleData**, add:```Private Sub HandleRankUpdate(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)Dim Buffer As clsBuffer, i As Byte' If debug mode, handle error then exit outIf Options.Debug = 1 Then On Error GoTo errorhandlerSet Buffer = New clsBufferBuffer.WriteBytes Data()frmMain.lstRank.ClearFor i = 1 To MAX_RANKfrmMain.lstRank.AddItem i & ":Level: " & Buffer.ReadLong & ", Name: " & Trim$(Buffer.ReadString)Next iSet Buffer = Nothing' Error handlerExit Suberrorhandler:HandleError "HandleRankUpdate", "modHandleData", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit SubEnd Sub```**19 -** In **modInput**, search for:``` ' Whos OnlineCase "/who"SendWhosOnline```**20 -** Below add:``` ' Request RankCase "/rank"SendRequestRankfrmMain.picRank.Visible = Not frmMain.picRank.Visible```**21 -** In **modGeneral**, search for:```frmMain.picParty.Visible = False```**22 -** Below add:```frmMain.picRank.Visible = False```**Open Server****1 -** In **modConstants**, search for:```Public Const MAX_PARTY_MEMBERS As Long = 4```**2 -** Below add:```Public Const MAX_RANK As Long = 10```**3 -** In **modEnumerations**,search for:```' Make sure SMSG_COUNT is below everything else```**4 -** Above this line and below of:```SPartyVitals```**5 -** Add:```SRankUpdate```**6 -** Still in **modEnumerations**, search for:```' Make sure CMSG_COUNT is below everything else```**7 -** Above this line and below of:```CPartyLeave```**8 -** Add:```CRequestRank```**9 -** In **modHandleData**, search for:```HandleDataSub(CPartyLeave) = GetAddress(AddressOf HandlePartyLeave)```**10** - Below Add:```HandleDataSub(CRequestRank) = GetAddress(AddressOf HandleRequestRank)```**11 -** At the end of **modHandleData**, add:```Sub HandleRequestRank(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)SendRankUpdate indexEnd Sub```**12 -** At the end of **modServerTCP**, add:```Sub SendRankUpdate(ByVal index As Long)Dim i As ByteDim Buffer As clsBufferSet Buffer = New clsBufferBuffer.WriteLong SRankUpdateFor i = 1 To MAX_RANKBuffer.WriteLong Rank(i).LevelBuffer.WriteString Trim$(Rank(i).Name)Next iSendDataTo index, Buffer.ToArray()Set Buffer = NothingEnd Sub```**13 -** In **modPlayer**, search for```Sub CheckPlayerLevelUp(ByVal index As Long)```**14 -** Beneath of:```Dim level_count As Long```**15 -** Add:```Dim RankPos As Byte```**16 -** Beneath of:```SendPlayerData index```**17 -** Add:``` ' check rankRankPos = CheckRank(index)If RankPos > 0 ThenChangeRank index, RankPosEnd If```**18 -** At the end of **modPlayer**, add:```Private Function CheckRank(ByVal index As Long) As ByteDim i As ByteFor i = 1 To MAX_RANKIf GetPlayerLevel(index) > Rank(i).Level ThenCheckRank = iExit FunctionEnd IfNext iEnd FunctionPrivate Sub ChangeRank(ByVal index As Long, RankPos As Byte)Dim i As Long, ClearPos As Byte' if not change position in rankIf GetPlayerName(index) = Trim$(Rank(RankPos).Name) ThenRank(RankPos).Level = GetPlayerLevel(index)SaveRankExit SubEnd If' search player in rankFor i = 1 To MAX_RANKIf GetPlayerName(index) = Trim$(Rank(i).Name) ThenRank(i).Name = vbNullStringRank(i).Level = 0ClearPos = iExit ForEnd IfNext i' down clear positionIf ClearPos > 0 ThenFor i = ClearPos To MAX_RANKIf i = MAX_RANK ThenRank(i).Name = vbNullStringRank(i).Level = 0ElseRank(i).Name = Rank(i + 1).NameRank(i).Level = Rank(i + 1).LevelEnd IfNext iEnd If' open space in rank to playerFor i = MAX_RANK To RankPos Step -1If i > RankPos ThenRank(i).Name = Rank(i - 1).NameRank(i).Level = Rank(i - 1).LevelEnd IfNext i' put player in rankRank(RankPos).Name = GetPlayerName(index)Rank(RankPos).Level = GetPlayerLevel(index)SaveRankEnd Sub```**19 -** At the end of **modDatabase**, add:```Public Sub SaveRank()Dim filename As String, i As Bytefilename = App.Path & "\data\rank.ini"For i = 1 To MAX_RANKPutVar filename, "RANK", "Name" & i, Trim$(Rank(i).Name)PutVar filename, "RANK", "Level" & i, Val(Rank(i).Level)Next iEnd SubPublic Sub LoadRank()Dim filename As String, i As Bytefilename = App.Path & "\data\rank.ini"If FileExist(filename, True) ThenFor i = 1 To MAX_RANKRank(i).Name = GetVar(filename, "RANK", "Name" & i)Rank(i).Level = Val(GetVar(filename, "RANK", "Level" & i))Next iElseSaveRankEnd IfEnd Sub```**20 -** In **modTypes**, search for:```Public Party(1 To MAX_PARTYS) As PartyRec```**21 -** Below add:```Public Rank(1 To MAX_RANK) As RankRec```**22 -** Beneath of:```Private Type OptionsRecGame_Name As StringMOTD As StringPort As LongWebsite As StringEnd Type```**23 -** Add:```Private Type RankRecName As String * ACCOUNT_LENGTHLevel As LongEnd Type```**24 -** In **modPlayer**, search for:``` ' Send Resource cacheFor i = 0 To ResourceCache(GetPlayerMap(index)).Resource_CountSendResourceCacheTo index, iNext```**25 -** Below add:``` ' Check RankFor i = 1 To MAX_RANKIf Trim$(Rank(i).Name) = GetPlayerName(index) ThenExit ForEnd IfIf GetPlayerLevel(index) > Rank(i).Level ThenRank(i).Name = GetPlayerName(index)Rank(i).Level = GetPlayerLevel(index)SaveRankExit ForEnd IfNext i```**26 -**In **modGeneral**,search for:``` Call SetStatus("Loading animations...")Call LoadAnimations```**27 -** Below Add:``` Call SetStatus("Loading rank...")Call LoadRank```**Credits:**Valentine Link to comment Share on other sites More sharing options...
DMF Posted December 21, 2012 Share Posted December 21, 2012 can you explain what this kind of rank system is? different ways you can look at it. Link to comment Share on other sites More sharing options...
Draken Posted December 21, 2012 Share Posted December 21, 2012 > can you explain what this kind of rank system is? different ways you can look at it.I agree I was looking at the code and guessing its something to do with party ranks…. maybe???or maybe like after your reach a level you will be come called something else???Exampleat level 1 your a Noobat level 100 your an EPIC Link to comment Share on other sites More sharing options...
Growlith1223 Posted December 21, 2012 Share Posted December 21, 2012 You got it right, Draken…It's using the level as your rank points.It looks pretty nice though. Link to comment Share on other sites More sharing options...
Valentine90 Posted December 21, 2012 Author Share Posted December 21, 2012 System Rank, which exist in all MMORPG where the player ranks higher level. Link to comment Share on other sites More sharing options...
Growlith1223 Posted December 21, 2012 Share Posted December 21, 2012 my rank system is completely different from this x3Mine uses a point system. and when you complete a mission, it gives you points. Link to comment Share on other sites More sharing options...
DMF Posted December 21, 2012 Share Posted December 21, 2012 a game i play "WLO" uses gold ranking, level ranking.not titles o-o Link to comment Share on other sites More sharing options...
Greendude120 Posted December 21, 2012 Share Posted December 21, 2012 > my rank system is completely different from this x3> > Mine uses a point system. and when you complete a mission, it gives you points.That's kinda irrelevant here.This is a ranking list of the highest levels in the game using words like Noob > Pro > God. Hopefully that's clear.I was actually going to make this once I release my game but this will save me time. Thanks for the submission. Link to comment Share on other sites More sharing options...
Growlith1223 Posted December 21, 2012 Share Posted December 21, 2012 > That's kinda irrelevant here.Thanks captain obvious. Anymore obvious things out in the vast world? Link to comment Share on other sites More sharing options...
Greendude120 Posted December 21, 2012 Share Posted December 21, 2012 If it's obvious it's irrelevant, why bother saying it then?"Anymore irrelevant things out in your vast brain?" derp derp Link to comment Share on other sites More sharing options...
Growlith1223 Posted December 22, 2012 Share Posted December 22, 2012 > If it's obvious it's irrelevant, why bother saying it then?> > "Anymore irrelevant things out in your vast brain?" derp derpTook you long enough to come up with a comeback… Link to comment Share on other sites More sharing options...
Masarisx Posted November 10, 2014 Share Posted November 10, 2014 what is the use from * ACCOUNT_LENGTH ? Link to comment Share on other sites More sharing options...
deathtaker26 Posted November 10, 2014 Share Posted November 10, 2014 Dude, The post was from 2012, the people who made this are probably gone. Link to comment Share on other sites More sharing options...
hisherwin Posted November 10, 2014 Share Posted November 10, 2014 > what is the use from * ACCOUNT_LENGTH ?To make sure that the String have defined length when saving.. I don't know how to explain it since i'm not english person, my grammar always mess up so.. i'll just say it in a simple wayYou need to define the length of a string before saving it on a file or a text (This answer is base on my experience, probably wrong or correct.. ) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now