Guest User

Untitled

a guest
Aug 3rd, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.19 KB | None | 0 0
  1. //Author Goddameit
  2. //Version 2012/06/09 - ''flag_event'' map
  3. //Web http://bit.ly/Ja4udH
  4. guild_room,236,283,4 script CTF Premiador 100,{
  5.  
  6. if($ctfevt == 0){ dispbottom "[CTF] Desculpe mais não tenho nara para você."; warp "SavePoint",0,0; end; }
  7.  
  8. query_sql "UPDATE `login` SET `ppoints` = `ppoints` +20 WHERE `account_id`='"+getcharid(3)+"'";
  9. dispbottom "[CTF] Você acaba de ganhar 20 Peace Points";
  10. warp "SavePoint",0,0;
  11. end;
  12. }
  13. prontera,150,185,4 script CTF -1,{
  14.  
  15. OnInit:
  16. bindatcmd ("CTF", "CTF::OnAtcmd_CTF");
  17. set $ctfevt,0;
  18. end;
  19.  
  20. OnClock0900: callsub EventoCTF;
  21. OnClock1300: callsub EventoCTF;
  22. OnClock1700: callsub EventoCTF;
  23. OnClock0000: callsub EventoCTF;
  24.  
  25.  
  26. EventoCTF:
  27. announce "[CTF] A captura pela bandeira vai começar em 5 minutos, digite @ctf para se registrar.",8;
  28. set $ctfevt,1;
  29. initnpctimer;
  30. end;
  31. OnAtcmd_CTF:
  32. if($ctfevt == 0){ dispbottom "[CTF] A captura pela bandeira não começou"; end; }
  33. function c_flagon {
  34. while(set(.@i,.@i+1)<=6)
  35. {
  36. if(getd("$@flag"+.@i+"_a")==getarg(0))
  37. return .@i;
  38. }
  39. return 0;
  40. }
  41. dispbottom "[CTF] Você acaba de se registrar, espere até ser chamado.";
  42. set @ctf_tid,.join==0?1:.join==1?2:.join%2;
  43. setd ".join_j"+.join,getcharid(3);
  44. set .join,.join+1;
  45. close;
  46.  
  47. OnTimer600000:
  48. set .w,0;
  49. if(.ctf_tp1!=.ctf_tp2)
  50. {
  51. announce "[CTF] O Time "+set(.w,(.ctf_tp1>.ctf_tp2?1:2))+" capturou mais bandeiras e venceu.",0;
  52. for(set .@io,0;.@io<=.join;set .@io,.@io+1)
  53. {
  54. if(attachrid(getd(".join_j"+.@io)))
  55. {
  56. getmapxy(@cm$,@cx,@cy,0);
  57. if(@cm$=="flag_event")
  58. {
  59. if(.w==@ctf_tid)
  60. {
  61. warp "guild_room",236,283;
  62. }else
  63. warp "prontera",150,180;
  64. }
  65. setd ".join_j"+.@io,0;
  66. deltimer "FlagTimer::OnTimerStart";
  67. }
  68. }
  69. set .join,0;
  70. }
  71. mapwarp "flag_event","prontera",150,180;
  72. mapannounce "flag_event","[CTF] Fim de jogo.",0;
  73. end;
  74. OnTimer1:
  75. OnStart:
  76. set .game,1;
  77. set .join,0;
  78. set .ctf_tn1,0;
  79. set .ctf_tn2,0;
  80. set .ctf_tp1,0;
  81. set .ctf_tp2,0;
  82. sleep2 300000;
  83. set .game,2;
  84. set $ctfevt,0;
  85. setmapflag "flag_event",mf_pvp;
  86. setmapflag "flag_event",mf_pvp_noguild;
  87. removemapflag "flag_event",mf_gvg;
  88. announce "[CTF] A captura pela bandeira começou.",0;
  89. for(set .@io,0;.@io<=.join;set .@io,.@io+1)
  90. {
  91. if(attachrid(getd(".join_j"+.@io)))
  92. {
  93. if(@ctf_tid==2)
  94. warp "flag_event",180,87;
  95. else
  96. warp "flag_event",33,93;
  97. }
  98. }
  99. initnpctimer "CTF-Point#1";
  100. initnpctimer "CTF-Point#2";
  101. end;
  102. OnPCDieEvent:
  103. getmapxy(@cm$,@cx,@cy,0);
  104. if(@cm$!="flag_event"||.game!=2) // ||!@ctf_tid
  105. end;
  106. addtimer 5000,"CTF-Point#"+@ctf_tid+"::OnDie";
  107. OnPCEnd:
  108. OnPCLogoutEvent:
  109. set @ctf_tu,0;
  110. set @CTF,0;
  111. if(set(.@i,c_flagon(getcharid(0))))
  112. {
  113. deltimer "FlagTimer::OnTimerStart";
  114. callfunc "CTF_LimitSkillWhenCareFlag",0;
  115. getmapxy(.@cm$,.@cx,.@cy,0);
  116. hideoffnpc "Flag#"+.@i;
  117. stopnpctimer "Flag#"+.@i;
  118. setd "$@flag"+.@i+"_a",0;
  119. movenpc "Flag#"+.@i,.@cx,.@cy;
  120. if(@ctf_xt&&@ctf_tid)
  121. {
  122. specialeffect2 666;
  123. set @ctf_xt,0;
  124. mapannounce "flag_event","[CTF] Time "+@ctf_tid+" +1 Ponto.",0;
  125. setd ".ctf_tp"+@ctf_tid,getd(".ctf_tp"+@ctf_tid)+1;
  126. mapannounce "flag_event","[CTF] Time 1 ["+.ctf_tp1+"] Pontos : Time 2 ["+.ctf_tp2+"] Pontos",0;
  127. movenpc "Flag#"+.@i,107,90;
  128. getmapxy(getvariableofnpc(.cm$,"Flag#"+.@i),getvariableofnpc(.cx,"Flag#"+.@i),getvariableofnpc(.cy,"Flag#"+.@i),1,"Flag#"+.@i);
  129. }
  130. end;
  131. }
  132. set @ctf_xt,0;
  133. end;
  134. }
  135. flag_event,107,90,4 script Flag#1 722,{
  136. if(getvariableofnpc(.game,"CTF")!=2) // ||!@ctf_tid
  137. end;
  138. function flag_tid {
  139. if(getarg(0)<4)
  140. return 1;
  141. else
  142. return 2;
  143. }
  144. set .k,atoi(strnpcinfo(2));
  145. getmapxy(.cm$,.cx,.cy,1);
  146. getmapxy(.@cm$,.@cx,.@cy,0);
  147. if(pow(.cx-.@cx,2)>9||pow(.cy-.@cy,2)>9)
  148. {
  149. message strcharinfo(0),"Chegue mais perto oras.."+rand(1000)+""+rand(1000);
  150. end;
  151. }
  152. if(@CTF)
  153. end;
  154. set @CTF,1;
  155. setd "$@flag"+.k+"_a",getcharid(0);
  156. hideonnpc strnpcinfo(0);
  157. callfunc "CTF_LimitSkillWhenCareFlag",1;
  158. addtimer 500,"FlagTimer::OnTimerStart";
  159. end;
  160. }
  161. - script FlagTimer -,{
  162.  
  163. OnTimerStart:
  164. set @ctf_tu,@ctf_tu+1;
  165. if(@ctf_tu>120)
  166. {
  167. unitskilluseid getcharid(3),173,1;
  168. doevent "CTF::OnPCEnd";
  169. end;
  170. }
  171. specialeffect2 589;
  172. addtimer 500,"FlagTimer::OnTimerStart";
  173. end;
  174. }
  175.  
  176. flag_event,33,93,4 script CTF-Point#1 111,3,3,{
  177. end;
  178.  
  179. OnDie:
  180. if(@ctf_tid==2)
  181. warp "flag_event",180,87;
  182. else
  183. warp "flag_event",33,93;
  184. end;
  185. OnTouch:
  186. if(getvariableofnpc(.game,"CTF")!=2||!@ctf_tid)
  187. end;
  188. if(@ctf_tid!=atoi(strnpcinfo(2)))
  189. end;
  190. set @ctf_xt,1;
  191. doevent "CTF::OnPCEnd";
  192. end;
  193.  
  194. OnTimer500:
  195. specialeffect 225;
  196. sleep(500);
  197. specialeffect 236;
  198. sleep(500);
  199. specialeffect 237;
  200. sleep(500);
  201. specialeffect 238;
  202. initnpctimer;
  203. end;
  204. }
  205. flag_event,180,87,4 duplicate(CTF-Point#1) CTF-Point#2 45,3,3
  206. flag_event mapflag nowarpto
  207. flag_event mapflag nosave
  208. flag_event mapflag nobranch
  209. flag_event mapflag nopenalty
  210. flag_event mapflag noreturn
  211. flag_event mapflag nowarp
  212. flag_event mapflag noicewall
  213. flag_event mapflag nomemo
  214. flag_event mapflag pvp
  215. guild_room mapflag nowarpto
  216. guild_room mapflag nosave
  217. guild_room mapflag nobranch
  218. guild_room mapflag noreturn
  219. guild_room mapflag nowarp
  220. guild_room mapflag nomemo
Advertisement
Add Comment
Please, Sign In to add comment