summaryrefslogblamecommitdiff
path: root/npc/functions/inventoryplace.txt
blob: c2f95c5cfb2bd354fafbb3b8c72bf1f03a649b81 (plain) (tree)
1
2
3
4
5
6
7
8
9
                  

                   

               


                                                                                                 
             



                                                                           
                     
                                             
                                              
 
                                                            

                                                                                     
                                                        
 
       
           


                                                                          
                                                                         

          
 
// Evol functions.
// Authors:
//    Qwerty Dragon
//    Reid
// Description:
//    Check if the player have enough place on his inventory to accept new items  with arguments:
//      getarg(0)   item ID,
//      getarg(1)   number of items,
// Variables:
//    @iteminfo = Item information type. (See doc for list of item's types)
//    @countitem = Count item's number.

function	script	InventoryPlace	{
    getinventorylist;
    set @iteminfo, getiteminfo(getarg(0), 2);
    set @countitem, countitemcolor(getarg(0));

    if (checkweight(getarg(0), getarg(1)) == 0) goto L_Warn;
    if ((@iteminfo < 4) && (@countitem == 0) && (@inventorylist_count < 100)) return;
    if ((@iteminfo < 4) && (@countitem > 0)) return;
    if (@inventorylist_count + getarg(1) <= 100) return;

L_Warn:
    mes "";
    mesn "Narrator";
    mes col(l("It looks like you can't carry anything else for now."), 9);
    next;
    mes col(l("You should come back when you have some free space."), 9);

    close;
}