Dota 2 Workshop Tools/Scripting/API/CDOTA Item.LaunchLoot: Difference between revisions
< Dota 2 Workshop Tools | Scripting | API
Jump to navigation
Jump to search
RoyAwesome (talk | contribs) (Dota_Lebot push: Updated Page) |
RoyAwesome (talk | contribs) (Dota_Lebot push: Updated Page) |
||
Line 6: | Line 6: | ||
''' void LaunchLoot(bool '' | ''' void LaunchLoot(bool ''useOnContact'', float ''height'', float ''speed'', Vector ''destination'') ''' | ||
'' | ''For items lying on the ground. Fires the item up into the air so that it lands at the specified position.'' | ||
;Example | |||
<source lang="lua"> | |||
-- Create a blink dagger at (-256,0,0) and launch it to (256,0,0) | |||
local newItem = CreateItem("item_blink", nil, nil) | |||
newItem:SetPurchaseTime(0) | |||
local spawnPoint = Vector(-256, 0, 0) | |||
local destination = Vector(256, 0, 0) | |||
local drop = CreateItemOnPositionSync(spawnPoint, newItem) | |||
newItem:LaunchLoot(false, 300, 0.75, destination) | |||
</source> | |||
== Parameters == | == Parameters == | ||
{| class="standard-table" style="width: 50%;" | {| class="standard-table" style="width: 50%;" | ||
Line 19: | Line 30: | ||
|- | |- | ||
| bool | | bool | ||
| | | useOnContact | ||
| | | If true, the item will be used when a hero touches it | ||
|- | |- | ||
| float | | float | ||
| | | height | ||
| | | How high into the air the item should be launched | ||
|- | |- | ||
| float | | float | ||
| | | speed | ||
| | | How fast the object should traverse its trajectory. Small number (close to 0) means fast, big number means slow. | ||
|- | |- | ||
| Vector | | Vector | ||
| | | destination | ||
| | | Where the item should land | ||
|} | |} |
Revision as of 12:20, 11 September 2014

Function Description
void LaunchLoot(bool useOnContact, float height, float speed, Vector destination)
For items lying on the ground. Fires the item up into the air so that it lands at the specified position.
- Example
-- Create a blink dagger at (-256,0,0) and launch it to (256,0,0)
local newItem = CreateItem("item_blink", nil, nil)
newItem:SetPurchaseTime(0)
local spawnPoint = Vector(-256, 0, 0)
local destination = Vector(256, 0, 0)
local drop = CreateItemOnPositionSync(spawnPoint, newItem)
newItem:LaunchLoot(false, 300, 0.75, destination)
Parameters
Type | Name | Description |
---|---|---|
bool | useOnContact | If true, the item will be used when a hero touches it |
float | height | How high into the air the item should be launched |
float | speed | How fast the object should traverse its trajectory. Small number (close to 0) means fast, big number means slow. |
Vector | destination | Where the item should land |