//Script Name:  onmoduleload
//////////////////////////////////////////
//Created By: Genisys (Guile)
//Created On:   7/23/08 (Updated 8/10/08)
/////////////////////////////////////////
/*
This script goes in your OnModuleLoad
Event found in the Module Properties
Event Tab.
*/
////////////////////////////////////////
//IMPORTANT SWITCH
//Set this to TRUE if it's a multiplayer game
const int MULTI = TRUE; //Default = FALSE (Single Player Mode);
// I did this
const string NWNX_DISCORD_URL = "/api/webhooks/713882600216723518/1EpwmMZ6F9VBjDt6uKmvGizGJUqYZgCC35Dyt3slQGUeDMJszHjKcDVbJXjr-a59v55u/slack";

//Required Includes
#include "nwnx"
#include "nwnx_util"
#include "nwnx_webhook"

//Required Include for the DM Chat Control Options
#include "dm_chat_inc"
#include "_inc_color_text_"



//Main Script
void main()
{
 //Set whether we are using this module for multiplayer or single player..
 SetLocalInt(GetModule(), "MULTI", MULTI);

 //For Time Keeping...(This MUST BE HERE)
 SetLocalInt(GetModule(), "DELAY_OK", 1);
////////////////////////////////////////////////////////


//Stop the treasure generation on creatures, so they won't drop loot..
SetLocalInt(GetModule(), "X2_L_NOTREASURE", FALSE);

//IMPORTANT: This part is part of 2 color systems!
//It must be in your OnModuleLoad Event Script!!

//This set color to placeables in the module, it requires that the placeable
//tagged color is placed in the module somewhere out of reach.
string sColor = GetName(GetObjectByTag("COLORS"));

SetCustomToken(1001, GetSubString(sColor, 0, 6)); //white
SetCustomToken(1002, GetSubString(sColor, 6, 6)); //yellow
SetCustomToken(1003, GetSubString(sColor, 12, 6)); //magenta
SetCustomToken(1004, GetSubString(sColor, 18, 6)); //cyan
SetCustomToken(1005, GetSubString(sColor, 24, 6)); //red
SetCustomToken(1006, GetSubString(sColor, 30, 6)); //green
SetCustomToken(1007, GetSubString(sColor, 36, 6)); //blue

//More Custom Color Tokens By Genisys
//NOTE: These custom tokens go ONLY in conversation lines to colorize text
//The example below is everything that would go on a Conversation Line
/*******EXAMPLE CONVERSATION LINE**************

<CUSTOM101>This text of the conversation would be red<CUSTOM100>

IMPORTANT: You must use <CUSTOM100> At the end EVERY TIME!*/

    SetCustomToken(100, "</c>"); // CLOSE tag (Ends color, prevents run on!)

    SetCustomToken(101, "<c�  >"); // red
    SetCustomToken(102, "<c � >"); // green
    SetCustomToken(103, "<c  �>"); // blue
    SetCustomToken(104, "<c ��>"); // cyan
    SetCustomToken(105, "<c� �>"); // magenta
    SetCustomToken(106, "<c�� >"); // yellow
    SetCustomToken(107, "<c   >"); // black
    SetCustomToken(108, "<c�  >"); // dark red
    SetCustomToken(109, "<c � >"); // dark green
    SetCustomToken(110, "<c  �>"); // dark blue
    SetCustomToken(111, "<c ��>"); // dark cyan
    SetCustomToken(112, "<c� �>"); // dark magenta
    SetCustomToken(113, "<c�� >"); // dark yellow
    SetCustomToken(114, "<c���>"); // grey
    SetCustomToken(117, "<c���>"); // dark grey
    SetCustomToken(115, "<c�� >"); // orange
    SetCustomToken(116, "<c�� >"); // dark orange
    SetCustomToken(117, "<cڥ#>"); // brown
    SetCustomToken(118, "<c† >"); // dark brown
    SetCustomToken(119, "<c�k�>"); // Light Purple
    SetCustomToken(120, "<c � >"); // Neon Green
    SetCustomToken(121, "<c ��>"); // Light Blue
    SetCustomToken(122, "<c` �>"); // Purple
    SetCustomToken(123, "<c � >"); //Neon Green

//Set the name on the Rainbow Chest!
object oRainbow = GetObjectByTag("rainbowchest");
object oRainbow2 = GetObjectByTag("rainbowchest2");
SetName(oRainbow, ChaoticText(GetName(oRainbow, TRUE)));
SetName(oRainbow2, ChaoticText(GetName(oRainbow2, TRUE)));
////////////////////////////////////////////////////////////////////////////

 //Code added for the DM Chat Control Options..
 GetChatConfigurations();

/////////SPELL HOOKING BY Genisys (Guile)///////////////////////////////////
//This part sets a local variable on the module to allow you to edit
//spells through the "myhook" script, which will give you greater control
//over spell casting in your module, including items and area casting!

//SetLocalString(GetModule(), "X2_S_UD_SPELLSCRIPT", "myhook");

//To disable spell hooking simply type // at the start of the line above
////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////
/////////////////AUTOMATIC CHARACTER SAVING FUCTION////////////////////////
//Note this function is Polymorphing Friendly (Designed for that purpose!)

if(MULTI == TRUE)
{
  //:: DelayCommand(60.0, ExecuteScript("savepcinfo", OBJECT_SELF));  //:: Not needed for EE
}
//////////////////////////////////////////////////////////////////////////

//Your Code Goes here..

//Main Script End
NWNX_WebHook_SendWebHookHTTPS("discordapp.com", NWNX_DISCORD_URL, "Man lives in the sunlit world of what he believes to be reality. But... there is, unseen by most, an underworld, a place that is just as real, but not as brightly lit...", "Master of the Void");
}