当前位置: 首页>>代码示例>>C++>>正文


C++ SetUInt64Value函数代码示例

本文整理汇总了C++中SetUInt64Value函数的典型用法代码示例。如果您正苦于以下问题:C++ SetUInt64Value函数的具体用法?C++ SetUInt64Value怎么用?C++ SetUInt64Value使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SetUInt64Value函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SetUInt64Value

Item *Container::SafeRemoveAndRetreiveItemFromSlot(int16 slot, bool destroy)
{
	if (slot < 0 || (uint32)slot >= GetProto()->ContainerSlots)
		return false;

	Item *pItem = m_Slot[slot];

	if (pItem == NULL || pItem==this) return NULL;
	m_Slot[slot] = NULL;

	if( pItem->GetOwner() == m_owner )
	{
		SetUInt64Value(CONTAINER_FIELD_SLOT_1  + slot*2, 0 );
		pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, 0);

		if(destroy)
		{
			if(pItem->IsInWorld())
			{
				pItem->RemoveFromWorld();
			}
			pItem->DeleteFromDB();
		}
	}
	else
		pItem = NULL;

	return pItem;
}
开发者ID:xiaofeng,项目名称:Arcemu,代码行数:29,代码来源:Container.cpp

示例2: GetGUID

bool Container::AddItemToFreeSlot(Item *pItem, uint32 * r_slot)
{
	uint32 slot;
	for(slot = 0; slot < GetProto()->ContainerSlots; slot++)
	{
		if(!m_Slot[slot])
		{
			m_Slot[slot] = pItem;
			pItem->m_isDirty = true;

			pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID());
			pItem->SetOwner(m_owner);

			SetUInt64Value(CONTAINER_FIELD_SLOT_1  + (slot*2), pItem->GetGUID());

			if(m_owner->IsInWorld() && !pItem->IsInWorld())
			{
				pItem->PushToWorld(m_owner->GetMapMgr());
				ByteBuffer buf(2500);
				uint32 count = pItem->BuildCreateUpdateBlockForPlayer( &buf, m_owner );
				m_owner->PushCreationData(&buf, count);
			}
			if(r_slot)
				*r_slot = slot;
#ifdef ENABLE_ACHIEVEMENTS
			m_owner->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM, pItem->GetProto()->ItemId, pItem->GetUInt32Value(ITEM_FIELD_STACK_COUNT), 0);
#endif
			return true;
		}
	}
	return false;
}
开发者ID:xiaofeng,项目名称:Arcemu,代码行数:32,代码来源:Container.cpp

示例3: ASSERT

bool Corpse::Create(uint32 guidlow, Player* owner)
{
    ASSERT(owner);

    Relocate(owner->GetPositionX(), owner->GetPositionY(), owner->GetPositionZ(), owner->GetOrientation());

    if (!IsPositionValid())
    {
        TC_LOG_ERROR(LOG_FILTER_PLAYER, "Corpse (guidlow %d, owner %s) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
            guidlow, owner->GetName().c_str(), owner->GetPositionX(), owner->GetPositionY());
        return false;
    }

    //we need to assign owner's map for corpse
    //in other way we will get a crash in Corpse::SaveToDB()
    SetMap(owner->GetMap());

    WorldObject::_Create(guidlow, HIGHGUID_CORPSE, owner->GetPhaseMask());

    SetObjectScale(1);
    SetUInt64Value(CORPSE_FIELD_OWNER, owner->GetGUID());

    _gridCoord = Trinity::ComputeGridCoord(GetPositionX(), GetPositionY());

    return true;
}
开发者ID:mynew2,项目名称:trinitycore-1,代码行数:26,代码来源:Corpse.cpp

示例4: MANGOS_ASSERT

bool Corpse::Create( uint32 guidlow, Player *owner)
{
    MANGOS_ASSERT(owner);

    WorldObject::_Create(guidlow, HIGHGUID_CORPSE, owner->GetPhaseMask());
    Relocate(owner->GetPositionX(), owner->GetPositionY(), owner->GetPositionZ(), owner->GetOrientation());

    //we need to assign owner's map for corpse
    //in other way we will get a crash in Corpse::SaveToDB()
    SetMap(owner->GetMap());

    if(!IsPositionValid())
    {
        sLog.outError("Corpse (guidlow %d, owner %s) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
            guidlow, owner->GetName(), owner->GetPositionX(), owner->GetPositionY());
        return false;
    }

    SetObjectScale(DEFAULT_OBJECT_SCALE);
    SetUInt64Value( CORPSE_FIELD_OWNER, owner->GetGUID() );

    m_grid = MaNGOS::ComputeGridPair(GetPositionX(), GetPositionY());

    return true;
}
开发者ID:Choices,项目名称:mangos,代码行数:25,代码来源:Corpse.cpp

示例5: ASSERT

void Container::Create( uint32 itemid, Player *owner, ItemPrototype *proto )
{
	m_itemProto = proto;
	ASSERT(m_itemProto);

	SetUInt32Value( OBJECT_FIELD_ENTRY, itemid );
	SetUInt64Value( ITEM_FIELD_OWNER, owner->GetGUID() );
	SetUInt64Value( ITEM_FIELD_CONTAINED, owner->GetGUID() );
	SetUInt32Value( ITEM_FIELD_STACK_COUNT, 1 );
	SetUInt32Value( CONTAINER_FIELD_NUM_SLOTS, m_itemProto->ContainerSlots);

	m_Slot = new Item*[m_itemProto->ContainerSlots];
	memset(m_Slot, 0, sizeof(Item*)*(m_itemProto->ContainerSlots));

	m_owner = owner;
}
开发者ID:pfchrono,项目名称:rs-ascent,代码行数:16,代码来源:AHBot.cpp

示例6: SetMap

bool DynamicObject::CreateDynamicObject(uint32 guidlow, Unit* caster, uint32 spellId, Position const& pos, float radius, DynamicObjectType type)
{
    SetMap(caster->GetMap());
    Relocate(pos);
    if (!IsPositionValid())
    {
        sLog->outError(LOG_FILTER_GENERAL, "DynamicObject (spell %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", spellId, GetPositionX(), GetPositionY());
        return false;
    }

    WorldObject::_Create(guidlow, HIGHGUID_DYNAMICOBJECT, caster->GetPhaseMask());

    SetEntry(spellId);
    SetObjectScale(1);
    SetUInt64Value(DYNAMICOBJECT_CASTER, caster->GetGUID());

    // The lower word of DYNAMICOBJECT_BYTES must be 0x0001. This value means that the visual radius will be overriden
    // by client for most of the "ground patch" visual effect spells and a few "skyfall" ones like Hurricane.
    // If any other value is used, the client will _always_ use the radius provided in DYNAMICOBJECT_RADIUS, but
    // precompensation is necessary (eg radius *= 2) for many spells. Anyway, blizz sends 0x0001 for all the spells
    // I saw sniffed...
    SetByteValue(DYNAMICOBJECT_BYTES, 0, type);
    SetUInt32Value(DYNAMICOBJECT_SPELLID, spellId);
    SetFloatValue(DYNAMICOBJECT_RADIUS, radius);
    SetUInt32Value(DYNAMICOBJECT_CASTTIME, getMSTime());

    if (IsWorldObject())
        setActive(true);    //must before add to map to be put in world container

    if (!GetMap()->AddToMap(this))
        return false;

    return true;
}
开发者ID:AnthoDevMoP,项目名称:Genesis,代码行数:34,代码来源:DynamicObject.cpp

示例7: SetMap

bool DynamicObject::Create(uint32 guidlow, Unit *caster, uint32 spellId, const Position &pos, float radius, bool active)
{
    SetMap(caster->GetMap());
    Relocate(pos);
    if (!IsPositionValid())
    {
        sLog.outError("DynamicObject (spell %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",spellId,GetPositionX(),GetPositionY());
        return false;
    }

    WorldObject::_Create(guidlow, HIGHGUID_DYNAMICOBJECT, caster->GetPhaseMask());

    SetEntry(spellId);
    SetFloatValue(OBJECT_FIELD_SCALE_X, 1);
    SetUInt64Value(DYNAMICOBJECT_CASTER, caster->GetGUID());

    // The lower word of DYNAMICOBJECT_BYTES must be 0x0001. This value means that the visual radius will be overriden
    // by client for most of the "ground patch" visual effect spells and a few "skyfall" ones like Hurricane.
    // If any other value is used, the client will _always_ use the radius provided in DYNAMICOBJECT_RADIUS, but
    // precompensation is necessary (eg radius *= 2) for many spells. Anyway, blizz sends 0x0001 for all the spells
    // I saw sniffed...
    SetUInt32Value(DYNAMICOBJECT_BYTES, 0x00000001);
    SetUInt32Value(DYNAMICOBJECT_SPELLID, spellId);
    SetFloatValue(DYNAMICOBJECT_RADIUS, radius);
    SetUInt32Value(DYNAMICOBJECT_CASTTIME, getMSTime());

    m_isWorldObject = active;
    return true;
}
开发者ID:ice74,项目名称:blizzwow,代码行数:29,代码来源:DynamicObject.cpp

示例8: GetGUID

bool Container::AddItemToFreeSlot(Item *pItem, uint32 * r_slot)
{
	uint32 slot;
	for(slot = 0; slot < GetProto()->ContainerSlots; slot++)
	{
		if(!m_Slot[slot])
		{
			m_Slot[slot] = pItem;
			pItem->m_isDirty = true;

			pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, GetGUID());
			pItem->SetOwner(m_owner);

			SetUInt64Value(CONTAINER_FIELD_SLOT_1  + (slot*2), pItem->GetGUID());

			if(m_owner->IsInWorld() && !pItem->IsInWorld())
			{
				pItem->PushToWorld(m_owner->GetMapMgr());
				ByteBuffer buf(2500);
				uint32 count = pItem->BuildCreateUpdateBlockForPlayer( &buf, m_owner );
				m_owner->PushCreationData(&buf, count);
			}
			if(r_slot)
				*r_slot = slot;
			return true;
		}
	}
	return false;
}
开发者ID:Chero,项目名称:abcwow,代码行数:29,代码来源:Container.cpp

示例9: SetInstanceId

bool Corpse::Create( uint32 guidlow, Player *owner)
{
    SetInstanceId(owner->GetInstanceId());

    WorldObject::_Create(guidlow, HIGHGUID_CORPSE, owner->GetMapId(), owner->GetPhaseMask());

    Relocate(owner->GetPositionX(), owner->GetPositionY(), owner->GetPositionZ(), owner->GetOrientation());

    if(!IsPositionValid())
    {
        sLog.outError("Corpse (guidlow %d, owner %s) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
            guidlow,owner->GetName(),owner->GetPositionX(), owner->GetPositionY());
        return false;
    }

    SetFloatValue( OBJECT_FIELD_SCALE_X, 1 );
    SetFloatValue( CORPSE_FIELD_POS_X, GetPositionX() );
    SetFloatValue( CORPSE_FIELD_POS_Y, GetPositionY() );
    SetFloatValue( CORPSE_FIELD_POS_Z, GetPositionZ() );
    SetFloatValue( CORPSE_FIELD_FACING, GetOrientation() );
    SetUInt64Value( CORPSE_FIELD_OWNER, owner->GetGUID() );

    m_grid = Quad::ComputeGridPair(GetPositionX(), GetPositionY());

    return true;
}
开发者ID:madhatternc,项目名称:QuaDCore,代码行数:26,代码来源:Corpse.cpp

示例10: SetInstanceId

bool DynamicObject::Create( uint32 guidlow, Unit *caster, uint32 spellId, uint32 effIndex, float x, float y, float z, int32 duration, float radius )
{
    SetInstanceId(caster->GetInstanceId());

    WorldObject::_Create(guidlow, HIGHGUID_DYNAMICOBJECT, caster->GetMapId());
    Relocate(x,y,z,0);

    if(!IsPositionValid())
    {
        sLog.outError("ERROR: DynamicObject (spell %u eff %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",spellId,effIndex,GetPositionX(),GetPositionY());
        return false;
    }

    SetEntry(spellId);
    SetFloatValue( OBJECT_FIELD_SCALE_X, 1 );
    SetUInt64Value( DYNAMICOBJECT_CASTER, caster->GetGUID() );
    SetUInt32Value( DYNAMICOBJECT_BYTES, 0x00000001 );
    SetUInt32Value( DYNAMICOBJECT_SPELLID, spellId );
    SetFloatValue( DYNAMICOBJECT_RADIUS, radius);
    SetFloatValue( DYNAMICOBJECT_POS_X, x );
    SetFloatValue( DYNAMICOBJECT_POS_Y, y );
    SetFloatValue( DYNAMICOBJECT_POS_Z, z );
    SetUInt32Value( DYNAMICOBJECT_CASTTIME, getMSTime() );  // new 2.4.0

    m_aliveDuration = duration;
    m_radius = radius;
    m_effIndex = effIndex;
    m_spellId = spellId;
    m_casterGuid = caster->GetGUID();
    m_updateTimer = 0;
    return true;
}
开发者ID:Bootz,项目名称:TC-One,代码行数:32,代码来源:DynamicObject.cpp

示例11: SetUInt32Value

void Corpse::Delink()
{
	SetUInt32Value(CORPSE_FIELD_FLAGS,5);
	SetUInt64Value(CORPSE_FIELD_OWNER,0);
	SetCorpseState(CORPSE_STATE_BONES);
	DeleteFromDB();
}
开发者ID:Chero,项目名称:abcwow,代码行数:7,代码来源:Corpse.cpp

示例12: switch

void DynamicObject::Create(Object* caster, Spell* pSpell, float x, float y, float z, uint32 duration, float radius)
{
	Object::_Create(caster->GetMapId(),x, y, z, 0);
	if(pSpell->g_caster)
		m_parentSpell = pSpell;

	m_caster = caster;
	switch(caster->GetTypeId())
	{
	case TYPEID_GAMEOBJECT:
		{
			p_caster = pSpell->p_caster;
			u_caster = pSpell->u_caster;
			if(!u_caster && p_caster)
				u_caster = TO_UNIT(p_caster);

			g_caster = TO_GAMEOBJECT(caster);
		}break;
	case TYPEID_UNIT:
		{
			u_caster = TO_UNIT(caster);
		}break;
	case TYPEID_PLAYER:
		{
			p_caster = TO_PLAYER(caster);
			u_caster = TO_UNIT(caster);
		}break;
	}

	m_spellProto = pSpell->m_spellInfo;
	SetUInt64Value(DYNAMICOBJECT_CASTER, caster->GetGUID());

	m_uint32Values[OBJECT_FIELD_ENTRY] = m_spellProto->Id;
	m_uint32Values[DYNAMICOBJECT_BYTES] = 0x01eeeeee;
	m_uint32Values[DYNAMICOBJECT_SPELLID] = m_spellProto->Id;

	m_floatValues[DYNAMICOBJECT_RADIUS] = radius;
	m_position.x = x;
	m_position.y = y;
	m_position.z = z;
	m_uint32Values[DYNAMICOBJECT_CASTTIME] = (uint32)UNIXTIME;

	m_aliveDuration = duration;
	m_faction = caster->m_faction;
	m_factionDBC = caster->m_factionDBC;
	if(caster->dynObj != 0)
	{
		// expire next update
		caster->dynObj->m_aliveDuration = 1;
		caster->dynObj->UpdateTargets();
	}
	caster->dynObj = TO_DYNAMICOBJECT(this);

	PushToWorld(caster->GetMapMgr());

	sEventMgr.AddEvent(TO_DYNAMICOBJECT(this), &DynamicObject::UpdateTargets, EVENT_DYNAMICOBJECT_UPDATE, 200, 0,EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
}
开发者ID:arcticdev,项目名称:arcticdev,代码行数:57,代码来源:DynamicObject.cpp

示例13: ASSERT

void Bag::RemoveItem(uint8 slot, bool /*update*/) {
	ASSERT(slot < MAX_BAG_SIZE);

	if (m_bagslot[slot])
		m_bagslot[slot]->SetContainer(NULL);

	m_bagslot[slot] = NULL;
	SetUInt64Value(CONTAINER_FIELD_SLOT_1 + (slot * 2), 0);
}
开发者ID:Bootz,项目名称:DeepshjirRepack,代码行数:9,代码来源:Bag.cpp

示例14: SetUInt32Value

void Item::Create( uint32 guidlow, uint32 itemid, Player *owner )
{
    Object::_Create( guidlow, HIGHGUID_ITEM );

    SetUInt32Value( OBJECT_FIELD_ENTRY, itemid );
    SetFloatValue( OBJECT_FIELD_SCALE_X, 1.0f );

    SetUInt64Value( ITEM_FIELD_OWNER, owner->GetGUID() );
    SetUInt64Value( ITEM_FIELD_CONTAINED, owner->GetGUID() );
    SetUInt32Value( ITEM_FIELD_STACK_COUNT, 1 );

    m_itemProto = objmgr.GetItemPrototype( itemid );
    ASSERT(m_itemProto);

    //for(int i=5;i<m_valuesCount;i++)
    //     SetUInt32Value( i, 1 );

    SetUInt32Value( ITEM_FIELD_MAXDURABILITY, m_itemProto->MaxDurability);
    SetUInt32Value( ITEM_FIELD_DURABILITY, m_itemProto->MaxDurability);
/*
    ITEM_FIELD_OWNER                        =    6,  //  2  UINT64
    ITEM_FIELD_CONTAINED                    =    8,  //  2  UINT64
    ITEM_FIELD_CREATOR                      =   10,  //  2  UINT64
    ITEM_FIELD_GIFTCREATOR                  =   12,  //  2  UINT64
    ITEM_FIELD_STACK_COUNT                  =   14,  //  1  UINT32
    ITEM_FIELD_DURATION                     =   15,  //  1  UINT32
    ITEM_FIELD_SPELL_CHARGES                =   16,  //  5  SPELLCHARGES
    ITEM_FIELD_FLAGS                        =   21,  //  1  UINT32
    ITEM_FIELD_ENCHANTMENT                  =   22,  //  21 ENCHANTMENT
    ITEM_FIELD_PROPERTY_SEED                =   43,  //  1  UINT32
    ITEM_FIELD_RANDOM_PROPERTIES_ID         =   44,  //  1  UINT32
    ITEM_FIELD_ITEM_TEXT_ID                 =   45,  //  1  UINT32
    ITEM_FIELD_DURABILITY                   =   46,  //  1  UINT32
    ITEM_FIELD_MAXDURABILITY                =   47,  //  1  UINT32
*/
    SetUInt32Value( ITEM_FIELD_SPELL_CHARGES, m_itemProto->SpellCharges[0]);
    SetUInt32Value( ITEM_FIELD_SPELL_CHARGES+1, m_itemProto->SpellCharges[1]);
    SetUInt32Value( ITEM_FIELD_SPELL_CHARGES+2, m_itemProto->SpellCharges[2]);
    SetUInt32Value( ITEM_FIELD_SPELL_CHARGES+3, m_itemProto->SpellCharges[3]);
    SetUInt32Value( ITEM_FIELD_SPELL_CHARGES+4, m_itemProto->SpellCharges[4]);
    SetUInt32Value( ITEM_FIELD_FLAGS, m_itemProto->Flags);
    SetUInt32Value( ITEM_FIELD_ITEM_TEXT_ID, m_itemProto->DisplayInfoID);
    m_owner = owner;
}
开发者ID:Artea,项目名称:mangos-svn,代码行数:44,代码来源:Item.cpp

示例15: SetUInt32Value

void Item::Create( uint32 guidlow, uint32 itemid, Player *owner )
{
    Object::_Create( guidlow, HIGHGUID_ITEM );

    SetUInt32Value( OBJECT_FIELD_ENTRY, itemid );
    SetFloatValue( OBJECT_FIELD_SCALE_X, 1.0f );

    SetUInt64Value( ITEM_FIELD_OWNER, owner->GetGUID() );
    SetUInt64Value( ITEM_FIELD_CONTAINED, owner->GetGUID() );
    SetUInt32Value( ITEM_FIELD_STACK_COUNT, 1 );

    m_itemProto = objmgr.GetItemPrototype( itemid );
    ASSERT(m_itemProto);

    SetUInt32Value( ITEM_FIELD_MAXDURABILITY, m_itemProto->MaxDurability);
    SetUInt32Value( ITEM_FIELD_DURABILITY, m_itemProto->MaxDurability);

    m_owner = owner;
}
开发者ID:Artea,项目名称:mangos-svn,代码行数:19,代码来源:Item.cpp


注:本文中的SetUInt64Value函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。