sm

立即登录 | 账号注册

积分: 0 |用户组: 游客

搜索
服务器租用 传奇3一条龙 支付平台源码 无法下载点击此处反馈
查看: 354|回复: 1

[传奇3脚本] 传奇3BOSS查询Python脚本zircon引擎

[复制链接]

826

主题

36

回帖

23万

积分

霸王教主

积分
235297
发表于 2023-12-8 02:58:12 | 显示全部楼层 |阅读模式
BOSS查询Python脚本

  1. # -*- coding: utf-8 -*-
  2. # 载入模块SYS
  3. import sys
  4. # 引用模块的地址
  5. from Globals import *
  6. import clr

  7. clr.AddReference("Library")
  8. from Library import *
  9. import collections
  10. import NpcEvent
  11. import Server.Envir.SEnvir as SEnvir
  12. clr.AddReference("System.Core")
  13. clr.AddReference('System')
  14. import System
  15. clr.ImportExtensions(System.Linq)

  16. # 下面两个import用于调用其他NPC
  17. from Utils import ServerUtils
  18. from Npc import *

  19. import unicodedata


  20. # BOSS数量过多 建议分页
  21. # 这里是按等级分的 0-45, 75-100这样
  22. LEVEL_RANGE_1 = 45
  23. LEVEL_RANGE_2 = 90
  24. LEVEL_RANGE_3 = 180

  25. # 过滤名字结尾是数字的怪
  26. allInfo = [x for x in SEnvir.BossTrackerList if not (x.BossName)[-1].isdigit()]
  27. # 按等级升序
  28. sortByLevel = sorted(allInfo, cmp=None, key=lambda x: x.BossInfo.Level, reverse=False)

  29. def OnClick(args):
  30.         Self = args[0]
  31.         Sender = args[1]
  32.         Menu = args[2]
  33.         Dict={}
  34.        
  35.         if Menu == 1:
  36. #判断元宝
  37.                 if (Sender.GameGold < 10):
  38.                         say= """你没有足够的元宝。

  39.                         [离开:0]"""
  40.                 else:
  41. #上面条件达成,扣除元宝开始查询
  42.                         SubGameGold(Sender,10)
  43.                         say = GenereateSay(0, LEVEL_RANGE_1)
  44.         elif Menu == 2:
  45. #判断元宝
  46.                 if (Sender.GameGold < 10):
  47.                         say= """你没有足够的元宝。

  48.                         [离开:0]"""
  49.                 else:
  50. #上面条件达成,扣除元宝开始查询
  51.                         SubGameGold(Sender,10)
  52.                         say = GenereateSay(LEVEL_RANGE_1, LEVEL_RANGE_2)
  53.         elif Menu == 3:
  54. #判断元宝
  55.                 if (Sender.GameGold < 10):
  56.                         say= """你没有足够的元宝。

  57.                         [离开:0]"""
  58.                 else:
  59. #上面条件达成,扣除元宝开始查询
  60.                         SubGameGold(Sender,10)
  61.                         say = GenereateSay(LEVEL_RANGE_2, LEVEL_RANGE_3)
  62.         elif Menu == 4:
  63. #判断元宝
  64.                 if (Sender.GameGold < 10):
  65.                         say= """你没有足够的元宝。

  66.                         [离开:0]"""
  67.                 else:
  68. #上面条件达成,扣除元宝开始查询
  69.                         SubGameGold(Sender,10)
  70.                         say = GenereateSay(LEVEL_RANGE_3, 999999)

  71.         elif Menu >= 100:
  72.                 # 详情查询
  73.                 info = next(x for x in sortByLevel if x.BossInfo.Index == Menu-100)
  74.                 say = GenerateDetail(info.SpawnInfo) if info else "出错了"


  75.         else:
  76.                 say = """这里可以查询所有BOSS的状态

  77.                 每次查询收费10元宝

  78.                 [查询0-{}级boss:1]

  79.                 [查询{}-{}级boss:2]

  80.                 [查询{}-{}级boss:3]

  81.                 [查询{}级以上boss:4]
  82.                
  83.                 [关闭:0]""".format(LEVEL_RANGE_1, LEVEL_RANGE_1+1, LEVEL_RANGE_2, LEVEL_RANGE_2+1, LEVEL_RANGE_3, LEVEL_RANGE_3+1)
  84.   
  85.         Dict['Say']=say                         #定义聊天框对话内容
  86.         return Dict


  87. # 生成列表
  88. def GenereateSay(minLevel, maxLevel):
  89.         # 表头
  90.         say = '{0: <15} {1: <15} {2: <15} \n'.format('BOSS', '击杀者', '击杀时间')
  91.         # 内容
  92.         filtered = [x for x in sortByLevel if x.BossInfo.Level >= minLevel and x.BossInfo.Level <= maxLevel and not (x.BossName)[-1].isdigit()]
  93.         say += '\n'.join("[{}:{}]     {}    {}".format(
  94.                         boss.BossName,
  95.                         boss.BossInfo.Index + 100,
  96.                         boss.LastKiller.CharacterName if boss.LastKiller else '无',
  97.                         boss.LastKillTime if boss.LastKiller else '无') for boss in filtered)
  98.         return say


  99. def GenerateDetail(spawns):
  100.         # 表头
  101.         say = '{0: <10} {1: <6} {2: <6} {3: <6}\n'.format('名称', '当前地图', '存活数量', '下次刷新')
  102.         # 内容
  103.         say += '\n'.join("{}    {}   {}   {}".format(
  104.                         spawn.Info.Monster.MonsterName,
  105.                         spawn.CurrentMap.Info.Description,
  106.                         spawn.AliveCount,
  107.                         spawn.NextSpawn) for spawn in spawns)
  108.         return say


  109. #NpcEvent.add_listener(341,"OnClick",OnClick)
复制代码








上一篇:Zircon传奇3引擎Python超级传送脚本
下一篇:zircon引擎传奇3Python脚本,每日领取双倍经验
回复

使用道具 举报

1

主题

252

回帖

1070

积分

旋风流星刀

积分
1070
QQ
发表于 2023-12-29 22:01:20 | 显示全部楼层
积分任务
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|美林GM论坛 ( 蜀ICP备2020030293号-2 )|网站地图

禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.如遇版权问题,请及时QQ联系

GMT+8, 2024-4-27 20:00 , Processed in 0.337007 second(s), 65 queries .

Powered by Discuz! X3.5

Copyright © 2001-2024, Tencent Cloud.

快速回复 返回顶部 返回列表