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 3 of 3
  1. #1
    Grunt
    Sdyess94's Avatar
    Join Date
    Jan 2009
    Posts
    36
    Post Thanks / Like
    Rep Power
    16
    Reputation
    60

    A couple basic player commands


    Register to remove this ad
    Code:
    #include "StdAfx.h" 
    #include "Setup.h" 
    #ifdef WIN32
    #pragma warning(disable:4305) // warning C4305: 'argument' : truncation from 'double' to 'float'
    #endif
    
    #define STRUDEL_TYPE 43523
    #define STRUDEL_AMOUNT 20
    
    static string strudel = "#strudel";
    static string buff = "#buff";
    
    
    bool Commands(Player * pPlayer, uint32 Type, uint32 Lang, const char * Message, const char * Misc)
    {
        if (Message == strudel)
            {
    ItemPrototype* it = ItemPrototypeStorage.LookupEntry(STRUDEL_TYPE);
                    Item *item;
                    item = objmgr.CreateItem( STRUDEL_TYPE, pPlayer);
                    item->SetUInt32Value(ITEM_FIELD_STACK_COUNT, ((STRUDEL_AMOUNT > it->MaxCount) ? it->MaxCount : STRUDEL_AMOUNT));
                    if(it->Bonding==ITEM_BIND_ON_PICKUP)
                            item->SoulBind();
                    if(!pPlayer->GetItemInterface()->AddItemToFreeSlot(item))
                    {
                            pPlayer->BroadcastMessage("No free slots were found in your inventory!");
                            delete item;
                    }
                    SlotResult *lr = pPlayer->GetItemInterface()->LastSearchResult();
                    pPlayer->GetSession()->SendItemPushResult(item,false,true,false,true,lr->ContainerSlot,lr->Slot,STRUDEL_AMOUNT);
            } 
    
            if (Message == buff)
        {
            pPlayer->BroadcastMessage("You are now buffed!");
                 pPlayer->CastSpell(pPlayer, 33077, true);
                 pPlayer->CastSpell(pPlayer, 33078, true);
                 pPlayer->CastSpell(pPlayer, 33079, true);
                 pPlayer->CastSpell(pPlayer, 33080, true);
                 pPlayer->CastSpell(pPlayer, 33081, true);
                 pPlayer->CastSpell(pPlayer, 33082, true);
        }
            return true;
    }
    void SetupCommands(ScriptMgr * mgr)
    {
    mgr->register_hook(SERVER_HOOK_EVENT_ON_CHAT, &Commands);
    }
    Once compiled, a player can type #buff and it will buff them up with the scroll buffs ya know.
    A player can also type #strudel and receive 20 conjured mana strudels




    › See More: A couple basic player commands
    Last edited by Sdyess94; 12-07-09 at 01:17 PM.



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

  3. #2
    Contributor
    Onlykl's Avatar
    Join Date
    Jan 2009
    Location
    127.0.0.1
    Posts
    247
    Post Thanks / Like
    Rep Power
    19
    Reputation
    244
    you should give little info...

  4. #3
    Grunt
    Sdyess94's Avatar
    Join Date
    Jan 2009
    Posts
    36
    Post Thanks / Like
    Rep Power
    16
    Reputation
    60

    Register to remove this ad
    Edited.

 

 

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 05:03 PM.
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