Custom Graveyard for Trinity. menu

User Tag List

Results 1 to 7 of 7
  1. #1
    4BOLTMAIN's Avatar Sergeant
    Reputation
    2
    Join Date
    Dec 2010
    Posts
    63
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Custom Graveyard for Trinity.

    What do I use to detect when a player clicks the release button?

    Right now I have OnPVPKill and OnPlayerKilledByCreature. But these 2 commands send the player to the graveyard immediately when they die.

    Here is the script I have so far. I got this from someone else, I only made minor changes.

    Code:
    #include "ScriptPCH.h"
    
    
    class hyjal_grave : public PlayerScript
    {
    public:
        hyjal_grave() : PlayerScript("hyjal_grave") {}
    
        void OnPVPKill(Player* killer, Player* killed) 
        {
            if (killed->GetMapId() == 1 && killed->GetZoneId() == 616)
            {
                killed->TeleportTo(1, 4981.97f, -2857.31f, 1452.67f, 5.36318f);
            }
        }
    
        void OnPlayerKilledByCreature(Creature* killer, Player* killed)
        {
            if (killed->GetMapId() == 1 && killed->GetZoneId() == 616)
            {
                killed->TeleportTo(1, 4981.97f, -2857.31f, 1452.67f, 5.36318f);
            }
        }
    };
    
    void AddSC_hyjal_grave()
    {
        new hyjal_grave();
    }
    Last edited by 4BOLTMAIN; 02-04-2011 at 04:44 PM.

    Custom Graveyard for Trinity.
  2. #2
    92eatos's Avatar Contributor
    Reputation
    104
    Join Date
    Aug 2009
    Posts
    220
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    why not just add graveyard in db :S without script

  3. #3
    4BOLTMAIN's Avatar Sergeant
    Reputation
    2
    Join Date
    Dec 2010
    Posts
    63
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by 92eatos View Post
    why not just add graveyard in db :S without script
    I tried doing that but it didnt work so I did some more research and discovered that this isnt possible without editing the dbc files on both the server and the client. This is definitely something I want to avoid for obvious reasons.

    I ran a Neverwinter Nights server for over 5 years and in the script editor there was a search option that would let you search through all the commands (not sure if that is what it is called but I mean commands in NWN like GetLastUsedBy() ) then it would give an explanation of what the commands did. I know this isnt NWN but the coding is very similar. It would be great if there was a list of commands like this somewhere for the trinity core. I have looked at the example scripts and have figured out how to make teleporter scripts on my own but I am lost when it comes to finding something like what I am looking for.

  4. #4
    The-Eradicator's Avatar Contributor

    Reputation
    149
    Join Date
    May 2007
    Posts
    829
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by 4BOLTMAIN View Post
    I ran a Neverwinter Nights server for over 5 years and in the script editor there was a search option that would let you search through all the commands (not sure if that is what it is called but I mean commands in NWN like GetLastUsedBy() ) then it would give an explanation of what the commands did. I know this isnt NWN but the coding is very similar. It would be great if there was a list of commands like this somewhere for the trinity core. I have looked at the example scripts and have figured out how to make teleporter scripts on my own but I am lost when it comes to finding something like what I am looking for.
    Doesn't exist. I suggest you read up on Object Oriented Programming.

    You only have access to methods where you have access to an instance of the object that the method is in, or when the method is static.

    However, using Visual Studio, try searching the entire project (Control+Shift+F) to see if a method exists for what you'd like to do. Then figure out whether you have an instance of that class. If you don't, figure out how to get one.
    The most beautiful thing we can experience is the mysterious. It is the source of all true art and all science. He to whom this emotion is a stranger, who can no longer pause to wonder and stand rapt in awe, is as good as dead: his eyes are closed.
    Albert Einstein

  5. #5
    4BOLTMAIN's Avatar Sergeant
    Reputation
    2
    Join Date
    Dec 2010
    Posts
    63
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, Ive been digging through the source, using the find in VS and I dont see anything where a player would click the release button. Im just beginning to learn this stuff so I may have overlooked it. I also read some of the Wiki on Object Oriented Programming and thats a little over my head yet. I am hoping someone has done this before and has an example for me.
    Last edited by 4BOLTMAIN; 02-07-2011 at 06:50 AM.

  6. #6
    4BOLTMAIN's Avatar Sergeant
    Reputation
    2
    Join Date
    Dec 2010
    Posts
    63
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, Heres where I am at now... in the player.cpp file there is this section...(was gonna post the whole thing but thats not gonna work...lol)

    Code:
    void Player::RepopAtGraveyard()
    {
            // note: this can be called also when the player is alive
        // for example from WorldSession::HandleMovementOpcodes
    
        AreaTableEntry const *zone = GetAreaEntryByAreaID(GetAreaId());
    
        // Such zones are considered unreachable as a ghost and the player must be automatically revived    
            if ((!isAlive() && zone && zone->flags & AREA_FLAG_NEED_FLY) || GetTransport() || GetPositionZ() < -500.0f)
            {
            ResurrectPlayer(0.5f);
            SpawnCorpseBones();
        }
    
        WorldSafeLocsEntry const *ClosestGrave = NULL;
    
        // Special handle for battleground maps
        if (Battleground *bg = GetBattleground())
            ClosestGrave = bg->GetClosestGraveYard(this);
        else
            ClosestGrave = sObjectMgr->GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam());
    
        // stop countdown until repop
        m_deathTimer = 0;
    
        // if no grave found, stay at the current location
        // and don't show spirit healer location
            if (ClosestGrave)
            {
            TeleportTo(ClosestGrave->map_id, ClosestGrave->x, ClosestGrave->y, ClosestGrave->z, GetOrientation());
            if (isDead())                                        // not send if alive, because it used in TeleportTo()
            {
                WorldPacket data(SMSG_DEATH_RELEASE_LOC, 4*4);  // show spirit healer position on minimap
                data << ClosestGrave->map_id;
                data << ClosestGrave->x;
                data << ClosestGrave->y;
                data << ClosestGrave->z;
                GetSession()->SendPacket(&data);
            }
        }
            else if (GetPositionZ() < -500.0f)
            TeleportTo(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, GetOrientation());
    }


    Now if I add this line to that section of code

    Code:
    // 4boltmain Hyjal Grave added line
            if (GetZoneId() == 616) TeleportTo(1, 4981.97f, -2857.31f, 1452.67f, 5.36318f);
            // 4boltmain Hyjal Grave added line


    I am ported to the grave position when I click the release button but when I die my corpse is up in the air off the ground.
    I cant figure out why my corpse is up in the air when I die. Ive tried changing both GetPositionZ() < -500.0f to simply 0.5f but that has no effect...but anyway, I know shouldnt even be editing this file at all I was experimenting for testing purposes.

    How would I make a custom script to reference this section to have the player ported to the graveyard coordinates?

  7. #7
    4BOLTMAIN's Avatar Sergeant
    Reputation
    2
    Join Date
    Dec 2010
    Posts
    63
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Heres what I changed in the player.cpp file... I probably shouldnt have edited this file but I cant figure out how to make a stand alone script to do this. The added line is near the bottom.

    Code:
    void Player::RepopAtGraveyard()
    {
            // note: this can be called also when the player is alive
        // for example from WorldSession::HandleMovementOpcodes
    
        AreaTableEntry const *zone = GetAreaEntryByAreaID(GetAreaId());
    
        // Such zones are considered unreachable as a ghost and the player must be automatically revived    
            if ((!isAlive() && zone && zone->flags & AREA_FLAG_NEED_FLY) || GetTransport() || GetPositionZ() < -500.0f)
            {
            ResurrectPlayer(0.5f);
            SpawnCorpseBones();
        }
    
        WorldSafeLocsEntry const *ClosestGrave = NULL;
    
        // Special handle for battleground maps
        if (Battleground *bg = GetBattleground())
            ClosestGrave = bg->GetClosestGraveYard(this);
        else
            ClosestGrave = sObjectMgr->GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam());
    
        // stop countdown until repop
        m_deathTimer = 0;
    
        // if no grave found, stay at the current location
        // and don't show spirit healer location
            if (ClosestGrave)
            {
            TeleportTo(ClosestGrave->map_id, ClosestGrave->x, ClosestGrave->y, ClosestGrave->z, GetOrientation());
            if (isDead())                                        // not send if alive, because it used in TeleportTo()
            {
                WorldPacket data(SMSG_DEATH_RELEASE_LOC, 4*4);  // show spirit healer position on minimap
                data << ClosestGrave->map_id;
                data << ClosestGrave->x;
                data << ClosestGrave->y;
                data << ClosestGrave->z;
                GetSession()->SendPacket(&data);
            }
        }
            // I only had to add this one line here... zone 616 is the Hyjal area. 
            // It didnt work right on a previous core but it does on Rev. 11439.
            
            else if (GetZoneId() == 616) TeleportTo(1, 4981.97f, -2857.31f, 1452.67f, 5.36318f); 
            
            // original code
            else if (GetPositionZ() < -500.0f)
            TeleportTo(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, GetOrientation());
    }

Similar Threads

  1. [SQL] Custom Items for Trinity
    By mohamed37 in forum WoW EMU General Releases
    Replies: 5
    Last Post: 12-30-2010, 01:17 PM
  2. [Request] npcs customs for trinity database 3.2.2a
    By matrix23 in forum WoW EMU Questions & Requests
    Replies: 0
    Last Post: 01-24-2010, 12:19 AM
  3. Custom mounts for trinity core mangos
    By mikedezey in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 08-08-2009, 09:36 PM
  4. How to Make a Custom Graveyard
    By JulianX in forum WoW EMU Guides & Tutorials
    Replies: 15
    Last Post: 11-16-2007, 09:32 PM
  5. Custom Catform For Tauren Druids
    By ninjaweasel in forum World of Warcraft Model Editing
    Replies: 7
    Last Post: 09-07-2007, 11:24 AM
All times are GMT -5. The time now is 03:46 AM. 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