//===== rAthena Script =======================================
//= Pet Trader NPC
//===== Description: =========================================
//= [Walkthrough Conversion]
//= Exchanges Cute Pet Tickets for Pet Eggs.
//===== Additional Comments: =================================
//= 1.0 First version [Latiosu]
//============================================================

prontera,210,209,5	script	Pet Trader#1	4_M_JPNOJI,{
	disable_items;
	mes "[Pet Trader]";
	mes "Making a living through business ain't easy.";
	mes "I get real bad motion sickness, yet today I got caught up in a storm on my way here.";
	next;
	mes "[Pet Trader]";
	mes "It was such a horrible experience. Thanks to that, I don't feel so good. Ughh...";
	next;
	mes "[Pet Trader]";
	mes "Anyway, did you come here looking for a Cute Pet?";
	mes "You've brought a ticket with you, right?";
	next;
	switch (select("Examine your tickets:Cancel")) {
	case 1:
		setarray .@tickets,
			6116, //Succu_Pet_Coupon
			6117, //Imp_Pet_Coupon
			6118, //Chung_E_Pet_Coupon
			6129, //Ticket_Nightmare
			6130, //Ticket_Loli_Ruri
			6131, //Ticket_Goblin_Leader
			6132, //Ticket_Incubus
			6133, //Ticket_Miyabi_Ningyo
			6134, //Ticket_Whisper
			6135, //Ticket_Wicked_Nymph
			6136, //Ticket_Medusa
			6137, //Ticket_Stoneshooter
			6138, //Ticket_Marionette
			6139, //Ticket_Leafcat
			6140, //Ticket_Dullahan
			6141, //Ticket_Shinobi
			6142, //Ticket_Golem
			6143, //Ticket_Civil_Servant
			6157, //Poring_Ticket
			6158, //Drops_Ticket
			6159, //Poporing_Ticket
			6160, //Lunatic_Ticket
			6161, //Picky_Ticket
			6162, //Pecopeco_Ticket
			6163, //Savage_Baby_Ticket
			6164, //Spore_Ticket
			6165, //Poison_Spore_Ticket
			6166, //Chonchon_Ticket
			6167, //Steel_Chonchon_Ticket
			6168, //Petit_Ticket
			6169, //Deviruchi_Ticket
			6170, //Isis_Ticket
			6171, //Smokie_Ticket
			6172, //Dokebi_Ticket
			6173, //Desert_Wolf_B_Ticket
			6174, //Yoyo_Ticket
			6175, //Sohee_Ticket
			6176, //Rocker_Ticket
			6177, //Hunter_Fly_Ticket
			6178, //Orc_Warrior_Ticket
			6179, //Bapho_Jr_Ticket
			6180, //Munak_Ticket
			6181, //Bongun_Ticket
			6182, //Goblin_Ticket
			6183, //Hardtack_Ticket
			6184, //Zherlthsh_Ticket
			6185, //Alice_Ticket
			6883, //Pet_Snow_Bunny_Ticket
			6884; //Pet_Tikbalang_Ticket
		setarray .@eggs,
			9055, //Succubus_Egg
			9056, //Imp_Egg
			9030, //Chung_E_Egg
			9054, //Nightmare_Terror_Egg
			9042, //Loli_Ruri_Egg
			9046, //Goblin_Leader_Egg
			9052, //Incubus_Egg
			9048, //Miyabi_Ningyo_Egg
			9045, //Whisper_Egg
			9047, //Wicked_Nymph_Egg
			9050, //Medusa_Egg
			9051, //Stone_Shooter_Egg
			9043, //Marionette_Egg
			9041, //Leaf_Cat_Egg
			9049, //Dullahan_Egg
			9044, //Shinobi_Egg
			9053, //Golem_Egg
			9040, //Civil_Servant_Egg
			9001, //Poring_Egg
			9002, //Drops_Egg
			9003, //Poporing_Egg
			9004, //Lunatic_Egg
			9005, //Picky_Egg
			9014, //PecoPeco_Egg
			9009, //Savage_Bebe_Egg
			9012, //Spore_Egg
			9013, //Poison_Spore_Egg
			9006, //Chonchon_Egg
			9007, //Steel_Chonchon_Egg
			9022, //Green_Petite_Egg
			9023, //Deviruchi_Egg
			9021, //Isis_Egg
			9015, //Smokie_Egg
			9019, //Dokkaebi_Egg
			9010, //Baby_Desert_Wolf_Egg
			9016, //Yoyo_Egg
			9020, //Sohee_Egg
			9011, //Rocker_Egg
			9008, //Hunter_Fly_Egg
			9017, //Orc_Warrior_Egg
			9024, //Bapho_Jr
			9018, //Munak_Egg
			9025, //Bongun_Egg
			9029, //Santa_Goblin_Egg
			9028, //Rice_Cake_Egg
			9026, //Zherlthsh_Egg
			9027, //Alice_Egg
			9058, //Snow_Rabbit_Egg
			9059; //Tikbalang_Pet
		for (.@i = 0; .@i < getarraysize(.@tickets); .@i++) {
			if (countitem(.@tickets[.@i]) > 0) {
				.@menu$ += getitemname(.@tickets[.@i]) + ":";
				.@ticketIndices[.@count++] = .@i;
			}
		}

		if (.@count == 0) {
			mes "[Pet Trader]";
			mes "I don't think you've got the stuff I want.";
			close;
		}

		mes "[Pet Trader]";
		mes "Which ticket do you want to exchange?";
		next;
		.@index = .@ticketIndices[select(.@menu$) - 1];

		mes "[Pet Trader]";
		mes "Great!";
		mes "^0000FF"+ getitemname(.@eggs[.@index]) +"^000000";
		mes "Are you sure you want this pet?";
		next;
		if (select("Yes:No") == 2) close;
		if (!checkweight(.@eggs[.@index], 1)) {
			mes "You're carrying too much stuff!";
			mes "Come back when you've made some space.";
			close;
		}

		mes "[Pet Trader]";
		mes "Here's your pet~";
		delitem .@tickets[.@index], 1;
		getitem .@eggs[.@index], 1;
		close;
	case 2:
		mes "[Pet Trader]";
		mes "So you want hear about the land across the sea, but I ain't feeling so well today.";
		close;
	}
	end;
}

// Duplicate NPCs
alberta,179,141,5	duplicate(Pet Trader#1)	Pet Trader#2	4_M_JPNOJI
