Jump to content
  • 0

Block certain commands when WoE


Question

Posted

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 ?

11 answers to this question

Recommended Posts

  • 1
Posted

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
Posted

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
Posted

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

Posted (edited)

@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
Posted

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
Posted

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

Posted

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 !

Posted

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

Posted

@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.";

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...