Code: Select all
Spell 1
{
Name Ultimate Spell Of Mass Destruction
PowerWords Kal Vas Mon Ty Pyt Hon
ManaCost 50
Difficulty 50
CastType Normal
TargetType Mobile
Notoriety Harmful
ResistType Damage
Animation Target
Sound 0x209
CastCycles 4
CycleDuration 800
}Code: Select all
var spellcfg := ReadConfigFile(":NpcSpells:NpcSpells");
var cspell := spellcfg[id];There is a function ListConfigElemProps which returns names of all element's properties. Good. But How do I read specific property in a generic way when I don't know its type and there are only type-specific functions like GetConfigString or GetConfigInt? I'd do something like
Code: Select all
var spell := struct;
foreach prop in (ListConfigElemProps(cspell))
spell.Insert(prop, GetConfigXXX(cspell, prop));
endforeach