dungeon.tin 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. #nop 房间信息解析模块之副本管理;
  2. VAR {当前副本} {gCurrentDungeon} {主站};
  3. VAR {上一个副本} {gPrevDungeon} {主站};
  4. event.Define {map/EnterDungeon} {无参} {$MODULE} {进入副本,副本的名称在变量 gCurrentDungeon 中。};
  5. event.Define {map/LeaveDungeon} {无参} {$MODULE} {离开副本,副本的名称在变量 gPrevDungeon 中。};
  6. event.Define {map/EnterDungeonIdle} {无参} {$MODULE} {进入副本,且不再 busy,副本的名称在变量 gCurrentDungeon 中。};
  7. event.Define {map/LeaveDungeonIdle} {无参} {$MODULE} {离开副本,且不再 busy,副本的名称在变量 gPrevDungeon 中。};
  8. event.HandleOnce {map/init} {map/dungeon} {map} {map.Dungeon.Init};
  9. #alias {map.Dungeon.Init} {
  10. event.Handle {map/GotRoomInfo} {map/dungeon} {map} {map.Dungeon.locate};
  11. event.Handle {map/EnterDungeon} {map/dungeon} {map} {map.EnterDungeon.notice};
  12. event.Handle {map/LeaveDungeon} {map/dungeon} {map} {map.LeaveDungeon.notice};
  13. event.Handle {map/EnterDungeonIdle} {map/dungeon} {map} {map.EnterDungeon.notice idle};
  14. event.Handle {map/LeaveDungeonIdle} {map/dungeon} {map} {map.LeaveDungeon.notice idle};
  15. };
  16. #alias {map.EnterDungeon.notice} {
  17. #if { "%1" == "idle" } {
  18. warnLog 你来到了「$gCurrentDungeon」,你不忙。;
  19. #nop 万安塔进入的时候会丢失 GMCP 战斗标志。;
  20. #if { "$gCurrentDungeon" == "万安塔" } {char.MarkFight};
  21. };
  22. #else {
  23. warnLog 你来到了「$gCurrentDungeon」。;
  24. #tick dungeon.checkbusy {checkbusy} 1;
  25. busy.Wait {
  26. #untick dungeon.checkbusy;
  27. event.Emit map/EnterDungeonIdle;
  28. };
  29. };
  30. };
  31. #alias {map.LeaveDungeon.notice} {
  32. #if { "%1" == "idle" } {
  33. okLog 你离开了「$gPrevDungeon」,你不忙。;
  34. };
  35. #else {
  36. okLog 你离开了「$gPrevDungeon」。;
  37. #tick dungeon.checkbusy {checkbusy} 1;
  38. busy.Wait {
  39. #untick dungeon.checkbusy;
  40. event.Emit map/LeaveDungeonIdle;
  41. };
  42. };
  43. };
  44. #alias {map.Dungeon.locate} {
  45. #if { "$gMapRoom[name]" == "" } {
  46. errLog 房间信息解析不正确。;
  47. #return;
  48. };
  49. #local dungeon {主站};
  50. #if { "$gMapRoom[name]" == "%+1..S[%+1..S]" } {
  51. #local dungeon {$gMapRoom[name]};
  52. #replace dungeon {%+1..S[%+1..S]} {&2};
  53. #replace dungeon {任务副本} {};
  54. #replace gMapRoom[name] {[{[^\[]*}]} {};
  55. #replace gMapRoom[colorName] {[{[^\[]*}]} {};
  56. };
  57. #if { "$dungeon" == "$gCurrentDungeon" } {
  58. #return;
  59. };
  60. #var gPrevDungeon {$gCurrentDungeon};
  61. #var gCurrentDungeon {$dungeon};
  62. #if { "$dungeon" == "主站" } {
  63. event.Emit map/LeaveDungeon;
  64. };
  65. #else {
  66. event.Emit map/EnterDungeon;
  67. };
  68. };
  69. #action {^准备进入%S⏳$E} {
  70. map.dungeon.change {%1};
  71. };
  72. #action {^准备退出%S...$E} {
  73. map.dungeon.change {%1};
  74. };
  75. #alias {map.dungeon.change} {
  76. #local dungeon {%1};
  77. #nop 计有:藏经阁、鄱阳湖、万安塔、保卫襄阳、剿匪、团战、大航海等常规任务副本;
  78. #nop 及剑心居、北侠影视城、游侠等三个特别副本;
  79. #if { "$dungeon" != "{\[(.*)任务副本\]|北侠影视城|剑心居|游侠}" } {
  80. #return;
  81. };
  82. #class map.dungeon.change open;
  83. #action {^你进入了%1。{|ID=map/dungeon}$} {map.dungeon.change.done};
  84. #action {^你退出了%1。{|ID=map/dungeon}$} {map.dungeon.change.done};
  85. #alias {map.dungeon.change.sync} {
  86. #class map.dungeon.change kill;
  87. #untick map.dungeon.change.sync;
  88. sync.Ignore map.dungeon.change.sync;
  89. look;
  90. };
  91. #alias {map.dungeon.change.done} {
  92. xtt.Tick {map.dungeon.change.sync} {
  93. sync.Ignore map.dungeon.change.sync;
  94. sync.Wait {map.dungeon.change.sync} {map.dungeon.change.sync};
  95. } 1;
  96. };
  97. #delay {map.dungeon.change.wait} {map.dungeon.change.done} 5;
  98. #class dungeon.enter.wait close;
  99. };
  100. #action {^请使用 leave 自己的id 来退出副本。$E} {leave $user[id]; #line gag};
  101. #alias {enter jxj} {enter jianxinju} {5.5};