[Release][C++] Custom Pet Script menu

User Tag List

Results 1 to 4 of 4
  1. #1
    mager1794's Avatar Member
    Reputation
    356
    Join Date
    Feb 2008
    Posts
    703
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Release][C++] Custom Pet Script

    Okay i create a script to make custom pets, for example like a chicken

    its very simple edit the item Id
    and the creature ID

    and when you click the item it will spawn the creature at your location and he will follow you around


    Make sure the pet is friendly to everyone
    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    
    #ifdef WIN32
    #pragma warning(disable:4018)        // signed/unsigned mismatch in comparison op
    #endif;
    
    #define ENTRYID 47832
    #define ITEMID 42353
    
    class SCRIPT_DECL FollowGossip : public GossipScript
    {
    public:
        void GossipHello(Object * pObject, Player* Plr, bool AutoSend);
        void GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code);
        void GossipEnd(Object * pObject, Player* Plr);
        void Destroy(){ delete this;}
    };
    
    
    void FollowGossip::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
    {
        Creature * cre = Plr->GetMapMgr()->GetInterface()->SpawnCreature(ENTRYID,Plr->GetPositionX(),Plr->GetPositionY(),Plr->GetPositionZ(),Plr->GetOrientation(),true,false,0,0);
        cre->m_escorter = Plr;
    }
    
    void FollowGossip::GossipEnd(Object * pObject, Player* Plr)
    {
        GossipScript::GossipEnd(pObject, Plr);
    }
    
    void FollowGossip::GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
    {
            return;
        switch(IntId)
        {
            case 1:
            
            break;
            
        }
    }
    
    class FollowAI : CreatureAIScript
    {
    public:
        ADD_CREATURE_FACTORY_FUNCTION(FollowAI);
        FollowAI(Creature* pCreature) : CreatureAIScript(pCreature)
        {
            RegisterAIUpdateEvent(100);
        }
        
         void AIUpdate()
        {
            if(_unit->m_escorter != NULL)
            {
                Player * Plr = _unit->m_escorter;
                _unit->GetAIInterface()->MoveTo(Plr->GetPositionX() + .1f,Plr->GetPositionY(),Plr->GetPositionZ(),Plr->GetOrientation());
            }
        }
    
    };
    
    void SetupMorphNPC(ScriptMgr * mgr)
    {
    GossipScript * gs = (GossipScript*) new FollowGossip();
    mgr->register_item_gossip_script(ITEMID, gs);
    mgr->register_creature_script(ENTRYID,&FollowAI::Create);
    }
    Lunar Gaming - Reaching For The Stars

    [Release][C++] Custom Pet Script
  2. #2
    iMurloc's Avatar Member
    Reputation
    5
    Join Date
    Nov 2009
    Posts
    76
    Thanks G/R
    0/3
    Trade Feedback
    13 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow... Where are all the comments!

    Extremly creative and fun! I will try this out a little later

    Thanks for this christmas present :P

    +Rep man!

  3. #3
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Is this how pets work on the normal system? I've never looked into it before, since updating the potition every second with a lot of players online will be laggy. Never the less, it looks good, similar to your helper one.

  4. #4
    mager1794's Avatar Member
    Reputation
    356
    Join Date
    Feb 2008
    Posts
    703
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the comments and I'm not sure if thats how they due it in the core, but it was originally written buy me as a true 'escort style' escort quest but I gave it a twist and gave it to the community
    Lunar Gaming - Reaching For The Stars

Similar Threads

  1. custom pet trainer script
    By glh290 in forum WoW EMU General Releases
    Replies: 5
    Last Post: 01-01-2009, 07:39 AM
  2. [Release] Snowman! Custom scripted raid boss by B!atch ! ;O
    By b!atch in forum World of Warcraft Emulator Servers
    Replies: 22
    Last Post: 06-19-2008, 04:20 AM
  3. [Release] My Custom boss script (LUA)
    By Nilrac in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 06-17-2008, 03:57 AM
  4. Custom Pet Trainer Script
    By vb4evr in forum World of Warcraft Emulator Servers
    Replies: 33
    Last Post: 05-09-2008, 12:54 PM
  5. [Release] Satan! Custom scripted lvl200 5manboss
    By b!atch in forum World of Warcraft Emulator Servers
    Replies: 15
    Last Post: 04-01-2008, 01:43 PM
All times are GMT -5. The time now is 05:13 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search