ash47 / Frota

An addon for Dota 2, I intend for it to contain several sub game modes such as Legends of Dota and Random OMG
65 stars 73 forks source link

Added FrotaGameMode functions: GetHeroItemByName & RemoveHeroItemByName #146

Closed chirayuchiripal closed 10 years ago

chirayuchiripal commented 10 years ago

[1]

table GetHeroItemByName( hscript hero, string itemName, bool stash,
bool dropped )
Use            : function to search an item in hero's invent and return if present otherwise nil
               : For multiple instances of same item, first one is returned

Arguments:
hscript hero   : the player's hero
string itemname: Item name for e.g. "item_blink"
bool stash     : whether to search stash slots also
bool dropped   : whether to search dropped items also

Returns Values : 
Returns a table with key,
    Item: if found in slots
    PhysicalItem: if dropped item
Otherwise nil

[2]

bool RemoveHeroItemByName( hscript hero, string itemName, bool
stash, bool dropped )
Use            : function to remove an item in hero's invent if present
               : For multiple instances of same item, first one is removed only

Arguments:
hscript hero   : the player's hero
string itemname: Item name for e.g. "item_blink"
bool stash     : whether to search stash slots also
bool dropped   : whether to search dropped items also

Returns Values : true on Success otherwise false