how to add a sfx like a item? Like on insanity flyff, they has a cape of sfx, without time to use
Tks advanced
Tks advanced
CItemElem* pItemElem = GetEquipItem(PARTS_MASK);
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwID == II_SYS_MASK_TEST1 )
{
if(m_pSfxWing == NULL)
m_pSfxWing = CreateSfx( D3DDEVICE, XI_NAT_WINGANGEL01, GetPos(), GetId(), D3DXVECTOR3(0,0,0), NULL_ID, -1 );
}
else
{
if(m_pSfxWing != NULL)
{
m_pSfxWing->Delete();
m_pSfxWing = NULL;
}
}
That should work. It hides the Model itself.Quote:
Almost this, I tried it that way, but it would still take another model to load the sfx. If you set to load the sfx directly, it loads a standard model when fitted to the character.
pModel->SetEffect(PARTS_MASK, XE_HIDE);
CItemElem* pItemElem = GetEquipItem(PARTS_MASK);
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwID == II_SYS_MASK_TEST1 )
{
if(m_pSfxWing == NULL)
m_pSfxWing = CreateSfx( D3DDEVICE, XI_NAT_WINGANGEL01, GetPos(), GetId(), D3DXVECTOR3(0,0,0), NULL_ID, -1 );
pModel->SetEffect(PARTS_MASK, XE_HIDE);
}
else
{
if(m_pSfxWing != NULL)
{
m_pSfxWing->Delete();
m_pSfxWing = NULL;
pModel->SetEffectOff(PARTS_MASK, XE_HIDE);
}
}
case XI_YOURSFX: //SFX ID pObj = new CSfxRotate(); break;
case XI_NAT_WINGANGEL01: // õ»çÀÇ ³¯°³ pObj = new CSfxRotate(); break;
m_dwWingTime = g_tmCurrent
if( g_tmCurrent - m_dwWingTime > 1100 )
CItemElem* pItemElem = GetEquipItem(PARTS_MASK);
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwID == II_SYS_MASK_TEST1 )
{
if(m_pSfxWing == NULL)
m_pSfxWing = CreateSfx( D3DDEVICE, XI_NAT_WINGANGEL01, GetPos(), GetId(), D3DXVECTOR3(0,0,0), NULL_ID, -1 );
pModel->SetEffect(PARTS_MASK, XE_HIDE);
m_dwWingTime = g_tmCurrent;
}
else
{
if(m_pSfxWing != NULL)
{
m_pSfxWing->Delete();
m_pSfxWing = NULL;
pModel->SetEffectOff(PARTS_MASK, XE_HIDE);
}
}
Quote:
I can't actually explain why, but using only
without takingCode:m_dwWingTime = g_tmCurrent
fixed it for me.Code:if( g_tmCurrent - m_dwWingTime > 1100 )
So this should work fine:
[Only registered and activated users can see links. Click Here To Register...]Code:CItemElem* pItemElem = GetEquipItem(PARTS_MASK); if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwID == II_SYS_MASK_TEST1 ) { if(m_pSfxWing == NULL) m_pSfxWing = CreateSfx( D3DDEVICE, XI_NAT_WINGANGEL01, GetPos(), GetId(), D3DXVECTOR3(0,0,0), NULL_ID, -1 ); pModel->SetEffect(PARTS_MASK, XE_HIDE); m_dwWingTime = g_tmCurrent; } else { if(m_pSfxWing != NULL) { m_pSfxWing->Delete(); m_pSfxWing = NULL; pModel->SetEffectOff(PARTS_MASK, XE_HIDE); } }
Uhm that is actually the entire code. The other thing is to choose/create an Item you wanna use for the SFX.Quote:
Hello sir,
If you don't mind sharing the entire code to make it work we'll be really happy.
Some of my friends have these MASK / sfx wings in their servers but don't like sharing it.
Hope to hear from you sir Professor Linebeck.
Thanks in advance