Hello & Welcome to our community. Is this your first visit? Register
Follow us on
Follow us on Facebook Follow us on Twitter Watch us on YouTube


MMOCoin

Likes Likes:  0
Results 1 to 5 of 5
  1. #1
    Contributor
    Cocain's Avatar
    Join Date
    Mar 2010
    Posts
    208
    Post Thanks / Like
    Rep Power
    16
    Reputation
    92

    AuxProductions Releases.


    Register to remove this ad
    As now, this will be the official topic in which I'll be releasing the AuxProductions C++ scripts.

    Currently, I have 3 scripts avaible for your use.

    A Exchanger Npc.

    Code:
    /*+++++++++++++++++++++++++++++++++++++
    Copyright claimed by AuxProductions.+++
     +++++++++++++++++++++++++++++++++++++*/
    
    #include "StdAfx.h"
    #include "Setup.h"
    
    
    //ItemID of the item you want them to have.
    #define TOKEN10REWARD (ID)
    #define TOKEN20REWARD (ID)
    #define TOKEN30REWARD (ID)
    #define TOKEN40REWARD (ID)
    #define TOKEN50REWARD (ID)
    
    
    class SCRIPT_DECL KS_Exchange : 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 KS_Exchange::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
    {
        GossipMenu *Menu;
        objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
        Menu->AddItem(9, "Pvp Tokens 10", 2);
        Menu->AddItem(9, "Pvp Tokens 20", 3);
        Menu->AddItem(9, "Pvp Tokens 30", 4);
        Menu->AddItem(9, "Pvp Tokens 40", 5);
        Menu->AddItem(9, "Pvp Tokens 50", 6);
        Menu->SendTo(Plr);
    }
    
    void KS_Exchange::GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
    {    
        GossipMenu *Menu;
        QueryResult *query;
        Creature * pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?((Creature*)pObject):NULL;
        if(pCreature==NULL)
            return;
    
        switch(IntId)
        {
        case 0:
            GossipHello(pObject, Plr, true);
            break;
    
        case 1:
            { 
        objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
        Menu->AddItem(9, "Pvp Tokens 10", 2);
        Menu->AddItem(9, "Pvp Tokens 20", 3);
        Menu->AddItem(9, "Pvp Tokens 30", 4);
        Menu->AddItem(9, "Pvp Tokens 40", 5);
        Menu->AddItem(9, "Pvp Tokens 50", 6);
        Menu->SendTo(Plr);
            break;
    }
        case 2:// 10 Killstreak rewards.
            {
                query = WorldDatabase.Query("SELECT `PvpToken` from `kill_streak_tokens` WHERE `name` = '%s'", Plr->GetName());
                    
                if (query->Fetch()[0].GetUInt32() >= 10)
                {
                    Plr->GetItemInterface()->AddItemById(TOKEN10REWARD,1,0);
                    WorldDatabase.Query("UPDATE `kill_streak_tokens` SET `Pvptoken`=(Pvptoken - 10) WHERE (`name`='%s')", Plr->GetName());
    
                    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 4, Plr);
                    Menu->AddItem(9, "You've just exchanged 10 of your PvP tokens.", 1);
                    Menu->AddItem(9, "Main Menu", 1);
                    Menu->SendTo(Plr);
                }
                else
                {
                    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 5, Plr);
                    Menu->AddItem(9, "You do not have enough Tokens for this exchange.", 1);
                    Menu->AddItem(9, "Back", 1);
                    Menu->SendTo(Plr);
                }
            }
            break;
    
        case 3:// 20 Killstreak rewards.
            {
                query = WorldDatabase.Query("SELECT `Pvptoken` from `Killsystem_Token` WHERE `name` = '%s'", Plr->GetName());
                    
                if (query->Fetch()[0].GetUInt32() >= 20)
                {
                    Plr->GetItemInterface()->AddItemById(TOKEN20REWARD,1,0);
                    WorldDatabase.Query("UPDATE `Killsystem_Token` SET `Pvptoken`=(Pvptoken - 20) WHERE (`name`='%s')", Plr->GetName());
    
                    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 6, Plr);
                    Menu->AddItem(9, "Congratulations, you exchanged 20 of your Tokens for Chaos Tokens.", 1);
                    Menu->AddItem(9, "Main Menu", 1);
                    Menu->SendTo(Plr);
                }
                else
                {
                    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 7, Plr);
                    Menu->AddItem(9, "You do not have enough Tokens for this exchange.", 1);
                    Menu->AddItem(9, "Back", 1);
                    Menu->SendTo(Plr);
                }
            }
            break;
    
        case 4:// 30 Killstreak rewards.
            {
                query = WorldDatabase.Query("SELECT `Pvptoken` from `Killsystem_Token` WHERE `name` = '%s'", Plr->GetName());
                    
                if (query->Fetch()[0].GetUInt32() >= 30)
                {
                    Plr->GetItemInterface()->AddItemById(TOKEN30REWARD,1,0);
                    WorldDatabase.Query("UPDATE `Killsystem_Token` SET `Pvptoken`=(Pvptoken - 30) WHERE (`name`='%s')", Plr->GetName());
    
                    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 8, Plr);
                    Menu->AddItem(9, "Congratulations, you exchanged 30 of your Tokens for Chaos Tokens.", 1);
                    Menu->AddItem(9, "Main Menu", 1);
                    Menu->SendTo(Plr);
                }
                else
                {
                    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 9, Plr);
                    Menu->AddItem(9, "You do not have enough Tokens for this exchange.", 1);
                    Menu->AddItem(9, "Back", 1);
                    Menu->SendTo(Plr);
                }
            }
            break;
            }
    }
    
        case 5:// 40 Killstreak rewards.
            {
                query = WorldDatabase.Query("SELECT `Pvptoken` from `Killsystem_Token` WHERE `name` = '%s'", Plr->GetName());
                    
                if (query->Fetch()[0].GetUInt32() >= 40)
                {
                    Plr->GetItemInterface()->AddItemById(TOKEN40REWARD,1,0);
                    WorldDatabase.Query("UPDATE `Killsystem_Token` SET `Pvptoken`=(Pvptoken - 40) WHERE (`name`='%s')", Plr->GetName());
    
                    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 10, Plr);
                    Menu->AddItem(9, "Congratulations, you exchanged 40 of your Tokens for Chaos Tokens.", 1);
                    Menu->AddItem(9, "Main Menu", 1);
                    Menu->SendTo(Plr);
                }
                else
                {
                    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 11, Plr);
                    Menu->AddItem(9, "You do not have enough Tokens for this exchange.", 1);
                    Menu->AddItem(9, "Back", 1);
                    Menu->SendTo(Plr);
                }
            }
            break;
    
        case 6:// 50 Killstreak rewards.
            {
                query = WorldDatabase.Query("SELECT `Pvptoken` from `Killsystem_Token` WHERE `name` = '%s'", Plr->GetName());
                    
                if (query->Fetch()[0].GetUInt32() >= 50)
                {
                    Plr->GetItemInterface()->AddItemById(TOKEN30REWARD,1,0);
                    WorldDatabase.Query("UPDATE `Killsystem_Token` SET `Pvptoken`=(Pvptoken - 50) WHERE (`name`='%s')", Plr->GetName());
    
                    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 12, Plr);
                    Menu->AddItem(9, "Congratulations, you exchanged 50 of your Tokens for Chaos Tokens.", 1);
                    Menu->AddItem(9, "Main Menu", 2);
                    Menu->SendTo(Plr);
                }
                else
                {
                    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 13, Plr);
                    Menu->AddItem(9, "You do not have enough Tokens for this exchange.", 1);
                    Menu->AddItem(9, "Back", 1);
                    Menu->SendTo(Plr);
                }
            }
            break;
    }
    void KS_Exchange::GossipEnd(Object * pObject, Player* Plr)
    {
        GossipScript::GossipEnd(pObject, Plr);
    }
    
    void SetupKS_Exchange(ScriptMgr * mgr)
    {
        GossipScript * gs = (GossipScript*) new KS_Exchange();
        mgr->register_gossip_script(55555,gs);
    }
    You can eventually use a Lua script for this NPC to go along with. We'll be writting a specific Cpp script, which is customly made to function with this Gossip script.

    A Auto-Defend on Login.




    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    
    #ifdef WIN32
    #pragma warning(disable:4305)    // warning C4305: 'argument' : truncation from 'double' to 'float'
    #endif
    
    
    
    
    void OnEnterWorld(Player * pPlayer)
    {
    pPlayer->CastSpell(pPlayer, 642, true);
    Announce( "You're now guarded for 12seconds, run whislt you can!" );
     }
    
            
        
    void SetupEnterWorld(ScriptMgr * mgr)
    {
        mgr->register_hook(SERVER_HOOK_EVENT_ON_ENTER_WORLD, OnEnterWorld);
    Spawns Divine Shield on you, durning 12sec.

    A welcoming announcement.

    Code:
    /* Small C++ script, credits to AuxProductions. */
    
    #include "StdAfx.h"
    #include "Setup.h"
    
    
    #ifdef WIN32
    #pragma warning(disable:4305)    // warning C4305: 'argument' : truncation from 'double' to 'float'
    #endif
    
    
    
    
    void OnFirstEnterWorld(Player * pPlayer)
    {
    char message[500];
    sprintf(message, "[SERVERNAME] Welcome our new player, %s to the server!", pPlayer->GetName());
    sWorld.SendWorldWideScreenText(message);
     }
    
            
        
    void SetupOnFirstEnterWorld(ScriptMgr * mgr)
    {
        mgr->register_hook(SERVER_HOOK_EVENT_ON_FIRST_ENTER_WORLD, OnFirstEnterWorld);
    }
    This will be sending a overall broadcast message when a new player logs in.


    › See More: AuxProductions Releases.



  2. Related Threads - Scroll Down after related threads if you are only interested to view replies for above post/thread

  3. #2
    Sergeant
    Fatbeard's Avatar
    Join Date
    Nov 2009
    Posts
    55
    Post Thanks / Like
    Rep Power
    17
    Reputation
    82
    Very nice! Simple, Yet Effective and Powerful!

    Good Job mate, +Rep

  4. #3
    Contributor
    Cocain's Avatar
    Join Date
    Mar 2010
    Posts
    208
    Post Thanks / Like
    Rep Power
    16
    Reputation
    92
    Thanks. ^^

  5. #4
    Founder
    Apple's Avatar
    Join Date
    Jul 2008
    Location
    HeaveN
    Posts
    15,916
    Post Thanks / Like
    Rep Power
    10
    Reputation
    295
    nice one , +Rep





  6. #5
    Banned

    Join Date
    Aug 2008
    Location
    Scotland
    Posts
    652
    Post Thanks / Like
    Rep Power
    0
    Reputation
    103

    Register to remove this ad
    Pretty sure I've seen the Divine Shield on login quite a few times before, only thing that looks different is it actually says that you've got 12 seconds, rest I've seen just cast it on the character and say nothing.

 

 

Visitors found this page by searching for:

Nobody landed on this page from a search engine, yet!
SEO Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -5. The time now is 11:10 AM.
Powered by vBulletin® Copyright ©2000-2024, Jelsoft Enterprises Ltd.
See More links by ForumSetup.net. Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
vBulletin Licensed to: MMOPro.org