Jump to content
  • 0

How break an equipped weapon?


Question

Posted

Hi, I need help for a script that break the players equipped weapon (not delete the player weapon, but breaks that return the weapon with broken status). I tried "delequip" with "getitem2", but how I get the slotted cards? And in case of BS/WS crafted weapons and signed weapons, have problem?

 

And, have any way to do it better than:

get weapon id;
get refine;
get card 1;
get card 2;
get card 3;
get card 4;
delequip;
getitem2(weapon id, 1, 1, refine, 1, 0, card 1~4);

Some item script, function, effect, etc, that I can use to do it better/easier?

3 answers to this question

Recommended Posts

  • 1
Posted
	if (getequipid(EQI_HAND_R) != -1)
		breakequip(EQI_HAND_R);
	end;

Shorter ? xD

*breakequip <equipment slot>{,<char_id>};

This command will break and unequip whatever is currently equipped in the
invoking character's specified equipment slot. For a full list of possible
equipment slots see 'getequipid'.

This command will return 1 if an item was broken and 0 otherwise.

 

  • MVP 1
  • 1
Posted (edited)

try this.

.@equip_loc = EQI_HAND_R;
getinventorylist();
for (.@i = 0; .@i < @inventorylist_count; .@i++)
	if (@inventorylist_id[.@i] > 0 && @inventorylist_id[.@i] == getequipid(.@equip_loc) && @inventorylist_equip[.@i] > 0) {
		delequip .@equip_loc;
		getitem2 @inventorylist_id[.@i],1,@inventorylist_identify[.@i],@inventorylist_refine[.@i],1,@inventorylist_card1[.@i],@inventorylist_card2[.@i],@inventorylist_card3[.@i],@inventorylist_card4[.@i];
		end;
	}

with random item option

.@equip_loc = EQI_HAND_R;
getinventorylist();
for (.@i = 0; .@i < @inventorylist_count; .@i++)
	if (@inventorylist_id[.@i] > 0 && @inventorylist_id[.@i] == getequipid(.@equip_loc) && @inventorylist_equip[.@i] > 0) {
		delequip .@equip_loc;
		for (.@r = 1; .@r <= 5; .@r++) {
			.@RandomIDArray[.@r-1] = getd("@inventorylist_option_id"+.@r+"["+.@i+"]");
			.@RandomValueArray[.@r-1] = getd("@inventorylist_option_value"+.@r+"["+.@i+"]");
			.@RandomParamArray[.@r-1] = getd("@inventorylist_option_parameter"+.@r+"["+.@i+"]");
		}
		getitem3 @inventorylist_id[.@i],1,@inventorylist_identify[.@i],@inventorylist_refine[.@i],1,@inventorylist_card1[.@i],@inventorylist_card2[.@i],@inventorylist_card3[.@i],@inventorylist_card4[.@i],.@RandomIDArray,.@RandomValueArray,.@RandomParamArray;
		end;
	}

 

Edited by Emistry
fix attribute value
  • MVP 1

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