hello there MMOwned i came up with idea to make class chnage script in lua. reasons:
1) im not good with c++
2)my repack is arcemu
3)lua is kinda easyer for all scripters
4)i have seen some change slass scripts but only 1 is working and its on cpp so i have decided to make my own in lua...here is the script:
local itemid =80000
function Remort_OnUse(item, event, player)
if (player:IsInCombat() == true) then
player:SendAreaTriggerMessage("U can't use this while u are in combat!")
else
Remort_Menu(item, player)
end
end
function Remort_Menu(item, player)
item:GossipCreateMenu(1, player, 0)
item:GossipMenuAddItem(4, "I want to be |c00FFFF00[Rogue]! |r", 1, 0)
item:GossipMenuAddItem(4, "I want to be |cffFF00A0[Paladin]! |r", 2, 0)
item:GossipMenuAddItem(4, "I want to be |c0066FF00[Hunter]! |r", 3, 0)
item:GossipMenuAddItem(4, "I want to be |c00C79C6E[Warrior]! |r", 4, 0)
item:GossipMenuAddItem(4, "I want to be |c0000B4FF[Mage]! |r", 5, 0)
item:GossipMenuAddItem(4, "I want to be |c00CC00FF[Warlock]! |r", 6, 0)
item:GossipMenuAddItem(4, "I want to be |c00FF9900[Druid]! |r", 7, 0)
item:GossipMenuAddItem(4, "I want to be |c00FFFFFF[Priest]! |r", 8, 0)
item:GossipMenuAddItem(4, "I want to be |cff0000cc[Shaman]! |r", 9, 0)
item:GossipMenuAddItem(4, "I want to be |c00FF0000[Death Knight]! |r", 10, 0)
item:GossipMenuAddItem(4, "I dont want to change my class!", 11, 0)
item:GossipMenuAddItem(0, "|cffFF00A0Script by: TheLaboureR|r", 100, 0)
item:GossipSendMenu(player)
end
function Remort_OnSelect(item, event, player, id, intid, code)
local plyr = player:GetPlayerClass()
if (intid == 1) then
if (plyr == 4) then
player:SendBroadcastMessage("You are Rogue already!")
else
player:SetClass(4)
player:SendBroadcastMessage("You may need to relog for this to take effect")
player:GossipComplete()
end
end
if (intid == 2) then
if (plyr == 2) then
player:SendBroadcastMessage("You are Paladin already!")
else
player:SetClass(2)
player:SendBroadcastMessage("You may need to relog for this to take effect")
player:GossipComplete()
end
end
if (intid == 3) then
if (plyr == 3) then
player:SendBroadcastMessage("You are Hunter already!")
else
player:SetClass(3)
player:SendBroadcastMessage("You may need to relog for this to take effect")
player:GossipComplete()
end
end
if (intid == 4) then
if (plyr == 1) then
player:SendBroadcastMessage("You are Warrior already!")
else
player:SetClass(1)
player:SendBroadcastMessage("You may need to relog for this to take effect")
player:GossipComplete()
end
end
if (intid == 5) then
if (plyr ==then
player:SendBroadcastMessage("You are Mage already!")
else
player:SetClass(
player:SendBroadcastMessage("You may need to relog for this to take effect")
player:GossipComplete()
end
end
if (intid == 6) then
if (plyr == 9) then
player:SendBroadcastMessage("You are Warlock already!")
else
player:SetClass(9)
player:SendBroadcastMessage("You may need to relog for this to take effect")
player:GossipComplete()
end
end
if (intid == 7) then
if (plyr == 11) then
player:SendBroadcastMessage("You are Druid already!")
else
player:SetClass(11)
player:SendBroadcastMessage("You may need to relog for this to take effect")
player:GossipComplete()
end
end
if (intid ==then
if (plyr == 5) then
player:SendBroadcastMessage("You are Priest already!")
else
player:SetClass(5)
player:SendBroadcastMessage("You may need to relog for this to take effect")
player:GossipComplete()
end
end
if (intid == 9) then
if (plyr == 7) then
player:SendBroadcastMessage("You are Shaman already!")
else
player:SetClass(7)
player:SendBroadcastMessage("You may need to relog for this to take effect")
player:GossipComplete()
end
end
if (intid == 10) then
if (plyr == 6) then
player:SendBroadcastMessage("You are Death knight already!")
else
player:SetClass(6)
player:SendBroadcastMessage("You may need to relog for this to take effect")
player:GossipComplete()
end
end
end
RegisterItemGossipEvent(80000, 1, "Remort_OnUse")
RegisterItemGossipEvent(80000, 2, "Remort_OnSelect")
function Whelp_OnSpawn(Unit, event)
local plyr = Unit:GetClosestPlayer()
if (plyr ~= nil) then
Unit:FullCastSpellOnTarget(56520, plyr)
Unit:FullCastSpellOnTarget(56521, plyr)
Unit:FullCastSpellOnTarget(58054, plyr)
Unit:FullCastSpellOnTarget(48469, plyr)
Unit:FullCastSpellOnTarget(42995, plyr)
Unit:FullCastSpellOnTarget(48161, plyr)
end
end
well the script is loaded by luahyparc with any erors but when i log ingame and try to remort (change my class) it doesnt do anything!
please help me fast!!Thanks in advance!