Перейти к содержанию
Авторизация  
VIPxAnGeL

Рецепты

Рекомендуемые сообщения

Нашёл мануал по созданию своего рецепта

Скачал сборку револьт тима..но в папке дата не было файла recipes

Где он может быть у этой команды?

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Сделай проще типа сундука нажал и получил итем из шансом вот пример скрипта:

Скрытый текст
	package handlers;

import java.util.HashMap;
import java.util.Map;

import ru.catssoftware.gameserver.handler.IItemHandler;
import ru.catssoftware.gameserver.handler.ItemHandler;
import ru.catssoftware.gameserver.model.L2ItemInstance;
import ru.catssoftware.gameserver.model.actor.instance.L2PcInstance;
import ru.catssoftware.gameserver.model.actor.instance.L2PlayableInstance;
import ru.catssoftware.tools.random.Rnd;
import ru.catssoftware.util.ArrayUtils;

public class RandomReward implements IItemHandler {

		private class Reward {
				private int [] items;
				private int [] counts;
				private int [] chances;
				public Reward(int [] _items, int[] _counts, int [] _chances) {
						items = _items;
						counts = _counts;
						chances = _chances;
				}
		}
		private Map<Integer, Reward>  _rewards = new HashMap<Integer, Reward>();

		private RandomReward() {
				// Добавляем атем
		//		   ИД предмета, который будет распакован			награды		   количества			шансы					  
				_rewards.put(4037,new Reward(new int [] {6579,6673,6577,7575,}, new int [] {1,1,1,1}, new int[] {2,99,2,2}));
		}
		@Override
		public int[] getItemIds() {
				int [] ids = null;
				for (int i : _rewards.keySet())
						ids = ArrayUtils.add(ids, i);
				return ids;
		}

		@Override
		public void useItem(L2PlayableInstance cha, L2ItemInstance item) {
				L2PcInstance player = cha.getActingPlayer();
				if(player==null)
						return;
				Reward reward  =_rewards.get(item.getItemId());
				if(reward==null)
						return;
				// Уничтожаем распаковываемый предмет
				cha.getInventory().destroyItemByItemId("use", item.getItemId(), 1, player, null);
				// Идем по списку наград
				for (int i=0;i<reward.items.length;i++) {
						// Если шанс нужный
						if(Rnd.get(100)<reward.chances[i]) {
								// Считаем количество.
								int count = Rnd.get(reward.counts[i]);
								// Если хотите что бы падал всегда то раскоментарьте строку ниже
								if (count==0) count =1;
								if(count>0)
										// Выдаем награду. Если сбой - то прекращаем
										if(!player.addItem("reward", reward.items[i], count, null, true))
												return;
						}
				}
		}

		@Override
		public void useItem(L2PlayableInstance arg0, L2ItemInstance arg1,
						boolean arg2) {
		}
		public static void main(String [] args) {
				ItemHandler.getInstance().registerItemHandler(new RandomReward());
		}

}

или же 2 скрипт

Скрытый текст
package handlers;

import java.util.HashMap;
import java.util.Map;

import ru.catssoftware.gameserver.handler.IItemHandler;
import ru.catssoftware.gameserver.handler.ItemHandler;
import ru.catssoftware.gameserver.model.L2ItemInstance;
import ru.catssoftware.gameserver.model.actor.instance.L2PcInstance;
import ru.catssoftware.gameserver.model.actor.instance.L2PlayableInstance;
import ru.catssoftware.tools.random.Rnd;
import ru.catssoftware.util.ArrayUtils;

public class RandomReward implements IItemHandler {

	private class Reward {
			private int [] items;
			private int [] counts;
			public Reward(int [] _items, int[] _counts, int [] _chances) {
					items = _items;
					counts = _counts;
					chances;
			}
	}
	private Map<Integer, Reward>  _rewards = new HashMap<Integer, Reward>();

	private RandomReward() {
			// Добавляем атем
	//		   ИД предмета, который будет распакован			награды		   количества			шансы					  
			_rewards.put(10090,new Reward(new int [] {1341}, new int [] {1000}, new int[] {100}));
			_rewards.put(10091,new Reward(new int [] {1342}, new int [] {1000}, new int[] {100}));
			_rewards.put(10092,new Reward(new int [] {1343}, new int [] {1000}, new int[] {100}));
			_rewards.put(10093,new Reward(new int [] {1344}, new int [] {1000}, new int[] {100}));
			_rewards.put(10094,new Reward(new int [] {1345}, new int [] {1000}, new int[] {100}));
			_rewards.put(10095,new Reward(new int [] {6645}, new int [] {1000}, new int[] {100}));
			_rewards.put(10096,new Reward(new int [] {6646}, new int [] {1000}, new int[] {100}));
			_rewards.put(10097,new Reward(new int [] {6647}, new int [] {1000}, new int[] {100}));
			_rewards.put(10006,new Reward(new int [] {10075}, new int [] {10}, new int[] {100}));
			_rewards.put(10007,new Reward(new int [] {10079}, new int [] {10}, new int[] {100}));
			_rewards.put(10008,new Reward(new int [] {10076}, new int [] {10}, new int[] {100}));
			_rewards.put(10009,new Reward(new int [] {10085}, new int [] {10}, new int[] {100}));
			_rewards.put(10010,new Reward(new int [] {10078}, new int [] {10}, new int[] {100}));
			_rewards.put(10011,new Reward(new int [] {10072}, new int [] {10}, new int[] {100}));
			_rewards.put(10012,new Reward(new int [] {10089}, new int [] {10}, new int[] {100}));
			_rewards.put(10013,new Reward(new int [] {10076}, new int [] {10}, new int[] {100}));
			_rewards.put(10014,new Reward(new int [] {10075}, new int [] {10}, new int[] {100}));
			_rewards.put(10015,new Reward(new int [] {10078}, new int [] {10}, new int[] {100}));
			_rewards.put(10016,new Reward(new int [] {10084}, new int [] {10}, new int[] {100}));
			_rewards.put(10017,new Reward(new int [] {10077}, new int [] {10}, new int[] {100}));
			_rewards.put(10018,new Reward(new int [] {10078}, new int [] {10}, new int[] {100}));
			_rewards.put(10019,new Reward(new int [] {10080}, new int [] {10}, new int[] {100}));
			_rewards.put(10020,new Reward(new int [] {10069}, new int [] {10}, new int[] {100}));
			_rewards.put(10021,new Reward(new int [] {10089}, new int [] {10}, new int[] {100}));
			_rewards.put(10022,new Reward(new int [] {10071}, new int [] {10}, new int[] {100}));
			_rewards.put(10023,new Reward(new int [] {10078}, new int [] {10}, new int[] {100}));
			_rewards.put(10024,new Reward(new int [] {10081}, new int [] {10}, new int[] {100}));
			_rewards.put(10025,new Reward(new int [] {10080}, new int [] {10}, new int[] {100}));
			_rewards.put(10026,new Reward(new int [] {10076}, new int [] {10}, new int[] {100}));
			_rewards.put(10027,new Reward(new int [] {10086}, new int [] {10}, new int[] {100}));
			_rewards.put(10028,new Reward(new int [] {10089}, new int [] {10}, new int[] {100}));
			_rewards.put(10029,new Reward(new int [] {10076}, new int [] {10}, new int[] {100}));
			_rewards.put(10030,new Reward(new int [] {10088}, new int [] {10}, new int[] {100}));
			_rewards.put(10031,new Reward(new int [] {10069}, new int [] {10}, new int[] {100}));
			_rewards.put(10032,new Reward(new int [] {10070}, new int [] {10}, new int[] {100}));
			_rewards.put(10033,new Reward(new int [] {10080}, new int [] {10}, new int[] {100}));
			_rewards.put(10034,new Reward(new int [] {10075}, new int [] {10}, new int[] {100}));
			_rewards.put(10035,new Reward(new int [] {10079}, new int [] {10}, new int[] {100}));
			_rewards.put(10036,new Reward(new int [] {10078}, new int [] {10}, new int[] {100}));
			_rewards.put(10037,new Reward(new int [] {10089}, new int [] {10}, new int[] {100}));
			_rewards.put(10038,new Reward(new int [] {10076}, new int [] {10}, new int[] {100}));
			_rewards.put(10039,new Reward(new int [] {10076}, new int [] {10}, new int[] {100}));
			_rewards.put(10040,new Reward(new int [] {10089}, new int [] {10}, new int[] {100}));
			_rewards.put(10041,new Reward(new int [] {10071}, new int [] {10}, new int[] {100}));
			_rewards.put(10042,new Reward(new int [] {10089}, new int [] {10}, new int[] {100}));
			_rewards.put(10043,new Reward(new int [] {10083}, new int [] {10}, new int[] {100}));
			_rewards.put(10044,new Reward(new int [] {10073}, new int [] {10}, new int[] {100}));
			_rewards.put(10045,new Reward(new int [] {10082}, new int [] {10}, new int[] {100}));
			_rewards.put(10046,new Reward(new int [] {10073}, new int [] {10}, new int[] {100}));
			_rewards.put(10047,new Reward(new int [] {10077}, new int [] {10}, new int[] {100}));
			_rewards.put(10048,new Reward(new int [] {10080}, new int [] {10}, new int[] {100}));
			_rewards.put(10049,new Reward(new int [] {10075}, new int [] {10}, new int[] {100}));
			_rewards.put(10050,new Reward(new int [] {10087}, new int [] {10}, new int[] {100}));
			_rewards.put(10051,new Reward(new int [] {10089}, new int [] {10}, new int[] {100}));
			_rewards.put(10052,new Reward(new int [] {10074}, new int [] {10}, new int[] {100}));
			_rewards.put(10053,new Reward(new int [] {10071}, new int [] {10}, new int[] {100}));
			_rewards.put(10054,new Reward(new int [] {10079}, new int [] {10}, new int[] {100}));
			_rewards.put(10222,new Reward(new int [] {10065,10066,10067}, new int [] {1,1,1}, new int[] {33,33,34}));
			_rewards.put(10172,new Reward(new int [] {10098,10099,10100,10101,10102}, new int [] {1,1,1,1,1}, new int[] {20,20,20,20,20}));
			_rewards.put(10192,new Reward(new int [] {10208}, new int [] {3}, new int[] {100}));
			_rewards.put(10193,new Reward(new int [] {10192}, new int [] {10}, new int[] {100}));
			_rewards.put(10208,new Reward(new int [] {10173,10174,10175,10176,10177,10178,10179,10180,10181,10182,1870,1869,1880}, new int [] {1,1,1,1,1,1,1,1,1,1,10,10,10}, new int[] {1,1,1,1,1,1,1,1,1,1,30,30,30}));
			_rewards.put(10335,new Reward(new int [] {6364,6364,10231,10231,10232,10233,10234}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10336,new Reward(new int [] {6365,6365,10235,10235,10236,10237,10238}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10337,new Reward(new int [] {6366,6366,10239,10239,10240,10241,10242}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10338,new Reward(new int [] {6367,6367,10243,10243,10244,10245,10246}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10339,new Reward(new int [] {6368,6368,10247,10247,10248,10249,10250}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10340,new Reward(new int [] {6369,6369,10251,10251,10252,10253,10254}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10341,new Reward(new int [] {6370,6370,10255,10255,10256,10257,10258}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10342,new Reward(new int [] {6371,6371,10259,10259,10260,10261,10262}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10343,new Reward(new int [] {6372,6372,10263,10263,10264,10265,10266}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10344,new Reward(new int [] {6579,6579,10363,10363,10364,10365,10366}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10345,new Reward(new int [] {7575,7575,10367,10367,10368,10369,10370}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10346,new Reward(new int [] {80,80,10267,10267,10268,10269,10270}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10347,new Reward(new int [] {2500,2500,10271,10271,10272,10273,10274}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10348,new Reward(new int [] {235,235,10275,10275,10276,10277,10278}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10349,new Reward(new int [] {236,236,10279,10279,10280,10281,10282}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10350,new Reward(new int [] {269,269,10283,10283,10284,10285,10286}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10351,new Reward(new int [] {270,270,10287,10287,10288,10289,10290}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10352,new Reward(new int [] {288,288,10291,10291,10292,10293,10294}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10353,new Reward(new int [] {289,289,10295,10295,10296,10297,10298}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10354,new Reward(new int [] {98,98,10299,10299,10300,10301,10302}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10355,new Reward(new int [] {305,305,10303,10303,10304,10305,10306}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10356,new Reward(new int [] {2504,2504,10307,10307,10308,10309,10310}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10357,new Reward(new int [] {164,164,10311,10311,13012,13013,10314}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10358,new Reward(new int [] {150,150,10315,10315,10316,13017,10318}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10359,new Reward(new int [] {151,151,10319,10319,10320,10321,13022}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10360,new Reward(new int [] {212,212,10323,10323,10324,10325,10326}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10361,new Reward(new int [] {213,213,10327,10327,10328,10329,10330}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10362,new Reward(new int [] {81,81,10331,13031,10332,10333,10334}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
	}
	@Override
	public int[] getItemIds() {
			int [] ids = null;
			for (int i : _rewards.keySet())
					ids = ArrayUtils.add(ids, i);
			return ids;
	}

	@Override
	public void useItem(L2PlayableInstance cha, L2ItemInstance item) {
			L2PcInstance player = cha.getActingPlayer();
			if(player==null)
					return;
			Reward reward  =_rewards.get(item.getItemId());
			if(reward==null)
					return;
			// Уничтожаем распаковываемый предмет
			cha.getInventory().destroyItemByItemId("use", item.getItemId(), 1, player, null);

			// кароче, хуйня такая, берем массив, потом типо рандомазируем и то что рандомнетцо то и даём блеать
			// и еще, уже указывается в блядо награде, чо по чом.
			int i = Rnd.get(reward.items.length-1); //пиздим блядодлинну массива + и чтоже мы выиграли ебать
							// Считаем количество.
							int count = reward.counts[i]; // тут был Rnd.get
							// Если хотите что бы падал всегда то раскоментарьте строку ниже
									// Выдаем награду. Если сбой - то прекращаем
									if(!player.addItem("reward", reward.items[i], count, null, true))
											return;
	}

	@Override
	public void useItem(L2PlayableInstance arg0, L2ItemInstance arg1,
					boolean arg2) {
	}
	public static void main(String [] args) {
			ItemHandler.getInstance().registerItemHandler(new RandomReward());
	}

}

Изменено пользователем AlexMan

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
Сделай проще типа сундука нажал и получил итем из шансом вот пример скрипта:

Скрытый текст
	package handlers;

import java.util.HashMap;
import java.util.Map;

import ru.catssoftware.gameserver.handler.IItemHandler;
import ru.catssoftware.gameserver.handler.ItemHandler;
import ru.catssoftware.gameserver.model.L2ItemInstance;
import ru.catssoftware.gameserver.model.actor.instance.L2PcInstance;
import ru.catssoftware.gameserver.model.actor.instance.L2PlayableInstance;
import ru.catssoftware.tools.random.Rnd;
import ru.catssoftware.util.ArrayUtils;

public class RandomReward implements IItemHandler {

		private class Reward {
				private int [] items;
				private int [] counts;
				private int [] chances;
				public Reward(int [] _items, int[] _counts, int [] _chances) {
						items = _items;
						counts = _counts;
						chances = _chances;
				}
		}
		private Map<Integer, Reward>  _rewards = new HashMap<Integer, Reward>();

		private RandomReward() {
				// Добавляем атем
		//		   ИД предмета, который будет распакован			награды		   количества			шансы					  
				_rewards.put(4037,new Reward(new int [] {6579,6673,6577,7575,}, new int [] {1,1,1,1}, new int[] {2,99,2,2}));
		}
		@Override
		public int[] getItemIds() {
				int [] ids = null;
				for (int i : _rewards.keySet())
						ids = ArrayUtils.add(ids, i);
				return ids;
		}

		@Override
		public void useItem(L2PlayableInstance cha, L2ItemInstance item) {
				L2PcInstance player = cha.getActingPlayer();
				if(player==null)
						return;
				Reward reward  =_rewards.get(item.getItemId());
				if(reward==null)
						return;
				// Уничтожаем распаковываемый предмет
				cha.getInventory().destroyItemByItemId("use", item.getItemId(), 1, player, null);
				// Идем по списку наград
				for (int i=0;i<reward.items.length;i++) {
						// Если шанс нужный
						if(Rnd.get(100)<reward.chances[i]) {
								// Считаем количество.
								int count = Rnd.get(reward.counts[i]);
								// Если хотите что бы падал всегда то раскоментарьте строку ниже
								if (count==0) count =1;
								if(count>0)
										// Выдаем награду. Если сбой - то прекращаем
										if(!player.addItem("reward", reward.items[i], count, null, true))
												return;
						}
				}
		}

		@Override
		public void useItem(L2PlayableInstance arg0, L2ItemInstance arg1,
						boolean arg2) {
		}
		public static void main(String [] args) {
				ItemHandler.getInstance().registerItemHandler(new RandomReward());
		}

}

или же 2 скрипт

Скрытый текст
package handlers;

import java.util.HashMap;
import java.util.Map;

import ru.catssoftware.gameserver.handler.IItemHandler;
import ru.catssoftware.gameserver.handler.ItemHandler;
import ru.catssoftware.gameserver.model.L2ItemInstance;
import ru.catssoftware.gameserver.model.actor.instance.L2PcInstance;
import ru.catssoftware.gameserver.model.actor.instance.L2PlayableInstance;
import ru.catssoftware.tools.random.Rnd;
import ru.catssoftware.util.ArrayUtils;

public class RandomReward implements IItemHandler {

	private class Reward {
			private int [] items;
			private int [] counts;
			public Reward(int [] _items, int[] _counts, int [] _chances) {
					items = _items;
					counts = _counts;
					chances;
			}
	}
	private Map<Integer, Reward>  _rewards = new HashMap<Integer, Reward>();

	private RandomReward() {
			// Добавляем атем
	//		   ИД предмета, который будет распакован			награды		   количества			шансы					  
			_rewards.put(10090,new Reward(new int [] {1341}, new int [] {1000}, new int[] {100}));
			_rewards.put(10091,new Reward(new int [] {1342}, new int [] {1000}, new int[] {100}));
			_rewards.put(10092,new Reward(new int [] {1343}, new int [] {1000}, new int[] {100}));
			_rewards.put(10093,new Reward(new int [] {1344}, new int [] {1000}, new int[] {100}));
			_rewards.put(10094,new Reward(new int [] {1345}, new int [] {1000}, new int[] {100}));
			_rewards.put(10095,new Reward(new int [] {6645}, new int [] {1000}, new int[] {100}));
			_rewards.put(10096,new Reward(new int [] {6646}, new int [] {1000}, new int[] {100}));
			_rewards.put(10097,new Reward(new int [] {6647}, new int [] {1000}, new int[] {100}));
			_rewards.put(10006,new Reward(new int [] {10075}, new int [] {10}, new int[] {100}));
			_rewards.put(10007,new Reward(new int [] {10079}, new int [] {10}, new int[] {100}));
			_rewards.put(10008,new Reward(new int [] {10076}, new int [] {10}, new int[] {100}));
			_rewards.put(10009,new Reward(new int [] {10085}, new int [] {10}, new int[] {100}));
			_rewards.put(10010,new Reward(new int [] {10078}, new int [] {10}, new int[] {100}));
			_rewards.put(10011,new Reward(new int [] {10072}, new int [] {10}, new int[] {100}));
			_rewards.put(10012,new Reward(new int [] {10089}, new int [] {10}, new int[] {100}));
			_rewards.put(10013,new Reward(new int [] {10076}, new int [] {10}, new int[] {100}));
			_rewards.put(10014,new Reward(new int [] {10075}, new int [] {10}, new int[] {100}));
			_rewards.put(10015,new Reward(new int [] {10078}, new int [] {10}, new int[] {100}));
			_rewards.put(10016,new Reward(new int [] {10084}, new int [] {10}, new int[] {100}));
			_rewards.put(10017,new Reward(new int [] {10077}, new int [] {10}, new int[] {100}));
			_rewards.put(10018,new Reward(new int [] {10078}, new int [] {10}, new int[] {100}));
			_rewards.put(10019,new Reward(new int [] {10080}, new int [] {10}, new int[] {100}));
			_rewards.put(10020,new Reward(new int [] {10069}, new int [] {10}, new int[] {100}));
			_rewards.put(10021,new Reward(new int [] {10089}, new int [] {10}, new int[] {100}));
			_rewards.put(10022,new Reward(new int [] {10071}, new int [] {10}, new int[] {100}));
			_rewards.put(10023,new Reward(new int [] {10078}, new int [] {10}, new int[] {100}));
			_rewards.put(10024,new Reward(new int [] {10081}, new int [] {10}, new int[] {100}));
			_rewards.put(10025,new Reward(new int [] {10080}, new int [] {10}, new int[] {100}));
			_rewards.put(10026,new Reward(new int [] {10076}, new int [] {10}, new int[] {100}));
			_rewards.put(10027,new Reward(new int [] {10086}, new int [] {10}, new int[] {100}));
			_rewards.put(10028,new Reward(new int [] {10089}, new int [] {10}, new int[] {100}));
			_rewards.put(10029,new Reward(new int [] {10076}, new int [] {10}, new int[] {100}));
			_rewards.put(10030,new Reward(new int [] {10088}, new int [] {10}, new int[] {100}));
			_rewards.put(10031,new Reward(new int [] {10069}, new int [] {10}, new int[] {100}));
			_rewards.put(10032,new Reward(new int [] {10070}, new int [] {10}, new int[] {100}));
			_rewards.put(10033,new Reward(new int [] {10080}, new int [] {10}, new int[] {100}));
			_rewards.put(10034,new Reward(new int [] {10075}, new int [] {10}, new int[] {100}));
			_rewards.put(10035,new Reward(new int [] {10079}, new int [] {10}, new int[] {100}));
			_rewards.put(10036,new Reward(new int [] {10078}, new int [] {10}, new int[] {100}));
			_rewards.put(10037,new Reward(new int [] {10089}, new int [] {10}, new int[] {100}));
			_rewards.put(10038,new Reward(new int [] {10076}, new int [] {10}, new int[] {100}));
			_rewards.put(10039,new Reward(new int [] {10076}, new int [] {10}, new int[] {100}));
			_rewards.put(10040,new Reward(new int [] {10089}, new int [] {10}, new int[] {100}));
			_rewards.put(10041,new Reward(new int [] {10071}, new int [] {10}, new int[] {100}));
			_rewards.put(10042,new Reward(new int [] {10089}, new int [] {10}, new int[] {100}));
			_rewards.put(10043,new Reward(new int [] {10083}, new int [] {10}, new int[] {100}));
			_rewards.put(10044,new Reward(new int [] {10073}, new int [] {10}, new int[] {100}));
			_rewards.put(10045,new Reward(new int [] {10082}, new int [] {10}, new int[] {100}));
			_rewards.put(10046,new Reward(new int [] {10073}, new int [] {10}, new int[] {100}));
			_rewards.put(10047,new Reward(new int [] {10077}, new int [] {10}, new int[] {100}));
			_rewards.put(10048,new Reward(new int [] {10080}, new int [] {10}, new int[] {100}));
			_rewards.put(10049,new Reward(new int [] {10075}, new int [] {10}, new int[] {100}));
			_rewards.put(10050,new Reward(new int [] {10087}, new int [] {10}, new int[] {100}));
			_rewards.put(10051,new Reward(new int [] {10089}, new int [] {10}, new int[] {100}));
			_rewards.put(10052,new Reward(new int [] {10074}, new int [] {10}, new int[] {100}));
			_rewards.put(10053,new Reward(new int [] {10071}, new int [] {10}, new int[] {100}));
			_rewards.put(10054,new Reward(new int [] {10079}, new int [] {10}, new int[] {100}));
			_rewards.put(10222,new Reward(new int [] {10065,10066,10067}, new int [] {1,1,1}, new int[] {33,33,34}));
			_rewards.put(10172,new Reward(new int [] {10098,10099,10100,10101,10102}, new int [] {1,1,1,1,1}, new int[] {20,20,20,20,20}));
			_rewards.put(10192,new Reward(new int [] {10208}, new int [] {3}, new int[] {100}));
			_rewards.put(10193,new Reward(new int [] {10192}, new int [] {10}, new int[] {100}));
			_rewards.put(10208,new Reward(new int [] {10173,10174,10175,10176,10177,10178,10179,10180,10181,10182,1870,1869,1880}, new int [] {1,1,1,1,1,1,1,1,1,1,10,10,10}, new int[] {1,1,1,1,1,1,1,1,1,1,30,30,30}));
			_rewards.put(10335,new Reward(new int [] {6364,6364,10231,10231,10232,10233,10234}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10336,new Reward(new int [] {6365,6365,10235,10235,10236,10237,10238}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10337,new Reward(new int [] {6366,6366,10239,10239,10240,10241,10242}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10338,new Reward(new int [] {6367,6367,10243,10243,10244,10245,10246}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10339,new Reward(new int [] {6368,6368,10247,10247,10248,10249,10250}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10340,new Reward(new int [] {6369,6369,10251,10251,10252,10253,10254}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10341,new Reward(new int [] {6370,6370,10255,10255,10256,10257,10258}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10342,new Reward(new int [] {6371,6371,10259,10259,10260,10261,10262}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10343,new Reward(new int [] {6372,6372,10263,10263,10264,10265,10266}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10344,new Reward(new int [] {6579,6579,10363,10363,10364,10365,10366}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10345,new Reward(new int [] {7575,7575,10367,10367,10368,10369,10370}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10346,new Reward(new int [] {80,80,10267,10267,10268,10269,10270}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10347,new Reward(new int [] {2500,2500,10271,10271,10272,10273,10274}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10348,new Reward(new int [] {235,235,10275,10275,10276,10277,10278}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10349,new Reward(new int [] {236,236,10279,10279,10280,10281,10282}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10350,new Reward(new int [] {269,269,10283,10283,10284,10285,10286}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10351,new Reward(new int [] {270,270,10287,10287,10288,10289,10290}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10352,new Reward(new int [] {288,288,10291,10291,10292,10293,10294}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10353,new Reward(new int [] {289,289,10295,10295,10296,10297,10298}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10354,new Reward(new int [] {98,98,10299,10299,10300,10301,10302}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10355,new Reward(new int [] {305,305,10303,10303,10304,10305,10306}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10356,new Reward(new int [] {2504,2504,10307,10307,10308,10309,10310}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10357,new Reward(new int [] {164,164,10311,10311,13012,13013,10314}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10358,new Reward(new int [] {150,150,10315,10315,10316,13017,10318}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10359,new Reward(new int [] {151,151,10319,10319,10320,10321,13022}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10360,new Reward(new int [] {212,212,10323,10323,10324,10325,10326}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10361,new Reward(new int [] {213,213,10327,10327,10328,10329,10330}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
			_rewards.put(10362,new Reward(new int [] {81,81,10331,13031,10332,10333,10334}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1}));
	}
	@Override
	public int[] getItemIds() {
			int [] ids = null;
			for (int i : _rewards.keySet())
					ids = ArrayUtils.add(ids, i);
			return ids;
	}

	@Override
	public void useItem(L2PlayableInstance cha, L2ItemInstance item) {
			L2PcInstance player = cha.getActingPlayer();
			if(player==null)
					return;
			Reward reward  =_rewards.get(item.getItemId());
			if(reward==null)
					return;
			// Уничтожаем распаковываемый предмет
			cha.getInventory().destroyItemByItemId("use", item.getItemId(), 1, player, null);

			// кароче, хуйня такая, берем массив, потом типо рандомазируем и то что рандомнетцо то и даём блеать
			// и еще, уже указывается в блядо награде, чо по чом.
			int i = Rnd.get(reward.items.length-1); //пиздим блядодлинну массива + и чтоже мы выиграли ебать
							// Считаем количество.
							int count = reward.counts[i]; // тут был Rnd.get
							// Если хотите что бы падал всегда то раскоментарьте строку ниже
									// Выдаем награду. Если сбой - то прекращаем
									if(!player.addItem("reward", reward.items[i], count, null, true))
											return;
	}

	@Override
	public void useItem(L2PlayableInstance arg0, L2ItemInstance arg1,
					boolean arg2) {
	}
	public static void main(String [] args) {
			ItemHandler.getInstance().registerItemHandler(new RandomReward());
	}

}

 

Я пока в этом не шарю..

 

Лучше скажите мне где этот файл с рецептами находится...

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
Авторизация  

  • Последние посетители   0 пользователей онлайн

    Ни одного зарегистрированного пользователя не просматривает данную страницу

×
×
  • Создать...