The "me" API Set

This API set encapsulates player attributes and game operations.

Character Attributes

Character General Operations

Potion Operations

Npc Operations


LPCSTR GetAccountName();

Return Value

If succeeded, the function returns pointer to a null-terminated string which contains the account name.

Remarks

Retrieve the account name, from which the player logged on to Battle.net.


DWORD GetStashGoldLimit();

Return Value

The function returns maximum amount of gold the player's stash can hold.

Remarks

Retrieve the player's stash gold amount limit. Gold amount limit depends on player's character level.


DWORD GetInventoryGoldLimit();

Return Value

The function returns maximum amount of gold the player's inventory can hold.

Remarks

Retrieve the player's inventory gold amount limit. Gold amount limit depends on player's character level.


int GetMaxDifficulty();

Return Value

If succeeded, the function returns the maximum difficulty number, otherwise it returns zero.

Remarks

Retrieve the maximum difficulty, to which the player has access. 1(normal), 2(nightmare), 3(hell).


BOOL IsHardcore();

Return Value

The function returns non-zero if the player is a hardcore player, zero otherwise.

Remarks

Detect whether the player is a hardcore player.


BOOL GetAlwaysRun();

Return Value

The function returns non-zero if the "always run" game trigger is on, zero otherwise.

Remarks

Detect whether the "always run" game trigger is on.


DWORD GetCursorItem();

Return Value

If there's an item sticks on the cursor, the function returns ID of the item, otherwise it returns zero. 

Remarks

Detect whether there's an item sticks on the cursor.


BOOL HaveSpell(WORD wSpellID);

Return Value

The function returns non-zero if the player has the spell, zero otherwise.

Parameters

wSpellID

Specifies the spell ID. Please check Spell Definition for a complete list of spell ID's.

Remarks

Check whether the player has a pariticular spell.


BOOL IsInTown();

Return Value

The function returns non-zero if the player is in town, zero otherwise.

Remarks

Check whether the player is in town.


BOOL GetMyMercUnit(LPGAMEUNIT lpBuffer);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

lpUnit

Pointer to a GAMEUNIT struct which will receive the merc unit data.

Remarks

Retrieve the hiring unit of this player, if any.


DWORD GetID();

Return Value

The function returns the player's ID.

Remarks

Retrieve the player's ID.


LPCSTR GetName();

Return Value

The function returns a pointer to a null-terminated string which contains the player's name.

Remarks

Retrieve the player's name.


int GetMode();

Return Value

The function returns current mode of the player.

Remarks

Retrieve mode of the player. Please check Player Modes for a complete list of player modes.


WORD GetSelectedSpell(BOOL bLeftHand);

Return Value

The function returns currently selected spell ID.

Parameters

bLeftHand

Specifies whether the function should return left-hand spell or right-hand spell.

Remarks

Retrieve selected spell ID.


BYTE GetHPPercent();

Return Value

The function returns player's remaining life percent.

Remarks

Retrieve life percent of the player, return value ranges from 0 to 100.


BYTE GetManaPercent();

Return Value

The function returns player's remaining mana percent.

Remarks

Retrieve mana percent of the player, return value ranges from 0 to 100.


BYTE GetItemDurabilityPercent();

Return Value

The function returns player's overall item durability percent.

Remarks

Retrieve overall item durability percent, return value ranges from 0 to 100.


DWORD GetStat(int nStatID);

Return Value

The function returns player's stat value specified by nStatID.

Parameters

nStatID

ID of the stat to return. Please check Unit Stat Definition for a complete list of unit stat ID's.

Remarks

Retrieve a particular stat value of the player, such as HP, max HP, mana, max mana, magic find, IAS, fast run, fast cast, resists, absorbs, etc. 


BOOL GetAffection(int nAffectionID);

Return Value

The function returns non-zero if the player is affected by the affection specified by nAffectionID, zero otherwise.

Parameters

nAffectionID

ID of the affection. Please check Unit Affection Definition for a complete list of unit affection ID's.

Remarks

Check whether the player is affected by a particular affection. Affections are states that can affect game units, such as poisoned, chilled, all passive skills, auras, etc.


BOOL SelectSpell(WORD wSpell, BOOL bLeftHand = FALSE);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

wSpell

Specifies the spell ID. Please check Spell Definition for a complete list of spell ID's.

bLeftHand  

Specifies whether the spell shall be set as the left-hand spell.

Remarks

Select a particular spell.


MAPPOS GetPosition();

Return Value

The function returns a MAPPOS struct which contains the player's current map position.

Remarks

Retrive the player's current position. Please note that the result returned by this function is guaranteed to be up-to-time, unlike the old way of "thisgame->player->PlayerPositionX" which had a 2-5 seconds of delay. It is strongly recommended that you use this function to retrieve player position.


int GetMyCorpseCount();

Return Value

The function returns the player's corpse number. Only corpses those are within player's vision are counted in.

Remarks

Retrieve player's corpse number.


BOOL PickMyCorpse();

Return Value

The function returns non-zero if succeeds, zero otherwise.

Remarks

Pick up the player's corpse. If there are multiple corpses, it picks up the first corpse found in the game unit chain.


int GetHostilerCount();

Return Value

The function returns number of players who have expressed hostility to this player.

Remarks

Retrieve number of hostiled players.


BYTE GetCurrentMapID();

Return Value

The function returns current map ID.

Remarks

Retrieve ID of the map where the player is currently at. Please check Map definition for a complete list of map ID's.


DWORD GetDistanceFrom(WORD x, WORD y);

Return Value

The function returns distance, in yards, between the player and a particular map position.

Parameters

x, y

Specifies the map position.

Remarks

Calculate distance, in yards, between the player and a particular map position.


DWORD HealMe();

Return Value

The function returns class ID of the potion drank if succeeds, zero otherwise.

Remarks

Drink a belt potion to heal the player. 


DWORD HealMerc();

Return Value

The function returns class ID of the potion drank if succeeds, zero otherwise.

Remarks

Feed a belt potion to heal the player's hiring.


DWORD SupplyMana(BOOL bDrinkPurpleIfNoBlue = TRUE);

Return Value

The function returns class ID of the potion drank if succeeds, zero otherwise.

Parameters

bDrinkPurpleIfNoBlue  

Specifies whether to try to drink a rejuvenate/full rejuvenate potion if there's no blue potion in the belt.

Remarks

Drink a belt potion to supply the player's mana, it will search for a mana potion first, if there's none, then search for a purple potion if bDrinkPurpleIfNoBlue is non-zero.


BOOL IsBeltFull();

Return Value

The function returns non-zero if all slots on the player's belt are full, zero otherwise.

Remarks

Check whether the player's belt slots are full.


BYTE GetBeltRows();

Return Value

The function returns number of rows of the player's belt.

Remarks

Retrieve player's belt rows, return value ranges from 1 to 4.


LPCITEM GetBeltItem(int x, int x);

Return Value

The function returns pointer to an ITEM struct if succeeds, zero otherwise.

Parameters

x, y

Specifies the belt slots coordinates.

Remarks

Retrieve the item resides in a particular bel slot. Diablo II storage coordinates are top-left based, that is, the top-left corner has the smallest x and y values, whereas the bottom-right corner has the greatest.


BOOL CastNoTarget(WORD wSpell, BOOL bLeftHand = FALSE);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

wSpell

Specifies the spell ID. Please check Spell Definition for a complete list of spell ID's.

bLeftHand  

Specifies whether the spell shall be set as the left-hand spell.

Remarks

Cast a spell which does not require any target, such as Energy shield, Battle orders, etc.


BOOL CastOnMap(WORD wSpell, WORD x, WORD y, BOOL bLeftHand = FALSE);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

wSpell

Specifies the spell ID. Please check Spell Definition for a complete list of spell ID's.

x, y

Specifies the map position to where the spell will be cast.

bLeftHand  

Specifies whether the spell shall be set as the left-hand spell.

Remarks

Cast a spell to a map position.


BOOL CastOnUnit(WORD wSpell, LPCGAMEUNIT lpUnit, BOOL bLeftHand = FALSE);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

wSpell

Specifies the spell ID. Please check Spell Definition for a complete list of spell ID's.

lpUnit

Pointer to a GAMEUNIT struct.

bLeftHand  

Specifies whether the spell shall be set as the left-hand spell.

Remarks

Cast a spell on a game unit.


BOOL LeaveGame();

Return Value

The function returns non-zero if succeeds, zero otherwise.

Remarks

Leave current game and back to the chat lobby.


void PauseJobs(BOOL bPause);

Parameters

bPause

If non-zero, all queued jobs will be suspended, if zero, queued jobs will be resumed.

Remarks

Pause/resume queued jobs. Motion operations such as "me->MoveTo" and "me->TeleportTo" are stored in a First-in-first-out queue and to be executed once all preceding jobs are completed, during this process, your application is not actually controlling the player. If your module need to pause, you should call this function and pass in non-zero to prevent the player from further moving, later call this function again and pass in zero the resume. 


void CleanJobs();

Remarks

Clean the player's job queue, all jobs in the queue are abandoned.


BOOL BackToTown();

Return Value

The function returns non-zero if succeeds, zero otherwise.

Remarks

Make the player cast a town portal and walk in as soon as the portal becomes "click-able". This is an asynchronous operation, that is, although the function returns right away, this operation will be performed internally in a number of actual steps and usually takes a couple of seconds to complete, depends on network status. If there's no scroll of town portal or tome of town portal in the player's inventory, the operation fails.


BOOL MoveTo(WORD x, WORD y, BOOL bQueueJob = TRUE);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

x, y

Specifies the destination map position where the player will move to.

bQueueJob  

Specifies whether this job shall be queued.

Remarks

Make the player move to a particular map position, the player will be either walking or running, depends on state of the "Always Run" game trigger.

Moving jobs can either be queued or not queued. If it is queued, the moving might not be executed immediately, instead, they will be stored in a First-in-first-out queue and to be executed one after another. if, however, bQueueJob is zero, then the job queue will be cleaned and all previously queued jobs will be abanddoned, and the new job gets executed right away.


BOOL MoveToUnit(LPCGAMEUNIT lpUnit, BOOL bQueueJob = TRUE);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

lpUnit

Pointer to a GAMEUNIT struct.

bQueueJob  

Specifies whether this job shall be queued.

Remarks

Make the player move to a particular game unit, the player will be either walking or running, depends on state of the "Always Run" game trigger.

Moving jobs can either be queued or not queued. If it is queued, the moving might not be executed immediately, instead, they will be stored in a First-in-first-out queue and to be executed one after another. if, however, bQueueJob is zero, then the job queue will be cleaned and all previously queued jobs will be abanddoned, and the new job gets executed right away.


BOOL TeleportTo(WORD x, WORD y, BOOL bQueueJob = TRUE);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

x, y

Specifies the destination map position where the player will teleport to.

bQueueJob  

Specifies whether this job shall be queued.

Remarks

Make the player teleport to a particular map position.

Moving jobs can either be queued or not queued. If it is queued, the moving might not be executed immediately, instead, they will be stored in a First-in-first-out queue and to be executed one after another. if, however, bQueueJob is zero, then the job queue will be cleaned and all previously queued jobs will be abanddoned, and the new job gets executed right away.


BOOL Say(LPCSTR lpszMessage);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

lpszMessage

Pointer to a null-terminated string which contains the message that is to be said.

Remarks

Make the player say a message, other players in the game will see the message.


BOOL OverHead(LPCSTR lpszMessage, BOOL bClientOnly = TRUE);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

lpszMessage

Pointer to a null-terminated string which contains the overhead message that is to be printed.

bClientOnly  

Specifies whether this overhead message shall be printed client-only.

Remarks

Make the player print an overhead message. If bClientOnly is zero, other players in the same screen will see the message, if bClientOnly is non-zero, only yourself can see the message.


BOOL SendSound(BYTE iSound);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

iSound

Specifies index of the sound to be sent.

Remarks

Make the player send a sound to the game, other player in the same area will hear the sound. Value of iSound shall be 25 to 32, maps to the mini-keyboard key "0" to "7".


BOOL AntiIdle();

Return Value

The function returns non-zero if succeeds, zero otherwise.

Remarks

Make the player send some irrelevant packets to avoid being dropped by the game due to inactivity. The player will make some randomly sounds, or print some overhead messages.


BOOL WeaponSwitch();

Return Value

The function returns non-zero if succeeds, zero otherwise.

Remarks

Make the player perform a weapon switching.


BOOL EnterWaypoint(LPCGAMEUNIT lpWPUnit, BYTE iDestinationMapID);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

lpWPUnit

Pointer to a GAMEUNIT struct which contains the waypoint unit data.

iDestinationMapID

Specifies the destination map ID. Please check Map definition for a complete list of map ID's.

Remarks

Make the player travel to another map through the waypoint. This operation is asynchronous, you will have to wait for the PM_MAPCHANGE or PM_WPFAIL message to get the final results. You do not need to open the waypoint UI beffore calling this function.


BOOL Interact(LPCGAMEUNIT lpUnit);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

lpUnit

Pointer to a GAMEUNIT struct.

Remarks

Make the player interact with a game unit.


BOOL PickGroundItem(DWORD dwItemID, BOOL bShowClientMove = TRUE);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

dwItemID

Specifies the item ID..

bShowClientMove  

Specifies whether to reflect the player movement on client screen.

Remarks

Make the player pick up an ground item.


BOOL ResurrectMerc();

Return Value

The function returns non-zero if succeeds, zero otherwise.

Remarks

Make the player request current npc to resurrect the hiring. This operation must be performed with an npc interact session started by a successful previous call of NpcStart.

Please note that, in order to protect you from losing your merc or raising an error, the function will fail if either of the following conditions are true:


BOOL BuyItem(DWORD dwItemID);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

dwItemID

Specified the item ID.

Remarks

Make the player buy an item from a current npc. This function requires an active npc session which was started by a previous successful call to StartNpcSession with interact type being set to NPC_TRADE.


BOOL RepairItem(DWORD dwItemID = 0);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

dwItemID

Specifies the item ID.

Remarks

Make the player repair items from an npc unit. If dwItemID is non-zero, that particular item will be repaired, if dwItemID is zero, all equipped items will be repaired. This function requires an active npc session which was started by a previous successful call to StartNpcSession with interact type being set to NPC_TRADE.


BOOL IdentifyItems();

Return Value

The function returns non-zero if succeeds, zero otherwise.

Remarks

Make the player identify all items from current npc, namely, Deckard Cain. This function requires an active npc session which was started by a previous successful call to StartNpcSession.


BOOL DepositGoldToStash(DWORD dwAmount = 0);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

dwAmount  

Specifies the amount of gold to be deposit.

Remarks

Make the player deposit gold from inventory to stash. If dwAmount is zero, the player will attempt to deposit all inventory gold.


BOOL RedrawClient(BOOL bFade = TRUE);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

bFade  

Specifies whether to blink the screen.

Remarks

Redraw client screen, reposition the player to last known good map position. This function is extremely handy in case of desynchronization, such as the infamous "black wall".


BOOL DropCursorItemToGround();

Return Value

The function returns non-zero if succeeds, zero otherwise.

Remarks

Make the player drop the the cursor item.


BOOL Transmute();

Return Value

The function returns non-zero if succeeds, zero otherwise.

Remarks

Make the player use the cube to transmute.


BOOL IsUIOpened(int nUIType);

Return Value

The function returns non-zero if the UI specified by nUIType is opened, zero otherwise.

Parameters

nUIType

Specifies type of the UI to be examed. Please check UI Flags for a complete list of game UI flags.

Remarks

Determine whether a game UI is opened.


BOOL EnumStorageItems(int nSTorageType, fnEnumItemProc lpfnEnumItemProc, LPARAM lParam = 0);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

nSTorageType

Specifies type of the storage area in which items are to be enumerated. Please check Storage Types for a complete list of storage types.

lpfnEnumItemProc

Pointer to a fnEnumItemProc function which will receive item data.

lParam 

A 32-bit application defined data.

Remarks

Enumerate all items in the storage type specified by nSTorageType.


typedef BOOL (CALLBACK *fnEnumItemProc)(LPCITEM lpItem, LPARAM lParam);

Return Value

Return zero to abort unit enumeration, return non-zero to continue.

Parameters

lpItem

Pointer to an ITEM struct.

lParam

A 32-bit application defined value.

Remarks

Process each unit data passed from EnumStorageItems.


BOOL PickStorageItemToCursor(DWORD dwItemID);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

dwItemID

Specifies the item ID.

Remarks

Pick an item from storage up to the cursor.


BOOL FindFirstStorageSpace(int nStorageType, SIZE minSize, LPPOINT lpBuffer);

Return Value

The function returns non-zero if the required storage space is found, zero otherwise.

Parameters

nSTorageType

Specifies type of the storage area in which spaces are calculated. Please check Storage Types for a complete list of storage types.

minSize

The minimum size of an item that the storage must be capable of hold. Sizes of items are same as what they appear on the screen, for example, rings/amulets/potions/gems/runes have size of 1*1, gloves/helmets/boots have size of 2*2, pikes/colussus blades/polearms have size of 2*4, etc. The function server->GetItemSize is available for retrieving sizes of any known items.

lpBuffer

Pointer to a POINT struct which will receive the storage coordinates if the required space is found.

Remarks

Find an available space from the storage specified by nSTorageType, where it can hold an item which has size of minSize. If the space is found, the function returns non-zero and the coordinates found in the storage will be copied into lpBuffer, if the space is not found, the function returns zero, in that case value of lpBuffer is undefined.


BOOL DropCursorItemToStorage(int nStorageType);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

nSTorageType

Specifies type of the storage area in which spaces are calculated. Please check Storage Types for a complete list of storage types.

Remarks

Drops the cursor item, if any, to the storage specified by nSTorageType. Appropriate coordinates to where the item should be dropped are to be calculated automatically. If there are no required space in the storage for the given item, the function fails.


BYTE GetOpenedUI();

Return Value

The function returns first opened UI flag, or zero if no UI has been opened. Please check UI Flags for a complete list of game UI flags.

Remarks

Check whether any UI has been opened.


void CloseAllUIs();

Remarks

Close all opened UI's that will obstruct player operations. UI's those will not obstruct player operations will not be closed, e.g. mini-panel, auto-map, etc. You shall wait for the PM_UICLOSED message after calling this function.


BOOL BuyHealingPotion(int nQuantity = 0);
BOOL BuyManaPotion(int
nQuantity = 0);
BOOL BuyTownScroll(int
nQuantity = 0);
BOOL BuyIdentifyScroll(int
nQuantity = 0);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

nQuantity 

Specifies quantity of the item to be bought. If this parameter is zero, the player will perform a "full-fill" purchase.

Remarks

Buy potions or scrolls from current npc. This function requires an active npc session which was started by a previous successful call to StartNpcSession with interact type being set to NPC_TRADE.


BOOL BuyArrows(int nQuantity);
BOOL BuyBolts(int
nQuantity);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

nQuantity 

Specifies quantity of the item to be bought. If this parameter cannot be zero.

Remarks

Buy arrows or bolts from current npc. This function requires an active npc session which was started by a previous successful call to StartNpcSession with interact type being set to NPC_TRADE.


BOOL SellItem(DWORD dwItemID);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

dwItemID

Specifies ID of the item to be sold.

Remarks

Sell an item to current npc. This function requires an active npc session which was started by a previous successful call to StartNpcSession with interact type being set to NPC_TRADE.


BOOL StartNpcSession(LPCGAMEUNIT lpNpcUnit, int nInteractType = NPC_NORMAL);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

lpWPUnit

Pointer to a GAMEUNIT struct which contains the npc unit data.

nInteractType

Specifies additional interaction types after successfully talk to the npc, this parameter can be one of the following:

Please note that if the npc does not have the ability on the specified interaction types, the function will immediately fail. For example, if you specify NPC_TRADE type to Warriv, who is not capable of trading, this function will fail.

Remarks

Start an npc session. If the function returns non-zero, you must wait for the PM_NPCSESSION message and check the wParam parameter value to determine results of this operation. If this function returns zero, no further message will be sent. The player can only perform npc operations after an npc session has been successfully started with appropriate interaction types.


void EndNpcSession();

Remarks

End an npc session that was started by an previous call to StartNpcSession. This function simply closes any opened npc UI's/menus and will never fail. You will, however, need to wait a short period of time(around 500 milliseconds) for all opened npc UI's/ menus to be closed. After calling this function, all subsequent npc operations will fail until a new npc session is successfully started by another call to StartNpcSession


int DrinkAllInventoryPotions(BOOL bKeepFullRejuv = FALSE);

Return Value

If succeeded, the function returns number of potions that were drunk, otherwise it returns zero.

Parameters

bKeepFullRejuv  

Specifies whether full rejuvenation potions should be drunk, too. If this parameter is non-zero, full rejuvenation potions will be kept in inventory.

Remarks

Drink all inventory potions, except for full rejuvenation potions which will be kept if bKeepFullRejuv is non-zero.


BOOL IsMercAlive();

Return Value

The function returns non-zero if the player's hiring is alive, zero if the player does not have a hiring or the hiring was killed.

Remarks

Determine if the player's hiring is alive.


BOOL DropGold(DWORD dwGoldAmount);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

dwGoldAmount

Specifies the gold amount to be dropped.

Remarks

Drop some gold to the ground. The function fails if dwGoldAmount is zero or is greater than the player's current inventory gold amount. To retrieve the player's current inventory gold amount, please check the GetStat API.


BOOL DrinkBeltPotion(DWORD dwItemID, BOOL bFeedMerc);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

dwItemID

Specifies ID of the potion which is to be drunk.

bFeedMerc

Specifies whether this potion will be used for feeding the player's hiring.

Remarks

Drink a belt potion.


BOOL DrinkInventoryPotion(DWORD dwItemID);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

dwItemID

Specifies ID of the potion which is to be drunk.

Remarks

Drink an inventory potion.


BOOL Gamble(DWORD dwItemID);

Return Value

The function returns non-zero if succeeds, zero otherwise.

Parameters

dwItemID

Specified the item ID.

Remarks

Make the player gamble an item from current npc. This function requires an active npc session which was started by a previous successful call to StartNpcSession with interact type being set to NPC_GAMBLE.


DWORD GetSpellCharges(WORD wSpellID);

Return Value

If succeeded, the function returns number of remaining charges on the spell cpecified by wSpellID, otherwise it returns zero.

Parameters

wSpellID

Specifies the spell ID. Please check Spell Definition for a complete list of spell ID's.

Remarks

Retrieve remaining charges on a particular spell.


int GetUnidItemCount();

Return Value

The function returns number of unidentified items in the player's storage.

Remarks

Retrieve number of unidentified items in the player's storage.


BYTE GetLowestEquipDurabilityPercent(BOOL bIncludeSecondarySlots = FALSE);

Return Value

The function returns the lowest equipped item durability percentage (0-100).

Parameters

bIncludeSecondarySlots 

Specifies whether items equipped at the player's secondary weapon switch slots need to be counted in.

Remarks

Retrieve the lowest equipped item durability percentage (0-100).


LPCITEM GetEquipItem(int nEquipLocation);

Return Value

The function returns pointer to an ITEM struct if succeeds, zero otherwise.

Parameters

nEquipLocation

Specifies the equip location that determines which item shall be returned. Please check Player Equip Location for a complete list of player's equip locations.

Remarks

Retrieve a particular equipped item.


int GetAvailableBeltSlots(BYTE iColumn);

Return Value

The function returns number of empty slots on a belt column.

Parameters

iColumn

Specifies column index. This value is zero based (0-3).

Remarks

Retrieve number of empty slots on a belt column.


BYTE GetCurrentAct();

Return Value

The function returns current act number. Zero based (0-4).

Remarks

Retrieve current act number.


LPCITEM GetStorageItem(int nStorageType, int x, int y);

Return Value

The function returns pointer to an ITEM struct if succeeds, zero otherwise.

Parameters

nSTorageType

Specifies type of the storage area. Please check Storage Types for a complete list of storage types.

x, y

Specifies coordinates of the position where item resides.

Remarks

Retrieve an item from a particular storage position. Diablo II storage coordinates are top-left based, that is, the top-left corner has the smallest x and y values, whereas the bottom-right corner has the greatest.


int SellInventoryItems(int nLeftColumn, int nRightColumn);

Return Value

If succeeded, the function returns number of items that were sold, otherwise it returns zero.

Parameters

nLeftColumn, nRightColumn

Specifies left-most and right-most column indices, all items that reside between nLeftColumn and nRightColumn, inclusively, will be sold to the npc.

Remarks

Sell inventory items to npc. This function requires an active npc session which was started by a previous successful call to StartNpcSession with interact type being set to NPC_TRADE.