MountSkinFunc.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using pomelo.connector;
  7. using CommonLang.Property;
  8. using pomelo.area;
  9. namespace XmdsBotTest.Runner
  10. {
  11. public class MountSkinFunc : BotRunner.RunnerModule
  12. {
  13. public MountSkinFunc() {
  14. module_name = "坐骑更换皮肤";
  15. }
  16. public MountSkinFunc(BotRunner r) : base(r)
  17. {
  18. }
  19. protected internal override void OnGateBindPlayer(BindPlayerResponse e)
  20. {
  21. base.OnGateBindPlayer(e);
  22. runner.do_gm_add_exp(999999);
  23. // gm发放皮肤
  24. runner.do_gm_add_skin();
  25. }
  26. protected internal override void OnBattleActorReady(CommonAI.ZoneClient.ZoneLayer layer, CommonAI.ZoneClient.ZoneActor actor)
  27. {
  28. layer.AddTimePeriodicMS(Config.CheckIntervalMS, (t) =>
  29. {
  30. if (Enable)
  31. {
  32. activeMountSkinRequest();
  33. }
  34. });
  35. }
  36. private void activeMountSkinRequest()
  37. {
  38. int skinId = bot.Random.Next(1, 8);
  39. client.GameSocket.mountHandler.activeMountSkinRequest(skinId,
  40. (err, rsp) =>
  41. { });
  42. }
  43. [Desc("坐骑更换皮肤配置")]
  44. [Expandable]
  45. public class Config : ConfigBase
  46. {
  47. [Desc("坐骑更换皮肤检测间隔")]
  48. public static int CheckIntervalMS = 5000;
  49. public override string ToString()
  50. {
  51. return "坐骑更换皮肤配置";
  52. }
  53. public override void popG2DPropertyDialog()
  54. {
  55. CommonFroms.G2D.G2DPropertyDialog<MountSkinFunc.Config>.Show("修改配置", this);
  56. }
  57. }
  58. }
  59. }