Coolgamer012345

Untitled

May 24th, 2015
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.72 KB | None | 0 0
  1. const int CR_LEVEL = 7;
  2. const int CR_HEART_CT = 8;
  3. const int CR_MAGIC_CT = 9;
  4. const int CR_HP = 10;
  5. const int CR_MP = 11;
  6. const int CR_XP = 12;
  7. //const int CR_LEVEL =
  8. //const int CR_MAXMP =
  9. //const int CR_MAXHP =
  10.  
  11. //float XP[3]={0,1,0}; //
  12.  
  13. //const int XPCOUNTER = 0;
  14. //const int LVL_COUNT = 1;
  15. //const int LVL_DAMAGE = 2;
  16.  
  17. int EXP_Counter = 0;
  18. int Level_Counter = 1;
  19. int Level_Damage = 0;
  20. float Num_Hearts;
  21. float Num_Magics;
  22.  
  23. int LinkXP_DrawX;
  24. int LinkXP_DrawY;
  25.  
  26. const int DRAW_XP_OFFSET = 12;
  27.  
  28. const int ENEMY_XP_VALUE = 10;
  29.  
  30. const int DRAW_XP_FRAMES = 70;
  31.  
  32. const int TOP_Y_OFFSET = 4;
  33. const int BOTTOM_Y_OFFSET = -12;
  34. const int RIGHT_X_OFFSET = -4;
  35. const int LEFT_X_OFFSET = 12;
  36.  
  37. //Shorthand way of drawing an integer. I should probably add this to my own import file eventually too.
  38. void QuickInteger(int x, int y, int number){
  39. Screen->DrawInteger(7, x, y, FONT_Z1, 1, 2, -1, -1, number, 2, OP_OPAQUE);
  40. }
  41.  
  42.  
  43. global script SC_Global_V1{
  44. void run(){
  45. while(true){
  46.  
  47.  
  48. Game->Counter[CR_SCRIPT1] = Level_Counter;
  49. Num_Hearts = ( Link->HP / 16 );
  50. Game->Counter[CR_SCRIPT2] = Num_Hearts;
  51. Num_Magics = Link->MP;
  52. Game->Counter[CR_SCRIPT3] = Num_Magics;
  53. Game->Counter[CR_SCRIPT4] = Link->HP;
  54. Game->Counter[CR_SCRIPT5] = Link->MP;
  55. Game->Counter[CR_SCRIPT6] = EXP_Counter;
  56. Game->Counter[CR_SCRIPT7] = Link->MaxHP;
  57. Game->Counter[CR_SCRIPT8] = Link->MaxMP;
  58. Game->Counter[CR_SCRIPT9] = 1,000;
  59.  
  60. //You may want MaxHP and MaxHP display counters.
  61.  
  62. for ( int e = 1; e < ( Screen->NumNPCs() + 1 ); e++ ) {
  63. npc exp_enemy = Screen->LoadNPC(e);
  64. int worth = exp_enemy->Attributes[ENEMY_XP_VALUE];
  65.  
  66. if ( exp_enemy->HP <= 0 ) {
  67. EXP_Counter += worth;
  68. for ( int q = DRAW_XP_FRAMES; q > 0; q-- ) {
  69. if ( Link->X >= 128 ) {
  70. LinkXP_DrawX = Link->X + DRAW_XP_OFFSET + RIGHT_X_OFFSET;
  71. }
  72. if ( Link->X <= 0 ) {
  73. LinkXP_DrawX = Link->X + DRAW_XP_OFFSET + LEFT_X_OFFSET;
  74. }
  75. else {
  76. LinkXP_DrawX = Link->X + DRAW_XP_OFFSET;
  77. }
  78. if ( Link->Y >= 176 ) {
  79. LinkXP_DrawY = Link->Y + DRAW_XP_OFFSET + BOTTOM_Y_OFFSET;
  80. }
  81. else if ( Link->Y <= 0 ) {
  82. LinkXP_DrawY = Link->Y + DRAW_XP_OFFSET + TOP_Y_OFFSET;
  83. }
  84. else {
  85. LinkXP_DrawY = Link->Y + DRAW_XP_OFFSET;
  86. }
  87. QuickInteger(LinkXP_DrawX, LinkXP_DrawY, worth);
  88. Waitframe();
  89. }
  90. }
  91. }
  92.  
  93.  
  94.  
  95. Level_Damage = ( Level_Counter + ( Level_Counter / 10 ) );
  96. // CoolGamer012345 Edit
  97.  
  98. UpdateLevel();
  99.  
  100.  
  101.  
  102. Waitdraw();
  103. Waitframe();
  104. }
  105. }
  106. }
  107.  
  108. void UpdateLevel(){
  109. if ( EXP_Counter >= 100 ) {
  110. Level_Counter += 1;
  111. EXP_Counter = 0;
  112. }
  113. }
Advertisement
Add Comment
Please, Sign In to add comment