Advertisement
Rochet2

Some custom start script

Sep 20th, 2011
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.56 KB | None | 0 0
  1. local Cinema = {}
  2. Cinema.Gossiper = 90091
  3. Cinema.Nicolas  = 99902
  4. Cinema.Dummy    = 99903
  5.  
  6. function Cinema.Cinematic_OnGossip(pUnit, event, player)
  7.      pUnit:GossipCreateMenu(100, player, 0)
  8.      pUnit:GossipMenuAddItem(0, "Hello Soldier, Begin Your Journey Here ..", 100, 0)
  9.      pUnit:GossipSendMenu(player)
  10. end
  11.  
  12. function Cinema.Cinematic_OnGossipSubMenus(pUnit, event, player, id, intid, code)
  13.     if (intid == 100) then
  14.         pUnit:RemoveEvents()
  15.         pUnit:SetNPCFlags(2)
  16.         pUnit:RegisterEvent(Cinema.Cinematic_Phase1, 1000, 1)
  17.     end
  18.     player:GossipComplete()
  19. end
  20.  
  21. RegisterUnitGossipEvent(Cinema.Gossiper, 1, Cinema.Cinematic_OnGossip)
  22. RegisterUnitGossipEvent(Cinema.Gossiper, 2, Cinema.Cinematic_OnGossipSubMenus)
  23.  
  24. function Cinema.Cinematic_Phase1(pUnit, event)
  25.     pUnit:SendChatMessage(12, 0, "Welcome to Universe-WoW. Here Is Where You Will Make Yourself The Warrior That You Want To Become.")
  26.     pUnit:RegisterEvent(Cinema.Cinematic_Phase2, 6000, 1)
  27. end
  28.  
  29. function Cinema.Cinematic_Phase2(pUnit, event)
  30.     pUnit:SendChatMessage(12, 0, "Remember That The Path You Choose Is Bound. You Only Get 1 Choice, So Be Wise In Your Choosing.")
  31.     pUnit:RegisterEvent(Cinema.Cinematic_Phase3, 6000, 1)
  32. end
  33.  
  34. function Cinema.Cinematic_Phase3(pUnit, event)
  35.     pUnit:SendChatMessage(12, 0, "Come with me....")
  36.     local x, y, z, o = pUnit:GetX(), pUnit:GetY(), pUnit:GetZ(), pUnit:GetO()
  37.     pUnit:MoveTo(x - 36, y + 14, z + 0, o)
  38.     pUnit:RegisterEvent(Cinema.Gossiper_Speech1, 4500, 1)
  39. end
  40.  
  41. function Cinema.Gossiper_Speech1(pUnit, event)
  42.     pUnit:SendChatMessage(12, 0, "Here on Universe-WoW, We Want You To Work For Your Reputation.")
  43.     pUnit:Emote(1, 100)
  44.     pUnit:RegisterEvent(Cinema.Gossiper_Speech2, 4500, 1)
  45. end
  46.  
  47. function Cinema.Gossiper_Speech2(pUnit, event)
  48.     pUnit:SendChatMessage(12, 0, "Nothing Here Will Be Handed To You. You Will Have To Earn Your Way To The Top.")
  49.     pUnit:Emote(1, 100)
  50.     pUnit:RegisterEvent(Cinema.Gossiper_Speech3, 4500, 1)
  51. end
  52.  
  53. function Cinema.Gossiper_Speech3(pUnit, event)
  54.     pUnit:SendChatMessage(12, 0, "You Will Encounter Many Obstacles, But You Must Overcome Those Obstacles To Achieve Your Goal To Be The Best.")
  55.     pUnit:Emote(1, 100)
  56.     pUnit:RegisterEvent(Cinema.Cinematic_Phase4, 6000, 1)
  57. end
  58.  
  59. function Cinema.Cinematic_Phase4(pUnit, event)
  60.     pUnit:SendChatMessage(14, 0, "KEEP TRAINING MEN !! STOP SLACKING YOU PEASANTS !")
  61.     local x, y, z, o = pUnit:GetX(), pUnit:GetY(), pUnit:GetZ(), pUnit:GetO()
  62.     pUnit:MoveTo(x - 50, y - 10, z - 5, o)
  63.     pUnit:RegisterEvent(Cinema.Gossiper_Speech5, 5000, 1)
  64. end
  65.  
  66. function Cinema.Gossiper_Speech5(pUnit, event)
  67.     pUnit:SendChatMessage(12, 0, "To Your Right, You Will See The PVP Boat. If You Choose To Go With The Gladiator Path(PVP), Then You Must Go There...")
  68.     pUnit:Emote(1, 100)
  69.     pUnit:RegisterEvent(Cinema.Gossiper_Speech6, 6000, 1)
  70. end
  71.  
  72. function Cinema.Gossiper_Speech6(pUnit, event)
  73.     pUnit:SendChatMessage(12, 0, "To Your Left, You Will See The PVE Boat. If You Choose To Go With The Warrior Path(PVE), Then You Must Go There.")
  74.     pUnit:Emote(1, 100)
  75.     pUnit:RegisterEvent(Cinema.Gossiper_Speech7, 6000, 1)
  76. end
  77.  
  78. function Cinema.Gossiper_Speech7(pUnit, event)
  79.     pUnit:SendChatMessage(12, 0, "I Have Now Placed The Men You Need To Speak With On The Ships. You May Now Go And Choose Your Path.")
  80.     pUnit:Emote(1, 100)
  81.     pUnit:RegisterEvent(Cinema.Cinematic_Phase5, 5000, 1)
  82. end
  83.  
  84. function Cinema.Cinematic_Phase5(pUnit, event)
  85.     pUnit:SendChatMessage(12, 0, "Good Luck In Your Journies Soldier.")
  86.     pUnit:SpawnCreature(Cinema.Nicolas, -11539.008789, -4567.151855, 9.302907, 4.762055, 35, 0)
  87.     pUnit:SpawnCreature(Cinema.Dummy, -11582.299805, -4805.240234, 10.704400, 2.328890, 35, 0)
  88.     pUnit:RegisterEvent(Cinema.Gossiper_Despawn, 3000, 1)
  89. end
  90.  
  91. function Cinema.Gossiper_Despawn(pUnit, event)
  92.     -- Not needed if Despawn has time pUnit:SpawnCreature(Cinema.Gossiper, -11459.845703, -4686.315918, 8.566786, 2.729703, 35, 0)
  93.     --[[ I dont understand what this is for and the rest of the script wont work.
  94.     Why despawn Nicolas couple seconds after spawning him??
  95.     pUnit:RegisterEvent(Cinema.Nicolas_Despawn2, 4500, 1)
  96.     ]]
  97.     pUnit:RemoveEvents()
  98.     pUnit:SetPhase(2) --Setting phase instead and desp resp later, so no need for spawn a new one on reset pUnit:Despawn(4500, 0)
  99. end
  100.  
  101. --[[ Commented out couse of above
  102. function Cinema.Nicolas_Despawn2(pUnit, event)
  103.     pUnit:SendChatMessage(14, 0, "Test to see if this works..")
  104.     if(Nicolass ~= nil) then
  105.         Nicolas:Despawn(4500, 0)
  106.         Nicolas:RegisterEvent(Cinema.Dummy_OnGossipSubMenus, 1000, 1)
  107.     else
  108.         pUnit:SendChatMessage(12, 0, "Error! "..Cinema.Nicolas.." NPC not found near.")
  109.     end
  110. end
  111. ]]
  112.  
  113. function Cinema.Dummy_OnGossip(pUnit, event, player)
  114.     pUnit:GossipCreateMenu(100, player, 0)
  115.     pUnit:GossipMenuAddItem(0, "Dummy test item", 100, 0)
  116.     pUnit:GossipSendMenu(player)
  117. end
  118.  
  119. function Cinema.Dummy_OnGossipSubMenus(pUnit, event, player, id, intid, code)
  120.     if (intid == 100) then
  121.         pUnit:SetNPCFlags(2)
  122.         pUnit:RegisterEvent(Cinema.Dummy_ScriptReset, 3000, 1)
  123.     end
  124.     player:GossipComplete()
  125. end
  126.  
  127. function Cinema.Dummy_ScriptReset(pUnit, event)
  128.     --What was this for? pUnit:SetNPCFlags(1)
  129.     local x, y, z = pUnit:GetX(), pUnit:GetY(), pUnit:GetZ()
  130.     local Nicolas = pUnit:GetCreatureNearestCoords(x, y, z, Cinema.Nicolas)
  131.     if (Nicolas ~= nil) then
  132.         Nicolas:Despawn(0, 0)
  133.     else
  134.         pUnit:SendChatMessage(14, 0, "Error! Nicolas was nil")
  135.     end
  136.     local Gossiper = pUnit:GetCreatureNearestCoords(x, y, z, Cinema.Gossiper)
  137.     if (Gossiper ~= nil) then
  138.         Gossiper:SetNPCFlags(1)
  139.         Gossiper:Despawn(0, 1000)
  140.         Gossiper:SetPhase(1)
  141.     else
  142.         pUnit:SendChatMessage(14, 0, "Error! Gossiper was nil")
  143.     end
  144.     pUnit:Despawn(0, 0)
  145. end
  146.  
  147. RegisterUnitGossipEvent(Cinema.Dummy, 1, Cinema.Dummy_OnGossip)
  148. RegisterUnitGossipEvent(Cinema.Dummy, 2, Cinema.Dummy_OnGossipSubMenus)
  149.  
  150. -- The registerevent wont work for the NPCs whithout these:
  151. RegisterUnitEvent(Cinema.Gossiper, 18, function() return; end)
  152. RegisterUnitEvent(Cinema.Nicolas, 18, function() return; end)
  153. RegisterUnitEvent(Cinema.Dummy, 18, function() return; end)
  154.  
  155. --[[
  156. -- Old unused (removed) code. Made them all be declared in the script locally
  157.  
  158.  
  159. local Gossiper;
  160. local Nicolas;
  161. local Dummy;
  162.  
  163. function Cinema.Gossiper_OnSpawn(pUnit, event)
  164.     Gossiper = pUnit
  165. end
  166.  
  167. function Cinema.Nicolas_OnSpawn(pUnit, event)
  168.     Nicolas = pUnit
  169. end
  170.  
  171. function Cinema.Dummy_OnSpawn(pUnit, event)
  172.     Dummy = pUnit
  173. end
  174.  
  175. RegisterUnitEvent(90091, 18, "Gossiper_OnSpawn")
  176. RegisterUnitEvent(99902, 18, "Nicolas_OnSpawn")
  177. RegisterUnitEvent(99903, 18, "Dummy_OnSpawn")
  178. ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement