5. Pre-defined functionsHere a list of predefined functions:
Game.CreateGlobal(string name)Creates a global variable to be used in any script.
Game.GetGlobal(string name)Get the value of a global variable. If the variable doesn't exist, it is created.
Game.SetGlobal(string name, int value)Set the value of a global variable. If the variable doesn't exist, it is created.
Game.RemoveGlobal(string name)Deletes a global variable.
Game.AddStatusMessage(string message)Displays a status message in white.
Game.AddStatusMessageRGB(int red, int green, int blue, string message)Displays a status message in the given color.
Game.AddLanStatusMessage(int type, int no)Displays a status message in white. The message is got from the en_lan.txt file in the Data folder.
Game.AddLanStatusMessageRGB(int red, int green, int blue, int type, int no)Displays a status message in the given color. The message is got from the en_lan.txt file in the Data folder.
Game.GetCurrTime()Returns the number of seconds elapsed since the 1st of January 1970.
Game.GetTicks()Returns the number of milisecond elapsed since the game has been started.
Game.SendChat(string message)Sends a normal chat message.
Game.SendGuildChat(string message)Sends a guild chat message.
Game.SendPartyChat(string message)Sends a party chat message.
Game.SendWhisperChat(string target, string message)Sends a whisper chat message to the specified target.
Game.GetSpecialString(string name)Get a special string. The special strings are defined in both the code and the en_strings.txt which is located in the Data/UI/Resources folder. The hardcoded strings are listed in the
viewtopic.php?p=96118#p96118 topic.
Game.GetSpecialValue(string name)Get a special value. The special values are all hardcoded and a list can be found in the following topic:
viewtopic.php?p=96119#p96119Game.HasUnreadMails()Returns true if there are unread mails. Else, returns false.
Game.IsRandomArenaMatchReady()Returns true if a random match is ready to be played. Else, returns false.
Game.AskQuestion(int question)Asks a pre-defined question to the player.
Game.AnswerQuestion(bool answer)Replies to the previously asked question.
Hero.IsDead()Returns true if your main character is dead. Else, returns false.
UIManager.ShowUI(string name)Shows the UI of the given name.
UIManager.HideUI(string name)Hides the UI of the given name.
UIManager.ToggleUI(string name)Toggles the UI of the given name.
UIManager.IsShown(string name)Returns true if the UI of the given name is currently visible. Else, returns false.