WoW:API DropItemOnUnit: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
 
m (Fixed category links.)
Line 2: Line 2:


Drops an item from the cursor onto the specified target.
Drops an item from the cursor onto the specified target.
For trading with a player, use the [[World_of_Warcraft_API#Trading_Functions|Trade functions]]. This function is mainly of use for giving items to pets.
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.


  DropItemOnUnit("pet");
  DropItemOnUnit("unit");


----
----
;''Arguments''
;''Arguments''


:String itemTarget
:("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>.


:;target : Who to give the item to. Typcially, you'll probably want to use "pet". <br>
''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)''
''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)''


----
----
Line 35: Line 37:
----
----
{{Template:WoW API}}
{{Template:WoW API}}
[[Category:API Pet Functions|DropItemOnUnit]]
[[Category:API Unit Functions|DropItemOnUnit]]

Revision as of 20:27, 28 December 2004

DropItemOnUnit

Drops an item from the cursor onto the specified target. For trading with a player, use the Trade functions. This function is mainly of use for giving items(food?) to pets.

DropItemOnUnit("unit");

Arguments
("unit")
unit
String - The UnitId to which to give the item to. Typcially, you'll probably want to use "pet".

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". -- 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! -- Flickering 15:27, 28 Dec 2004 (EST)


Returns
None

Example
if ( CursorHasItem() ) then
  DropItemOnUnit("pet");
end;
Result
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".

Template:WoW API