Moje rozwiązanie jest następujące. Co prawda odnalezienie nazwy klucza jest łopatologiczne, ale jest ich kilka w użyciu.
var int symbID;
var string text;
var string name;
func void check_keyname()
{
if (symbID == ITKE_GOMEZ_01)
{
text = ConcatStrings ("Użyłeś ",itke_gomez_01.name);Print (text);
};
if (symbID == ItKe_Storage_01)
{
text = ConcatStrings ("Użyłeś ",ItKe_Storage_01.name);Print (text);
};
if (symbID == itkey_ob_smith_01)
{
text = ConcatStrings ("Użyłeś ",itkey_ob_smith_01.name);Print (text);
};
if (symbID == ITKE_TOWER_01)
{
text = ConcatStrings ("Użyłeś ",ITKE_TOWER_01.name);Print (text);
};
};
func int NEED_DOOR_KEY()//many thanks for Fawkes
{
var oCNpc her; her = Hlp_GetNpc(hero);
var oCMobLockable Door2; Door2 = _^(her.focus_vob);
Print(Door2.keyInstance);
if (Hlp_Is_oCMobLockable(her.focus_vob))
{
symbID = MEM_GetSymbolIndex (Door2.keyInstance);
if (symbID > 0) && (symbID < currSymbolTableLength)
{
if (NPC_HasItems (hero, symbID))
{
Snd_Play ("Door_unlock");
check_keyname();
return TRUE;
}
else if //(Str_len (Door2.keyInstance) > 0)&&
(!Npc_HasItems(hero, symbID))
{
//
AI_PlayAni(hero,"T_DONTKNOW");
//AI_OutputSVM(hero,hero,"$NeedKey");
AI_OutputSVM(hero,hero,"$keymissing");
//AI_OutputSVM(hero,hero,"$neveropen");
return FALSE;
};
};
};
};