mes ("Sold "+.@total+" Items");
mes ("and you received "+.@xTItemZeny+" Zeny.");
Zeny = (Zeny + .@xTItemZeny) ;
} else {
mes ("No Items were sold,");
mes ("therefore you don't");
mes ("receive any Zeny.");
}
close2;
end;
}
mes ("Sold "+.@total+" Items");
mes ("and you received "+.@xTItemZeny+" Zeny.");
Zeny = (Zeny + .@xTItemZeny) ;
} else {
mes ("No Items were sold,");
mes ("therefore you don't");
mes ("receive any Zeny.");
}
close2;
end;
}
Question
utofaery
I need help with this selling IT_ETC and IT_ARMOR and IT_WEAPON
Everytime I click it, it just go to no selling anything at all.
prontera,164,175,4 script Mass Manipulator 1_M_MERCHANT,{
mes ( " OPTIONe " ) ;
switch ( select ("EQUIPS:ETC:IDENTIFY") ) {
case 1:
callfunc ("F_SellEquips");
close2;
end;
case 2:
callfunc ("F_SellETC");
close2;
end;
case 3:
callfunc ("F_IdentifyUnidentified");
close2;
end;
}
}
function script F_SellETC {
setarray(.@noSell0x[0], 1231, 969 );
.@sellable = 0;
getinventorylist();
for ( set .@i,0; .@i < @inventorylist_count; set .@i,.@i + 1) {
if ( getiteminfo( (@inventorylist_id[.@i] ) ,ITEMINFO_TYPE ) == IT_ETC ) {
for( .@c = 0; .@c < getarraysize(.@noSell0x); ++.@c ) {
if ( @inventorylist_id[.@i] != .@noSell0x[.@c] ) { // Yes to sell
.@FinishCheck = 1;
}
}
}
if ( .@FinishCheck == 1 ) {
setarray .@sellid[getarraysize(.@sellid)],@inventorylist_id[.@i];
}
} //End of loop check
if(getarraysize(.@sellid) > 0) {
.@xTItemCount = 0;
.@xTItemZeny = 0;
for ( set .@s,0; .@s < getarraysize(.@sellid); set .@s,.@s + 1) {
set .@total,.@total + (getiteminfo(.@sellid[.@s],1)*countitem(.@sellid[.@s]));
delitem2 .@sellid[.@s],countitem(.@sellid[.@s]),1,0,0,0,0,0,0;
.@xTItemCount = ( .@xTItemCount+ countitem(.@sellid[.@s]) );
.@xTItemZeny = ( .@xTItemZeny + .@total );
}
mes ("Sold "+.@total+" Items");
mes ("and you received "+.@xTItemZeny+" Zeny.");
Zeny = (Zeny + .@xTItemZeny) ;
} else {
mes ("No Items were sold,");
mes ("therefore you don't");
mes ("receive any Zeny.");
}
close2;
end;
}
function script F_SellEquips {
setarray(.@noSell0x[0], 1231, 969 );
.@sellable = 0;
getinventorylist();
for ( set .@i,0; .@i < @inventorylist_count; set .@i,.@i + 1) {
if ( getiteminfo(@inventorylist_id[.@i],ITEMINFO_TYPE) == IT_WEAPON ) || ( getiteminfo(@inventorylist_id[.@i],ITEMINFO_TYPE) == IT_ARMOR ) {
if ( @inventorylist_equip[.@i] == 0 ) {
.@sellable = .@sellable + 1;
} else {
.@sellable = .@sellable - 1;
}
if ( @inventorylist_refine[.@i] == 0 ) {
.@sellable = .@sellable + 1;
} else {
.@sellable = .@sellable - 1;
}
if ( @inventorylist_card1[.@i] == 0 ) {
.@sellable = .@sellable + 1;
} else {
.@sellable = .@sellable - 1;
}
if ( @inventorylist_card2[.@i] == 0 ) {
.@sellable = .@sellable + 1;
} else {
.@sellable = .@sellable - 1;
}
if ( @inventorylist_card3[.@i] == 0 ) {
.@sellable = .@sellable + 1;
} else {
.@sellable = .@sellable - 1;
}
if ( @inventorylist_card4[.@i] == 0 ) {
.@sellable = .@sellable + 1;
} else {
.@sellable = .@sellable - 1;
}
if (.@sellingITEM) == 0 { //Not sell item
}
if (.@sellingITEM) == 1 { //Yes sell item
for( .@c = 0; .@c < getarraysize(.@noSell0x); ++.@c ) {
if ( @inventorylist_id[.@i] != .@noSell0x[.@c] ) && ( .@sellable >= 6 ) { // Yes to sell
.@FinishCheck = 1;
}
}
}
}
if ( .@FinishCheck == 1 ) {
setarray .@sellid[getarraysize(.@sellid)],@inventorylist_id[.@i];
}
} //End of loop check
if(getarraysize(.@sellid) > 0) {
.@xTItemCount = 0;
.@xTItemZeny = 0;
for ( set .@s,0; .@s < getarraysize(.@sellid); set .@s,.@s + 1) {
set .@total,.@total + (getiteminfo(.@sellid[.@s],1)*countitem(.@sellid[.@s]));
delitem2 .@sellid[.@s],countitem(.@sellid[.@s]),1,0,0,0,0,0,0;
.@xTItemCount = ( .@xTItemCount+ countitem(.@sellid[.@s]) );
.@xTItemZeny = ( .@xTItemZeny + .@total );
}
mes ("Sold "+.@total+" Items");
mes ("and you received "+.@xTItemZeny+" Zeny.");
Zeny = (Zeny + .@xTItemZeny) ;
} else {
mes ("No Items were sold,");
mes ("therefore you don't");
mes ("receive any Zeny.");
}
close2;
end;
}
function script F_IdentifyUnidentified {
//identify all player's equipments
getinventorylist();
for( .@i = 0; .@i < @inventorylist_count; .@i++ ) {
if ( @inventorylist_identify[.@i] == 1 ) {
continue;
} else if ( getskilllv("MC_IDENTIFY") == 1 && Sp >= 10 ) {
heal 0,0; // lol... this is supposed to reduce their SP by 10, whatever
npctalk("MC_IDENTIFY");
} else if ( countitem("Spectacles") ) {
delitem(Spectacles, 1);
npctalk("Spectacles deleted 1!"); //debuglines
} else if ( getskilllv("RG_COMPULSION") && Zeny >= ( 100 - ( 5 + 4 * getskilllv("RG_COMPULSION") ) )* 2/5 ) {
Zeny -= ( 100 - ( 5 + 4 * getskilllv("RG_COMPULSION") ) )* 2/5;
npctalk("RGCompulsion"); //debuglines
} else if ( getskilllv("MC_DISCOUNT") && Zeny >= ( 100 - ( 5 + 2 * getskilllv("MC_DISCOUNT") ) )* 2/5 ) {
Zeny -= ( 100 - ( 5 + 2 * getskilllv("MC_DISCOUNT") ) )* 2/5;
npctalk("MC_DISCOUNT"); //debuglines
} else if ( Zeny >= 40 ) {
Zeny -= 40;
npctalk("40z deducted."); //debuglines
} else if ( Zeny <= 39 ) {
npctalk("Zeny < 39."); //debuglines
return;
}
delitem2(@inventorylist_id[.@i], 1, 0, 0, 0, 0, 0, 0, 0);
getitem2(@inventorylist_id[.@i], 1, 1, 0, 0, 0, 0, 0, 0);
.@icount++;
}
mes ( "Identified "+ .@icount +" Items." );
close2;
end;
}
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.