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
Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Scout

    Join Date
    Sep 2008
    Posts
    7
    Post Thanks / Like
    Rep Power
    17
    Reputation
    10

    #food,#drink,#both Player - command's


    Register to remove this ad
    So i got bored and made this. Note: Not tested or compiled so any errors Post.

    PlayerCommands.cpp:
    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    
    #define FOOD_ADD    33254
    #define DRINK_ADD    33236
    #define BOTH_ADD    34062
    #define MPOT_ADD    32948
    #define HPOT_ADD    32947
    #define STACK_COUNT        20
    
    static string food = "#food";
    static string food = "#drink";
    static string food = "#both";
    static string food = "#mpot";
    static string food = "#hpot";
    
    void EventPlayerCommands(Player * Plr, uint32 Type, uint32 Lang, const char * Message, const char * Misc)
    {
        if(Message == food)
        {
            ItemPrototype *proto;
            ItemPrototype* it = ItemPrototypeStorage.LookupEntry(FOOD_ADD);
            SlotResult slot;
            Item * pItem = objmgr.CreateItem(FOOD_ADD, Plr);
            proto = pItem->GetProto();
            slot = Plr->GetItemInterface()->FindFreeInventorySlot(proto);
            if(slot.Result)
            {
                pItem->SetUInt32Value(ITEM_FIELD_STACK_COUNT, STACK_COUNT);
                pItem->SetOwner(Plr);
                if (pItem->GetProto()->Bonding == ITEM_BIND_ON_PICKUP)
                    pItem->SoulBind();
                pItem->m_isDirty = true;
                Plr->GetItemInterface()->SafeAddItem(pItem,slot.ContainerSlot,slot.Slot);
                if(Plr->IsInWorld() && !pItem->IsInWorld())
                {
                    pItem->PushToWorld(Plr->GetMapMgr());
    
                    ByteBuffer buf(2500);
                    uint32 count = pItem->BuildCreateUpdateBlockForPlayer(&buf, Plr);
                    Plr->PushCreationData(&buf, count);
                }
            }
        }
    
        elseif(Message == drink)
        {
            ItemPrototype *proto;
            ItemPrototype* it = ItemPrototypeStorage.LookupEntry(DRINK_ADD);
            SlotResult slot;
            Item * pItem = objmgr.CreateItem(DRINK_ADD, Plr);
            proto = pItem->GetProto();
            slot = Plr->GetItemInterface()->FindFreeInventorySlot(proto);
            if(slot.Result)
            {
                pItem->SetUInt32Value(ITEM_FIELD_STACK_COUNT, STACK_COUNT);
                pItem->SetOwner(Plr);
                if (pItem->GetProto()->Bonding == ITEM_BIND_ON_PICKUP)
                    pItem->SoulBind();
                pItem->m_isDirty = true;
                Plr->GetItemInterface()->SafeAddItem(pItem,slot.ContainerSlot,slot.Slot);
                if(Plr->IsInWorld() && !pItem->IsInWorld())
                {
                    pItem->PushToWorld(Plr->GetMapMgr());
    
                    ByteBuffer buf(2500);
                    uint32 count = pItem->BuildCreateUpdateBlockForPlayer(&buf, Plr);
                    Plr->PushCreationData(&buf, count);
                }
            }
        }
    
        elseif(Message == both)
        {
            ItemPrototype *proto;
            ItemPrototype* it = ItemPrototypeStorage.LookupEntry(FOOD_ADD);
            SlotResult slot;
            Item * pItem = objmgr.CreateItem(BOTH_ADD, Plr);
            proto = pItem->GetProto();
            slot = Plr->GetItemInterface()->FindFreeInventorySlot(proto);
            if(slot.Result)
            {
                pItem->SetUInt32Value(ITEM_FIELD_STACK_COUNT, STACK_COUNT);
                pItem->SetOwner(Plr);
                if (pItem->GetProto()->Bonding == ITEM_BIND_ON_PICKUP)
                    pItem->SoulBind();
                pItem->m_isDirty = true;
                Plr->GetItemInterface()->SafeAddItem(pItem,slot.ContainerSlot,slot.Slot);
                if(Plr->IsInWorld() && !pItem->IsInWorld())
                {
                    pItem->PushToWorld(Plr->GetMapMgr());
    
                    ByteBuffer buf(2500);
                    uint32 count = pItem->BuildCreateUpdateBlockForPlayer(&buf, Plr);
                    Plr->PushCreationData(&buf, count);
                }
            }
        }
    
        elseif(Message == hpot)
        {
            ItemPrototype *proto;
            ItemPrototype* it = ItemPrototypeStorage.LookupEntry(FOOD_ADD);
            SlotResult slot;
            Item * pItem = objmgr.CreateItem(HPOT_ADD, Plr);
            proto = pItem->GetProto();
            slot = Plr->GetItemInterface()->FindFreeInventorySlot(proto);
            if(slot.Result)
            {
                pItem->SetUInt32Value(ITEM_FIELD_STACK_COUNT, STACK_COUNT);
                pItem->SetOwner(Plr);
                if (pItem->GetProto()->Bonding == ITEM_BIND_ON_PICKUP)
                    pItem->SoulBind();
                pItem->m_isDirty = true;
                Plr->GetItemInterface()->SafeAddItem(pItem,slot.ContainerSlot,slot.Slot);
                if(Plr->IsInWorld() && !pItem->IsInWorld())
                {
                    pItem->PushToWorld(Plr->GetMapMgr());
    
                    ByteBuffer buf(2500);
                    uint32 count = pItem->BuildCreateUpdateBlockForPlayer(&buf, Plr);
                    Plr->PushCreationData(&buf, count);
                }
            }
        }
    
        elseif(Message == mpot)
        {
            ItemPrototype *proto;
            ItemPrototype* it = ItemPrototypeStorage.LookupEntry(FOOD_ADD);
            SlotResult slot;
            Item * pItem = objmgr.CreateItem(MPOT_ADD, Plr);
            proto = pItem->GetProto();
            slot = Plr->GetItemInterface()->FindFreeInventorySlot(proto);
            if(slot.Result)
            {
                pItem->SetUInt32Value(ITEM_FIELD_STACK_COUNT, STACK_COUNT);
                pItem->SetOwner(Plr);
                if (pItem->GetProto()->Bonding == ITEM_BIND_ON_PICKUP)
                    pItem->SoulBind();
                pItem->m_isDirty = true;
                Plr->GetItemInterface()->SafeAddItem(pItem,slot.ContainerSlot,slot.Slot);
                if(Plr->IsInWorld() && !pItem->IsInWorld())
                {
                    pItem->PushToWorld(Plr->GetMapMgr());
    
                    ByteBuffer buf(2500);
                    uint32 count = pItem->BuildCreateUpdateBlockForPlayer(&buf, Plr);
                    Plr->PushCreationData(&buf, count);
                }
            }
        }
    }
    
    void SetupPlayerCommands(ScriptMgr * mgr)
    {
        mgr->register_hook(SERVER_HOOK_EVENT_ON_CHAT, (void *) EventPlayerCommands);
    }#include "StdAfx.h"
    #include "Setup.h"
    
    #define FOOD_ADD    33254
    #define DRINK_ADD    33236
    #define BOTH_ADD    34062
    #define MPOT_ADD    32948
    #define HPOT_ADD    32947
    #define STACK_COUNT        20
    
    static string food = "#food";
    static string food = "#drink";
    static string food = "#both";
    static string food = "#mpot";
    static string food = "#hpot";
    
    void EventPlayerCommands(Player * Plr, uint32 Type, uint32 Lang, const char * Message, const char * Misc)
    {
        if(Message == food)
        {
            ItemPrototype *proto;
            ItemPrototype* it = ItemPrototypeStorage.LookupEntry(FOOD_ADD);
            SlotResult slot;
            Item * pItem = objmgr.CreateItem(FOOD_ADD, Plr);
            proto = pItem->GetProto();
            slot = Plr->GetItemInterface()->FindFreeInventorySlot(proto);
            if(slot.Result)
            {
                pItem->SetUInt32Value(ITEM_FIELD_STACK_COUNT, STACK_COUNT);
                pItem->SetOwner(Plr);
                if (pItem->GetProto()->Bonding == ITEM_BIND_ON_PICKUP)
                    pItem->SoulBind();
                pItem->m_isDirty = true;
                Plr->GetItemInterface()->SafeAddItem(pItem,slot.ContainerSlot,slot.Slot);
                if(Plr->IsInWorld() && !pItem->IsInWorld())
                {
                    pItem->PushToWorld(Plr->GetMapMgr());
    
                    ByteBuffer buf(2500);
                    uint32 count = pItem->BuildCreateUpdateBlockForPlayer(&buf, Plr);
                    Plr->PushCreationData(&buf, count);
                }
            }
        }
    
        elseif(Message == drink)
        {
            ItemPrototype *proto;
            ItemPrototype* it = ItemPrototypeStorage.LookupEntry(DRINK_ADD);
            SlotResult slot;
            Item * pItem = objmgr.CreateItem(DRINK_ADD, Plr);
            proto = pItem->GetProto();
            slot = Plr->GetItemInterface()->FindFreeInventorySlot(proto);
            if(slot.Result)
            {
                pItem->SetUInt32Value(ITEM_FIELD_STACK_COUNT, STACK_COUNT);
                pItem->SetOwner(Plr);
                if (pItem->GetProto()->Bonding == ITEM_BIND_ON_PICKUP)
                    pItem->SoulBind();
                pItem->m_isDirty = true;
                Plr->GetItemInterface()->SafeAddItem(pItem,slot.ContainerSlot,slot.Slot);
                if(Plr->IsInWorld() && !pItem->IsInWorld())
                {
                    pItem->PushToWorld(Plr->GetMapMgr());
    
                    ByteBuffer buf(2500);
                    uint32 count = pItem->BuildCreateUpdateBlockForPlayer(&buf, Plr);
                    Plr->PushCreationData(&buf, count);
                }
            }
        }
    
        elseif(Message == both)
        {
            ItemPrototype *proto;
            ItemPrototype* it = ItemPrototypeStorage.LookupEntry(FOOD_ADD);
            SlotResult slot;
            Item * pItem = objmgr.CreateItem(BOTH_ADD, Plr);
            proto = pItem->GetProto();
            slot = Plr->GetItemInterface()->FindFreeInventorySlot(proto);
            if(slot.Result)
            {
                pItem->SetUInt32Value(ITEM_FIELD_STACK_COUNT, STACK_COUNT);
                pItem->SetOwner(Plr);
                if (pItem->GetProto()->Bonding == ITEM_BIND_ON_PICKUP)
                    pItem->SoulBind();
                pItem->m_isDirty = true;
                Plr->GetItemInterface()->SafeAddItem(pItem,slot.ContainerSlot,slot.Slot);
                if(Plr->IsInWorld() && !pItem->IsInWorld())
                {
                    pItem->PushToWorld(Plr->GetMapMgr());
    
                    ByteBuffer buf(2500);
                    uint32 count = pItem->BuildCreateUpdateBlockForPlayer(&buf, Plr);
                    Plr->PushCreationData(&buf, count);
                }
            }
        }
    
        elseif(Message == hpot)
        {
            ItemPrototype *proto;
            ItemPrototype* it = ItemPrototypeStorage.LookupEntry(FOOD_ADD);
            SlotResult slot;
            Item * pItem = objmgr.CreateItem(HPOT_ADD, Plr);
            proto = pItem->GetProto();
            slot = Plr->GetItemInterface()->FindFreeInventorySlot(proto);
            if(slot.Result)
            {
                pItem->SetUInt32Value(ITEM_FIELD_STACK_COUNT, STACK_COUNT);
                pItem->SetOwner(Plr);
                if (pItem->GetProto()->Bonding == ITEM_BIND_ON_PICKUP)
                    pItem->SoulBind();
                pItem->m_isDirty = true;
                Plr->GetItemInterface()->SafeAddItem(pItem,slot.ContainerSlot,slot.Slot);
                if(Plr->IsInWorld() && !pItem->IsInWorld())
                {
                    pItem->PushToWorld(Plr->GetMapMgr());
    
                    ByteBuffer buf(2500);
                    uint32 count = pItem->BuildCreateUpdateBlockForPlayer(&buf, Plr);
                    Plr->PushCreationData(&buf, count);
                }
            }
        }
    
        elseif(Message == mpot)
        {
            ItemPrototype *proto;
            ItemPrototype* it = ItemPrototypeStorage.LookupEntry(FOOD_ADD);
            SlotResult slot;
            Item * pItem = objmgr.CreateItem(MPOT_ADD, Plr);
            proto = pItem->GetProto();
            slot = Plr->GetItemInterface()->FindFreeInventorySlot(proto);
            if(slot.Result)
            {
                pItem->SetUInt32Value(ITEM_FIELD_STACK_COUNT, STACK_COUNT);
                pItem->SetOwner(Plr);
                if (pItem->GetProto()->Bonding == ITEM_BIND_ON_PICKUP)
                    pItem->SoulBind();
                pItem->m_isDirty = true;
                Plr->GetItemInterface()->SafeAddItem(pItem,slot.ContainerSlot,slot.Slot);
                if(Plr->IsInWorld() && !pItem->IsInWorld())
                {
                    pItem->PushToWorld(Plr->GetMapMgr());
    
                    ByteBuffer buf(2500);
                    uint32 count = pItem->BuildCreateUpdateBlockForPlayer(&buf, Plr);
                    Plr->PushCreationData(&buf, count);
                }
            }
        }
    }
    
    void SetupPlayerCommands(ScriptMgr * mgr)
    {
        mgr->register_hook(SERVER_HOOK_EVENT_ON_CHAT, (void *) EventPlayerCommands);
    }
    Gl and if it works HF




    › See More: #food,#drink,#both Player - command's
    Last edited by You_Got_Tescoed; 08-09-08 at 03:13 PM.



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

  3. #2
    Contributor
    Boxxy's Avatar
    Join Date
    Aug 2008
    Location
    Florida
    Posts
    351
    Post Thanks / Like
    Rep Power
    18
    Reputation
    136
    So this adds items to a player? This has been done in lua and is 10x more simpler XD.

    But still nice release
    your mother

  4. #3
    Scout

    Join Date
    Sep 2008
    Posts
    7
    Post Thanks / Like
    Rep Power
    17
    Reputation
    10
    Yep Depending On What String or Text yuo type in the chat it will add you a item. Aka typeing #both will give you a mana biscuit with both health and food. 'food #water, Guess =D

  5. #4
    Scout

    Join Date
    Sep 2008
    Posts
    7
    Post Thanks / Like
    Rep Power
    17
    Reputation
    10
    Update!: Added Health and Mana Pot Commands.

    Also a note: You may want to add Flood Protection a bit more with theese

  6. #5
    Contributor
    StickyIcky's Avatar
    Join Date
    Jul 2008
    Location
    127.0.0.1
    Posts
    747
    Post Thanks / Like
    Rep Power
    19
    Reputation
    188
    You should make this so it will check the players lvl
    and give them the correct food/water

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





  8. #7
    Scout
    Torgash's Avatar
    Join Date
    Mar 2009
    Location
    In My Computer!
    Posts
    12
    Post Thanks / Like
    Rep Power
    16
    Reputation
    8
    Quote Originally Posted by You_Got_Tescoed View Post
    So i got bored and made this. Note: Not tested or compiled so any errors Post.

    PlayerCommands.cpp:
    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    
    #define FOOD_ADD    33254
    #define DRINK_ADD    33236
    #define BOTH_ADD    34062
    #define MPOT_ADD    32948
    #define HPOT_ADD    32947
    #define STACK_COUNT        20
    
    static string food = "#food";
    static string food = "#drink";
    static string food = "#both";
    static string food = "#mpot";
    static string food = "#hpot";
    
    void EventPlayerCommands(Player * Plr, uint32 Type, uint32 Lang, const char * Message, const char * Misc)
    {
        if(Message == food)
        {
            ItemPrototype *proto;
            ItemPrototype* it = ItemPrototypeStorage.LookupEntry(FOOD_ADD);
            SlotResult slot;
            Item * pItem = objmgr.CreateItem(FOOD_ADD, Plr);
            proto = pItem->GetProto();
            slot = Plr->GetItemInterface()->FindFreeInventorySlot(proto);
            if(slot.Result)
            {
                pItem->SetUInt32Value(ITEM_FIELD_STACK_COUNT, STACK_COUNT);
                pItem->SetOwner(Plr);
                if (pItem->GetProto()->Bonding == ITEM_BIND_ON_PICKUP)
                    pItem->SoulBind();
                pItem->m_isDirty = true;
                Plr->GetItemInterface()->SafeAddItem(pItem,slot.ContainerSlot,slot.Slot);
                if(Plr->IsInWorld() && !pItem->IsInWorld())
                {
                    pItem->PushToWorld(Plr->GetMapMgr());
    
                    ByteBuffer buf(2500);
                    uint32 count = pItem->BuildCreateUpdateBlockForPlayer(&buf, Plr);
                    Plr->PushCreationData(&buf, count);
                }
            }
        }
    
        elseif(Message == drink)
        {
            ItemPrototype *proto;
            ItemPrototype* it = ItemPrototypeStorage.LookupEntry(DRINK_ADD);
            SlotResult slot;
            Item * pItem = objmgr.CreateItem(DRINK_ADD, Plr);
            proto = pItem->GetProto();
            slot = Plr->GetItemInterface()->FindFreeInventorySlot(proto);
            if(slot.Result)
            {
                pItem->SetUInt32Value(ITEM_FIELD_STACK_COUNT, STACK_COUNT);
                pItem->SetOwner(Plr);
                if (pItem->GetProto()->Bonding == ITEM_BIND_ON_PICKUP)
                    pItem->SoulBind();
                pItem->m_isDirty = true;
                Plr->GetItemInterface()->SafeAddItem(pItem,slot.ContainerSlot,slot.Slot);
                if(Plr->IsInWorld() && !pItem->IsInWorld())
                {
                    pItem->PushToWorld(Plr->GetMapMgr());
    
                    ByteBuffer buf(2500);
                    uint32 count = pItem->BuildCreateUpdateBlockForPlayer(&buf, Plr);
                    Plr->PushCreationData(&buf, count);
                }
            }
        }
    
        elseif(Message == both)
        {
            ItemPrototype *proto;
            ItemPrototype* it = ItemPrototypeStorage.LookupEntry(FOOD_ADD);
            SlotResult slot;
            Item * pItem = objmgr.CreateItem(BOTH_ADD, Plr);
            proto = pItem->GetProto();
            slot = Plr->GetItemInterface()->FindFreeInventorySlot(proto);
            if(slot.Result)
            {
                pItem->SetUInt32Value(ITEM_FIELD_STACK_COUNT, STACK_COUNT);
                pItem->SetOwner(Plr);
                if (pItem->GetProto()->Bonding == ITEM_BIND_ON_PICKUP)
                    pItem->SoulBind();
                pItem->m_isDirty = true;
                Plr->GetItemInterface()->SafeAddItem(pItem,slot.ContainerSlot,slot.Slot);
                if(Plr->IsInWorld() && !pItem->IsInWorld())
                {
                    pItem->PushToWorld(Plr->GetMapMgr());
    
                    ByteBuffer buf(2500);
                    uint32 count = pItem->BuildCreateUpdateBlockForPlayer(&buf, Plr);
                    Plr->PushCreationData(&buf, count);
                }
            }
        }
    
        elseif(Message == hpot)
        {
            ItemPrototype *proto;
            ItemPrototype* it = ItemPrototypeStorage.LookupEntry(FOOD_ADD);
            SlotResult slot;
            Item * pItem = objmgr.CreateItem(HPOT_ADD, Plr);
            proto = pItem->GetProto();
            slot = Plr->GetItemInterface()->FindFreeInventorySlot(proto);
            if(slot.Result)
            {
                pItem->SetUInt32Value(ITEM_FIELD_STACK_COUNT, STACK_COUNT);
                pItem->SetOwner(Plr);
                if (pItem->GetProto()->Bonding == ITEM_BIND_ON_PICKUP)
                    pItem->SoulBind();
                pItem->m_isDirty = true;
                Plr->GetItemInterface()->SafeAddItem(pItem,slot.ContainerSlot,slot.Slot);
                if(Plr->IsInWorld() && !pItem->IsInWorld())
                {
                    pItem->PushToWorld(Plr->GetMapMgr());
    
                    ByteBuffer buf(2500);
                    uint32 count = pItem->BuildCreateUpdateBlockForPlayer(&buf, Plr);
                    Plr->PushCreationData(&buf, count);
                }
            }
        }
    
        elseif(Message == mpot)
        {
            ItemPrototype *proto;
            ItemPrototype* it = ItemPrototypeStorage.LookupEntry(FOOD_ADD);
            SlotResult slot;
            Item * pItem = objmgr.CreateItem(MPOT_ADD, Plr);
            proto = pItem->GetProto();
            slot = Plr->GetItemInterface()->FindFreeInventorySlot(proto);
            if(slot.Result)
            {
                pItem->SetUInt32Value(ITEM_FIELD_STACK_COUNT, STACK_COUNT);
                pItem->SetOwner(Plr);
                if (pItem->GetProto()->Bonding == ITEM_BIND_ON_PICKUP)
                    pItem->SoulBind();
                pItem->m_isDirty = true;
                Plr->GetItemInterface()->SafeAddItem(pItem,slot.ContainerSlot,slot.Slot);
                if(Plr->IsInWorld() && !pItem->IsInWorld())
                {
                    pItem->PushToWorld(Plr->GetMapMgr());
    
                    ByteBuffer buf(2500);
                    uint32 count = pItem->BuildCreateUpdateBlockForPlayer(&buf, Plr);
                    Plr->PushCreationData(&buf, count);
                }
            }
        }
    }
    
    void SetupPlayerCommands(ScriptMgr * mgr)
    {
        mgr->register_hook(SERVER_HOOK_EVENT_ON_CHAT, (void *) EventPlayerCommands);
    }#include "StdAfx.h"
    #include "Setup.h"
    
    #define FOOD_ADD    33254
    #define DRINK_ADD    33236
    #define BOTH_ADD    34062
    #define MPOT_ADD    32948
    #define HPOT_ADD    32947
    #define STACK_COUNT        20
    
    static string food = "#food";
    static string food = "#drink";
    static string food = "#both";
    static string food = "#mpot";
    static string food = "#hpot";
    
    void EventPlayerCommands(Player * Plr, uint32 Type, uint32 Lang, const char * Message, const char * Misc)
    {
        if(Message == food)
        {
            ItemPrototype *proto;
            ItemPrototype* it = ItemPrototypeStorage.LookupEntry(FOOD_ADD);
            SlotResult slot;
            Item * pItem = objmgr.CreateItem(FOOD_ADD, Plr);
            proto = pItem->GetProto();
            slot = Plr->GetItemInterface()->FindFreeInventorySlot(proto);
            if(slot.Result)
            {
                pItem->SetUInt32Value(ITEM_FIELD_STACK_COUNT, STACK_COUNT);
                pItem->SetOwner(Plr);
                if (pItem->GetProto()->Bonding == ITEM_BIND_ON_PICKUP)
                    pItem->SoulBind();
                pItem->m_isDirty = true;
                Plr->GetItemInterface()->SafeAddItem(pItem,slot.ContainerSlot,slot.Slot);
                if(Plr->IsInWorld() && !pItem->IsInWorld())
                {
                    pItem->PushToWorld(Plr->GetMapMgr());
    
                    ByteBuffer buf(2500);
                    uint32 count = pItem->BuildCreateUpdateBlockForPlayer(&buf, Plr);
                    Plr->PushCreationData(&buf, count);
                }
            }
        }
    
        elseif(Message == drink)
        {
            ItemPrototype *proto;
            ItemPrototype* it = ItemPrototypeStorage.LookupEntry(DRINK_ADD);
            SlotResult slot;
            Item * pItem = objmgr.CreateItem(DRINK_ADD, Plr);
            proto = pItem->GetProto();
            slot = Plr->GetItemInterface()->FindFreeInventorySlot(proto);
            if(slot.Result)
            {
                pItem->SetUInt32Value(ITEM_FIELD_STACK_COUNT, STACK_COUNT);
                pItem->SetOwner(Plr);
                if (pItem->GetProto()->Bonding == ITEM_BIND_ON_PICKUP)
                    pItem->SoulBind();
                pItem->m_isDirty = true;
                Plr->GetItemInterface()->SafeAddItem(pItem,slot.ContainerSlot,slot.Slot);
                if(Plr->IsInWorld() && !pItem->IsInWorld())
                {
                    pItem->PushToWorld(Plr->GetMapMgr());
    
                    ByteBuffer buf(2500);
                    uint32 count = pItem->BuildCreateUpdateBlockForPlayer(&buf, Plr);
                    Plr->PushCreationData(&buf, count);
                }
            }
        }
    
        elseif(Message == both)
        {
            ItemPrototype *proto;
            ItemPrototype* it = ItemPrototypeStorage.LookupEntry(FOOD_ADD);
            SlotResult slot;
            Item * pItem = objmgr.CreateItem(BOTH_ADD, Plr);
            proto = pItem->GetProto();
            slot = Plr->GetItemInterface()->FindFreeInventorySlot(proto);
            if(slot.Result)
            {
                pItem->SetUInt32Value(ITEM_FIELD_STACK_COUNT, STACK_COUNT);
                pItem->SetOwner(Plr);
                if (pItem->GetProto()->Bonding == ITEM_BIND_ON_PICKUP)
                    pItem->SoulBind();
                pItem->m_isDirty = true;
                Plr->GetItemInterface()->SafeAddItem(pItem,slot.ContainerSlot,slot.Slot);
                if(Plr->IsInWorld() && !pItem->IsInWorld())
                {
                    pItem->PushToWorld(Plr->GetMapMgr());
    
                    ByteBuffer buf(2500);
                    uint32 count = pItem->BuildCreateUpdateBlockForPlayer(&buf, Plr);
                    Plr->PushCreationData(&buf, count);
                }
            }
        }
    
        elseif(Message == hpot)
        {
            ItemPrototype *proto;
            ItemPrototype* it = ItemPrototypeStorage.LookupEntry(FOOD_ADD);
            SlotResult slot;
            Item * pItem = objmgr.CreateItem(HPOT_ADD, Plr);
            proto = pItem->GetProto();
            slot = Plr->GetItemInterface()->FindFreeInventorySlot(proto);
            if(slot.Result)
            {
                pItem->SetUInt32Value(ITEM_FIELD_STACK_COUNT, STACK_COUNT);
                pItem->SetOwner(Plr);
                if (pItem->GetProto()->Bonding == ITEM_BIND_ON_PICKUP)
                    pItem->SoulBind();
                pItem->m_isDirty = true;
                Plr->GetItemInterface()->SafeAddItem(pItem,slot.ContainerSlot,slot.Slot);
                if(Plr->IsInWorld() && !pItem->IsInWorld())
                {
                    pItem->PushToWorld(Plr->GetMapMgr());
    
                    ByteBuffer buf(2500);
                    uint32 count = pItem->BuildCreateUpdateBlockForPlayer(&buf, Plr);
                    Plr->PushCreationData(&buf, count);
                }
            }
        }
    
        elseif(Message == mpot)
        {
            ItemPrototype *proto;
            ItemPrototype* it = ItemPrototypeStorage.LookupEntry(FOOD_ADD);
            SlotResult slot;
            Item * pItem = objmgr.CreateItem(MPOT_ADD, Plr);
            proto = pItem->GetProto();
            slot = Plr->GetItemInterface()->FindFreeInventorySlot(proto);
            if(slot.Result)
            {
                pItem->SetUInt32Value(ITEM_FIELD_STACK_COUNT, STACK_COUNT);
                pItem->SetOwner(Plr);
                if (pItem->GetProto()->Bonding == ITEM_BIND_ON_PICKUP)
                    pItem->SoulBind();
                pItem->m_isDirty = true;
                Plr->GetItemInterface()->SafeAddItem(pItem,slot.ContainerSlot,slot.Slot);
                if(Plr->IsInWorld() && !pItem->IsInWorld())
                {
                    pItem->PushToWorld(Plr->GetMapMgr());
    
                    ByteBuffer buf(2500);
                    uint32 count = pItem->BuildCreateUpdateBlockForPlayer(&buf, Plr);
                    Plr->PushCreationData(&buf, count);
                }
            }
        }
    }
    
    void SetupPlayerCommands(ScriptMgr * mgr)
    {
        mgr->register_hook(SERVER_HOOK_EVENT_ON_CHAT, (void *) EventPlayerCommands);
    }
    Gl and if it works HF
    you copied your script twice in the code box

  9. #8
    Contributor
    StickyIcky's Avatar
    Join Date
    Jul 2008
    Location
    127.0.0.1
    Posts
    747
    Post Thanks / Like
    Rep Power
    19
    Reputation
    188
    Plus, what if their under level 75?

  10. #9
    Elite Member
    Dimman's Avatar
    Join Date
    Apr 2009
    Posts
    1,091
    Post Thanks / Like
    Rep Power
    21
    Reputation
    319
    are you sure that this is not a rippoff ive seen this before om ******* and acweb...
    No touching please.

  11. #10
    Contributor
    StickyIcky's Avatar
    Join Date
    Jul 2008
    Location
    127.0.0.1
    Posts
    747
    Post Thanks / Like
    Rep Power
    19
    Reputation
    188

    Register to remove this ad
    I've made this before...
    But it had drinks and shit for all levels...

 

 
Page 1 of 2 12 LastLast

Visitors found this page by searching for:

command for food

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 08:32 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