Jump to content

patro

Members
  • Posts

    15
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by patro

  1. With 7825 rev it doesn't work. The console give me this error:

    Anyway... I am grateful with you for your works, but I ask: Why you don't relase the patches for the latests rev of MaNGOS?

    Cuz we <3 to stick with a stable version :P

    J/k, i just don't wanna update my server everytime. If i get things sorted out, i'll update it. But untill then you can always add one of the 4 patches given manually. It's not that much work, and we gotta do it aswell ;)

  2. For rev. 7776 (last one i made)

    diff --git a/src/game/Group.cpp b/src/game/Group.cpp
    index b2b495c..a2b99f1 100644
    --- a/src/game/Group.cpp
    +++ b/src/game/Group.cpp
    @@ -310,6 +310,8 @@ bool Group::AddMember(const uint64 &guid, const char* name)
    
    uint32 Group::RemoveMember(const uint64 &guid, const uint8 &method)
    {
    + BroadcastGroupUpdate();
    +
        // remove member and change leader (if need) only if strong more 2 members _before_ member remove
        if(GetMembersCount() > (isBGGroup() ? 1 : 2))           // in BG group case allow 1 members group
        {
    @@ -1595,3 +1597,18 @@ void Group::_homebindIfInstance(Player *player)
                player->m_InstanceValid = false;
        }
    }
    +
    +void Group::BroadcastGroupUpdate(void)
    +{
    + // Group Hack: force flags update on group leave - for values update hack
    + for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
    + {
    +  Player *pp = objmgr.GetPlayer(citr->guid);
    +  if(pp && pp->IsInWorld())
    +  {
    +   pp->ForceValuesUpdateAtIndex(UNIT_FIELD_BYTES_2);
    +   pp->ForceValuesUpdateAtIndex(UNIT_FIELD_FACTIONTEMPLATE);
    +   DEBUG_LOG("-- Forced group value update for '%s'", pp->GetName());
    +  }
    + }
    +}
    \\ No newline at end of file
    diff --git a/src/game/Group.h b/src/game/Group.h
    index 478b7c5..17cfac9 100644
    --- a/src/game/Group.h
    +++ b/src/game/Group.h
    @@ -330,6 +330,9 @@ class MANGOS_DLL_SPEC Group
            InstanceGroupBind* GetBoundInstance(uint32 mapid, uint8 difficulty);
            BoundInstancesMap& GetBoundInstances(uint8 difficulty) { return m_boundInstances[difficulty]; }
    
    +  //Group hack.
    +  void BroadcastGroupUpdate(void);
    +
        protected:
            bool _addMember(const uint64 &guid, const char* name, bool isAssistant=false);
            bool _addMember(const uint64 &guid, const char* name, bool isAssistant, uint8 group);
    diff --git a/src/game/GroupHandler.cpp b/src/game/GroupHandler.cpp
    index b7c55e6..0373ab4 100644
    --- a/src/game/GroupHandler.cpp
    +++ b/src/game/GroupHandler.cpp
    @@ -196,6 +196,7 @@ void WorldSession::HandleGroupAcceptOpcode( WorldPacket & /*recv_data*/ )
        if(!group->AddMember(GetPlayer()->GetGUID(), GetPlayer()->GetName()))
            return;
    
    + group->BroadcastGroupUpdate();
    }
    
    void WorldSession::HandleGroupDeclineOpcode( WorldPacket & /*recv_data*/ )
    diff --git a/src/game/Object.cpp b/src/game/Object.cpp
    index 15963e8..35da227 100644
    --- a/src/game/Object.cpp
    +++ b/src/game/Object.cpp
    @@ -637,6 +637,38 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
                        else
                            *data << (m_uint32Values[ index ] & ~UNIT_DYNFLAG_OTHER_TAGGER);
                    }
    +    // FG: pretend that OTHER players in own group are friendly ("blue")
    +    else if(index == UNIT_FIELD_BYTES_2 || index == UNIT_FIELD_FACTIONTEMPLATE)
    +    {
    +    bool ch = false;
    +    if(target->GetTypeId() == TYPEID_PLAYER && GetTypeId() == TYPEID_PLAYER && target != this)
    +    {
    +     if(target->IsInSameGroupWith((Player*)this) || target->IsInSameRaidWith((Player*)this))
    +     {
    +      if(index == UNIT_FIELD_BYTES_2)
    +      {
    +       DEBUG_LOG("-- VALUES_UPDATE: Sending '%s' the blue-group-fix from '%s' (flag)", target->GetName(), ((Player*)this)->GetName());
    +       *data << ( m_uint32Values[ index ] & (UNIT_BYTE2_FLAG_SANCTUARY << 8) ); // this flag is at uint8 offset 1 !!
    +       ch = true;
    +      }
    +      else if(index == UNIT_FIELD_FACTIONTEMPLATE)
    +      {
    +       FactionTemplateEntry const *ft1, *ft2;
    +       ft1 = ((Player*)this)->getFactionTemplateEntry();
    +       ft2 = ((Player*)target)->getFactionTemplateEntry();
    +       if(ft1 && ft2 && !ft1->IsFriendlyTo(*ft2))
    +        {
    +        uint32 faction = ((Player*)target)->getFaction(); // pretend that all other HOSTILE players have own faction, to allow follow, heal, rezz (trade wont work)
    +        DEBUG_LOG("-- VALUES_UPDATE: Sending '%s' the blue-group-fix from '%s' (faction %u)", target->GetName(), ((Player*)this)->GetName(), faction);
    +        *data << uint32(faction);
    +        ch = true;
    +       }
    +      }
    +     }
    +    }
    +    if(!ch)
    +    *data << m_uint32Values[ index ];
    +    }
                    else
                    {
                        // send in current format (float as float, uint32 as uint32)
    @@ -1496,6 +1528,19 @@ Creature* WorldObject::SummonCreature(uint32 id, float x, float y, float z, floa
        return pCreature;
    }
    
    +void Object::ForceValuesUpdateAtIndex(uint32 i)
    +{
    + m_uint32Values_mirror[i] = GetUInt32Value(i) + 1; // makes server think the field changed
    + if(m_inWorld)
    + {
    +  if(!m_objectUpdated)
    +  {
    +   ObjectAccessor::Instance().AddUpdateObject(this);
    +   m_objectUpdated = true;
    +  }
    + }
    +}
    +
    namespace MaNGOS
    {
        class NearUsedPosDo
    diff --git a/src/game/Object.h b/src/game/Object.h
    index fc01e3a..ab0fdbc 100644
    --- a/src/game/Object.h
    +++ b/src/game/Object.h
    @@ -300,6 +300,9 @@ class MANGOS_DLL_SPEC Object
    
            virtual bool hasQuest(uint32 /* quest_id */) const { return false; }
            virtual bool hasInvolvedQuest(uint32 /* quest_id */) const { return false; }
    +
    +  void ForceValuesUpdateAtIndex(uint32);
    +
        protected:
    
            Object ( );
    diff --git a/src/game/TradeHandler.cpp b/src/game/TradeHandler.cpp
    index aa323c9..df83656 100644
    --- a/src/game/TradeHandler.cpp
    +++ b/src/game/TradeHandler.cpp
    @@ -534,11 +534,11 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
            return;
        }
    
    -    if(pOther->GetTeam() !=_player->GetTeam() )
    +    /*if(pOther->GetTeam() !=_player->GetTeam() )
        {
            SendTradeStatus(TRADE_STATUS_WRONG_FACTION);
            return;
    -    }
    +    }*/
    
        if( pOther->GetDistance2d( _player ) > 10.0f )
        {
    

    Thnx to False.Genesis for the original patch

    Thnx to Frozen-in-Time for the trading fix part

  3. Maybe this?

    uint32 race_data = target->getRace();

    if(race_data == RACE_HUMAN)

    *data << uint32(1);

    else if(race_data == RACE_ORC)

    ...................

    do getRace() once

    I always used this from False.Genesis's GitHub:

    2[/color][/size]22[/color][/size]22[/color][/size]22[/color][/size]22[/color][/size]22[/color][/size]22[/color][/size]22[/color][/size]22[/color][/size]2

    It always worked for me :)

  4. I've finally installed / compiled my server again, and i'm also figgling around with your given codes :)

    I've tried the one from post #17, but i can summon a ghoul w/out Corpse Dust or a nearby corpse (dunno how that can be, i've might done something wrong... i'm not an expert in C++, but i'm learning it on the way ;))

    Also, on the very first try of casting the spell with the Ghoul-mastery talent on, i've summoned a pet with the name "Bonerawler". But after i dismissed him to give it another shot, he was called "Risen Ghoul" :huh: (Every time i summon him now, he's called like that...)

    I'm going to see if i can help you guys a bit. Anyways, great work making it work sofar. =)

    Edit: you got a little typo in your last code: ManGOS::XP::GetGrayLevel, it should be with a capital "N"

  5. Hmm, i've also been thinking to do something with the area beneath Karazhan, but i didn't came too far...

    It's not an "real instance", so it's hard to make something nice out of it.

    I just created a few boss scripts with SD2, and spawned the bosses in there. And to let the players come in, i made a areatrigger NPC.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use