Вход для пользователей

[ Новые сообщения · Участники · Правила форума · Поиск · RSS ]
  • Страница 1 из 1
  • 1
[Lua]Simple Teleporter(First Script)
Дата: Четверг, 29.04.2010, 17:25 | Сообщение # 1
Аватар

VIP Статус:
Группа: Администратор
Сообщений: 3088
Награды: 48
Репутация: 215  
 
my first ever Lua script,sorry that it is an teleporter though it was a good thing to start with for me.

Please share any bugs/errors you discover.

http://pastebin.com/48dDJSar

Code
--[[
My First Gossip Script!
Made by Twistelf
Thanks Neglected for the Tut.
]]

-- Variables

local NPC_ID = 40000    -- change this to your own npc entry id please!
local Mall_MapID = 0    -- change this to your mall mapID please!
local Mall_X = -6805.926270   -- change this to your mall x co-ord please!
local Mall_Y = -4163.295410   -- change this to your mall y co-ord please!
local Mall_Z = 268.132385   -- change this to your mall z co-ord please!
local mounts_1 = {48778, 60025, 43688, 16056, 66906, 63844, 67466, 66907, 61230, 60114, 60116, 61229, 59567, 40192, 41514, 51412, 58983, 71342, 22719, 59650, 35022, 16055, 59976, 26656, 17461, 64977, 470, 60118, 48027, 22718, 59785, 22720, 22721, 22717, 22723, 22724, 64658, 72808, 61996, 59568, 35020, 10969, 59996, 25953, 39803, 17463, 64656, 32244, 50869, 43899, 59569, 34406, 458, 18990, 6899, 17464, 6654, 58615, 43927, 23214, 6648, 41515, 39315, 34896, 73313, 68188, 68187, 39316, 34790, 63635, 63637, 64927, 6653, 23161, 32239, 8395, 63639, 5784, 36702, 61451, 44153, 63643, 17460, 23509, 65439, 63638, 32235, 61465, 61469, 35710, 18989, 6777, 35713, 49379, 23249, 65641}
local mounts_2 = {23248, 35712, 35714, 563723247, 18991, 17453, 61294, 26056, 39798, 17465, 32245, 48025, 59797, 72807, 17459, 72286, 63956, 63636, 17450, 65917, 61309, 60424, 44744, 63796, 16084, 66846, 41513, 69395, 63640, 16082, 32345, 472, 60021, 35711, 35018, 41516, 39801, 23246, 66090, 41252, 61997, 59570, 34795, 10873, 59961, 26054, 39800, 17462, 22722, 16080, 67336, 30174, 17481, 63963, 64731, 66087, 39802, 39317, 34898, 63642, 32240, 42276, 10789, 23510, 63232, 66847, 8394, 10793, 34769, 66088, 66091, 68057, 32242, 23241, 43900, 23238, 23229, 23250, 65646,23221, 23239, 65640, 23252, 32290, 35025, 23225, 32295, 68056, 23219, 65638, 37015, 23242, 23243, 23227}
local mounts_3 = {33660, 32292, 35027, 65644, 32297, 24242, 32289, 65639, 32246, 42777, 23338, 23251, 65643, 35028, 46628, 23223, 23240, 23228, 23222, 32296, 49322, 24252, 39318, 34899, 32243, 18992, 63641, 580, 60002, 61425, 44151, 65642, 10796, 59571, 17454, 49153, 64659, 41517, 41518, 17454, 49193, 64659, 41517, 41518, 60024, 10799, 64657, 15779, 54753, 6898, 39319, 65645, 16083, 34897, 54729, 16081, 17229, 59791, 71810, 46197, 46199, 26055}

-- On Triggers
function GossipOnTalk(Unit,Event,player)
Unit:GossipCreateMenu(100, player, 0)
Unit:GossipMenuAddItem(2, "Mall Teleport.", 1, 0)
Unit:GossipMenuAddItem(2, "Alliance and Horde Major City's.", 2, 0)
Unit:GossipMenuAddItem(2, "Neutral City's", 3, 0)
Unit:GossipMenuAddItem(3, "Buffz up!", 4, 0)
Unit:GossipMenuAddItem(4, "Taxi Vendor.", 14, 0)
Unit:GossipMenuAddItem(4, "Advance Weapon Skillz", 16, 0)
Unit:GossipMenuAddItem(4, "Learn Riding/Flying.", 15, 0)
Unit:GossipMenuAddItem(0, "Never mind.", 5, 0)
Unit:GossipSendMenu(player)
end

function GossipOnSelect(Unit, Event, player, id, intid, code, pMisc)
if (intid == 1) then
player:Teleport(Mall_MapID, Mall_X, Mall_Y, Mall_Z)
player:GossipComplete()
end
if (intid == 2) then
Unit:GossipCreateMenu(100, player, 50)
Unit:GossipMenuAddItem(2, "Stormwind", 6, 0)
Unit:GossipMenuAddItem(2, "Ironforge", 7, 0)
Unit:GossipMenuAddItem(2, "Darnassus", 8, 0)
Unit:GossipMenuAddItem(2, "Exodar", 9, 0)
Unit:GossipMenuAddItem(1, "Orgrimmar", 10, 0)
Unit:GossipMenuAddItem(1, "The Undercity", 11, 0)
Unit:GossipMenuAddItem(1, "Thunder Bluff", 12, 0)
Unit:GossipMenuAddItem(1, "Silvermoon", 13, 0)
Unit:GossipSendMenu(player)
end
if (intid == 3) then
Unit:GossipCreateMenu(100, player, 300)
Unit:GossipMenuAddItem(2, "Dalaran", 30, 0)
Unit:GossipMenuAddItem(2, "Shattrath", 31, 0)
Unit:GossipMenuAddItem(2, "Booty Bay", 32, 0)
Unit:GossipMenuAddItem(2, "Gadgetzan", 33, 0)
Unit:GossipMenuAddItem(2, "Ratchet", 34, 0)
Unit:GossipSendMenu(player)
end
if (intid == 17) then
Unit:GossipCreateMenu(100, player, 1700)
Unit:GossipMenuAddItem(2, "Fight !", 1701, 0)
Unit:GossipMenuAddItem(0, "Still under construction....", 1702, 0)
Unit:GossipSendMenu(player)
end
if (intid == 30) then
player:Teleport(571, 5811.4067, 647.7883, 647.4152)
player:GossipComplete()
end
if (intid == 31) then
player:Teleport(530, -1849.4200, 5401.4599, -12.4279)
player:GossipComplete()
end
if (intid == 32) then
player:Teleport(0, -14284.9, 557.354, 8.841)
player:GossipComplete()
end
if (intid == 33) then
player:Teleport(1, -7124.13, -3818.93, 8.4107)
player:GossipComplete()
end
if (intid == 34) then
player:Teleport(1, -994.248, -3830.1, 7)
end
if (intid == 4) then
Unit:CastSpellOnTarget(25898, player)
Unit:CastSpellOnTarget(48469, player)
Unit:CastSpellOnTarget(48073, player)
Unit:CastSpellOnTarget(58451, player)
Unit:CastSpellOnTarget(58449, player)
Unit:CastSpellOnTarget(48102, player)
Unit:CastSpellOnTarget(58453, player)
player:SendBroadcastMessage("Ye Da BuffZorZ Are Up!")
player:GossipComplete()
end
if (intid == 6) then
player:Teleport(0, -9100.480469, 406.950745, 92.594185)
player:GossipComplete()
end
if (intid == 7) then
player:Teleport(0, -5028.265137, -825.976563, 495.301575)
player:GossipComplete()
end
if (intid == 8) then
player:Teleport(1, 9985.907227, 1971.155640, 1326.815674)
player:GossipComplete()
end
if (intid == 9) then
player:Teleport(530, -4072.202393, -12014.337891, -1.277277)
player:GossipComplete()
end
if (intid == 10) then
player:Teleport(1, 1371.068970, -4370.801758, 26.052483)
player:GossipComplete()
end
if (intid == 11) then
player:Teleport(0, 2050.203125, 285.650604, 56.994549)
player:GossipComplete()
end
if (intid == 12) then
player:Teleport(1, -1304.569946, 205.285004, 68.681396)
player:GossipComplete()
end
if (intid == 13) then
player:Teleport(530, 9400.486328, -7278.376953, 14.206780)
player:GossipComplete()
end

if (intid == 14) then
Unit:VendorAddItem(52021, 1000, 0)
Unit:VendorAddItem(52020, 1000, 0)
Unit:VendorAddItem(51809, 1, 0)
Unit:VendorAddItem(21177, 100, 0)
Unit:VendorAddItem(5178, 1, 0)
Unit:VendorAddItem(17030, 10, 0)
Unit:VendorAddItem(17020, 100, 0)
Unit:VendorAddItem(17036, 10, 0)
Unit:VendorAddItem(37201, 20, 0)
Unit:VendorAddItem(16583, 5, 0)
Unit:VendorAddItem(44615, 20, 0)
Unit:VendorAddItem(5175, 1, 0)
Unit:VendorAddItem(5176, 1, 0)
Unit:VendorAddItem(17058, 20, 0)
Unit:VendorAddItem(22147, 20, 0)
Unit:VendorAddItem(17028, 20, 0)
Unit:VendorAddItem(17037, 20, 0)
Unit:VendorAddItem(5565, 5, 0)
Unit:VendorAddItem(6265, 1, 0)
Unit:VendorAddItem(21177, 100, 0)
Unit:VendorAddItem(17032, 20, 0)
Unit:VendorAddItem(17031, 20, 0)
Unit:VendorAddItem(5177, 1, 0)
Unit:VendorAddItem(44605, 20, 0)
Unit:VendorAddItem(21176, 1, 0)
Unit:VendorAddItem(33809, 1, 0)
Unit:VendorAddItem(47179, 1, 0)
Unit:VendorAddItem(47180, 1, 0)
Unit:VendorAddItem(49282, 1, 0)
Unit:VendorAddItem(50250, 1, 0)
Unit:VendorAddItem(13335, 1, 0)
Unit:VendorAddItem(30480, 1, 0)
Unit:VendorAddItem(37828, 1, 0)
Unit:VendorAddItem(49290, 1, 0)
Unit:VendorAddItem(46109, 1, 0)
Unit:VendorAddItem(33189, 1, 0)
Unit:VendorAddItem(37011, 1, 0)
Unit:VendorAddItem(32458, 1, 0)
Unit:VendorAddItem(44843, 1, 0)
Unit:VendorAddItem(25596, 1, 0)
Unit:VendorAddItem(46171, 1, 0)
player:SendVendorWindow(Unit)
player:GossipComplete()
end

if (intid == 15) then
player:CastSpell(34093)
player:CastSpell(54198)
player:LearnSpells(mounts_1)
player:LearnSpells(mounts_2)
play er:LearnSpells(mounts_3)
player:SendBroadcastMessage("All mounts and mount riding skills obtained!")
player:SendBroadcastMessage("Advanced Riding/Flying Skill.")
player:GossipComplete()
end

if (intid == 16) then
local dummyx = player:GetX()
local dummyy = player:GetY()
local dummyz = player:GetZ()
local dummyo = player:GetO()
Unit:SpawnCreature(32541, dummyx, dummyy, dummyz, dummyo, 679, 120000)
player:SendAreaTriggerMessage("ADVANCE UR PWNZORZ SKILLZ ON DUMMEHS.")
player:GossipComplete()
end
if (intid == 5) then
player:GossipComplete()
end
end

-- RegisterUnitEvents
RegisterUnitGossipEvent(NPC_ID, 1, "GossipOnTalk")
RegisterUnitGossipEvent(NPC_ID, 2, "GossipOnSelect")
 
  • Страница 1 из 1
  • 1
Поиск:
Статистика Форума

  • [05:43 Готовый сервер 4.0.6 ... 11.12.2023]

  • [23:30 Arcanum Core (3.3.5а)... 16.11.2023]

  • [12:37 delete 02.03.2020]

  • [12:37 Ищу пост ГМ-а 02.03.2020]

  • [12:37 RastaWoW 3.3.5a (Набо... 02.03.2020]

  • [12:37 Набор команды 02.03.2020]

  • [00:34 AMD FUN SERVER - Worl... 03.07.2019]

  • [00:34 Продам private сборку... 03.07.2019]

  • [00:34 НПС для покупки опыта... 03.07.2019]

  • [00:34 WoW-TRONE 03.07.2019]

  • [12:21 Набор спидхаков (spee... 12.10.2018]

  • [21:00 [Продам] Фуловые чары... 13.03.2015]

  • [18:47 Продам приват сборку ... 04.03.2015]

  • [20:54 ВСЕ приват сборки от ... 01.03.2015]

  • [20:52 QuantumCore Server 3.... 04.02.2015]

  • [21:07 GAMESV STUDIO | ... 02.01.2015]

  • [16:36 Готовый сервер wow 4.... 04.10.2014]

  • [16:51 Скупаю чаров! 30.08.2014]

  • [19:18 Готовый сервер 4.0.6 17.08.2013]

  • [18:47 [HELP]Квесты 16.08.2013]


  • Карта Сайта ||||| Карта Форума|||