Jump to content
  • 0

BGM Loop


wakefield21

Question


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  115
  • Reputation:   4
  • Joined:  08/14/16
  • Last Seen:  

Hello rAthena! Can someone please tell me how can i loop a BGM inside a script and if possible please give me an example.

Here's my sample script.

 

-	script	timeattack	-1,{
	
	OnPCLoginEvent:

	atcommand "@night";
	playBGM "100";

	mes "[Great Demon Baphomet]";
	mes "Greetings, "+ strcharinfo(0) +". Yes, human, I know who you are. I know that from the bottom of your heart, you seek glory and riches. You can't fool me foolish human! Now I stand before you to give you an offer.";
	next;
	mes "[Great Demon Baphomet]";
	mes "I can grant you any treasure you desire and infinite power at your fingertips. Powerful weapons that humans have never before seen...";
	next;
	mes "[Great Demon Baphomet]";
	mes "Mountains of zeny that you cannot possibly hope to spend in a lifetime. Though, who's to say that your lifespan should be limited? Fame, power, immortality: It can all be yours.";
	next;
	mes "[Great Demon Baphomet]";
	mes "I will be yours to summon at anytime. All other humans will dread making you their enemy. You will become the most powerful person in all of history!";
	switch (select("Okay, Let's do it!:No! I'll never submit to you!")) {
		case 1:
			mes "[Great Demon Baphomet]";
			mes "Then we shall form a contract. You won't ever regret this moment...";
			next;
			mes "[Great Demon Baphomet]";
			mes "Follow me.";
			mes "We will make the";
			mes "contract in my";
			mes "sanctum of darkness.";
			warp "prt_fild08",271,191;
			end;
		case 2:
			mes "[Great Demon Baphomet]";
			mes "Foolish human...";
			mes "You have made your choice. I will leave you alone for now, then. However, your training won't be as easy as you think.";
			next;
			mes "[Great Demon Baphomet]";
			mes "I shall be preparing my troops for you. The day will come when I shall enjoy watching you writhe in agony as my fiends slowly devour you.";
			close;
		}
	end;
}

 

Thank you very much guys!

Edited by wakefield21
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

prontera,150,150,6	script	Test	100,{
	for (.@i = 50; .@i <= 60; .@i++) {
		playBGM "" + .@i;
		sleep2 3000;
	}
	end;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  115
  • Reputation:   4
  • Joined:  08/14/16
  • Last Seen:  

20 minutes ago, Patskie said:

prontera,150,150,6	script	Test	100,{
	for (.@i = 50; .@i <= 60; .@i++) {
		playBGM "" + .@i;
		sleep2 3000;
	}
	end;
}

 

can i do it on a dummy npc instead of like that? like this, - script timeattack -1,{

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

If you have a trigger point then it should work fine. (i.e OnPCLoginEvent, OnPCLogoutEvent, bindatcmd, etc.)

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  115
  • Reputation:   4
  • Joined:  08/14/16
  • Last Seen:  

Okay thanks sir!

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

you could use the timer to create this...

playBGM("filename", 0);
initnpctimer;
OnTimer60000: // set according to your BGM duration
	playBGM("filename", 0);
	initnpctimer;
	end;

start the timer when the BGM started, and repeat it once it end.

Edited by Emistry
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...