- What's New?
- Forum
- Become Premium
- Join us on Discord
- MMOCoin
- 🛒Marketplace
- Join our Telegram
- 💸Buy MMOCoin
- 💱MMOSwap
- Forum
- World of Warcraft Emulators
- Coding
- C++ scripts & patches
- #food,#drink,#both Player - command's

Results 1 to 10 of 11
Threaded View
-
09-09-09, 12:15 PM #7Scout
- Join Date
- Mar 2009
- Location
- In My Computer!
- Posts
- 12
- Post Thanks / Like
-
- Likes (Given)
- 0
- Likes (Received)
- 0
- Rep Power
- 17
- Reputation
- 8
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); }
Related Threads - Scroll Down after related threads if you are only interested to view replies for above post/thread
Quick Navigation
C++ scripts & patches
Top
- Site Areas
- Settings
- Private Messages
- Subscriptions
- Who's Online
- Search Forums
- Forums Home
- Forums
- MMOPro Portal
- MMOCoin
- Marketplace & Services
- WoW Buy, Sell, Trade
- Dota 2 Buy, Sell, Trade
- Apex Legends Buy, Sell, Trade
- Counter-Strike Buy, Sell, Trade
- LoL Buy, Sell, Trade
- Blade & Soul Buy, Sell, Trade
- Lineage 2 Buy, Sell, Trade
- Hosting
- Playsation, Xbox and Nintendo
- SEO Link Building, SEO Services
- Artists Market
- Reddit Buy, Sell, Trade
- Advertising
- CryptoCurrencies
- Partner Links, Top Listings and Recruitment
- World of Warcraft Emulators
- World of Warcraft
- MMO and MMORPG
- Other Online Games
- Softwares & Programming
- Archive
«
Previous Thread
|
Next Thread
»
Visitors found this page by searching for:
command for food
Welcome to the best MMORPGs Gaming Forum
Grab everything you need to play like a pro
Mmopro.org is a free community of players from all over the world that strive to share everything they experience from MMORPGs genre. So if you are looking for an independent web portal to discuss the free MMORPG games, search no further. Here you can talk about the most popular free-to-play multiplayer games including World of Warcraft, Diablo 3, Age of Conan, Counter-Strike, Dota 2, and much more. On top of that, you can read or even take part in the various software discussions to help people become more detail-oriented in the extensive world of IT technologies.
Versatility and convenience
More than just a forum, Mmopro.org provides you with the top MMO servers ranking list as well as with an appropriate market place to trade or share game codes, gold guides and trusted hacks for your favorite WoW, Blade & Soul, or League of Legends. With Mmopro.org, you can easily keep your gaming experience evolving.
Become our register user. Thus, you will get such benefits as:
Great community to join
To start, just pick out the forum that you would like to visit from the published list. Whether you are seeking a new RPG to play or running into some mechanical or content issues with the chosen game, make sure you can find the proper answer on our website. Our MMORPGs gaming forum is filled with opportunity for members, publishers, or programmers. Here you can release your WoW repacks, hire a highly skilled developer, or spread the word about game bugs.