Advertisement
Trickysticks

Untitled

Apr 12th, 2015
240
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. function castbar(seconds, spell, sound, size, width){
  4.  
  5.  
  6. PlaySE(sound);
  7. let alpha = 255;
  8. let angle = 0;
  9. let numcasts = 0;
  10. let green = 0;
  11. let string = "Casting:" ~ spell;
  12. let variable = 180;
  13. let obj = ObjPrim_Create(OBJ_SPRITE_2D);
  14. Obj_SetRenderPriority(obj, 0.9);
  15. ObjPrim_SetTexture(obj, GetCurrentScriptDirectory~"tricky_system/img/Default_System.png");
  16. ObjSprite2D_SetSourceRect(obj, 1, 1, 127, 7);
  17. ObjSprite2D_SetDestRect(obj, GetStgFrameWidth+60, GetStgFrameHeight/2+65, GetStgFrameWidth+70, GetStgFrameHeight/2+65);
  18. ObjRender_SetColor(obj, 255, 165, 0);
  19. ObjRender_SetAlpha(obj, 255);
  20. ObjMove_SetX(obj, GetStgFrameWidth/2);
  21. ObjMove_SetY(obj, GetStgFrameHeight/2);
  22. ObjRender_SetScaleXYZ(obj, 1, 1, 1);
  23.  
  24.  
  25.  
  26.  
  27. let objText = ObjText_Create();
  28. ObjText_SetFontType(objText, "Corbel");
  29. ObjText_SetText(objText, spell);
  30. ObjText_SetFontSize(objText, size);
  31. ObjText_SetFontBold(objText, true);
  32. ObjText_SetHorizontalAlignment(objText, ALIGNMENT_CENTER);
  33. ObjText_SetMaxWidth(objText, width);
  34. ObjText_SetFontColorTop(objText, 224, 255, 255);
  35. ObjText_SetFontColorBottom(objText, 128, 128, 255);
  36. ObjText_SetFontBorderType(objText, BORDER_FULL);
  37. ObjText_SetFontBorderColor(objText,0, 0, 0);
  38. ObjText_SetFontBorderWidth(objText, 1);
  39.  
  40. Obj_SetRenderPriority(objText, 0.9);
  41. ObjRender_SetX(objText, GetStgFrameWidth/2+225);
  42. ObjRender_SetY(objText, GetStgFrameHeight/2+25);
  43.  
  44. loop(seconds){
  45. variable-=180/seconds;
  46. ObjSprite2D_SetDestRect(obj, GetStgFrameWidth+60, GetStgFrameHeight/2+(180+65), GetStgFrameWidth+70, (GetStgFrameHeight/2+65)+variable);
  47. if(GetVirtualKeyState(VK_USER1)==KEY_PUSH && GetCommonData("interruptavail", false)==true){
  48. ObjRender_SetColor(obj, 0, 255, 0);
  49. PlaySE(counterspell);
  50. StopSound(sound);
  51. wait2(15);
  52. loop(30){
  53. alpha-=255/30;
  54. ObjRender_SetAlpha(objText, alpha);
  55. ObjRender_SetAlpha(obj, alpha);
  56. yield;
  57. }
  58. return true;
  59. Obj_Delete(obj); break; }
  60. wait2(1);
  61. }
  62. StopSound(sound);
  63. ObjRender_SetColor(obj, 255, 0, 0);
  64. if(sound == firecast){ PlaySE(fireball); }
  65. if(spell == "Fireball"){ loop(10){ ascent(i in 0..9){ CreateDNHShotA1(GetEnemyX, GetEnemyY, 0.5+(i/3.15), angletoplayer(objEnemy)+angle+rand((-(9-i))*2, (9-i)*2), SP01, 10); } angle+=360/10; }}
  66. if(spell == "Pyroblast"){ loop(10){ ascent(i in 0..25){ CreateDNHShotA1(GetEnemyX, GetEnemyY, 0.25+(i/8.3333333), angletoplayer(objEnemy)+rand(-i-10, i+10)+angle, SP01, 10); } angle+=360/10; }}
  67. wait2(15);
  68. loop(30){
  69. alpha-=255/30;
  70. ObjRender_SetAlpha(objText, alpha);
  71. ObjRender_SetAlpha(obj, alpha);
  72. wait2(1);
  73. }
  74. return false;
  75. Obj_Delete(obj);
  76. function wait2(w){ loop(w){ if (popped==true){ StopSound(sound); Obj_Delete(objText); Obj_Delete(obj); } yield; } }
  77. }
  78.  
  79.  
  80.  
  81. task attack1{
  82. wait(120);
  83. let numcasts = 0;
  84. let one = 1;
  85. let angle2 = 0;
  86. let color = 0;
  87. let angle3 = 0;
  88. loop{
  89. numcasts++;
  90. if(castbar(15, "Fireball", firecast, 20, 60) == true){
  91. //wait(15);
  92. }
  93. else{
  94.  
  95. //wait(15);
  96. }
  97. if(numcasts>=6){
  98. PlaySE(charge2);
  99. TCharge01(objEnemy, 3, 45, 255, 0, 0);
  100. wait(60);
  101. castbar(120, "Pyroblast", firecast, 18, 80);
  102. numcasts = 0;
  103. wait(60);
  104. }
  105.  
  106.  
  107. if(popped==true){break;}
  108.  
  109.  
  110. }
  111. }
  112.  
  113.  
  114.  
  115.  
  116. task DestroyBoss{
  117. SetCommonData("petals", false);
  118. popped=true;
  119. StopSlow(TARGET_ALL);
  120. loop(10){ yield; }
  121. Obj_Delete(objEnemy);
  122. loop(45){ yield; }
  123. CloseScript(GetOwnScriptID());
  124. return;
  125. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement