WoW:API DropItemOnUnit: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
m (Move page script moved page API DropItemOnUnit to API DropItemOnUnit without leaving a redirect)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  <center>'''DropItemOnUnit'''</center>
{{wowapi}} __NOTOC__
Drops an item from the cursor onto the specified target. Can be used to initiate a trade session (though see [[World_of_Warcraft_API#Trading_Functions|Trade functions]]) or feeding pets.
  DropItemOnUnit(unit);


Drops an item from the cursor onto the specified target.
==Parameters==
For trading with a player, use the [[World_of_Warcraft_API#Trading_Functions|Trade functions]]. This function is mainly of use for giving items(food?) to pets.
===Arguments===
 
:;unit : [[UnitId]] - Unit to which you want to give the item on the cursor.  
DropItemOnUnit("unit");
==Example==
 
----
;''Arguments''
 
:("unit")
:;unit : String - The [[API TYPE UnitId|UnitId]] to which to give the item to. Typcially, you'll probably want to use <tt>"pet"</tt>.
 
''Not tested with other targets such as "party1" to see what this would do for giving items to group members, let alone mobs via "target". -- [[User:Goldark|Goldark]] 08:12, 17 Dec 2004 (EST)''
 
''In spite of the comment above, the WoW base UI uses it with both party members and targets, so it's going to be worth trying! -- [[User:Flickering|Flickering]] 15:27, 28 Dec 2004 (EST)''
 
----
;''Returns''
 
:None
 
----
;''Example''
  if ( CursorHasItem() ) then
  if ( CursorHasItem() ) then
   DropItemOnUnit("pet");
   DropItemOnUnit("pet");
  end;
  end;
 
===Result===
;''Result''
Item is dropped from cursor and given to the player's pet.
 
:Item is dropped from cursor and given to the specified target.
 
----
;''Description''
 
: Gives an item from the cursor to a specified target such as "pet".
 
----
{{WoW API}}

Latest revision as of 04:45, 15 August 2023

WoW API < DropItemOnUnit

Drops an item from the cursor onto the specified target. Can be used to initiate a trade session (though see Trade functions) or feeding pets.

DropItemOnUnit(unit);

Parameters[edit]

Arguments[edit]

unit
UnitId - Unit to which you want to give the item on the cursor.

Example[edit]

if ( CursorHasItem() ) then
  DropItemOnUnit("pet");
end;

Result[edit]

Item is dropped from cursor and given to the player's pet.