yuhsing

Untitled

May 15th, 2013
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.27 KB | None | 0 0
  1.  
  2.  
  3.  
  4. - script KoE -1,{
  5.  
  6. OnInit:
  7. // min gm level to control koe
  8. .gm_level = 90;
  9. // map used for koe
  10. .map_name$ = "guild_vs1";
  11. // koe max duration in minutes
  12. .koe_duration = 60;
  13.  
  14. setarray .@mapflag_list,mf_nomemo,mf_noteleport,mf_nosave,mf_nobranch,mf_gvg,mf_nowarp,mf_noicewall,mf_nogo,mf_nowarpto;
  15. .@mapflag_list_size = getarraysize( .@mapflag_list );
  16. for( .@i = 0; .@i < .@mapflag_list_size; .@i++ )
  17. setmapflag .map_name$,.@mapflag_list[.@i];
  18. disablenpc "KoE#entrance";
  19. donpcevent "::OnRevKoE";
  20. end;
  21.  
  22. OnWhisperGlobal:
  23. if( getgmlevel() < .gm_level ) end;
  24. else if( compare( @whispervar0$,"on" ) ) goto L_start;
  25. else if( compare( @whispervar0$,"off" ) ) goto L_end;
  26. else if( compare( @whispervar0$,"reset" ) ) goto OnGuildBreak;
  27. else end;
  28.  
  29. OnClock0800:
  30. if( gettime(4) == 0 || gettime(4) == 6 ) end;
  31. L_start:
  32. if( !.koe_start ){
  33. announce "The King of Emperium Hill - "+.map_name$+" has begun for "+.koe_duration+" minutes..!", 0;
  34. .koe_start = 1;
  35. $koe_guild = 0;
  36. enablenpc "KoE#entrance";
  37. donpcevent "::OnRevKoE";
  38. maprespawnguildid .map_name$,$koe_guild,6;
  39. monster .map_name$,49,49,"KOE Emperium",1288,1,strnpcinfo(0)+"::OnEmpDead";
  40.  
  41. sleep ( .koe_duration * 60000 );
  42.  
  43. announce "The King of Emperium Hill is over!", 0;
  44. .koe_start = 0;
  45. killmonsterall .map_name$;
  46. maprespawnguildid .map_name$,$koe_guild,7;
  47.  
  48. if( $koe_guild ){
  49. .@size = query_sql( "SELECT `account_id`,`char_id` FROM `guild_member` WHERE `guild_id` = '"+$koe_guild+"'",.@aid,.@cid );
  50. for( .@i = 0; .@i < .@size; .@i++ )
  51. if( isloggedin( .@aid[.@i],.@cid[.@i] ) ){
  52. // all online member get rewards.
  53. getitem 14232,5,.@aid[.@i];
  54. getitem 13995,5,.@aid[.@i];
  55. getitem 7539,5,.@aid[.@i];
  56. }
  57. }
  58. disablenpc "KoE#entrance";
  59. }
  60. end;
  61.  
  62. OnEmpDead:
  63. .@gid = getcharid(2);
  64. if( .@gid != $koe_guild ){
  65. $koe_guild = getcharid(2);
  66. donpcevent "::OnRevKoE";
  67. announce "The current King of Emperium Hill is the [ "+strcharinfo(2)+" ] guild.", 0;
  68. maprespawnguildid .map_name$,$koe_guild,6;
  69. }
  70. if( .koe_start ){
  71. sleep 2000;
  72. monster .map_name$,49,49,"KOE Emperium",1288,1,strnpcinfo(0)+"::OnEmpDead";
  73. }
  74. end;
  75.  
  76. L_end:
  77. if( .koe_start )
  78. awake strnpcinfo(0);
  79. end;
  80.  
  81. OnGuildBreak:
  82. $koe_guild = 0;
  83. donpcevent "::OnRevKoE";
  84. announce "KOE Ownership removed.",0;
  85. end;
  86.  
  87. OnWarp:
  88. if( !.koe_start ){
  89. mes "No KOE now.";
  90. }else if( !getcharid(2) ){
  91. mes "You need a aguild.";
  92. }else{
  93. setarray .@x[0],50,88,50,11;
  94. setarray .@y[0],88,50,11,50;
  95. set .@random,getarraysize(.@x);
  96. warp .map_name$,.@x[.@random],.@y[.@random];
  97. end;
  98. }
  99. close;
  100. }
  101.  
  102.  
  103. // KOE Entrance
  104. izlude,128,142,5 script KoE#entrance 757,{
  105. doevent "KoE::OnWarp";
  106. }
  107.  
  108.  
  109. // KOE Flags
  110. - script koe_flag -1,{
  111. if( $koe_guild ){
  112. mes "[King of Emperium Hill]";
  113. mes "The Current King of Emperium Hill is the [ ^0055FF"+ getguildname( $koe_guild ) +"^000000 ] guild.";
  114. }
  115. close;
  116.  
  117. OnRevKoE:
  118. if( $koe_guild )
  119. flagemblem $koe_guild;
  120. end;
  121. }
  122.  
  123.  
  124. // Duplicated Flags
  125. izlude,136,168,4 duplicate(koe_flag) King of Emperium Hill#1 722
  126. guild_vs1,61,49,6 duplicate(koe_flag) King of Emperium Hill#2 722
  127. guild_vs1,38,49,2 duplicate(koe_flag) King of Emperium Hill#3 722
  128. guild_vs1,49,61,0 duplicate(koe_flag) King of Emperium Hill#4 722
Advertisement
Add Comment
Please, Sign In to add comment