Hello & Welcome to our community. Is this your first visit? Register
Follow us on
Follow us on Facebook Follow us on Twitter Watch us on YouTube


MMOCoin

Likes Likes:  0
Results 1 to 2 of 2
  1. #1
    Scout

    Join Date
    Jul 2009
    Posts
    20
    Post Thanks / Like
    Rep Power
    16
    Reputation
    40

    [C++]Event Checkpoint Guide


    Register to remove this ad
    Event Checkpoint Guide
    by mager

    I will teach you to make an npc that
    will teleport you to your checkpoint
    location all you need to do is create
    a quest for each checkpoint you wish
    to have

    ok for our first bit of it lets put this

    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    
    class SCRIPT_DECL Event : 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;
    }
    };
    k now we did that which is kinda just the
    starting of the scripts its really absolutly
    nothing to the actual NPC

    lets make some menu selections for it

    Code:
    void Event::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
    {
    GossipMenu *Menu;
    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    Menu->AddItem(5, "Take me to my checkpoint!", 1);
    if you wish you can aswell add a line like this after that

    Code:
    Menu->AddItem(5, "What is my objective", 2);
    now they have something that will exist when they
    speak to your check point porter

    after that line add this

    Code:
    Menu->SendTo(Plr);
    }
    
    void Prison::GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
    {
    Creature * pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?((Creature*)pObject):NULL;
    if(pObject==NULL)
    return;
    
    switch(IntId)
    {
    excellent and now we make the check points
    first off make sure you have a quest for
    each check point if not make them now

    then we do this

    Code:
    case 0: // Return to start
    GossipHello(pCreature, Plr, true);
    break;
    case 1: // Teleport Down
    {
        if (Plr->HasFinishedQuest(QuestID) == false){
    Plr->EventTeleport(0, X , Y, Z);
    Plr->Gossip_Complete();
        }    
        else    if (Plr->HasFinishedQuest(QuestID) == false && Plr->HasFinishedQuest(400001) == true) {
    Plr->EventTeleport(0, X, Y, Z);
    Plr->Gossip_Complete();
    just re add this line for a new quest to be added


    [code]
    }
    else if (Plr->HasFinishedQuest(QuestID) == false && Plr->HasFinishedQuest(400001) == true) {
    Plr->EventTeleport(0, X, Y, Z);
    Plr->Gossip_Complete();
    [/CODE

    and you can make as many check points as you wish : )

    if you added teh otehr menu item then this is what you do

    Code:
          case 2: // Information
    {
        Plr->BroadcastMessage("Fill in Event info here");
    Plr->Gossip_Complete();
    there now finish this script off with



    Code:
    } 
    
    }
    };
    
    void Event::GossipEnd(Object * pObject, Player* Plr)
    {
    GossipScript::GossipEnd(pObject, Plr);
    }
    
    void SetupEvent(ScriptMgr * mgr)
    {
    GossipScript * gs = (GossipScript*) new Event();
    mgr->register_gossip_script([MOBENTRYID], gs);
    }
    and thats my guide well
    thanks for listening please leave feedback : )



    › See More: [C++]Event Checkpoint Guide



  2. Related Threads - Scroll Down after related threads if you are only interested to view replies for above post/thread

  3. #2
    Contributor
    Onlykl's Avatar
    Join Date
    Jan 2009
    Location
    127.0.0.1
    Posts
    247
    Post Thanks / Like
    Rep Power
    19
    Reputation
    244

    Register to remove this ad
    nice +Rep

 

 

Visitors found this page by searching for:

checkpoint c

check points codes c

event checkpoint

c event guide

trinitycore newquest npc create guide

SEO Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -5. The time now is 11:33 AM.
Powered by vBulletin® Copyright ©2000-2024, Jelsoft Enterprises Ltd.
See More links by ForumSetup.net. Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
vBulletin Licensed to: MMOPro.org