All pastes #405892 Raw Edit

Stuff

public text v1 · immutable
·published 2007-03-22 00:32 UTC
rendered paste body
--         /\/\   __ _ _ __   __ _  ___ / _\ ___ _ __(_)_ __ | |_ 
--        /    \ / _` | '_ \ / _` |/ _ \\ \ / __| '__| | '_ \| __|
--       / /\/\ \ (_| | | | | (_| | (_) |\ \ (__| |  | | |_) | |_ 
--       \/    \/\__,_|_| |_|\__, |\___/\__/\___|_|  |_| .__/ \__|
--                           |___/                     |_|     
--                        A WHOLE NEW WORLD
--         MangoScript - Bringing a whole new world to MaNGOS
--
--      Masterscript.lua - This file loads all of the LUA scripts
--
--      (c) Copyright 2006-2007 by the MangoScript Team <http://www.mangoscript.org>
--
--      This program is free software; you can redistribute it and/or modify
--      it under the terms of the GNU General Public License as published by
--      the Free Software Foundation; either version 2 of the License, or
--      (at your option) any later version.
--  
--      This program is distributed in the hope that it will be useful,
--      but WITHOUT ANY WARRANTY; without even the implied warranty of
--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--      GNU General Public License for more details.
--  
--      You should have received a copy of the GNU General Public License
--      along with this program; if not, write to the Free Software
--      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
--
--      $Id$


-- ************************************************
-- OPTION TO ENABLE OR DISSABLE EXTRA SCRITPS HERE*
-- ************************************************
local useCustoms = false; -- set this to true to enable too MangoScript custom extras
-- ************************************************

-- This is the MasterScript
local hasDelay = true; -- Delay after showing MangoScript license header?

-- Simple printf function
function printf(...) io.write(string.format(unpack(arg))) end

-- log in Debug log-level
function log(...) log_debug(string.format(unpack(arg))) end

-- this function is used for logging errors
function logerror(...) log_error(string.format(unpack(arg))) end

-- this includes file
function include(file)
	printf("MangoScript: Loading file : %s\n", file )
	assert(loadfile(file))()
end

-- Show the GPL header on load
printf("\n");
printf(" _____                 _____         _     _   \n");
printf("|     |___ ___ ___ ___|   __|___ ___|_|___| |_ \n");
printf("| | | | .'|   | . | . |__   |  _|  _| | . |  _|\n");
printf("|_|_|_|__,|_|_|_  |___|_____|___|_| |_|  _|_|  \n");
printf("              |___|                   |_|      \n");
printf("                     http://www.mangoscript.org\n");
printf("\n");

-- Add a simple delay 
-- Should be around 1-2seconds :p
if hasDelay == true then
	for i = 1, 80, 1 do
		    Sleep(20); -- Do NOT use this anywhere else! It'll 'stall' Mangos!
			printf('#');      
	end
	printf("\n");
end;
printf("   MangoScript - Bringing a whole new world to MaNGOS      \n");
printf("\n");
printf("(c) Copyright 2006-2007 by the MangoScript Team <http://www.mangoscript.org> \n");
printf("\n");
printf("This program is free software; you can redistribute it and/or modify \n");
printf("it under the terms of the GNU General Public License as published by \n");
printf("the Free Software Foundation; either version 2 of the License, or    \n");
printf("(at your option) any later version.                                  \n");
printf("\n");
printf("This program is distributed in the hope that it will be useful,      \n");
printf("but WITHOUT ANY WARRANTY; without even the implied warranty of       \n");
printf("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        \n");
printf("GNU General Public License for more details.                         \n");
printf("\n");
printf("You should have received a copy of the GNU General Public License    \n");
printf("along with this program; if not, write to the Free Software          \n");
printf("Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n");
printf("\n");
printf("$Id$ \n");


-- Add a simple delay 
-- Should be around 1-2seconds :p
if hasDelay == true then
	for i = 1, 80, 1 do
		    Sleep(20); -- Do NOT use this anywhere else! It'll 'stall' Mangos!
			printf('#');      
	end
	printf("\n");
end;
-- First load required libraries
printf("\n")
printf("MangoScript: Loading libraries...\n")
printf("\n")

include ('MangoScript/Extension.lua')
include ('MangoScript/defines.lua')
include ('MangoScript/ScriptMgr.lua')
include ('MangoScript/AI.lua')
include ('MangoScript/CallBacks.lua')

-- Load the Mango Utility Libraries
include ('MangoScript/Mango.lua')					-- Mango object
include ('MangoScript/Mango/Mango.IO.lua')			-- Mango IO Library
include ('MangoScript/Mango/Mango.Data.lua')		-- Mango Data Library
include ('MangoScript/Mango/Mango.DataStore.lua')	-- Mango DataStore Library
include ('MangoScript/Mango/Mango.Stubby.lua')		-- Mango Stubby Library
include ('MangoScript/Mango/Mango.Scripts.lua')		-- Mango Scripts Library
include ('MangoScript/Mango/Mango.AIScripts.lua')	-- Mango AIScripts Library
include ('MangoScript/Mango/Mango.Utils.lua')		-- Mango Utils Library

-- Then load the scripts
printf("\n")
printf("MangoScript: Loading scripts...\n")
printf("\n")
--
--
--Here you can include your script files :)  , have a look at sc_default.lua on info how to script
-- 
--

-- AI
include ('MangoScript/guards/sc_default_guard.lua')
include ('MangoScript/guards/default_guard_ai.lua')		-- Using Mango AIScripts Library (still needs both, not every script is converted)
include ('MangoScript/AIs/sc_tranquil_gardens.lua')
include ('MangoScript/AIs/bosses/sm_herod_ai.lua')      	-- Using Mango AIScripts Library
include ('MangoScript/AIs/bosses/uld_ironaya_ai.lua')      	-- Using Mango AIScripts Library
include ('MangoScript/AIs/bosses/uld_galgann_firehammer_ai.lua')      	-- Using Mango AIScripts Library
include ('MangoScript/general/alliance/brother_sarno_ai.lua')	-- Using Mango AIScripts Library
include ('MangoScript/general/test_threat_ai.lua')	        -- TEST THREAT SCRIPT
include ('MangoScript/AIs/bosses/uld_revelosh_ai.lua')      	-- Using Mango AIScripts Library
include ('MangoScript/AIs/uld_magregan_deepshadow_ai.lua')	-- Using Mango Scripts Library
include ('MangoScript/general/shared/lumberjack_ai.lua')	-- Using Mango AIScripts Library
include ('MangoScript/general/shared/miner_ai.lua')		-- Using Mango AIScripts Library
include ('MangoScript/general/alliance/thomas_mille_ai.lua')	-- Using Mango AIScripts Library

-- NPC Scripts
include ('MangoScript/sc_default.lua')
include ('MangoScript/guards/sc_guard_dunmorogh.lua')
include ('MangoScript/guards/sc_guard_durotar.lua')
include ('MangoScript/guards/sc_guard_elwynnforest.lua')
include ('MangoScript/guards/sc_guard_ironforge.lua')
include ('MangoScript/guards/guard_mulgore.lua')			-- Using Mango Scripts Library
include ('MangoScript/guards/guard_orgrimmar.lua')			-- Using Mango Scripts Library
include ('MangoScript/guards/guard_undercity.lua')			-- Using Mango Scripts Library
include ('MangoScript/guards/guard_bluffwatcher.lua')		-- Using Mango Scripts Library
include ('MangoScript/guards/guard_stormwind.lua')			-- Using Mango Scripts Library
include ('MangoScript/guards/guard_teldrassil.lua')			-- Using Mango Scripts Library
include ('MangoScript/guards/guard_tirisfal.lua')			-- Using Mango Scripts Library
include ('MangoScript/guards/guard_darnassus.lua')		-- Using Mango Scripts Library
include ('MangoScript/misc/misc_bombay.lua')			-- Using Mango Scripts Library
include ('MangoScript/bosses/sm_herod.lua')			-- Using Mango Scripts Library
include ('MangoScript/general/alliance/brother_sarno.lua')	-- Using Mango Scripts Library
include ('MangoScript/commands/example_cmd.lua')
include ('MangoScript/misc/gm_mob_say.lua')			-- GM mob talk cmd
include ('MangoScript/bosses/uld_ironaya.lua')			-- Using Mango Scripts Library
include ('MangoScript/bosses/uld_galgann_firehammer.lua')	-- Using Mango Scripts Library
include ('MangoScript/bosses/uld_revelosh.lua')			-- Using Mango Scripts Library
include ('MangoScript/AIs/uld_magregan_deepshadow.lua')		-- Using Mango Scripts Library
include ('MangoScript/general/shared/lumberjack.lua')		-- Using Mango Scripts Library
include ('MangoScript/general/shared/miner.lua')		-- Using Mango Scripts Library
include ('MangoScript/general/alliance/thomas_mille.lua')	-- Using Mango AIScripts Library


-- Custom Scripts
if useCustoms == true then
include ('MangoScript/custom/My_teleporter_instance.lua')		-- Instance Teleporter Master
include ('MangoScript/custom/pvp_arena_cmd.lua')			-- pvp enter command
include ('MangoScript/custom/npc_teleport.lua')			-- npc teleport script
include ('MangoScript/custom/npc_teleport_mat.lua')		-- npc teleport script
include ('MangoScript/custom/npc_teleport_bbr.lua')		-- npc teleport script
include ('MangoScript/custom/npc_teleport_Horde_zep.lua')		-- npc teleport script
include ('MangoScript/general/test_threat.lua')	        	-- MangoScript AI System
include ('MangoScript/misc/misc_uptime.lua')			-- Collects & Saves Server UP time info
end


-- Example usage for the Mango.DataStore lib
Mango.DataStore.loadfromfile('MangoScript/Data/MangoScriptConfig.slua', 'MangoScriptConfig');
local Config = Mango.DataStore.get('MangoScriptConfig');
if (Config.times_ran == nil) or (Config.times_ran == "") then
   Config.times_ran = 1;
else
   Config.times_ran = Config.times_ran + 1;
end
Mango.DataStore.set('MangoScriptConfig', Config); -- Workaround, looking into this...
Mango.DataStore.storetofile('MangoScript/Data/MangoScriptConfig.slua', 'MangoScriptConfig');
printf("MangoScript: Times ran: " ..  Config.times_ran .. "\n");