WorldObject* ObjectAccessor::GetWorldObject(WorldObject const& p, uint64 guid) { switch (GUID_HIPART(guid)) { case HIGHGUID_PLAYER: return GetPlayer(p, guid); case HIGHGUID_TRANSPORT: case HIGHGUID_MO_TRANSPORT: case HIGHGUID_GAMEOBJECT: return GetGameObject(p, guid); case HIGHGUID_VEHICLE: case HIGHGUID_UNIT: return GetCreature(p, guid); case HIGHGUID_PET: return GetPet(p, guid); case HIGHGUID_DYNAMICOBJECT: return GetDynamicObject(p, guid); case HIGHGUID_CORPSE: return GetCorpse(p, guid); default: return NULL; } }
WorldObject* ObjectAccessor::GetWorldObject(WorldObject const& p, ObjectGuid const& guid) { switch (guid.GetHigh()) { case HighGuid::Player: return GetPlayer(p, guid); case HighGuid::Transport: case HighGuid::GameObject: return GetGameObject(p, guid); case HighGuid::Vehicle: case HighGuid::Creature: return GetCreature(p, guid); case HighGuid::Pet: return GetPet(p, guid); case HighGuid::DynamicObject: return GetDynamicObject(p, guid); case HighGuid::AreaTrigger: return GetAreaTrigger(p, guid); case HighGuid::Corpse: return GetCorpse(p, guid); default: return NULL; } }
//------------------------------------------------------------------------ void CItem::InitClient(int channelId) { const int numAccessories = m_accessories.size(); // send the differences between the current, and the initial setup for (int i = 0; i < numAccessories; i++) { uint16 classId = 0; bool result = g_pGame->GetIGameFramework()->GetNetworkSafeClassId(classId, m_accessories[i].pClass->GetName()); #if !defined(_RELEASE) if(!result) { char errorMsg[256]; sprintf(errorMsg, "CItem::InitClient failed to find network safe class id for %s", m_accessories[i].pClass->GetName()); CRY_ASSERT_MESSAGE(result, errorMsg); } #endif if(result) GetGameObject()->InvokeRMI(ClAttachInitialAccessory(), AccessoryParams(classId), eRMI_ToClientChannel, channelId); } IActor *pOwner=GetOwnerActor(); if (!pOwner) return; // only send the pickup message if the player is connecting // for items spawned during gameplay, CItem::PickUp is already sending the pickup message INetChannel *pNetChannel=m_pGameFramework->GetNetChannel(channelId); if (pNetChannel && pNetChannel->GetContextViewState()<eCVS_InGame) { if (!m_stats.mounted && !m_stats.used) { pOwner->GetGameObject()->InvokeRMIWithDependentObject(CActor::ClPickUp(), CActor::PickItemParams(GetEntityId(), m_stats.selected, false), eRMI_ToClientChannel, GetEntityId(), channelId); //GetOwnerActor()->GetGameObject()->InvokeRMI(CActor::ClPickUp(), // CActor::PickItemParams(GetEntityId(), m_stats.selected, false), eRMI_ToClientChannel, channelId); } } if (m_stats.mounted && m_stats.used) { pOwner->GetGameObject()->InvokeRMIWithDependentObject(CActor::ClStartUse(), CActor::ItemIdParam(GetEntityId()), eRMI_ToClientChannel, GetEntityId(), channelId); } }
void CHeavyMountedWeapon::TryRipOffGun() { CActor *pActor = GetOwnerActor(); if(!pActor) return; PerformRipOff(pActor); if(gEnv->bServer) { CHANGED_NETWORK_STATE(this, ASPECT_RIPOFF); } else { GetGameObject()->InvokeRMI(SvRequestRipOff(), EmptyParams(), eRMI_ToServer); } }
ObjectData* Event::GetGameObject(const std::string& aName, ObjectData* aParent) const { for (unsigned int i = 0; i < aParent->myChilds.Size(); ++i) { if (aParent->myChilds[i]->myName == aName) { return aParent->myChilds[i]; } ObjectData* data = GetGameObject(aName, aParent->myChilds[i]); if (data != nullptr) { return data; } } return nullptr; }
void CGunTurret::FullSerialize(TSerialize ser) { CWeapon::FullSerialize(ser); ser.BeginGroup("GunTurret"); ser.Value("target", m_targetId); ser.EndGroup(); if(ser.IsReading()) { if(!IsDestroyed()) { if(IGameObject *pGameObject = GetGameObject()) PostInit(pGameObject); } } }
//----------------------------------------------------------------------- void CWeapon::RequestCancelReload() { CActor *pActor=GetOwnerActor(); if (!gEnv->bServer && pActor && pActor->IsClient()) { if(m_fm) { m_fm->CancelReload(); } GetGameObject()->InvokeRMI(SvRequestCancelReload(), DefaultParams(), eRMI_ToServer); } else if (IsServer()) { SvCancelReload(); } }
GameObject* Transform::Find(RegistrationId nameHash) { GameObject* gameObject = GetGameObject(); if( gameObject->GetNameHash() == nameHash ) return gameObject; for(Transform* child = firstChild; child != 0; child = child->nextSibling) { GameObject* childObject = child->GetGameObject(); RegistrationId childNameHash = childObject->GetNameHash(); if( childNameHash == nameHash ) return childObject; } return 0; }
void CAccessory::Physicalize( bool enable, bool rigid ) { const bool isMounted = (GetParentId() != 0); int profile = eIPhys_NotPhysicalized; if (enable && !isMounted) { profile = rigid ? eIPhys_PhysicalizedRigid : eIPhys_PhysicalizedStatic; } if (IsServer()) { GetGameObject()->SetAspectProfile(eEA_Physics, profile); } m_deferPhysicalization = eIPhys_Max; }
const EDMath::Aabb& ShapeRenderer::GetAabb(void) { const EDMath::Float4x4& worldMat = GetGameObject()->GetTransform()->GetWorldMatrix(); if(renderShapePtr != 0) { EDMath::Aabb aabb = renderShapePtr->GetRenderMesh()->GetAabb(); EDMath::TransformAabb(worldAabb, aabb, worldMat); } else { worldAabb.center = worldMat.WAxis; worldAabb.extents.x = worldAabb.extents.y = worldAabb.extents.z = 0.001f; } return worldAabb; }
void Target::Update(void) { if( spinTimer > 0.0f ) { float deltaTime = EDGameCore::Game::GetDeltaTime(); spinTimer -= deltaTime; GetTransform()->RotateLocalY( 3.14159f * deltaTime ); } else { LookAt* lookAtBehavior = GetGameObject()->GetBehavior<LookAt>(); if( lookAtBehavior != 0 ) lookAtBehavior->enable(); } }
void BattlefieldWG::ProcessEvent(WorldObject* obj, uint32 eventId) { if (!obj || !IsWarTime()) return; // We handle only gameobjects here GameObject* go = obj->ToGameObject(); if (!go) return; // On click on titan relic if (go->GetEntry() == GO_WINTERGRASP_TITAN_S_RELIC) { if (CanInteractWithRelic()) EndBattle(false); else if (GameObject* relic = GetRelic()) relic->SetRespawnTime(RESPAWN_IMMEDIATELY); } // if destroy or damage event, search the wall/tower and update worldstate/send warning message for (GameObjectBuilding::const_iterator itr = BuildingsInZone.begin(); itr != BuildingsInZone.end(); ++itr) { if (GameObject* build = GetGameObject((*itr)->m_BuildGUID)) { if (go->GetEntry() == build->GetEntry()) { if (build->GetGOInfo()->building.damagedEvent == eventId) (*itr)->Damaged(); if (build->GetGOInfo()->building.destroyedEvent == eventId) (*itr)->Destroyed(); // Add Support of Quests Toppling the Towers & Southern Sabotage if (go->GetEntry()==190356 || go->GetEntry()==190357 || go->GetEntry()==190358) { for (GuidSet::const_iterator itr = m_PlayersInWar[GetDefenderTeam()].begin(); itr != m_PlayersInWar[GetDefenderTeam()].end(); ++itr) if (Player* player = sObjectAccessor->FindPlayer(*itr)) player->RewardPlayerAndGroupAtEvent(35074, go); } break; } } } }
void CLivingEntitySample::Reset( const bool enteringGameMode ) { ResetCharacterModel(); ResetAnimationState(); Physicalize(); IGameObject* pGameObject = GetGameObject(); if ( enteringGameMode ) { pGameObject->EnablePostUpdates( this ); pGameObject->EnablePrePhysicsUpdate( ePPU_Always ); } else { pGameObject->DisablePostUpdates( this ); pGameObject->EnablePrePhysicsUpdate( ePPU_Never ); } }
//------------------------------------------------------------------------ void CGameRules::ClientHit(const HitInfo &hitInfo) { FUNCTION_PROFILER(GetISystem(), PROFILE_GAME); IActor *pClientActor = g_pGame->GetIGameFramework()->GetClientActor(); IEntity *pTarget = m_pEntitySystem->GetEntity(hitInfo.targetId); IEntity *pShooter = m_pEntitySystem->GetEntity(hitInfo.shooterId); IVehicle *pVehicle = g_pGame->GetIGameFramework()->GetIVehicleSystem()->GetVehicle(hitInfo.targetId); IActor *pActor = g_pGame->GetIGameFramework()->GetIActorSystem()->GetActor(hitInfo.targetId); bool dead = pActor?(pActor->GetHealth()<=0):false; if((pClientActor && pClientActor->GetEntity()==pShooter) && pTarget && (pVehicle || pActor) && !dead) { SAFE_HUD_FUNC(GetCrosshair()->CrosshairHit()); SAFE_HUD_FUNC(GetTagNames()->AddEnemyTagName(pActor?pActor->GetEntityId():pVehicle->GetEntityId())); } if(pActor == pClientActor) if (gEnv->pInput) gEnv->pInput->ForceFeedbackEvent( SFFOutputEvent(eDI_XI, eFF_Rumble_Basic, 0.5f * hitInfo.damage * 0.01f, hitInfo.damage * 0.02f, 0.0f)); /* if (gEnv->pAISystem && !gEnv->bMultiplayer) { static int htMelee = GetHitTypeId("melee"); if (pShooter && hitInfo.type != htMelee) { ISurfaceType *pSurfaceType = GetHitMaterial(hitInfo.material); const ISurfaceType::SSurfaceTypeAIParams* pParams = pSurfaceType ? pSurfaceType->GetAIParams() : 0; const float radius = pParams ? pParams->fImpactRadius : 5.0f; gEnv->pAISystem->BulletHitEvent(hitInfo.pos, radius, pShooter->GetAI()); } }*/ CreateScriptHitInfo(m_scriptHitInfo, hitInfo); CallScript(m_clientStateScript, "OnHit", m_scriptHitInfo); bool backface = hitInfo.dir.Dot(hitInfo.normal)>0; if (!hitInfo.remote && hitInfo.targetId && !backface) { if (!gEnv->bServer) GetGameObject()->InvokeRMI(SvRequestHit(), hitInfo, eRMI_ToServer); else ServerHit(hitInfo); } }
void MeshRenderer::Update(GameTime* gameTime,GraphicsDevice* graphicsDevice) { int drawCalls = 0; int triangles = 0; if(_mesh != NULL) { VertexBuffer* vertexBuffer = _mesh->GetVertexBuffer(); IndexBuffer* indexBuffer = _mesh->GetIndexBuffer(); //Set the per object uniforms of the game object(for example - the world matrix) _material->SetObjectUniforms(graphicsDevice, GetGameObject()); vertexBuffer->BindBuffer(); //Draw the mesh unsigned int numberOfAttributeInformations = vertexBuffer->GetNumberOfAttributeInfos(); for(unsigned int i = 0; i < numberOfAttributeInformations; i++) { const VertexAttributeInformation& thisInfo = vertexBuffer->GetVertexAttributeInformation(i); graphicsDevice->EnableVertexAttribute(thisInfo.GetIndex()); graphicsDevice->SetVertexAttribute(thisInfo.GetIndex(), thisInfo.GetSize(), thisInfo.GetType(), thisInfo.GetIsNormalized(), thisInfo.GetStride(), thisInfo.GetOffset()); } //Bind the index buffer indexBuffer->BindBuffer(); //DRAW graphicsDevice->DrawElements(GraphicsPrimitiveType::Triangles(), indexBuffer->GetNumberOfElements(), indexBuffer->GetIndexDataType(), (void*)0); drawCalls++; triangles += indexBuffer->GetNumberOfElements() / 3; for(unsigned int i = 0; i < numberOfAttributeInformations; i++) { graphicsDevice->DisableVertexAttribute(vertexBuffer->GetVertexAttributeInformation(i).GetIndex()); } indexBuffer->UnbindBuffer(); vertexBuffer->UnbindBuffer(); } SetNumberOfDrawCalls(drawCalls); SetNumberOfTriangles(triangles); }
void ShapeRenderer::Render(EDRendererD3D::RenderContext *contextPtr) { if( renderShapePtr != 0 ) { const EDMath::Float4x4& worldMat = GetGameObject()->GetTransform()->GetWorldMatrix(); EDGameCore::Animation* animation = GetAnimation(); if( animation != 0 ) { EDRendererD3D::RenderShapeSkinned *skinShape = (EDRendererD3D::RenderShapeSkinned *)renderShapePtr; skinShape->SetBoneMatrices( animation->GetFlatMats() ); } else renderShapePtr->SetWorldMatrix( (DirectX::XMFLOAT4X4*)&worldMat ); renderShapePtr->AddToContextSet(contextPtr); } }
bool CBattleEvent::Init(IGameObject *pGameObject) { SetGameObject(pGameObject); if(!GetGameObject()->BindToNetwork()) return false; if(GetEntity()) m_entityId = GetEntity()->GetId(); if(gEnv->bServer && g_pGame->GetGameRules()) { CBattleDust* pBD = g_pGame->GetGameRules()->GetBattleDust(); if(pBD) pBD->NewBattleArea(this); } return true; }
void Camera::Render() const { auto context = GraphicsDevice::GetInstance()->GetDeviceContext(); auto render_buffer= GraphicsDevice::GetInstance()->GetRenderTargetView(); auto depth_buffer = GraphicsDevice::GetInstance()->GetDepthStencilView(); SetViewport(); //set target context->OMSetRenderTargets(1, &render_buffer, depth_buffer); //clear context->ClearRenderTargetView(render_buffer, (const float *) &m_clear_color); context->ClearDepthStencilView(depth_buffer, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0f, 0); //render m_current = GetGameObject()->GetComponent<Camera>(); Renderer::RenderAll(); }
void Blast::Update(void) { const float LIFE_SPAN = 0.375f; static float GREEN = 1.0f; if( GREEN > 0.5f ) GREEN = 0.5f; else GREEN = 1.0f; EDGameCore::ICollider* iCollider = GetCollider(); if( iCollider == 0 ) return; if( iCollider->GetColliderType() != EDGameCore::SPHERE ) return; EDGameCore::SphereCollider* sphereCollider = (EDGameCore::SphereCollider*)iCollider; EDMath::Sphere sphere = sphereCollider->GetSphere(); float deltaTime = EDGameCore::Game::GetDeltaTime(); age += deltaTime; if( age >= LIFE_SPAN ) { EDGameCore::Game::destroy( GetGameObject() ); return; } float ratio = age / LIFE_SPAN; float ALPHA = 1.0f - ratio*ratio; sphere.radius *= 1.0f + 10.0f * deltaTime; sphereCollider->SetSphere( sphere ); XMFLOAT4 color( 1.0f, GREEN, 0.0f, ALPHA ); EDRendererD3D::DebugRenderer::GetInstance()->DrawSphere( sphereCollider->GetWorldSphere(), color ); }
void ComponentRootMotion::OnUpdate(float dt) { float metric_proportion = App->hints->GetFloatValue(ModuleHints::METRIC_PROPORTION); GameObject* go = GetGameObject(); float angle_diff = atan2(dir.x, dir.z)- atan2(local_dir[dir_axis].x, local_dir[dir_axis].z); while(angle_diff < -PI) angle_diff += PI*2.0f; while(angle_diff > PI) angle_diff -= PI*2.0f; float max_angle = MAX_ANGULAR_SPEED*dt; float angle = angle_diff > 0.0f ? min(max_angle, angle_diff) : max(-max_angle, angle_diff); go->SetLocalRotation((Quat(float3::unitY, angle)*go->GetLocalRotationQ()).Normalized()); float4x4 transform = go->GetGlobalTransformation(); float3 global_dir = transform.TransformDir(local_dir[dir_axis]); go->SetLocalPosition(go->GetLocalPosition()+global_dir*(min(MAX_LINEAR_SPEED*metric_proportion, speed)*dt)); }
bool AnimStateComponent::Update(float fDelta) { if( !m_pkAnimStateAttrib ) { m_pkAnimStateAttrib = GetGameObjectAttribute(GetGameObject(),AnimStateAttributeBase); } assert(m_pkAnimStateAttrib); IAnimState *pkAnimState = m_pkAnimStateAttrib->GetAnimState(); if( pkAnimState!=m_pkCurrState ) SetAnimState(pkAnimState); if (m_pkCurrState) { m_pkCurrState->Update(m_pkAnimComponent); } return true; }
//------------------------------------------------------------------------ void CGunTurret::UpdateEntityProperties() { bool enabled = m_turretparams.enabled; GetEntityProperty("GunTurret","bEnabled",m_turretparams.enabled); if(enabled!=m_turretparams.enabled) { Activate(m_turretparams.enabled); GetGameObject()->ChangedNetworkState(ASPECT_STATEBITS); } GetEntityProperty("GunTurret", "bSearching", m_turretparams.searching); GetEntityProperty("GunTurret", "bSurveillance", m_turretparams.surveillance); const char *teamName=0; GetEntityProperty("teamName", teamName); if(teamName && teamName[0]) m_turretparams.team = g_pGame->GetGameRules()->GetTeamId(teamName); }
//------------------------------------------------------------------------ void CProjectile::InitWithAI() { // register with ai if needed //FIXME //make AI ignore grenades thrown by AI; needs proper/readable grenade reaction if (m_pAmmoParams->aiType!=AIOBJECT_NONE) { bool isFriendlyGrenade(true); IEntity *pOwnerEntity = gEnv->pEntitySystem->GetEntity(m_ownerId); if (pOwnerEntity && pOwnerEntity->GetAI()) isFriendlyGrenade = (pOwnerEntity->GetAI()->GetAIType() == AIOBJECT_ACTOR); if (!isFriendlyGrenade) { GetEntity()->RegisterInAISystem(AIObjectParams(m_pAmmoParams->aiType)); } } GetGameObject()->SetAIActivation(eGOAIAM_Always); }
Object* ObjectAccessor::GetObjectByTypeMask(WorldObject const& p, uint64 guid, uint32 typemask) { switch (GUID_HIPART(guid)) { case HIGHGUID_ITEM: if (typemask & TYPEMASK_ITEM && p.GetTypeId() == TYPEID_PLAYER) return ((Player const&)p).GetItemByGuid(guid); break; case HIGHGUID_PLAYER: if (typemask & TYPEMASK_PLAYER) return GetPlayer(p, guid); break; case HIGHGUID_TRANSPORT: case HIGHGUID_MO_TRANSPORT: case HIGHGUID_GAMEOBJECT: if (typemask & TYPEMASK_GAMEOBJECT) return GetGameObject(p, guid); break; case HIGHGUID_UNIT: case HIGHGUID_VEHICLE: if (typemask & TYPEMASK_UNIT) return GetCreature(p, guid); break; case HIGHGUID_PET: if (typemask & TYPEMASK_UNIT) return GetPet(p, guid); break; case HIGHGUID_DYNAMICOBJECT: if (typemask & TYPEMASK_DYNAMICOBJECT) return GetDynamicObject(p, guid); break; case HIGHGUID_AREATRIGGER: if (typemask & TYPEMASK_AREATRIGGER) return GetAreaTrigger(p, guid); break; case HIGHGUID_CORPSE: break; } return NULL; }
Object* ObjectAccessor::GetObjectByTypeMask(WorldObject const& p, ObjectGuid const& guid, uint32 typemask) { switch (guid.GetHigh()) { case HighGuid::Item: if (typemask & TYPEMASK_ITEM && p.GetTypeId() == TYPEID_PLAYER) return ((Player const&)p).GetItemByGuid(guid); break; case HighGuid::Player: if (typemask & TYPEMASK_PLAYER) return GetPlayer(p, guid); break; case HighGuid::Transport: case HighGuid::GameObject: if (typemask & TYPEMASK_GAMEOBJECT) return GetGameObject(p, guid); break; case HighGuid::Creature: case HighGuid::Vehicle: if (typemask & TYPEMASK_UNIT) return GetCreature(p, guid); break; case HighGuid::Pet: if (typemask & TYPEMASK_UNIT) return GetPet(p, guid); break; case HighGuid::DynamicObject: if (typemask & TYPEMASK_DYNAMICOBJECT) return GetDynamicObject(p, guid); break; case HighGuid::AreaTrigger: if (typemask & TYPEMASK_AREATRIGGER) return GetAreaTrigger(p, guid); case HighGuid::Corpse: break; default: break; } return nullptr; }
bool CMonoEntityExtension::Init(IGameObject *pGameObject) { SetGameObject(pGameObject); pGameObject->EnablePhysicsEvent( true, eEPE_OnPostStepImmediate ); if (!GetGameObject()->BindToNetwork()) return false; IEntity *pEntity = GetEntity(); IEntityClass *pEntityClass = pEntity->GetClass(); m_pScript = g_pScriptSystem->InstantiateScript(pEntityClass->GetName(), eScriptFlag_Entity); IMonoClass *pEntityInfoClass = g_pScriptSystem->GetCryBraryAssembly()->GetClass("EntityInitializationParams", "CryEngine.Native"); SMonoEntityInfo entityInfo(pEntity); IMonoArray *pArgs = CreateMonoArray(1); pArgs->InsertMonoObject(pEntityInfoClass->BoxObject(&entityInfo)); g_pScriptSystem->InitializeScriptInstance(m_pScript, pArgs); pArgs->Release(); int numProperties; auto pProperties = static_cast<CEntityPropertyHandler *>(pEntityClass->GetPropertyHandler())->GetQueuedProperties(pEntity->GetId(), numProperties); if(pProperties) { for(int i = 0; i < numProperties; i++) { auto queuedProperty = pProperties[i]; SetPropertyValue(queuedProperty.propertyInfo, queuedProperty.value.c_str()); } } m_bInitialized = true; return true; }
YmxExplodeParticleSystem::YmxExplodeParticleSystem(LPYMXCOMPONENT pComponent, LPYMXTEXTURE pTexture, int maxCount) :YmxParticleSystem(pComponent, pTexture, maxCount) { m_Type = PAR_TYPE_EXPLODE; // init all null pointers m_ParVertexs = NULL; m_ParAttributes = NULL; m_ParGroups = NULL; m_Center.x = (m_BoundingBox.right - m_BoundingBox.left) * 0.5f; m_Center.y = (m_BoundingBox.bottom - m_BoundingBox.top) * 0.5f; m_Velocity = 10.0f; m_VelocityVariant = 1.0f; m_ParLife = 10.0f; m_ParLifeVariant = 0.0f; m_StartSize = 3.0f; m_EndSize = 4.0f; m_Delta = GetGameObject()->GetUpdateDelta(); m_SizeVariant = 0.0f; m_Acceleration = 0.0f; m_StartAngle = 0.0f; m_EndAngle = 360.0f; m_StartColorA = m_EndColorA = 255; m_StartColorR = m_EndColorR = 255; m_StartColorG = m_EndColorG = 255; m_StartColorB = m_EndColorB = 255; m_StartColor = YMX_RGB(255, 255, 255); m_EndColor = YMX_RGB(255, 255, 255); m_RGBVariant = 0; m_elapseTimeSinceUpdatePSize = 0.0f; m_Style |= _PS_COLOR_GRADIENT; m_Style |= _PS_HIGHLIGHT; m_Style |= _PS_SIZE_GRADIENT; //m_Style |= _PS_EXPLODE_CONTINUOUS; }
Object* MapMgr::_GetObject(const uint64 & guid) { switch(GET_TYPE_FROM_GUID(guid)) { case HIGHGUID_TYPE_GAMEOBJECT: return GetGameObject(GET_LOWGUID_PART(guid)); break; case HIGHGUID_TYPE_UNIT: return GetCreature(GET_LOWGUID_PART(guid)); break; case HIGHGUID_TYPE_DYNAMICOBJECT: return GetDynamicObject((uint32)guid); break; case HIGHGUID_TYPE_TRANSPORTER: return objmgr.GetTransporter(GUID_LOPART(guid)); break; default: return GetUnit(guid); break; } }
YmxCometParticleSystem::YmxCometParticleSystem(LPYMXCOMPONENT pComponent, LPYMXTEXTURE pTexture, int maxCount) :YmxParticleSystem(pComponent, pTexture, maxCount) { m_Type = PAR_TYPE_COMET; m_Particles = NULL; m_FreeParticles = NULL; m_ParGroups = NULL; m_ParLife = 0.5f; m_ParLifeVariant = 0.1f; m_StartSize = 30.0f; m_EndSize = 1.0f; m_SizeVariant = 0.0f; m_Velocity = 30.0f; m_VelocityVariant = 10.0f; m_Density = 10; m_StartColorA = m_EndColorA = 255; m_StartColorR = m_EndColorR = 255; m_StartColorG = m_EndColorG = 255; m_StartColorB = m_EndColorB = 255; m_StartColor = YMX_RGB(255, 255, 255); m_EndColor = YMX_RGB(255, 255, 255); m_RGBVariant = 0; m_Delta = GetGameObject()->GetUpdateDelta(); m_Acceleration = 0.0f; m_AccelerationVariant = 0.0f; m_elapseTimeSinceUpdatePSize = 0.0f; m_Style |= _PS_COLOR_GRADIENT; m_Style |= _PS_HIGHLIGHT; m_Style |= _PS_SIZE_GRADIENT; m_Style |= _PS_COMIT_BURN_ONLY_ONMOVING; }
bool SetBossState(uint32 type, EncounterState state) override { if (!InstanceScript::SetBossState(type, state)) return false; switch (type) { case DATA_TALON_KING_IKISS: if (state == DONE) { /// @workaround: GO_FLAG_INTERACT_COND remains on the gob, but it is not handled correctly in this case /// gameobject should have GO_DYNFLAG_LO_ACTIVATE too, which makes gobs interactable with GO_FLAG_INTERACT_COND /// so just removed GO_FLAG_INTERACT_COND if (GameObject* coffer = GetGameObject(DATA_TALON_KING_COFFER)) coffer->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND | GO_FLAG_NOT_SELECTABLE); } break; default: break; } return true; }