Jump to content
  • 0

About NPC Broadcaster i use...


Gidz Cross

Question


  • Group:  Members
  • Topic Count:  124
  • Topics Per Day:  0.03
  • Content Count:  647
  • Reputation:   83
  • Joined:  04/07/14
  • Last Seen:  

Hello. My players was reporting my Broadcaster NPC. They said sometimes its repeating their old message. So the scenario is like this.

 

 

First broadcast message will be

 

Hi

 

Then they use it again by saying

 

Hello

 

 

So instead of hello, it was saying hi (the previous message). Im pertaining to one character.

 

Anyways this is the script i use. (it has a 3 min delay before broadcasting again)

prontera,187,209,3	script	Broadcaster#1::BC	894,{
	
	set @npcname$, "Broadcaster";
	set @header$,"[^0000ff" + @npcname$ + "^000000]";

	set broadcastfee, 1000000;

	if (agitcheck()){mes @header$; mes "War of Emperium is ongoing!"; close;}

	mes @header$;
	mes "Hi, I'm the Broadcaster";
	mes "I can Broadcast a message for you";
	next;
	mes @header$;
	mes "It costs ^ff0000"+ broadcastfee +"^000000 zeny ";
	next;
	mes @header$;
	mes "Would you like to Broadcast?";
	switch (select("Yes","Nevermind")){
	case 1:
		if(Broadcast> gettimetick(2)) {
		next;
		mes @header$;
		mes "Sorry you have to wait for 3 min.";
		close;
		}
		next;
		mes @header$;
		if(Zeny<1000000) goto $nozenybc;
		set Zeny,zeny - broadcastfee;
		mes "Please input your message.";
		next;
		input broadcast$;
		announce ""+strcharinfo(0)+": "+broadcast$+"",0,0x5AFF00; // Edit 5AFF00 for color code HTML Color Code
		close2;
		set Broadcast, gettimetick(2)+180; //Timer 180 = 3 minutes
		dispbottom "Broadcaster: Please wait for 3min until next broadcast to avoid flooding.";
		end;
	case 2:
		mes "Suit yourself";
		close;
}

$nozenybc:
	mes "I have to check that you have";
	mes "enough money";
	next;
	mes @header$;
	mes "Im sorry but you dont have ^ff0000"+broadcastfee+"^000000 zeny";
	mes "Go get it if you want to Broadcast";
	close;
}

splendide,194,182,3	duplicate(BC)	Broadcaster#2	894

Please have a look at it.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  89
  • Topics Per Day:  0.02
  • Content Count:  232
  • Reputation:   15
  • Joined:  11/02/13
  • Last Seen:  

prontera,187,209,3	script	Broadcaster#1::BC	894,{
	
	if (agitcheck() || agitcheck2()){
	mes .header$; 
	mes "War of Emperium is ongoing!"; 
	close;
	}

	mes .header$;
	mes "Hi, I'm the Broadcaster";
	mes "I can Broadcast a message for you";
	next;
	mes .header$;
	mes "It costs ^ff0000"+.broadcastfee+"^000000 zeny.";
	next;
	mes .header$;
	mes "Would you like to Broadcast?";
	next;
	switch (select("Yes","Nevermind")){
	case 1:

		if(gettimetick(2) - #Broadcast < (60 * 3)) { // 3mins delay
			set .@i, (priest+(10 * 1)) - gettimetick(2);
			if (.@i > 3600) set .@j$, (.@i/3600)+" hour"+(((.@i/3600) == 1)?"":"s");
			else if (.@i > 60) set .@j$, (.@i/60)+" minute"+(((.@i/60) == 1)?"":"s");
			else set .@j$, (.@i)+" second"+((.@i == 1)?"":"s");
			mes .header$;
			mes "You have to wait "+.@j$+" before taking another broadcast.";
			close;
		}

		mes .header$;
		mes "Please input your message.";
		next;
		input .@broadcast$;
		if(Zeny < 1000000) goto nozeny;
		set Zeny,zeny - .broadcastfee;
		announce ""+strcharinfo(0)+": "+.@broadcast$+"",0,0x5AFF00;
		set #Broadcast, gettimetick(2); 
		close;
	case 2:
		mes .header$;
		mes "Suit yourself";
		close;
	}

nozeny:
	mes .header$;
	mes "Im sorry but you don't have enough zeny";
	mes "Come back again you have ^ff0000"+.broadcastfee+"^000000 zeny";
	close;

OnInit:
	set .header$,"[^0000ffBroadcaster^000000]";
	set .broadcastfee, 1000000;
end;

}

splendide,194,182,3	duplicate(BC)	Broadcaster#2	894

 

I just cleaned your script and do some re-edit. Try this one.

Edited by gmprestige
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  124
  • Topics Per Day:  0.03
  • Content Count:  647
  • Reputation:   83
  • Joined:  04/07/14
  • Last Seen:  

I just cleaned your script and do some re-edit. Try this one.

OMG. Thank you so much! I will try this now.

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...