Wave Image
















  • help > hooks > pre give item
    ---
    
    Hook Name :         pre_give_item
    Called From :       /bin/living/give.c
    Resolution Method : HOOK_OR
    
    Sample Header :
    
    int my_pre_give_item(string tag, object ob, object who, object what,
                         int receiver)
    
    Arguments :
    
    tag - "pre_give_item"
    ob - The object this hook was called in, can either be the giver or receiver
    who - The other living object involved with the give
    what - The object being given
    receiver - 0 if "ob" is doing the giving, 1 if "who" is doing the giving
    
    Return Value : 1 to intercept the give, 0 to allow it
    
    Description :
    
    When one living thing attempts to give an item to another living thing
    (whether npc's or players), this hook is called twice.  The first call is
    made in the one attempting to give the item, and "ob" will be the giver, and
    "who" will be the receiver.  The second call is made in the one attempting to
    receive the item, and "ob" is the receiver, and "who" is the giver.
    
    If 1 is returned, the give is disallowed, and no messages are displayed,
    so you should take care of that yourself.  If 0 is returned, the move is
    allowed (unless someone else had a give hook that returns 1).
    
    See also:
    
    post_give_coins, pre_give_coins, post_give_item
    
    ---
    
    Last modified : 2-5-01, Megaboz