Startequipp Script (How to do?)

Hello guys,

i need to create an custom Script to add an player startequipp ! The player write an command in the chatbox and the server add the equipp to the bags !

#include “ScriptMgr.h”
#include “Chat.h”

class example_commandscript : public CommandScript
{
public:
example_commandscript() : CommandScript(“example_commandscript”) { }

    static bool HandleHelloWorldCommand(ChatHandler* handler, const char* /*args*/)
    {
        handler->PSendSysMessage("Hello World");
        return true;
    }

    ChatCommand* GetCommands() const
    {
        static ChatCommand HelloWorldCommandTable[] =
        {
            { "hello",          SEC_PLAYER,         true,   &HandleHelloWorldCommand,        "", NULL },
            { NULL,             0,                  false,  NULL,                            "", NULL }
        };
        return HelloWorldCommandTable;
    }

};

void AddSC_example_commandscript()
{
new example_commandscript();
}

What i have to do ???

Example :

.startequipp

This Command add the player the follow equipp…

As Warrior: http://www.mobmap.de/itemset?id=699

Can anyone Help me `?

Your public server is giving away legendaries to new players?

No Legendaries

Help me pls !!!

Create a command, name it something and have it grant items (player->AddItem) dependant to class ?

How can i make it real ? Have an example code with … hmmm … if i put in the chatbox as DK .start and the DK become all items from T9 Tank and DD but no Legendaries…

Why not just use the playercreate* tables?

handler->getsession()->getplayer()->add

uint32 entry = YOURITEMENTRY
uint32 slot = SLOTTOEQUIPTO

uint16 dest;
InventoryResult result = player->CanEquipItem(slot, dest, entry, false);
if (result != EQUIP_ERR_OK) // equip slot is filled or not enough level or something
return;
Item* newItem = player->EquipItem(dest, entry, true); // returns the equipped item

Why not just use the playercreate* tables?

I think to have the items equipped you need to rewrite how the items are loaded or something… not sure

By default the outfit comes from the DBCs and you would either need to mod them or mod how its handled in the core.