About sfx on item

02/13/2017 21:08 pedala1#1
how to add a sfx like a item? Like on insanity flyff, they has a cape of sfx, without time to use
Tks advanced
02/13/2017 21:29 Lumi#2
Copy Cupid Wings and make it unlimited.
02/13/2017 21:35 pedala1#3
But it does not appear in the inventory as an item. For example the cupid wing, make it appear in the inventory as an equipmen. Ty to reply
02/13/2017 23:54 Lumi#4
Oh, now I see what you meant. You mean an equipment like cloak in sfx style? I would like to know how does it work, too.
02/14/2017 00:07 pedala1#5
Haha, yeah =/
02/14/2017 12:44 alfredico#6
It's same as adding sfx to weapon, to character...
02/14/2017 22:27 pedala1#7
Unfortunately, i don't know how to do this =/ . I read on my source how to works (cupid wings), but I cant make on my own . Anyway, thx
02/15/2017 13:26 Professor Linebeck#8
Something like this?
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 );
	}
	else
	{
		if(m_pSfxWing != NULL)
		{
			m_pSfxWing->Delete();
			m_pSfxWing = NULL;
		}
	}
02/15/2017 20:18 pedala1#9
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.
02/15/2017 20:43 Professor Linebeck#10
Quote:
Originally Posted by pedala1 View Post
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.
That should work. It hides the Model itself.
Code:
pModel->SetEffect(PARTS_MASK, XE_HIDE);

All in one:
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);
	}
	else
	{
		if(m_pSfxWing != NULL)
		{
			m_pSfxWing->Delete();
			m_pSfxWing = NULL;
			pModel->SetEffectOff(PARTS_MASK, XE_HIDE);
		}
	}
You need to make sure to edit this;
PARTS_MASK to the slot your item is using.
II_SYS_MASK_TEST1 to your item ID
XI_NAT_WINGANGEL01 to your SFX ID


Also, if you want to match the SFX to the Character, make sure to add
Code:
	case XI_YOURSFX:	//SFX ID
		pObj = new CSfxRotate();
		break;
below

Code:
	case XI_NAT_WINGANGEL01:	// õ»çÀÇ ³¯°³
		pObj = new CSfxRotate();
		break;
at CreateObj.cpp
02/16/2017 03:23 pedala1#11
Work! The sfx "restarts", is active while using the item but is "blinking", does not appear "constant" as for example the sfx used in orbs.

Anyway, ty so much!
02/16/2017 08:34 Professor Linebeck#12
I can't actually explain why, but using only
Code:
m_dwWingTime = g_tmCurrent
without taking
Code:
if( g_tmCurrent - m_dwWingTime > 1100 )
fixed it for me.

So this should work fine:
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);
		}
	}
[Only registered and activated users can see links. Click Here To Register...]
02/16/2017 10:00 Freddie_Faulisch#13
Cool thing because it is possible to make sfx fashion :) but how can i set the position of the sfx?? Edit D3DXVECTOR3(0,0,0) didnt work for me
02/17/2017 06:25 elitemember21#14
Quote:
Originally Posted by Professor Linebeck View Post
I can't actually explain why, but using only
Code:
m_dwWingTime = g_tmCurrent
without taking
Code:
if( g_tmCurrent - m_dwWingTime > 1100 )
fixed it for me.

So this should work fine:
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);
		}
	}
[Only registered and activated users can see links. Click Here To Register...]


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
02/17/2017 09:11 Professor Linebeck#15
Quote:
Originally Posted by elitemember21 View Post
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
Uhm that is actually the entire code. The other thing is to choose/create an Item you wanna use for the SFX.
I simply used Butterfly Mask.