Jump to content
  • 0

Announce the Signed name on an Item


Eross

Question


  • Group:  Members
  • Topic Count:  155
  • Topics Per Day:  0.11
  • Content Count:  349
  • Reputation:   12
  • Joined:  04/05/20
  • Last Seen:  

Good day ! I've created a simple give away npc that has name of event GM on it 

image.png.9d751bbaca9703a5576fbd8b99e3cc94.png

My questions is .. Is it possible to broadcast the item name including the name that signed into it ?? For example, I will open this scroll and the broadcast should be : 

"[Player Name] has obtained Battle Manual from [Eross's Angel Egg Scroll]!!!"

Instead of just:

"[Player Name] has obtained Battle Manual from [Angel Egg Scroll]!!!"

 

Thankyou and a Blessed  Sunday to everyone

Edited by Eross
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

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

  - Id: 501
    AegisName: Red_Potion
    Type: Healing
    Script: |
      callfunc("F_SignedItem", 501, IG_Taming);
function	script	F_SignedItem	{
	.@item_id = getarg(0, 0);
	.@groupranditem = getarg(1, 0);
	
	if (.@item_id && .@groupranditem) {
		getinventorylist;
		for (.@i = 0; .@i < @inventorylist_count; .@i++) {
			if (@inventorylist_id[.@i] == .@item_id && @inventorylist_card3[.@i] && @inventorylist_card4[.@i]) {
				.@signed_cid = (@inventorylist_card3[.@i] | (@inventorylist_card4[.@i] << 0x10));
				query_sql("SELECT `name` FROM `char` WHERE `char_id` = "+.@signed_cid, .@signed_name$);
				.@item_name$ = getitemname(.@item_id);
				if (.@signed_name$ != "")
					.@item_name$ = .@signed_name$+"'s " + .@item_name$;
				.@inventorylist_name$[.@i] = .@signed_name$;
				.@menu$ = .@menu$ + .@item_name$;
			}
			.@menu$ += ":";
		}
		.@i = select(.@menu$) - 1;
		delitem2 @inventorylist_id[.@i],1,@inventorylist_identify[.@i],@inventorylist_refine[.@i],@inventorylist_attribute[.@i],@inventorylist_card1[.@i],@inventorylist_card2[.@i],@inventorylist_card3[.@i],@inventorylist_card4[.@i];
		.@reward_id = groupranditem(.@groupranditem);
		getitem .@reward_id, 1;
		announce "["+strcharinfo(0)+"] has obtained "+getitemname(.@reward_id)+" from ["+.@inventorylist_name$[.@i]+"'s "+getitemname(.@item_id)+"]!!!", bc_all;
	}
	return;
}

you can try something like this.

  • Upvote 1
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...