mirror of
https://github.com/ornfelt/azerothcore_lua_scripts
synced 2026-08-22 06:26:03 -04:00
59 lines
46 KiB
Lua
59 lines
46 KiB
Lua
|
|
local command = "spawnbots" --.hire will open menu
|
||
|
|
|
||
|
|
local function Hello(event, player)
|
||
|
|
player:GossipClearMenu()
|
||
|
|
player:GossipMenuAddItem(0, "Spawn ALL bots", 0, 1)
|
||
|
|
player:GossipMenuAddItem(0, "Remove ALL SPawned bots", 0, 2)
|
||
|
|
|
||
|
|
player:GossipSendMenu(1, player, 13372)
|
||
|
|
end
|
||
|
|
|
||
|
|
local function OnSelect(event, player, _, sender, intid, code)
|
||
|
|
local deletebots_char = [[ delete from characters_npcbot where entry > 70000 and entry < 70466;]]
|
||
|
|
local deletebots_world = [[ delete from creature where id > 70000 and id < 70466;]]
|
||
|
|
|
||
|
|
|
||
|
|
local spawnchar = [[ INSERT IGNORE characters_npcbot (entry,owner,roles,spec,faction,equipMhEx,equipOhEx,equipRhEx,equipHead,equipShoulders,equipChest,equipWaist,equipLegs,equipFeet,equipWrist,equipHands,equipBack,equipBody,equipFinger1,equipFinger2,equipTrinket1,equipTrinket2,equipNeck,spells_disabled) VALUES (70001,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70002,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70003,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70004,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70005,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70006,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70007,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70008,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70009,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70010,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70011,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70012,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70013,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70014,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70015,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70016,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70017,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70018,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70019,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70020,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70021,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70022,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70023,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70024,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70025,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70026,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70027,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70028,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70029,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70030,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70031,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70032,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70033,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70034,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70035,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70036,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70037,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70038,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70051,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70052,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70053,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70054,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70055,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70056,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70057,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70058,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70059,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70060,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70061,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70062,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70063,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70064,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70065,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70066,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70067,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70068,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70069,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70070,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70071,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70072,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70073,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL),
|
||
|
|
(70575,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70576,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70577,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL),
|
||
|
|
(70578,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL), (70579,0,8,18,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL);
|
||
|
|
]]
|
||
|
|
|
||
|
|
|
||
|
|
local spawnworld = [[INSERT IGNORE creature (id,`map`,zoneId,areaId,spawnMask,phaseMask,modelid,equipment_id,position_x,position_y,position_z,orientation,spawntimesecs,wander_distance,currentwaypoint,curhealth,curmana,MovementType,npcflag,unit_flags,dynamicflags,ScriptName,VerifiedBuild) VALUES (70001,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70002,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70003,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70004,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70005,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70006,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70007,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70008,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70009,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70010,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70011,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70012,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70013,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70014,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70015,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70016,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70017,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70018,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70019,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70020,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70021,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70022,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70023,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70024,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70025,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70026,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70027,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70028,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70029,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70030,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70031,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70032,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70033,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70034,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70035,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70036,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70037,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70038,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70051,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70052,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70053,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70054,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70055,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70056,1,0,0,1,1,0,0,-3505.44,-51.4943,323.159,4.82292,300,0.0,0,2,0,0,0,0,0,'',0), (70057,1,0,0,
|
||
|
|
]]
|
||
|
|
|
||
|
|
|
||
|
|
if(intid== 1) then
|
||
|
|
CharDBExecute(deletebots_char)
|
||
|
|
WorldDBExecute(deletebots_world)
|
||
|
|
CharDBExecute(spawnchar)
|
||
|
|
WorldDBExecute(spawnworld)
|
||
|
|
player:SendBroadcastMessage("|cff5af304 Next time worldserver is started ALL bots will be spawned and hirable from the Hire npc. (NPCID=70000).|r")
|
||
|
|
end
|
||
|
|
|
||
|
|
if(intid== 2) then
|
||
|
|
CharDBExecute(deletebots_char)
|
||
|
|
WorldDBExecute(deletebots_world)
|
||
|
|
player:SendBroadcastMessage("|cff5af304 Next time worldserver is started ALL Spawned bots will be removed|r")
|
||
|
|
end
|
||
|
|
|
||
|
|
player:GossipComplete()
|
||
|
|
end
|
||
|
|
|
||
|
|
local function PlrMenu(event, player, message, Type, lang)
|
||
|
|
|
||
|
|
if (message:lower() == command) then
|
||
|
|
local mingmrank = 3
|
||
|
|
if (player:GetGMRank() < mingmrank) then
|
||
|
|
player:SendBroadcastMessage("|cff5af304Only a GM can use this command.|r")
|
||
|
|
return false
|
||
|
|
else
|
||
|
|
Hello(event, player)
|
||
|
|
return false
|
||
|
|
end
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
|
||
|
|
RegisterPlayerEvent(42, PlrMenu)
|
||
|
|
RegisterPlayerGossipEvent(13372, 2, OnSelect)
|