Jump to content

@command pack


rootKid

Recommended Posts


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  83
  • Reputation:   11
  • Joined:  11/28/11
  • Last Seen:  

@command pack


¦¦¦¦¦¦   ¦¦¦¦¦¦   ¦¦¦¦¦¦  ¦¦¦¦¦¦¦¦ ¦¦   ¦¦ ¦¦ ¦¦¦¦¦¦  
¦¦   ¦¦ ¦¦    ¦¦ ¦¦    ¦¦    ¦¦    ¦¦¦ ¦¦  ¦¦ ¦¦¦   ¦¦ 
¦¦¦¦¦¦  ¦¦    ¦¦ ¦¦    ¦¦    ¦¦    ¦¦¦¦¦   ¦¦ ¦¦¦   ¦¦¦
¦¦   ¦¦ ¦¦    ¦¦ ¦¦    ¦¦    ¦¦    ¦¦  ¦¦  ¦¦ ¦¦¦   ¦¦¦
¦¦¦  ¦¦¦ ¦¦¦¦¦¦   ¦¦¦¦¦¦     ¦¦    ¦¦   ¦¦ ¦¦ ¦¦¦¦¦¦¦   @command pack. (@runlabel, @allchat, @emo, @allemo, @alleffect)
////////////////////////////////////////////////////////////////////////////////////////////////
[src/map/atcommand.c] is the only file needed to be editted. Set your account group permissions as desired.
You're assumed to know how to implement these. However, if you have further questions, feel free to contact me.
////////////////////////////////////////////////////////////////////////////////////////////////

ACMD_DEF(runlabel),		//rootKid
ACMD_DEF(allchat),		//rootKid
ACMD_DEF(emo),			//rootKid
ACMD_DEF(allemo),		//rootKid
ACMD_DEF(alleffect),	//rootKid

/*==========================================
* @runlabel by [rootKid]
* Makes invoker run an 'On' label from within an npc
* @runlabel Healer#OnMinute44
*------------------------------------------*/
ACMD_FUNC(runlabel) {
	char label_output[256],npcname[100],label[100];
	nullpo_retr(-1, sd);
	
	if (!message || !*message) {
		sprintf(atcmd_output, "Usage: @runlabel <npc name>, <label>");
		clif_displaymessage(fd, atcmd_output);
		return -1;
	}
	
	if (sscanf(message, "%23[^,], %99[^\n]", npcname, label) < 2) {
		clif_displaymessage(fd, "Please, enter the correct info (usage: @runlabel <npc name>, <label>).");
		return -1;
	}

	if (npc_name2id(npcname) != NULL) {
		sprintf(label_output, "%s::%s", npcname, label);
		npc_event( sd, label_output, 0 );
		clif_displaymessage(fd, "Label was triggered.");
		return 0;
	}
	else {
		clif_displaymessage(fd, "NPC doesn't exist.");
		return -1;
	}
}

/*==========================================
* @allchat by [rootKid]
* Makes all players, except the invoker, send out a desired message
* eg. @allchat blahblah
*------------------------------------------*/
ACMD_FUNC(allchat) {
	struct map_session_data* iter_sd;
	struct s_mapiterator* iter;
	
	char tempmes[200];
	iter = mapit_getallusers();
	nullpo_retr(-1, sd);
	
	memset(tempmes, '\0', sizeof(tempmes));
	memset(atcmd_output, '\0', sizeof(atcmd_output));
	
	if (!message || !*message || sscanf(message, "%199[^\n]", tempmes) < 0) {
		clif_displaymessage(fd, "Please, enter a message (usage: @me <message>).");
		return -1;
	}
	
	for (iter_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); iter_sd = (TBL_PC*)mapit_next(iter))
		if (iter_sd != sd){	//Triggers on all players except the one who initiates it.
		sprintf(atcmd_output, "%s : %s", iter_sd->status.name, tempmes);	// *%s %s*
		clif_disp_overhead(&iter_sd->bl, atcmd_output);
		}
	mapit_free(iter);
	return 0;
}

/*==========================================
* @emo by [rootKid]
* Makes invoker send out an emote
* @emo 3
*------------------------------------------*/
ACMD_FUNC(emo) {
	if (!message || !*message) {
		clif_displaymessage(fd, "Usage: @emo 1-81");
	return -1;
   }
   clif_emotion(&sd->bl, atoi(message));
   return 0;
}

/*==========================================
* @allemo by [rootKid]
* Makes all players, except the invoker, send out a desired emote
* eg. @allemo 1
*------------------------------------------*/
ACMD_FUNC(allemo) {
	struct map_session_data* iter_sd;
	struct s_mapiterator* iter;	
	iter = mapit_getallusers();
	
	if (!message || !*message) {
		clif_displaymessage(fd, "Usage: @emo 1-81");
	return -1;
   }
   
   for (iter_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); iter_sd = (TBL_PC*)mapit_next(iter))
		if (iter_sd != sd){	//Triggers on all players except the one who initiates it.
			clif_emotion(&iter_sd->bl, atoi(message));
	}
	mapit_free(iter);
   return 0;
}

/*==========================================
* @alleffect by [rootKid]
* Makes all players, except the invoker, send out a desired special effect
* eg. @alleffect 89
*------------------------------------------*/
ACMD_FUNC(alleffect) {
	struct map_session_data* iter_sd;
	struct s_mapiterator* iter;
	int type = 0, flag = 0;
	iter = mapit_getallusers();
	nullpo_retr(-1, sd);

	if (!message || !*message || sscanf(message, "%d", &type) < 1) {
		clif_displaymessage(fd, "Please, enter an effect number (usage: @effect <effect number>).");
		return -1;
	}
	
	for (iter_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); iter_sd = (TBL_PC*)mapit_next(iter))
		if (iter_sd != sd){	//Triggers on all players except the one who initiates it.
			clif_specialeffect(&iter_sd->bl, type, (send_target)flag);
	}
	mapit_free(iter);
	return 0;
}

 


 

  • Upvote 4
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  545
  • Reputation:   220
  • Joined:  03/01/13
  • Last Seen:  

Wanted to extend my support for this file- These are nifty and I can't wait to give them a whirl!

Regards,
~Azura Skyy

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  36
  • Topics Per Day:  0.01
  • Content Count:  383
  • Reputation:   121
  • Joined:  03/31/12
  • Last Seen:  

This from Ragna Tale?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  83
  • Reputation:   11
  • Joined:  11/28/11
  • Last Seen:  

8 hours ago, Azeroth said:

This from Ragna Tale?

I did have them implemented on there, yes.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  166
  • Topics Per Day:  0.04
  • Content Count:  789
  • Reputation:   50
  • Joined:  04/16/12
  • Last Seen:  

thanks for this +1

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  566
  • Reputation:   349
  • Joined:  11/20/11
  • Last Seen:  

You're awesome rootKid/no1

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
Reply to this topic...

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