[Request] NPC Reset Level 80 to Level 1 and that gives GOLD

Reset NPC Level 80 to Level 1 and that gives GOLD.

C + + script I found was in format [LUA] I’m in need of a C + + Script, Follow the Link Below Script [MOON] If anyone Convert To Get C + +


-- Buy Experience NPC v2 --

-- Scripted by Furball   --

-- Idea by QQrofl        --

-- www.ac-web.org        --


--NPC CONFIG--

local EntryID = 50000          -- The entry ID of the npc. Used for spawning the experience npc. [DEFAULT: 50000]


--SPAWN CONFIG--

local SpawnCommand = "#buy xp" -- When typed in-game, the Buy Experience NPC will spawn. [DEFAULT: "#buy xp"] [DO NOT REMOVE THE QUOTES]

local TimeNPC = 30             -- Time, in seconds, that the NPC will be spawned for. It will despawn after the timer runs out. [DEFAULT: 30]


--SERVER CONFIG--

local LevelCap = 80            -- The maximum level you can obtain on your realm. [DEFAULT: 80]

local SrvrName = "ExampleWoW"  -- The name of your server.


--PRICE CONFIG--

local Gold1k = 1               -- Amount of gold you need to buy 1,000 experience [DEFAULT: 1]

local Gold10k = 10             -- Amount of gold you need to buy 10,000 experience [DEFAULT: 10]

local Gold100k = 100           -- Amount of gold you need to buy 100,000 experience [DEFAULT: 100]

local Gold500k = 500           -- Amount of gold you need to buy 500,000 experience [DEFAULT: 500]

local Gold1m = 1000            -- Amount of gold you need to buy 1,000,000 experience [DEFAULT: 1000]

local Gold5m = 5000            -- Amount of gold you need to buy 5,000,000 experience [DEFAULT: 5000]


--[[GOLD AND TIME CONVERSIONS - DO NOT EDIT]]--

local DontModify = TimeNPC * 600

local DontModify2 = Gold1k * 10000

local DontModify3 = Gold10k * 10000

local DontModify4 = Gold100k * 10000

local DontModify5 = Gold500k * 10000

local DontModify6 = Gold1m * 10000

local DontModify7 = Gold5m * 10000

-----------------------------------------------

function Spawn_OnChat(event, player, message, type, language)

local Mess = message:lower()

if (Mess:find(SpawnCommand) == 1) then

if (player:GetPlayerLevel() == LevelCap) then

player:SendBroadcastMessage("You are already level "..LevelCap.."!")

return 0

else

player:SpawnCreature(EntryID, player:GetX(), player:GetY(), player:GetZ(), player:GetO(), 35, DontModify, player:GetPhase())

player:SendBroadcastMessage("Success! The experience vendor will despawn in "..TimeNPC.." seconds.")

return 0

end

end

end


function XPGossip(Unit, event, player)

if (player:GetPlayerLevel() == LevelCap) then

Unit:SendChatMessageToPlayer(15, 0, "You are already level "..LevelCap.."!", player) -- Whispering the player.

player:GossipComplete()

else

Unit:GossipCreateMenu(100, player, 0)

Unit:GossipMenuAddItem(9, "1,000 XP ["..Gold1k.."g]", 1, 0)

Unit:GossipMenuAddItem(9, "10,000 XP ["..Gold10k.."g]", 2, 0)

Unit:GossipMenuAddItem(9, "100,000 XP ["..Gold100k.."g]", 3, 0)

Unit:GossipMenuAddItem(9, "500,000 XP ["..Gold500k.."g]", 4, 0)

Unit:GossipMenuAddItem(9, "1,000,000 XP ["..Gold1m.."g]", 5, 0)

Unit:GossipMenuAddItem(9, "5,000,000 XP ["..Gold5m.."g]", 6, 0)

Unit:GossipMenuAddItem(9, "[Nevermind]", 999, 0)

Unit:GossipSendMenu(player)

end

end


function XPGossip_OnSelect(Unit, event, player, code, intid, id)

if(intid == 998) then -- [Back]

Unit:GossipCreateMenu(100, player, 0)

Unit:GossipMenuAddItem(9, "1,000 XP ["..Gold1k.."g]", 1, 0)

Unit:GossipMenuAddItem(9, "10,000 XP ["..Gold10k.."g]", 2, 0)

Unit:GossipMenuAddItem(9, "100,000 XP ["..Gold100k.."g]", 3, 0)

Unit:GossipMenuAddItem(9, "500,000 XP ["..Gold500k.."g]", 4, 0)

Unit:GossipMenuAddItem(9, "1,000,000 XP ["..Gold1m.."g]", 5, 0)

Unit:GossipMenuAddItem(9, "5,000,000 XP ["..Gold5m.."g]", 6, 0)

Unit:GossipMenuAddItem(9, "[Nevermind]", 999, 0)

Unit:GossipSendMenu(player)

end


if(intid == 999) then -- [Nevermind]

Unit:SendChatMessage(14, 0, "Goodbye! Don't forget to vote for "..SrvrName.."!") -- Whispering to player

player:GossipComplete()

end


if(intid == 1) then -- 1,000 Experience

if(player:GetCoinage() <= DontModify2) then

Unit:SendChatMessage(14, 0, "You don't have "..Gold1k.." gold.")

Unit:GossipCreateMenu(100, player, 0)

Unit:GossipMenuAddItem(9, "[Back]", 998, 0)

Unit:GossipSendMenu(player)

else

player:DealGoldCost(DontModify2)

player:GiveXp(1000) -- Giving 1,000 XP

Unit:SendChatMessage(14, 0, "Success! You've bought 1,000 experience for "..Gold1k.." gold.")

Unit:GossipCreateMenu(100, player, 0)

Unit:GossipMenuAddItem(9, "[Back]", 998, 0)

Unit:GossipSendMenu(player)

end

end


if(intid == 2) then -- 10,000 Experience

if(player:GetCoinage() <= DontModify3) then

Unit:SendChatMessage(14, 0, "You don't have "..Gold10k.." gold.")

Unit:GossipCreateMenu(100, player, 0)

Unit:GossipMenuAddItem(9, "[Back]", 998, 0)

Unit:GossipSendMenu(player)

else

player:DealGoldCost(DontModify3)

player:GiveXp(10000)

Unit:SendChatMessage(14, 0, "Success! You've bought 10,000 experience for "..Gold10k.." gold.")

Unit:GossipCreateMenu(100, player, 0)

Unit:GossipMenuAddItem(9, "[Back]", 998, 0)

Unit:GossipSendMenu(player)

end

end


if(intid == 3) then -- 100,000 Experience

if(player:GetCoinage() <= DontModify4) then

Unit:SendChatMessage(14, 0, "You don't have "..Gold100k.." gold.")

Unit:GossipCreateMenu(100, player, 0)

Unit:GossipMenuAddItem(9, "[Back]", 998, 0)

Unit:GossipSendMenu(player)

else

player:DealGoldCost(DontModify4)

player:GiveXp(100000)

Unit:SendChatMessage(14, 0, "Success! You've bought 100,000 experience for "..Gold100k.." gold.")

Unit:GossipCreateMenu(100, player, 0)

Unit:GossipMenuAddItem(9, "[Back]", 998, 0)

Unit:GossipSendMenu(player)

end

end


if(intid == 4) then -- 500,000 Experience

if(player:GetCoinage() <= DontModify5) then

Unit:SendChatMessage(14, 0, "You don't have "..Gold500k.." gold.")

Unit:GossipCreateMenu(100, player, 0)

Unit:GossipMenuAddItem(9, "[Back]", 998, 0)

Unit:GossipSendMenu(player)

else

player:DealGoldCost(DontModify5)

player:GiveXp(500000)

Unit:SendChatMessage(14, 0, "Success! You've bought 500,000 experience for "..Gold500k.." gold.")

Unit:GossipCreateMenu(100, player, 0)

Unit:GossipMenuAddItem(9, "[Back]", 998, 0)

Unit:GossipSendMenu(player)

end

end


if(intid == 5) then -- 1,000,000 Experience

if(player:GetCoinage() <= DontModify6) then

Unit:SendChatMessage(14, 0, "You don't have "..Gold1m.." gold.")

Unit:GossipCreateMenu(100, player, 0)

Unit:GossipMenuAddItem(9, "[Back]", 998, 0)

Unit:GossipSendMenu(player)

else

player:DealGoldCost(DontModify6)

player:GiveXp(1000000)

Unit:SendChatMessage(14, 0, "Success! You've bought 1,000,000 experience for "..Gold1m.." gold.")

Unit:GossipCreateMenu(100, player, 0)

Unit:GossipMenuAddItem(9, "[Back]", 998, 0)

Unit:GossipSendMenu(player)

end

end


if(intid == 6) then -- 5,000,000 Experience

if(player:GetCoinage() <= DontModify7) then

Unit:SendChatMessage(14, 0, "You don't have "..Gold5m.." gold.")

Unit:GossipCreateMenu(100, player, 0)

Unit:GossipMenuAddItem(9, "[Back]", 998, 0)

Unit:GossipSendMenu(player)

else

player:DealGoldCost(DontModify7)

player:GiveXp(5000000)

Unit:SendChatMessage(14, 0, "Success! You've bought 5,000,000 experience for "..Gold5m.." gold.")

Unit:GossipCreateMenu(100, player, 0)

Unit:GossipMenuAddItem(9, "[Back]", 998, 0)

Unit:GossipSendMenu(player)

end

end

end

RegisterServerHook(16, "Spawn_OnChat")

RegisterUnitGossipEvent(EntryID, 1, "XPGossip")

RegisterUnitGossipEvent(EntryID, 2, "XPGossip_OnSelect")


--[[ PREMADE NPC SQL[Tested on ArcEmu r4005] [RUN THIS SCRIPT INTO THE WORLD DATABASE FOR YOUR SERVER]

insert into `creature_names` (`entry`, `name`, `subname`, `info_str`, `Flags1`, `type`, `family`, `rank`, `killcredit1`, `killcredit2`, `male_displayid`, `female_displayid`, `male_displayid2`, `female_displayid2`, `unknown_float1`, `unknown_float2`, `leader`) 

values ('50000', "The XP Master", "Buy Experience Here!", '', '0', '7', '0', '1', '0', '0', '28213', '0', '0', '0', '1', '1', '0');


insert into `creature_proto` (`entry`, `minlevel`, `maxlevel`, `faction`, `minhealth`, `maxhealth`, `mana`, `scale`, `npcflags`, `attacktime`, `attacktype`, `mindamage`, `maxdamage`, `can_ranged`, `rangedattacktime`, `rangedmindamage`, `rangedmaxdamage`, `respawntime`, `armor`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `combat_reach`, `bounding_radius`, `auras`, `boss`, `money`, `invisibility_type`, `walk_speed`, `run_speed`, `fly_speed`, `extra_a9_flags`, `spell1`, `spell2`, `spell3`, `spell4`, `spell_flags`, `modImmunities`, `summonguard`) 

values ('50000', '80', '80', '35', '10000', '80000', '87906', '2', '1', '2000', '0', '5000', '15000', '0', '0', '0', '0', '30000', '5000', '0', '0', '0', '0', '0', '0', '0', '0', "0", '0', '0', '0', '2.50', '8.00', '14.00', '0', '0', '0', '0', '0', '0', '0', '0');

]]--