Code:
al NPCID = 99001 -- Your NPC ID here.
local TTable = {
"PRIVATE" = {100, 1}
"CORPORAL" = {300, 2}
"SERGEANT" = {750, 3}
"MASTERSERGEANT" = {1350, 4}
"SERGEANTMAJOR" = {1900, 5}
"KNIGHT" = {3000, 6}
"KNIGHTLIEUTENANT" = {4500, 7}
"KNIGHTCAPTAIN" = {7350, 8}
"KNIGHTCHAMPION" = {9500, 9}
"LIEUTENANTCOMMANDER" = {12000, 10}
"COMMANDERLIEUTENANT" = {14000, 11}
"MARSHAL" = {16500, 12}
"FIELDMARSHAL" = {20000, 13}
"GRANDMARSHAL" = {30000, 14}
"SCOUT" = {100, 15}
"GRUNT" = {300, 16}
"SERGEANT_HORDE" = {750, 17}
"SENIORSERGEANT" = {1350, 18}
"FIRSTSERGEANT" = {1900, 19}
"STONEGUARD" = {3000, 20}
"BLOODGUARD" = {4500, 21}
"LEGIONNAIRE" = {7350, 22}
"CENTURION" = {9500, 23}
"CHAMPION" = {12000, 24}
"LIEUTENANTGENERAL" = {14000, 25}
"GENERAL" = {16500, 26}
"WARLORD" = {20000, 27}
"HIGHWARLORD" = {30000, 28}
}
function PVPTitleNPC_OnGossipTalk(unit, event, plr)
if(plr:GetTeam() == 1) then -- Alliance
unit:GossipCreateMenu(100, plr, 0)
unit:GossipMenuAddItem(0, "Private - 100HKs.", 1, 0)
unit:GossipMenuAddItem(0, "Corporal - 300HKs.", 2, 0)
unit:GossipMenuAddItem(0, "Sergeant - 750HKs.", 3, 0)
unit:GossipMenuAddItem(0, "Master Sergeant - 1,350HKs.", 4, 0)
unit:GossipMenuAddItem(0, "Sergeant Major - 1,900HKs.", 5, 0)
unit:GossipMenuAddItem(0, "Knight - 3,000HKs.", 6, 0)
unit:GossipMenuAddItem(0, "Knight-Lieutenant - 4,500HKs.", 7, 0)
unit:GossipMenuAddItem(0, "Knight-Captain - 7,350HKs.", 8, 0)
unit:GossipMenuAddItem(0, "Knight-Champion - 9,500HKs.", 9, 0)
unit:GossipMenuAddItem(0, "Lieutenant Commander - 12,000HKs.", 10, 0)
unit:GossipMenuAddItem(0, "Commander Lieutenant - 14,000HKs.", 11, 0)
unit:GossipMenuAddItem(0, "Marshal - 16,500HKs.", 12, 0)
unit:GossipMenuAddItem(0, "Field Marshal - 20,000HKs.", 13, 0)
unit:GossipMenuAddItem(0, "Grand Marshal - 30,000HKs.", 14, 0)
unit:GossipSendMenu(plr)
else
unit:GossipCreateMenu(100, plr, 0)
unit:GossipMenuAddItem(0, "Scout - 100HKs.", 15, 0)
unit:GossipMenuAddItem(0, "Grunt - 300HKs.", 16, 0)
unit:GossipMenuAddItem(0, "Sergeant - 750HKs.", 17, 0)
unit:GossipMenuAddItem(0, "Senior Sergeant - 1,350HKs.", 18, 0)
unit:GossipMenuAddItem(0, "First Sergeant - 1,900HKs.", 19, 0)
unit:GossipMenuAddItem(0, "Stone Guard - 3,000HKs.", 20, 0)
unit:GossipMenuAddItem(0, "Blood Guard - 4,500HKs.", 21, 0)
unit:GossipMenuAddItem(0, "Legionnaire - 7,350HKs.", 22, 0)
unit:GossipMenuAddItem(0, "Centurion - 9,500HKs.", 23, 0)
unit:GossipMenuAddItem(0, "Champion - 12,000HKs.", 24, 0)
unit:GossipMenuAddItem(0, "Lieutenant General - 14,000HKs.", 25, 0)
unit:GossipMenuAddItem(0, "General - 16,500HKs.", 26, 0)
unit:GossipMenuAddItem(0, "Warlord - 20,000HKs.", 27, 0)
unit:GossipMenuAddItem(0, "High Warlord - 30,000HKs.", 28, 0)
unit:GossipSendMenu(plr)
end
end
function PVPTitleNPC_OnGossipSelect(unit, event, plr, id, intid, code, pMisc)
if(intid == 1) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "PRIVATE")
plr:GossipComplete()
end
end
if(intid == 2) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "CORPORAL")
plr:GossipComplete()
end
end
if(intid == 3) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "SERGEANT")
plr:GossipComplete()
end
end
if(intid == 4) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "MASTERSERGEANT")
plr:GossipComplete()
end
end
if(intid == 5) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "SERGEANTMAJOR")
plr:GossipComplete()
end
end
if(intid == 6) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "KNIGHT")
plr:GossipComplete()
end
end
if(intid == 7) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "KNIGHTLIEUTENANT")
plr:GossipComplete()
end
end
if(intid == 8) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "KNIGHTCAPTAIN")
plr:GossipComplete()
end
end
if(intid == 9) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "COMMANDERLIEUTENANT")
plr:GossipComplete()
end
end
if(intid == 10) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "LIEUTENANTCOMMANDER")
plr:GossipComplete()
end
end
if(intid == 11) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "COMMANDERLIEUTENANT"])
plr:GossipComplete()
end
end
if(intid == 12) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "MARSHAL")
plr:GossipComplete()
end
end
if(intid == 13) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "FIELDMARSHAL")
plr:GossipComplete()
end
end
if(intid == 14) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "GRANDMARSHAL")
plr:GossipComplete()
end
end
if(intid == 15) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "SCOUT")
plr:GossipComplete()
end
end
if(intid == 16) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "GRUNT")
plr:GossipComplete()
end
end
if(intid == 17) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "SERGEANT_HORDE")
plr:GossipComplete()
end
end
if(intid == 18) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "SENIORSERGEANT")
plr:GossipComplete()
end
end
if(intid == 19) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "FIRSTSERGEANT")
plr:GossipComplete()
end
end
if(intid == 20) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "STONEGUARD")
plr:GossipComplete()
end
end
if(intid == 21) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "BLOODGUARD")
plr:GossipComplete()
end
end
if(intid == 22) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "LEGIONNAIRE")
plr:GossipComplete()
end
end
if(intid == 23) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "CENTURION")
plr:GossipComplete()
end
end
if(intid == 24) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "CHAMPION")
plr:GossipComplete()
end
end
if(intid == 25) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "LIEUTENANTGENERAL")
plr:GossipComplete()
end
end
if(intid == 26) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "GENERAL")
plr:GossipComplete()
end
end
if(intid == 27) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "WARLORD")
plr:GossipComplete()
end
end
if(intid == 28) then
if(plr:GetLifetimeKills() >= ReturnRequirement(TTable[intid])) then
GiveTitle(plr, "HIGHWARLORD")
plr:GossipComplete()
end
end
end
function GiveTitle(plr, title)
local titlepos = TTable[title]
plr:SetKnownTitle(titlepos[2])
end
function ReturnRequirement(place)
return place[1]
end
RegisterUnitGossipEvent(NPCID, 1, "PVPTitleNPC_OnGossipTalk")
RegisterUnitGossipEvent(NPCID, 2, "PVPTitleNPC_OnGossipSelect")