Jump to content
  • 0

Soundeffect Script


SlashGeeGee

Question


  • Group:  Members
  • Topic Count:  111
  • Topics Per Day:  0.02
  • Content Count:  573
  • Reputation:   20
  • Joined:  11/19/11
  • Last Seen:  

For example a player talks to the npc then a sound effect will play next time the player talks to the npc another new sound effect will play just like a round robin sound effects. how to do that ?

SlashGeeGee

Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  34
  • Reputation:   42
  • Joined:  02/19/12
  • Last Seen:  

Not sure if thats what you wanted.




// Adjust location and sprite display
prontera, 156, 180, 3	script	Sound Player	99,{

// Sets player temporary variable for round-robin cycling
// This temporary variable will reset back to zero if player relogs.
// If you do not wish for this, change the type of variable.
// From : @soundef_number
// To : soundef_number
// (Without the '@' symbol)
set @soundef_number, @soundef_number + 1;

// Random sound effects
switch (@soundef_number)
{

	// Example list of sound effects
	case 1:
	soundeffect "se_creak01.wav",0;
	break;

	case 2:
	soundeffect "se_wolf1.wav",0;
	break;

	case 3:
	soundeffect "se_prtbird_01.wav",0;
	break;

	// ... And so on
}

// After reaching max sound effects number, the script
// will cycle back to beggining.
if (@soundef_number >= 3)
{
	set @soundef_number, 0;
}

end;

}

If you want this instead :

Player 1 talks to npc -> listens to sound 1

Player 2 talks to npc -> listens to sound 2

Player 1 talks to npc -> listens to sound 3

Which means, a round-robin that cycles through the sounds on the npc itself, rather than the players,

then you gotta change the variable type to npc-bound -> add a period at beggining of variable and make it ".soundef_number"

without the quotes.

Edited by kenedos
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  111
  • Topics Per Day:  0.02
  • Content Count:  573
  • Reputation:   20
  • Joined:  11/19/11
  • Last Seen:  

Not sure if thats what you wanted.




// Adjust location and sprite display
prontera, 156, 180, 3	script	Sound Player	99,{

// Sets player temporary variable for round-robin cycling
// This temporary variable will reset back to zero if player relogs.
// If you do not wish for this, change the type of variable.
// From : @soundef_number
// To : soundef_number
// (Without the '@' symbol)
set @soundef_number, @soundef_number + 1;

// Random sound effects
switch (@soundef_number)
{

	// Example list of sound effects
	case 1:
	soundeffect "se_creak01.wav",0;
	break;

	case 2:
	soundeffect "se_wolf1.wav",0;
	break;

	case 3:
	soundeffect "se_prtbird_01.wav",0;
	break;

	// ... And so on
}

// After reaching max sound effects number, the script
// will cycle back to beggining.
if (@soundef_number >= 3)
{
	set @soundef_number, 0;
}

end;

}

If you want this instead :

Player 1 talks to npc -> listens to sound 1

Player 2 talks to npc -> listens to sound 2

Player 1 talks to npc -> listens to sound 3

Which means, a round-robin that cycles through the sounds on the npc itself, rather than the players,

then you gotta change the variable type to npc-bound -> add a period at beggining of variable and make it ".soundef_number"

without the quotes.

Thanks this is what i wanted i change all "@" -> "." for npc bound efffects but when i click the npc i got this error :


Time Stamp: 0x4c188139 - Wed Jun 16 00:46:01 2010


Exception Type: 0xc0000005

0x00433b70 2010-06-16aRagexeRE_patched.exe
0x005d971c 2010-06-16aRagexeRE_patched.exe
0x005ee7be 2010-06-16aRagexeRE_patched.exe
0x0059d74c 2010-06-16aRagexeRE_patched.exe
0x0059d6d6 2010-06-16aRagexeRE_patched.exe
0x006fb2ea 2010-06-16aRagexeRE_patched.exe
0x0070f81d 2010-06-16aRagexeRE_patched.exe
0x75fd3677 kernel32.dll
0x77259f42 ntdll.dll
0x77259f15 ntdll.dll

eax: 0x00000000 ebx: 0x0018a17a
ecx: 0x3f800000 edx: 0x00000028
esi: 0x02d36850 edi: 0x0018a17a
ebp: 0x0018a01c esp: 0x0018a018

stack 0018a018 - 0018a418
0018A018 : 00 00 00 00 98 A0 18 00 1C 97 5D 00 7A A1 18 00
0018A028 : 00 00 00 00 00 00 00 00 00 00 00 00 FA 00 00 00
0018A038 : 28 00 00 00 00 00 80 3F 00 00 00 00 50 68 D3 02
0018A048 : F0 26 C0 73 58 8B 79 00 50 68 D3 02 98 A0 18 00
0018A058 : 7A 90 41 00 23 00 00 00 78 A1 18 00 F0 26 C0 73
0018A068 : AF 66 50 00 00 25 7D 00 70 30 CC 09 00 25 7D 00
0018A078 : 70 30 CC 09 00 25 7D 00 D3 01 00 00 00 00 00 00
0018A088 : 50 68 D3 02 68 FB 18 00 D0 D0 72 00 FF FF FF FF
0018A098 : 74 FB 18 00 BE E7 5E 00 78 A1 18 00 00 00 00 00
0018A0A8 : 50 68 D3 02 F0 26 C0 73 00 00 00 BF 00 00 00 BF
0018A0B8 : 00 00 00 BF 00 00 00 BF 00 00 00 BF 00 00 00 00
0018A0C8 : 00 00 00 BF 00 00 00 BF 00 00 00 BF 00 00 00 FF
0018A0D8 : 00 00 00 FF 00 00 00 FF 00 00 00 FF 00 00 00 00
0018A0E8 : 00 00 00 BF 00 00 00 BF 00 00 00 BF 00 00 00 BF
0018A0F8 : 00 00 00 BF 00 00 00 BF 00 00 00 BF 00 00 00 00
0018A108 : 00 00 00 BF 00 00 00 BF 00 00 00 BF 00 00 00 BF

Launch Info
0224 00A4 00A4 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000

Job : Champion

here's the script i'm using :





// Adjust location and sprite display
prontera, 156, 180, 3 script Sound Player 100,{

// Sets player temporary variable for round-robin cycling
// This temporary variable will reset back to zero if player relogs.
// If you do not wish for this, change the type of variable.
// From : @soundef_number
// To : soundef_number
// (Without the '@' symbol)
set .soundef_number, .soundef_number + 1;

// Random sound effects
switch (.soundef_number)
{

// Example list of sound effects
case 1:
soundeffect "npc_bellin_0091_sp_01_b.wav",0;
break;

case 2:
soundeffect "npc_bellin_0091_sp_02_b.wav",0;
break;

case 3:
soundeffect "npc_bellin_0091_sp_05_a.wav",0;
break;

// ... And so on
}

// After reaching max sound effects number, the script
// will cycle back to beggining.
if (.soundef_number >= 3)
{
set .soundef_number, 0;
}

end;

}

Edited by Emistry
Please use [CODEBOX] or Attachment for long contents.
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

for soundeffect or soundeffectall ,

the file name must be within 23 characters INCLUDE the .wav extension

soundeffect "1234567890123456789.wav", 0; // this will play the soundeffect

sleep2 1000;

soundeffect "12345678901234567890.wav", 0; // throw gravity error

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  111
  • Topics Per Day:  0.02
  • Content Count:  573
  • Reputation:   20
  • Joined:  11/19/11
  • Last Seen:  

for soundeffect or soundeffectall ,

the file name must be within 23 characters INCLUDE the .wav extension

soundeffect "1234567890123456789.wav", 0; // this will play the soundeffect

sleep2 1000;

soundeffect "12345678901234567890.wav", 0; // throw gravity error

Thanks Annie it worked it doesn't gravity error anymore but the sound won't play T_T

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

your custom *.wav file must be PCM type and mono

http://www.eathena.w...dpost&p=1486262

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...