yuhsing

Untitled

Apr 30th, 2013
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.22 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 = 1;
  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. L_start:
  30. if( !.koe_start ){
  31. announce "The King of Emperium Hill - "+.map_name$+" has begun for next "+.koe_duration+" minutes..!", 0;
  32. .koe_start = 1;
  33. $koe_guild = 0;
  34. enablenpc "KoE#entrance";
  35. donpcevent "::OnRevKoE";
  36. maprespawnguildid .map_name$,$koe_guild,6;
  37. monster .map_name$,49,49,"KOE Emperium",1001,1,strnpcinfo(0)+"::OnEmpDead";
  38.  
  39. sleep ( .koe_duration * 60000 );
  40.  
  41. announce "The King of Emperium Hill is over!", 0;
  42. .koe_start = 0;
  43. killmonsterall .map_name$;
  44. maprespawnguildid .map_name$,$koe_guild,7;
  45.  
  46. if( $koe_guild ){
  47. .@size = query_sql( "SELECT `account_id`,`char_id` FROM `guild_member` WHERE `guild_id` = '"+$koe_guild+"'",.@aid,.@cid );
  48. for( .@i = 0; .@i < .@size; .@i++ )
  49. if( isloggedin( .@aid[.@i],.@cid[.@i] ) ){
  50. // all online member get rewards.
  51. getitem 512,1,.@aid[.@i];
  52. getitem 512,2,.@aid[.@i];
  53. getitem 512,3,.@aid[.@i];
  54. }
  55. }
  56. disablenpc "KoE#entrance";
  57. }
  58. end;
  59.  
  60. OnEmpDead:
  61. .@gid = getcharid(2);
  62. if( .@gid != $koe_guild ){
  63. $koe_guild = getcharid(2);
  64. donpcevent "::OnRevKoE";
  65. announce "The current King of Emperium Hill is the [ "+strcharinfo(2)+" ] guild.", 0;
  66. maprespawnguildid .map_name$,$koe_guild,6;
  67. }
  68. if( .koe_start ){
  69. sleep 2000;
  70. monster .map_name$,49,49,"KOE Emperium",1001,1,strnpcinfo(0)+"::OnEmpDead";
  71. }
  72. end;
  73.  
  74. L_end:
  75. if( .koe_start )
  76. awake strnpcinfo(0);
  77. end;
  78.  
  79. OnGuildBreak:
  80. $koe_guild = 0;
  81. donpcevent "::OnRevKoE";
  82. announce "KOE Ownership removed.",0;
  83. end;
  84.  
  85. OnWarp:
  86. if( !.koe_start ){
  87. mes "No KOE now.";
  88. }else if( !getcharid(2) ){
  89. mes "You need a aguild.";
  90. }else{
  91. setarray .@x[0],50,88,50,11;
  92. setarray .@y[0],88,50,11,50;
  93. set .@random,getarraysize(.@x);
  94. warp .map_name$,.@x[.@random],.@y[.@random];
  95. end;
  96. }
  97. close;
  98. }
  99.  
  100.  
  101. // KOE Entrance
  102. prontera,155,181,5 script KoE#entrance 757,{
  103. doevent "KoE::OnWarp";
  104. }
  105.  
  106.  
  107. // KOE Flags
  108. - script koe_flag -1,{
  109. if( $koe_guild ){
  110. mes "[King of Emperium Hill]";
  111. mes "The Current King of Emperium Hill is the [ ^0055FF"+ getguildname( $koe_guild ) +"^000000 ] guild.";
  112. }
  113. close;
  114.  
  115. OnRevKoE:
  116. if( $koe_guild )
  117. flagemblem $koe_guild;
  118. end;
  119. }
  120.  
  121.  
  122. // Duplicated Flags
  123. guild_vs1,49,38,4 duplicate(koe_flag) King of Emperium Hill#1 722
  124. guild_vs1,61,49,6 duplicate(koe_flag) King of Emperium Hill#2 722
  125. guild_vs1,38,49,2 duplicate(koe_flag) King of Emperium Hill#3 722
  126. guild_vs1,49,61,0 duplicate(koe_flag) King of Emperium Hill#4 722
Advertisement
Add Comment
Please, Sign In to add comment