Add files via upload

This commit is contained in:
Dinkledork
2023-03-17 09:25:31 -06:00
committed by GitHub
parent b0a3c479e8
commit 6f443cf36c
13 changed files with 505 additions and 45 deletions

View File

@@ -3,49 +3,53 @@ local LOG_ITEM_ID = 60116
local BARRIERS_BUILT_QUEST_ID = 30012
function OnCreatureSpawn(event, creature)
creature:SetReactState(0)
creature:SetReactState(0)
end
function OnGossipHello(event, player, creature)
if player:IsMounted() then
player:SendBroadcastMessage("You must dismount first!")
return
end
if player:IsMounted() then
player:SendBroadcastMessage("You must dismount first!")
return
end
if not player:HasItem(1311) then
player:SendBroadcastMessage("You need the Wood Cutter Axe in order to chop down this tree.")
return
end
if not player:HasItem(1311) then
player:SendBroadcastMessage("You need the Wood Cutter Axe in order to chop down this tree!")
return
end
if not player:HasQuest(BARRIERS_BUILT_QUEST_ID) then
player:SendBroadcastMessage("You must have the 'Barriers Built' quest before you can chop down this tree.")
return
end
if not player:HasQuest(BARRIERS_BUILT_QUEST_ID) then
player:SendBroadcastMessage("You must have the 'Final Fortification' quest before you can chop down this tree!")
return
end
creature:SetReactState(0)
player:GossipMenuAddItem(8, "Cut down this tree", 1, GOSSIP_OPTION_CUT_TREE)
player:GossipSendMenu(8, creature)
if player:HasItem(LOG_ITEM_ID, 20) then
player:SendBroadcastMessage("You have the maximum amount of logs already!")
return
end
creature:SetReactState(0)
player:GossipMenuAddItem(8, "Cut down this tree", 1, GOSSIP_OPTION_CUT_TREE)
player:GossipSendMenu(8, creature)
end
function OnGossipSelect(event, player, creature, sender, intid)
if intid == GOSSIP_OPTION_CUT_TREE then
player:CastSpell(creature, 62990, false)
player:Kill(creature)
player:KilledMonsterCredit(400091)
player:GossipComplete()
end
if intid == GOSSIP_OPTION_CUT_TREE then
player:CastSpell(creature, 62990, false)
player:Kill(creature)
player:KilledMonsterCredit(400091)
player:GossipComplete()
end
end
function OnCreatureDeath(event, creature, killer)
creature:DespawnOrUnsummon(12000)
creature:RemoveEvents()
creature:DespawnOrUnsummon(12000)
creature:RemoveEvents()
-- Give the player 1-3 logs upon death
if killer ~= nil and killer:IsPlayer() then
local logs = math.random(1, 3)
killer:AddItem(LOG_ITEM_ID, logs)
end
-- Give the player 1-3 logs upon death
if killer ~= nil and killer:IsPlayer() then
local logs = math.random(1, 3)
killer:AddItem(LOG_ITEM_ID, logs)
end
end
RegisterCreatureEvent(400091, 5, OnCreatureSpawn)