Jump to content
  • 0

Modify server broadcast for rare drops


Talaysen

Question


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  161
  • Reputation:   5
  • Joined:  02/07/13
  • Last Seen:  

I'd like to modify the server broadcast (or replace it completely) to where, instead of broadcasting to the entire server that so-and-so got this item (below 0.01%), I would rather it display a message for that player only.

 

Players have complained about disabling the server-wide broadcast because they use it as an 'alert' while farming cards and whatnot, but a greater number of players have requested that the feature be disabled for a rather long list of reasons.

Link to comment
Share on other sites

22 answers to this question

Recommended Posts


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

announce "This will broadcast on the entire server",0;

announce "This will broadcast on yourself",3;

 

or you can try : 

 

dispbottom "This is a message";

 

Reference : http://rathena.org/wiki/Announce

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  161
  • Reputation:   5
  • Joined:  02/07/13
  • Last Seen:  

announce "This will broadcast on the entire server",0;

announce "This will broadcast on yourself",3;

 

or you can try : 

 

dispbottom "This is a message";

 

Reference : http://rathena.org/wiki/Announce

Wouldn't happen to know where the script part of

// Make broadcast ** Player1 won Pupa's Pupa Card (chance 0.01%) ***
// This can be set to any value between 0~10000.
// Note: It also announces STEAL skill usage with rare items
// 0 = don't show announces at all
// 1 = show announces for 0.01% drop chance items
// 333 = show announces for 3.33% or lower drop chance items
// 10000 = show announces for all items
rare_drop_announce: 

is located?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

trunk/src/map/pc.c around line 4706
		intif_broadcast(message,strlen(message)+1,0);
bc_self is "3", so change that line to:
		intif_broadcast(message,strlen(message)+1,3);
  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  161
  • Reputation:   5
  • Joined:  02/07/13
  • Last Seen:  

Thanks Brian! :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  161
  • Reputation:   5
  • Joined:  02/07/13
  • Last Seen:  

trunk/src/map/pc.c around line 4706

		intif_broadcast(message,strlen(message)+1,0);
bc_self is "3", so change that line to:
		intif_broadcast(message,strlen(message)+1,3);

 

I implemented this, but it took a while before a rare item dropped and someone reported what was happening.

The broadcast is still occuring (overhead big yellow broadcast), and all players are getting it when rare items drop.

Lets say I get a rare drop below 1%, I only want the drop message to go to myself, and no one else.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  69
  • Reputation:   4
  • Joined:  07/02/12
  • Last Seen:  

did you recompile after editing that part? if you did, i don't know the answer. lol

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  161
  • Reputation:   5
  • Joined:  02/07/13
  • Last Seen:  

Yes, I did.

I should clarify, they're getting the message in the yellow broadcast (overhead) and they are getting a message in their chat.

But everyone is getting the announcement and message, which is the opposite of what I want.

I only want players to get a notification when an item drops specifically for them.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

oops I forgot we have to change it to clif_broadcast() so we can include the player's bl.

Find (that same line):

		intif_broadcast(message,strlen(message)+1,0);
Replace with:
		clif_broadcast(&sd->bl, message, (int)strlen(message)+1, 3, SELF);
Save, recompile, and that should work.

PS: to make the rare_drop_announce trigger sooner, you could temporarily set it higher

@setbattleflag rare_drop_announce 9000

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  161
  • Reputation:   5
  • Joined:  02/07/13
  • Last Seen:  

Thanks again, Brian! /thx

Edited by Talaysen
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  161
  • Reputation:   5
  • Joined:  02/07/13
  • Last Seen:  

Getting an error on compile:

CC pc.c

pc.c: In function âpc_steal_itemâ:

pc.c:4712: error: incompatible type for argument 1 of âclif_broadcastâ

clif.h:584: note: expected âstruct block_list *â but argument is of type âstruct block_listâ

make[1]: *** [obj_sql/pc.o] Error 1

make[1]: Leaving directory `/trunk/src/map'

make: *** [map_sql] Error 2

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  161
  • Reputation:   5
  • Joined:  02/07/13
  • Last Seen:  

Anyone know how to make that bit of code work?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  92
  • Reputation:   8
  • Joined:  01/11/13
  • Last Seen:  

no problem at my end in compiling 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  161
  • Reputation:   5
  • Joined:  02/07/13
  • Last Seen:  

no problem at my end in compiling 

You're using:

        clif_broadcast(&sd->bl, message, (int)strlen(message)+1, 3, SELF);

?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  92
  • Reputation:   8
  • Joined:  01/11/13
  • Last Seen:  

yes

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

Make sure you have the &

&sd->bl

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  161
  • Reputation:   5
  • Joined:  02/07/13
  • Last Seen:  

I had copied it directly, but it's possible there was an extra character left from the previous code or something of the such.

I'll give it a try again later tonight. Thanks guys.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  161
  • Reputation:   5
  • Joined:  02/07/13
  • Last Seen:  

Alright, I added that bit of code at the line specified (it compiled successfully), however, it is still broadcasting to everyone on the server.

I used the @setbattleflag rare_drop_announce to set it to 9000, killed a few mobs, everyone online received the broadcasts.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  161
  • Reputation:   5
  • Joined:  02/07/13
  • Last Seen:  

Anyone know how to make this work (the way I'm trying to make it work)?

I don't want the message going to all players on the server, only the player who received the item.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  161
  • Reputation:   5
  • Joined:  02/07/13
  • Last Seen:  

Still no resolution for this?

 

I don't want the message to broadcast, I only want it to be sent to the player (say, in the regular chat) who got the item.

 

I'd like to add an enhancement to this, as well.

Once it's working properly, I'd like to create an atcommand (IE: @globaldrops or @sharedropmsg, or something similar),

that when enabled, would also forward these messages to a channel named '#drops'.

 

This way, users who feel like sharing their drop announcements with everyone would have the opportunity to do so.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  58
  • Reputation:   4
  • Joined:  07/10/13
  • Last Seen:  

Maybe you can just disable the command and then make a script about it, I'm not yet sure how to script it but im just going to give you an idea and to make things easier.

 

Is there an event such as : OnPCgetitemevent? x.x

 

if there is then maybe we can do the next part which is (i dont know if there is such thing like this as well) :

 

 if (getitemrate is 0.01%) goto Test;
//dont mind my coding i just want to let you know what was the idea.

then on the code for Test

Test:
dispbottom "You just received a very rare item, Good for you!"
end;

 

Like this? Its simple but I just don't know if those things do exist. I'll read on my script_commands later on and if I get those answers i'll post the script.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  161
  • Reputation:   5
  • Joined:  02/07/13
  • Last Seen:  

I have it disabled for now, and anything comparable would certainly be fine. :)

Would it be possible to print the item name in the message?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  58
  • Reputation:   4
  • Joined:  07/10/13
  • Last Seen:  

I have it disabled for now, and anything comparable would certainly be fine. :)

Would it be possible to print the item name in the message?

Yeah with this.

message strcharinfo(0),"Wow wow you just received a very rare item!";
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...