Jump to content
  • 0

Block certain commands when WoE


- Mariel

Question


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  58
  • Reputation:   0
  • Joined:  02/23/13
  • Last Seen:  

I've search for a script that blocks @item2 and it's made by Euphy and it's totally working. Is there any way to block @guildrecall and @recall when woe or prevent gm from logging in when WoE starts ?

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

An easier way:

-	script	#sample	-1,{

OnAgitStart:

OnAgitStart2:

sleep rand(10,50); // In case both are executed simultaneously, don't overlap.

if (!.bound) {

set .bound,1;

bindatcmd("guildrecall",strnpcinfo(0)+"::OnBlock");

bindatcmd("recall",strnpcinfo(0)+"::OnBlock");

}

end;

OnAgitEnd:

OnAgitEnd2:

sleep rand(10,50);

if (.bound && !agitcheck() && !agitcheck2()) {

set .bound,0;

unbindatcmd("guildrecall");

unbindatcmd("recall");

}

end;

OnBlock:

message strcharinfo(0),.@atcmd_command$+" is blocked during WoE.";

end;

}

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1125
  • Reputation:   236
  • Joined:  07/30/12
  • Last Seen:  

src/map/atcommand.c

 

For @guildrecall; Search for:

	memset(atcmd_output, '\0', sizeof(atcmd_output));

Add Below:

	if(agit_flag)
	{
		clif_displaymessage(fd, "You cannot use @guildrecall during WoE.");
		return -1;
	}

For @recall; Search for:

ACMD_FUNC(recall) {
	struct map_session_data *pl_sd = NULL;

	nullpo_retr(-1, sd);

Add Below:

	if(agit_flag)
	{
		clif_displaymessage(fd, "You cannot use @recall during WoE.");
		return -1;
	}
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  58
  • Reputation:   0
  • Joined:  02/23/13
  • Last Seen:  

Thanks !

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1125
  • Reputation:   236
  • Joined:  07/30/12
  • Last Seen:  

An easier way:

-	script	#sample	-1,{
OnAgitStart:
OnAgitStart2:
	sleep rand(10,50); // In case both are executed simultaneously, don't overlap.
	if (!.bound) {
		set .bound,1;
		bindatcmd("guildrecall",strnpcinfo(0)+"::OnBlock");
		bindatcmd("recall",strnpcinfo(0)+"::OnBlock");
	}
	end;
OnAgitEnd:
OnAgitEnd2:
	sleep rand(10,50);
	if (.bound && !agitcheck() && !agitcheck2()) {
		set .bound,0;
		unbindatcmd("guildrecall");
		unbindatcmd("recall");
	}
	end;
OnBlock:
	message strcharinfo(0).@atcmd_command$+" is blocked during WoE.";
	end;
}

 

Too pro Euphy! :D

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  58
  • Reputation:   0
  • Joined:  02/23/13
  • Last Seen:  

@Euphy thanks a lot. I just have to add party recall there right ?



another thing, do i have to put a number here to block partyrecall too ?

sleep rand(10,50,x);

Edited by - Mariel
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1125
  • Reputation:   236
  • Joined:  07/30/12
  • Last Seen:  

For @partyrecall;

 

Find:

ACMD_FUNC(partyrecall)
{
	struct map_session_data* pl_sd;
	struct s_mapiterator* iter;
	char party_name[NAME_LENGTH];
	struct party_data *p;
	int count;
	nullpo_retr(-1, sd);

	memset(party_name, '\0', sizeof(party_name));
	memset(atcmd_output, '\0', sizeof(atcmd_output));

 

Add below:

	if(agit_flag)
	{
		clif_displaymessage(fd, "You cannot use @partyrecall during WoE.");
		return -1;
	}
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  354
  • Reputation:   3
  • Joined:  02/17/13
  • Last Seen:  

An easier way:

-	script	#sample	-1,{
OnAgitStart:
OnAgitStart2:
	sleep rand(10,50); // In case both are executed simultaneously, don't overlap.
	if (!.bound) {
		set .bound,1;
		bindatcmd("guildrecall",strnpcinfo(0)+"::OnBlock");
		bindatcmd("recall",strnpcinfo(0)+"::OnBlock");
	}
	end;
OnAgitEnd:
OnAgitEnd2:
	sleep rand(10,50);
	if (.bound && !agitcheck() && !agitcheck2()) {
		set .bound,0;
		unbindatcmd("guildrecall");
		unbindatcmd("recall");
	}
	end;
OnBlock:
	message strcharinfo(0).@atcmd_command" is blocked during WoE.";
	end;
}

Nice one i 've used it xD

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  58
  • Reputation:   0
  • Joined:  02/23/13
  • Last Seen:  

Thanks Anakid and Euphy. But somehow, Euphy scripts don't work for me, it said that in the line 23 it needs '

I added ' in the last part of line 21 but somehow didn't manage to make it work. Anyway thanks !

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  143
  • Reputation:   30
  • Joined:  12/23/11
  • Last Seen:  

Thanks Anakid and Euphy. But somehow, Euphy scripts don't work for me, it said that in the line 23 it needs '

I think there is a typo. Must be ',' instead of '.' in line

message strcharinfo(0).@atcmd_command$+" is blocked during WoE.";

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

@Euphy thanks a lot. I just have to add party recall there right ?

Add near the other bindatcmd/unbind

bindatcmd("partyrecall",strnpcinfo(0)+"::OnBlock");
unbindatcmd("partyrecall");

 

 

I think there is a typo. Must be ',' instead of '.' in line

message strcharinfo(0), .@atcmd_command$+" is blocked during WoE.";
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

My mistake, thanks for catching that. Post edited.

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