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 };
}
}
📢 ¡ATENCIÓN JUGADORES DE LINEAGE 2! 📢
¡L2 Crest Converter ha llegado! El programa creado por PulserX para obtener crests de clan (banderas) que realmente funciona, programado y distribuido de manera gratuita a todo el mundo por su humilde servidor.
¿Cansado de que el viejo CrestMaker falle y arruine tus imágenes en Windows 10/11? Hemos creado una solución actualizada.
✅ Optimizado para Windows 10/11
✅ Convierte PNG/JPG perfectamente
✅ Adiós a las imágenes cuadriculadas
L2 Crest Converter es la herramienta que garantiza que tu crest se vea tal como la diseñaste.
Descárgalo y velo en acción aquí:
👉 https://youtu.be/OVsoi5Vaj7M?si=mhE8Aet0w5nwo6ZE
👉 https://youtu.be/OVsoi5Vaj7M?si=mhE8Aet0w5nwo6ZE
👉 https://youtu.be/OVsoi5Vaj7M?si=mhE8Aet0w5nwo6ZE
New update!
A gift coupon system has been added.
Now you can activate gift coupons directly in the bot:
Open "My Profile"
Tap "Activate gift coupon"
Enter the coupon code
The balance will be topped up automatically.
Received a coupon? Activate it and top up your balance.
Buy Telegram Stars with maximum benefit in our bot
New update!
A gift coupon system has been added.
Now you can activate gift coupons directly in the bot:
Open "My Profile"
Tap "Activate gift coupon"
Enter the coupon code
The balance will be topped up automatically.
Received a coupon? Activate it and top up your balance.
Buy Telegram Stars with maximum benefit in our bot
New update!
A gift coupon system has been added.
Now you can activate gift coupons directly in the bot:
Open "My Profile"
Tap "Activate gift coupon"
Enter the coupon code
The balance will be topped up automatically.
Received a coupon? Activate it and top up your balance.
Buy Telegram Stars with maximum benefit in our bot
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