- 打卡等级:尐伊娃
- 打卡总天数:192
- 打卡月天数:9
- 打卡总奖励:1854
|
转自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
下面代码为某位大大的美化版,附件为原版脚本
- skill_data = {
- 'MAX_HP':[5995, 20, [[57,100000]], 'HP 上限<img src="icon.skill1232" width=32 height=32>'],
- 'MAX_MP':[5996, 10, [[57,100000]], 'MP 上限<img src="icon.skill1238" width=32 height=32>'],
- 'REGENERATE_MP_RATE':[5997, 20, [[57,1000000]], 'MP回復率<img src="icon.skill1047" width=32 height=32>'],
- 'POWER_DEFENCE':[5998, 10, [[57,1000000]], '物防<img src="icon.skill0142" width=32 height=32>'],
- 'MAGIC_DEFENCE':[5999, 10, [[57,1000000]], '魔防<img src="icon.skill1036" width=32 height=32>'],
- 'POWER_ATTACK':[6000, 10, [[57,1000000]], '物攻<img src="icon.skill0003" width=32 height=32>'],
- 'MAGIC_ATTACK':[6001, 10, [[57,1000000]], '魔攻<img src="icon.skill1177" width=32 height=32>'],
- 'POWER_ATTACK_SPEED':[6002, 10, [[57,10000000]], '物攻速<img src="icon.skill0168" width=32 height=32>'],
- 'MAGIC_ATTACK_SPEED':[6003, 10, [[57,10000000]], '魔攻速<img src="icon.skill1479" width=32 height=32>'],
- 'MAGIC_REUSE_RATE':[6004, 10, [[57,100000]], '魔技再用時間<img src="icon.skill1297" width=32 height=32>'],
- 'CRITICAL_DAMAGE':[6005, 10, [[57,1000000]], '物爆擊傷害<img src="icon.skill0017" width=32 height=32>'],
- 'MAGIC_CRIT_DMG':[6006, 10, [[57,1000000]], '魔爆擊傷害<img src="icon.skill1291" width=32 height=32>'],
- 'EVASION_RATE':[6007, 10, [[57,1000000]], '回避率<img src="icon.skill0111" width=32 height=32>'],
- 'SHIELD_RATE':[6008, 10, [[57,1000000]], '盾防率<img src="icon.skill1556" width=32 height=32>'],
- 'CRITICAL_RATE':[6009, 10, [[57,1000000]], '物爆率<img src="icon.skill0137" width=32 height=32>'],
- 'MCRITICAL_RATE':[6010, 10, [[57,1000000]], '魔爆率<img src="icon.skill1235" width=32 height=32>'],
- 'EXPSP_RATE':[6011, 10, [[57,100000]], '經驗,SP率<img src="icon.skill0467" width=32 height=32>'],
- 'ACCURACY_COMBAT':[6012, 10, [[57,10000000]], '命中率<img src="icon.skill0422" width=32 height=32>'],
- 'RUN_SPEED':[6013, 10, [[57,10000000]], '跑速<img src="icon.skill0169" width=32 height=32>'],
- 'STAT_STR':[6014, 10, [[57,10000000]], '力量<img src="icon.skill10255" width=32 height=32>'],
- 'STAT_CON':[6015, 10, [[57,10000000]], '體質<img src="icon.skill10002" width=32 height=32>'],
- 'STAT_DEX':[6016, 10, [[57,10000000]], '敏捷<img src="icon.skill10504" width=32 height=32>'],
- 'STAT_INT':[6017, 10, [[57,10000000]], '智力<img src="icon.skill11253" width=32 height=32>'],
- 'STAT_WIT':[6018, 10, [[57,10000000]], '智慧<img src="icon.skill11251" width=32 height=32>'],
- 'STAT_MEN':[6025, 10, [[57,10000000]], '精神<img src="icon.skill10506" width=32 height=32>'],
- 'VITALITY_CONSUME_RATE':[6026, 10, [[57,1000000]], '活力消耗率<img src="icon.skill11536" width=32 height=32>'],
- 'P_REUSE':[6027, 10, [[57,1000000]], '物技再用時間<img src="icon.skill0334" width=32 height=32>'],
- }
- def __init__(self, id, name, descr):
- JQuest.__init__(self, id, name, descr)
- for id in self.NPCID:
- self.addStartNpc(id)
- self.addFirstTalkId(id)
- self.addTalkId(id)
- print "Init:" + qn + " loaded"
- def powerup_list(self, player, listonly = False):
- def getRandomList(listSize):
- templist = []
- listSize = min(listSize, len(self.skill_data.keys()))
- while len(templist) < listSize:
- temp = self.skill_data.keys()[Random().nextInt(len(self.skill_data.keys()))]
- if temp not in templist:
- templist += [temp]
- return templist
- st = player.getQuestState(qn)
- if not st:
- st = self.newQuestState(player)
- st.setState(State.STARTED)
- choiceList = st.get('choiceList') or ""
- choiceList = choiceList.split(",")
- if len(choiceList) != self.maxChoice:
- choiceList = getRandomList(self.maxChoice)
- choiceList.sort()
- st.set('choiceList', ",".join(choiceList))
- r = ""
- if listonly:
- for key in self.skill_data.keys():
- skillid, skillmaxlv, requireitem, desc = self.skill_data[key]
- r += "<─────><br1>" + desc + " " + str(max(0,player.getSkillLevel(skillid))) + "/" + str(skillmaxlv) + "<BR1>"
- else:
- for key in choiceList:
- skillid, skillmaxlv, requireitem, desc = self.skill_data[key]
- r += "<─────><a action="bypass -h Quest " + qn + " show_requirement " + key + "">" + desc + " " + str(max(0,player.getSkillLevel(skillid))) + "/" + str(skillmaxlv) + "</a><BR1>"
- return self.htm_header + r + self.htm_random + self.htm_footer
- def add_skill(self, player, skill_data_key):
- skill_id = self.skill_data[skill_data_key][0]
- new_skill_level = player.getSkillLevel(skill_id)
- new_skill_level = new_skill_level + 1 or 1
- player.addSkill(SkillTable.getInstance().getInfo(skill_id, new_skill_level), True)
- def take_items(self, player, skill_data_key):
- st = player.getQuestState(qn)
- for itemid, count in self.global_require_item:
- st.takeItems(itemid, count)
- for itemid, count in self.skill_data[skill_data_key][2]:
- st.takeItems(itemid, count)
- def check_requirement(self, player, skill_data_key):
- skill_id = self.skill_data[skill_data_key][0]
- skill_max_level = self.skill_data[skill_data_key][1]
- if player.getSkillLevel(skill_id)+1 > skill_max_level:
- player.sendMessage("升級已達到上限")
- return False
- if not self.check_require_item(player, skill_data_key):
- #player.sendMessage("道具不足")
- return False
- return True
- def check_require_item(self, player, skill_data_key):
- st = player.getQuestState(qn)
- for itemid, count in self.global_require_item:
- if st.getQuestItemsCount(itemid) < count:
- item_name = ItemTable.getInstance().getTemplate(itemid).getName()
- player.sendMessage("道具不足:" + item_name + " 需要 " + str(count))
- return False
- for itemid, count in self.skill_data[skill_data_key][2]:
- if st.getQuestItemsCount(itemid) < count:
- item_name = ItemTable.getInstance().getTemplate(itemid).getName()
- player.sendMessage("道具不足:" + item_name + " 需要 " + str(count))
- return False
- return True
- def show_requirement(self, player, skill_data_key):
- skillid, skillmaxlv, requireitem, desc = self.skill_data[skill_data_key]
- r = "<center>" + desc + "</center><BR>"
- r += "升級所需道具如下<BR>"
- for itemid, count in self.global_require_item:
- item_name = ItemTable.getInstance().getTemplate(itemid).getName()
- r += item_name + ":" + str(count) +"<br>"
- for itemid, count in requireitem:
- item_name = ItemTable.getInstance().getTemplate(itemid).getName()
- r += item_name + ":" + str(count) +"<br>"
- r += "<─────><a action="bypass -h Quest " + qn + " confirm " + skill_data_key + "">確認提升 " + desc + " " + str(max(0,player.getSkillLevel(skillid))) + "/" + str(skillmaxlv) + "</a><BR1>"
- return r
- def onAdvEvent(self, event, npc, player):
- st = player.getQuestState(qn)
- if event.startswith("show_requirement "):
- event = event[17:]
- if event in self.skill_data.keys():
- return self.htm_header + self.show_requirement(player, event) + self.htm_footer
- if event.startswith("confirm "):
- event = event[8:]
- if event in self.skill_data.keys():
- if self.check_requirement(player, event):
- self.take_items(player, event)
- self.add_skill(player, event)
- st.unset('choiceList')
- else:
- return self.htm_header + self.htm_not_meet_requirement + self.htm_footer
- if event == "random":
- itemid, count = self.random_require_item
- if st.getQuestItemsCount(itemid) < count:
- item_name = ItemTable.getInstance().getTemplate(itemid).getName()
- player.sendMessage("道具不足:" + item_name + " 需要 " + str(count))
- return ""
- st.takeItems(itemid, count)
- st.unset('choiceList')
- if event == "listonly":
- return self.powerup_list(player, True)
- return self.powerup_list(player)
- def onFirstTalk(self, npc, player):
- st = player.getQuestState(qn)
- if not st:
- st = self.newQuestState(player)
- st.setState(State.STARTED)
- return self.htm_header + self.htm_first + self.htm_footer
- PowerUp(qID, qn, qDesc)
复制代码
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
×
|