mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-17 18:41:29 +00:00
Added item link functionality to #summonitem (thanks Kinglykrab!)
This commit is contained in:
parent
23758d5e90
commit
6db397f07d
@ -9,7 +9,7 @@ Athrogate: Adding ClearCompassMark() to Lua.
|
|||||||
- Lua didn't have ClearCompassMark(). Perl already had this.
|
- Lua didn't have ClearCompassMark(). Perl already had this.
|
||||||
|
|
||||||
== 01/12/2016 ==
|
== 01/12/2016 ==
|
||||||
Uleat: Fix for tradeskill containers remaining locked after a RoF+ client leaves. Intermediary fix for RoF+ clients accessing tradeskill containers when in use by another player.
|
Uleat: Fix for tradeskill containers remaining locked after a RoF+ client leaves. Intermediary fix for RoF+ clients accessing tradeskill containers when in use by another player (thanks Natedog!)
|
||||||
|
|
||||||
== 12/29/2015 ==
|
== 12/29/2015 ==
|
||||||
Akkadius: Implemented standardized zone controller scripts (Rule Zone, UseZoneController) Defaulted to true
|
Akkadius: Implemented standardized zone controller scripts (Rule Zone, UseZoneController) Defaulted to true
|
||||||
|
|||||||
@ -5484,10 +5484,28 @@ void command_interrupt(Client *c, const Seperator *sep)
|
|||||||
|
|
||||||
void command_summonitem(Client *c, const Seperator *sep)
|
void command_summonitem(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
if (!sep->IsNumber(1))
|
uint32 itemid = 0;
|
||||||
c->Message(0, "Usage: #summonitem [item id] [charges], charges are optional");
|
|
||||||
|
std::string cmd_msg = sep->msg;
|
||||||
|
size_t link_open = cmd_msg.find('\x12');
|
||||||
|
size_t link_close = cmd_msg.find_last_of('\x12');
|
||||||
|
if (link_open != link_close && (cmd_msg.length() - link_open) > EmuConstants::TEXT_LINK_BODY_LENGTH) {
|
||||||
|
TextLinkBody_Struct link_body;
|
||||||
|
Client::TextLink::DegenerateLinkBody(link_body, cmd_msg.substr(link_open + 1, EmuConstants::TEXT_LINK_BODY_LENGTH));
|
||||||
|
itemid = link_body.item_id;
|
||||||
|
}
|
||||||
|
else if (!sep->IsNumber(1)) {
|
||||||
|
c->Message(0, "Usage: #summonitem [item id | link] [charges], charges are optional");
|
||||||
|
return;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
uint32 itemid = atoi(sep->arg[1]);
|
itemid = atoi(sep->arg[1]);
|
||||||
|
}
|
||||||
|
if (!itemid) {
|
||||||
|
c->Message(0, "A valid item id number is required (derived: 0)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int16 item_status = 0;
|
int16 item_status = 0;
|
||||||
const Item_Struct* item = database.GetItem(itemid);
|
const Item_Struct* item = database.GetItem(itemid);
|
||||||
if (item) {
|
if (item) {
|
||||||
@ -5513,7 +5531,7 @@ void command_summonitem(Client *c, const Seperator *sep)
|
|||||||
else {
|
else {
|
||||||
c->SummonItem(itemid);
|
c->SummonItem(itemid);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void command_giveitem(Client *c, const Seperator *sep)
|
void command_giveitem(Client *c, const Seperator *sep)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user