Skip to content

Commit

Permalink
[9721] Updated high guids. Renamed few files. Added some comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomrus88 committed Apr 10, 2010
1 parent 31485e2 commit e420ce8
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 55 deletions.
2 changes: 1 addition & 1 deletion src/game/Bag.cpp
Expand Up @@ -25,7 +25,7 @@

Bag::Bag( ): Item()
{
m_objectType |= TYPEMASK_CONTAINER;
m_objectType |= (TYPEMASK_ITEM | TYPEMASK_CONTAINER);
m_objectTypeId = TYPEID_CONTAINER;

m_valuesCount = CONTAINER_END;
Expand Down
27 changes: 17 additions & 10 deletions src/game/BattleGroundMgr.cpp
Expand Up @@ -32,7 +32,7 @@
#include "BattleGroundDS.h"
#include "BattleGroundRV.h"
#include "BattleGroundIC.h"
#include "BattleGroundABG.h"
#include "BattleGroundRB.h"
#include "MapManager.h"
#include "Map.h"
#include "MapInstanced.h"
Expand Down Expand Up @@ -1528,7 +1528,7 @@ BattleGround * BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeI
bg = new BattleGroundIC(*(BattleGroundIC*)bg_template);
break;
case BATTLEGROUND_RB:
bg = new BattleGroundABG(*(BattleGroundABG*)bg_template);
bg = new BattleGroundRB(*(BattleGroundRB*)bg_template);
break;
default:
//error, but it is handled few lines above
Expand Down Expand Up @@ -1571,7 +1571,7 @@ uint32 BattleGroundMgr::CreateBattleGround(BattleGroundTypeId bgTypeId, bool IsA
case BATTLEGROUND_DS: bg = new BattleGroundDS; break;
case BATTLEGROUND_RV: bg = new BattleGroundRV; break;
case BATTLEGROUND_IC: bg = new BattleGroundIC; break;
case BATTLEGROUND_RB: bg = new BattleGroundABG; break;
case BATTLEGROUND_RB: bg = new BattleGroundRB; break;
default:bg = new BattleGround; break; // placeholder for non implemented BG
}

Expand Down Expand Up @@ -1643,19 +1643,26 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
MaxPlayersPerTeam = fields[2].GetUInt32();
MinLvl = fields[3].GetUInt32();
MaxLvl = fields[4].GetUInt32();

//check values from DB
if (MaxPlayersPerTeam == 0 || MinPlayersPerTeam == 0 || MinPlayersPerTeam > MaxPlayersPerTeam)
if (MaxPlayersPerTeam == 0 || MinPlayersPerTeam == 0)
{
MinPlayersPerTeam = 0; // by default now expected strong full bg requirement
MaxPlayersPerTeam = 40;
sLog.outErrorDb("Table `battleground_template` for id %u have wrong min/max players per team settings. BG not created.", bgTypeID);
continue;
}
if (MinLvl == 0 || MaxLvl == 0 || MinLvl > MaxLvl)

if (MinPlayersPerTeam > MaxPlayersPerTeam)
MinPlayersPerTeam = MaxPlayersPerTeam;

if (MinLvl == 0 || MaxLvl == 0)
{
// TODO: fix me
MinLvl = 0;//bl->minlvl;
MaxLvl = 80;//bl->maxlvl;
sLog.outErrorDb("Table `battleground_template` for id %u have wrong min/max level settings. BG not created.", bgTypeID);
continue;
}

if (MinLvl > MaxLvl)
MinLvl = MaxLvl;

start1 = fields[5].GetUInt32();

start = sWorldSafeLocsStore.LookupEntry(start1);
Expand Down
20 changes: 10 additions & 10 deletions src/game/BattleGroundABG.cpp → src/game/BattleGroundRB.cpp
Expand Up @@ -18,10 +18,10 @@

#include "Player.h"
#include "BattleGround.h"
#include "BattleGroundABG.h"
#include "BattleGroundRB.h"
#include "Language.h"

BattleGroundABG::BattleGroundABG()
BattleGroundRB::BattleGroundRB()
{
//TODO FIX ME!
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = 0;
Expand All @@ -30,25 +30,25 @@ BattleGroundABG::BattleGroundABG()
m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_BG_WS_HAS_BEGUN;
}

BattleGroundABG::~BattleGroundABG()
BattleGroundRB::~BattleGroundRB()
{

}

void BattleGroundABG::Update(uint32 diff)
void BattleGroundRB::Update(uint32 diff)
{
BattleGround::Update(diff);
}

void BattleGroundABG::StartingEventCloseDoors()
void BattleGroundRB::StartingEventCloseDoors()
{
}

void BattleGroundABG::StartingEventOpenDoors()
void BattleGroundRB::StartingEventOpenDoors()
{
}

void BattleGroundABG::AddPlayer(Player *plr)
void BattleGroundRB::AddPlayer(Player *plr)
{
BattleGround::AddPlayer(plr);
//create score and add it to map, default values are set in constructor
Expand All @@ -57,19 +57,19 @@ void BattleGroundABG::AddPlayer(Player *plr)
m_PlayerScores[plr->GetGUID()] = sc;
}

void BattleGroundABG::RemovePlayer(Player* /*plr*/,uint64 /*guid*/)
void BattleGroundRB::RemovePlayer(Player* /*plr*/,uint64 /*guid*/)
{

}

void BattleGroundABG::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)
void BattleGroundRB::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)
{
// this is wrong way to implement these things. On official it done by gameobject spell cast.
if (GetStatus() != STATUS_IN_PROGRESS)
return;
}

void BattleGroundABG::UpdatePlayerScore(Player* Source, uint32 type, uint32 value)
void BattleGroundRB::UpdatePlayerScore(Player* Source, uint32 type, uint32 value)
{

std::map<uint64, BattleGroundScore*>::iterator itr = m_PlayerScores.find(Source->GetGUID());
Expand Down
6 changes: 3 additions & 3 deletions src/game/BattleGroundABG.h → src/game/BattleGroundRB.h
Expand Up @@ -28,13 +28,13 @@ class BattleGroundABGScore : public BattleGroundScore
virtual ~BattleGroundABGScore() {};
};

class BattleGroundABG : public BattleGround
class BattleGroundRB : public BattleGround
{
friend class BattleGroundMgr;

public:
BattleGroundABG();
~BattleGroundABG();
BattleGroundRB();
~BattleGroundRB();
void Update(uint32 diff);

/* inherited from BattlegroundClass */
Expand Down
9 changes: 5 additions & 4 deletions src/game/ItemPrototype.h
Expand Up @@ -107,19 +107,20 @@ enum ITEM_FLAGS
ITEM_FLAGS_BINDED = 0x00000001, // set in game at binding, not set in template
ITEM_FLAGS_CONJURED = 0x00000002,
ITEM_FLAGS_OPENABLE = 0x00000004,
ITEM_FLAGS_WRAPPED = 0x00000008,
ITEM_FLAGS_WRAPPED = 0x00000008, // conflicts with heroic flag
ITEM_FLAGS_HEROIC = 0x00000008, // weird...
ITEM_FLAGS_BROKEN = 0x00000010, // appears red icon (like when item durability==0)
ITEM_FLAGS_TOTEM = 0x00000020, // ?
ITEM_FLAGS_UNK2 = 0x00000020, // saw this on item 43012, 43013, 46377, 52021...
ITEM_FLAGS_USABLE = 0x00000040, // ?
ITEM_FLAGS_NO_EQUIP_COOLDOWN = 0x00000080, // ?
ITEM_FLAGS_UNK3 = 0x00000100, // saw this on item 47115, 49295...
ITEM_FLAGS_WRAPPER = 0x00000200, // used or not used wrapper
ITEM_FLAGS_IGNORE_BAG_SPACE = 0x00000400, // ignore bag space at new item creation?
ITEM_FLAGS_PARTY_LOOT = 0x00000800, // determines if item is party loot or not
ITEM_FLAGS_REFUNDABLE = 0x00001000, // item cost can be refunded within 2 hours after purchase
ITEM_FLAGS_CHARTER = 0x00002000, // arena/guild charter
ITEM_FLAGS_REFUNDABLE_2 = 0x00008000, // ?
ITEM_FLAGS_UNK1 = 0x00010000,
ITEM_FLAGS_UNK4 = 0x00008000, // a lot of items have this
ITEM_FLAGS_UNK1 = 0x00010000, // a lot of items have this
ITEM_FLAGS_PROSPECTABLE = 0x00040000,
ITEM_FLAGS_UNIQUE_EQUIPPED = 0x00080000,
ITEM_FLAGS_USEABLE_IN_ARENA = 0x00200000,
Expand Down
2 changes: 1 addition & 1 deletion src/game/Mail.cpp
Expand Up @@ -716,7 +716,7 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket & recv_data )
bodyItem->SetText(m->body);

bodyItem->SetUInt32Value(ITEM_FIELD_CREATOR, m->sender);
bodyItem->SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_WRAPPER | ITEM_FLAGS_REFUNDABLE_2 | ITEM_FLAGS_UNK1);
bodyItem->SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_WRAPPER | ITEM_FLAGS_UNK4 | ITEM_FLAGS_UNK1);


sLog.outDetail("HandleMailCreateTextItem mailid=%u", mailId);
Expand Down
4 changes: 2 additions & 2 deletions src/game/Makefile.am
Expand Up @@ -45,7 +45,7 @@ libmangosgame_a_SOURCES = \
BattleGround.cpp \
BattleGroundAA.cpp \
BattleGroundAB.cpp \
BattleGroundABG.cpp \
BattleGroundRB.cpp \
BattleGroundAV.cpp \
BattleGroundBE.cpp \
BattleGroundDS.cpp \
Expand All @@ -59,7 +59,7 @@ libmangosgame_a_SOURCES = \
BattleGround.h \
BattleGroundAA.h \
BattleGroundAB.h \
BattleGroundABG.h \
BattleGroundRB.h \
BattleGroundAV.h \
BattleGroundBE.h \
BattleGroundDS.h \
Expand Down
22 changes: 11 additions & 11 deletions src/game/ObjectGuid.h
Expand Up @@ -40,7 +40,7 @@ enum TypeMask
{
TYPEMASK_OBJECT = 0x0001,
TYPEMASK_ITEM = 0x0002,
TYPEMASK_CONTAINER = 0x0006, // TYPEMASK_ITEM | 0x0004
TYPEMASK_CONTAINER = 0x0004,
TYPEMASK_UNIT = 0x0008, // players also have it
TYPEMASK_PLAYER = 0x0010,
TYPEMASK_GAMEOBJECT = 0x0020,
Expand All @@ -55,16 +55,16 @@ enum TypeMask

enum HighGuid
{
HIGHGUID_ITEM = 0x4000, // blizz 4000
HIGHGUID_CONTAINER = 0x4000, // blizz 4000
HIGHGUID_PLAYER = 0x0000, // blizz 0000
HIGHGUID_GAMEOBJECT = 0xF110, // blizz F110
HIGHGUID_TRANSPORT = 0xF120, // blizz F120 (for GAMEOBJECT_TYPE_TRANSPORT)
HIGHGUID_UNIT = 0xF130, // blizz F130
HIGHGUID_PET = 0xF140, // blizz F140
HIGHGUID_VEHICLE = 0xF150, // blizz F550
HIGHGUID_DYNAMICOBJECT = 0xF100, // blizz F100
HIGHGUID_CORPSE = 0xF101, // blizz F100
HIGHGUID_ITEM = 0x4700, // blizz 4700
HIGHGUID_CONTAINER = 0x4700, // blizz 4700
HIGHGUID_PLAYER = 0x0700, // blizz 0700
HIGHGUID_GAMEOBJECT = 0xF110, // blizz F110/F510
HIGHGUID_TRANSPORT = 0xF120, // blizz F120/F520 (for GAMEOBJECT_TYPE_TRANSPORT)
HIGHGUID_UNIT = 0xF130, // blizz F130/F530
HIGHGUID_PET = 0xF140, // blizz F140/F540
HIGHGUID_VEHICLE = 0xF150, // blizz F150/F550
HIGHGUID_DYNAMICOBJECT = 0xF100, // blizz F100/F500
HIGHGUID_CORPSE = 0xF500, // blizz F100/F500 used second variant to resolve conflict with HIGHGUID_DYNAMICOBJECT
HIGHGUID_MO_TRANSPORT = 0x1FC0, // blizz 1FC0 (for GAMEOBJECT_TYPE_MO_TRANSPORT)
};

Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9720"
#define REVISION_NR "9721"
#endif // __REVISION_NR_H__
4 changes: 2 additions & 2 deletions win/VC100/game.vcxproj
Expand Up @@ -355,7 +355,7 @@
<ClCompile Include="..\..\src\game\BattleGround.cpp" />
<ClCompile Include="..\..\src\game\BattleGroundAA.cpp" />
<ClCompile Include="..\..\src\game\BattleGroundAB.cpp" />
<ClCompile Include="..\..\src\game\BattleGroundABG.cpp" />
<ClCompile Include="..\..\src\game\BattleGroundRB.cpp" />
<ClCompile Include="..\..\src\game\BattleGroundAV.cpp" />
<ClCompile Include="..\..\src\game\BattleGroundBE.cpp" />
<ClCompile Include="..\..\src\game\BattleGroundDS.cpp" />
Expand Down Expand Up @@ -502,7 +502,7 @@
<ClInclude Include="..\..\src\game\BattleGround.h" />
<ClInclude Include="..\..\src\game\BattleGroundAA.h" />
<ClInclude Include="..\..\src\game\BattleGroundAB.h" />
<ClInclude Include="..\..\src\game\BattleGroundABG.h" />
<ClInclude Include="..\..\src\game\BattleGroundRB.h" />
<ClInclude Include="..\..\src\game\BattleGroundAV.h" />
<ClInclude Include="..\..\src\game\BattleGroundBE.h" />
<ClInclude Include="..\..\src\game\BattleGroundDS.h" />
Expand Down
4 changes: 2 additions & 2 deletions win/VC80/game.vcproj
Expand Up @@ -566,11 +566,11 @@
>
</File>
<File
RelativePath="..\..\src\game\BattleGroundABG.cpp"
RelativePath="..\..\src\game\BattleGroundRB.cpp"
>
</File>
<File
RelativePath="..\..\src\game\BattleGroundABG.h"
RelativePath="..\..\src\game\BattleGroundRB.h"
>
</File>
<File
Expand Down
16 changes: 8 additions & 8 deletions win/VC90/game.vcproj
Expand Up @@ -566,14 +566,6 @@
RelativePath="..\..\src\game\BattleGroundAB.h"
>
</File>
<File
RelativePath="..\..\src\game\BattleGroundABG.cpp"
>
</File>
<File
RelativePath="..\..\src\game\BattleGroundABG.h"
>
</File>
<File
RelativePath="..\..\src\game\BattleGroundAV.cpp"
>
Expand Down Expand Up @@ -634,6 +626,14 @@
RelativePath="..\..\src\game\BattleGroundNA.h"
>
</File>
<File
RelativePath="..\..\src\game\BattleGroundRB.cpp"
>
</File>
<File
RelativePath="..\..\src\game\BattleGroundRB.h"
>
</File>
<File
RelativePath="..\..\src\game\BattleGroundRL.cpp"
>
Expand Down

6 comments on commit e420ce8

@Neo2003
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For items/containers and players. The guid 2nd and 3rd digits depend on server in a group of server. Eitrigg (EU) uses 0x0680 mask (items are 0x4680, players are all 0x0680...

@alexrp
Copy link

@alexrp alexrp commented on e420ce8 Apr 10, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last 3 bytes of a GUID are mask and type.

A GUID typically goes like this: MMTEEEEELLLLLLLL

Where:

M = mask (flags)
T = type
E = entry (if any)
L = low (can be longer if no entry part)

Eventually, we should use these... Hence why the ObjectGuid class was used and cleanups regarding it have started.

@VladimirMangos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I worry about 2 case:

  1. do we realy in all cases use proepr lowguid->guid convertion for players
  2. character_aura/pet_aura store full caster guids

@LordJZ
Copy link
Contributor

@LordJZ LordJZ commented on e420ce8 Apr 10, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. As the player higuid changed in this commit, if there are such failures in the code, they will be posted at forums probably (cus lowguid != fullguid after this commit)
  2. We could remove caster guids' storing and store (current_)basepoints instead, but calculate it at aura apply, as it should be blizzlike (but it's a long long story)

@VladimirMangos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(1) ofc

(2) caster stored for another thing: for proper report like dot/hot caster name and who must get threat

@LordJZ
Copy link
Contributor

@LordJZ LordJZ commented on e420ce8 Apr 10, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, now I see, thankyou.

Please sign in to comment.