Likes: 0
Results 1 to 3 of 3
Thread: A couple basic player commands
-
12-07-09, 01:48 PM #1
A couple basic player commands
Register to remove this adCode:#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); }
A player can also type #strudel and receive 20 conjured mana strudels
› See More: A couple basic player commandsLast edited by Sdyess94; 12-07-09 at 02:17 PM.
-
12-07-09, 01:55 PM #2
-
12-07-09, 02:17 PM #3
Register to remove this adEdited.
Related Threads - Scroll Down after related threads if you are only interested to view replies for above post/thread
Visitors found this page by searching for:
Nobody landed on this page from a search engine, yet!
SEO Blog