-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrpg_inventory_core.inc
211 lines (153 loc) · 4.83 KB
/
rpg_inventory_core.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
#if defined _rpg_inventory_core_included_
#endinput
#endif
#define _rpg_inventory_core_included_
/*
Give an Item to a Player
@Param1 -> int client
@Param2 -> char itemname[128]
@Param3 -> int weight
@Param4 -> char flags[64]
@Param5 -> char category[64]
@Param6 -> char category2[64]
@Param7 -> int rarity
@return none
*/
native void inventory_givePlayerItem(int client, char itemname[128], int weight, char flags[64], char category[64], char category2[64], int rarity, char reason[256]);
/*
Returns if a Player has a item
@Param1 -> client
@Param2 -> char itemname[128]
@return true or false
*/
native bool inventory_hasPlayerItem(int client, char itemname[128]);
/*
Returns the amount of items a player has
@Param1 -> int client
@Param2 -> char itemname[128]
@return int amount
*/
native int inventory_getPlayerItemAmount(int client, char itemname[128]);
/*
Removes x items from the players inventory
@Param1 -> int client
@Param2 -> char itemname[128]
@Param3 -> int amount
@Param4 -> char reason[256]
@return true if successfull - false if not (false still removes items!!)
*/
native bool inventory_removePlayerItems(int client, char itemname[128], int amount, char reason[256]);
/*
On Item used
@Param1 -> int client
@Param2 -> char Itemname[128]
@Param3 -> int weight
@Param4 -> category[64]
@Param5 -> category2[64]
@Param6 -> int rarity
@Param7 -> char timestamp[64]
@Param8 -> int slot
*/
forward void inventory_onItemUsed(int client, char itemname[128], int weight, char category[64], char category2[64], int rarity, char timestamp[64], int slot);
/*
Shows the inventory of client1 to client2
@Param1 -> int client1
@Param2 -> int client2
@return -
*/
native void inventory_showInventoryOfClientToOtherClient(int client1, int client2);
/*
Shows the inventory of client1 to client2
@Param1 -> int client1
@Param2 -> int client2
@Param3 -> char category[64]
@return -
*/
native void inventory_showInventoryOfClientToOtherClientByCategory(int client1, int client2, char category[64]);
/*
Blocks the default Item handle
@Param1-> char Itemname[128];
@Param2-> int type = 1: Single Item, 2: Category, 3: Category2, 4:Category+Category2
*/
native void inventory_addItemHandle(char itemname[128], int type);
/*
Return the owned items of a client
@Param1 -> int client
return amount of items the client has
*/
native int inventory_getClientItemsAmount(int client);
/*
Check if the Item is valid or not
@Param1 -> int client
@Param2 -> int slot
return true when it is valid false if not
*/
native bool inventory_isValidItem(int client, int slot);
/*
Return the Name of an Item Slot
@Param1 -> int client
@Param2 -> int slot
@Param3 -> ItemNameBuffer[128]
@Param4 -> char FilterFlags[8] // leave blank to enforce flags (only usable items)
Saves the ItemName in Param3
return true if usable false if not
*/
native bool inventory_getItemNameBySlotAndClient(int client, int slot, char ItemNameBuffer[128], char FilterFlags[8]);
/*
Return the Category of an Item Slot
@Param1 -> int client
@Param2 -> int slot
@Param3 -> ItemNameBuffer[128]
@Param4 -> char FilterFlags[8] // leave blank to enforce flags (only usable items)
Saves the ItemName in Param3
return true if usable false if not
*/
native bool inventory_getItemCategoryBySlotAndClient(int client, int slot, char ItemNameBuffer[128], char FilterFlags[8]);
/*
Return the Weight of an Item Slot
@Param1 -> int client
@Param2 -> int slot
return weight of item if exists otherwise -1
*/
native int inventory_getItemWeightBySlot(int client, int slot);
/*
Transfer Item to Container
@Param1 -> int client
@Param2 -> int slot
@Param3 -> char containerName[64]
noreturn
*/
native void inventory_transferItemToContainer(int client, int slot, char containerName[64]);
/*
Return the Flags of an Item Slot
@Param1 -> int client
@Param2 -> int slot
@Param3 -> char flags[8]
return - (Saves into Param3)
*/
native void inventory_getItemFlagsBySlot(int client, int slot, char flags[8]);
/*
Delete Item by Slot
@Param1 -> int client
@Param2 -> int slot
@Param3 -> char reason[256]
noreturn
*/
native void inventory_deleteItemBySlot(int client, int slot, char reason[256]);
/*
Transfer Item to other Player by Slot
@Param1 -> int client
@Param2 -> int target
@Param3 -> int slot
@Param4 -> char reason[256]
noreturn
*/
native void inventory_transferItemToPlayerBySlot(int client, int target, int slot, char reason[256]);
/*
Transfer Item from Container
@Param1 -> int client
@Param2 -> char containerName[64]
@Param3 -> char uniqueId[64]
@return noreturn
*/
native void inventory_transferItemFromContainer(int client, char containerName[64], char uniqueId[64]);