Add spell casting script for arrows, adapted from patch https://sourceforge.net/p/crossfire/patches/364/

git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@21599 282e977c-c81d-0410-88c4-b93c2d0d6712
master
ryo_saeba 2020-12-12 16:12:36 +00:00
parent 8d9a295239
commit 4318122384
2 changed files with 22 additions and 0 deletions

View File

@ -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.

View File

@ -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()