找回密码
 立即注册

QQ登录

只需一步,快速开始

Close
查看: 2160|回复: 4

[L2JTW] 【l2jtw】能力提升系統 (歡迎參考, 抄襲, 修改, 轉發, 除錯, 使用)

[复制链接]
  • 打卡等级:尐伊娃
  • 打卡总天数:192
  • 打卡月天数:9
  • 打卡总奖励:1854
发表于 2014-3-28 22:36:19 | 显示全部楼层 |阅读模式
转自l2jtw
原文如下
v1 初版
2012-02-22
簡介 部份 沒有寫.. 可以自行修改. .
註.. : powerUp_skill.xml 請自行覆製到 game\data\stats\skills\custom\powerUp_skill.xml

這個主要是.. 用特殊道具.. 換取個人的能力提升..
能力一般設為 10級. .有些設為 20級.
可按照個人喜好. 修改.. 增加 減少..能力等級, 修改加多少 減多少能力.

原作者:otfnir
下载地址:
百度网盘(2017-10-13更新下载链接)
http://pan.baidu.com/s/1dEP0mh7


下面代码为某位大大的美化版,附件为原版脚本
  1. skill_data = {
  2. 'MAX_HP':[5995, 20, [[57,100000]], 'HP 上限<img src="icon.skill1232" width=32 height=32>'],
  3. 'MAX_MP':[5996, 10, [[57,100000]], 'MP 上限<img src="icon.skill1238" width=32 height=32>'],
  4. 'REGENERATE_MP_RATE':[5997, 20, [[57,1000000]], 'MP回復率<img src="icon.skill1047" width=32 height=32>'],
  5. 'POWER_DEFENCE':[5998, 10, [[57,1000000]], '物防<img src="icon.skill0142" width=32 height=32>'],
  6. 'MAGIC_DEFENCE':[5999, 10, [[57,1000000]], '魔防<img src="icon.skill1036" width=32 height=32>'],
  7. 'POWER_ATTACK':[6000, 10, [[57,1000000]], '物攻<img src="icon.skill0003" width=32 height=32>'],
  8. 'MAGIC_ATTACK':[6001, 10, [[57,1000000]], '魔攻<img src="icon.skill1177" width=32 height=32>'],
  9. 'POWER_ATTACK_SPEED':[6002, 10, [[57,10000000]], '物攻速<img src="icon.skill0168" width=32 height=32>'],
  10. 'MAGIC_ATTACK_SPEED':[6003, 10, [[57,10000000]], '魔攻速<img src="icon.skill1479" width=32 height=32>'],
  11. 'MAGIC_REUSE_RATE':[6004, 10, [[57,100000]], '魔技再用時間<img src="icon.skill1297" width=32 height=32>'],
  12. 'CRITICAL_DAMAGE':[6005, 10, [[57,1000000]], '物爆擊傷害<img src="icon.skill0017" width=32 height=32>'],
  13. 'MAGIC_CRIT_DMG':[6006, 10, [[57,1000000]], '魔爆擊傷害<img src="icon.skill1291" width=32 height=32>'],
  14. 'EVASION_RATE':[6007, 10, [[57,1000000]], '回避率<img src="icon.skill0111" width=32 height=32>'],
  15. 'SHIELD_RATE':[6008, 10, [[57,1000000]], '盾防率<img src="icon.skill1556" width=32 height=32>'],
  16. 'CRITICAL_RATE':[6009, 10, [[57,1000000]], '物爆率<img src="icon.skill0137" width=32 height=32>'],
  17. 'MCRITICAL_RATE':[6010, 10, [[57,1000000]], '魔爆率<img src="icon.skill1235" width=32 height=32>'],
  18. 'EXPSP_RATE':[6011, 10, [[57,100000]], '經驗,SP率<img src="icon.skill0467" width=32 height=32>'],
  19. 'ACCURACY_COMBAT':[6012, 10, [[57,10000000]], '命中率<img src="icon.skill0422" width=32 height=32>'],
  20. 'RUN_SPEED':[6013, 10, [[57,10000000]], '跑速<img src="icon.skill0169" width=32 height=32>'],
  21. 'STAT_STR':[6014, 10, [[57,10000000]], '力量<img src="icon.skill10255" width=32 height=32>'],
  22. 'STAT_CON':[6015, 10, [[57,10000000]], '體質<img src="icon.skill10002" width=32 height=32>'],
  23. 'STAT_DEX':[6016, 10, [[57,10000000]], '敏捷<img src="icon.skill10504" width=32 height=32>'],
  24. 'STAT_INT':[6017, 10, [[57,10000000]], '智力<img src="icon.skill11253" width=32 height=32>'],
  25. 'STAT_WIT':[6018, 10, [[57,10000000]], '智慧<img src="icon.skill11251" width=32 height=32>'],
  26. 'STAT_MEN':[6025, 10, [[57,10000000]], '精神<img src="icon.skill10506" width=32 height=32>'],
  27. 'VITALITY_CONSUME_RATE':[6026, 10, [[57,1000000]], '活力消耗率<img src="icon.skill11536" width=32 height=32>'],
  28. 'P_REUSE':[6027, 10, [[57,1000000]], '物技再用時間<img src="icon.skill0334" width=32 height=32>'],
  29. }

  30. def __init__(self, id, name, descr):
  31. JQuest.__init__(self, id, name, descr)
  32. for id in self.NPCID:
  33. self.addStartNpc(id)
  34. self.addFirstTalkId(id)
  35. self.addTalkId(id)
  36. print "Init:" + qn + " loaded"

  37. def powerup_list(self, player, listonly = False):
  38. def getRandomList(listSize):
  39. templist = []
  40. listSize = min(listSize, len(self.skill_data.keys()))
  41. while len(templist) < listSize:
  42. temp = self.skill_data.keys()[Random().nextInt(len(self.skill_data.keys()))]
  43. if temp not in templist:
  44. templist += [temp]
  45. return templist

  46. st = player.getQuestState(qn)
  47. if not st:
  48. st = self.newQuestState(player)
  49. st.setState(State.STARTED)
  50. choiceList = st.get('choiceList') or ""
  51. choiceList = choiceList.split(",")
  52. if len(choiceList) != self.maxChoice:
  53. choiceList = getRandomList(self.maxChoice)
  54. choiceList.sort()
  55. st.set('choiceList', ",".join(choiceList))
  56. r = ""
  57. if listonly:
  58. for key in self.skill_data.keys():
  59. skillid, skillmaxlv, requireitem, desc = self.skill_data[key]
  60. r += "<─────><br1>" + desc + " " + str(max(0,player.getSkillLevel(skillid))) + "/" + str(skillmaxlv) + "<BR1>"
  61. else:
  62. for key in choiceList:
  63. skillid, skillmaxlv, requireitem, desc = self.skill_data[key]
  64. r += "<─────><a action="bypass -h Quest " + qn + " show_requirement " + key + "">" + desc + " " + str(max(0,player.getSkillLevel(skillid))) + "/" + str(skillmaxlv) + "</a><BR1>"
  65. return self.htm_header + r + self.htm_random + self.htm_footer

  66. def add_skill(self, player, skill_data_key):
  67. skill_id = self.skill_data[skill_data_key][0]
  68. new_skill_level = player.getSkillLevel(skill_id)
  69. new_skill_level = new_skill_level + 1 or 1
  70. player.addSkill(SkillTable.getInstance().getInfo(skill_id, new_skill_level), True)

  71. def take_items(self, player, skill_data_key):
  72. st = player.getQuestState(qn)
  73. for itemid, count in self.global_require_item:
  74. st.takeItems(itemid, count)
  75. for itemid, count in self.skill_data[skill_data_key][2]:
  76. st.takeItems(itemid, count)

  77. def check_requirement(self, player, skill_data_key):
  78. skill_id = self.skill_data[skill_data_key][0]
  79. skill_max_level = self.skill_data[skill_data_key][1]
  80. if player.getSkillLevel(skill_id)+1 > skill_max_level:
  81. player.sendMessage("升級已達到上限")
  82. return False
  83. if not self.check_require_item(player, skill_data_key):
  84. #player.sendMessage("道具不足")
  85. return False
  86. return True

  87. def check_require_item(self, player, skill_data_key):
  88. st = player.getQuestState(qn)
  89. for itemid, count in self.global_require_item:
  90. if st.getQuestItemsCount(itemid) < count:
  91. item_name = ItemTable.getInstance().getTemplate(itemid).getName()
  92. player.sendMessage("道具不足:" + item_name + " 需要 " + str(count))
  93. return False
  94. for itemid, count in self.skill_data[skill_data_key][2]:
  95. if st.getQuestItemsCount(itemid) < count:
  96. item_name = ItemTable.getInstance().getTemplate(itemid).getName()
  97. player.sendMessage("道具不足:" + item_name + " 需要 " + str(count))
  98. return False
  99. return True

  100. def show_requirement(self, player, skill_data_key):
  101. skillid, skillmaxlv, requireitem, desc = self.skill_data[skill_data_key]
  102. r = "<center>" + desc + "</center><BR>"
  103. r += "升級所需道具如下<BR>"
  104. for itemid, count in self.global_require_item:
  105. item_name = ItemTable.getInstance().getTemplate(itemid).getName()
  106. r += item_name + ":" + str(count) +"<br>"
  107. for itemid, count in requireitem:
  108. item_name = ItemTable.getInstance().getTemplate(itemid).getName()
  109. r += item_name + ":" + str(count) +"<br>"
  110. r += "<─────><a action="bypass -h Quest " + qn + " confirm " + skill_data_key + "">確認提升 " + desc + " " + str(max(0,player.getSkillLevel(skillid))) + "/" + str(skillmaxlv) + "</a><BR1>"
  111. return r

  112. def onAdvEvent(self, event, npc, player):
  113. st = player.getQuestState(qn)
  114. if event.startswith("show_requirement "):
  115. event = event[17:]
  116. if event in self.skill_data.keys():
  117. return self.htm_header + self.show_requirement(player, event) + self.htm_footer

  118. if event.startswith("confirm "):
  119. event = event[8:]
  120. if event in self.skill_data.keys():
  121. if self.check_requirement(player, event):
  122. self.take_items(player, event)
  123. self.add_skill(player, event)
  124. st.unset('choiceList')
  125. else:
  126. return self.htm_header + self.htm_not_meet_requirement + self.htm_footer

  127. if event == "random":
  128. itemid, count = self.random_require_item
  129. if st.getQuestItemsCount(itemid) < count:
  130. item_name = ItemTable.getInstance().getTemplate(itemid).getName()
  131. player.sendMessage("道具不足:" + item_name + " 需要 " + str(count))
  132. return ""
  133. st.takeItems(itemid, count)
  134. st.unset('choiceList')

  135. if event == "listonly":
  136. return self.powerup_list(player, True)
  137. return self.powerup_list(player)

  138. def onFirstTalk(self, npc, player):
  139. st = player.getQuestState(qn)
  140. if not st:
  141. st = self.newQuestState(player)
  142. st.setState(State.STARTED)
  143. return self.htm_header + self.htm_first + self.htm_footer

  144. PowerUp(qID, qn, qDesc)
复制代码





本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
回复

使用道具 举报

  • 打卡等级:尐席琳
  • 打卡总天数:293
  • 打卡月天数:0
  • 打卡总奖励:4216
发表于 2020-8-24 20:16:32 | 显示全部楼层
为了吟游诗人!!!
回复

使用道具 举报

发表于 2021-5-9 06:30:25 | 显示全部楼层
好东东啊,自己下来试试,
回复

使用道具 举报

发表于 2021-5-10 21:06:51 | 显示全部楼层
这个还是要强力支持一下。。
回复

使用道具 举报

  • 打卡等级:尐沙哈
  • 打卡总天数:56
  • 打卡月天数:0
  • 打卡总奖励:139
发表于 2024-4-3 13:30:55 | 显示全部楼层
thx!!!!!!!!!!!!!!!!!!!!!!!!!
回复

使用道具 举报

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

本版积分规则

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