mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-11 11:12:25 +00:00
Task reward stacking
This commit is contained in:
parent
1e136c4e2f
commit
512f29c0d4
@ -979,14 +979,19 @@ void ClientTaskState::RewardTask(Client *client, const TaskInformation *task_inf
|
|||||||
const EQ::ItemData *item_data;
|
const EQ::ItemData *item_data;
|
||||||
std::vector<int> reward_list;
|
std::vector<int> reward_list;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (auto &i: Strings::Split(task_information->reward_id_list, "|")) {
|
for (auto &i: Strings::Split(task_information->reward_id_list, "|")) {
|
||||||
auto item_id = Strings::IsNumber(i) ? std::stoi(i) : 0;
|
auto item_id = Strings::IsNumber(i) ? std::stoi(i) : 0;
|
||||||
if (item_id > 0) {
|
if (item_id > 0) {
|
||||||
int16_t slot = client->GetInv().FindFreeSlot(false, true);
|
EQ::ItemInstance *inst = database.CreateItem(item_id);
|
||||||
client->SummonItem(item_id, -1, 0, 0, 0, 0, 0, 0, false, slot);
|
bool stacked = client->TryStacking(inst);
|
||||||
item_data = database.GetItem(item_id);
|
if (!stacked) {
|
||||||
if (item_data) {
|
int16_t slot = client->GetInv().FindFreeSlot(inst->IsClassBag(), true, inst->GetItem()->Size);
|
||||||
client->MessageString(Chat::Yellow, YOU_HAVE_BEEN_GIVEN, item_data->Name);
|
client->SummonItem(item_id, -1, 0, 0, 0, 0, 0, 0, false, slot);
|
||||||
|
if (item_data) {
|
||||||
|
client->MessageString(Chat::Yellow, YOU_HAVE_BEEN_GIVEN, inst->GetItem()->Name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user