Jump to content

LouisePalmer

Members
  • Posts

    5
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

LouisePalmer's Achievements

Newbie

Newbie (1/3)

0

Reputation

  1. Many patch was derived from False.Genesis original idéa. False.Genesis Git here: http://github.com/fgenesis/mangos/commits/master This is an extract of the last commit about the original False.Genesis's Group patch: diff -r -u mangosorig//src/game/Group.cpp mangos/src/game/Group.cpp --- mangosorig//src/game/Group.cpp 2009-11-26 21:23:20.000000000 +0100 +++ mangos/src/game/Group.cpp 2009-11-26 21:25:20.000000000 +0100 @@ -339,6 +339,8 @@ 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 { @@ -1687,3 +1689,34 @@ player->m_InstanceValid = false; } } + +void Group::BroadcastGroupUpdate(void) +{ + // FG: HACK: force flags update on group leave - for values update hack + // -- not very efficient but safe + for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr) + { + Player *pp = sObjectMgr.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()); + if(pp->GetPet()) + { + pp->GetPet()->ForceValuesUpdateAtIndex(UNIT_FIELD_BYTES_2); + pp->GetPet()->ForceValuesUpdateAtIndex(UNIT_FIELD_FACTIONTEMPLATE); + DEBUG_LOG("-- Forced group value update for '%s' pet '%s'", pp->GetName(), pp->GetPet()->GetName()); + } + for(uint32 i = 0; i < MAX_TOTEM; ++i) + { + if(Unit *totem = Unit::GetUnit(*pp, pp->m_TotemSlot[i])) + { + totem->ForceValuesUpdateAtIndex(UNIT_FIELD_BYTES_2); + totem->ForceValuesUpdateAtIndex(UNIT_FIELD_FACTIONTEMPLATE); + DEBUG_LOG("-- Forced group value update for '%s' totem #%u", pp->GetName(), i); + } + } + } + } +} \\ Pas de fin de ligne à la fin du fichier. diff -r -u mangosorig//src/game/Group.h mangos/src/game/Group.h --- mangosorig//src/game/Group.h 2009-11-26 21:23:20.000000000 +0100 +++ mangos/src/game/Group.h 2009-11-26 21:27:57.000000000 +0100 @@ -337,6 +337,9 @@ InstanceGroupBind* GetBoundInstance(Map* aMap); BoundInstancesMap& GetBoundInstances(Difficulty difficulty) { return m_boundInstances[difficulty]; } + // FG: evil hacks + 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 -r -u mangosorig//src/game/GroupHandler.cpp mangos/src/game/GroupHandler.cpp --- mangosorig//src/game/GroupHandler.cpp 2009-11-26 21:23:20.000000000 +0100 +++ mangos/src/game/GroupHandler.cpp 2009-11-26 21:28:54.000000000 +0100 @@ -196,6 +196,9 @@ if(!group->AddMember(GetPlayer()->GetGUID(), GetPlayer()->GetName())) return; + // FG: part of blue group fix + group->BroadcastGroupUpdate(); + } void WorldSession::HandleGroupDeclineOpcode( WorldPacket & /*recv_data*/ ) diff -r -u mangosorig//src/game/Object.cpp mangos/src/game/Object.cpp --- mangosorig//src/game/Object.cpp 2009-11-26 21:23:20.000000000 +0100 +++ mangos/src/game/Object.cpp 2009-11-26 21:36:36.000000000 +0100 @@ -691,6 +691,50 @@ 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((GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT) && target != this) + { + bool forcefriendly = false; // bool for pets/totems to offload more code from the big if below + if(GetTypeId() == TYPEID_UNIT) + { + forcefriendly = (((Creature*)this)->isTotem() || ((Creature*)this)->isPet()) + && ((Creature*)this)->GetOwner()->GetTypeId() == TYPEID_PLAYER + && ((Creature*)this)->GetOwner()->IsFriendlyTo(target) // pet owner must be friendly to target + && ((Creature*)this)->GetOwner() != target // no need to send hackfix to pet owner + && (target->IsInSameGroupWith((Player*)((Creature*)this)->GetOwner()) || target->IsInSameRaidWith((Player*)((Creature*)this)->GetOwner())); + } + + if(((Unit*)this)->IsSpoofSamePlayerFaction() || forcefriendly + || (target->GetTypeId() == TYPEID_PLAYER && GetTypeId() == TYPEID_PLAYER && (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(), ((Unit*)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 = ((Unit*)this)->getFactionTemplateEntry(); + ft2 = ((Unit*)target)->getFactionTemplateEntry(); + if(ft1 && ft2 && (!ft1->IsFriendlyTo(*ft2) || ((Unit*)this)->IsSpoofSamePlayerFaction())) + { + 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(), ((Unit*)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) @@ -1668,6 +1712,19 @@ 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) + { + AddToClientUpdateList(); + m_objectUpdated = true; + } + } +} + namespace MaNGOS { class NearUsedPosDo diff -r -u mangosorig//src/game/Object.h mangos/src/game/Object.h --- mangosorig//src/game/Object.h 2009-11-26 21:23:20.000000000 +0100 +++ mangos/src/game/Object.h 2009-11-26 21:37:35.000000000 +0100 @@ -301,6 +301,9 @@ virtual bool hasQuest(uint32 /* quest_id */) const { return false; } virtual bool hasInvolvedQuest(uint32 /* quest_id */) const { return false; } + + void ForceValuesUpdateAtIndex(uint32); + protected: Object ( ); diff -r -u mangosorig//src/game/TradeHandler.cpp mangos/src/game/TradeHandler.cpp --- mangosorig//src/game/TradeHandler.cpp 2009-11-26 21:23:20.000000000 +0100 +++ mangos/src/game/TradeHandler.cpp 2009-11-26 21:38:21.000000000 +0100 @@ -532,11 +532,11 @@ return; } - if (pOther->GetTeam() !=_player->GetTeam() ) + /*if (pOther->GetTeam() !=_player->GetTeam() ) { SendTradeStatus(TRADE_STATUS_WRONG_FACTION); return; - } + }*/ if (!pOther->IsWithinDistInMap(_player,10.0f,false)) { diff -r -u mangosorig//src/game/Unit.cpp mangos/src/game/Unit.cpp --- mangosorig//src/game/Unit.cpp 2009-11-26 21:23:20.000000000 +0100 +++ mangos/src/game/Unit.cpp 2009-11-26 21:42:57.000000000 +0100 @@ -156,6 +156,10 @@ // remove aurastates allowing special moves for(int i=0; i < MAX_REACTIVE; ++i) m_reactiveTimer[i] = 0; + + // FG + m_spoofSamePlayerFaction = false; + } Unit::~Unit() diff -r -u mangosorig//src/game/Unit.h mangos/src/game/Unit.h --- mangosorig//src/game/Unit.h 2009-11-26 21:23:20.000000000 +0100 +++ mangos/src/game/Unit.h 2009-11-26 21:46:17.000000000 +0100 @@ -1553,6 +1553,10 @@ void AddPetAura(PetAura const* petSpell); void RemovePetAura(PetAura const* petSpell); + // FG + inline void SetSpoofSamePlayerFaction(bool b) { m_spoofSamePlayerFaction = b; } + inline bool IsSpoofSamePlayerFaction(void) {return m_spoofSamePlayerFaction; } + protected: explicit Unit (); @@ -1603,6 +1607,9 @@ uint32 m_regenTimer; uint32 m_lastManaUseTimer; + // FG: + bool m_spoofSamePlayerFaction : 1; + private: bool IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent ); bool HandleDummyAuraProc( Unit *pVictim, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); Or if you prefer ... a patch file ready for 8876 : DOWNLOAD NOW! As you see this version added possibility to control NPC faction spoofing for each player independently from scripts and show pets/totems as friendly. So Thx for all guys working on mangos project
  2. @ Schmoozerd Yep, I think the False.Genesis's starting idea is better, I continue to use and update it. There are still some small issues that need to be improved (such as JCJ activation cuz of interfaction healing and other) but overall it's very interesting direction. rrtn, thanks for posting your update for all. Test and use it ! it works great.
  3. And this another style code is working to. Tested on 8076. diff -r -u mangos/src/game//Group.cpp mangos_group1/src/game//Group.cpp --- mangos/src/game//Group.cpp 2009-06-25 08:43:06.000000000 +0200 +++ mangos_group1/src/game//Group.cpp 2009-06-25 09:12:28.000000000 +0200 @@ -310,6 +310,8 @@ 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 @@ 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()); + } + } +} \\ Pas de fin de ligne à la fin du fichier. diff -r -u mangos/src/game//Group.h mangos_group1/src/game//Group.h --- mangos/src/game//Group.h 2009-06-25 08:43:06.000000000 +0200 +++ mangos_group1/src/game//Group.h 2009-06-25 09:13:18.000000000 +0200 @@ -330,6 +330,10 @@ 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 -r -u mangos/src/game//GroupHandler.cpp mangos_group1/src/game//GroupHandler.cpp --- mangos/src/game//GroupHandler.cpp 2009-06-25 08:43:06.000000000 +0200 +++ mangos_group1/src/game//GroupHandler.cpp 2009-06-25 09:14:03.000000000 +0200 @@ -196,6 +196,8 @@ if(!group->AddMember(GetPlayer()->GetGUID(), GetPlayer()->GetName())) return; + group->BroadcastGroupUpdate(); + } void WorldSession::HandleGroupDeclineOpcode( WorldPacket & /*recv_data*/ ) diff -r -u mangos/src/game//Object.cpp mangos_group1/src/game//Object.cpp --- mangos/src/game//Object.cpp 2009-06-25 08:43:06.000000000 +0200 +++ mangos_group1/src/game//Object.cpp 2009-06-25 09:16:35.000000000 +0200 @@ -652,6 +652,40 @@ 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) @@ -1629,6 +1663,19 @@ 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 -r -u mangos/src/game//Object.h mangos_group1/src/game//Object.h --- mangos/src/game//Object.h 2009-06-25 08:43:06.000000000 +0200 +++ mangos_group1/src/game//Object.h 2009-06-25 09:17:09.000000000 +0200 @@ -297,6 +297,9 @@ virtual bool hasQuest(uint32 /* quest_id */) const { return false; } virtual bool hasInvolvedQuest(uint32 /* quest_id */) const { return false; } + + void ForceValuesUpdateAtIndex(uint32); + protected: Object ( ); diff -r -u mangos/src/game//TradeHandler.cpp mangos_group1/src/game//TradeHandler.cpp --- mangos/src/game//TradeHandler.cpp 2009-06-25 08:43:06.000000000 +0200 +++ mangos_group1/src/game//TradeHandler.cpp 2009-06-25 09:17:51.000000000 +0200 @@ -534,11 +534,11 @@ return; } - if (pOther->GetTeam() !=_player->GetTeam() ) + /*if (pOther->GetTeam() !=_player->GetTeam() ) { SendTradeStatus(TRADE_STATUS_WRONG_FACTION); return; - } + }*/ if (!pOther->IsWithinDistInMap(_player,10.0f,false)) { group8076.patch
  4. Yeah, very nice. I think it's necessary to integrate it in mangos core ! Many server have few player and it will be fantastic that we just have to activate it in conf files like an option. THX
×
×
  • 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