Revision 2, 1.1 kB
(checked in by yumileroy, 17 years ago)
|
[svn] * Proper SVN structure
Original author: Neo2003
Date: 2008-10-02 16:23:55-05:00
|
Line | |
---|
1 | |
---|
2 | ** HOW TO SCRIPT IN C++ ** |
---|
3 | |
---|
4 | 1 - create a file myscript.cpp in scripts folder. |
---|
5 | 2 - copy the content of script_default.cpp, it as the structure on how the scripting fuctions are organized. |
---|
6 | dont forget to change the name of fuctions, like GossipHello_default to GossipHello_myscript. |
---|
7 | |
---|
8 | 3 - in fuction AddSC_default change to AddSC_myscript. |
---|
9 | 4 - newscript->Name="default"; change the string to "myscript" this name is the one to be called from the db |
---|
10 | 5 - dont forget to change the name in here to newscript->pGossipHello = &GossipHello_default; this is where the scripted fuctions are stored. |
---|
11 | 6 - and last thing is in ScriptMgr.cpp |
---|
12 | |
---|
13 | add your AddSC_myscript in here |
---|
14 | |
---|
15 | // -- Scripts to be added -- |
---|
16 | extern void AddSC_default(); |
---|
17 | // ------------------- |
---|
18 | |
---|
19 | and here |
---|
20 | |
---|
21 | // -- Inicialize the Scripts to be Added -- |
---|
22 | AddSC_default(); |
---|
23 | // ---------------------------------------- |
---|
24 | |
---|
25 | now start using the player fuctions to script ;) |
---|
26 | see the sc_defines.h for some fuctions to use. |
---|
27 | |
---|
28 | hope it helps, any question use our forum. |
---|
29 | |
---|
30 | copy libscript.so and libscript.a to your server/lib path |
---|
31 | |
---|
32 | made by: mmcs. |
---|