Advertisement
jackpoz

Untitled

Sep 16th, 2011
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.44 KB | None | 0 0
  1. crashUnit = nil
  2. crashGo = nil
  3. scaleGo = nil
  4.  
  5. function Crash_OnGossip(Unit, event, player)
  6.         Unit:GossipCreateMenu(100, player, 0)
  7.         Unit:GossipMenuAddItem( 0, "Test chat msg", 1, 0)
  8.         Unit:GossipMenuAddItem( 0, "Crash Part 1", 2, 0)
  9.         Unit:GossipMenuAddItem( 0, "Crash Part 2", 3, 0)
  10.         Unit:GossipMenuAddItem( 0, "Lock", 4, 0)
  11.         Unit:GossipMenuAddItem( 0, "Unlock", 5, 0)
  12.         Unit:GossipMenuAddItem( 0, "TestMail", 6, 0)
  13.         Unit:GossipMenuAddItem( 0, "Spawn Go for scale", 7, 0)
  14.         Unit:GossipMenuAddItem( 0, "Rescale Go", 8, 0)
  15.         Unit:GossipMenuAddItem( 0, "GetTeam", 9, 0)
  16.         Unit:GossipMenuAddItem( 0, "Unit:SendChatMessageToPlayer", 10, 0)
  17.         Unit:GossipMenuAddItem( 0, "Player:SendChatMessageToPlayer", 11, 0)
  18.         Unit:GossipMenuAddItem( 0, "Test Spawns", 12, 0)
  19.         Unit:GossipSendMenu(player)
  20. end
  21.  
  22. function Crash_OnSelect(Unit, event, player, id, intid, code, pMisc)
  23.     if (intid == 1) then
  24.         Unit:SendChatMessage(12, 0, "This is a chat msg. Lua script loaded and working.", 0)
  25.         player:GossipComplete()
  26.     end
  27.     if (intid == 2) then
  28.         Unit:SendChatMessage(12, 0, "Choose Crash Part 2 to crash arcemu. Hold tight!", 0)
  29.         player:GossipComplete()
  30.         crashUnit = Unit:SpawnCreature(1126, player:GetX(), player:GetY(), player:GetZ(), player:GetO(), 56, 1)-- despawn after 1 ms
  31.         crashGo = Unit:SpawnGameObject(194569, player:GetX(), player:GetY(), player:GetZ(), player:GetO(), 1, 19)--despawn after 1 ms
  32.     end
  33.     if (intid == 3) then
  34.         Unit:FullCastSpellOnTarget(57652, crashUnit) -- Crashing Wave spell
  35.         Unit:FullCastSpellOnTarget(57652, crashGo) -- Crashing Wave spell
  36.         Unit:SendChatMessage(12, 0, "Did you see this msg? Nice, no crash!", 0)
  37.         player:GossipComplete()
  38.         crashUnit = nil
  39.         crashGo = nil
  40.     end
  41.     if (intid == 4) then
  42.         Unit:SendChatMessage(12, 0, "Locking", 0)
  43.         player:SetPlayerLock(1);
  44.         player:GossipComplete()
  45.     end
  46.     if (intid == 5) then
  47.         Unit:SendChatMessage(12, 0, "Unlocking", 0)
  48.         player:SetPlayerLock(0);
  49.         player:GossipComplete()
  50.     end
  51.     if (intid == 6) then
  52.         Unit:SendChatMessage(12, 0, "Sending a mail", 0)
  53.         SendMail(3, Unit:GetGUID(), player:GetGUID(), "Test Mail", "Testing mail system", 0, 0, 0, 1);
  54.         player:GossipComplete()
  55.     end
  56.     if (intid == 7) then
  57.         Unit:SendChatMessage(12, 0, "Spawning a GO", 0)
  58.         scaleGo = Unit:SpawnGameObject(194569, player:GetX(), player:GetY(), player:GetZ(), player:GetO(), 0, 19)
  59.         player:GossipComplete()
  60.     end
  61.     if (intid == 8) then
  62.         if(scaleGo ~= nil) then
  63.             Unit:SendChatMessage(12, 0, "Scaling the GO", 0)
  64.             scaleGo:ChangeScale(2.0);
  65.             player:GossipComplete()
  66.         end
  67.     end
  68.     if (intid == 9) then
  69.         Unit:SendChatMessage(12, 0, "Team: "..player:GetTeam(), 0)
  70.         player:GossipComplete()
  71.     end
  72.     if (intid == 10) then
  73.         Unit:SendChatMessageToPlayer(8, 0, "Unit sending a chat msg", player)
  74.         player:GossipComplete()
  75.     end
  76.     if (intid == 11) then
  77.         player:SendChatMessageToPlayer(7, 0, "Player sending a chat message", player)
  78.         player:GossipComplete()
  79.     end
  80.     if (intid == 12) then
  81.         player:SendChatMessageToPlayer(7, 0, "Spawning a GO and a Creature", player)
  82.         Unit:SpawnGameObject(194569, player:GetX() + 1, player:GetY() + 1, player:GetZ() + 1, player:GetO(), 15000, 20, 1, 0)
  83.         Unit:SpawnCreature(1126, player:GetX() - 1, player:GetY() - 1, player:GetZ(), player:GetO(), 56, 15000, 0, 0, 0, 1, 1)
  84.         player:GossipComplete()
  85.     end
  86. end
  87.    
  88. RegisterUnitGossipEvent(1000, 1, Crash_OnGossip)
  89. RegisterUnitGossipEvent(1000, 2, Crash_OnSelect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement