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-b93c2d0d6712master
parent
8d9a295239
commit
4318122384
|
@ -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.
|
||||
|
||||
|
|
|
@ -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()
|
Loading…
Reference in New Issue