trashman2012
Explorador
- Desde
- 6 Sep 2023
- Mensajes
- 11
- Reacciones
- 7
- Honor
- 15
Hi all, i was looking on how to add custom scripts to a trinity legion core. I found old tutorials and managed to adapt them for wow legion. Enjoy my short tutorial.
Hola a todos, estaba buscando cómo agregar scripts personalizados a un núcleo de Trinity Legion. Encontré tutoriales antiguos y logré adaptarlos para wow legion. Disfruta de mi breve tutorial.
1. Go to src\server\scripts\Custom
2. Create a new file Greeting.cpp
3. Add code into your file
4. Go to ScriptLoader.cpp
Add this line next to some other scripts, at about line 25 like this
//customs
void AddSC_CustomGreeting();
5. Go to the bottom of Scriptloader.cpp
Search for the function
void AddCustomScripts()
{
#ifdef SCRIPTS
#endif
}
and insert your script, so it should be like this
void AddCustomScripts()
{
#ifdef SCRIPTS
AddSC_CustomGreeting();
#endif
}
6. Open your SLN with visual studio, and from inside the IDE, nagivate to src\server\scripts\Custom
7. Inside Explorer go to src\server\scripts\Custom
and drag and drop your script inside visual studio, in the same location
8. Build all your solution
9. The output should be similar to this
========== Build: 3 succeeded, 0 failed, 15 up-to-date, 0 skipped ==========
1. Vaya a src\server\scripts\Custom
2. Crea un nuevo archivo Greeting.cpp
3. Agregue código a su archivo
4. Vaya a ScriptLoader.cpp
Agregue esta línea junto a otros scripts, aproximadamente en la línea 25 como esta
//aduanas
anular AddSC_CustomGreeting();
5. Vaya al final de Scriptloader.cpp
Buscar la función
anular AddCustomScripts()
{
#ifdef GUIONES
#terminara si
}
e inserta tu script, por lo que debería ser así
anular AddCustomScripts()
{
#ifdef GUIONES
AddSC_CustomGreeting();
#terminara si
}
6. Abra su SLN con Visual Studio y, desde dentro del IDE, navegue hasta src\server\scripts\Custom.
7. Dentro del Explorador, vaya a src\server\scripts\Custom
y arrastra y suelta tu guión dentro de Visual Studio, en la misma ubicación
8. Construya toda su solución
9. El resultado debería ser similar a este.
========== Compilación: 3 exitosas, 0 fallidas, 15 actualizadas, 0 omitidas ==========
The Code
El código
#include "Config.h"
#include "Chat.h"
#include "Log.h"
#include "ScriptMgr.h"
class MyCustomGreeting : public WorldScript
{
public:
MyCustomGreeting() : WorldScript("MyCustomGreeting") {}
void OnStartup() override
{
TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "Server has finished loading, player can join your server now, enjoy.");
}
};
void AddSC_CustomGreeting() {
//new OnNewCharFirstLogin2();
new MyCustomGreeting();
}
Hola a todos, estaba buscando cómo agregar scripts personalizados a un núcleo de Trinity Legion. Encontré tutoriales antiguos y logré adaptarlos para wow legion. Disfruta de mi breve tutorial.
1. Go to src\server\scripts\Custom
2. Create a new file Greeting.cpp
3. Add code into your file
4. Go to ScriptLoader.cpp
Add this line next to some other scripts, at about line 25 like this
//customs
void AddSC_CustomGreeting();
5. Go to the bottom of Scriptloader.cpp
Search for the function
void AddCustomScripts()
{
#ifdef SCRIPTS
#endif
}
and insert your script, so it should be like this
void AddCustomScripts()
{
#ifdef SCRIPTS
AddSC_CustomGreeting();
#endif
}
6. Open your SLN with visual studio, and from inside the IDE, nagivate to src\server\scripts\Custom
7. Inside Explorer go to src\server\scripts\Custom
and drag and drop your script inside visual studio, in the same location
8. Build all your solution
9. The output should be similar to this
========== Build: 3 succeeded, 0 failed, 15 up-to-date, 0 skipped ==========
1. Vaya a src\server\scripts\Custom
2. Crea un nuevo archivo Greeting.cpp
3. Agregue código a su archivo
4. Vaya a ScriptLoader.cpp
Agregue esta línea junto a otros scripts, aproximadamente en la línea 25 como esta
//aduanas
anular AddSC_CustomGreeting();
5. Vaya al final de Scriptloader.cpp
Buscar la función
anular AddCustomScripts()
{
#ifdef GUIONES
#terminara si
}
e inserta tu script, por lo que debería ser así
anular AddCustomScripts()
{
#ifdef GUIONES
AddSC_CustomGreeting();
#terminara si
}
6. Abra su SLN con Visual Studio y, desde dentro del IDE, navegue hasta src\server\scripts\Custom.
7. Dentro del Explorador, vaya a src\server\scripts\Custom
y arrastra y suelta tu guión dentro de Visual Studio, en la misma ubicación
8. Construya toda su solución
9. El resultado debería ser similar a este.
========== Compilación: 3 exitosas, 0 fallidas, 15 actualizadas, 0 omitidas ==========
The Code
El código
#include "Config.h"
#include "Chat.h"
#include "Log.h"
#include "ScriptMgr.h"
class MyCustomGreeting : public WorldScript
{
public:
MyCustomGreeting() : WorldScript("MyCustomGreeting") {}
void OnStartup() override
{
TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "Server has finished loading, player can join your server now, enjoy.");
}
};
void AddSC_CustomGreeting() {
//new OnNewCharFirstLogin2();
new MyCustomGreeting();
}