[Release][C++] Best Master NPC Script! menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    AzolexX's Avatar Contributor
    Reputation
    179
    Join Date
    May 2007
    Posts
    587
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Release][C++]BeastmasterNPC Script!

    This NPC Allows Hunters to choose pet and get it Without taming it!
    Code:
    /*Azolex's Beast master script! This is originally by ArcEmu Arena tournament project its been fully fixed and edited by me!
    Fell free to use it :)*\
    
    #include "StdAfx.h"
    #include "Setup.h"
    
    #ifdef WIN32
    #pragma warning(disable:4305)		// warning C4305: 'argument' : truncation from 'double' to 'float'
    #endif
    
    /*
    ------------------------------------------------------------------------------
    --------------------- Beast Master stuff ------------------------
    -----------------------------------------------------------------------------
    */
    
    #define BACK_BUTTON
    
    #ifdef BACK_BUTTON
    
    // Make code neater with this define.
    #define SendQuickMenu(textid) objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), textid, plr); \
        Menu->SendTo(plr);
    
    #else
    
    // Make code neater with this define.
    #define SendQuickMenu(textid) objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), textid, Plr); \
        Menu->AddItem(0, "I was looking for something else.", 0); \
        Menu->SendTo(Plr);
    
    #endif
    
    
    /*
    ----------------- The beast ;) -------------------------------------
    */
    
    #define CN_BAT 10357
    #define CN_BOAR 8303
    #define CN_CARRION 2931
    #define CN_CAT 10200
    #define CN_DRAGON 20502
    #define CN_NETHER 21128
    #define CN_OWL 14343
    #define CN_RAPTOR 5842
    #define CN_REVAGER 19350
    #define CN_SCORPID 14476
    #define CN_SERPENT 19784
    #define CN_SPIDER 574
    #define CN_WARP 18884
    #define CN_WIND 19428
    #define CN_WOLF 8211
    
    class SCRIPT_DECL BeastsMaster : public GossipScript
    {
    public:
    	void Destroy()
    	{
    		delete this;
    	}
    
    	void GossipHello(Object* pObject, Player * plr, bool AutoSend)
    	{
    	Creature * pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?((Creature*)pObject):NULL;
    
    	if(plr->getClass() == 3)
    	{
    		GossipMenu *Menu;
    
    		objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 12342, plr);
    		Menu->AddItem( 0, "Bat", 1);
    		Menu->AddItem( 0, "Boar", 2);
    		Menu->AddItem( 0, "Carrion Bird", 3);
    		Menu->AddItem( 0, "Cat", 4);
    		Menu->AddItem( 0, "Dragonhawk", 5);
    		Menu->AddItem( 0, "Nether Ray", 6);
    		Menu->AddItem( 0, "Owl", 7);
    		Menu->AddItem( 0, "Raptor", 8);
    		Menu->AddItem( 0, "Revager", 9);
    		Menu->AddItem( 0, "Scorpid", 10);
    		Menu->AddItem( 0, "Serpent", 11);
    		Menu->AddItem( 0, "Spider", 12);
    		Menu->AddItem( 0, "Warp Stalker", 13);
    		Menu->AddItem( 0, "Wind Serpent", 14);
    		Menu->AddItem( 0, "Wolf", 15);
    		if(AutoSend)
    		Menu->SendTo(plr);
    	}
    	else
    	{
    		GossipMenu * Menu;
    		objmgr.CreateGossipMenuForPlayer(&Menu,pObject->GetGUID(), 12321,plr);
    		Menu->SendTo(plr);
    		return;
    	}
    	}
    
    	void GossipSelectOption(Object* pObject, Player * plr, uint32 Id, uint32 IntId, const char * Code)
    	{
    		Creature * pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?((Creature*)pObject):NULL;
    		if(pCreature==NULL)
    			return;
    		GossipMenu * Menu;
    
    		switch(IntId)
    		{
       case 0:     // Return to start
       GossipHello(pObject, plr, true);
       break;
    
        case 1:
    	SendQuickMenu(12343);
    		{
    	uint32 Entry = CN_BAT;
    	CreatureProto * pTemplate = CreatureProtoStorage.LookupEntry(Entry);
    	CreatureInfo * pCreatureInfo = CreatureNameStorage.LookupEntry(Entry);
    
    
    	// spawn a creature of this id to create from
    	Creature * pCreature = new Creature(1);//no need in guid
    	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 = pTemplate->Faction;
    	sp->flags = 0;
    	sp->form = 0;
    	sp->movetype = 0;
    	sp->o = plr->GetOrientation();
    	sp->x = plr->GetPositionX();
    	sp->y = plr->GetPositionY();
    	//sp->respawnNpcLink = 0;
    	sp->stand_state = 0;
    	sp->channel_spell=sp->channel_target_creature=sp->channel_target_go=0;
    	pCreature->Load(sp, (uint32)NULL, NULL);
    
    	Pet *old_tame = plr->GetSummon();
    	if(old_tame != NULL)
    	{
    		old_tame->Dismiss(true);
    	}
    
    	// create a pet from this creature
    	Pet * pPet = objmgr.CreatePet();
    	pPet->SetInstanceID(plr->GetInstanceID());
    	pPet->SetMapId(plr->GetMapId());
    	pPet->CreateAsSummon(Entry, pCreatureInfo, pCreature, plr, NULL, 0x2, 0);
    
    	// remove the temp creature
    	delete sp;
    	delete pCreature;
    		};
                    break;
    
        case 2:
    		{
    	uint32 Entry = CN_BOAR;
    	CreatureProto * pTemplate = CreatureProtoStorage.LookupEntry(Entry);
    	CreatureInfo * pCreatureInfo = CreatureNameStorage.LookupEntry(Entry);
    
    	// spawn a creature of this id to create from
    	Creature * pCreature = new Creature(1);//no need in guid
    	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 = pTemplate->Faction;
    	sp->flags = 0;
    	sp->form = 0;
    	sp->movetype = 0;
    	sp->o = plr->GetOrientation();
    	sp->x = plr->GetPositionX();
    	sp->y = plr->GetPositionY();
    	//sp->respawnNpcLink = 0;
    	sp->stand_state = 0;
    	sp->channel_spell=sp->channel_target_creature=sp->channel_target_go=0;
    	pCreature->Load(sp, (uint32)NULL, NULL);
    
    	Pet *old_tame = plr->GetSummon();
    	if(old_tame != NULL)
    	{
    		old_tame->Dismiss(true);
    	}
    
    	// create a pet from this creature
    	Pet * pPet = objmgr.CreatePet();
    	pPet->SetInstanceID(plr->GetInstanceID());
    	pPet->SetMapId(plr->GetMapId());
    	pPet->CreateAsSummon(Entry, pCreatureInfo, pCreature, plr, NULL, 0x2, 0);
    
    	// remove the temp creature
    	delete sp;
    	delete pCreature;
    	SendQuickMenu(12343)
    		}
    	break;
    
        case 3:
    		{
    	uint32 Entry = CN_CARRION;
    	CreatureProto * pTemplate = CreatureProtoStorage.LookupEntry(Entry);
    	CreatureInfo * pCreatureInfo = CreatureNameStorage.LookupEntry(Entry);
    
    	// spawn a creature of this id to create from
    	Creature * pCreature = new Creature(1);//no need in guid
    	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 = pTemplate->Faction;
    	sp->flags = 0;
    	sp->form = 0;
    	sp->movetype = 0;
    	sp->o = plr->GetOrientation();
    	sp->x = plr->GetPositionX();
    	sp->y = plr->GetPositionY();
    	//sp->respawnNpcLink = 0;
    	sp->stand_state = 0;
    	sp->channel_spell=sp->channel_target_creature=sp->channel_target_go=0;
    	pCreature->Load(sp, (uint32)NULL, NULL);
    
    	Pet *old_tame = plr->GetSummon();
    	if(old_tame != NULL)
    	{
    		old_tame->Dismiss(true);
    	}
    
    	// create a pet from this creature
    	Pet * pPet = objmgr.CreatePet();
    	pPet->SetInstanceID(plr->GetInstanceID());
    	pPet->SetMapId(plr->GetMapId());
    	pPet->CreateAsSummon(Entry, pCreatureInfo, pCreature, plr, NULL, 0x2, 0);
    
    	// remove the temp creature
    	delete sp;
    	delete pCreature;
    	SendQuickMenu(12343)
    		}
    	break;
    
                    case 4:
    	{
    	uint32 Entry = CN_CAT;
    	CreatureProto * pTemplate = CreatureProtoStorage.LookupEntry(Entry);
    	CreatureInfo * pCreatureInfo = CreatureNameStorage.LookupEntry(Entry);
    
    	// spawn a creature of this id to create from
    	Creature * pCreature = new Creature(1);//no need in guid
    	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 = pTemplate->Faction;
    	sp->flags = 0;
    	sp->form = 0;
    	sp->movetype = 0;
    	sp->o = plr->GetOrientation();
    	sp->x = plr->GetPositionX();
    	sp->y = plr->GetPositionY();
    	//sp->respawnNpcLink = 0;
    	sp->stand_state = 0;
    	sp->channel_spell=sp->channel_target_creature=sp->channel_target_go=0;
    	pCreature->Load(sp, (uint32)NULL, NULL);
    
    	Pet *old_tame = plr->GetSummon();
    	if(old_tame != NULL)
    	{
    		old_tame->Dismiss(true);
    	}
    
    	// create a pet from this creature
    	Pet * pPet = objmgr.CreatePet();
    	pPet->SetInstanceID(plr->GetInstanceID());
    	pPet->SetMapId(plr->GetMapId());
    	pPet->CreateAsSummon(Entry, pCreatureInfo, pCreature, plr, NULL, 0x2, 0);
    
    	// remove the temp creature
    	delete sp;
    	delete pCreature;
    	SendQuickMenu(12343)
    	}
    	break;
    
                    case 5:
    	{
    	uint32 Entry = CN_DRAGON;
    	CreatureProto * pTemplate = CreatureProtoStorage.LookupEntry(Entry);
    	CreatureInfo * pCreatureInfo = CreatureNameStorage.LookupEntry(Entry);
    
    	// spawn a creature of this id to create from
    	Creature * pCreature = new Creature(1);//no need in guid
    	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 = pTemplate->Faction;
    	sp->flags = 0;
    	sp->form = 0;
    	sp->movetype = 0;
    	sp->o = plr->GetOrientation();
    	sp->x = plr->GetPositionX();
    	sp->y = plr->GetPositionY();
    	//sp->respawnNpcLink = 0;
    	sp->stand_state = 0;
    	sp->channel_spell=sp->channel_target_creature=sp->channel_target_go=0;
    	pCreature->Load(sp, (uint32)NULL, NULL);
    
    	Pet *old_tame = plr->GetSummon();
    	if(old_tame != NULL)
    	{
    		old_tame->Dismiss(true);
    	}
    
    	// create a pet from this creature
    	Pet * pPet = objmgr.CreatePet();
    	pPet->SetInstanceID(plr->GetInstanceID());
    	pPet->SetMapId(plr->GetMapId());
    	pPet->CreateAsSummon(Entry, pCreatureInfo, pCreature, plr, NULL, 0x2, 0);
    
    	// remove the temp creature
    	delete sp;
    	delete pCreature;
    	SendQuickMenu(12343)
    	}
    	break;
    
                    case 6:
    					{
    	uint32 Entry = CN_NETHER;
    	CreatureProto * pTemplate = CreatureProtoStorage.LookupEntry(Entry);
    	CreatureInfo * pCreatureInfo = CreatureNameStorage.LookupEntry(Entry);
    
    	// spawn a creature of this id to create from
    	Creature * pCreature = new Creature(1);//no need in guid
    	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 = pTemplate->Faction;
    	sp->flags = 0;
    	sp->form = 0;
    	sp->movetype = 0;
    	sp->o = plr->GetOrientation();
    	sp->x = plr->GetPositionX();
    	sp->y = plr->GetPositionY();
    	//sp->respawnNpcLink = 0;
    	sp->stand_state = 0;
    	sp->channel_spell=sp->channel_target_creature=sp->channel_target_go=0;
    	pCreature->Load(sp, (uint32)NULL, NULL);
    
    	Pet *old_tame = plr->GetSummon();
    	if(old_tame != NULL)
    	{
    		old_tame->Dismiss(true);
    	}
    
    	// create a pet from this creature
    	Pet * pPet = objmgr.CreatePet();
    	pPet->SetInstanceID(plr->GetInstanceID());
    	pPet->SetMapId(plr->GetMapId());
    	pPet->CreateAsSummon(Entry, pCreatureInfo, pCreature, plr, NULL, 0x2, 0);
    
    	// remove the temp creature
    	delete sp;
    	delete pCreature;
    	SendQuickMenu(12343)
    					}
    	break;
    
                    case 7:
    					{
    	uint32 Entry = CN_OWL;
    	CreatureProto * pTemplate = CreatureProtoStorage.LookupEntry(Entry);
    	CreatureInfo * pCreatureInfo = CreatureNameStorage.LookupEntry(Entry);
    
    	// spawn a creature of this id to create from
    	Creature * pCreature = new Creature(1);//no need in guid
    	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 = pTemplate->Faction;
    	sp->flags = 0;
    	sp->form = 0;
    	sp->movetype = 0;
    	sp->o = plr->GetOrientation();
    	sp->x = plr->GetPositionX();
    	sp->y = plr->GetPositionY();
    	//sp->respawnNpcLink = 0;
    	sp->stand_state = 0;
    	sp->channel_spell=sp->channel_target_creature=sp->channel_target_go=0;
    	pCreature->Load(sp, (uint32)NULL, NULL);
    
    	Pet *old_tame = plr->GetSummon();
    	if(old_tame != NULL)
    	{
    		old_tame->Dismiss(true);
    	}
    
    	// create a pet from this creature
    	Pet * pPet = objmgr.CreatePet();
    	pPet->SetInstanceID(plr->GetInstanceID());
    	pPet->SetMapId(plr->GetMapId());
    	pPet->CreateAsSummon(Entry, pCreatureInfo, pCreature, plr, NULL, 0x2, 0);
    
    	// remove the temp creature
    	delete sp;
    	delete pCreature;
    	SendQuickMenu(12343)
    					}
    	break;
    
                    case 8:
    					{
    	uint32 Entry = CN_RAPTOR;
    	CreatureProto * pTemplate = CreatureProtoStorage.LookupEntry(Entry);
    	CreatureInfo * pCreatureInfo = CreatureNameStorage.LookupEntry(Entry);
    
    	// spawn a creature of this id to create from
    	Creature * pCreature = new Creature(1);//no need in guid
    	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 = pTemplate->Faction;
    	sp->flags = 0;
    	sp->form = 0;
    	sp->movetype = 0;
    	sp->o = plr->GetOrientation();
    	sp->x = plr->GetPositionX();
    	sp->y = plr->GetPositionY();
    	//sp->respawnNpcLink = 0;
    	sp->stand_state = 0;
    	sp->channel_spell=sp->channel_target_creature=sp->channel_target_go=0;
    	pCreature->Load(sp, (uint32)NULL, NULL);
    
    	Pet *old_tame = plr->GetSummon();
    	if(old_tame != NULL)
    	{
    		old_tame->Dismiss(true);
    	}
    
    	// create a pet from this creature
    	Pet * pPet = objmgr.CreatePet();
    	pPet->SetInstanceID(plr->GetInstanceID());
    	pPet->SetMapId(plr->GetMapId());
    	pPet->CreateAsSummon(Entry, pCreatureInfo, pCreature, plr, NULL, 0x2, 0);
    
    	// remove the temp creature
    	delete sp;
    	delete pCreature;
    	SendQuickMenu(12343)
    					}
    	break;
    
                    case 9:
    					{
    	uint32 Entry = CN_REVAGER;
    	CreatureProto * pTemplate = CreatureProtoStorage.LookupEntry(Entry);
    	CreatureInfo * pCreatureInfo = CreatureNameStorage.LookupEntry(Entry);
    
    	// spawn a creature of this id to create from
    	Creature * pCreature = new Creature(1);//no need in guid
    	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 = pTemplate->Faction;
    	sp->flags = 0;
    	sp->form = 0;
    	sp->movetype = 0;
    	sp->o = plr->GetOrientation();
    	sp->x = plr->GetPositionX();
    	sp->y = plr->GetPositionY();
    	//sp->respawnNpcLink = 0;
    	sp->stand_state = 0;
    	sp->channel_spell=sp->channel_target_creature=sp->channel_target_go=0;
    	pCreature->Load(sp, (uint32)NULL, NULL);
    
    	Pet *old_tame = plr->GetSummon();
    	if(old_tame != NULL)
    	{
    		old_tame->Dismiss(true);
    	}
    
    	// create a pet from this creature
    	Pet * pPet = objmgr.CreatePet();
    	pPet->SetInstanceID(plr->GetInstanceID());
    	pPet->SetMapId(plr->GetMapId());
    	pPet->CreateAsSummon(Entry, pCreatureInfo, pCreature, plr, NULL, 0x2, 0);
    
    	// remove the temp creature
    	delete sp;
    	delete pCreature;
    	SendQuickMenu(12343)
    					}
    	break;
    
                    case 10:
    					{
    	uint32 Entry = CN_SCORPID;
    	CreatureProto * pTemplate = CreatureProtoStorage.LookupEntry(Entry);
    	CreatureInfo * pCreatureInfo = CreatureNameStorage.LookupEntry(Entry);
    
    	// spawn a creature of this id to create from
    	Creature * pCreature = new Creature(1);//no need in guid
    	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 = pTemplate->Faction;
    	sp->flags = 0;
    	sp->form = 0;
    	sp->movetype = 0;
    	sp->o = plr->GetOrientation();
    	sp->x = plr->GetPositionX();
    	sp->y = plr->GetPositionY();
    	//sp->respawnNpcLink = 0;
    	sp->stand_state = 0;
    	sp->channel_spell=sp->channel_target_creature=sp->channel_target_go=0;
    	pCreature->Load(sp, (uint32)NULL, NULL);
    
    	Pet *old_tame = plr->GetSummon();
    	if(old_tame != NULL)
    	{
    		old_tame->Dismiss(true);
    	}
    
    	// create a pet from this creature
    	Pet * pPet = objmgr.CreatePet();
    	pPet->SetInstanceID(plr->GetInstanceID());
    	pPet->SetMapId(plr->GetMapId());
    	pPet->CreateAsSummon(Entry, pCreatureInfo, pCreature, plr, NULL, 0x2, 0);
    
    	// remove the temp creature
    	delete sp;
    	delete pCreature;
    	SendQuickMenu(12343)
    					}
    	break;
    
                    case 11:
    					{
    	uint32 Entry = CN_SERPENT;
    	CreatureProto * pTemplate = CreatureProtoStorage.LookupEntry(Entry);
    	CreatureInfo * pCreatureInfo = CreatureNameStorage.LookupEntry(Entry);
    
    	// spawn a creature of this id to create from
    	Creature * pCreature = new Creature(1);//no need in guid
    	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 = pTemplate->Faction;
    	sp->flags = 0;
    	sp->form = 0;
    	sp->movetype = 0;
    	sp->o = plr->GetOrientation();
    	sp->x = plr->GetPositionX();
    	sp->y = plr->GetPositionY();
    	//sp->respawnNpcLink = 0;
    	sp->stand_state = 0;
    	sp->channel_spell=sp->channel_target_creature=sp->channel_target_go=0;
    	pCreature->Load(sp, (uint32)NULL, NULL);
    
    	Pet *old_tame = plr->GetSummon();
    	if(old_tame != NULL)
    	{
    		old_tame->Dismiss(true);
    	}
    
    	// create a pet from this creature
    	Pet * pPet = objmgr.CreatePet();
    	pPet->SetInstanceID(plr->GetInstanceID());
    	pPet->SetMapId(plr->GetMapId());
    	pPet->CreateAsSummon(Entry, pCreatureInfo, pCreature, plr, NULL, 0x2, 0);
    
    	// remove the temp creature
    	delete sp;
    	delete pCreature;
    	SendQuickMenu(12343)
    					}
    	break;
    
                    case 12:
    					{
    	uint32 Entry = CN_SPIDER;
    	CreatureProto * pTemplate = CreatureProtoStorage.LookupEntry(Entry);
    	CreatureInfo * pCreatureInfo = CreatureNameStorage.LookupEntry(Entry);
    
    	// spawn a creature of this id to create from
    	Creature * pCreature = new Creature(1);//no need in guid
    	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 = pTemplate->Faction;
    	sp->flags = 0;
    	sp->form = 0;
    	sp->movetype = 0;
    	sp->o = plr->GetOrientation();
    	sp->x = plr->GetPositionX();
    	sp->y = plr->GetPositionY();
    	//sp->respawnNpcLink = 0;
    	sp->stand_state = 0;
    	sp->channel_spell=sp->channel_target_creature=sp->channel_target_go=0;
    	pCreature->Load(sp, (uint32)NULL, NULL);
    
    	Pet *old_tame = plr->GetSummon();
    	if(old_tame != NULL)
    	{
    		old_tame->Dismiss(true);
    	}
    
    	// create a pet from this creature
    	Pet * pPet = objmgr.CreatePet();
    	pPet->SetInstanceID(plr->GetInstanceID());
    	pPet->SetMapId(plr->GetMapId());
    	pPet->CreateAsSummon(Entry, pCreatureInfo, pCreature, plr, NULL, 0x2, 0);
    
    	// remove the temp creature
    	delete sp;
    	delete pCreature;
    	SendQuickMenu(12343)
    					}
    	break;
    
                     case 13:
    					 {
    	uint32 Entry = CN_WARP;
    	CreatureProto * pTemplate = CreatureProtoStorage.LookupEntry(Entry);
    	CreatureInfo * pCreatureInfo = CreatureNameStorage.LookupEntry(Entry);
    
    	// spawn a creature of this id to create from
    	Creature * pCreature = new Creature(1);//no need in guid
    	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 = pTemplate->Faction;
    	sp->flags = 0;
    	sp->form = 0;
    	sp->movetype = 0;
    	sp->o = plr->GetOrientation();
    	sp->x = plr->GetPositionX();
    	sp->y = plr->GetPositionY();
    	//sp->respawnNpcLink = 0;
    	sp->stand_state = 0;
    	sp->channel_spell=sp->channel_target_creature=sp->channel_target_go=0;
    	pCreature->Load(sp, (uint32)NULL, NULL);
    
    	Pet *old_tame = plr->GetSummon();
    	if(old_tame != NULL)
    	{
    		old_tame->Dismiss(true);
    	}
    
    	// create a pet from this creature
    	Pet * pPet = objmgr.CreatePet();
    	pPet->SetInstanceID(plr->GetInstanceID());
    	pPet->SetMapId(plr->GetMapId());
    	pPet->CreateAsSummon(Entry, pCreatureInfo, pCreature, plr, NULL, 0x2, 0);
    
    	// remove the temp creature
    	delete sp;
    	delete pCreature;
    	SendQuickMenu(12343)
    					 }
    	break;
    
                    case 14:
    					{
    	uint32 Entry = CN_WIND;
    	CreatureProto * pTemplate = CreatureProtoStorage.LookupEntry(Entry);
    	CreatureInfo * pCreatureInfo = CreatureNameStorage.LookupEntry(Entry);
    
    	// spawn a creature of this id to create from
    	Creature * pCreature = new Creature(1);//no need in guid
    	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 = pTemplate->Faction;
    	sp->flags = 0;
    	sp->form = 0;
    	sp->movetype = 0;
    	sp->o = plr->GetOrientation();
    	sp->x = plr->GetPositionX();
    	sp->y = plr->GetPositionY();
    	//sp->respawnNpcLink = 0;
    	sp->stand_state = 0;
    	sp->channel_spell=sp->channel_target_creature=sp->channel_target_go=0;
    	pCreature->Load(sp, (uint32)NULL, NULL);
    
    	Pet *old_tame = plr->GetSummon();
    	if(old_tame != NULL)
    	{
    		old_tame->Dismiss(true);
    	}
    
    	// create a pet from this creature
    	Pet * pPet = objmgr.CreatePet();
    	pPet->SetInstanceID(plr->GetInstanceID());
    	pPet->SetMapId(plr->GetMapId());
    	pPet->CreateAsSummon(Entry, pCreatureInfo, pCreature, plr, NULL, 0x2, 0);
    
    	// remove the temp creature
    	delete sp;
    	delete pCreature;
    	SendQuickMenu(12343)
    					}
    	break;
    
                    case 15:
    					{
    	uint32 Entry = CN_WOLF;
    	CreatureProto * pTemplate = CreatureProtoStorage.LookupEntry(Entry);
    	CreatureInfo * pCreatureInfo = CreatureNameStorage.LookupEntry(Entry);
    
    	// spawn a creature of this id to create from
    	Creature * pCreature = new Creature(1);//no need in guid
    	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 = pTemplate->Faction;
    	sp->flags = 0;
    	sp->form = 0;
    	sp->movetype = 0;
    	sp->o = plr->GetOrientation();
    	sp->x = plr->GetPositionX();
    	sp->y = plr->GetPositionY();
    	//sp->respawnNpcLink = 0;
    	sp->stand_state = 0;
    	sp->channel_spell=sp->channel_target_creature=sp->channel_target_go=0;
    	pCreature->Load(sp, (uint32)NULL, NULL);
    
    	Pet *old_tame = plr->GetSummon();
    	if(old_tame != NULL)
    	{
    		old_tame->Dismiss(true);
    	}
    
    	// create a pet from this creature
    	Pet * pPet = objmgr.CreatePet();
    	pPet->SetInstanceID(plr->GetInstanceID());
    	pPet->SetMapId(plr->GetMapId());
    	pPet->CreateAsSummon(Entry, pCreatureInfo, pCreature, plr, NULL, 0x2, 0);
    
    	// remove the temp creature
    	delete sp;
    	delete pCreature;
    	SendQuickMenu(12343)
    					}
        break;
    
    	}
    	}
    
    	void GossipEnd(Object * pObject, Player* plr)
    	{
    		GossipScript::GossipEnd(pObject, plr);
    	}
    };
    
    void SetupBeast(ScriptMgr * mgr)
    {
    	GossipScript * BeastMaster = (GossipScript*) new BeastsMaster;
    	mgr->register_gossip_script(50001, BeastMaster);
    }
    NPC id is 50001

    Code:
    #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);
    		pPet->CreateAsSummon(Entry, pCreatureInfo, pCreature, pPlayer, NULL, 0x2, 0);
    		pPet->Rename("Pet");
    		pPet->SendSpellsToOwner();
    	}
    }
    
    class SCRIPT_DECL HunterTrainer : public GossipScript
    {
    public:
         void GossipHello(Object * pObject, Player* Plr, bool AutoSend)
    	{
    		GossipMenu *Menu;
    		uint32 TextID = 2;
    		objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), TextID, Plr);
    		Menu->AddItem(0, "I would like a pet, Rexxar.", 1);
    	
    		if(AutoSend)
    			Menu->SendTo(Plr);
    	}
    
         void GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
    	{
    		GossipMenu *Menu;
    		if(Plr->getClass() != HUNTER)
    		{
    			SendQuickMenu(200016);
    			return;
    		}
    
    		static uint32 pets[] = { 16174, 24530, 21723, 24047, 18155, 17724, 23219 };
    		// size: 7
    
    		switch(IntId)
    		{
    			case 0:
    				GossipHello(pObject, Plr, true);
    				return;
    				break;
    			
    			case 1:
    				objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 200018, Plr);
    				Menu->AddItem(0, "I would like a Greater Shadowbat.", 10);
    				Menu->AddItem(0, "I would like an Amani Elder Lynx.", 11);
    				Menu->AddItem(0, "I would like a Blackwind Sabercat.", 12);
    				Menu->AddItem(0, "I would like an Amani Crocolisk.", 13);
    				Menu->AddItem(0, "I would like a Bloodfalcon.", 14);
    				Menu->AddItem(0, "I would like an Underbat.", 15);
    				Menu->AddItem(0, "I would like a Blackwind Warp Chaser.", 16);
    				Menu->SendTo(Plr);
    				return;
    				break;
    		}
    
    		uint32 id = IntId - 10;
    		if(id > 6) return;
    
    		SpawnPet(Plr, pets[id]);
    		SendQuickMenu(200017);
    	}
    
         void GossipEnd(Object * pObject, Player* Plr)
    	{
    		GossipScript::GossipEnd(pObject, Plr);
    	}
    
         void Destroy()
         {
    		delete this;
         }
    };
    
    void SetupHunterTrainer(ScriptMgr * mgr)
    {
    	GossipScript * ht = (GossipScript*)new HunterTrainer;
    	mgr->register_gossip_script(50002, ht);
    }
    That is Summits one! Its much better/ NPC id is 50002

    Setup.cpp
    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    #define SKIP_ALLOCATOR_SHARING 1
    #include <ScriptSetup.h>
    
    extern "C" SCRIPT_DECL uint32 _exp_get_script_type()
    {
    	return SCRIPT_TYPE_MISC;
    }
    
    extern "C" SCRIPT_DECL void _exp_script_register(ScriptMgr* mgr)
    {
        SetupHunterTrainer(mgr);
        SetupBeast(mgr);
    }
    
    #ifdef WIN32
    
    BOOL APIENTRY DllMain( HANDLE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved )
    {
        return TRUE;
    }
    
    #endif
    Setup.h
    Code:
    #include "StdAfx.h"
    
    #ifndef _BG_GOSSIP_SETUP_H
    #define _BG_GOSSIP_SETUP_H
    
    typedef set<Group*> RaidList;
    
    void SetupBeast(ScriptMgr * mgr);
    void SetupHunterTrainer(ScriptMgr * mgr);
    #endif
    Credits!

    -ArenaTournament Team(i really don't know names..)
    -Summit Emu, i think Terelon
    -Me AzoleX(Arc'Emuing First Script,Fixing some stuff)

    This is for Aspire,ArcEmu,Ascent!

    SQL
    Code:
    /* Clean up */
    DELETE FROM creature_names WHERE (`entry`='50002');
    
    DELETE FROM creature_proto WHERE (`entry`='50002');
    
    
    /* And now Creature */
    INSERT INTO `creature_names` (`entry`, `name`, `subname`, `info_str`, `type`, `family`, `rank`, `male_displayid`, `female_displayid`, `male_displayid2`, `female_displayid2`, `civilian`, `leader`) VALUES ('50002', 'BeastMasterNPC', 'Blua Scripting', '', '0', '0', '0', '23758', '0', '0', '0', '0', NULL);
    INSERT INTO `creature_proto` (`minlevel`, `maxlevel`, `faction`, `minhealth`, `maxhealth`, `mana`, `scale`, `npcflags`, `attacktime`, `mindamage`, `maxdamage`, `rangedattacktime`, `rangedmindamage`, `rangedmaxdamage`, `mountdisplayid`, `equipmodel1`, `equipmodel2`, `equipmodel3`, `respawntime`, `armor`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `combat_reach`, `bounding_radius`, `auras`, `boss`, `money`, `invisibility_type`, `death_state`, `walk_speed`, `run_speed`, `fly_speed`, `entry`) VALUES ('50002', '70', '70', '1635', '100', '100', '0', '1', '1', '1500', '0', '0', '0', '0', '0', '0', '0', '0', '0', '36000', '1', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '2.5', '8', '14');
    Blua Scripting : Blua - Revision 406: /
    Last edited by AzolexX; 10-23-2008 at 04:09 PM.

    Find about scripting, programming and music! My blog: https://worldofsmth.wordpress.com!

    [Release][C++] Best Master NPC Script!
  2. #2
    treeko11's Avatar Member
    Reputation
    11
    Join Date
    Jan 2008
    Posts
    275
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Umm, what exactly does this do?

  3. #3
    AzolexX's Avatar Contributor
    Reputation
    179
    Join Date
    May 2007
    Posts
    587
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Edited read thread now .
    Last edited by AzolexX; 10-23-2008 at 04:10 PM.

    Find about scripting, programming and music! My blog: https://worldofsmth.wordpress.com!

  4. #4
    TheFitzy's Avatar Active Member
    Reputation
    19
    Join Date
    Oct 2008
    Posts
    65
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Booyah, Nice mate..
    Gona Please alot of people..
    Is your new friend
    Lok'Tar Friend.

  5. #5
    AzolexX's Avatar Contributor
    Reputation
    179
    Join Date
    May 2007
    Posts
    587
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can find this and many more scripts on Blua Scripting SVN.
    Take time to visit it!
    Last edited by AzolexX; 10-23-2008 at 04:10 PM.

    Find about scripting, programming and music! My blog: https://worldofsmth.wordpress.com!

  6. #6
    near1337's Avatar Member
    Reputation
    6
    Join Date
    Oct 2008
    Posts
    21
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good job Azo
    "Moon Emu" Totally new Generation of Ascent Emulation!

  7. #7
    AzolexX's Avatar Contributor
    Reputation
    179
    Join Date
    May 2007
    Posts
    587
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    20 More to go thanks man!
    Last edited by AzolexX; 10-23-2008 at 04:11 PM.

    Find about scripting, programming and music! My blog: https://worldofsmth.wordpress.com!

  8. #8
    tylert40's Avatar Member
    Reputation
    31
    Join Date
    Dec 2007
    Posts
    47
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    GG

    GG m8..........

  9. #9
    AzolexX's Avatar Contributor
    Reputation
    179
    Join Date
    May 2007
    Posts
    587
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks ,15 more to go!
    Last edited by AzolexX; 10-23-2008 at 04:11 PM.

    Find about scripting, programming and music! My blog: https://worldofsmth.wordpress.com!

  10. #10
    Aznex's Avatar Contributor
    Reputation
    128
    Join Date
    Feb 2008
    Posts
    770
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by AzolexX View Post
    Thanks 15 More to GO!
    Don't lie to me nice script, good to learn from for me

  11. #11
    blind999's Avatar Member
    Reputation
    4
    Join Date
    Jan 2008
    Posts
    46
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Very well presented... Loads of other scripts.. Neatly done code..

    Summarise it all up and you get a nice: +REP!

  12. #12
    AzolexX's Avatar Contributor
    Reputation
    179
    Join Date
    May 2007
    Posts
    587
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for comments guys! Fell free to comment more .
    Last edited by AzolexX; 10-23-2008 at 04:11 PM.

    Find about scripting, programming and music! My blog: https://worldofsmth.wordpress.com!

  13. #13
    Performer's Avatar Contributor
    Reputation
    212
    Join Date
    Nov 2007
    Posts
    874
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    GJ Azo +rep


  14. #14
    AzolexX's Avatar Contributor
    Reputation
    179
    Join Date
    May 2007
    Posts
    587
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks mate .
    Last edited by AzolexX; 10-23-2008 at 04:11 PM.

    Find about scripting, programming and music! My blog: https://worldofsmth.wordpress.com!

  15. #15
    TheSpidey's Avatar Elite User
    Reputation
    365
    Join Date
    Jan 2008
    Posts
    2,200
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Avoid repeating code, and instead either use functions or macros. This will lower the length of the script and improve readability

Page 1 of 2 12 LastLast

Similar Threads

  1. [Release] Reputation Booster - NPC Script
    By nofix in forum WoW EMU General Releases
    Replies: 3
    Last Post: 09-11-2008, 04:22 PM
  2. [Release] Precompiled, Latest Ascent REVs + scripts + databases (updated regular)
    By latruwski in forum World of Warcraft Emulator Servers
    Replies: 67
    Last Post: 12-14-2007, 07:47 AM
  3. [Release] Complete Azeroth Portals (gm scripts)
    By knaur in forum World of Warcraft Emulator Servers
    Replies: 11
    Last Post: 11-22-2007, 08:10 AM
  4. [Ascent] List of Class Trainers and Weapon Masters NPC spawn ID's
    By mkenzi in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 10-21-2007, 11:41 AM
All times are GMT -5. The time now is 05:42 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search