diff --git a/ChangeLog b/ChangeLog index 2375e5be4..794d4fe5a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2020-12-12 Nicolas Weeger + * python/items/spell_arrow.py: Apply modified patch #364, see https://sourceforge.net/p/crossfire/patches/364/ + 2020-12-02 Nicolas Weeger * styles/cheststyles: Add map with available chests for random maps. This will allow removing hardcoded list in the server code. diff --git a/python/items/spell_arrow.py b/python/items/spell_arrow.py new file mode 100644 index 000000000..44a715c83 --- /dev/null +++ b/python/items/spell_arrow.py @@ -0,0 +1,19 @@ +import Crossfire + +who = Crossfire.WhoAmI() +victim = Crossfire.WhoIsOther(); + +spells = who.ReadKey("arrow_spell") +if spells and victim: + spells = spells.split(";") + for spell in spells: + if ":" in spell: + quantity, archetype = spell.split(":") + else: + quantity = 1 + archetype = spell + spellob = Crossfire.CreateObjectByName(archetype) + if spellob: + for r in range(0, int(quantity)): + victim.CastAbility(spellob, 0, "") + spellob.Remove()