File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -193,6 +193,26 @@ class AoeLoot_Player : public PlayerScript
193
193
{
194
194
OnCreatureLootAOE (player);
195
195
}
196
+
197
+ /*
198
+ * This function is responsible for deleting the player's leftover items.
199
+ * But it only deletes those that are from a quest, and that cannot be obtained if the quest were not being carried out.
200
+ * Since there are some items that can be obtained even if you are not doing a quest.
201
+ */
202
+
203
+ void OnPlayerCompleteQuest (Player* player, Quest const * quest) override
204
+ {
205
+ for (uint8 i = 0 ; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
206
+ {
207
+ if (ItemTemplate const * itemTemplate = sObjectMgr ->GetItemTemplate (quest->RequiredItemId [i]))
208
+ {
209
+ if ((itemTemplate->Bonding == BIND_QUEST_ITEM) && (!quest->IsRepeatable ()))
210
+ {
211
+ player->DestroyItemCount (quest->RequiredItemId [i], 9999 , true );
212
+ }
213
+ }
214
+ }
215
+ }
196
216
};
197
217
198
218
void AddSC_AoeLoot ()
You can’t perform that action at this time.
0 commit comments