void Monster::load(const PropertyBag &xml) { Creature::load(xml); if(xml.exists("preferredSpell")) { xml.get_optional("preferredSpell", preferredSpell); } else { preferredSpell = 0; } switch(preferredSpell) { case 0: spell = new SpellFireBall (&getZone(), m_ID, "data/spells/fireball.xml"); break; // Fireball case 1: spell = new SpellFireBall (&getZone(), m_ID, "data/spells/arctic-wind.xml"); break; // Arctic Wind case 2: spell = new SpellIncinerate (&getZone(), m_ID, "data/spells/incinerate.xml"); break; // Incinerate case 3: spell = new SpellFireBall (&getZone(), m_ID, "data/spells/chill.xml"); break; // Chill case 4: spell = new SpellHeal (&getZone(), m_ID, "data/spells/heal.xml"); break; // Heal case 5: spell = new SpellFireBall (&getZone(), m_ID, "data/spells/ice-blast.xml"); break; // Ice Blast case 6: spell = 0; break; // Reserved for "Resurrect" Spell default: spell = 0; break; }; if(spell!=0) { spell->available = true; } }
void Trigger::load(const PropertyBag &xml) { Actor::load(xml); loadList(xml, "sounds", sounds); if(xml.exists("triggerRadius")) { xml.get("triggerRadius", triggerRadius); } else { triggerRadius = getCylinderRadius(); // default } }