From 010c2c84eb38acb1a68a51cf0cf997a9d83ffa75 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 5 Jul 2021 18:36:39 +0800 Subject: [PATCH] Generate genereric aeo and curse actions --- .../extract_r2_required/generate_aiaction.py | 114 +++++++++++------- 1 file changed, 70 insertions(+), 44 deletions(-) diff --git a/ryzom/tools/extract_r2_required/generate_aiaction.py b/ryzom/tools/extract_r2_required/generate_aiaction.py index c592e1938..79d667648 100644 --- a/ryzom/tools/extract_r2_required/generate_aiaction.py +++ b/ryzom/tools/extract_r2_required/generate_aiaction.py @@ -21,8 +21,9 @@ base = { # }, "magic": { "damage": magicSpec, - "dot": magicSpec, - "heal": [ "hp", "sap", "stamina", "focus" ], + "aoe": magicSpec, + # "dot": magicSpec, + # "heal": [ "hp", "sap", "stamina", "focus" ], "curse": curseSpec, }, # "debuff": { @@ -64,48 +65,73 @@ spellRandomPostTime = 1.0 # magic_damage # egs_static_ai_action.cpp # Total Magic Damage = DamageValue + (SpellPowerFactor * creature.AttackLevel) -for spec in magicSpec: - # for variant in variantSpec: - name = "magic_damage_" + spec - # randBoostFactor = zlib.crc32("SpellPowerFactor" + name) & 0xffffffff - # randBoostFactor = (((randBoostFactor % 2000) - 1000) * randomVariance) / 1000.0 - randBoostFactor = 0.0 - # randBoostAdd = zlib.crc32("DamageValue" + name) & 0xffffffff - # randBoostAdd = (((randBoostAdd % 2000) - 1000) * randomVariance) / 1000.0 - randBoostAdd = 0.0 - randBaseTime = zlib.crc32("CastingTime" + name) & 0xffffffff - randBaseTime = ((randBaseTime % 1000) * spellRandomBaseTime) / 1000.0 - randPostTime = zlib.crc32("PostActionTime" + name) & 0xffffffff - randPostTime = ((randPostTime % 1000) * spellRandomPostTime) / 1000.0 - baseTime = int((spellBaseTime + randBaseTime) * 10.0) * 0.1 - postTime = int((spellPostTime + randPostTime) * 10.0) * 0.1 - totalTime = baseTime + postTime - maxLevelDamage = (maxScore * totalTime * boosts["magic"]) / combatTime - damagePerLevel = maxLevelDamage / maxCharacteristic - damagePerLevelFactor = (damagePerLevel + (damagePerLevel * randBoostFactor)) # * variantBoost[variant] - damageAdd = (damagePerLevel + (damagePerLevel * randBoostAdd)) * minCharacteristic # * variantBaseLevel[variant] - behaviour = "CAST_" + spec.upper() - if behaviour == "CAST_ELECTRICITY": - behaviour = "CAST_ELEC" - if behaviour == "CAST_SHOCKWAVE": - behaviour = "CAST_SHOCK" - damageType = spec.upper() - if damageType == "SHOCKWAVE": - damageType = "SHOCK" - with open(aiActionFolder + "\\" + name + ".aiaction", "w") as f: - f.write("\n") - f.write("
\n") - f.write(" \n") - f.write(" \n") - f.write(" \n") - f.write(" \n") - f.write(" \n") - f.write(" \n") - f.write(" \n") - f.write(" \n") - f.write(" \n") - f.write(" \n") - f.write("
\n") +for skill in base["magic"]: + for spec in base["magic"][skill]: + # for variant in variantSpec: + name = "magic_" + skill + "_" + spec + # randBoostFactor = zlib.crc32("SpellPowerFactor" + name) & 0xffffffff + # randBoostFactor = (((randBoostFactor % 2000) - 1000) * randomVariance) / 1000.0 + randBoostFactor = 0.0 + # randBoostAdd = zlib.crc32("DamageValue" + name) & 0xffffffff + # randBoostAdd = (((randBoostAdd % 2000) - 1000) * randomVariance) / 1000.0 + randBoostAdd = 0.0 + randBaseTime = zlib.crc32("CastingTime" + name) & 0xffffffff + randBaseTime = ((randBaseTime % 1000) * spellRandomBaseTime) / 1000.0 + randPostTime = zlib.crc32("PostActionTime" + name) & 0xffffffff + randPostTime = ((randPostTime % 1000) * spellRandomPostTime) / 1000.0 + baseTime = int((spellBaseTime + randBaseTime) * 10.0) * 0.1 + postTime = int((spellPostTime + randPostTime) * 10.0) * 0.1 + totalTime = baseTime + postTime + maxLevelDamage = (maxScore * totalTime * boosts["magic"]) / combatTime + damagePerLevel = maxLevelDamage / maxCharacteristic + damagePerLevelFactor = (damagePerLevel + (damagePerLevel * randBoostFactor)) # * variantBoost[variant] + damageAdd = (damagePerLevel + (damagePerLevel * randBoostAdd)) * minCharacteristic # * variantBaseLevel[variant] + behaviour = "CAST_" + spec.upper() + if behaviour == "CAST_ELECTRICITY": + behaviour = "CAST_ELEC" + elif behaviour == "CAST_SHOCKWAVE": + behaviour = "CAST_SHOCK" + elif behaviour == "CAST_MADNESS": + behaviour = "CAST_MAD" + elif behaviour == "CAST_SNARE": + behaviour = "CAST_SLOW" + damageType = spec.upper() + if damageType == "SHOCKWAVE": + damageType = "SHOCK" + with open(aiActionFolder + "\\" + name + ".aiaction", "w") as f: + f.write("\n") + f.write("
\n") + f.write(" \n") + f.write(" \n") + if skill == "aoe": + f.write(" \n") + f.write(" \n") + f.write(" \n") + if skill == "curse": + effectType = spec[0].upper() + spec[1:] + if effectType == "Sleep": + effectType = "Mezz" + elif effectType == "Madness": + effectType = "MeleeMadness" + elif effectType == "Slow": + effectType = "SlowMelee" + elif effectType == "Snare": + effectType = "SlowMove" + referenceTime = spellBaseTime + spellRandomBaseTime / 2.0 + spellPostTime + spellRandomPostTime / 2.0 + effectDuration = 10.0 * totalTime / referenceTime + f.write(" \n") + f.write(" \n") + f.write(" \n") + f.write(" \n") + else: + f.write(" \n") + f.write(" \n") + f.write(" \n") + f.write(" \n") + f.write(" \n") + f.write(" \n") + f.write(" \n") + f.write("
\n") # player melee boosts # skill -> 10x