A bit of a necro, but I have fixed his commands
Code:/* Credits claimed by AuxProductions. More functions WILL be added on request. */ #include "StdAfx.h" #include "Setup.h" #ifdef WIN32 #pragma warning(disable:4305) // Disables the funky warning. #endif // Defines. #define FOOD 35953 // http://www.wowhead.com/?item=35953 #define DRINK 33445 // http://www.wowhead.com/?item=33445 // Command Registration static string food = "%food"; // Adds the item '35953'. static string drink = "%drink"; // Adds the item '33445'. static string buffs ="%buffs"; // Buffs the player. bool AuxChat(Player * Plr, uint32 Type, uint32 Lang, const char * Message, const char * Misc) { if(Message == food) { Item * item; item = objmgr.CreateItem(FOOD, Plr); item->SetUInt32Value(ITEM_FIELD_STACK_COUNT, 10); if(Plr->CombatStatus.IsInCombat()) { Plr->BroadcastMessage("You are in combat!"); item->DeleteMe(); return true; } else if(!Plr->GetItemInterface()->AddItemToFreeSlot(item)) { Plr->BroadcastMessage("No free slots were found in your inventory!"); item->DeleteMe(); } else { SlotResult * sr = Plr->GetItemInterface()->LastSearchResult(); Plr->GetItemInterface()->AddItemById(DRINK, 10, 0); } } else if(Message == drink) { Item * item; item = objmgr.CreateItem(DRINK, Plr); item->SetUInt32Value(ITEM_FIELD_STACK_COUNT, 10); if(Plr->CombatStatus.IsInCombat()) { Plr->BroadcastMessage("You are in combat!"); item->DeleteMe(); return true; } else if(!Plr->GetItemInterface()->AddItemToFreeSlot(item)) { Plr->BroadcastMessage("No free slots were found in your inventory!"); item->DeleteMe(); } else { SlotResult * sr = Plr->GetItemInterface()->LastSearchResult(); Plr->GetItemInterface()->AddItemById(DRINK, 10, 0); } } if(Message == buffs) { Plr->CastSpell(Plr, 20217, true); // BoK Plr->CastSpell(Plr, 48469, true); // Mark of the wild. Plr->BroadcastMessage("You are now buffed!"); //orly? } return true; } void SetupChat(ScriptMgr *mgr) { mgr->register_hook(SERVER_HOOK_EVENT_ON_CHAT, &AuxChat); }


Likes: 






Reply With Quote
Bookmarks