<waypoints type="TRAVEL"><!-- Tier_Maker v1.1.5 by Bot_romka -->

	<onLoad>
		-- Names table of Fusion Stones with stats Receivers on same account.
		StonesReceiver = {"Charetovi",	-- 1. Stamina I and Stamina I + ( Strength I or Dexterity I or Intellect I )
						"Charetovu",	-- 2. Stamina I + ( Spirit I or Ability I or Element I )
						"Charetove",	-- 3. Stamina I + ( Earth I or Mist I or Flame I)
						"Charetove",	-- 4. Stamina I + ( Whiff I or Light I or Dark I )
						"Charetove",	-- 5. Stamina I + ( Energy I or Command I or Life I )
						"Charetove",	-- 6. Stamina I + ( Spell I or Barricade I or Solidity I )
						};								<!-- Names table of Stone with stats Receivers. -->
						
		ThreeStatReceiver = "Charnica"					<!-- Name of Stone with Three stat receiver -->

		-- Stats tables for send.
			-- 0 Stamina I
		StatsTables0 = {510360}
			-- 1 Stamina I + ( Strength I, Dexterity I, Intellect I),
		StatsTables1 = { {510360, 510380}, {510360, 510060}, {510360, 510320}, };
			-- 2 Stamina I + Spirit I, Ability I, Element I ,
		StatsTables2 = { {510360, 510340}, {510360, 510300}, {510360, 510560}, };
			-- 3 Stamina I + ( Earth I, Mist I, Flame I),
		StatsTables3 = { {510360, 510500}, {510360, 510440}, {510360, 510460}, };
			-- 4 Stamina I + ( Whiff I, Light I, Dark I ),
		StatsTables4 = { {510360, 510520}, {510360, 510480}, {510360, 510540}, };
			-- 5 Stamina I + ( Energy I, Command I, Life I ),
		StatsTables5 = { {510360, 510400}, {510360, 510100}, {510360, 510020}, };
			-- 6 Stamina I + ( Spell I, Barricade I, Solidity I ),
		StatsTables6 = { {510360, 510040}, {510360, 510420}, {510360, 510120}, };
		
		--=====functions=====--
		RecipientMailFullString = getTEXT("SYS_SENDMAIL_TARGET_MAILFULL");
		BotsendedFusionstone = 0;
		Presendeditems = 0;

		function CheckBotsendedFusionstone(_check)
			if _check  then
				BotsendedFusionstone = inventory:getItemCount(0) - Presendeditems
				Presendeditems = 0
			else
				Presendeditems = inventory:getItemCount(0)
			end
		end;
	</onLoad>
		
<!-- Auto FusionStoneSender. Varanas. Odeley Prole -->	
<!-- #  1 --><waypoint x="2708" z="-1643" y="53" tag="MassBuyFusionStones">
		local Cur_Gold = RoMScript("GetPlayerMoney('copper');");
		if( 5643 > Cur_Gold ) then
			printf("\a\a\a\a\a\a\a Error. GOLD WARNING!");
		end;

		-- Buy Fusion Stones
		player:openStore(110576); yrest(500);							-- Odeley Prole
		store:buyItem(203001, inventory:getItemCount(0));				-- Камень соединения с Выностливость и двумя произвольными
		RoMScript("CloseWindows()"); inventory:update();

		-- Error if not receive Random Fusion Stone
		local Cur_Gold = RoMScript("GetPlayerMoney('copper');");
		if( 1 > inventory:getItemCount(203001) and Cur_Gold >= 5643) then    
			__WPL:setWaypointIndex(__WPL:findWaypointTag("MassBuyFusionStones"));
		end;
	</waypoint>
	<!-- #  2 --><waypoint x="2664" z="-1594" y="53">	</waypoint>
	<!-- #  3 --><waypoint x="2558" z="-1477" y="53">	</waypoint>
	<!-- #  4 --><waypoint x="2506" z="-1420" y="53" tag="ToGuildHouse">
		player:target_NPC(111621); yrest(500);							-- Управляющий замками гильдий
		ChoiceOptionByName(getTEXT("SC_GUILDHOUSE_01")); yrest(500);	-- 'Я хочю войти в замок гильдии.'
		waitForLoadingScreen(30);
		player:update();
		__WPL:setWaypointIndex(__WPL:getNearestWaypoint(player.X, player.Z));
	</waypoint>
	<!-- #  5 --><waypoint x="0" z="-485" y="5" tag="Guild">	</waypoint>
	<!-- #  6 --><waypoint x="-6" z="-322" y="5">	</waypoint>
	<!-- #  7 --><waypoint x="-6" z="-315" y="5">	</waypoint>
	<!-- #  8 --><waypoint x="-14" z="-125" y="5" tag="GuildFortressGate">
		-- Check Main Fortress Gate
		local success = player:moveTo(CWaypoint(-22,93),true);
		if success == false then
			player:moveTo(CWaypoint(-14,-125),true);
			player:target_Object(111577);								-- Main Fortress Gate
			yrest(3000);
		end
	</waypoint>
	<!-- #  9 --><waypoint x="-22" z="93" y="7">	</waypoint>
	<!-- # 10 --><waypoint x="-31" z="313" y="7">	</waypoint>
	<!-- # 11 --><waypoint x="-39" z="506" y="7">	</waypoint>
	<!-- # 12 --><waypoint x="-43" z="615" y="7" tag="GuildFortressMailbox">
		-- Open Mailbox
		player:target_Object(113043); yrest(500);						-- Почтовый ящик гильдии
		RoMScript("ChoiceOption(1);"); yrest(1000);
		-- Send Stones
		local start = os.clock()
		CheckBotsendedFusionstone()
		UMM_SendFusionStones(StonesReceiver[1], 203001, StatsTables0)	-- Одностатные Камни соединения
		UMM_SendFusionStones(StonesReceiver[1], 203001, StatsTables1)	-- Двухстатные Камни соединения
		UMM_SendFusionStones(StonesReceiver[2], 203001, StatsTables2)	-- Двухстатные Камни соединения
		UMM_SendFusionStones(StonesReceiver[3], 203001, StatsTables3)	-- Двухстатные Камни соединения
		UMM_SendFusionStones(StonesReceiver[4], 203001, StatsTables4)	-- Двухстатные Камни соединения
		UMM_SendFusionStones(StonesReceiver[5], 203001, StatsTables5)	-- Двухстатные Камни соединения
		UMM_SendFusionStones(StonesReceiver[6], 203001, StatsTables6)	-- Двухстатные Камни соединения
		UMM_SendByStatNumber(ThreeStatReceiver, 3)						-- Трехстатные Камни соединения
		RoMScript("CloseWindows()");
		inventory:update();

		CheckBotsendedFusionstone(true)
		local Cur_Gold = RoMScript("GetPlayerMoney('copper');");
		printf("Sended Fusion Stones: %s, Cur_Gold: %s.\n", BotsendedFusionstone, Cur_Gold);

		if getLastWarning(RecipientMailFullString, os.clock()-start) or 145144 > Cur_Gold then
			error("Error sended Fusion stone!")
		else
			local timer = os.clock()
			repeat
				RoMScript("CloseWindows()"); yrest(500);
				player:target_NPC(112588); yrest(500);						-- Горничная замка гильдии
			until RoMScript("SpeakFrame:IsVisible()") or (os.clock() - timer) > 60
			local timer = os.clock();
			repeat
				ChoiceOptionByName(getTEXT("SC_GUILDGIRL_P1_03"));			-- 'Я хочю покинуть замок гильдии'
				yrest(1000);
			until RoMScript("StaticPopup1:IsVisible()") or (os.clock() - timer) > 60
			AcceptPopup(StaticPopup1, 1);
			waitForLoadingScreen(30);
		end
	</waypoint>
	<!-- # 13 --><waypoint x="2560" z="-1480" y="53">	</waypoint>
	<!-- # 14 --><waypoint x="2621" z="-1547" y="53">	</waypoint>
	<!-- # 15 --><waypoint x="2708" z="-1645" y="53">
		__WPL:setWaypointIndex(__WPL:findWaypointTag("MassBuyFusionStones"))
	</waypoint>
</waypoints>