Advertisement
Capuche

Align_dromedary

May 8th, 2013
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.66 KB | None | 0 0
  1. //===== rAthena Script =======================================
  2. //= Align
  3. //===== By: ==================================================
  4. //= Capuche
  5. //===== Current Version: =====================================
  6. //= 1.0
  7. //===== Compatible With: =====================================
  8. //= rAthena SVN
  9. //===== Description: =========================================
  10. //= Align the dromedary in the same direction
  11. //= to winning... well nothing for now. Just for fun.
  12. //============================================================
  13.  
  14. prontera,150,170,6 script Align 742,{
  15. npctalk "Force the dromedary to be in the same direction.";
  16. if( getgmlevel() < 99 ) end;
  17. goto OnTimer180000;
  18. OnWin:
  19. npctalk "Bravo ! You take "+ ( getnpctimer(0) / 1000 ) +" seconds!";
  20. monster "prontera",155,172,"--ja--",1324,1;
  21. .@win++;
  22. sleep 5000;
  23. OnTimer180000:
  24. if( !.@win )
  25. npctalk "You take to much time... to bad!";
  26. stopnpctimer;
  27. setnpctimer 0;
  28. // .timer_play = 0;
  29. OnInit:
  30. setarray .direction, 2, 6, 2, 6, 6, 2, 6;
  31. for( .@i = 0; .@i < 7; .@i++ ) {
  32. // .direction[ .@i ] = rand(2) ? 2 : 6;
  33. getmapxy .@map$, .@x, .@y, 1, "#npcswitch_1_"+ .@i;
  34. movenpc "#npcswitch_1_"+ .@i, .@x, .@y, .direction[ .@i ];
  35. }
  36. end;
  37. }
  38.  
  39. prontera,152,164,6 script #npcswitch_1_0 938,{
  40. if( !getnpctimer( 0,"Align" ) ) {
  41. initnpctimer "Align";
  42. // set getvariableofnpc( .timer_play, "Align" ), gettimetick(2);
  43. deletearray .tmp;
  44. for( .@i = 0; .@i < 7; .@i++ )
  45. .tmp[ .@i ] = getvariableofnpc( .direction[ .@i ], "Align" );
  46. }
  47. while ( .@i < 7 && strnpcinfo(0) != "#npcswitch_1_"+.@i ) .@i++;
  48. switch( .@i ) {
  49. case 0: setarray .@switch_[0], .@i, 1, 2; break;
  50. case 1: setarray .@switch_[0], .@i, 3, 4; break;
  51. case 2: setarray .@switch_[0], .@i, 5, 6; break;
  52. case 3:
  53. case 4: setarray .@switch_[0], .@i, 0, 2; break;
  54. case 5:
  55. case 6: setarray .@switch_[0], .@i, 0, 1;
  56. }
  57. for ( .@j = 0; .@j < getarraysize( .@switch_ ); .@j++ ) {
  58. .tmp[ .@switch_[.@j] ] = ( .tmp[ .@switch_[.@j] ] == 2 ? 6 : 2 );
  59. getmapxy .@map$, .@x, .@y, 1, "#npcswitch_1_"+ .@switch_[.@j];
  60. movenpc "#npcswitch_1_"+ .@switch_[.@j], .@x, .@y, .tmp[ .@switch_[.@j] ];
  61. }
  62. while ( .@k < 6 && .tmp[.@k] == .tmp[.@k +1] ) .@k++;
  63. if( .@k == 6 ) donpcevent "Align::OnWin";
  64. end;
  65.  
  66.  
  67. // 4 6
  68. // 2 0 1
  69. // 3 5
  70. }
  71.  
  72. prontera,158,164,6 duplicate(#npcswitch_1_0) #npcswitch_1_1 938
  73. prontera,146,164,6 duplicate(#npcswitch_1_0) #npcswitch_1_2 938
  74. prontera,149,161,2 duplicate(#npcswitch_1_0) #npcswitch_1_3 938
  75. prontera,149,167,2 duplicate(#npcswitch_1_0) #npcswitch_1_4 938
  76. prontera,155,161,2 duplicate(#npcswitch_1_0) #npcswitch_1_5 938
  77. prontera,155,167,2 duplicate(#npcswitch_1_0) #npcswitch_1_6 938
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement