* Fixed Itemdebugger script
* Added handling of uint64-fields to ValuesUpdate (not necessary, but nicer log output)
This commit is contained in:
parent
a1280a9647
commit
df7fb6d26b
@ -36,8 +36,8 @@ set,pguid ${@def}
|
||||
set,pname ?{getname,guid ${pguid}}
|
||||
|
||||
// between these fields all item guids are stored (check UpdateFields.h)
|
||||
set,fstart 0x26E // PLAYER_FIELD_INV_SLOT_HEAD
|
||||
set,fend 0x35A // PLAYER_FIELD_KEYRING_SLOT_1 + 64
|
||||
set,fstart 0x144 // PLAYER_FIELD_INV_SLOT_HEAD
|
||||
set,fend 0x22E // PLAYER_FIELD_KEYRING_SLOT_1 + 64
|
||||
|
||||
set,f ${fstart}
|
||||
set,slot 0
|
||||
@ -64,13 +64,14 @@ endloop
|
||||
#script=bagitemdebugger
|
||||
set,bagslots ?{getobjectvalue,60 ${@def}} // CONTAINER_FIELD_NUM_SLOTS
|
||||
set,j 0
|
||||
log This is a bag
|
||||
loop
|
||||
set,t ${j}
|
||||
mul,t 2
|
||||
if ?{bigger,${t} ${bagslots}} // max. bag size = 36 slots
|
||||
exitloop
|
||||
endif
|
||||
set,field 62 // CONTAINER_FIELD_SLOT_1 - 36
|
||||
set,field 66 // CONTAINER_FIELD_SLOT_1 - 36
|
||||
add,field ${t}
|
||||
set,itemguid ?{getobjectvalue,${field},i64 ${@def}}
|
||||
itemdebugger,{Bag slot ${j} (field: ${field}) -> } ${itemguid}
|
||||
|
||||
@ -111,6 +111,7 @@ void WorldSession::_HandleUpdateObjectOpcode(WorldPacket& recvPacket)
|
||||
Item *item = new Item();
|
||||
item->Create(uguid);
|
||||
objmgr.Add(item);
|
||||
logdebug("Created Item with guid "I64FMT,uguid);
|
||||
break;
|
||||
}
|
||||
case TYPEID_CONTAINER:
|
||||
@ -118,6 +119,7 @@ void WorldSession::_HandleUpdateObjectOpcode(WorldPacket& recvPacket)
|
||||
Bag *bag = new Bag();
|
||||
bag->Create(uguid);
|
||||
objmgr.Add(bag);
|
||||
logdebug("Created Bag with guid "I64FMT,uguid);
|
||||
break;
|
||||
}
|
||||
case TYPEID_UNIT:
|
||||
@ -404,11 +406,13 @@ void WorldSession::_ValuesUpdate(uint64 uguid, WorldPacket& recvPacket)
|
||||
uint8 blockcount,tyid;
|
||||
uint32 value, masksize, valuesCount;
|
||||
float fvalue;
|
||||
uint64 value64;
|
||||
|
||||
if(obj)
|
||||
{
|
||||
valuesCount = obj->GetValuesCount();
|
||||
tyid = obj->GetTypeId();
|
||||
logdebug("Type %u Object, %u Values",tyid, valuesCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -444,6 +448,13 @@ void WorldSession::_ValuesUpdate(uint64 uguid, WorldPacket& recvPacket)
|
||||
obj->SetFloatValue(i, fvalue);
|
||||
logdev("-> Field[%u] = %f",i,fvalue);
|
||||
}
|
||||
else if(IsUInt64Field(obj->GetTypeMask(),i) && umask.GetBit(i+1))
|
||||
{
|
||||
recvPacket >> value64;
|
||||
obj->SetUInt64Value(i, value64);
|
||||
logdev("-> Field[%u] = "I64FMT,i,value64);
|
||||
i++;
|
||||
}
|
||||
else
|
||||
{
|
||||
recvPacket >> value;
|
||||
@ -625,3 +636,111 @@ bool IsFloatField(uint8 ty, uint32 f)
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsUInt64Field(uint8 ty, uint32 f)
|
||||
{
|
||||
static uint32 u64_object[] =
|
||||
{
|
||||
(uint32)OBJECT_FIELD_GUID,
|
||||
(uint32)-1
|
||||
};
|
||||
|
||||
static uint32 u64_item[] =
|
||||
{
|
||||
(uint32)ITEM_FIELD_OWNER,
|
||||
(uint32)ITEM_FIELD_CONTAINED,
|
||||
(uint32)ITEM_FIELD_CREATOR,
|
||||
(uint32)ITEM_FIELD_GIFTCREATOR,
|
||||
(uint32)-1
|
||||
};
|
||||
static uint32 u64_container[] =
|
||||
{
|
||||
(uint32)CONTAINER_FIELD_SLOT_1,
|
||||
(uint32)-1
|
||||
};
|
||||
|
||||
static uint32 u64_unit[] =
|
||||
{
|
||||
(uint32)UNIT_FIELD_CHARM,
|
||||
(uint32)UNIT_FIELD_SUMMON,
|
||||
(uint32)UNIT_FIELD_CRITTER,
|
||||
(uint32)UNIT_FIELD_CHARMEDBY,
|
||||
(uint32)UNIT_FIELD_SUMMONEDBY,
|
||||
(uint32)UNIT_FIELD_CREATEDBY,
|
||||
(uint32)UNIT_FIELD_TARGET,
|
||||
(uint32)UNIT_FIELD_CHANNEL_OBJECT,
|
||||
(uint32)-1
|
||||
};
|
||||
static uint32 u64_player[] =
|
||||
{
|
||||
(uint32)PLAYER_DUEL_ARBITER,
|
||||
(uint32)PLAYER_FIELD_INV_SLOT_HEAD,
|
||||
(uint32)PLAYER_FIELD_PACK_SLOT_1,
|
||||
(uint32)PLAYER_FIELD_BANK_SLOT_1,
|
||||
(uint32)PLAYER_FIELD_BANKBAG_SLOT_1,
|
||||
(uint32)PLAYER_FIELD_VENDORBUYBACK_SLOT_1,
|
||||
(uint32)PLAYER_FIELD_KEYRING_SLOT_1,
|
||||
(uint32)PLAYER_FIELD_CURRENCYTOKEN_SLOT_1,
|
||||
(uint32)PLAYER_FARSIGHT,
|
||||
(uint32)PLAYER__FIELD_KNOWN_TITLES,
|
||||
(uint32)PLAYER__FIELD_KNOWN_TITLES1,
|
||||
(uint32)PLAYER__FIELD_KNOWN_TITLES2,
|
||||
(uint32)PLAYER_FIELD_KNOWN_CURRENCIES,
|
||||
(uint32)-1
|
||||
};
|
||||
static uint32 u64_gameobject[] =
|
||||
{
|
||||
(uint32)OBJECT_FIELD_CREATED_BY,
|
||||
(uint32)-1
|
||||
};
|
||||
static uint32 u64_dynobject[] =
|
||||
{
|
||||
(uint32)DYNAMICOBJECT_CASTER,
|
||||
(uint32)-1
|
||||
};
|
||||
|
||||
static uint32 u64_corpse[] =
|
||||
{
|
||||
(uint32)CORPSE_FIELD_OWNER,
|
||||
(uint32)CORPSE_FIELD_PARTY,
|
||||
(uint32)-1
|
||||
};
|
||||
|
||||
if(ty & TYPE_OBJECT)
|
||||
for(uint32 i = 0; u64_object[i] != (uint32)(-1); i++)
|
||||
if(u64_object[i] == f)
|
||||
return true;
|
||||
|
||||
if(ty & TYPE_ITEM)
|
||||
for(uint32 i = 0; u64_item[i] != (uint32)(-1); i++)
|
||||
if(u64_item[i] == f)
|
||||
return true;
|
||||
if(ty & TYPE_CONTAINER)
|
||||
for(uint32 i = 0; u64_container[i] != (uint32)(-1); i++)
|
||||
if(u64_container[i] == f)
|
||||
return true;
|
||||
|
||||
if(ty & TYPE_UNIT)
|
||||
for(uint32 i = 0; u64_unit[i] != (uint32)(-1); i++)
|
||||
if(u64_unit[i] == f)
|
||||
return true;
|
||||
if(ty & TYPE_PLAYER)
|
||||
for(uint32 i = 0; u64_player[i] != (uint32)(-1); i++)
|
||||
if(u64_player[i] == f)
|
||||
return true;
|
||||
if(ty & TYPE_GAMEOBJECT)
|
||||
for(uint32 i = 0; u64_gameobject[i] != (uint32)(-1); i++)
|
||||
if(u64_gameobject[i] == f)
|
||||
return true;
|
||||
if(ty & TYPE_DYNAMICOBJECT)
|
||||
for(uint32 i = 0; u64_dynobject[i] != (uint32)(-1); i++)
|
||||
if(u64_dynobject[i] == f)
|
||||
return true;
|
||||
|
||||
if(ty & TYPE_CORPSE)
|
||||
for(uint32 i = 0; u64_corpse[i] != (uint32)(-1); i++)
|
||||
if(u64_corpse[i] == f)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -98,5 +98,6 @@ struct MovementInfo
|
||||
};
|
||||
|
||||
bool IsFloatField(uint8, uint32);
|
||||
bool IsUInt64Field(uint8, uint32);
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user