func int B_GiveInvItems(var C_Npc giver,var C_Npc taker,var int itemInstance,var int amount)
{
var string concatText;
var string itemname;
[COLOR="Red"]TextDisplacement += 1;
if(TextDisplacement >= 5)
{
TextDisplacement = 0;
};[/COLOR]
if(Npc_IsPlayer(giver))
{
if(amount > Npc_HasItems(giver,itemInstance))
{
return FALSE;
};
};
if(amount == 0)
{
return TRUE;
};
Npc_RemoveInvItems(giver,itemInstance,amount);
CreateInvItems(taker,itemInstance,amount);
itemname = item.name;
if(Npc_IsPlayer(giver))
{
if(itemInstance == ItMi_Gold)
{
concatText = ConcatStrings(IntToString(amount),PRINT_GoldGegeben);
AI_PrintScreen(concatText,-1,YPOS_GoldGiven[COLOR="Red"]+TextDisplacement[/COLOR],FONT_ScreenSmall,2);
}
else
{
concatText = ConcatStrings(b_formgivestring(giver,amount)," (");
concatText = ConcatStrings(concatText,itemname);
concatText = ConcatStrings(concatText,").");
AI_PrintScreen(concatText,-1,YPOS_ItemGiven[COLOR="Red"]+TextDisplacement[/COLOR],FONT_ScreenSmall,2);
};
}
else if(Npc_IsPlayer(taker))
{
if(itemInstance == ItMi_Gold)
{
concatText = ConcatStrings(IntToString(amount),PRINT_GoldErhalten);
AI_PrintScreen(concatText,-1,YPOS_GoldTaken[COLOR="Red"]+TextDisplacement[/COLOR],FONT_ScreenSmall,2);
}
else if(itemInstance == itpo_xmagicdef)
{
concatText = ConcatStrings(PRINT__ERHALTEN,"напиток защиты от магии.");
AI_PrintScreen(concatText,-1,YPOS_ItemTaken[COLOR="Red"]+TextDisplacement[/COLOR],FONT_ScreenSmall,2);
}
else
{
concatText = ConcatStrings(b_formgivestring(giver,amount)," (");
concatText = ConcatStrings(concatText,itemname);
concatText = ConcatStrings(concatText,").");
AI_PrintScreen(concatText,-1,YPOS_ItemTaken[COLOR="Red"]+TextDisplacement[/COLOR],FONT_ScreenSmall,2);
};
};
return TRUE;
};