Emistry

Class Restriction v2

Feb 12th, 2012
850
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.74 KB | None | 0 0
  1. // -------- BitMasks --------
  2. // 1 - Normal jobs,
  3. // 2 - Adv jobs.
  4. // 4 - Baby jobs,
  5. // 8 - Normal 3rd jobs.
  6. // 16 - Adv. 3rd jobs.
  7. // 32 - Baby 3rd jobs.
  8. // 64 - Certain Jobs ( Specific )
  9.  
  10. // ----- Mode Example : ( Blocked Class ) ------
  11. // 63 - All Class that has been defined
  12. // 64 - Only the Specific Job you defined
  13. // 7 - Normal + Advanced + Baby Jobs
  14. // 56 - Normal 3rd + Advanced 3rd + Baby 3rd Jobs
  15.  
  16. // Just add in the Value for the Bitmask.
  17. // Aware of the Usage of Certain Jobs.
  18. // --- If you using Bitmask Above , aware of the Limit Reach. ( ~128 Total Class )
  19. // --- If your Bitmask = ( 63 + 64 ) , Your "Certain Jobs" have only about 20 Slots.
  20. // --- Anyway, i dont think you will do so since Bitmask 63 will block most of the Class already.
  21. // * Common Sense : Make sure the Array ".@Restrict" didnt exceed limit of 128 element.
  22.  
  23.  
  24. - script ClassRestriction -1,{
  25. function RestrictJob;
  26.  
  27. OnPCLoadMapEvent:
  28. if( getgmlevel() < .LowGMLvl )
  29. for( set .@i,0; .@i < getarraysize( .Map$ ); set .@i,.@i + 2 )
  30. if( strcharinfo(3) == .Map$[.@i] ) RestrictJob( atoi( .Map$[.@i+1] ) );
  31. end;
  32.  
  33. function RestrictJob {
  34. // Normal Jobs
  35. if( getarg(0) & 1 ) setarray .@Restrict[getarraysize(.@Restrict)],0,1,2,3,4,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,23,24,25,4046,4047,4049;
  36. // Adv Jobs
  37. if( getarg(0) & 2 ) setarray .@Restrict[getarraysize(.@Restrict)],4001,4002,4003,4004,4005,4006,4007,4008,4009,4010,4011,4012,4013,4015,4016,4017,4018,4019,4020,4021;
  38. // Baby Jobs
  39. if( getarg(0) & 4 ) setarray .@Restrict[getarraysize(.@Restrict)],4023,4024,4025,4026,4027,4028,4029,4030,4031,4032,4033,4034,4035,4037,4038,4039,4040,4041,4042,4043,4045;
  40. // Normal 3rd Jobs
  41. if( getarg(0) & 8 ) setarray .@Restrict[getarraysize(.@Restrict)],4054,5055,4056,4057,4058,4059,4066,4067,4068,4069,4070,4071,4072;
  42. // Adv 3rd Jobs
  43. if( getarg(0) & 16 ) setarray .@Restrict[getarraysize(.@Restrict)],4060,4061,4062,4063,4064,4065,4073,4074,4075,4076,4077,4078,4079;
  44. // Baby 3rd Jobs
  45. if( getarg(0) & 32 ) setarray .@Restrict[getarraysize(.@Restrict)],4096,4097,4098,4099,4100,4101,4102,4103,4104,4105,4106,4107,4108;
  46.  
  47. // Certain Jobs ( Specific Your Own Class Restriction )
  48. if( getarg(0) & 64 ) setarray .@Restrict[getarraysize(.@Restrict)],4046,4002,4004,4013,4011;
  49.  
  50. for( set .@i,0; .@i < getarraysize(.@Restrict); set .@i,.@i + 1 )
  51. if( Class == .@Restrict[.@i] ){
  52. mes "[ ^FF0000Job Restriction System^000000 ]";
  53. mes "^0000FFMap^000000 : ^FF0000"+strcharinfo(3)+"^000000";
  54. mes "^FFFFFF________________________________^000000";
  55. if( getarg(0) & 1 ) mes " -- ^0000FFNormal Jobs^000000";
  56. if( getarg(0) & 2 ) mes " -- ^0000FFAdvanced Jobs^000000";
  57. if( getarg(0) & 4 ) mes " -- ^0000FFNormal Baby Jobs^000000";
  58. if( getarg(0) & 8 ) mes " -- ^0000FFNormal Third Jobs^000000";
  59. if( getarg(0) & 16 ) mes " -- ^0000FFAdvanced Third Jobs^000000";
  60. if( getarg(0) & 32 ) mes " -- ^0000FFBaby Third Jobs^000000";
  61. if( getarg(0) & 64 )
  62. for( set .@i,0; .@i < getarraysize(.@Restrict); set .@i,.@i + 1 )
  63. mes " -- ^0000FF"+jobname( .@Restrict[.@i] )+"^000000";
  64. mes "^FFFFFF________________________________^000000";
  65. mes "You will be warped out within "+.Sec+" Seconds.";
  66. sleep2 ( .Sec * 1000 );
  67. warp "prontera",155,181;
  68. }
  69. return;
  70. }
  71.  
  72. OnInit:
  73. // Wait X Seconds before warped out.
  74. set .Sec,5;
  75. // Lowest GM Level to Bypass
  76. set .LowGMLvl,80;
  77.  
  78. setarray .Map$, // <Mapname>,<Mode>.... ( Mode = Bitwise Value ) Max of ~64 Map Settings.
  79. "prtg_cas01","63",
  80. "prtg_cas02","64",
  81. "prtg_cas03","7",
  82. "prtg_cas04","56",
  83. "prtg_cas05","1";
  84.  
  85. // Assign a LoadEvent Mapflag to each map you listed.
  86. for( set .map,0; .map < getarraysize( .Map$ ); set .map,.map + 2 )
  87. setmapflag .Map$[.map],mf_loadevent;
  88. end;
  89. }
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment