index.js 768 B

12345678910111213141516171819202122232425262728293031323334
  1. module.exports = function FF(mod) {
  2. let unlock = false
  3. mod.hook('S_ABNORMALITY_BEGIN', 4, event => {
  4. if (!mod.game.me.is(event.target)) return
  5. if (event.id === 30010000) unlock = true
  6. })
  7. mod.hook('S_ABNORMALITY_END', 1, event => {
  8. if (!mod.game.me.is(event.target)) return
  9. if (event.id === 30010000) unlock = false
  10. })
  11. mod.game.me.on('change_zone', (zone, quick) => {
  12. if (zone === 2000 && !unlock) {
  13. unlock = true
  14. mod.send('S_ABNORMALITY_BEGIN', 4, {
  15. target: mod.game.me.gameId,
  16. source: mod.game.me.gameId,
  17. id: 30010000,
  18. duration: 0x7FFFFFFF,
  19. stacks: 1
  20. })
  21. }
  22. if (zone !== 2000 && unlock) {
  23. unlock = false
  24. mod.send('S_ABNORMALITY_END', 1, {
  25. target: mod.game.me.gameId,
  26. id: 30010000
  27. })
  28. }
  29. })
  30. }