morocc,81,103,4 script Bree 555,{function a; function b;goto MainMenu; MainMenu:mes .npc$;mes"Greetings "+strcharinfo(0)+"!";mes"I am the known ^00557fGift Package Wrapper^000000.";next;if(getgmlevel()>=.@gm){menu"[ ^005500Information^000000 ]",Info,"[ ^00007fWrap a Gift^000000 ]",Wrap,"[ ^ff0000GM Menu^000000 ]",GMMenu; }else{menu"[ ^005500Information^000000 ]",Info,"[ ^00007fWrap a Gift^000000 ]",Wrap;}close; GMMenu:mes .npc$;mes"Please select an option.";next;menu"[ ^005500Gift Listing^000000 ]",GiftList,"[ ^00007fDelete a Gift^000000 ]",DeleteGift,"[ ^ff0000Main Menu^000000 ]",MainMenu;close; GiftList:set .@serials,query_sql("SELECT `serial`,`sender`,`time_created`,`item_id`,`refine`,`card1`,`card2`,`card3`,`card4` FROM `ragnarok`.`gift_sys` ORDER BY `time_created` ASC LIMIT 15",.@ser$,.@sen$,.@time$,.@a,.@b,.@c,.@d,.@e,.@f);mes"[ ^00007fGift Box Listing^000000 ]";if(!.@serials ){mes"^ff0000No Gift Box existed.^000000";next;menu"[ ^00007fDelete a Gift^000000 ]",DeleteGift,"[ ^ff0000GM Menu^000000 ]",GMMenu,"[ ^00007fClose^000000 ]",No;close;}dispbottom"#:Serial:Sender:Time Created:Item:Refine:Card1:Card2:Card3:Card4";mes"^ff0000See Chat-Box below to see Gift Listing.^000000"; for(set .@i,0; .@i<getarraysize(.@serials); set .@i,.@i+1){dispbottom .@i+"."+.@ser$[.@i]+":"+.@sen$[.@i]+":"+.@time$[.@i]+":"+getitemname(.@a[.@i])+":"+.@b[.@i]+":"+getitemname(.@c[.@i])+":"+getitemname(.@d[.@i])+":"+getitemname(.@e[.@i])+":"+getitemname(.@f[.@i])+"";}next;menu"[ ^005500Return^000000 ]",GMMenu,"[ ^00007fClose^000000 ]",No;close; DeleteGift:set .@serials,query_sql("SELECT `serial`,`sender`,`time_created` FROM `ragnarok`.`gift_sys` ORDER BY `time_created` ASC LIMIT 15",.@ser$,.@sen$,.@time$);mes"[ ^00007fDelete a Gift^000000 ]";if(!.@serials){mes"^ff0000No Gift Box existed.^000000";next;menu"[ ^00007fDelete a Gift^000000 ]",DeleteGift,"[ ^ff0000GM Menu^000000 ]",GMMenu,"[ ^00007fClose^000000 ]",No;close;}mes"^ff0000See Chat-Box below to see Gift Listing.^000000";dispbottom"Existing Gift Box Serials:"; dispbottom"#:Serial:Sender:Time Created";for(set .@i,0; .@i<getarraysize(.@serials); set .@i,.@i+1){dispbottom .@i+"."+.@ser$[.@i]+":"+.@sen$[.@i]+":"+.@time$[.@i]+"";}mes"Input Serial to delete a Gift.";input .@sn$;if(.@ser$!=.@sn$){next;mes"[ ^00007fDelete a Gift^000000 ]";mes"Serial doesn`t exist.";next;menu"[ ^00007fDelete a Gift^000000 ]",DeleteGift,"[ ^ff0000GM Menu^000000 ]",GMMenu,"[ ^00007fClose^000000 ]",No;close;}mes"Serial : [ ^ff0000"+.@sn$+"^000000 ]";mes"^005500Proceed to delete.^000000";next;mes"[ ^00007fDelete a Gift^000000 ]";mes"Deleting...";sleep2500;mes".....";sleep2500;mes"........";mes"^ff0000Gift Box deleted.^000000";query_sql"DELETE FROM `gift_sys` WHERE `serial` = '"+escape_sql(.@sn$)+"'";query_sql"DELETE FROM `gift_box` WHERE `serial` = '"+escape_sql(.@sn$)+"'";next;menu"[ ^00007fDelete a Gift^000000 ]",DeleteGift,"[ ^ff0000GM Menu^000000 ]",GMMenu,"[ ^00007fClose^000000 ]",No;close; Info:mes .npc$;mes"I can wrap any [ ^005500Items^000000 ] or"; mes"[ ^005500Equipments^000000 ] you are wearing into a [ ^ff0000Gift Package ^000000].";next;mes .npc$;mes"Before I wrap the [ ^55007fGift Package^000000 ]. First you need to"; mes"[ ^005500Write a Message^000000 ] to the gift";mes"[ ^ff0000Reciever^000000 ].";next;mes .npc$;mes"Next we need to put a [ ^ff0000Serial^000000 ] that will be provided by you, in the package so that no one can open the box except your desired reciever.";next;if(.toggle[0]==1){mes .npc$;mes"I need these [ ^ff0000Materials^000000 ] to start wrapping the Gift Package.";for(set .@a,1; .@a<getarraysize(.req); set .@a,.@a+1){mes .@a+".[ ^00007f"+b(.req[.@a])+"^000000 : ^0055ff"+.amt[.@a]+"^000000 ]";}next;}if(.toggle[1]==1){mes .npc$;mes"Also theres a fee for packaging service. The cost is";mes"[ ^ff0000"+.toggle[2]+"^000000 ] Zeny.";next;}mes .npc$;mes"When [ ^007979Claiming^000000 ] the Gift Package";mes"use [ ^ff0000@gift^000000 ] and enter the right"; mes"[ ^005500Serial Key^000000 ] and [ ^00007fName^000000 ] of the sender.";next;mes .npc$;mes"You cannot use [ ^ff0000@gift^000000 ] command when you don`t have any [ ^00007fGift Package^000000 ] in your [ ^005500Inventory^000000 ].";next;mes .npc$;mes"Remember that only [ ^ff0000ONE^000000 ] Gift is allowed that can be stored in your [ ^005500Inventory^000000 ]. Resulting of [ ^00007fTwo or More Count^000000 ] will"; mes"[ ^ff0000Drop any Gift^000000 ] beside the first one. Just to be [ ^55aaffSafe^000000 ] you can put other gifts to your [ ^e69900Storage^000000 ] and claim it [ ^005500One by One^000000 ].";next;mes .npc$;mes"Well thats all, its very simple, isn`t it?";emotione_no1;next;menu"[ ^009e00Return^000000 ]",MainMenu,"[ ^ff0000Done^000000 ]",No;close; Wrap:mes .npc$;mes"^ff0000Remember that any equip attribute that will be wrapped as gift will be deleted.^000000";next;mes .npc$;mes"^ff0000You cannot create two gift using one name, the reciepient must claim the gift first for you to be able to make another gift.^000000";next;mes .npc$;mes"^ff0000Also you cannot change any equipment you are wearing while im doing the job. If you do that, I will discontinue the wrapping.^000000";next;menu"[ ^005500Proceed^000000 ]",Yes,"[ ^00557fCancel^000000 ]",No; close; No:mes .npc$;mes" ";mes"Have a nice day!";close; Yes:mes .npc$;mes"^ff0000Checking inventory..^000000";mes"....";sleep2500;mes"^005500Please wait a moment...^000000";sleep2500;if(getequipisequiped(1)==0&&getequipisequiped(2)==0&&getequipisequiped(3)==0&&getequipisequiped(4)==0&&getequipisequiped(5)==0&&getequipisequiped(6)==0&&getequipisequiped(7)==0&&getequipisequiped(8)==0&&getequipisequiped(9)==0&&getequipisequiped(10)==0){mes"....";sleep2500;mes"^4f4f4fYou are not equipping any item!^000000";next;menu"[ ^005500Return^000000 ]",Yes,"[ ^ff0000Cancel^000000 ]",No;close;}else{mes"....";sleep2500;mes"^ff0000Done!^000000";next; }if(.toggle[0]==1){mes .npc$;mes"Requirements:";for(set .@a,1; .@a<getarraysize(.req); set .@a,.@a+1){mes .@a+".[ ^00007f"+b(.req[.@a])+"^000000 : ^0055ff"+.amt[.@a]+"^000000 ]";}}if(.toggle[1]==1){mes"Zeny Cost : [ ^a87000"+.toggle[2]+"^000000 ]";}if(.toggle[0]==1){for(set .@b,1; .@b<getarraysize(.req); set .@b,.@b+1){if(countitem(.req[.@b])<.amt[.@b]){next;mes .npc$;mes" ";mes"^3b3b3bYou are lacking of requirements!^000000";next;menu"[ ^005500Return^000000 ]",Yes,"[ ^ff0000Cancel^000000 ]",No;close;}}}if(.toggle[1]==1){if(Zeny<.toggle[2]){next;mes .npc$;mes"^3b3b3bYour Zeny is insufficient^000000.";next;menu"[ ^005500Return^000000 ]",Yes,"[ ^ff0000Cancel^000000 ]",No;close;}}mes .npc$;mes"^abab00Select the equipment that will be wrapped.^000000";set .@m,select(a(1),a(2),a(3),a(4),a(5),a(6),a(7),a(8),a(9),a(10));for(set .@a,0; .@a<getarraysize(.p); set .@a,.@a+1){if(.@m==.p[.@a]&&getequipname(.p[.@a])==""){mes" ";mes"There are no equipment in that slot.";next;menu"[ ^005500Return^000000 ]",Yes,"[ ^ff0000Cancel^000000 ]",No;close;}}set .@gi,getequipid(.@m);set .@gr,getequiprefinerycnt(.@m);set .@ga,getequipcardid(.@m,0);set .@gb,getequipcardid(.@m,1);set .@gd,getequipcardid(.@m,2);set .@gc,getequipcardid(.@m,3);next;if(getequipid(.@m)!= .@gi){mes .npc$;mes"Aha! You switched your equipment! You dont do that to me!";close;}if(countitem(.@gi) > 1){mes .npc$; mes" ";mes"^3b3b3bLooks like you have same equipment in your inventory, store it first.^000000"; close;}if(getequipisequiped(1)==0&&getequipisequiped(2)==0&&getequipisequiped(3)==0&&getequipisequiped(4)==0&&getequipisequiped(5)==0&&getequipisequiped(6)==0&&getequipisequiped(7)==0&&getequipisequiped(8)==0&&getequipisequiped(9)==0&&getequipisequiped(10)==0){mes"....";sleep2500;mes"^4f4f4fYou are not equipping any item!^000000";close;}mes .npc$;mes"Input the reciever`s name.";input .@reciever$;mes"[ Name ] : ^55007f"+.@reciever$+"^000000";if(getstrlen(.@reciever$)<4||getstrlen(.@reciever$)>23){next;mes .npc$;mes" ";mes"^3b3b3bName must be atleast 4 character lenght and maximum of 23.^000000";next;menu"[ ^005500Return^000000 ]",Yes,"[ ^ff0000Cancel^000000 ]",No;close;}if(.@reciever$ ==strcharinfo(0)){next;mes .npc$;mes" ";mes"^3b3b3bYou cannot put your own name!^000000";next;menu"[ ^005500Return^000000 ]",Yes,"[ ^ff0000Cancel^000000 ]",No;close;}next;if(getequipid(.@m)!= .@gi){mes .npc$;mes"Aha! You switched your equipment! You dont do that to me!";close;}mes .npc$;mes"Now type your message.";input .@rm$;if(getstrlen(.@rm$)<4||getstrlen(.@rm$)>23){next;mes .npc$;mes" ";mes"^3b3b3bMessage must be atleast 4 character lenght and maximum of 23.^000000";next;menu"[ ^005500Return^000000 ]",Yes,"[ ^ff0000Cancel^000000 ]",No;close;}mes"[ Message ] :";mes"^00007f"+.@rm$+"^000000";next;if(getequipid(.@m)!= .@gi){mes .npc$;mes"Aha! You switched your equipment! You dont do that to me!";close;}mes .npc$;mes"Input your desired serial.";input .@h$;mes"[ Serial ] :"; mes"^339a9a"+.@h$+"^000000 ";query_sql"SELECT `serial`,`sender`,`account_id` FROM `ragnarok`.`gift_sys` WHERE `serial` = '"+escape_sql(.@h$)+"'",.@s$,.@g$,.@i;query_sql"SELECT `sender` FROM `ragnarok`.`gift_box` WHERE `serial` = '"+escape_sql(.@h$)+"'",.@n$;if(getstrlen(.@h$)<4||getstrlen(.@h$)>10){next;mes .npc$;mes" ";mes"^3b3b3bSerial must be atleast 4 character length and maximum of 10.^000000";next;menu"[ ^005500Return^000000 ]",Yes,"[ ^ff0000Cancel^000000 ]",No;close;}if(strcharinfo(0)== .@h$){mes .npc$;mes" ";mes"^3b3b3bYou cannot enter your name as serial.^000000";next;menu"[ ^005500Return^000000 ]",Yes,"[ ^ff0000Cancel^000000 ]",No;}if(strcharinfo(0)== .@g$ || getcharid(3)== .@i){next;mes .npc$;mes" ";mes"^3b3b3bYour gift is not opened yet, cannot create another one^000000.";close;}if(.@s$ == .@h$){next;mes .npc$;mes" ";mes"^3b3b3bYou cannot enter this serial.^000000";next;menu"[ ^005500Return^000000 ]",Yes,"[ ^ff0000Cancel^000000 ]",No;close;}if(getequipid(.@m)!= .@gi || (getequiprefinerycnt(.@m)!= .@gr)){next;mes .npc$;mes" ";mes"^3b3b3bYou changed your equipment.^000000";close;}if(getequipisequiped(1)==0&&getequipisequiped(2)==0&&getequipisequiped(3)==0&&getequipisequiped(4)==0&&getequipisequiped(5)==0&&getequipisequiped(6)==0&&getequipisequiped(7)==0&&getequipisequiped(8)==0&&getequipisequiped(9)==0&&getequipisequiped(10)==0){mes"....";sleep2500;mes"^4f4f4fYou are not equipping any item!^000000";next;menu"[ ^005500Return^000000 ]",Yes,"[ ^ff0000Cancel^000000 ]",No;close;}if(.toggle[0]==1){for(set .@b,1; .@b<getarraysize(.req); set .@b,.@b+1){if(countitem(.req[.@b])<.amt[.@b]){next;mes .npc$;mes" ";mes"^3b3b3bYou are lacking of requirements!^000000";next;menu"[ ^005500Return^000000 ]",Yes,"[ ^ff0000Cancel^000000 ]",No;close;}}}if(.toggle[1]==1){if(Zeny<.toggle[2]){next;mes .npc$;mes" ";mes"^3b3b3bYour Zeny is insufficient^000000.";next;menu"[ ^005500Return^000000 ]",Yes,"[ ^ff0000Cancel^000000 ]",No;close;}}progressbar"ffff00",3;if(getequipid(.@m)!= .@gi){mes .npc$;mes"Aha! You switched your equipment! You dont do that to me!";close;}unequip .@m;delitem .@gi,1;emotione_proud;emotione_lv2,1;set .@charid,getcharid(0,""+strcharinfo(0)+"");set .@card3, .@charid &65535;set .@card4, .@charid >> 16;set .@aid,getcharid(3);next;mes .npc$;mes" ";mes"^005500Done wraping the gift!^000000";getitem2 .gb,1,1,0,0,254,0,.@card3,.@card4,.@aid;if(.toggle[1]==1){setZeny,Zeny-.toggle[2];}if(.toggle[0]==1){for(set .@b,1; .@b<getarraysize(.req); set .@b,.@b+1){delitem .req[.@b],.amt[.@b];}}query_sql"INSERT INTO `ragnarok`.`gift_box` (`serial`,`sender`,`account_id`,`time_created`,`reciever`,`message`,`item_id`,`card1`,`card3`,`card4`) VALUES ('"+escape_sql(.@h$)+"','"+strcharinfo(0)+"','"+getcharid(3)+"',NOW(),'"+escape_sql(.@reciever$)+"','"+escape_sql(.@rm$)+"','"+escape_sql(.gb)+"','254','"+escape_sql(.@card3)+"','"+escape_sql(.@card4)+"')";query_sql"INSERT INTO `ragnarok`.`gift_sys` (`serial`,`sender`,`account_id`,`time_created`,`item_id`,`refine`,`card1`,`card2`,`card3`,`card4`) VALUES ('"+escape_sql(.@h$)+"','"+strcharinfo(0)+"','"+getcharid(3)+"',NOW(),'"+escape_sql(.@gi)+"','"+escape_sql(.@gr)+"','"+escape_sql(.@ga)+"','"+escape_sql(.@gb)+"','"+escape_sql(.@gc)+"','"+escape_sql(.@gd)+"')";close; function b {return""+getitemname(getarg(0))+""; }function a {if(getequipname(getarg(0,0))=="")return"- ^ff0000Empty^000000 -"; return""+getequipname(getarg(0))+""; }//----------------------MODIFY SETUP TO YOUR OWN LIKING-----------------------------------------OnInit:set .npc$,"[ ^00007fBree^000000 ]"; // NPC Namesetarray .toggle[0],1, // 1 Enable & 0 Disable requirements.1, // 1 Enable & 0 Disable wrapping cost in Zeny.5000000; // Wrapping cost in Zeny.setarray .req[1],501, // Requirement 1 id number.502, // Requirement 2 id number.503, // Requirement 3 id number.504, // Requirement 4 id number.505; // Requirement 5 id number.setarray .amt[1],1, // Requirement 1 amount.2, // Requirement 2 amount.3, // Requirement 3 amount.4, // Requirement 4 amount.5; // Requirement 5 amount.set .gb,21020; // Gift Box IDset .@gm,99; // GM Level for GM menu view.setarray .gmaid[0],2000000, // ADD GM Account ID here. 2000001; // Auto delete @atcommand of players.//----------------------DONT CHANGE ANYTHING BEYOND THIS POINT---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//----------------------DONT CHANGE ANYTHING BEYOND THIS POINT---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//----------------------DONT CHANGE ANYTHING BEYOND THIS POINT---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//----------------------DONT CHANGE ANYTHING BEYOND THIS POINT---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//----------------------DONT CHANGE ANYTHING BEYOND THIS POINT---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------setarray .p[0],1,2,3,4,5,6,7,8,9,10;query_sql"CREATE TABLE IF NOT EXISTS `ragnarok`.`gift_sys` (`serial` varchar(10) NOT NULL DEFAULT '',`sender` varchar(26) NOT NULL DEFAULT '',`account_id` int(11) unsigned NOT NULL default '0',`time_created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',`item_id` INT( 6 ) NOT NULL DEFAULT '0',`refine` INT( 2 ) NOT NULL DEFAULT '0',`card1` INT( 6 ) NOT NULL DEFAULT '0',`card2` INT( 6 ) NOT NULL DEFAULT '0',`card3` INT( 6 ) NOT NULL DEFAULT '0',`card4` INT( 6 ) NOT NULL DEFAULT '0', PRIMARY KEY (`serial`)) ENGINE = MYISAM COMMENT = 'Lil-Troll:Best Regards!'"; query_sql"CREATE TABLE IF NOT EXISTS `ragnarok`.`gift_box` (`serial` varchar(10) NOT NULL DEFAULT '',`sender` varchar(26) NOT NULL DEFAULT '',`account_id` int(11) unsigned NOT NULL default '0',`time_created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',`reciever` varchar(25) NOT NULL DEFAULT '',`message` varchar(25) NOT NULL DEFAULT '',`item_id` INT( 6 ) NOT NULL DEFAULT '0',`card1` INT( 6 ) NOT NULL DEFAULT '0',`card3` INT( 6 ) NOT NULL DEFAULT '0',`card4` INT( 6 ) NOT NULL DEFAULT '0', PRIMARY KEY (`serial`)) ENGINE = MYISAM COMMENT = 'Lil-Troll:Best Regards!'"; bindatcmd"gift", strnpcinfo(3)+"::OnGift"; bindatcmd"GIFT", strnpcinfo(3)+"::OnGift"; bindatcmd"Gift", strnpcinfo(3)+"::OnGift";waitingroom"Gift Wrapper",0;end;OnGift:if(countitem(.gb)<1){dispbottom"No gift box in your inventory.";end;}mes"[ ^ff0000Gift Box^000000 ]";mes"^005500Input Serial:^000000";input .@g$;query_sql"SELECT `sender`,`item_id`,`account_id`,`refine`,`card1`,`card2`,`card3`,`card4` FROM `ragnarok`.`gift_sys` WHERE `serial` = '"+escape_sql(.@g$)+"'",.@b$,.@c,.@a,.@d,.@e,.@f,.@g,.@h;query_sql"SELECT `sender`,`reciever`,`message`,`account_id`,`item_id`,`card1`,`card3`,`card4` FROM `ragnarok`.`gift_box` WHERE `serial` = '"+escape_sql(.@g$)+"'",.@nm$,.@rm$,.@mm$,.@aa,.@bb,.@cc,.@dd,.@ee;if(!.@c ){mes"^3b3b3bWrong serial or non-existing.^000000";close;}mes"SN: ^00007f"+.@g$+"^000000";mes"^55007fEnter the name of the Sender:^000000";input .@n$;if( .@n$ != .@b$ ){mes"^^3b3b3bWrong sender's name(Case Sensitive)!^000000";close;}mes"Sender: ^ad7300"+.@n$+"^000000";mes"^00afafOpening the gift!^000000";next;mes"[ ^ff0000Gift Box^000000 ]";mes"From : ^ff0000"+.@nm$+"^000000";mes"Dear : ^0000ff"+.@rm$+"^000000";mes""+.@mm$+"";progressbar"ffff00",3;close2;dispbottom"[ ^ff0000Gift Box^000000 ]";dispbottom"From : ^ff0000"+.@nm$+"^000000";dispbottom"Dear : ^0000ff"+.@rm$+"^000000";dispbottom""+.@mm$+"";getitem2 .@c,1,1,.@d,0,.@e,.@f,.@g,.@h,.@a;delitem2 .@bb,1,1,0,0,.@cc,0,.@dd,.@ee,.@aa;query_sql"DELETE FROM `gift_sys` WHERE `serial` = '"+escape_sql(.@g$)+"'";query_sql"DELETE FROM `gift_box` WHERE `serial` = '"+escape_sql(.@g$)+"'";specialeffect2509; specialeffect2709; sleep21000;specialeffect2509; specialeffect2709; sleep21000;specialeffect2509; specialeffect2709; sleep21000;specialeffect2509; specialeffect2709; sleep21000;specialeffect2509; specialeffect2709;end; // ENDS : Claim Gift}// ENDS : Gift Packager NPC//----------------------DONT CHANGE ANYTHING ABOVE THIS POINT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//----------------------DONT CHANGE ANYTHING ABOVE THIS POINT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//----------------------DONT CHANGE ANYTHING ABOVE THIS POINT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//----------------------DONT CHANGE ANYTHING ABOVE THIS POINT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//----------------------DONT CHANGE ANYTHING ABOVE THIS POINT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------