func int B_GiveInvItems_New(var C_Npc giver,var C_Npc taker,var C_ITEM itm,var int amount, var int screenprocent)
{
var string concatText;
var string itemname;
var int itemInstance;
itemInstance = Hlp_GetInstanceID(itm);
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(Hlp_IsItem(itm,itmi_gold))
{
concatText = ConcatStrings(IntToString(amount),PRINT_GoldGegeben);
AI_PrintScreen(concatText,-1,YPOS_GoldGiven,FONT_ScreenSmall,2);
}
else if(amount == 1)
{
concatText = ConcatStrings(itemname,PRINT_Addon_gegeben);
AI_PrintScreen(concatText,-1,
screenprocent,FONT_ScreenSmall,2);
}
else
{
concatText = ConcatStrings(IntToString(amount),PRINT_ItemsGegeben);
concatText = ConcatStrings(concatText,"(");
concatText = ConcatStrings(concatText,itemname);
concatText = ConcatStrings(concatText,")"
;
AI_PrintScreen(concatText,-1,
screenprocent,FONT_ScreenSmall,2);
};
}
else if(Npc_IsPlayer(taker))
{
if(Hlp_IsItem(itm,itmi_gold))
{
concatText = ConcatStrings(IntToString(amount),PRINT_GoldErhalten);
AI_PrintScreen(concatText,-1,YPOS_GoldTaken,FONT_ScreenSmall,2);
}
else if(amount == 1)
{
concatText = ConcatStrings(itemname,PRINT_Addon_erhalten);
AI_PrintScreen(concatText,-1,
screenprocent,FONT_ScreenSmall,2);
}
else
{
concatText = ConcatStrings(IntToString(amount),PRINT_ItemsErhalten);
concatText = ConcatStrings(concatText,"(");
concatText = ConcatStrings(concatText,itemname);
concatText = ConcatStrings(concatText,")"
;
AI_PrintScreen(concatText,-1,
screenprocent,FONT_ScreenSmall,2);
};
};
return TRUE;
};