[Quest API] Add AddItem() to Perl/Lua. (#2054)

- Add $client->AddItem(item_data) to Perl.
- Add client:AddItem(item_table) to Lua.
- This will allow server operators to add items without needless parameters.

Perl Example:
```pl
my %item_data = (
	"item_id" => 1200,
	"charges" => 1,
	"augment_one" => 49656,
	"augment_two" => 49656,
	"augment_three" => 49656,
	"augment_four" => 49656,
	"augment_five" => 49656,
	"augment_six" => 49656,
	"attuned" => 1,
	"slot_id" => quest::getinventoryslotid("general1")
);
$client->AddItem(\%item_data);
```
Lua Example:
```lua
local item_data = {
	item_id = 1200,
	charges = 1,
	augment_one = 49656,
	augment_two = 49656,
	augment_three = 49656,
	augment_four = 49656,
	augment_five = 49656,
	augment_six = 49656,
	attuned = true,
	slot_id = Slot.General1
};
e.self:AddItem(item_data);
```
This commit is contained in:
Kinglykrab
2022-03-13 15:59:48 -04:00
committed by GitHub
parent 4296e2e39e
commit 8e62383997
3 changed files with 92 additions and 0 deletions
+1
View File
@@ -392,6 +392,7 @@ public:
void RemoveItem(uint32 item_id);
void RemoveItem(uint32 item_id, uint32 quantity);
void SetGMStatus(uint32 newStatus);
void AddItem(luabind::object item_table);
int GetEnvironmentDamageModifier();
void SetEnvironmentDamageModifier(int value);