Advertisement
Guest User

Faction Change LUA - By Avid

a guest
Mar 12th, 2010
533
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 13.67 KB | None | 0 0
  1. --[[
  2.         Changing a faction for a player
  3.         This may or may not work.
  4.         Testing
  5.     ]]
  6.  
  7.    
  8. -- Variables
  9. local NPC_ID = 50033
  10.  
  11. -- On Triggers
  12. function GossipOnTalk(Unit, Event, player)
  13.     Unit:GossipCreateMenu(100, player, 0)
  14.     Unit:GossipMenuAddItem(0, "Alliance", 1, 0)
  15.     Unit:GossipMenuAddItem(0, "Horde", 2, 0)
  16.     Unit:GossipMenuAddItem(0, "Scourge", 3, 0)
  17.     Unit:GossipMenUAddItem(0, "Worgen", 4, 0)
  18.     Unit:GossipMenuAddItem(0, "I'd like another faction", 500, 0)
  19.     Unit:GossipSendMenu(player)
  20. end
  21.  
  22. function GossipOnTalk(Unit, Event, player, id, intid, code, pMisc)
  23.     if (intid == 1) then
  24.     Unit:GossipCreateMenu(100, player, 0)
  25.     Unit:GossipMenuAddItem(0, "Male Human", 5. 0)
  26.     Unit:GossipMenuAddItem(0, "Female Human", 6, 0)
  27.     Unit:GossipMenuAddItem(0, "Male Dwarf", 7, 0)
  28.     Unit:GossipMenuAddItem(0, "Female Dwarf", 8, 0)
  29.     Unit:GossipMenuAddItem(0, "Male Gnome", 9, 0)
  30.     Unit:GossipMenuAddItem(0, "Female Gnome", 10, 0)
  31.     Unit:GossipMenuAddItem(0, "Male Night Elf", 11, 0)
  32.     Unit:GossipMenuAddItem(0, "Female Night Elf", 12, 0)
  33.     Unit:GossipMenuAddItem(0, "Male Draenei", 13, 0)
  34.     Unit:GossipMenuAddItem(0, "Female Draenei", 14, 0)
  35.     Unit:GossipMenuAdditem(0, "Male Orc", 15, 0)
  36.     Unit:GossipMenuAddItem(0, "Female Orc", 16, 0)
  37.     Unit:GossipMenuAddItem(0, "Male Undead", 17, 0)
  38.     Unit:GossipMenuAddItem(0, "Female Undead", 18, 0)
  39.     Unit:GossipMenuAddItem(0, "Male Troll", 19, 0)
  40.     Unit:GossipMenuAddItem(0, "Female Troll", 20, 0)
  41.     Unit:GossipMenuAddItem(0, "Male Tauren", 21, 0)
  42.     Unit:GossipMenuAddItem(0, "Female Tauren", 22, 0)
  43.     Unit:GossipMenuAddItem(0, "Male Blood Elf", 23, 0)
  44.     Unit:GossipMenuAddItem(0, "Female Blood Elf", 24, 0)
  45.     Unit:GossipMenuAddItem(0, "I'd like to join another faction", 500, 0)
  46.     Unit:GossipSendMenu(player)
  47.             player:SetFaction(72)
  48.             player:SetPlayerAtWar(76, 1)
  49.             player:SetPlayerAtWar(528, 1)
  50.             playerSetPlayerAtWar(68, 1)
  51.             player:SendBroadcastMessage("Your now a member of the Alliance!")
  52.            
  53.     end
  54. end
  55.     if (intid == 2) then
  56.     Unit:GossipCreateMenu(100, player, 0)
  57.     Unit:GossipMenuAddItem(0, "Male Human", 25. 0)
  58.     Unit:GossipMenuAddItem(0, "Female Human", 26, 0)
  59.     Unit:GossipMenuAddItem(0, "Male Dwarf", 27, 0)
  60.     Unit:GossipMenuAddItem(0, "Female Dwarf", 28, 0)
  61.     Unit:GossipMenuAddItem(0, "Male Gnome", 29, 0)
  62.     Unit:GossipMenuAddItem(0, "Female Gnome", 30, 0)
  63.     Unit:GossipMenuAddItem(0, "Male Night Elf", 31, 0)
  64.     Unit:GossipMenuAddItem(0, "Female Night Elf", 32, 0)
  65.     Unit:GossipMenuAddItem(0, "Male Draenei", 33, 0)
  66.     Unit:GossipMenuAddItem(0, "Female Draenei", 34, 0)
  67.     Unit:GossipMenuAdditem(0, "Male Orc", 35, 0)
  68.     Unit:GossipMenuAddItem(0, "Female Orc", 36, 0)
  69.     Unit:GossipMenuAddItem(0, "Male Undead", 37, 0)
  70.     Unit:GossipMenuAddItem(0, "Female Undead", 38, 0)
  71.     Unit:GossipMenuAddItem(0, "Male Troll", 39, 0)
  72.     Unit:GossipMenuAddItem(0, "Female Troll", 30, 0)
  73.     Unit:GossipMenuAddItem(0, "Male Tauren", 41, 0)
  74.     Unit:GossipMenuAddItem(0, "Female Tauren", 42, 0)
  75.     Unit:GossipMenuAddItem(0, "Male Blood Elf", 43, 0)
  76.     Unit:GossipMenuAddItem(0, "Female Blood Elf", 44, 0)
  77.     Unit:GossipMenuAddItem(0, "I'd like to join another faction", 500, 0)
  78.     Unit:GossipSendMenu(player)    
  79.             player:SetFaction(76)
  80.             player:SetPlayerAtWar(72, 1)
  81.             player:SetPlayerAtWar(528, 1)
  82.             player:SetPlayerAtWar(68, 1)
  83.             player:SendBroadcastMessage("Your now a member of the Horde!")
  84.            
  85.     end
  86.    
  87.     if (intd == 3) then
  88.     Unit:GossipCreateMenu(100, player, 0)
  89.     Unit:GossipMenuAddItem(0, "Skeletal Soldier", 45. 0)
  90.     Unit:GossipMenuAddItem(0, "Blighted Zombie", 46, 0)
  91.     Unit:GossipMenuAddItem(0, "Darkfallen Archmage (Caster)", 47, 0)
  92.     Unit:GossipMenuAddItem(0, "Darkfallen Blood Knight (Melee)", 48, 0)
  93.     Unit:GossipMenuAddItem(0, "Servant of the Throne (Caster)", 49, 0)
  94.     Unit:GossipMenuAddItem(0, "I'd like to join another faction", 500, 0)
  95.     Unit:GossipSendMenu(player)    
  96.             player:SetFaction(529)
  97.             player:SetPlayerAtWar(72, 1)
  98.             player:SetPlayerAtWar(76, 1)
  99.             player:SetPlayerAtWar(68, 1)
  100.             player:SendBroadcastMessage("Your now a member of the Scourge!")
  101.            
  102.     end
  103.  
  104.     if (intid == 4) then
  105.     Unit:GossipCreateMenu(100, player, 0)
  106.     Unit:GossipMenuAddItem(0, "Bloodmoon Worgen", 50, 0)
  107.     Unit:GossipMenuAddItem(0, "Nightbane Worgen", 51, 0)
  108.     Unit:GossipMenuAddItem(0, "I'd like to join another faction", 500, 0)
  109.     Unit:GossipSendMenu(player)    
  110.             player:SetFaction(68)
  111.             player:SetPlayerAtWar(72, 1)
  112.             player:SetPlayerAtWar(76, 1)
  113.             player:SetPlayerAtWar(68, 1)
  114.             player:SendBroadcastMessage("Your now a member of the Worgen!")
  115.            
  116.     end
  117.  
  118.  
  119.  
  120. --[[ Changing Displays ]]--
  121.  
  122. if (intid == 5) then
  123.     player:SetModel(49)
  124.         Unit:GossipCreateMenu(100, player, 0)
  125.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  126.         Unit:GossipSendMenu(player)
  127. end
  128.  
  129. if (intid == 6) then
  130.     player:SetModel(49)
  131.         Unit:GossipCreateMenu(100, player, 0)
  132.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  133.         Unit:GossipSendMenu(player)
  134. end
  135.  
  136. if (intid == 7) then
  137.     player:SetModel(52)
  138.         Unit:GossipCreateMenu(100, player, 0)
  139.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  140.         Unit:GossipSendMenu(player)
  141. end
  142.  
  143.  
  144. if (intid == 8) then
  145.     player:SetModel(52)
  146.         Unit:GossipCreateMenu(100, player, 0)
  147.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  148.         Unit:GossipSendMenu(player)
  149. end
  150.  
  151.  
  152. if (intid == 9) then
  153.     player:SetModel(1563)
  154.         Unit:GossipCreateMenu(100, player, 0)
  155.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  156.         Unit:GossipSendMenu(player)
  157. end
  158.  
  159.  
  160. if (intid == 10) then
  161.     player:SetModel(1563)
  162.         Unit:GossipCreateMenu(100, player, 0)
  163.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  164.         Unit:GossipSendMenu(player)
  165. end
  166.  
  167.  
  168. if (intid == 11) then
  169.     player:SetModel(55)
  170.         Unit:GossipCreateMenu(100, player, 0)
  171.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  172.         Unit:GossipSendMenu(player)
  173. end
  174.  
  175.  
  176. if (intid == 12) then
  177.     player:SetModel(55)
  178.         Unit:GossipCreateMenu(100, player, 0)
  179.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  180.         Unit:GossipSendMenu(player)
  181. end
  182.  
  183.  
  184. if (intid == 13) then
  185.     player:SetModel(16125)
  186.         Unit:GossipCreateMenu(100, player, 0)
  187.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  188.         Unit:GossipSendMenu(player)
  189. end
  190.  
  191.  
  192. if (intid == 14) then
  193.     player:SetModel(16125)
  194.         Unit:GossipCreateMenu(100, player, 0)
  195.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  196.         Unit:GossipSendMenu(player)
  197. end
  198.  
  199.  
  200. if (intid == 15) then
  201.     player:SetModel(51)
  202.         Unit:GossipCreateMenu(100, player, 0)
  203.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  204.         Unit:GossipSendMenu(player)
  205. end
  206.  
  207.  
  208. if (intid == 16) then
  209.     player:SetModel(51)
  210.         Unit:GossipCreateMenu(100, player, 0)
  211.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  212.         Unit:GossipSendMenu(player)
  213. end
  214.  
  215.  
  216. if (intid == 17) then
  217.     player:SetModel(57)
  218.         Unit:GossipCreateMenu(100, player, 0)
  219.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  220.         Unit:GossipSendMenu(player)
  221. end
  222.  
  223.  
  224. if (intid == 18) then
  225.     player:SetModel(57)
  226.         Unit:GossipCreateMenu(100, player, 0)
  227.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  228.         Unit:GossipSendMenu(player)
  229. end
  230.  
  231.  
  232. if (intid == 19) then
  233.     player:SetModel(1478)
  234.         Unit:GossipCreateMenu(100, player, 0)
  235.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  236.         Unit:GossipSendMenu(player)
  237. end
  238.  
  239.  
  240. if (intid == 20) then
  241.     player:SetModel(1478)
  242.         Unit:GossipCreateMenu(100, player, 0)
  243.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  244.         Unit:GossipSendMenu(player)
  245. end
  246.  
  247.  
  248. if (intid == 21) then
  249.     player:SetModel(59)
  250.         Unit:GossipCreateMenu(100, player, 0)
  251.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  252.         Unit:GossipSendMenu(player)
  253. end
  254.  
  255.  
  256. if (intid == 22) then
  257.     player:SetModel(59)
  258.         Unit:GossipCreateMenu(100, player, 0)
  259.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  260.         Unit:GossipSendMenu(player)
  261. end
  262.  
  263.  
  264. if (intid == 23) then
  265.     player:SetModel(15476)
  266.         Unit:GossipCreateMenu(100, player, 0)
  267.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  268.         Unit:GossipSendMenu(player)
  269. end
  270.  
  271.  
  272. if (intid == 24) then
  273.     player:SetModel(15476)
  274.         Unit:Unit:GossipCreateMenu(100, player, 0)
  275.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  276.         Unit:GossipSendMenu(player)
  277. end
  278.  
  279.  
  280. if (intid == 25) then
  281.     player:SetModel(49)
  282.         Unit:Unit:GossipCreateMenu(100, player, 0)
  283.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  284.         Unit:GossipSendMenu(player)
  285. end
  286.  
  287.  
  288. if (intid == 26) then
  289.     player:SetModel(49)
  290.         Unit:GossipCreateMenu(100, player, 0)
  291.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  292.         Unit:GossipSendMenu(player)
  293. end
  294.  
  295.  
  296. if (intid == 27) then
  297.     player:SetModel(52)
  298.         Unit:Unit:GossipCreateMenu(100, player, 0)
  299.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  300.         Unit:GossipSendMenu(player)
  301. end
  302.  
  303.  
  304. if (intid == 28) then
  305.     player:SetModel(52)
  306.         Unit:GossipCreateMenu(100, player, 0)
  307.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  308.         Unit:GossipSendMenu(player)
  309. end
  310.  
  311.  
  312. if (intid == 29) then
  313.     player:SetModel(1563)
  314.         Unit:GossipCreateMenu(100, player, 0)
  315.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  316.         Unit:GossipSendMenu(player)
  317. end
  318.  
  319.  
  320. if (intid == 30) then
  321.     player:SetModel(1563)
  322.         Unit:GossipCreateMenu(100, player, 0)
  323.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  324.         Unit:GossipSendMenu(player)
  325. end
  326.  
  327.  
  328. if (intid == 31) then
  329.     player:SetModel(55)
  330.         Unit:GossipCreateMenu(100, player, 0)
  331.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  332.         Unit:GossipSendMenu(player)
  333. end
  334.  
  335.  
  336. if (intid == 32) then
  337.     player:SetModel(55)
  338.         Unit:GossipCreateMenu(100, player, 0)
  339.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  340.         Unit:GossipSendMenu(player)
  341. end
  342.  
  343.  
  344. if (intid == 33) then
  345.     player:SetModel(16125)
  346.         Unit:GossipCreateMenu(100, player, 0)
  347.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  348.         Unit:GossipSendMenu(player)
  349. end
  350.  
  351.  
  352. if (intid == 34) then
  353.     player:SetModel(16125)
  354.         Unit:GossipCreateMenu(100, player, 0)
  355.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  356.         Unit:GossipSendMenu(player)
  357. end
  358.  
  359.  
  360. if (intid == 35) then
  361.     player:SetModel(51)
  362.         Unit:GossipCreateMenu(100, player, 0)
  363.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  364.         Unit:GossipSendMenu(player)
  365. end
  366.  
  367.  
  368. if (intid == 36) then
  369.     player:SetModel(51)
  370.         Unit:GossipCreateMenu(100, player, 0)
  371.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  372.         Unit:GossipSendMenu(player)
  373. end
  374.  
  375.  
  376. if (intid == 37) then
  377.     player:SetModel(57)
  378.         Unit:GossipCreateMenu(100, player, 0)
  379.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  380.         Unit:GossipSendMenu(player)
  381. end
  382.  
  383.  
  384. if (intid == 38) then
  385.     player:SetModel(57)
  386.         Unit:GossipCreateMenu(100, player, 0)
  387.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  388.         Unit:GossipSendMenu(player)
  389. end
  390.  
  391.  
  392. if (intid == 39) then
  393.     player:SetModel(1478)
  394.         Unit:GossipCreateMenu(100, player, 0)
  395.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  396.         Unit:GossipSendMenu(player)
  397. end
  398.  
  399.  
  400. if (intid == 40) then
  401.     player:SetModel(1478)
  402.         Unit:GossipCreateMenu(100, player, 0)
  403.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  404.         Unit:GossipSendMenu(player)
  405. end
  406.  
  407.  
  408. if (intid == 41) then
  409.     player:SetModel(59)
  410.         Unit:GossipCreateMenu(100, player, 0)
  411.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  412.         Unit:GossipSendMenu(player)
  413. end
  414.  
  415. if (intid == 42) then
  416.     player:SetModel(59)
  417.         Unit:GossipCreateMenu(100, player, 0)
  418.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  419.         Unit:GossipSendMenu(player)
  420. end
  421.  
  422. if (intid == 43) then
  423.     player:SetModel(15476)
  424.         Unit:GossipCreateMenu(100, player, 0)
  425.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  426.         Unit:GossipSendMenu(player)
  427. end
  428.  
  429.  
  430. if (intid == 44) then
  431.     player:SetModel(15476)
  432.         Unit:GossipCreateMenu(100, player, 0)
  433.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  434.         Unit:GossipSendMenu(player)
  435. end
  436.  
  437.  
  438. if (intid == 45) then
  439.     player:SetModel(30616)
  440.         Unit:GossipCreateMenu(100, player, 0)
  441.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  442.         Unit:GossipSendMenu(player)
  443. end
  444.  
  445.  
  446. if (intid == 46) then
  447.     player:SetModel(10970)
  448.         Unit:GossipCreateMenu(100, player, 0)
  449.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  450.         Unit:GossipSendMenu(player)
  451. end
  452.  
  453.  
  454. if (intid == 47) then
  455.     player:SetModel(30713)
  456.         Unit:GossipCreateMenu(100, player, 0)
  457.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  458.         Unit:GossipSendMenu(player)
  459. end
  460.  
  461.  
  462. if (intid == 48) then
  463.     player:SetModel(31025)
  464.         Unit:GossipCreateMenu(100, player, 0)
  465.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  466.         Unit:GossipSendMenu(player)
  467. end
  468.  
  469. if (intid == 49) then
  470.     player:SetModel(26919)
  471.         Unit:GossipCreateMenu(100, player, 0)
  472.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  473.         Unit:GossipSendMenu(player)
  474. end
  475.  
  476.  
  477. if (intid == 50) then
  478.     player:SetModel(26787)
  479.         Unit:GossipCreateMenu(100, player, 0)
  480.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  481.         Unit:GossipSendMenu(player)
  482. end
  483.  
  484. if (intid == 51) then
  485.     player:SetModel(657)
  486.         Unit:GossipCreateMenu(100, player, 0)
  487.         Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
  488.         Unit:GossipSendMenu(player)
  489.         player:GossipComplete()
  490. end
  491.  
  492.  
  493.  
  494. -- RegisterUnitEvents
  495. RegisterUnitGossipEvent(50033, 1, "GossipOnTalk")
  496. RegisterUnitGossipEvent(50033, 2, "GossipOnSelect")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement