mirror of
https://github.com/araxiaonline/RandomScriptsforAzerothCore.git
synced 2026-06-13 10:22:22 -04:00
Add files via upload
This commit is contained in:
22
Faction_Shared/ScourgeQuestsWorkAround.lua
Normal file
22
Faction_Shared/ScourgeQuestsWorkAround.lua
Normal file
@@ -0,0 +1,22 @@
|
||||
local questIds = {9265, 9264, 9263, 9262, 9261, 9260}
|
||||
local itemId = 22892
|
||||
local itemCount = 3
|
||||
local totalLooted = {}
|
||||
|
||||
local function OnLootItem(event, player, item, count)
|
||||
if item:GetEntry() == itemId then
|
||||
for _, questId in pairs(questIds) do
|
||||
if player:HasQuest(questId) then
|
||||
if not totalLooted[questId] then
|
||||
totalLooted[questId] = 0
|
||||
end
|
||||
totalLooted[questId] = totalLooted[questId] + count
|
||||
if totalLooted[questId] >= itemCount then
|
||||
player:CompleteQuest(questId)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
RegisterPlayerEvent(32, OnLootItem)
|
||||
Reference in New Issue
Block a user