area.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. 'use strict';
  2. const {
  3. Vec3: g
  4. } = require('tera-data-parser').types;
  5. class I {
  6. constructor(cutallbehaviorlist) {
  7. const blackbottle = cutallbehaviorlist.mod,
  8. emptybottle = cutallbehaviorlist.defs;
  9. this.entities = new Map();
  10. const bottlepoison = new Map(),
  11. crestrapidattack = new Map();
  12. bottlepoison.set(713, [81301, 81359, 81305, 81307]);
  13. crestrapidattack.set(467, [46704]);
  14. crestrapidattack.set(767, [46704]);
  15. const crestfightingwill = (cutallbehaviorlist, blackbottle) => {
  16. if (this.entities.has(blackbottle.gameId)) {
  17. if ('Uedgg' !== 'Iiway') {
  18. const emptybottle = blackbottle.loc.addN(blackbottle.dest).scale(0.5);
  19. this.entities.set(blackbottle.gameId, {
  20. 'type': cutallbehaviorlist,
  21. 'loc': emptybottle,
  22. 'w': blackbottle.w
  23. });
  24. } else {
  25. return;
  26. }
  27. }
  28. },
  29. apple = (cutallbehaviorlist, blackbottle) => {
  30. if (1 === cutallbehaviorlist && (blackbottle.aggressive || 12 == blackbottle.relation || 10 == blackbottle.relation && 1 == blackbottle.spawnType)) {
  31. const emptybottle = bottlepoison.get(blackbottle.huntingZoneId),
  32. crestfightingwill = crestrapidattack.get(blackbottle.huntingZoneId);
  33. if (emptybottle && -1 !== emptybottle.indexOf(blackbottle.templateId)) {
  34. this.entities.set(blackbottle.gameId, {
  35. 'type': 3,
  36. 'loc': blackbottle.loc,
  37. 'w': blackbottle.w
  38. });
  39. } else if (crestfightingwill && -1 !== crestfightingwill.indexOf(blackbottle.templateId)) {
  40. this.entities.set(blackbottle.gameId, {
  41. 'type': 4,
  42. 'loc': blackbottle.loc,
  43. 'w': blackbottle.w
  44. });
  45. } else {
  46. if ('JvbbR' !== 'mQmcu') {
  47. this.entities.set(blackbottle.gameId, {
  48. 'type': cutallbehaviorlist,
  49. 'loc': blackbottle.loc,
  50. 'w': blackbottle.w
  51. });
  52. } else {
  53. return;
  54. }
  55. }
  56. if (blackbottle.replaceId !== BigInt(0)) {
  57. if ('LmMxF' === 'LmMxF') {
  58. this.entities.delete(blackbottle.replaceId);
  59. } else {
  60. return;
  61. }
  62. }
  63. } else if (0 === cutallbehaviorlist) {
  64. this.entities.set(blackbottle.gameId, {
  65. 'type': cutallbehaviorlist,
  66. 'loc': blackbottle.loc,
  67. 'w': blackbottle.w
  68. });
  69. }
  70. },
  71. blackdagger = cutallbehaviorlist => {
  72. this.entities.delete(cutallbehaviorlist);
  73. },
  74. crestribbreaker = cutallbehaviorlist => {
  75. if (!this.entities.has(cutallbehaviorlist.gameId)) {
  76. if ('ncTfT' !== 'JdjDK') {
  77. return;
  78. } else {
  79. return this.entities.has(cutallbehaviorlist) ? this.entities.get(cutallbehaviorlist) : null;
  80. }
  81. }
  82. const blackbottle = this.entities.get(cutallbehaviorlist.gameId);
  83. blackbottle.w = cutallbehaviorlist.w;
  84. this.entities.set(cutallbehaviorlist.gameId, blackbottle);
  85. },
  86. itemmix = cutallbehaviorlist => {
  87. if (!this.entities.has(cutallbehaviorlist.target)) {
  88. return;
  89. }
  90. let blackbottle = this.entities.get(cutallbehaviorlist.target);
  91. if (blackbottle.loc && cutallbehaviorlist.reaction.enable) {
  92. let emptybottle = 0;
  93. for (let blackbottle in cutallbehaviorlist.reaction.animSeq) {
  94. if ('YNqsc' !== 'YNqsc') {
  95. return this.entities.has(cutallbehaviorlist) && 0 === this.entities.get(cutallbehaviorlist).type;
  96. } else {
  97. emptybottle += cutallbehaviorlist.reaction.animSeq[blackbottle].distance;
  98. }
  99. }
  100. emptybottle *= -1;
  101. blackbottle.loc.x += Math.cos(blackbottle.w) * emptybottle;
  102. blackbottle.loc.y += Math.sin(blackbottle.w) * emptybottle;
  103. this.entities.set(cutallbehaviorlist.target, blackbottle);
  104. }
  105. },
  106. crestveinslash = cutallbehaviorlist => {
  107. if (!this.entities.has(cutallbehaviorlist.gameId)) {
  108. return;
  109. }
  110. let blackbottle = this.entities.get(cutallbehaviorlist.gameId);
  111. blackbottle.loc = cutallbehaviorlist.loc;
  112. blackbottle.w = cutallbehaviorlist.w;
  113. if (cutallbehaviorlist.animSeq) {
  114. if ('GGSTH' !== 'kXEDD') {
  115. let emptybottle = 0;
  116. for (let blackbottle in cutallbehaviorlist.animSeq) {
  117. emptybottle += cutallbehaviorlist.animSeq[blackbottle].distance;
  118. }
  119. blackbottle.loc.x += Math.cos(blackbottle.w) * emptybottle;
  120. blackbottle.loc.y += Math.sin(blackbottle.w) * emptybottle;
  121. } else {
  122. let mackerelcat = 0;
  123. for (let staff in cutallbehaviorlist.reaction.animSeq) {
  124. mackerelcat += cutallbehaviorlist.reaction.animSeq[staff].distance;
  125. }
  126. mackerelcat *= -1;
  127. blackbottle.loc.x += Math.cos(blackbottle.w) * mackerelcat;
  128. blackbottle.loc.y += Math.sin(blackbottle.w) * mackerelcat;
  129. this.entities.set(cutallbehaviorlist.target, blackbottle);
  130. }
  131. } else if (cutallbehaviorlist.dest && 0 != cutallbehaviorlist.dest.x && 0 != cutallbehaviorlist.dest.y && 0 != cutallbehaviorlist.dest.z) {
  132. blackbottle.loc = cutallbehaviorlist.loc.addN(cutallbehaviorlist.dest).scale(0.5);
  133. }
  134. this.entities.set(cutallbehaviorlist.gameId, blackbottle);
  135. },
  136. cresttrackinginferno = cutallbehaviorlist => {
  137. if ('QBrdi' !== 'QBrdi') {
  138. if (!this.entities.has(cutallbehaviorlist.target)) {
  139. return;
  140. }
  141. const amulet = this.entities.get(cutallbehaviorlist.target);
  142. amulet.loc = cutallbehaviorlist.loc;
  143. this.entities.set(cutallbehaviorlist.target, amulet);
  144. } else {
  145. if (!this.entities.has(cutallbehaviorlist.target)) {
  146. if ('nBNIX' === 'Vuxbb') {
  147. let cresthealingpray = 0;
  148. for (let searchable in cutallbehaviorlist.animSeq) {
  149. cresthealingpray += cutallbehaviorlist.animSeq[searchable].distance;
  150. }
  151. blackbottle.loc.x += Math.cos(blackbottle.w) * cresthealingpray;
  152. blackbottle.loc.y += Math.sin(blackbottle.w) * cresthealingpray;
  153. } else {
  154. return;
  155. }
  156. }
  157. const blackbottle = this.entities.get(cutallbehaviorlist.target);
  158. blackbottle.loc = blackbottle.loc.add(new g(cutallbehaviorlist.distance, 0, 0).rotate(blackbottle.w));
  159. this.entities.set(cutallbehaviorlist.target, blackbottle);
  160. }
  161. },
  162. moonshadow = cutallbehaviorlist => {
  163. if (!this.entities.has(cutallbehaviorlist.target)) {
  164. if ('zPcti' === 'jzcxP') {
  165. if (!this.entities.has(cutallbehaviorlist)) {
  166. return ![];
  167. }
  168. let darkmountainfragment = this.entities.get(cutallbehaviorlist);
  169. if (1 === darkmountainfragment.type || 3 === darkmountainfragment.type || 4 === darkmountainfragment.type) {
  170. return !![];
  171. }
  172. return ![];
  173. } else {
  174. return;
  175. }
  176. }
  177. const blackbottle = this.entities.get(cutallbehaviorlist.target);
  178. blackbottle.loc = cutallbehaviorlist.loc;
  179. this.entities.set(cutallbehaviorlist.target, blackbottle);
  180. };
  181. blackbottle.hook(...emptybottle.getVersion('S_NPC_LOCATION'), {
  182. 'order': -999999,
  183. 'filter': {
  184. 'fake': ![]
  185. }
  186. }, crestfightingwill.bind(null, 1));
  187. blackbottle.hook(...emptybottle.getVersion('S_USER_LOCATION'), {
  188. 'order': -999999,
  189. 'filter': {
  190. 'fake': ![]
  191. }
  192. }, crestfightingwill.bind(null, 0));
  193. blackbottle.hook(...emptybottle.getVersion('S_SPAWN_NPC'), {
  194. 'order': -999999,
  195. 'filter': {
  196. 'fake': ![]
  197. }
  198. }, apple.bind(null, 1));
  199. blackbottle.hook(...emptybottle.getVersion('S_SPAWN_USER'), {
  200. 'order': -999999,
  201. 'filter': {
  202. 'fake': ![]
  203. }
  204. }, apple.bind(null, 0));
  205. blackbottle.hook(...emptybottle.getVersion('S_DESPAWN_NPC'), {
  206. 'order': -999999,
  207. 'filter': {
  208. 'fake': ![]
  209. }
  210. }, blackdagger);
  211. blackbottle.hook(...emptybottle.getVersion('S_DESPAWN_USER'), {
  212. 'order': -999999,
  213. 'filter': {
  214. 'fake': ![]
  215. }
  216. }, blackdagger);
  217. blackbottle.hook(...emptybottle.getVersion('S_CREATURE_ROTATE'), {
  218. 'order': -999999,
  219. 'filter': {
  220. 'fake': ![]
  221. }
  222. }, crestribbreaker);
  223. blackbottle.hook(...emptybottle.getVersion('S_EACH_SKILL_RESULT'), {
  224. 'order': -999999,
  225. 'filter': {
  226. 'fake': ![]
  227. }
  228. }, itemmix);
  229. blackbottle.hook(...emptybottle.getVersion('S_ACTION_STAGE'), {
  230. 'order': -999999,
  231. 'filter': {
  232. 'fake': ![]
  233. }
  234. }, crestveinslash);
  235. blackbottle.hook(...emptybottle.getVersion('S_ACTION_END'), {
  236. 'order': -999999,
  237. 'filter': {
  238. 'fake': ![]
  239. }
  240. }, crestveinslash);
  241. blackbottle.hook(...emptybottle.getVersion('S_STICK_TO_USER_START'), {
  242. 'order': -999999,
  243. 'filter': {
  244. 'fake': ![]
  245. }
  246. }, cresttrackinginferno);
  247. blackbottle.hook(...emptybottle.getVersion('S_STICK_TO_USER_END'), {
  248. 'order': -999999,
  249. 'filter': {
  250. 'fake': ![]
  251. }
  252. }, moonshadow);
  253. blackbottle.hook('S_LOAD_TOPO', 'raw', () => this.entities.clear());
  254. } ['getTypeByGameId'](crestsealed) {
  255. return this.entities.has(crestsealed) ? this.entities.get(crestsealed).type : -1;
  256. } ['getBackstabLocation'](bugbeetle) {
  257. return this.entities.has(bugbeetle) ? this.entities.get(bugbeetle) : null;
  258. } ['isMob'](cresthandyslash) {
  259. if (!this.entities.has(cresthandyslash)) {
  260. return ![];
  261. }
  262. let level = this.entities.get(cresthandyslash);
  263. if (1 === level.type || 3 === level.type || 4 === level.type) {
  264. if ('FiRnO' !== 'FiRnO') {
  265. if (!this.entities.has(cresthandyslash.target)) {
  266. return;
  267. }
  268. const medium = this.entities.get(cresthandyslash.target);
  269. medium.loc = medium.loc.add(new g(cresthandyslash.distance, 0, 0).rotate(medium.w));
  270. this.entities.set(cresthandyslash.target, medium);
  271. } else {
  272. return !![];
  273. }
  274. }
  275. return ![];
  276. } ['isPlayer'](crestsleepwind) {
  277. return this.entities.has(crestsleepwind) && 0 === this.entities.get(crestsleepwind).type;
  278. }
  279. }
  280. module.exports = I;