Jump to content
  • 0

Card Function in Weapon


Phantom Of Rogue-Gon

Question


  • Group:  Members
  • Topic Count:  65
  • Topics Per Day:  0.02
  • Content Count:  181
  • Reputation:   0
  • Joined:  08/07/13
  • Last Seen:  

if the player [4] weapon and the card function is 1511 the max card in weapon is 3 . if the players 4 card in weapon he/she cant use the weapon

Edited by Phantom Of Rogue-Gon
Link to comment
Share on other sites

7 answers to this question

Recommended Posts


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

why not just edit the db/re/item_db.txt and change to 3 slots instead of having 4 slots ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  65
  • Topics Per Day:  0.02
  • Content Count:  181
  • Reputation:   0
  • Joined:  08/07/13
  • Last Seen:  

the weapon is 4 slot but he or she can use 3 max of card same id

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

For eAthena you could do something like this...

 

setarray .@eqid, 7,6;
for(set(.@i,0);.@i<getarraysize(.@eqid);set(.@i,.@i+1)) {
	setarray .@temp, getequipcardid(.@eqid[.@i],0), getequipcardid(.@eqid[.@i],1);
	for(set(.@b,0);.@b<getarraysize(.@temp);set(.@b,.@b+1)) {
		if(getequipid(.@eqid[.@i])>-1)
			for(set(.@a,0);.@a<getequipcardcnt(.@eqid[.@i]);set(.@a,.@a+1))
				if(compare(""+getequipcardid(.@eqid[.@i],.@a),""+.@temp[.@b]))
					set(.@m,.@m+1);
		if(.@m>=3) unequip(.@eqid[.@i]);
		set(.@m,0);
	}
}

 

 

For rAthena you can make it smaller.

 

setarray .@cards$, ""+getequipcardid(7,0), ""+getequipcardid(7,1), ""+getequipcardid(7,2), ""+getequipcardid(7,3);
set .@card$, implode(.@cards$,"|");
for(set(.@b,0);.@b<2;set(.@b,.@b+1))
	if(getequipid(7)>-1)
		if(countstr("|"+.@card$+"|", "|"+.@cards$[.@b]+"|", 0)>=3)
			unequip(7);
Link to comment
Share on other sites


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

it gonna be a pain for you to edit every single card in the server to avoid them from using 3 or more same card in same equipments..

 

i remember QQFoolSelina posted a small source snippet on how to fix your problem ... try check source support/request forum ...

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

it gonna be a pain for you to edit every single card in the server to avoid them from using 3 or more same card in same equipments..

 

i remember QQFoolSelina posted a small source snippet on how to fix your problem ... try check source support/request forum ...

 

Well linking it with a function wouldn't be all that hard especially if he's using an SQL database, but I didn't realize this is something he wanted for all items... As I've done something similar with a limited number of items, and I do agree a source mod would be better at restricting the number of cards per equipped.

 

I'm not sure if it works but this might be what you're looking for.

http://rathena.org/board/files/file/2822-card-effect-stack-limit/

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  65
  • Topics Per Day:  0.02
  • Content Count:  181
  • Reputation:   0
  • Joined:  08/07/13
  • Last Seen:  

setarray .@eqid, 7,6;
for(set(.@i,0);.@i<getarraysize(.@eqid);set(.@i,.@i+1)) {
	setarray .@temp, getequipcardid(.@eqid[.@i],0), getequipcardid(.@eqid[.@i],1);
	for(set(.@b,0);.@b<getarraysize(.@temp);set(.@b,.@b+1)) {
		if(getequipid(.@eqid[.@i])>-1)
			for(set(.@a,0);.@a<getequipcardcnt(.@eqid[.@i]);set(.@a,.@a+1))
				if(compare(""+getequipcardid(.@eqid[.@i],.@a),""+.@temp[.@b]))
					set(.@m,.@m+1);
		if(.@m>=3) unequip(.@eqid[.@i]);
		set(.@m,0);
	}
}

how can put the ID of card?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

You don't need to. It will get the ID of the card for you. This script is designed to be universal, meaning it works with all cards.

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