From 099b2fb33ca18da4f8cbc669d04f645d6080462e Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Mon, 26 Sep 2022 00:17:08 +0000 Subject: [PATCH] Addition of Smash It Completely event. Contributed by CostyKiller. --- .../dist/game/data/multisell/2450.xml | 18 ++ .../events/SmashItCompletely/34575-1.htm | 8 + .../events/SmashItCompletely/34575-2.htm | 10 + .../events/SmashItCompletely/34575-3.htm | 8 + .../SmashItCompletely/34575-no-level.htm | 6 + .../34575-successful.htm.htm | 5 + .../events/SmashItCompletely/34575.htm | 11 + .../SmashItCompletely/SmashItCompletely.java | 269 ++++++++++++++++ .../events/SmashItCompletely/config.xml | 34 ++ .../game/data/stats/items/81700-81799.xml | 140 ++++++++- .../dist/game/data/stats/npcs/13600-13699.xml | 12 +- .../game/data/stats/skills/33900-33999.xml | 63 +++- .../game/data/stats/skills/39600-39699.xml | 51 ++- .../game/data/stats/skills/39700-39799.xml | 29 ++ .../dist/game/data/multisell/2450.xml | 18 ++ .../events/SmashItCompletely/34575-1.htm | 8 + .../events/SmashItCompletely/34575-2.htm | 10 + .../events/SmashItCompletely/34575-3.htm | 8 + .../SmashItCompletely/34575-no-level.htm | 6 + .../34575-successful.htm.htm | 5 + .../events/SmashItCompletely/34575.htm | 11 + .../SmashItCompletely/SmashItCompletely.java | 297 ++++++++++++++++++ .../events/SmashItCompletely/config.xml | 34 ++ .../game/data/stats/items/81700-81799.xml | 80 ++++- .../dist/game/data/stats/npcs/13600-13699.xml | 12 +- .../game/data/stats/skills/33900-33999.xml | 63 +++- .../game/data/stats/skills/39600-39699.xml | 51 ++- .../game/data/stats/skills/39700-39799.xml | 29 ++ 28 files changed, 1275 insertions(+), 21 deletions(-) create mode 100644 L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/multisell/2450.xml create mode 100644 L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/34575-1.htm create mode 100644 L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/34575-2.htm create mode 100644 L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/34575-3.htm create mode 100644 L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/34575-no-level.htm create mode 100644 L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/34575-successful.htm.htm create mode 100644 L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/34575.htm create mode 100644 L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/SmashItCompletely.java create mode 100644 L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/config.xml create mode 100644 L2J_Mobius_10.2_MasterClass/dist/game/data/multisell/2450.xml create mode 100644 L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/34575-1.htm create mode 100644 L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/34575-2.htm create mode 100644 L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/34575-3.htm create mode 100644 L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/34575-no-level.htm create mode 100644 L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/34575-successful.htm.htm create mode 100644 L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/34575.htm create mode 100644 L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/SmashItCompletely.java create mode 100644 L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/config.xml diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/multisell/2450.xml b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/multisell/2450.xml new file mode 100644 index 0000000000..d0278a3e85 --- /dev/null +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/multisell/2450.xml @@ -0,0 +1,18 @@ + + + + 34575 + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/34575-1.htm b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/34575-1.htm new file mode 100644 index 0000000000..444d7e6be5 --- /dev/null +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/34575-1.htm @@ -0,0 +1,8 @@ +Baby Shark Doo Doo Doo:
+Once a day! Gift giveaway! Delicious watermelons!
+Of course, you can only receive a Watermelon if you have a Watermelon Seed.
+Oh, you don't know what I'm talking about, do you?
+You can try it if you've reached Lv. 105 or higher! (once a day per account) + + + \ No newline at end of file diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/34575-2.htm b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/34575-2.htm new file mode 100644 index 0000000000..fb3a2797c4 --- /dev/null +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/34575-2.htm @@ -0,0 +1,10 @@ +Baby Shark Doo Doo Doo:
+Calm down? Why? I might look a bit crazy, but I am in fact very calm!
+You want to know more about the buff?
+Well... I'll try to keep calm. Listen here! Woo-hoo!
+1. When you use a Watermelon Seed, a Watermelon will appear. Its size is up to a chance!
+2. The Watermelon will break open in 30 sec., but you can attack it and break it faster. When you do, you have a chance to receive a buff and an Ice Box.
+3. The bigger the Watermelon, the longer you have to hit it until it breaks and the higher probability of receiving a buff and an Ice Box.
+4. Be careful, you can't receive the buff and the reward if you are standing too far from the Watermelon.
+ + \ No newline at end of file diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/34575-3.htm b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/34575-3.htm new file mode 100644 index 0000000000..ce4f3ff942 --- /dev/null +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/34575-3.htm @@ -0,0 +1,8 @@ +Baby Shark Doo Doo Doo:
+Huh? Hm...
+Watermelons are tasty, aren't they? Once you start eating them, it's hard to stop!
+To get a Watermelon Seed, join a clan and complete a clan quest.
+If you've joined a clan during the event, click N and then press the Clan Quests button.
+Open the General and Events tabs of the main UI to learn more about the clan quests that have a Watermelon Seed as a reward.
+ + \ No newline at end of file diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/34575-no-level.htm b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/34575-no-level.htm new file mode 100644 index 0000000000..99b302cdf2 --- /dev/null +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/34575-no-level.htm @@ -0,0 +1,6 @@ +Baby Shark Doo Doo Doo:
+No-no-no! Bad!
+Babies below Lv. 105 can't have watermelons! They'll upset their tummies!
+Available to characters of Lv. 105 and higher. + + \ No newline at end of file diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/34575-successful.htm.htm b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/34575-successful.htm.htm new file mode 100644 index 0000000000..d78fde58ce --- /dev/null +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/34575-successful.htm.htm @@ -0,0 +1,5 @@ +Baby Shark Doo Doo Doo:
+Let's fight the summer heat together - the freshness of the watermelon will help us!
+(1 time per day per account, reset at 06:30) + + \ No newline at end of file diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/34575.htm b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/34575.htm new file mode 100644 index 0000000000..70ee34252b --- /dev/null +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/34575.htm @@ -0,0 +1,11 @@ +Baby Shark Doo Doo Doo:
+it's not hot today, isn't it? Heh-heh...
+A cold watermelon on a day like this would be a godsend, wouldn't it? Do you want to know who I am?
+It's me! Baby Shark, doo doo doo doo doo doo! That is actually my name - Doo Doo Doo!
+You've heard the song, right? Saw the video? Anyway, since it's summertime i've prepared Watermelon Seeds!
+You can receive one gift a day now.
+ + + + + \ No newline at end of file diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/SmashItCompletely.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/SmashItCompletely.java new file mode 100644 index 0000000000..ac71949378 --- /dev/null +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/SmashItCompletely.java @@ -0,0 +1,269 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package events.SmashItCompletely; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.util.Calendar; +import java.util.logging.Level; + +import org.l2jmobius.commons.database.DatabaseFactory; +import org.l2jmobius.gameserver.model.World; +import org.l2jmobius.gameserver.model.actor.Attackable; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.ListenerRegisterType; +import org.l2jmobius.gameserver.model.events.annotations.Id; +import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent; +import org.l2jmobius.gameserver.model.events.annotations.RegisterType; +import org.l2jmobius.gameserver.model.events.impl.item.OnItemUse; +import org.l2jmobius.gameserver.model.holders.SkillHolder; +import org.l2jmobius.gameserver.model.quest.LongTimeEvent; +import org.l2jmobius.gameserver.model.skill.SkillCaster; +import org.l2jmobius.gameserver.network.SystemMessageId; + +/** + * @URL https://l2central.info/main/events_and_promos/1444.html + * @author CostyKiller + * @apiNote You need to edit client file to add additional seed rewards to clan missions. + * @TODO Fix autoloot and self destruction skill for melons. + */ +public class SmashItCompletely extends LongTimeEvent +{ + // NPCs + private static final int DOODOODOO = 34575; // Baby Shark Doo Doo Doo + private static final int SWEET_WATERMELON = 13608; + private static final int PRIME_WATERMELON = 13609; + private static final int LARGE_PRIME_WATERMELON = 13610; + // Items + private static final int WATERMELON_SEED = 81782; + private static final int ICE_BOX = 81783; + // Skills + private static final SkillHolder[] SKILLS = + { + new SkillHolder(39714, 2), // Sweet Watermelon + new SkillHolder(39714, 3), // Prime Watermelon + new SkillHolder(39714, 4), // Large Prime Watermelon + new SkillHolder(33927, 1), // Watermelon Burst + }; + // Buffs + private static final SkillHolder[] BUFFS = + { + new SkillHolder(33928, 1), // Dizzy Lv. 1 = 1 hour + new SkillHolder(33928, 2), // Dizzy Lv. 2 = 2 hours + new SkillHolder(33928, 3), // Dizzy Lv. 3 = 3 hours + }; + // Misc + private static final String SMASH_IT_COMPLETELY_VAR = "SMASH_IT_COMPLETELY_SEED_RECEIVED"; + private static final int PLAYER_LEVEL = 105; + // Chances for higher quality watermelons + private static final int LARGE_PRIME_WATERMELON_SUMMON_CHANCE = 15; // Large Watermelon summon chance + private static final int PRIME_WATERMELON_SUMMON_CHANCE = 40; // Prime Watermelon summon chance + // Chances to get Dizzy buff + private static final int LARGE_PRIME_WATERMELON_BUFF_CHANCE = 80; // Large Watermelon buff chance + private static final int PRIME_WATERMELON_BUFF_CHANCE = 60; // Prime Watermelon buff chance + private static final int SWEET_WATERMELON_BUFF_CHANCE = 40; // Sweet Watermelon buff chance + + public SmashItCompletely() + { + addStartNpc(DOODOODOO); + addFirstTalkId(DOODOODOO); + addTalkId(DOODOODOO); + addSpawnId(SWEET_WATERMELON, PRIME_WATERMELON, LARGE_PRIME_WATERMELON); + addKillId(SWEET_WATERMELON, PRIME_WATERMELON, LARGE_PRIME_WATERMELON); + + startQuestTimer("schedule", 1000, null, null); + } + + @Override + public String onAdvEvent(String event, Npc npc, Player player) + { + String htmltext = null; + switch (event) + { + case "getSeed": + { + if (npc.getId() != DOODOODOO) + { + break; + } + if (player.getLevel() < PLAYER_LEVEL) + { + htmltext = "34575-no-level.htm"; + break; + } + if (player.getAccountVariables().getBoolean(SMASH_IT_COMPLETELY_VAR, false)) + { + player.sendMessage("This account has already received a seed. An account can receive a seed only once a day."); + break; + } + + giveItems(player, WATERMELON_SEED, 1); + player.getAccountVariables().set(SMASH_IT_COMPLETELY_VAR, true); + player.getAccountVariables().storeMe(); + htmltext = "34575-successful.htm"; + break; + } + case "schedule": + { + final Calendar calendar = Calendar.getInstance(); + calendar.set(Calendar.HOUR_OF_DAY, 6); + calendar.set(Calendar.MINUTE, 30); + cancelQuestTimers("reset"); + startQuestTimer("reset", calendar.getTimeInMillis() - System.currentTimeMillis(), null, null); + break; + } + case "reset": + { + if (isEventPeriod()) + { + // Update data for offline players. + try (Connection con = DatabaseFactory.getConnection(); + PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?")) + { + ps.setString(1, SMASH_IT_COMPLETELY_VAR); + ps.executeUpdate(); + } + catch (Exception e) + { + LOGGER.log(Level.SEVERE, "Could not reset Smash It Completely Event var: ", e); + } + + // Update data for online players. + for (Player plr : World.getInstance().getPlayers()) + { + plr.getAccountVariables().remove(SMASH_IT_COMPLETELY_VAR); + plr.getAccountVariables().storeMe(); + } + } + cancelQuestTimers("schedule"); + startQuestTimer("schedule", 1000, null, null); + break; + } + } + return htmltext; + } + + @Override + public String onFirstTalk(Npc npc, Player player) + { + return npc.getId() + ".htm"; + } + + @Override + public String onKill(Npc npc, Player killer, boolean isPet) + { + if (killer.getSummonedNpc(npc.getObjectId()) == null) + { + killer.sendMessage("You must grow your own watermelon to get reward."); + return null; + } + + switch (npc.getId()) + { + case SWEET_WATERMELON: + { + if (getRandom(100) < SWEET_WATERMELON_BUFF_CHANCE) + { + SkillCaster.triggerCast(killer, killer, BUFFS[0].getSkill()); + } + break; + } + case PRIME_WATERMELON: + { + if (getRandom(100) < PRIME_WATERMELON_BUFF_CHANCE) + { + SkillCaster.triggerCast(killer, killer, BUFFS[1].getSkill()); + } + if (killer.isInventoryUnder80(false)) + { + killer.doAutoLoot((Attackable) npc, ICE_BOX, 1); // Prime Watermelon Ice Box x1 + } + else + { + killer.sendPacket(SystemMessageId.NOT_ENOUGH_SPACE_IN_THE_INVENTORY_UNABLE_TO_PROCESS_THIS_REQUEST_UNTIL_YOUR_INVENTORY_S_WEIGHT_AND_SLOT_COUNT_ARE_LESS_THAN_80_PERCENT_OF_CAPACITY); + } + break; + } + case LARGE_PRIME_WATERMELON: + { + if (getRandom(100) < LARGE_PRIME_WATERMELON_BUFF_CHANCE) + { + SkillCaster.triggerCast(killer, killer, BUFFS[2].getSkill()); + } + if (killer.isInventoryUnder80(false)) + { + killer.doAutoLoot((Attackable) npc, ICE_BOX, 2); // Large Prime Watermelon Ice Box x2 + } + else + { + killer.sendPacket(SystemMessageId.NOT_ENOUGH_SPACE_IN_THE_INVENTORY_UNABLE_TO_PROCESS_THIS_REQUEST_UNTIL_YOUR_INVENTORY_S_WEIGHT_AND_SLOT_COUNT_ARE_LESS_THAN_80_PERCENT_OF_CAPACITY); + } + break; + } + } + + return super.onKill(npc, killer, isPet); + } + + @Override + public String onSpawn(Npc npc) + { + SkillCaster.triggerCast(npc, npc, BUFFS[3].getSkill()); // TODO: FIX death skill. + return super.onSpawn(npc); + } + + @RegisterEvent(EventType.ON_ITEM_USE) + @RegisterType(ListenerRegisterType.ITEM) + @Id(81782) // Watermelon Seed + public void onItemUse(OnItemUse event) + { + if (isEventPeriod()) + { + final Player player = event.getPlayer(); + for (SkillHolder skill : BUFFS) + { + if (player.isAffectedBySkill(skill)) + { + player.sendMessage("You must remove current Dizzy buff effect to be able to grow another watermelon."); + player.getInventory().addItem("Watermelon Seed refund", event.getItem().getId(), 1, player, player); + return; + } + } + + final int chance = getRandom(100); + if (chance < LARGE_PRIME_WATERMELON_SUMMON_CHANCE) + { + SkillCaster.triggerCast(player, player, SKILLS[2].getSkill()); + } + else if (chance < PRIME_WATERMELON_SUMMON_CHANCE) + { + SkillCaster.triggerCast(player, player, SKILLS[1].getSkill()); + } + else + { + SkillCaster.triggerCast(player, player, SKILLS[0].getSkill()); + } + } + } + + public static void main(String[] args) + { + new SmashItCompletely(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/config.xml b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/config.xml new file mode 100644 index 0000000000..3de2deaab9 --- /dev/null +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/SmashItCompletely/config.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/81700-81799.xml b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/81700-81799.xml index b29f38346e..b97d1ad0b9 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/81700-81799.xml +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/81700-81799.xml @@ -612,7 +612,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -620,7 +649,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1017,20 +1075,36 @@ + + + + + + + + + + + + + + + + @@ -1062,6 +1136,10 @@ + + + + @@ -1069,16 +1147,74 @@ + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/npcs/13600-13699.xml b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/npcs/13600-13699.xml index 4d740de58f..d12d395aa1 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/npcs/13600-13699.xml +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/npcs/13600-13699.xml @@ -284,7 +284,7 @@ - + ETC MALE @@ -298,13 +298,13 @@ 600 - + - + ETC MALE @@ -318,13 +318,13 @@ 600 - + - + ETC MALE @@ -338,7 +338,7 @@ 600 - + diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/33900-33999.xml b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/33900-33999.xml index 4b0c2186f3..f42a646601 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/33900-33999.xml +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/33900-33999.xml @@ -67,7 +67,68 @@ icon.skill0000 - A1 + + 3600 + 7200 + 14400 + + 1 + EVENT_BUFF + V_EVENT_2020_SUMMER_AVE + 1800 + 1500 + 900 + 1 + 105 + A2 + 5000 + -5 + SELF + PARTY + FRIEND + true + true + true + + + + + + 10 + ENEMY_ALL + PER + + + 10 + ENEMY_ALL + PER + + + 10 + ENEMY_ALL + PER + + + 10 + PER + + + 10 + PER + + + 10 + PER + + + -10 + PK + + + -10 + ENEMY_ALL + + diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/39600-39699.xml b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/39600-39699.xml index ebb51eb384..b5541c5c2f 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/39600-39699.xml +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/39600-39699.xml @@ -661,8 +661,55 @@ - icon.skill0000 - A1 + icon.bm_royal_black_beer + A2 + 2 + 300000 + 500 + HONEY_BEER + 1 + 1800 + true + true + SELF + SINGLE + + + 3 + STR + + + 3 + CON + + + 3 + DEX + + + 3 + INT + + + 3 + WIT + + + 3 + MEN + + + 3 + LUC + + + 3 + CHA + + + 30 + + 1 diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/39700-39799.xml b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/39700-39799.xml index e38dd53b00..37edc165e6 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/39700-39799.xml +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/39700-39799.xml @@ -135,7 +135,36 @@ icon.skill0000 + 500 + 2 + + 1 + 1 + 1 + + 81782 + 1 A1 + 5 + 1.5 + SELF + SINGLE + + + + 105 + + + + + + 13608 + 13609 + 13610 + + 1 + + diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/multisell/2450.xml b/L2J_Mobius_10.2_MasterClass/dist/game/data/multisell/2450.xml new file mode 100644 index 0000000000..d0278a3e85 --- /dev/null +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/multisell/2450.xml @@ -0,0 +1,18 @@ + + + + 34575 + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/34575-1.htm b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/34575-1.htm new file mode 100644 index 0000000000..444d7e6be5 --- /dev/null +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/34575-1.htm @@ -0,0 +1,8 @@ +Baby Shark Doo Doo Doo:
+Once a day! Gift giveaway! Delicious watermelons!
+Of course, you can only receive a Watermelon if you have a Watermelon Seed.
+Oh, you don't know what I'm talking about, do you?
+You can try it if you've reached Lv. 105 or higher! (once a day per account) + + + \ No newline at end of file diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/34575-2.htm b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/34575-2.htm new file mode 100644 index 0000000000..fb3a2797c4 --- /dev/null +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/34575-2.htm @@ -0,0 +1,10 @@ +Baby Shark Doo Doo Doo:
+Calm down? Why? I might look a bit crazy, but I am in fact very calm!
+You want to know more about the buff?
+Well... I'll try to keep calm. Listen here! Woo-hoo!
+1. When you use a Watermelon Seed, a Watermelon will appear. Its size is up to a chance!
+2. The Watermelon will break open in 30 sec., but you can attack it and break it faster. When you do, you have a chance to receive a buff and an Ice Box.
+3. The bigger the Watermelon, the longer you have to hit it until it breaks and the higher probability of receiving a buff and an Ice Box.
+4. Be careful, you can't receive the buff and the reward if you are standing too far from the Watermelon.
+ + \ No newline at end of file diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/34575-3.htm b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/34575-3.htm new file mode 100644 index 0000000000..ce4f3ff942 --- /dev/null +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/34575-3.htm @@ -0,0 +1,8 @@ +Baby Shark Doo Doo Doo:
+Huh? Hm...
+Watermelons are tasty, aren't they? Once you start eating them, it's hard to stop!
+To get a Watermelon Seed, join a clan and complete a clan quest.
+If you've joined a clan during the event, click N and then press the Clan Quests button.
+Open the General and Events tabs of the main UI to learn more about the clan quests that have a Watermelon Seed as a reward.
+ + \ No newline at end of file diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/34575-no-level.htm b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/34575-no-level.htm new file mode 100644 index 0000000000..99b302cdf2 --- /dev/null +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/34575-no-level.htm @@ -0,0 +1,6 @@ +Baby Shark Doo Doo Doo:
+No-no-no! Bad!
+Babies below Lv. 105 can't have watermelons! They'll upset their tummies!
+Available to characters of Lv. 105 and higher. + + \ No newline at end of file diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/34575-successful.htm.htm b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/34575-successful.htm.htm new file mode 100644 index 0000000000..d78fde58ce --- /dev/null +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/34575-successful.htm.htm @@ -0,0 +1,5 @@ +Baby Shark Doo Doo Doo:
+Let's fight the summer heat together - the freshness of the watermelon will help us!
+(1 time per day per account, reset at 06:30) + + \ No newline at end of file diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/34575.htm b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/34575.htm new file mode 100644 index 0000000000..70ee34252b --- /dev/null +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/34575.htm @@ -0,0 +1,11 @@ +Baby Shark Doo Doo Doo:
+it's not hot today, isn't it? Heh-heh...
+A cold watermelon on a day like this would be a godsend, wouldn't it? Do you want to know who I am?
+It's me! Baby Shark, doo doo doo doo doo doo! That is actually my name - Doo Doo Doo!
+You've heard the song, right? Saw the video? Anyway, since it's summertime i've prepared Watermelon Seeds!
+You can receive one gift a day now.
+ + + + + \ No newline at end of file diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/SmashItCompletely.java b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/SmashItCompletely.java new file mode 100644 index 0000000000..3a49a57e64 --- /dev/null +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/SmashItCompletely.java @@ -0,0 +1,297 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package events.SmashItCompletely; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.util.Calendar; +import java.util.logging.Level; + +import org.l2jmobius.commons.database.DatabaseFactory; +import org.l2jmobius.gameserver.enums.ChatType; +import org.l2jmobius.gameserver.model.World; +import org.l2jmobius.gameserver.model.actor.Attackable; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.events.EventType; +import org.l2jmobius.gameserver.model.events.ListenerRegisterType; +import org.l2jmobius.gameserver.model.events.annotations.Id; +import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent; +import org.l2jmobius.gameserver.model.events.annotations.RegisterType; +import org.l2jmobius.gameserver.model.events.impl.item.OnItemUse; +import org.l2jmobius.gameserver.model.holders.SkillHolder; +import org.l2jmobius.gameserver.model.quest.LongTimeEvent; +import org.l2jmobius.gameserver.model.skill.SkillCaster; +import org.l2jmobius.gameserver.network.NpcStringId; +import org.l2jmobius.gameserver.network.SystemMessageId; +import org.l2jmobius.gameserver.network.serverpackets.NpcSay; +import org.l2jmobius.gameserver.util.Broadcast; + +/** + * @URL https://l2central.info/main/events_and_promos/1444.html + * @author CostyKiller + * @apiNote You need to edit client file to add additional seed rewards to clan missions. + * @TODO Fix autoloot and self destruction skill for melons. + */ +public class SmashItCompletely extends LongTimeEvent +{ + // NPCs + private static final int DOODOODOO = 34575; // Baby Shark Doo Doo Doo + private static final int SWEET_WATERMELON = 13608; + private static final int PRIME_WATERMELON = 13609; + private static final int LARGE_PRIME_WATERMELON = 13610; + // Items + private static final int WATERMELON_SEED = 81782; + private static final int ICE_BOX = 81783; + // Skills + private static final SkillHolder[] SKILLS = + { + new SkillHolder(39714, 2), // Sweet Watermelon + new SkillHolder(39714, 3), // Prime Watermelon + new SkillHolder(39714, 4), // Large Prime Watermelon + new SkillHolder(33927, 1), // Watermelon Burst + }; + // Buffs + private static final SkillHolder[] BUFFS = + { + new SkillHolder(33928, 1), // Dizzy Lv. 1 = 1 hour + new SkillHolder(33928, 2), // Dizzy Lv. 2 = 2 hours + new SkillHolder(33928, 3), // Dizzy Lv. 3 = 3 hours + }; + // Misc + private static final String SMASH_IT_COMPLETELY_VAR = "SMASH_IT_COMPLETELY_SEED_RECEIVED"; + private static final int PLAYER_LEVEL = 105; + private static final NpcStringId[] DOODOODOO_TEXT = + { + NpcStringId.HERE_COMES_BABY_SHARK_DOO_DOO_DOO, + NpcStringId.HEY_I_WANT_A_WATERMELON_TOO + }; + // Chances for higher quality watermelons + private static final int LARGE_PRIME_WATERMELON_SUMMON_CHANCE = 15; // Large Watermelon summon chance + private static final int PRIME_WATERMELON_SUMMON_CHANCE = 40; // Prime Watermelon summon chance + // Chances to get Dizzy buff + private static final int LARGE_PRIME_WATERMELON_BUFF_CHANCE = 80; // Large Watermelon buff chance + private static final int PRIME_WATERMELON_BUFF_CHANCE = 60; // Prime Watermelon buff chance + private static final int SWEET_WATERMELON_BUFF_CHANCE = 40; // Sweet Watermelon buff chance + + public SmashItCompletely() + { + addStartNpc(DOODOODOO); + addFirstTalkId(DOODOODOO); + addTalkId(DOODOODOO); + addSpawnId(DOODOODOO, SWEET_WATERMELON, PRIME_WATERMELON, LARGE_PRIME_WATERMELON); + addKillId(SWEET_WATERMELON, PRIME_WATERMELON, LARGE_PRIME_WATERMELON); + + startQuestTimer("schedule", 1000, null, null); + } + + @Override + public String onAdvEvent(String event, Npc npc, Player player) + { + String htmltext = null; + switch (event) + { + case "getSeed": + { + if (npc.getId() != DOODOODOO) + { + break; + } + if (player.getLevel() < PLAYER_LEVEL) + { + htmltext = "34575-no-level.htm"; + break; + } + if (player.getAccountVariables().getBoolean(SMASH_IT_COMPLETELY_VAR, false)) + { + player.sendMessage("This account has already received a seed. An account can receive a seed only once a day."); + break; + } + + giveItems(player, WATERMELON_SEED, 1); + player.getAccountVariables().set(SMASH_IT_COMPLETELY_VAR, true); + player.getAccountVariables().storeMe(); + htmltext = "34575-successful.htm"; + break; + } + case "schedule": + { + final Calendar calendar = Calendar.getInstance(); + calendar.set(Calendar.HOUR_OF_DAY, 6); + calendar.set(Calendar.MINUTE, 30); + cancelQuestTimers("reset"); + startQuestTimer("reset", calendar.getTimeInMillis() - System.currentTimeMillis(), null, null); + break; + } + case "reset": + { + if (isEventPeriod()) + { + // Update data for offline players. + try (Connection con = DatabaseFactory.getConnection(); + PreparedStatement ps = con.prepareStatement("DELETE FROM account_gsdata WHERE var=?")) + { + ps.setString(1, SMASH_IT_COMPLETELY_VAR); + ps.executeUpdate(); + } + catch (Exception e) + { + LOGGER.log(Level.SEVERE, "Could not reset Smash It Completely Event var: ", e); + } + + // Update data for online players. + for (Player plr : World.getInstance().getPlayers()) + { + plr.getAccountVariables().remove(SMASH_IT_COMPLETELY_VAR); + plr.getAccountVariables().storeMe(); + } + } + cancelQuestTimers("schedule"); + startQuestTimer("schedule", 1000, null, null); + break; + } + case "DOODOODOO_SHOUT": + { + Broadcast.toKnownPlayersInRadius(npc, new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), getRandomEntry(DOODOODOO_TEXT)), 1000); + break; + } + } + return htmltext; + } + + @Override + public String onFirstTalk(Npc npc, Player player) + { + return npc.getId() + ".htm"; + } + + @Override + public String onKill(Npc npc, Player killer, boolean isPet) + { + if (killer.getSummonedNpc(npc.getObjectId()) == null) + { + killer.sendMessage("You must grow your own watermelon to get reward."); + return null; + } + + switch (npc.getId()) + { + case SWEET_WATERMELON: + { + if (getRandom(100) < SWEET_WATERMELON_BUFF_CHANCE) + { + SkillCaster.triggerCast(killer, killer, BUFFS[0].getSkill()); + } + break; + } + case PRIME_WATERMELON: + { + if (getRandom(100) < PRIME_WATERMELON_BUFF_CHANCE) + { + SkillCaster.triggerCast(killer, killer, BUFFS[1].getSkill()); + } + if (killer.isInventoryUnder80(false)) + { + killer.doAutoLoot((Attackable) npc, ICE_BOX, 1); // Prime Watermelon Ice Box x1 + } + else + { + killer.sendPacket(SystemMessageId.NOT_ENOUGH_SPACE_IN_THE_INVENTORY_UNABLE_TO_PROCESS_THIS_REQUEST_UNTIL_YOUR_INVENTORY_S_WEIGHT_AND_SLOT_COUNT_ARE_LESS_THAN_80_PERCENT_OF_CAPACITY); + } + break; + } + case LARGE_PRIME_WATERMELON: + { + if (getRandom(100) < LARGE_PRIME_WATERMELON_BUFF_CHANCE) + { + SkillCaster.triggerCast(killer, killer, BUFFS[2].getSkill()); + } + if (killer.isInventoryUnder80(false)) + { + killer.doAutoLoot((Attackable) npc, ICE_BOX, 2); // Large Prime Watermelon Ice Box x2 + } + else + { + killer.sendPacket(SystemMessageId.NOT_ENOUGH_SPACE_IN_THE_INVENTORY_UNABLE_TO_PROCESS_THIS_REQUEST_UNTIL_YOUR_INVENTORY_S_WEIGHT_AND_SLOT_COUNT_ARE_LESS_THAN_80_PERCENT_OF_CAPACITY); + } + break; + } + } + + return super.onKill(npc, killer, isPet); + } + + @Override + public String onSpawn(Npc npc) + { + switch (npc.getId()) + { + case DOODOODOO: + { + startQuestTimer("DOODOODOO_SHOUT", (5 * 60 * 1000), npc, null, true); // Spam texts every 5 min + break; + } + case SWEET_WATERMELON: + case PRIME_WATERMELON: + case LARGE_PRIME_WATERMELON: + { + SkillCaster.triggerCast(npc, npc, BUFFS[3].getSkill()); // TODO: FIX death skill. + break; + } + } + return super.onSpawn(npc); + } + + @RegisterEvent(EventType.ON_ITEM_USE) + @RegisterType(ListenerRegisterType.ITEM) + @Id(81782) // Watermelon Seed + public void onItemUse(OnItemUse event) + { + if (isEventPeriod()) + { + final Player player = event.getPlayer(); + for (SkillHolder skill : BUFFS) + { + if (player.isAffectedBySkill(skill)) + { + player.sendMessage("You must remove current Dizzy buff effect to be able to grow another watermelon."); + player.getInventory().addItem("Watermelon Seed refund", event.getItem().getId(), 1, player, player); + return; + } + } + + final int chance = getRandom(100); + if (chance < LARGE_PRIME_WATERMELON_SUMMON_CHANCE) + { + SkillCaster.triggerCast(player, player, SKILLS[2].getSkill()); + } + else if (chance < PRIME_WATERMELON_SUMMON_CHANCE) + { + SkillCaster.triggerCast(player, player, SKILLS[1].getSkill()); + } + else + { + SkillCaster.triggerCast(player, player, SKILLS[0].getSkill()); + } + } + } + + public static void main(String[] args) + { + new SmashItCompletely(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/config.xml b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/config.xml new file mode 100644 index 0000000000..3de2deaab9 --- /dev/null +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/SmashItCompletely/config.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/81700-81799.xml b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/81700-81799.xml index 382f82a4e5..a93adb00b6 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/81700-81799.xml +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/81700-81799.xml @@ -1075,20 +1075,36 @@ + + + +
+ + + + + + + + + + + + @@ -1120,6 +1136,10 @@ + + + + @@ -1127,16 +1147,74 @@ + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/npcs/13600-13699.xml b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/npcs/13600-13699.xml index b01c798c07..137d545dd8 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/npcs/13600-13699.xml +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/npcs/13600-13699.xml @@ -284,7 +284,7 @@ - + ETC MALE @@ -298,13 +298,13 @@ 600 - + - + ETC MALE @@ -318,13 +318,13 @@ 600 - + - + ETC MALE @@ -338,7 +338,7 @@ 600 - + diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/33900-33999.xml b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/33900-33999.xml index 58e99a861c..3048113ebc 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/33900-33999.xml +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/33900-33999.xml @@ -67,7 +67,68 @@ icon.skill0000 - A1 + + 3600 + 7200 + 14400 + + 1 + EVENT_BUFF + V_EVENT_2020_SUMMER_AVE + 1800 + 1500 + 900 + 1 + 105 + A2 + 5000 + -5 + SELF + PARTY + FRIEND + true + true + true + + + + + + 10 + ENEMY_ALL + PER + + + 10 + ENEMY_ALL + PER + + + 10 + ENEMY_ALL + PER + + + 10 + PER + + + 10 + PER + + + 10 + PER + + + -10 + PK + + + -10 + ENEMY_ALL + + diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/39600-39699.xml b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/39600-39699.xml index 9359202374..ee8f4af112 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/39600-39699.xml +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/39600-39699.xml @@ -661,8 +661,55 @@ - icon.skill0000 - A1 + icon.bm_royal_black_beer + A2 + 2 + 300000 + 500 + HONEY_BEER + 1 + 1800 + true + true + SELF + SINGLE + + + 3 + STR + + + 3 + CON + + + 3 + DEX + + + 3 + INT + + + 3 + WIT + + + 3 + MEN + + + 3 + LUC + + + 3 + CHA + + + 30 + + 1 diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/39700-39799.xml b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/39700-39799.xml index a146a05b51..b69533dfa3 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/39700-39799.xml +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/39700-39799.xml @@ -135,7 +135,36 @@ icon.skill0000 + 500 + 2 + + 1 + 1 + 1 + + 81782 + 1 A1 + 5 + 1.5 + SELF + SINGLE + + + + 105 + + + + + + 13608 + 13609 + 13610 + + 1 + +