Code:
local npcid = 600011
function HealNPC_OnGossipTalk(pUnit, event, player, pMisc)
pUnit:GossipCreateMenu(100, player, 0)
pUnit:GossipMenuAddItem(0, "Heal My Wounds!", 1, 0)
pUnit:GossipMenuAddItem(0, "A little bit of buffage", 2, 0)
pUnit:GossipSendMenu(player)
end
function HealNPC_OnGossipSelect(pUnit, event, player, id, intid, code, pMisc)
if (intid == 1) then
if (player:IsInCombat() == true) then
player:SendAreaTriggerMessage("You are in combat!")
pUnit:SendChatMessage(12, 0, "I cannot heal you while you are in combat. That's cheating!")
else
player:SetHealthPct(100)
end
end
if (intid == 2) then
if (player:IsInCombat() == true) then
player:SendAreaTriggerMessage("You are in combat!")
pUnit:SendChatMessage(12, 0, "I can't buff you in combat.")
else
pUnit:GossipCreateMenu(99, player, 0)
pUnit:GossipMenuAddItem(3, "Agility", 3, 0)
pUnit:GossipMenuAddItem(3, "Intellect", 4, 0)
pUnit:GossipMenuAddItem(3, "Protection", 5, 0)
pUnit:GossipMenuAddItem(3, "Spirit", 6, 0)
pUnit:GossipMenuAddItem(3, "Stamina", 7, 0)
pUnit:GossipMenuAddItem(3, "Strength", 8, 0)
pUnit:GossipSendMenu(player)
end
end
if (intid == 3) then
pUnit:FullCastSpellOnTarget(33077, player)
pUnit:GossipComplete(player)
end
if (intid == 4) then
pUnit:FullCastSpellOnTarget(33078, player)
pUnit:GossipComplete(player)
end
if (intid == 5) then
pUnit:FullCastSpellOnTarget(33079, player)
pUnit:GossipComplete(player)
end
if (intid == 6) then
pUnit:FullCastSpellOnTarget(33080, player)
pUnit:GossipComplete(player)
end
if (intid == 7) then
pUnit:FullCastSpellOnTarget(33081, player)
pUnit:GossipComplete(player)
end
if (intid == 8) then
pUnit:FullCastSpellOnTarget(33082, player)
pUnit:GossipComplete(player)
end
end
RegisterUnitGossipEvent(npcid, 1, "HealNPC_OnGossipTalk")
RegisterUnitGossipEvent(npcid, 2, "HealNPC_OnGossipSelect")
Remember to change the NPCID to the NPC you want to use, and set its flags to 3!! Otherwise this won't work. :P