[crossfire] Command learn_spell does not work for some spells

Mark Wedel mwedel at sonic.net
Sun Dec 11 19:49:46 CST 2005


Andreas Kirschbaum wrote:
> The DM command learn_spell does not work for some spells: for example
> "learn_spell ball lightning" does not work.
> 
> The reason is that three different archetypes with "name ball lightning"
> and "type 101" (SPELL) exist:
> - abil_ball_lightning,
> - spell_ball_lightning,
> - spelldirect_ball_lightning.
> 
> This makes get_spell_by_name() fail because it finds more than one
> matching spell and therefore rejects the name as ambiguous.
> 
> To fix this, I'd suggest to make this function consider only archetypes
> with names "spell_xxx". Any objections or other suggestions?

  I'd think that the abil_ball_lightning could perhaps change names.  The 
monsters don't care what it is called :).  I'm just not sure if that is used for 
dragon players to give them the spell or something.

  Not even sure what spelldirect_ball_lightning is used for - the archetype 
exists, but isn't used in the treasure for any monster nor is it used by any 
other arch (quick grep spelldirect_ball_lightning */*) - I _think_ this is here 
for compatiblity because some maps gave the monster this object (old spell code) 
so needed an object to use for that instead of getting a null object.  IF this 
is the case, the maps should perhaps be examined to see if anything is still 
using this, and ideally, just fix up those references and remove this arch.

  All that said, looking for objects that have spell_ as the archetype name 
would probably be a safe workaround.  It'd perhaps also be good to somehow get 
that multiple matches were found and print a warning in that case, but not sure 
how easy that is to do.



More information about the crossfire mailing list