Advertisement
Rochet2

Original lua help

Jan 26th, 2014
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.26 KB | None | 0 0
  1. local SAY_WILLIX_START   = "Woo hoo! Finally getting out of here. It's going to be rough though. Keep your eyes peeled for trouble."
  2. local SAY_WILLIX_1       = "Up there is where Charlga Razorflank resides. Blasted old crone."
  3. local SAY_WILLIX_2       = "There's blueleaf tuber in this trench! It's like gold waiting to be mined I tell you!"
  4. local SAY_WILLIX_3       = "There could be danger around every corner here."
  5. local SAY_WILLIX_4       = "I don't see how these foul animals live in this place... sheesh it smells!"
  6. local SAY_WILLIX_5       = "I think I see a way for us to get out of this big twisted mess of a bramble."
  7. local SAY_WILLIX_6       = "Glad to be out of that wretched trench. Not much nicer up here though!"
  8. local SAY_WILLIX_7       = "Finally! I'll be glad to get out of this place."
  9. local SAY_WILLIX_END     = "I think I'll rest a moment and catch my breath before heading back to Ratchet. Thanks for all the help!"
  10.  
  11. local RAGING_AGAMAR    = 4514
  12. local NPC_WILLIX       = 4508
  13.  
  14.  
  15. local T = {}
  16. local currentWP = 0
  17. local WILLIX_Waypoints =
  18. {
  19. {0, 2194.38, 1791.65, 65.48},
  20. {1, 2188.56, 1805.87, 64.45},
  21. {2, 2186.2, 1836.28, 59.859},
  22. {3, 2163.27, 1851.67, 56.73},
  23. {4, 2140.22, 1845.02, 48.32},
  24. {5, 2131.5, 1804.29, 46.85},
  25. {6, 2096.18, 1789.03, 51.13},
  26. {7, 2074.46, 1780.09, 55.64},
  27. {8, 2055.12, 1768.67, 58.46},
  28. {9, 2037.83, 1748.62, 60.27},
  29. {10, 2037.51, 1728.94, 60.85},
  30. {11, 2044.7, 1711.71, 59.71},
  31. {12, 2067.66, 1701.84, 57.77},
  32. {13, 2078.91, 1704.54, 56.77},
  33. {14, 2097.65, 1715.24, 54.74},
  34. {15, 2106.44, 1720.98, 54.41},
  35. {16, 2123.96, 1732.56, 52.27},
  36. {17, 2153.82, 1728.73, 51.92},
  37. {18, 2163.49, 1706.33, 54.42},
  38. {19, 2158.75, 1695.98, 55.7},
  39. {20, 2142.6, 1680.72, 58.24},
  40. {21, 2118.31, 1671.54, 59.21},
  41. {22, 2086.02, 1672.04, 61.24},
  42. {23, 2068.81, 1658.93, 61.24},
  43. {24, 2062.82, 1633.31, 64.35},
  44. {25, 2060.92, 1600.11, 62.41},
  45. {26, 2063.05, 1589.16, 63.26},
  46. {27, 2063.67, 1577.22, 65.89},
  47. {28, 2057.94, 1560.68, 68.4},
  48. {29, 2052.56, 1548.05, 73.35},
  49. {30, 2045.22, 1543.4, 76.65},
  50. {31, 2034.35, 1543.01, 79.7},
  51. {32, 2029.95, 1542.94, 80.79},
  52. {33, 2021.34, 1538.67, 80.8},
  53. {34, 2012.45, 1549.48, 79.93},
  54. {35, 2008.05, 1554.92, 80.44},
  55. {36, 2006.54, 1562.72, 81.11},
  56. {37, 2003.8, 1576.43, 81.57},
  57. {38, 2000.57, 1590.06, 80.62},
  58. {39, 1998.96, 1596.87, 80.22},
  59. {40, 1991.19, 1600.82, 79.39},
  60. {41, 1980.71, 1601.44, 79.77},
  61. {42, 1967.22, 1600.18, 80.62},
  62. {43, 1956.43, 1596.97, 81.75},
  63. {44, 1954.87, 1592.02, 82.18},
  64. {45, 1948.35, 1571.35, 80.96},
  65. {46, 1947.02, 1566.42, 81.8}
  66. }
  67.  
  68. -- EVENTS:
  69. function WILLIX_OnQuestAccept(event, player, creature, quest)
  70.         creature:SetWalk(0)
  71.         creature:SetSpeed(3, 1)
  72.         creature:SetFaction(10) -- 69
  73.         creature:SendUnitSay(SAY_WILLIX_START, 0)
  74.         creature:MoveTo(0, 2188.56, 1805.87, 64.45)    
  75. --      creature:SetNPCFlags(0)
  76. end    
  77.  
  78. function WILLIX_OnReachWP(event, creature, pointType, waypointId)
  79. T[creature:GetGUIDLow()] = currentWP+1;
  80.         if (waypointId == 0) then
  81.             creature:RegisterEvent(WILLIX_OnMove, 0, 1)
  82.         elseif (waypointId == 2) then
  83.                 creature:Emote(1)
  84.                 creature:SendUnitSay(SAY_WILLIX_1, 0) -- Point Emote
  85.             creature:RegisterEvent(WILLIX_OnMove, 5000, 1)    
  86.         elseif (waypointId == 6) then
  87.                 creature:Emote(1)
  88.                 creature:SendUnitSay(SAY_WILLIX_2, 0)
  89.             creature:RegisterEvent(WILLIX_OnMove, 0, 1)
  90.         elseif (waypointId == 8) then
  91.                 creature:Emote(1)
  92.                 creature:SendUnitSay(SAY_WILLIX_3, 0)
  93.             creature:RegisterEvent(WILLIX_OnMove, 0, 1)
  94.         elseif (waypointId == 14) then
  95.                 creature:Emote(1)
  96.                 creature:SendUnitSay(SAY_WILLIX_4, 0)
  97.             creature:RegisterEvent(WILLIX_OnMove, 0, 1)
  98.         elseif (waypointId == 15) then
  99.                 local AGAMAR1 = creature:SpawnCreature(RAGING_AGAMAR, 2166.330, 1718.457, 53.368, 0.647, 3, 25000)
  100.                 local AGAMAR2 = creature:SpawnCreature(RAGING_AGAMAR, 2157.686, 1717.527, 52.591, 1.040, 3, 25000)
  101.                         AGAMAR1:AttackStart(creature)
  102.                         AGAMAR2:AttackStart(creature)  
  103.                 creature:RegisterEvent(WILLIX_OnMove, 0, 1)                            
  104.         elseif (waypointId == 25) then
  105.                 creature:Emote(1)
  106.                 creature:SendUnitSay(SAY_WILLIX_5, 0)
  107.             creature:RegisterEvent(WILLIX_OnMove, 3000, 1)            
  108.         elseif (waypointId == 33) then
  109.                 creature:Emote(1)
  110.                 creature:SendUnitSay(SAY_WILLIX_6, 0)
  111.             creature:RegisterEvent(WILLIX_OnMove, 0, 1)
  112.         elseif (waypointId == 44) then
  113.                 creature:Emote(1)
  114.                 creature:SendUnitSay(SAY_WILLIX_7, 0)
  115.                         local AGAMAR3 = creature:SpawnCreature(RAGING_AGAMAR, 1964.465, 1602.200, 81.008, 3.818, 3, 25000)
  116.                         local AGAMAR4 = crweature:SpawnCreature(RAGING_AGAMAR, 1962.268, 1597.519, 81.307, 3.995, 3, 25000)
  117.                                 AGAMAR3:AttackStart(creature)
  118.                                 AGAMAR4:AttackStart(creature)  
  119.             creature:RegisterEvent(WILLIX_OnMove, 3000, 1)
  120.         elseif (waypointId == 45) thend
  121.                 creature:SendUnitSay(SAY_WILLIX_END, 0)
  122.         else
  123.             creature:RegisterEvent(WILLIX_OnMove, 0, 1)
  124.         end
  125. end    
  126.  
  127.  
  128. -- MECHANICAL:
  129. function WILLIX_OnMove(event, delay, pCall, creature)
  130.         creature:SendUnitSay(T[creature:GetGUIDLow()], 0) -- DEBUG ONLY, Prints " 1 "
  131.     for k,_ in ipairs(WILLIX_Waypoints) do
  132.         if (WILLIX_Waypoints[k][1] == T[creature:GetGUIDLow()]) then
  133.             creature:MoveTo(WILLIX_Waypoints[k][1], WILLIX_Waypoints[k][2],WILLIX_Waypoints[k][3], WILLIX_Waypoints[k][4])
  134.         end
  135.     end
  136. end
  137.  
  138. function WILLIX_OnEmote(event, creature, player, emoteid)
  139.                         creature:SendUnitYell("Test",0)
  140.         local AGAMAR1 = creature:SpawnCreature(RAGING_AGAMAR, 2188.364, 1842.793, 59.498, 4.762, 3, 25000)
  141.                                 AGAMAR1:AttackStart(creature)
  142. end    
  143.  
  144. -- REGISTRY:
  145. RegisterCreatureEvent(NPC_WILLIX, 6, WILLIX_OnReachWP)
  146. RegisterCreatureEvent(NPC_WILLIX, 8, WILLIX_OnEmote)
  147. RegisterCreatureEvent(NPC_WILLIX, 31, WILLIX_OnQuestAccept)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement