PDA

View Full Version : hunter pet trainer



xepher
19-01-09, 12:23 PM
This C++ script will give a hunter a pet when they talk to the npc

All credits to Deathdude for finding summit, but some people i know DO NOT want to download it for fear or virus's. I don't know people are just weird so i am providing them with the scripts in it.





#include "StdAfx.h"
#include "Setup.h"

#define SendQuickMenu(textid) objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), textid, Plr); \
Menu->SendTo(Plr);

void SpawnPet(Player * pPlayer, uint32 petId)
{
if(pPlayer->getClass() == HUNTER)
{
uint32 Entry = petId;
CreatureProto * pTemplate = CreatureProtoStorage.LookupEntry(Entry);
CreatureInfo * pCreatureInfo = CreatureNameStorage.LookupEntry(Entry);
Creature * pCreature = new Creature(0xF1300000);
CreatureSpawn * sp = new CreatureSpawn;
sp->id = 1;
sp->bytes = 0;
sp->bytes2 = 0;
sp->displayid = pCreatureInfo->Male_DisplayID;
sp->emote_state = 0;
sp->entry = pCreatureInfo->Id;
sp->factionid = 35;
sp->flags = 0;
sp->form = 0;
sp->movetype = 0;
sp->o = pPlayer->GetOrientation();
sp->x = pPlayer->GetPositionX();
sp->y = pPlayer->GetPositionY();
sp->channel_spell=sp->channel_target_creature=sp->channel_target_go=0;
pCreature->Load(sp, (uint32)NULL, NULL);
Pet *old_pet = pPlayer->GetSummon();
if(old_pet != NULL)
old_pet->Dismiss(true);

Pet * pPet = objmgr.CreatePet();
pPet->SetInstanceID(pPlayer->GetInstanceID());
pPet->SetMapId(pPlayer->GetMapId());
pPet->SetFloatValue(OBJECT_FIELD_SCALE_X, pTemplate->Scale / 2);

LiLLeCarl
28-01-09, 01:42 AM
this is an ooooooolllllddddd script