Generate genereric aeo and curse actions

merge/2021-11-19
kaetemi 3 years ago
parent 838a362fad
commit 010c2c84eb
No known key found for this signature in database
GPG Key ID: 9873C4D40BB479BC

@ -21,8 +21,9 @@ base = {
# }, # },
"magic": { "magic": {
"damage": magicSpec, "damage": magicSpec,
"dot": magicSpec, "aoe": magicSpec,
"heal": [ "hp", "sap", "stamina", "focus" ], # "dot": magicSpec,
# "heal": [ "hp", "sap", "stamina", "focus" ],
"curse": curseSpec, "curse": curseSpec,
}, },
# "debuff": { # "debuff": {
@ -64,48 +65,73 @@ spellRandomPostTime = 1.0
# magic_damage # magic_damage
# egs_static_ai_action.cpp # egs_static_ai_action.cpp
# Total Magic Damage = DamageValue + (SpellPowerFactor * creature.AttackLevel) # Total Magic Damage = DamageValue + (SpellPowerFactor * creature.AttackLevel)
for spec in magicSpec: for skill in base["magic"]:
# for variant in variantSpec: for spec in base["magic"][skill]:
name = "magic_damage_" + spec # for variant in variantSpec:
# randBoostFactor = zlib.crc32("SpellPowerFactor" + name) & 0xffffffff name = "magic_" + skill + "_" + spec
# randBoostFactor = (((randBoostFactor % 2000) - 1000) * randomVariance) / 1000.0 # randBoostFactor = zlib.crc32("SpellPowerFactor" + name) & 0xffffffff
randBoostFactor = 0.0 # randBoostFactor = (((randBoostFactor % 2000) - 1000) * randomVariance) / 1000.0
# randBoostAdd = zlib.crc32("DamageValue" + name) & 0xffffffff randBoostFactor = 0.0
# randBoostAdd = (((randBoostAdd % 2000) - 1000) * randomVariance) / 1000.0 # randBoostAdd = zlib.crc32("DamageValue" + name) & 0xffffffff
randBoostAdd = 0.0 # randBoostAdd = (((randBoostAdd % 2000) - 1000) * randomVariance) / 1000.0
randBaseTime = zlib.crc32("CastingTime" + name) & 0xffffffff randBoostAdd = 0.0
randBaseTime = ((randBaseTime % 1000) * spellRandomBaseTime) / 1000.0 randBaseTime = zlib.crc32("CastingTime" + name) & 0xffffffff
randPostTime = zlib.crc32("PostActionTime" + name) & 0xffffffff randBaseTime = ((randBaseTime % 1000) * spellRandomBaseTime) / 1000.0
randPostTime = ((randPostTime % 1000) * spellRandomPostTime) / 1000.0 randPostTime = zlib.crc32("PostActionTime" + name) & 0xffffffff
baseTime = int((spellBaseTime + randBaseTime) * 10.0) * 0.1 randPostTime = ((randPostTime % 1000) * spellRandomPostTime) / 1000.0
postTime = int((spellPostTime + randPostTime) * 10.0) * 0.1 baseTime = int((spellBaseTime + randBaseTime) * 10.0) * 0.1
totalTime = baseTime + postTime postTime = int((spellPostTime + randPostTime) * 10.0) * 0.1
maxLevelDamage = (maxScore * totalTime * boosts["magic"]) / combatTime totalTime = baseTime + postTime
damagePerLevel = maxLevelDamage / maxCharacteristic maxLevelDamage = (maxScore * totalTime * boosts["magic"]) / combatTime
damagePerLevelFactor = (damagePerLevel + (damagePerLevel * randBoostFactor)) # * variantBoost[variant] damagePerLevel = maxLevelDamage / maxCharacteristic
damageAdd = (damagePerLevel + (damagePerLevel * randBoostAdd)) * minCharacteristic # * variantBaseLevel[variant] damagePerLevelFactor = (damagePerLevel + (damagePerLevel * randBoostFactor)) # * variantBoost[variant]
behaviour = "CAST_" + spec.upper() damageAdd = (damagePerLevel + (damagePerLevel * randBoostAdd)) * minCharacteristic # * variantBaseLevel[variant]
if behaviour == "CAST_ELECTRICITY": behaviour = "CAST_" + spec.upper()
behaviour = "CAST_ELEC" if behaviour == "CAST_ELECTRICITY":
if behaviour == "CAST_SHOCKWAVE": behaviour = "CAST_ELEC"
behaviour = "CAST_SHOCK" elif behaviour == "CAST_SHOCKWAVE":
damageType = spec.upper() behaviour = "CAST_SHOCK"
if damageType == "SHOCKWAVE": elif behaviour == "CAST_MADNESS":
damageType = "SHOCK" behaviour = "CAST_MAD"
with open(aiActionFolder + "\\" + name + ".aiaction", "w") as f: elif behaviour == "CAST_SNARE":
f.write("<?xml version=\"1.0\"?>\n") behaviour = "CAST_SLOW"
f.write("<FORM Version=\"4.0\" State=\"modified\">\n") damageType = spec.upper()
f.write(" <STRUCT>\n") if damageType == "SHOCKWAVE":
f.write(" <ATOM Name=\"type\" Value=\"DamageSpell\"/>\n") damageType = "SHOCK"
f.write(" <ATOM Name=\"Behaviour\" Value=\"" + behaviour + "\"/>\n") with open(aiActionFolder + "\\" + name + ".aiaction", "w") as f:
f.write(" <ATOM Name=\"SpellPowerFactor\" Value=\"" + str(round(damagePerLevelFactor, 3))+ "\"/>\n") f.write("<?xml version=\"1.0\"?>\n")
f.write(" <ATOM Name=\"DamageScore\" Value=\"HitPoints\"/>\n") f.write("<FORM Version=\"4.0\" State=\"modified\">\n")
f.write(" <ATOM Name=\"DamageType\" Value=\"" + damageType + "\"/>\n") f.write(" <STRUCT>\n")
f.write(" <ATOM Name=\"DamageValue\" Value=\"" + str(int(damageAdd)) + "\"/>\n") f.write(" <ATOM Name=\"type\" Value=\"DamageSpell\"/>\n")
f.write(" <ATOM Name=\"CastingTime\" Value=\"" + str(baseTime) + "\"/>\n") if skill == "aoe":
f.write(" <ATOM Name=\"PostActionTime\" Value=\"" + str(postTime) + "\"/>\n") f.write(" <ATOM Name=\"AreaType\" Value=\"Bomb\"/>\n")
f.write(" </STRUCT>\n") f.write(" <ATOM Name=\"BombRadius\" Value=\"4\"/>\n")
f.write("</FORM>\n") f.write(" <ATOM Name=\"Behaviour\" Value=\"" + behaviour + "\"/>\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(" <ATOM Name=\"EffectType\" Value=\"" + effectType + "\"/>\n")
f.write(" <ATOM Name=\"EffectValue\" Value=\"75\"/>\n")
f.write(" <ATOM Name=\"EffectDuration\" Value=\"" + str(round(effectDuration, 1)) + "\"/>\n")
f.write(" <ATOM Name=\"EffectDurationType\" Value=\"Normal\"/>\n")
else:
f.write(" <ATOM Name=\"SpellPowerFactor\" Value=\"" + str(round(damagePerLevelFactor, 3))+ "\"/>\n")
f.write(" <ATOM Name=\"DamageScore\" Value=\"HitPoints\"/>\n")
f.write(" <ATOM Name=\"DamageType\" Value=\"" + damageType + "\"/>\n")
f.write(" <ATOM Name=\"DamageValue\" Value=\"" + str(int(damageAdd)) + "\"/>\n")
f.write(" <ATOM Name=\"CastingTime\" Value=\"" + str(baseTime) + "\"/>\n")
f.write(" <ATOM Name=\"PostActionTime\" Value=\"" + str(postTime) + "\"/>\n")
f.write(" </STRUCT>\n")
f.write("</FORM>\n")
# player melee boosts # player melee boosts
# skill -> 10x # skill -> 10x

Loading…
Cancel
Save