Add files via upload

This commit is contained in:
Dinkledork
2023-03-09 03:36:13 -07:00
committed by GitHub
parent 853f202792
commit eae97d262b
23 changed files with 403 additions and 23 deletions

36
StealthPot.lua Normal file
View File

@@ -0,0 +1,36 @@
Draven = {}
-- Create the item you want to give to the player
Draven.ITEM_ID = 60114 -- replace with the ID of the item you want to give
-- Register the gossip event for the NPC
function Draven.OnGossipHello(event, player, creature)
player:GossipMenuAddItem(0, "|TInterface\\Icons\\ability_stealth:50:50:-23:0|tPurchase 3 Stealth Potions.|r", 0, 1)
player:GossipSendMenu(1, creature)
end
-- Handle the player's selection in the gossip menu
function Draven.OnGossipSelect(event, player, creature, sender, action)
if action == 1 then
if player:GetCoinage() < 7500 then
player:SendBroadcastMessage("You do not have enough coins.")
player:GossipComplete()
else
player:SetCoinage(player:GetCoinage() - 7500)
player:AddItem(Draven.ITEM_ID, 3)
player:SendBroadcastMessage("You have received 3 Stealth Potions.")
player:GossipComplete()
end
end
end
-- Send a unit yell when the NPC spawns
function Draven.OnSpawn(event, creature)
creature:SendUnitYell("", 0)
creature:CastSpell(creature, 20374)
end
-- Register the gossip events with the NPC
RegisterCreatureGossipEvent(nil, 1, Draven.OnGossipHello)
RegisterCreatureGossipEvent(nil, 2, Draven.OnGossipSelect)
RegisterCreatureEvent(nil, 5, Draven.OnSpawn)