[Guide] How to compile scripts! menu

User Tag List

Results 1 to 10 of 10
  1. #1
    Aldaus's Avatar Member
    Reputation
    28
    Join Date
    Sep 2007
    Posts
    98
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Guide] How to compile scripts!

    WARNING: If you are using a repack, This guide wont work for you.
    NOTICE: Theres alot of red in this guide, It might burn your eyes!
    This is the way I learned how to compile my own scripts or any scripts!

    First compile Ascent, You can find any guide here that tells you how to do this.

    Now from the root folder of ascent go to the src folder then go to the scripts folder then to src again.
    You should see four folders.
    AscentStats
    GossipScripts
    InstanceScripts
    ServerStatusPlugin
    SpellHandlers

    Now create a copy of the GossipScripts folder and rename it to anything you want, Lets go with MyScripts.
    You should still be in the src folder, Now you should see a file called Makefile. Open it with notepad and you should see...
    Code:
    SUBDIRS = GossipScripts InstanceScripts ServerStatusPlugin SpellHandlers
    Now make it look like this.
    Code:
    SUBDIRS = GossipScripts MyScripts InstanceScripts ServerStatusPlugin SpellHandlers
    Now open the MyScripts folder, and delete these following scripts.
    Gossip_Battlemaster
    Gossip_Innkeeper
    GuardGossip
    Put your scripts inside this folder.
    Now that your scripts are inside lets edit the Makefile inside this folder.
    It should say this
    Code:
    libGossipScripts_la_SOURCES = Gossip_Battlemaster.cpp Gossip_Innkeepers.cpp GuardGossip.cpp Setup.cpp
    Now remove
    Gossip_Battlemaster.cpp
    Gossip_Innkeepers.cpp
    GuardGossip.cpp
    Now type in all your scripts with spaces, Keep Setup.cpp.
    So lets say I added my PortableMorpher and my PortableTeleporter, My Makefile will say this.
    Code:
    libGossipScripts_la_SOURCES = PortableTeleporter.cpp PortableMorpher.cpp Setup.cpp
    Great! Now we should be add the step that we need to edit the Setup.cpp and Setup.h in the folder. Open Setup.cpp, You should see this.
    Code:
    extern "C" SCRIPT_DECL void _exp_script_register(ScriptMgr* mgr)
    {
        SetupInnkeepers(mgr);
        SetupBattlemaster(mgr);
        SetupGuardGossip(mgr);
    }
    Now this part gets a bit tricky...
    You must change it to the class in your script, So lets take my PortableMorpher for example. Open the script and search for
    Code:
    class SCRIPT_DECL
    My PortableMorpher says
    Code:
    class SCRIPT_DECL Morpher : public GossipScript
    Now go back to Setup.cpp and I would change it to this.
    Code:
    
    
    Code:
    extern "C" SCRIPT_DECL void _exp_script_register(ScriptMgr* mgr)
    {
       SetupMorpher(mgr);
    }
    

    See what i'm trying to say? Now I wanna add in my PortableTeleporter into their, and that scripts class is Warper. So lets change that part to...
    Code:
    
    
    Code:
    extern "C" SCRIPT_DECL void _exp_script_register(ScriptMgr* mgr)
    {
        SetupMorpher(mgr);
        SetupWarper(mgr);
    }
    

    Congratulations your very close to the end of this guide.
    Now save Setup.cpp and open Setup.h
    Now in there you should see
    Code:
    void SetupInnkeepers(ScriptMgr * mgr);
    void SetupGuardGossip(ScriptMgr * mgr);
    void SetupBattlemaster(ScriptMgr * mgr);
    This is the same thing now, so with my PortableMorpher and my PortableTeleporter I would change it to this.
    Code:
    void SetupMorpher(ScriptMgr * mgr);
    void SetupWarper(ScriptMgr * mgr);
    See? Simple.
    Save that and close it.
    Now go back to the Ascent root folder(the main folder)
    Find configure.ac, Scroll all the way to the bottom and find,
    Code:
    src/Makefile
       src/ascent/Makefile
       src/shared/Makefile
       src/logonserver/Makefile
       src/game/Makefile
       src/scripts/Makefile
       src/scripts/src/Makefile
       src/scripts/src/GossipScripts/Makefile
       src/scripts/src/InstanceScripts/Makefile
       src/scripts/src/ServerStatusPlugin/Makefile
       src/scripts/src/SpellHandlers/Makefile
       dep/Makefile
       dep/src/Makefile
       dep/src/pcre/Makefile
       dep/src/lua/Makefile
       dep/src/zlib/Makefile
    Add in this
    Code:
    src/Makefile
       src/ascent/Makefile
       src/shared/Makefile
       src/logonserver/Makefile
       src/game/Makefile
       src/scripts/Makefile
       src/scripts/src/Makefile
       src/scripts/src/GossipScripts/Makefile
       src/scripts/src/InstanceScripts/Makefile
       src/scripts/src/ServerStatusPlugin/Makefile
       src/scripts/src/MyScripts/Makefile
       src/scripts/src/SpellHandlers/Makefile
       dep/Makefile
       dep/src/Makefile
       dep/src/pcre/Makefile
       dep/src/lua/Makefile
       dep/src/zlib/Makefile
    Remember, MyScripts is the name of the folder you made.
    Close and save that, Now go to the src folder, the scripts folder, and then open the projects folder.
    Copy the GossipScripts project, Now there are three of them, GossipScripts2003, GossipScripts2005, GossipScripts2008.
    This depends on what version of Microsoft Visual Studio your using.
    Lets say we are using GossipScripts2008, Make a copy of that project. Rename it to whatever you want, I named it MyScripts2008.
    Now open it with notepad.
    This is the easy and lazy part, Do a Find And Replace
    For the find type in GossipScripts and for the Replace type in MyScripts.
    Now click replace all. Save it and close it, Now open it with Microsoft Visual Studio.
    Ok, don't build it yet, Click on click on the little + next to MyScripts and you should see the folders Main Resources and Scripts.
    Click on the + and you should see Setup.cpp and Setup.h, remove both of those.
    Now right click it and go to Add -> Existing Item, and go to open your MyScripts folder and add Setup.cpp and Setup.h. Now inside the project remove the three scripts which should be
    Gossip_Battlemaster.cpp
    Gossip_Innkeepers.cpp
    GuardGossip.cpp
    Now go to Add -> Existing Item and go to your MyScripts folder once again and add all your scripts into there.
    So I would add
    PortableMorpher.cpp
    and
    PortableTeleporter.cpp
    Now look for Solution MyScripts right click it and go to build.
    If you get
    Code:
    ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
    Congratulations you compiled your scripts successfully and your .dll will be in your scripts_bin folder.

    Note: The classes in your scripts cannot be the same, for example two scripts cannot both have the class Warper.
    Thanks for reading the guild, any questions can go in this thread and I will make improvements if needed.

    [Guide] How to compile scripts!
  2. #2
    SectorSeven's Avatar Banned
    Reputation
    444
    Join Date
    Oct 2007
    Posts
    1,948
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    +rep
    even though im not gonna try it

  3. #3
    Maine's Avatar Member
    Reputation
    24
    Join Date
    Dec 2007
    Posts
    524
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good guide +rep nice scripts btw

  4. #4
    Aldaus's Avatar Member
    Reputation
    28
    Join Date
    Sep 2007
    Posts
    98
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks ^ ^

  5. #5
    Maine's Avatar Member
    Reputation
    24
    Join Date
    Dec 2007
    Posts
    524
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Lol just needed a post here

  6. #6
    hardcore's Avatar Member
    Reputation
    8
    Join Date
    Nov 2007
    Posts
    40
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Where can i get the source code for the morpher and warp?

  7. #7
    gd8616396's Avatar Member
    Reputation
    1
    Join Date
    Oct 2007
    Posts
    56
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    wen i copied and renamed nothin happens i cant see the makefile. yet how can i do it copy the gossipscripts.dll and paste it in the same folder rename it and dats it?

  8. #8
    Pragma's Avatar Contributor
    Reputation
    261
    Join Date
    Feb 2007
    Posts
    630
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks aldaus, this guide helped me

    Hey, I made some modifications to your PortableTeleporter.cpp, it checks for horde or alliance when you teleport to a city and denies horde access to say Stormwind, it sends a message saying they are not allowed to go there too.

    here it is:

    Code:
    //Title of Script: Portable Teleporter
    //Description of Script: Teleports people to major citys with a item teleporter.
    //Author: Aldaus
    //Credits: To Mesmer for helping me fix the combat check.
    
        #include "StdAfx.h"
        #include "Setup.h"
    
        #ifdef WIN32
        #pragma warning(disable:4305)        // warning C4305: 'argument' : truncation from 'double' to 'float'
        #endif
    
        //Defining Pwarper
        class SCRIPT_DECL Pwarper : public GossipScript
        {
        public:
            void GossipHello(Object * pObject, Player* Plr, bool AutoSend);
            void GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code);
            void GossipEnd(Object * pObject, Player* Plr);
            void Destroy()
            {
            delete this;
            }
        };
    
        void Pwarper::GossipHello(Object* pObject, Player * Plr, bool AutoSend)
        {
            if(Plr->CombatStatus.IsInCombat())
            {
                Plr->BroadcastMessage("You are in combat!");
            }
            if(!Plr->CombatStatus.IsInCombat())
            {
            
            GossipMenu *Menu;
            objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 2593, Plr);
            Menu->AddItem(0, "Stormwind", 50);
            Menu->AddItem(0, "Ironforge", 51);
            Menu->AddItem(0, "Exodar", 52);
            Menu->AddItem(0, "Darnassus", 53);  
            Menu->AddItem(0, "Orgrimar", 54);
            Menu->AddItem(0, "Thunder Bluff", 55);
            Menu->AddItem(0, "Silvermoon City", 56);
            Menu->AddItem(0, "Undercity", 57);
            Menu->AddItem(0, "Shattrath", 58);
                if(AutoSend)
                Menu->SendTo(Plr);
        }
    };
    
    
    
    
        //Defining Cases
        void Pwarper::GossipSelectOption(Object* pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
        {
            GossipMenu * Menu;
            switch(IntId)
            {
                    case 50:
                        {   //Stormwind
                            if(Plr->getRace()== 10||Plr->getRace()== 2||Plr->getRace()== 6||Plr->getRace()== 8||Plr->getRace()== 5)
                            {
                                Plr->BroadcastMessage("You are horde, you cannot go there stupid!");
                            }
                            else
                            {
                                Plr->SafeTeleport(0, 0, -8831.61, 622.666, 93.7787, 0);
                                Plr->Gossip_Complete();
                            }
                        }break;
                        
                    case 51:
                        {   //Ironforge
                            if(Plr->getRace()== 10||Plr->getRace()== 2||Plr->getRace()== 6||Plr->getRace()== 8||Plr->getRace()== 5)
                            {
                                Plr->BroadcastMessage("You are horde, you cannot go there stupid!");
                            }
                            else
                            {
                                Plr->SafeTeleport(0, 0, -4804.45, -1101.14, 498.807, 0);
                                Plr->Gossip_Complete();
                            }
                        }break;
                        
                    case 52:
                        {   //Exodar
                            if(Plr->getRace()== 10||Plr->getRace()== 2||Plr->getRace()== 6||Plr->getRace()== 8||Plr->getRace()== 5)
                            {
                                Plr->BroadcastMessage("You are horde, you cannot go there stupid!");
                            }
                            else
                            {
                                Plr->SafeTeleport(530, 0, -3796.24, -11710.9, -105.45, 0);
                                Plr->Gossip_Complete();
                            }
                        }break;
                        
                    case 53:
                        {   //Darnassus
                            if(Plr->getRace()== 10||Plr->getRace()== 2||Plr->getRace()== 6||Plr->getRace()== 8||Plr->getRace()== 5)
                            {
                                Plr->BroadcastMessage("You are on the Horde, you cannot go there stupid!");
                            }
                            else
                            {
                                Plr->SafeTeleport(1, 0, 9952.07, 2278.46, 1341.39, 0);
                                Plr->Gossip_Complete();
                            }
                        }break;
                        
                    case 54:
                        {   //Orgrimmar
                            if(Plr->getRace()== 10||Plr->getRace()== 2||Plr->getRace()== 6||Plr->getRace()== 8||Plr->getRace()== 5)
                            {
                                Plr->SafeTeleport(1, 0, 1499.55, -4406.91, 23.1642, 0);
                                Plr->Gossip_Complete();
                            }
                            else
                            {
                                Plr->BroadcastMessage("You are on the Alliance, you cannot go there stupid!");
                            }
                        }break;
                        
                    case 55:
                        {   //Thunder Bluff
                            if(Plr->getRace()== 10||Plr->getRace()== 2||Plr->getRace()== 6||Plr->getRace()== 8||Plr->getRace()== 5)
                            {
                                Plr->SafeTeleport(1, 0, -1195.88, -56.5582, 160.034, 0);
                                Plr->Gossip_Complete();
                            }
                            else
                            {
                                Plr->BroadcastMessage("You are on the Alliance, you cannot go there stupid!");
                            }
    
                        }break;
                        
                    case 56:
                        {   //Silvermoon City
                            if(Plr->getRace()== 10||Plr->getRace()== 2||Plr->getRace()== 6||Plr->getRace()== 8||Plr->getRace()== 5)
                            {
                                Plr->SafeTeleport(530, 0, 9492.45, -7279.12, 14.3036, 0);
                                Plr->Gossip_Complete();
                            }
                            else
                            {
                                Plr->BroadcastMessage("You are on the Alliance, you cannot go there stupid!");
                            }
    
                        }break;
                        
                    case 57:
                        {   //Undercity
                            if(Plr->getRace()== 10||Plr->getRace()== 2||Plr->getRace()== 6||Plr->getRace()== 8||Plr->getRace()== 5)
                            {
                                Plr->SafeTeleport(0, 0, 1615.1, 239.786, -62.0774, 0);
                                Plr->Gossip_Complete();
                            }
                            else
                            {
                                Plr->BroadcastMessage("You are on the Alliance, you cannot go there stupid!");
                            }
    
                        }break;
                        
                    case 58:
                        {   //Shattrath
                            Plr->SafeTeleport(530, 0, -1852, 5432, -11, 0);
                            Plr->Gossip_Complete();
                        }break;
    
    
    
            }
        };
    
        void Pwarper::GossipEnd(Object * pObject, Player* Plr)
    {
        GossipScript::GossipEnd(pObject, Plr);
    }
    
        void SetupPwarper(ScriptMgr * mgr)
        {
        GossipScript * gs = (GossipScript*) new Pwarper();
        mgr->register_item_gossip_script(40010,gs);
        }
    Last edited by Pragma; 01-08-2008 at 10:18 PM.


  9. #9
    MysterioussouL1's Avatar
    MysterioussouL1
    Guest
    nice ty for sharing +rep

  10. #10
    Ballwinkle's Avatar Contributor Authenticator enabled
    Reputation
    124
    Join Date
    Mar 2007
    Posts
    662
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    wwoooo great!

Similar Threads

  1. [Guide]How To Compile Ascent
    By SectorSeven in forum WoW EMU Guides & Tutorials
    Replies: 144
    Last Post: 12-19-2008, 02:37 PM
  2. [Guide]How to Compile 2.4 Core
    By Algorithm in forum WoW EMU Guides & Tutorials
    Replies: 12
    Last Post: 07-16-2008, 03:18 PM
  3. [Guide] How to compile your own DLL
    By Cursed in forum WoW EMU Guides & Tutorials
    Replies: 58
    Last Post: 06-19-2008, 09:38 AM
  4. [Guide] How to compile your own ascent server. 100% work !! TRY IT :D
    By Etzzhy in forum WoW EMU Guides & Tutorials
    Replies: 22
    Last Post: 05-09-2008, 07:04 PM
  5. Guide: How to Compile Ascent yourself! [With photos]
    By Skaren in forum WoW EMU Guides & Tutorials
    Replies: 33
    Last Post: 01-08-2008, 08:18 PM
All times are GMT -5. The time now is 07:10 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search