From f221f5911a0f6d150160c348161d05bd0f328613 Mon Sep 17 00:00:00 2001 From: Rat Date: Fri, 22 Jan 2010 00:04:50 +0100 Subject: *update eventAI docs *add missed docs --HG-- branch : trunk --- doc/HowToScript.txt | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 doc/HowToScript.txt (limited to 'doc/HowToScript.txt') diff --git a/doc/HowToScript.txt b/doc/HowToScript.txt new file mode 100644 index 00000000000..73968a08b19 --- /dev/null +++ b/doc/HowToScript.txt @@ -0,0 +1,27 @@ + +** HOW TO SCRIPT IN C++ ** + +1 - create a file myscript.cpp in scripts folder. +2 - copy the content of script_default.cpp, it as the structure on how the scripting fuctions are organized. + dont forget to change the name of fuctions, like GossipHello_default to GossipHello_myscript. + +3 - in fuction AddSC_default change to AddSC_myscript. +4 - newscript->Name="default"; change the string to "myscript" this name is the one to be called from the db +5 - dont forget to change the name in here to newscript->pGossipHello = &GossipHello_default; this is where the scripted fuctions are stored. +6 - and last thing is in ScriptMgr.cpp + +add your AddSC_myscript in here + +// -- Scripts to be added -- +extern void AddSC_default(); +// ------------------- + +and here + +// -- Inicialize the Scripts to be Added -- + AddSC_default(); +// ---------------------------------------- + +now start using the player fuctions to script ;) + +hope it helps, any question use our forum. \ No newline at end of file -- cgit v1.2.3