import xml.etree.ElementTree as et
rootDir = 'S:/groupServer/Data/'
dungeonNpcFile = 'npcdata_dungeon.xml'
dungeonSpawnFile = 'zonenpcspawndata_baekcheong_sulokgoong.xml'
defendRate = 100
attackRate = 100
def get_dungeon_npc_alias():
result = set()
tree = et.parse(rootDir + dungeonSpawnFile)
root = tree.getroot()
for x in root.iter():
attr = x.attrib
npc = attr.get('npc')
if npc:
result.add(npc)
return result
def change_npc():
attackAttributes = ["attack-concentrate-value", "attack-counter-damage-modify",
"attack-perfect-parry-damage-modify", "attack-power-creature-max",
"attack-power-creature-min", "hate-power-modify",
]
defendAttributes = ["defend-counter-reduce-modify", "defend-dodge-value-modify", "defend-force-value-modify",
"defend-parry-value-modify", "defend-perfect-parry-reduce-modify",
"defend-physical-value-modify",
"defend-power-creature-value", "defend-resist-power-creature-value", "hp-regen",
"hp-regen-combat",
"max-hp"]
tree = et.parse(rootDir + dungeonNpcFile)
root = tree.getroot()
aliasList = get_dungeon_npc_alias()
for x in root.iter():
attr = x.attrib
alias = x.get('alias')
if alias in aliasList:
attr['level'] = '56'
for ak in attackAttributes:
av = attr.get(ak)
if not av is None:
attr[ak] = str(int(int(av) * attackRate))
for dk in defendAttributes:
dv = attr.get(dk)
if not dv is None:
attr[dk] = str(int(int(dv) * defendRate))
tree.write(f'{dungeonNpcFile}.output')
change_npc()
文章来源:(舞子哥出品 92bns.cn)
舞子哥出品提供最新最全的剑灵SF开区信息、剑灵开区视频教程,剑灵修改文章教程,开区版本,开区网站模版,免费资源(登录器、版本、GM工具、等其他开区软件、服务端那些),找服,开服,玩服,学技术,修改剑灵数据等等就来舞子哥出品!