Jump to content
  • 0

Script idea


IsabelaFernandez

Question


  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.07
  • Content Count:  354
  • Reputation:   8
  • Joined:  04/16/18
  • Last Seen:  

 

The script is already done, however there are ways to bypass it (spam command), any ideas to block spam or even cancel the element converter if using item 4263 of script?

 

-	script	buffs2	-1,{
end;

OnBuffs:
	if(getgroupid() <= 4) {
		message strcharinfo(0),"Falha, você não possui VIP.";
		end;
	}
	if(isequipped(4263)) {
		message strcharinfo(0),"Won't work with Samurai Incantation.";
		end;
	}
	.@size = getarraysize(.buffs$);
	for( .@i = 0; .@i < .@size; .@i++){
		.@menu$ = .@menu$ + ""+.buffs$[.@i]+"" + ":";
	}
	.@i = select(.@menu$) -1;
	sc_start .elements[.@i],180000,5;
	//atcommand "@refresh "+strcharinfo(0);
	end;

OnInit:
	setarray .buffs$, "^800080Envenenar Arma^000000", "^40E0D0Aspersio^000000", "^000000Sombrio^000000", "^FFD700Encantar com Ventania^000000", "^0000FFEncantar com Geada^000000", "^FF0000Encantar com Chama^000000", "^B8860BEncantar com Terremoto^000000";
	setarray .elements, 26, 37, "144", "98", "97", "96", "99";
	bindatcmd "encantar","paytowinbuffs::OnBuffs",0,99;
	end;
}
Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   703
  • Joined:  12/21/14
  • Last Seen:  

i didn't really understand the point of the script

but to prevent spamming , you can add delay (for reference check out this https://github.com/rathena/rathena/blob/master/npc/custom/healer.txt)

and to remove the element when an item is equipped , you can edit the item OnEquip script it self (in the item db)

also you might need to add disable_items; after OnBuffs: so people don't switch to the item after they pass the if statement .

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.07
  • Content Count:  354
  • Reputation:   8
  • Joined:  04/16/18
  • Last Seen:  

2 hours ago, sader1992 said:

i didn't really understand the point of the script

but to prevent spamming , you can add delay (for reference check out this https://github.com/rathena/rathena/blob/master/npc/custom/healer.txt)

and to remove the element when an item is equipped , you can edit the item OnEquip script it self (in the item db)

also you might need to add disable_items; after OnBuffs: so people don't switch to the item after they pass the if statement .

 

The problem is that I had already removed but the effect is still working:
12117,Elemental_Wind,Elemental Converter,11,2,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ if (!isequipped (4263)) { itemskill "ITEM_ENCHANTARMS",5; } },{},{}
The idea of the script is to block the use of converters if using card ID 4263, even blocking spam, the script dialog still opens / works, and if you
change the item during the dialog the effect also works...
Edited by IsabelaFernandez
Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   703
  • Joined:  12/21/14
  • Last Seen:  

i still don't understand

but did you add a delay ?

for example

like this

-	script	buffs2	-1,{
end;

OnBuffs:
	disable_items;
	if(getgroupid() <= 4) {
		message strcharinfo(0),"Falha, você não possui VIP.";
		end;
	}
	if (@STAT_BUFF_DELAY > gettimetick(2))
		end;
	@STAT_BUFF_DELAY = gettimetick(2) + 2;	//2 seconds
	if(isequipped(4263)) {
		message strcharinfo(0),"Won't work with Samurai Incantation.";
		end;
	}
	.@size = getarraysize(.buffs$);
	for( .@i = 0; .@i < .@size; .@i++){
		.@menu$ = .@menu$ + ""+.buffs$[.@i]+"" + ":";
	}
	.@i = select(.@menu$) -1;
	sc_start .elements[.@i],180000,5;
	//atcommand "@refresh "+strcharinfo(0);
	end;

OnInit:
	setarray .buffs$, "^800080Envenenar Arma^000000", "^40E0D0Aspersio^000000", "^000000Sombrio^000000", "^FFD700Encantar com Ventania^000000", "^0000FFEncantar com Geada^000000", "^FF0000Encantar com Chama^000000", "^B8860BEncantar com Terremoto^000000";
	setarray .elements, 26, 37, 144, 98, 97, 96, 99;
	bindatcmd "encantar","paytowinbuffs::OnBuffs",0,99;
	end;
}

also , i see the script name != what the command calls

make sure you don't have 2 npcs and you are editing the wrong one

 

this will also be better

-	script	buffs2	-1,{
end;

OnBuffs:
	disable_items;
	if(getgroupid() <= 4) {
		message strcharinfo(0),"Falha, você não possui VIP.";
		end;
	}
	if (@STAT_BUFF_DELAY > gettimetick(2))
		end;
	@STAT_BUFF_DELAY = gettimetick(2) + 2;	//2 seconds
	if(isequipped(4263)) {
		message strcharinfo(0),"Won't work with Samurai Incantation.";
		end;
	}
	.@i = select(.menu$) -1;
	sc_start .elements[.@i],180000,5;
	//atcommand "@refresh "+strcharinfo(0);
	end;

OnInit:
	setarray .buffs$, "^800080Envenenar Arma^000000", "^40E0D0Aspersio^000000", "^000000Sombrio^000000", "^FFD700Encantar com Ventania^000000", "^0000FFEncantar com Geada^000000", "^FF0000Encantar com Chama^000000", "^B8860BEncantar com Terremoto^000000";
	setarray .elements, 26, 37, 144, 98, 97, 96, 99;
	bindatcmd "encantar", strnpcinfo(3) + "::OnBuffs",0,99;
	for( .@i = 0; .@i < getarraysize(.buffs$); .@i++){
		.menu$ = .menu$ + ""+.buffs$[.@i]+"" + ":";
	}
	end;
}

however make sure that the script name is correct

 

and what i mean by editing the item script

like that , you create a function that remove those stats and call it onequip the item



function	script	F_RemoveSTATBUFF	{
	setarray .@e, 26, 37, 144, 98, 97, 96, 99;
	for(.@i=0;.@i<getarraysize(.@e);.@i++){
		sc_end .@e[.@i];
	}
	return;
}
ID,AegisName,Name,Type,Buy,Sell,Weight,ATK[:MATK],DEF,Range,Slots,Job,Class,Gender,Loc,wLV,eLV[:maxLevel],Refineable,View,{ Script },{ OnEquip_Script },{ OnUnequip_Script }

==

ID,AegisName,Name,Type,Buy,Sell,Weight,ATK[:MATK],DEF,Range,Slots,Job,Class,Gender,Loc,wLV,eLV[:maxLevel],Refineable,View,{ Script },{ callfunc "F_RemoveSTATBUFF"; },{ OnUnequip_Script }

 

Edited by sader1992
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.07
  • Content Count:  354
  • Reputation:   8
  • Joined:  04/16/18
  • Last Seen:  

13 minutes ago, sader1992 said:

also , i see the script name != what the command calls

make sure you don't have 2 npcs and you are editing the wrong one

Yes, I had changed before creating the topic
14 minutes ago, sader1992 said:

this will also be better


-	script	buffs2	-1,{
end;

OnBuffs:
	disable_items;
	if(getgroupid() <= 4) {
		message strcharinfo(0),"Falha, você não possui VIP.";
		end;
	}
	if (@STAT_BUFF_DELAY > gettimetick(2))
		end;
	@STAT_BUFF_DELAY = gettimetick(2) + 2;	//2 seconds
	if(isequipped(4263)) {
		message strcharinfo(0),"Won't work with Samurai Incantation.";
		end;
	}
	.@i = select(.menu$) -1;
	sc_start .elements[.@i],180000,5;
	//atcommand "@refresh "+strcharinfo(0);
	end;

OnInit:
	setarray .buffs$, "^800080Envenenar Arma^000000", "^40E0D0Aspersio^000000", "^000000Sombrio^000000", "^FFD700Encantar com Ventania^000000", "^0000FFEncantar com Geada^000000", "^FF0000Encantar com Chama^000000", "^B8860BEncantar com Terremoto^000000";
	setarray .elements, 26, 37, 144, 98, 97, 96, 99;
	bindatcmd "encantar", strnpcinfo(3) + "::OnBuffs",0,99;
	for( .@i = 0; .@i < getarraysize(.buffs$); .@i++){
		.menu$ = .menu$ + ""+.buffs$[.@i]+"" + ":";
	}
	end;
}

however make sure that the script name is correct

 

Thanks, your script has solved the problem of changing equips during the dialog but it is still possible to open the dialog with (lots of spam) equipped with item 4263 ID

Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   703
  • Joined:  12/21/14
  • Last Seen:  

try this for the spam

however it should work either ways

-	script	buffs2	-1,{
end;

OnBuffs:
	disable_items;
	if(getgroupid() <= 4) {
		message strcharinfo(0),"Falha, você não possui VIP.";
		end;
	}
	if (@STAT_BUFF_DELAY > gettimetick(2))
		end;
	@STAT_BUFF_DELAY = gettimetick(2) + 2;	//2 seconds
	if(!isequipped(4263)){
		.@i = select(.menu$) -1;
		sc_start .elements[.@i],180000,5;
		//atcommand "@refresh "+strcharinfo(0);
		end;
	}
	message strcharinfo(0),"Won't work with Samurai Incantation.";
end;

OnInit:
	setarray .buffs$, "^800080Envenenar Arma^000000", "^40E0D0Aspersio^000000", "^000000Sombrio^000000", "^FFD700Encantar com Ventania^000000", "^0000FFEncantar com Geada^000000", "^FF0000Encantar com Chama^000000", "^B8860BEncantar com Terremoto^000000";
	setarray .elements, 26, 37, 144, 98, 97, 96, 99;
	bindatcmd "encantar", strnpcinfo(3) + "::OnBuffs",0,99;
	for( .@i = 0; .@i < getarraysize(.buffs$); .@i++){
		.menu$ = .menu$ + ""+.buffs$[.@i]+"" + ":";
	}
	end;
}

if this still didn't work , if i were you , i would look into the src (i would do that either ways)

Edited by sader1992
Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   703
  • Joined:  12/21/14
  • Last Seen:  

if it didn't work , try this command

isequippedcnt

 

  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.07
  • Content Count:  354
  • Reputation:   8
  • Joined:  04/16/18
  • Last Seen:  

51 minutes ago, sader1992 said:

if it didn't work , try this command

isequippedcnt

 

 

Perfect! The command simply solved both problems (spam and the converter) thank you very much!

Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   703
  • Joined:  12/21/14
  • Last Seen:  

can you tell me how you were spamming it on testing?

Edited by sader1992
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.07
  • Content Count:  354
  • Reputation:   8
  • Joined:  04/16/18
  • Last Seen:  

3 hours ago, sader1992 said:

can you tell me how you were spamming it on testing?

For sure, I was using alt + m on all of them. With the command "isequipped" even with the constraint the dialog box was opening.
After using "isequippedcnt" everything worked.
Edited by IsabelaFernandez
Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   703
  • Joined:  12/21/14
  • Last Seen:  

while there is a problem with the command

the normal player should not use a @commands while is attached to an npc

this was fixed in this commit

https://github.com/rathena/rathena/pull/4043

but either ways , if you are testing it would be a gm account

and by default an account with group 99 command_enable: true

so i think the bug you experienced wouldn't happen to the normal player anyway

 

 

edit : tested the command , and the problem would happen anyway cuz the bug

https://github.com/rathena/rathena/issues/4366

Edited by sader1992
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.07
  • Content Count:  354
  • Reputation:   8
  • Joined:  04/16/18
  • Last Seen:  

2 hours ago, sader1992 said:

while there is a problem with the command

the normal player should not use a @commands while is attached to an npc

this was fixed in this commit

https://github.com/rathena/rathena/pull/4043

but either ways , if you are testing it would be a gm account

and by default an account with group 99 command_enable: true

so i think the bug you experienced wouldn't happen to the normal player anyway

 

 

edit : tested the command , and the problem would happen anyway cuz the bug

https://github.com/rathena/rathena/issues/4366

To be honest I did not test on player account but they were getting bypass the script, however it is a command available for VIP Players to use. However I will test
before the modifications you made and see if it is indeed a bug for me to be reporting, thanks.
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...