Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • drubrkletern: be honest with me boss
      Today at 01:31:52 AM
    • drubrkletern: now is it really that unique
      Today at 01:31:47 AM
    • SuperNativeZ: COME PLAY THE MOST UNIQUE CUSTOM RSPS #1 [link][link][link]
      December 05, 2019, 09:22:55 PM
    • SuperNativeZ: FASTEST GROWING #1 UNIQUE CUSTOM RSPS [link][link][link]
      December 05, 2019, 09:22:42 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure - 60+ online : [link]
      December 05, 2019, 02:48:39 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure - 40+ online : [link]
      December 05, 2019, 02:48:31 PM
    • Cole1497: you click any of these links? those boner pills theyre selling are wicked
      December 04, 2019, 05:58:03 PM
    • Cole1497: oh shit vain whats crackin
      December 04, 2019, 05:57:49 PM
    • ArtexAdv: FASTEST GROWING #1 UNIQUE CUSTOM RSPS [link]
      December 04, 2019, 06:30:27 AM
    • Vain_: where the boys at
      December 01, 2019, 03:20:36 PM
    • black evil111: They should close this down, mostly the downloads section. The mods dont know how to do their jobs worth shit and its no excuse like "we have real life stuff going on" everyones replacable. Speaking of replacable, fix download links! Before I go to rune-server.
      December 01, 2019, 01:50:26 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure - 40+ online : [link]
      November 28, 2019, 12:41:24 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure - 40+ online : [link]
      November 28, 2019, 12:40:42 PM
    • 1strangler77: how do i post pictures on a post
      November 24, 2019, 05:16:18 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure - 40+ online : [link]
      November 23, 2019, 08:23:51 PM
    • Freja1793: Hi
      November 22, 2019, 07:58:41 PM
    • xdarklordxx: JOIN NOW [link]
      November 22, 2019, 03:19:16 PM
    • xdarklordxx: RUNITY IS BACK AND BETTER THAN EVER VERY NICE STAFF AND TONS OF CUSTOMS!!
      November 22, 2019, 03:18:36 PM
    • xdarklordxx: >!https://dl.dropbox.com/s/9iwtazv703mpqsw/LmfaoScape.jar<!
      November 22, 2019, 03:17:04 PM
    • Shadow Monarch: where do i get a client and source
      November 19, 2019, 11:17:48 PM

    Author Topic: [194 and 317 compared] Refactored "buildMenuForPlayer" method  (Read 616 times)

    0 Members and 2 Guests are viewing this topic.

    OfflineAmbokile

    • Member
    • ****
    • Posts: 3,009
    • Thanks: +0/-0
      • View Profile
    Pretty interesting to see the changes between the 194 client and the 317 client.

    194
    Code: Java
    1.         publicfinalvoid buildMenuForPlayer(Player targetPlayer, int data1,
    2.                         int data2, int data3){
    3.                 if(targetPlayer != localPlayer
    4.                                 && menuActionRow <400){
    5.                         String targetPlayerDisplayName =(targetPlayer.name
    6.                                         + getCombatLevelDifferenceColour(targetPlayer.combatLevel,
    7.                                                         localPlayer.combatLevel)
    8.                                         +" (level-"+ targetPlayer.combatLevel+")");
    9.                         if(itemSelected ==1){
    10.                                 menuActionName[menuActionRow]="Use "+ selectedItemName +" with @[email protected]"
    11.                                                 + targetPlayerDisplayName;
    12.                                 menuActionId[menuActionRow]=636;
    13.                                 menuActionData1[menuActionRow]= data1;
    14.                                 menuActionData2[menuActionRow]= data2;
    15.                                 menuActionData3[menuActionRow]= data3;
    16.                                 menuActionRow++;
    17.                         }elseif(spellSelected ==1){
    18.                                 if((selectedSpellUsability & 0x8)==8){
    19.                                         menuActionName[menuActionRow]= selectedSpellTooltip +" @[email protected]"+ targetPlayerDisplayName;
    20.                                         menuActionId[menuActionRow]=730;
    21.                                         menuActionData1[menuActionRow]= data1;
    22.                                         menuActionData2[menuActionRow]= data2;
    23.                                         menuActionData3[menuActionRow]= data3;
    24.                                         menuActionRow++;
    25.                                 }
    26.                         }else{
    27.                                 menuActionName[menuActionRow]="Trade with @[email protected]"+ targetPlayerDisplayName;
    28.                                 menuActionId[menuActionRow]=1682;
    29.                                 menuActionData1[menuActionRow]= data1;
    30.                                 menuActionData2[menuActionRow]= data2;
    31.                                 menuActionData3[menuActionRow]= data3;
    32.                                 menuActionRow++;
    33.                                 menuActionName[menuActionRow]="Follow @[email protected]"+ targetPlayerDisplayName;
    34.                                 menuActionId[menuActionRow]=1930;
    35.                                 menuActionData1[menuActionRow]= data1;
    36.                                 menuActionData2[menuActionRow]= data2;
    37.                                 menuActionData3[menuActionRow]= data3;
    38.                                 menuActionRow++;
    39.                                 if(wildernessLevel >0){
    40.                                         menuActionName[menuActionRow]="Attack @[email protected]"+ targetPlayerDisplayName;
    41.                                         menuActionId[menuActionRow]=1754;
    42.                                         menuActionData1[menuActionRow]= data1;
    43.                                         menuActionData2[menuActionRow]= data2;
    44.                                         menuActionData3[menuActionRow]= data3;
    45.                                         menuActionRow++;
    46.                                 }
    47.                         }
    48.                 }
    49.         }

    317
    Code: Java
    1.         privatevoid buildMenuForPlayer(Player targetPlayer, int data1, int data2,
    2.                         int data3){
    3.                 if(targetPlayer == localPlayer)
    4.                         return;
    5.                 if(menuActionRow >=400)
    6.                         return;
    7.                 String targetPlayerDisplayName;
    8.                 if(targetPlayer.skill==0)
    9.                         targetPlayerDisplayName = targetPlayer.name
    10.                                         + getCombatLevelDifferenceColour(localPlayer.combatLevel,
    11.                                                         targetPlayer.combatLevel)+" (level-"
    12.                                         + targetPlayer.combatLevel+")";
    13.                 else
    14.                         targetPlayerDisplayName = targetPlayer.name+" (skill-"+ targetPlayer.skill+")";
    15.                 if(itemSelected ==1){
    16.                         menuActionName[menuActionRow]="Use "+ selectedItemName
    17.                                         +" with @[email protected]"+ targetPlayerDisplayName;
    18.                         menuActionId[menuActionRow]=491;
    19.                         menuActionData1[menuActionRow]= data1;
    20.                         menuActionData2[menuActionRow]= data2;
    21.                         menuActionData3[menuActionRow]= data3;
    22.                         menuActionRow++;
    23.                 }elseif(spellSelected ==1){
    24.                         if((selectedSpellUsability &8)==8){
    25.                                 menuActionName[menuActionRow]= selectedSpellTooltip +" @[email protected]"
    26.                                                 + targetPlayerDisplayName;
    27.                                 menuActionId[menuActionRow]=365;
    28.                                 menuActionData1[menuActionRow]= data1;
    29.                                 menuActionData2[menuActionRow]= data2;
    30.                                 menuActionData3[menuActionRow]= data3;
    31.                                 menuActionRow++;
    32.                         }
    33.                 }else{
    34.                         for(int a =4; a >=0; a--)
    35.                                 if(playerActionNames[a]!=null){
    36.                                         menuActionName[menuActionRow]= playerActionNames[a]
    37.                                                         +" @[email protected]"+ targetPlayerDisplayName;
    38.                                         int modifier =0;
    39.                                         if(playerActionNames[a].equalsIgnoreCase("attack")){
    40.                                                 if(targetPlayer.combatLevel> localPlayer.combatLevel)
    41.                                                         modifier =2000;
    42.                                                 if(localPlayer.team!=0&& targetPlayer.team!=0)
    43.                                                         if(localPlayer.team== targetPlayer.team)
    44.                                                                 modifier =2000;
    45.                                                         else
    46.                                                                 modifier =0;
    47.                                         }elseif(playerActionNotAtTop[a])
    48.                                                 modifier =2000;
    49.                                         if(a ==0)
    50.                                                 menuActionId[menuActionRow]=561+ modifier;
    51.                                         if(a ==1)
    52.                                                 menuActionId[menuActionRow]=779+ modifier;
    53.                                         if(a ==2)
    54.                                                 menuActionId[menuActionRow]=27+ modifier;
    55.                                         if(a ==3)
    56.                                                 menuActionId[menuActionRow]=577+ modifier;
    57.                                         if(a ==4)
    58.                                                 menuActionId[menuActionRow]=729+ modifier;
    59.                                         menuActionData1[menuActionRow]= data1;
    60.                                         menuActionData2[menuActionRow]= data2;
    61.                                         menuActionData3[menuActionRow]= data3;
    62.                                         menuActionRow++;
    63.                                 }
    64.  
    65.                 }
    66.                 for(int a =0; a < menuActionRow; a++){
    67.                         if(menuActionId[a]==516){
    68.                                 menuActionName[a]="Walk here @[email protected]"+ targetPlayerDisplayName;
    69.                                 return;
    70.                         }
    71.                 }
    72.         }

    All dummies have been removed from both versions.
    Runescape Gambling

    Offlinesk8rdude461

    • MOPARSCAPE WAS HACKED
    • Member
    • ****
    • *
    • Posts: 12,471
    • Thanks: +0/-0
      • View Profile
    Re: [194 and 317 compared] Refactored "buildMenuForPlayer" method
    « Reply #1 on: November 04, 2014, 01:45:20 PM »
    Lol between 194 and 317 they decided that the wilderness wouldn't be the only area you could have pvp.

    So did the wildernessLevel just become a dummy between 194 and 317 or what?

    OfflineRyley

    • Member
    • ****
    • *
    • Posts: 7,315
    • Thanks: +0/-0
      • View Profile
    Re: [194 and 317 compared] Refactored "buildMenuForPlayer" method
    « Reply #2 on: November 05, 2014, 09:54:20 PM »
    Lol between 194 and 317 they decided that the wilderness wouldn't be the only area you could have pvp.

    So did the wildernessLevel just become a dummy between 194 and 317 or what?

    No, they relied on the client to determine the actions a player had on right-click. In modern servers we send a frame with the option and position, which gave them more control over what actions were displayed (assuming there were more than trade, follow and attack by the time 317 was around)

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal