- 0
This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..
Question
Celsas
Hello guys, i have L2day event script and try to configure and change it, but don't know now how make 2 rewards :) 1 item 100% and other by chance...
When i collect word "Chronicle" or "Lineage II" and pres to npc i wanna get 1 item 100% (unique item "Letter Collector's Gift") and + one item from the list...
package l2f.gameserver.scripts.events.l2day; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import l2f.gameserver.model.reward.RewardData; public class l2day extends LettersCollection { static { _name = "l2day"; _msgStarted = "scripts.events.l2day.AnnounceEventStarted"; _msgEnded = "scripts.events.l2day.AnnounceEventStoped"; EVENT_MANAGERS = new int[][] {{ 83720, 149720, -3430, 49151 }}; _words.put("LineageII", new Integer[][] { { L, 1 }, { I, 1 }, { N, 1 }, { E, 2 }, { A, 1 }, { G, 1 }, { II, 1 } }); _rewards.put("LineageII", new RewardData[] { // Reward list new RewardData(0, 1, 1, 1000000), // 100% new RewardData(0, 1, 1, 750000), // 75% new RewardData(0, 1, 1, 500000), // 50% new RewardData(0, 1, 1, 250000), // 25% new RewardData(0, 1, 1, 100000), // 10% new RewardData(0, 1, 1, 50000), // 5% new RewardData(0, 1, 1, 5000), // 0.5% new RewardData(0, 1, 1, 1000), // 0.1% new RewardData(0, 1, 1, 100), }); // 0.01% _words.put("Chronicle", new Integer[][] { { C, 2 }, { H, 1 }, { R, 1 }, { O, 1 }, { N, 1 }, { I, 1 }, { L, 1 }, { E, 1 } }); _rewards.put("Chronicle", new RewardData[] { // Reward list new RewardData(0, 1, 1, 1000000), // 100% new RewardData(0, 1, 1, 750000), // 75% new RewardData(0, 1, 1, 500000), // 50% new RewardData(0, 1, 1, 250000), // 25% new RewardData(0, 1, 1, 100000), // 10% new RewardData(0, 1, 1, 50000), // 5% new RewardData(0, 1, 1, 5000), // 0.5% new RewardData(0, 1, 1, 1000), // 0.1% new RewardData(0, 1, 1, 100), }); // 0.01% final int DROP_MULT = 3; Map<Integer, Integer> temp = new HashMap <Integer, Integer>(); for(Integer[][] ii : _words.values()) for(Integer[] i : ii) { Integer curr = temp.get(i[0]); if(curr == null) temp.put(i[0], i[1]); else temp.put(i[0], curr + i[1]); } letters = new int[temp.size()][2]; int i = 0; for(Entry<Integer, Integer> e : temp.entrySet()) letters[i++] = new int[] { e.getKey(), e.getValue() * DROP_MULT }; } }4 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now