• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] Help with promotion NPC

Status
Not open for further replies.

Monolite

Enthusiast
Hello guys I need some help with my promotion NPC. The script give level, bags and some ridings but how to give some gold?

Code:
local NpcEntry = 50000

local ApprenticeRiding = 33388
local JourneymanRiding = 33391
local ExpertRiding = 34090

function NPCPromotion_Gossip(event, player, unit)
        if (player:IsInCombat() == true) then
            else
            NPCPromotion_Menu(unit, player)
        end
end
 
function NPCPromotion_Menu(unit, player)
	player:GossipMenuAddItem(7, "I want get the promotion", 0, 1)
	player:GossipMenuAddItem(7, "Exit", 0 , 10)
	player:GossipSendMenu(1, unit)
end

function NPCPromotion_Events(event, player, unit, sender, intid, code)
if (intid == 100) then
	player:GossipClearMenu()
	player:GossipMenuAddItem(7, "I want get the promotion", 0, 1)
	player:GossipMenuAddItem(7, "Exit", 0 , 10)
	player:GossipSendMenu(1, unit)
end

if (intid == 1) then
	if(player:HasSpell(ExpertRiding) == true) then
		player:GossipClearMenu()
		player:SendBroadcastMessage("You can't receive more promotions!")
		player:GossipMenuAddItem(7, "Exit", 0, 10)
		player:GossipSendMenu(1,unit)
	else
		player:GossipClearMenu()
		player:GiveXP(25913100) --Level 80
		player:AddItem(41600, 4) --Bags
		player:LearnSpell(ApprenticeRiding) --Apprentice Riding Level 20
		player:LearnSpell(JourneymanRiding) --Journeyman Riding Level 40
		player:LearnSpell(ExpertRiding) --Expert Riding Level 60
		player:GossipMenuAddItem(7, "Exit", 0, 10)
		player:SendBroadcastMessage("Congratulations you've received the promotion!") -- Message
	end
end

if(intid == 10) then
	player:GossipComplete()
end
end
 
RegisterCreatureGossipEvent(NpcEntry, 1, NPCPromotion_Gossip)
RegisterCreatureGossipEvent(NpcEntry, 2, NPCPromotion_Events)

Thanks for help!
 
Status
Not open for further replies.
Top