player.lua 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. cloud = {
  2. on_start = function(self)
  3. return 0;
  4. end;
  5. on_action = function(self)
  6. return 0;
  7. end;
  8. script4 = function(self)
  9. temp0 = "";
  10. -- self_id used mask 0x2060 probably attacked unit in this case
  11. if bu[800f83e0 + self_id * 0x68 + 0x17] == 0x13 then
  12. temp0 = "1_80";
  13. else if bu[800f83e0 + self_id * 0x68 + 0x17] == 0x12 then
  14. temp0 = "1_81";
  15. else if bu[800f83e0 + self_id * 0x68 + 0x17] == 0x15 then
  16. temp0 = "1_82";
  17. else if bu[800f83e0 + self_id * 0x68 + 0x17] == 0x11 then
  18. temp0 = "1_83";
  19. end;
  20. if temp0 ~= "" then
  21. byte_to_change_old = game:variable_get(temp0);
  22. byte_to_change = byte_to_change_old + 3;
  23. if byte_to_change > 200 then
  24. byte_to_change = 200;
  25. end;
  26. game:variable_set(temp0, byte_to_change);
  27. printf("LOVEPARA CHR:%d, %d->%d", bu[800f83e0 + self_id * 0x68 + 0x17] - 16, byte_to_change_old, byte_to_change);
  28. end;
  29. return 0;
  30. end;
  31. script6 = function(self)
  32. for unit_id = 0, 2, 1 do
  33. if unit_dead(unit_id) == true then
  34. temp0 = "";
  35. if bu[800f83e0 + unit_id * 0x68 + 0xc] == 0x13 then
  36. temp0 = "1_80";
  37. else if bu[800f83e0 + unit_id * 0x68 + 0xc] == 0x12 then
  38. temp0 = "1_81";
  39. else if bu[800f83e0 + unit_id * 0x68 + 0xc] == 0x15 then
  40. temp0 = "1_82";
  41. else if bu[800f83e0 + unit_id * 0x68 + 0xc] == 0x11 then
  42. temp0 = "1_83";
  43. end;
  44. if temp0 ~= "" then
  45. byte_to_change_old = game:variable_get(temp0);
  46. byte_to_change = byte_to_change_old - 5;
  47. if byte_to_change < 50 then
  48. byte_to_change = 50;
  49. end;
  50. game:variable_set(temp0, byte_to_change);
  51. printf("LOVEPARA CHR:%d, %d->%d", bu[800f83e0 + unit_id * 0x68 + 0x17] - 16, byte_to_change_old, byte_to_change);
  52. end;
  53. end;
  54. end;
  55. end;
  56. };
  57. sephiroth = {
  58. on_start = function(self)
  59. activate folowing bits
  60. 800f83e0 + 4
  61. activate on_action script
  62. 0x00000100;
  63. 0x00000200;
  64. 0x00000400;
  65. return 0;
  66. end;
  67. on_action = function(self)
  68. temp0 = 2;
  69. search_for_units_that_strong_to_earth_and_store_them_to_target_mask;
  70. if bu[0x800f83e0 + attacked_units * 0x68 + 0xb] >= 0x5 then
  71. printf("RESIST EARTH MONSTER");
  72. temp8 = 1;
  73. end;
  74. if young_cloud_is_dead == true then
  75. attack_mask = young_cloud_mask;
  76. temp4 = 8; -- life2
  77. else
  78. if there_only_one_opponent == true then
  79. SetRandomOpponentToAttack();
  80. if bu[0x800f83e0 + attacked_units * 0x68 + 0x4e] >= 0x10 then
  81. temp4 = 0x1d; -- fire3
  82. else
  83. temp0 = 1;
  84. end;
  85. else
  86. store_all_oponents_as_targets;
  87. rand = math.random(3) + temp8;
  88. if rand == 1 then
  89. temp4 = 0x26; -- quake3
  90. temp8 = 1;
  91. else if rand == 2 then
  92. temp4 = 0x20; -- ice3
  93. else
  94. temp4 = 0x23; -- bolt3
  95. end;
  96. end
  97. end;
  98. battle:run_command(temp0, temp4); -- type, attack_id
  99. return 0;
  100. end;
  101. };