Noticias:

Debes de estar registrado para poder ver el contenido indicado. Registrate o Conectate

Menú Principal

Evento Save the Cow

Iniciado por Swarlog, Ago 06, 2022, 02:17 AM

Tema anterior - Siguiente tema

Swarlog


### Eclipse Workspace Patch 1.0
#P L2J_DataPack_BETA
Index: dist/game/data/scripts.cfg
===================================================================
--- dist/game/data/scripts.cfg (revision 10487)
+++ dist/game/data/scripts.cfg (working copy)
@@ -313,3 +313,4 @@
 #events/FreyaCelebration/FreyaCelebration.java
 #events/MasterOfEnchanting/MasterOfEnchanting.java
 #events/LoveYourGatekeeper/LoveYourGatekeeper.java
+events/SaveTheCow/SaveTheCow.java
\ No newline at end of file
Index: dist/game/data/scripts/events/SaveTheCow/32476-12.htm
===================================================================
--- dist/game/data/scripts/events/SaveTheCow/32476-12.htm (revision 0)
+++ dist/game/data/scripts/events/SaveTheCow/32476-12.htm (working copy)
@@ -0,0 +1,3 @@
+<html><body>Employee of Magic Research Institute:<br>
+The situation here is back to normal, and the event pack sale is over.
+</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/events/SaveTheCow/32476-04.htm
===================================================================
--- dist/game/data/scripts/events/SaveTheCow/32476-04.htm (revision 0)
+++ dist/game/data/scripts/events/SaveTheCow/32476-04.htm (working copy)
@@ -0,0 +1,4 @@
+<html><body>Employee of Magic Research Institute:<br>
+You must bring at least <font color="LEVEL">50 Apigas</font> in order to receive a reward.<br>
+Come again when you have enough.
+</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/events/SaveTheCow/32476-08.htm
===================================================================
--- dist/game/data/scripts/events/SaveTheCow/32476-08.htm (revision 0)
+++ dist/game/data/scripts/events/SaveTheCow/32476-08.htm (working copy)
@@ -0,0 +1,7 @@
+<html><body>Employee of Magic Research Institute:<br>
+You'll help us? Excellent! Let me give you some instructions. Come see me <font color="LEVEL">every 12 hours</font> and I'll give you a scroll and a Cupid's Fatigue Recovery Potion, which you can use to call out the fatigued cows and revitalize them. Just so you know, the captain cows are very difficult -- you'll need some friends to help you. <font color="LEVEL">Also remember</font> that you must be careful not to lease the cow during the revitalization process, since the cows are very sensitive animals.<br>
+If you find the lost scrolls, you can also use them to revitalize the cows' energies. After you've done so, the cows will pay you in their currency, which is called Apiga. Bring that Apiga to me and I'll give you a reward. Oh, sometimes a bull or captain bull will give you Golden Apiga. Bring me that and I'll give you a special reward. One more thing: some very fatigued cows will need their energies revitalized very quickly. If you can do so within the required time frame, the Apigas you'll receive will be doubled.<br>
+<br>
+<br>
+<a action="bypass -h Quest SaveTheCow 32476-09.htm">Ask about Apigas.</a>
+</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/events/SaveTheCow/32476-03.htm
===================================================================
--- dist/game/data/scripts/events/SaveTheCow/32476-03.htm (revision 0)
+++ dist/game/data/scripts/events/SaveTheCow/32476-03.htm (working copy)
@@ -0,0 +1,4 @@
+<html><body>Employee of Magic Research Institute:<br>
+You need more Adena.<br>
+A minimum of <font color="LEVEL">10,000 Adena</font> is required.<br>
+</body></html>
\ No newline at end of file
Index: dist/game/data/stats/skills/02800-02899.xml
===================================================================
--- dist/game/data/stats/skills/02800-02899.xml (revision 10487)
+++ dist/game/data/stats/skills/02800-02899.xml (working copy)
@@ -1467,26 +1467,46 @@
  </for>
  </skill>
  <skill id="2867" levels="1" name="Cupid's Cure">
- <set name="effectPoint" val="-1000" />
+ <set name="baseCritRate" val="15" />
+ <set name="castRange" val="500" />
+ <set name="effectRange" val="700" />
+ <set name="hitTime" val="1000" />
  <set name="icon" val="icon.skill3260" />
  <set name="isMagic" val="2" /> <!-- Static Skill -->
  <set name="itemConsumeCount" val="1" />
  <set name="itemConsumeId" val="14722" /> <!-- Event - Cupid's Fatigue Recovery Potion -->
  <set name="magicLvl" val="1" />
- <set name="operateType" val="A1" />
- <set name="reuseDelay" val="1000" />
- <set name="targetType" val="NONE" />
+ <set name="mpConsume" val="1" />
+ <set name="operateType" val="A1" />
+ <set name="power" val="100" />
+ <set name="reuseDelay" val="1000" />
+ <set name="skillType" val="PDAM" />
+ <set name="staticDamage" val="true" />
+ <set name="targetType" val="ONE" />
+ <cond msgId="109">
+ <target npcId="13187,13188,13189,13190,13191,13192" />
+ </cond>
  </skill>
  <skill id="2868" levels="1" name="Cupid's Enhanced Cure">
- <set name="effectPoint" val="-1000" />
+ <set name="baseCritRate" val="15" />
+ <set name="castRange" val="500" />
+ <set name="effectRange" val="700" />
+ <set name="hitTime" val="1000" />
  <set name="icon" val="icon.skill3260" />
- <set name="isMagic" val="2" /> <!-- Static Skill -->
+ <set name="isMagic" val="2" /> <!-- Static Skill -->
  <set name="itemConsumeCount" val="1" />
  <set name="itemConsumeId" val="14723" /> <!-- Event - Cupid's Powerful Fatigue Recovery Potion -->
  <set name="magicLvl" val="1" />
- <set name="operateType" val="A1" />
- <set name="reuseDelay" val="4000" />
- <set name="targetType" val="NONE" />
+ <set name="mpConsume" val="1" />
+ <set name="operateType" val="A1" />
+ <set name="power" val="200" />
+ <set name="reuseDelay" val="4000" />
+ <set name="skillType" val="PDAM" />
+ <set name="staticDamage" val="true" />
+ <set name="targetType" val="ONE" />
+ <cond msgId="109">
+ <target npcId="13187,13188,13189,13190,13191,13192" />
+ </cond>
  </skill>
  <skill id="2869" levels="1" name="Event - Milk Cow Summon Scroll">
  <!-- Confirmed CT2.5 -->
Index: dist/game/data/scripts/events/SaveTheCow/SaveTheCow.java
===================================================================
--- dist/game/data/scripts/events/SaveTheCow/SaveTheCow.java (revision 0)
+++ dist/game/data/scripts/events/SaveTheCow/SaveTheCow.java (working copy)
@@ -0,0 +1,475 @@
+/*
+ * Copyright (C) 2004-2014 L2J DataPack
+ *
+ * This file is part of L2J DataPack.
+ *
+ * L2J DataPack 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.
+ *
+ * L2J DataPack 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 <http://www.gnu.org/licenses/>.
+ */
+package events.SaveTheCow;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.l2jserver.gameserver.ai.CtrlIntention;
+import com.l2jserver.gameserver.model.L2Object;
+import com.l2jserver.gameserver.model.actor.L2Attackable;
+import com.l2jserver.gameserver.model.actor.L2Npc;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.event.LongTimeEvent;
+import com.l2jserver.gameserver.model.holders.ItemHolder;
+import com.l2jserver.gameserver.model.holders.QuestItemHolder;
+import com.l2jserver.gameserver.model.holders.SkillHolder;
+import com.l2jserver.gameserver.model.itemcontainer.Inventory;
+import com.l2jserver.gameserver.model.quest.QuestState;
+import com.l2jserver.gameserver.model.skills.Skill;
+import com.l2jserver.gameserver.model.variables.PlayerVariables;
+import com.l2jserver.gameserver.network.NpcStringId;
+import com.l2jserver.gameserver.network.SystemMessageId;
+import com.l2jserver.gameserver.network.clientpackets.Say2;
+import com.l2jserver.gameserver.network.serverpackets.NpcSay;
+import com.l2jserver.gameserver.network.serverpackets.PlaySound;
+import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
+
+/**
+ * Save the Cow event AI.<br>
+ * Partially based on GKR's Catch a Tiger event.
+ * @author Pandragon
+ */
+public class SaveTheCow extends LongTimeEvent
+{
+ // NPC
+ private static final int MANAGER = 32476;
+ // Items
+ private static final int POTION = 14722;
+ private static final int APIGA = 14720;
+ private static final int GOLDEN_APIGA = 14721;
+ private static final int PACKAGE = 14740;
+ // Monsters
+ private static final int MILK_COW = 13187;
+ private static final int HEAD_MILK_COW = 13188;
+ private static final int BULL = 13189;
+ private static final int HEAD_BULL = 13190;
+ private static final int GLOOMY_MILK_COW = 13191;
+ private static final int GLOOMY_HEAD_MILK_COW = 13192;
+ private static final int PIG = 13196;
+ // Rewards
+ private static final int GEMSTONE_S = 2134;
+ private static final int VITALITY_POTION = 15438; // Vitality Maintaining Potion (10 minutes)
+ private static final QuestItemHolder[] REWARDS =
+ {
+ new QuestItemHolder(14739, 61, 10), // Event - Fresh Milk
+ new QuestItemHolder(8664, 48, 2), // Facelifting Potion - A (Event)
+ new QuestItemHolder(8665, 45, 2), // Facelifting Potion - B (Event)
+ new QuestItemHolder(8666, 42, 2), // Facelifting Potion - C (Event)
+ new QuestItemHolder(8671, 39, 2), // Hair Style Change Potion - A (Event)
+ new QuestItemHolder(8672, 36, 2), // Hair Style Change Potion - B (Event)
+ new QuestItemHolder(8673, 33, 2), // Hair Style Change Potion - C (Event)
+ new QuestItemHolder(8674, 30, 2), // Hair Style Change Potion - D (Event)
+ new QuestItemHolder(8675, 27, 2), // Hair Style Change Potion - E (Event)
+ new QuestItemHolder(8676, 24, 2), // Hair Style Change Potion - F (Event)
+ new QuestItemHolder(8677, 21, 2), // Hair Style Change Potion - G (Event)
+ new QuestItemHolder(8667, 18, 2), // Dye Potion - A (Event)
+ new QuestItemHolder(8668, 15, 2), // Dye Potion - B (Event)
+ new QuestItemHolder(8669, 12, 2), // Dye Potion - C (Event)
+ new QuestItemHolder(8670, 9, 2), // Dye Potion - D (Event)
+ new QuestItemHolder(9570, 8, 1), // Red Soul Crystal - Stage 14
+ new QuestItemHolder(9571, 7, 1), // Blue Soul Crystal - Stage 14
+ new QuestItemHolder(9572, 6, 1), // Green Soul Crystal - Stage 14
+ new QuestItemHolder(10480, 5, 1), // Red Soul Crystal - Stage 15
+ new QuestItemHolder(10481, 4, 1), // Blue Soul Crystal - Stage 15
+ new QuestItemHolder(10482, 3, 1), // Green Soul Crystal - Stage 15
+ new QuestItemHolder(13071, 2, 1), // Red Soul Crystal - Stage 16
+ new QuestItemHolder(13072, 1, 1), // Blue Soul Crystal - Stage 16
+ new QuestItemHolder(13073, 0, 1), // Green Soul Crystal - Stage 16
+ };
+ // Misc
+ private static final int PAYMENT = 10000;
+ private static final long INTERVAL = 12L * 60 * 60 * 1000; // 12hours
+
+ private static final int MILK_COW_SKILL = 2869; // Scroll Skill
+ private static final int HEAD_MILK_COW_SKILL = 2870; // Scroll Skill
+ private static final int GLOOMY_MILK_COW_SKILL = 2871; // Scroll Skill
+ private static final int GLOOMY_HEAD_MILK_COW_SKILL = 2872; // Scroll Skill
+ private static final int CUPID_CURE = 2867; // Cupid's Cure
+ private static final int CUPID_ENHANCED_CURE = 2868; // Cupid's Enhanced Cure
+ private static final SkillHolder DOUBT_SKILL = new SkillHolder(5994, 1); // Effect of Doubt
+
+ private static Map<Integer, ItemHolder> CUPID_CURE_CHANCES = new HashMap<>();
+ {
+ CUPID_CURE_CHANCES.put(MILK_COW, new ItemHolder(30, 2));
+ CUPID_CURE_CHANCES.put(GLOOMY_MILK_COW, new ItemHolder(25, 3));
+ CUPID_CURE_CHANCES.put(HEAD_MILK_COW, new ItemHolder(20, 4));
+ CUPID_CURE_CHANCES.put(GLOOMY_HEAD_MILK_COW, new ItemHolder(15, 5));
+ }
+ private static Map<Integer, ItemHolder> CUPID_ENHANCED_CURE_CHANCES = new HashMap<>();
+ {
+ CUPID_CURE_CHANCES.put(MILK_COW, new ItemHolder(50, 2));
+ CUPID_CURE_CHANCES.put(GLOOMY_MILK_COW, new ItemHolder(45, 3));
+ CUPID_CURE_CHANCES.put(HEAD_MILK_COW, new ItemHolder(40, 4));
+ CUPID_CURE_CHANCES.put(GLOOMY_HEAD_MILK_COW, new ItemHolder(25, 5));
+ }
+
+ private static final NpcStringId[] PIG_SKILL_ATTACK_TEXT =
+ {
+ NpcStringId.WHATS_THIS_FOOD,
+ NpcStringId.MY_ENERGY_IS_OVERFLOWING_I_DONT_NEED_ANY_FATIGUE_RECOVERY_POTION,
+ NpcStringId.WHATS_THE_MATTER_THATS_AN_AMATEUR_MOVE
+ };
+
+ private static final NpcStringId[] PIG_ON_SPAWN_TEXT =
+ {
+ NpcStringId.ROAR_NO_OINK_OINK_SEE_IM_A_PIG_OINK_OINK,
+ NpcStringId.WHO_AM_I_WHERE_AM_I_OINK_OINK
+ };
+
+ private static final NpcStringId[] NO_SKILL_ATTACK_TEXT =
+ {
+ NpcStringId.HEY_ARE_YOU_PLANNING_ON_EATING_ME_USE_A_CUPIDS_FATIGUE_RECOVERY_POTION_ALREADY,
+ NpcStringId.ILL_PASS_ON_AN_AMATEURS_MERIDIAN_MASSAGE_USE_A_CUPIDS_FATIGUE_RECOVERY_POTION_ALREADY
+ };
+
+ private static final String[] DEATH_TEXT =
+ {
+ "*Muuuu* I feel like I could use a nap...!",
+ "*Muuuu* I'm sleepy. Think I'll go take a nap.",
+ "I can't feel my legs anymore... ZzzZzz"
+ };
+
+ private SaveTheCow()
+ {
+ super(SaveTheCow.class.getSimpleName(), "events");
+ addFirstTalkId(MANAGER);
+ addStartNpc(MANAGER);
+ addTalkId(MANAGER);
+ addSpawnId(MILK_COW, HEAD_MILK_COW, GLOOMY_MILK_COW, GLOOMY_HEAD_MILK_COW, PIG);
+ addAttackId(MILK_COW, HEAD_MILK_COW, GLOOMY_MILK_COW, GLOOMY_HEAD_MILK_COW, PIG);
+ addKillId(BULL, HEAD_BULL);
+ addSkillSeeId(MILK_COW, HEAD_MILK_COW, GLOOMY_MILK_COW, GLOOMY_HEAD_MILK_COW);
+ }
+
+ @Override
+ public String onFirstTalk(L2Npc npc, L2PcInstance player)
+ {
+ if (player.getQuestState(getName()) == null)
+ {
+ newQuestState(player);
+ }
+ return isDropPeriod() ? "32476-01.htm" : "32476-11.htm";
+ }
+
+ @Override
+ public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
+ {
+ final QuestState st = player.getQuestState(getName());
+ String htmltext = event.endsWith(".htm") ? event : "";
+
+ if (st == null)
+ {
+ return null;
+ }
+
+ switch (event)
+ {
+ case "give_package":
+ {
+ if (isDropPeriod())
+ {
+ if (getQuestItemsCount(player, Inventory.ADENA_ID) >= PAYMENT)
+ {
+ final long now = System.currentTimeMillis();
+ final PlayerVariables vars = player.getVariables();
+ final long nextTime = vars.getString("SAVE_THE_COW_REWARD_TIME", null) == null ? 0 : Long.parseLong(vars.getString("SAVE_THE_COW_REWARD_TIME"));
+
+ if (now > nextTime)
+ {
+ st.startQuest();
+ takeItems(player, Inventory.ADENA_ID, PAYMENT);
+ giveItems(player, PACKAGE, 1);
+ vars.set("SAVE_THE_COW_REWARD_TIME", Long.toString(System.currentTimeMillis() + INTERVAL));
+ }
+ else
+ {
+ long remainingTime = (nextTime - System.currentTimeMillis()) / 1000;
+ int hours = (int) (remainingTime / 3600);
+ int minutes = (int) ((remainingTime % 3600) / 60);
+ SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.AVAILABLE_AFTER_S1_S2_HOURS_S3_MINUTES);
+ sm.addItemName(PACKAGE);
+ sm.addInt(hours);
+ sm.addInt(minutes);
+ player.sendPacket(sm);
+ }
+ }
+ else
+ {
+ htmltext = "32476-03.htm";
+ }
+ }
+ else
+ {
+ htmltext = "32476-12.htm";
+ }
+ break;
+ }
+ case "give_potions":
+ {
+ if (player.getAdena() >= PAYMENT)
+ {
+ takeItems(player, Inventory.ADENA_ID, PAYMENT);
+ giveItems(player, POTION, 200);
+ }
+ else
+ {
+ htmltext = "32476-03.htm";
+ }
+ break;
+ }
+ case "give_reward":
+ {
+ if (getQuestItemsCount(player, APIGA) >= 50)
+ {
+ htmltext = "32476-06.htm";
+ takeItems(player, APIGA, 50);
+ int random = getRandom(100);
+ for (QuestItemHolder holder : REWARDS)
+ {
+ if (random >= holder.getChance())
+ {
+ rewardItems(player, holder.getId(), getRandom(1, (int) holder.getCount()));
+ break;
+ }
+ }
+ }
+ else
+ {
+ htmltext = "32476-04.htm";
+ }
+ break;
+ }
+ case "give_adv_reward":
+ {
+ if (getQuestItemsCount(player, GOLDEN_APIGA) >= 50)
+ {
+ htmltext = "32476-06.htm";
+ takeItems(player, APIGA, 50);
+ rewardItems(player, VITALITY_POTION, 1);
+ rewardItems(player, GEMSTONE_S, 1);
+ rewardItems(player, getRandom(9546, 9551), 1); // random attribute stone
+ }
+ else
+ {
+ htmltext = "32476-05.htm";
+ }
+ break;
+ }
+ case "double_reward_lost":
+ {
+ if (npc != null)
+ {
+ npc.setBusyMessage("normal");
+ }
+ break;
+ }
+ }
+ return htmltext;
+ }
+
+ @Override
+ public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet, Skill skill)
+ {
+ // start counting down
+ if (!npc.isBusy())
+ {
+ npc.setBusy(true);
+ startQuestTimer("double_reward_lost", 10000, npc, null);
+ }
+
+ int npcId = npc.getId();
+ if ((skill != null) && ((skill.getId() == CUPID_CURE) || (skill.getId() == CUPID_ENHANCED_CURE)))
+ {
+ if (npcId != PIG)
+ {
+ String snd = ((npcId == MILK_COW) || (npcId == GLOOMY_MILK_COW)) ? "EV_04" : "EV_03";
+ attacker.sendPacket(new PlaySound(snd));
+ }
+ }
+ else
+ {
+ npc.broadcastPacket(new NpcSay(npc.getObjectId(), Say2.NPC_ALL, npcId, (npcId == PIG) ? PIG_SKILL_ATTACK_TEXT[getRandom(3)] : NO_SKILL_ATTACK_TEXT[getRandom(2)]));
+ if (getRandom(100) < 10)
+ {
+ npc.setTarget(attacker);
+ npc.doCast(DOUBT_SKILL.getSkill());
+ }
+ }
+ return super.onAttack(npc, attacker, damage, isPet, skill);
+ }
+
+ @Override
+ public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet)
+ {
+ if (killer.getQuestState(getName()) == null)
+ {
+ newQuestState(killer);
+ }
+
+ if (npc.getId() == HEAD_BULL)
+ {
+ if (getRandomBoolean())
+ {
+ rewardItems(killer, GOLDEN_APIGA, getRandom(5, 10));
+ }
+ else
+ {
+ rewardItems(killer, APIGA, getRandom(5, 10));
+ }
+ }
+ else
+ {
+ if (getRandomBoolean())
+ {
+ rewardItems(killer, GOLDEN_APIGA, getRandom(3, 5));
+ }
+ else
+ {
+ rewardItems(killer, APIGA, getRandom(3, 5));
+ }
+ }
+ NpcSay ns = new NpcSay(npc.getObjectId(), Say2.NPC_ALL, npc.getId(), DEATH_TEXT[getRandom(3)]);
+ npc.broadcastPacket(ns);
+ return super.onKill(npc, killer, isPet);
+ }
+
+ @Override
+ public String onSpawn(L2Npc npc)
+ {
+ if (npc.getId() == PIG)
+ {
+ npc.broadcastPacket(new NpcSay(npc.getObjectId(), Say2.NPC_ALL, npc.getId(), PIG_ON_SPAWN_TEXT[getRandom(2)]));
+ }
+ else
+ {
+ npc.disableCoreAI(true);
+ }
+ return super.onSpawn(npc);
+ }
+
+ @Override
+ public String onSkillSee(L2Npc npc, L2PcInstance caster, Skill skill, L2Object[] targets, boolean isPet)
+ {
+ final int skillId = skill.getId();
+ final int npcId = npc.getId();
+
+ if (!npc.isInvul())
+ {
+ // Summon randomness (cow, bull or pig)
+ switch (skillId)
+ {
+ case MILK_COW_SKILL:
+ case GLOOMY_MILK_COW_SKILL:
+ {
+ final int random = getRandom(10);
+ if (random == 0)
+ {
+ addSpawn(PIG, npc, false, 10000);
+ npc.deleteMe();
+ }
+ else if (random < 3)
+ {
+ final L2Attackable bullSpawn = (L2Attackable) addSpawn(BULL, npc, false, 360000);
+ npc.deleteMe();
+ bullSpawn.addDamageHate(caster, 0, 500);
+ bullSpawn.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, caster);
+ bullSpawn.setRunning();
+ }
+ else
+ {
+ npc.setIsInvul(true);
+ npc.setBusy(false);
+ npc.setBusyMessage("double");
+ }
+ break;
+ }
+ case HEAD_MILK_COW_SKILL:
+ case GLOOMY_HEAD_MILK_COW_SKILL:
+ {
+ final int random = getRandom(10);
+ if (random == 0)
+ {
+ addSpawn(PIG, npc, false, 10000);
+ npc.deleteMe();
+ }
+ else if (random < 3)
+ {
+ final L2Attackable bullSpawn = (L2Attackable) addSpawn(HEAD_BULL, npc, false, 360000);
+ npc.deleteMe();
+ bullSpawn.addDamageHate(caster, 0, 500);
+ bullSpawn.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, caster);
+ bullSpawn.setRunning();
+ }
+ else
+ {
+ npc.setIsInvul(true);
+ npc.setBusy(false);
+ npc.setBusyMessage("double");
+ }
+ break;
+ }
+ }
+ }
+
+ final int chance;
+ final int maxCount;
+
+ if (caster.getTarget() != npc)
+ {
+ chance = 0;
+ maxCount = 0;
+ }
+ else if (skillId == CUPID_CURE)
+ {
+ chance = CUPID_CURE_CHANCES.get(npcId).getId();
+ maxCount = (int) CUPID_CURE_CHANCES.get(npcId).getCount();
+ }
+ else if (skillId == CUPID_ENHANCED_CURE)
+ {
+ chance = CUPID_ENHANCED_CURE_CHANCES.get(npcId).getId();
+ maxCount = (int) CUPID_ENHANCED_CURE_CHANCES.get(npcId).getCount();
+ }
+ else
+ {
+ chance = 0;
+ maxCount = 0;
+ }
+
+ if ((chance > 0) && (getRandom(100) < chance))
+ {
+ if (npc.getBusyMessage().equals("double") && ((npcId == GLOOMY_MILK_COW) || (npcId == GLOOMY_HEAD_MILK_COW)))
+ {
+ rewardItems(caster, APIGA, getRandom(maxCount, maxCount * 2));
+ }
+ else
+ {
+ rewardItems(caster, APIGA, getRandom(1, maxCount));
+ }
+ npc.deleteMe();
+ }
+
+ return super.onSkillSee(npc, caster, skill, targets, isPet);
+ }
+
+ public static void main(String[] args)
+ {
+ new SaveTheCow();
+ }
+}
\ No newline at end of file
Index: dist/game/data/stats/items/14700-14799.xml
===================================================================
--- dist/game/data/stats/items/14700-14799.xml (revision 10487)
+++ dist/game/data/stats/items/14700-14799.xml (working copy)
@@ -316,7 +316,7 @@
  <set name="reuse_delay" val="10000" />
  <set name="is_stackable" val="true" />
  <set name="handler" val="ItemSkills" />
- <set name="item_skill" val="2880-1" />
+ <set name="item_skill" val="2871-1" />
  </item>
  <item id="14727" type="EtcItem" name="Event - Gloomy Head Milk Cow Summon Scroll">
  <set name="icon" val="icon.etc_scroll_of_milkcattle_b_i00" />
@@ -326,7 +326,7 @@
  <set name="reuse_delay" val="10000" />
  <set name="is_stackable" val="true" />
  <set name="handler" val="ItemSkills" />
- <set name="item_skill" val="2881-1" />
+ <set name="item_skill" val="2872-1" />
  </item>
  <item id="14728" type="EtcItem" name="Event - Orr Cube - 30-day limited period">
  <set name="icon" val="icon.etc_ore_cube_event_i00" />
Index: dist/game/data/scripts/events/SaveTheCow/32476-07.htm
===================================================================
--- dist/game/data/scripts/events/SaveTheCow/32476-07.htm (revision 0)
+++ dist/game/data/scripts/events/SaveTheCow/32476-07.htm (working copy)
@@ -0,0 +1,8 @@
+<html><body>Employee of Magic Research Institute:<br>
+A few days ago, the Magic Research Institute finally developed a new device to rapidly revitalize the cows' energies. We have already received a larger number of orders.<br>
+But the device was overwhelmed and suddenly exploded; the order scrolls were scattered to the four winds!<br>
+Until we have repaired the device, all orders have to be input manually. Worse, we still have to find all those missing scrolls! And we're very short-handed as it is...<br>
+<br>
+<br>
+<a action="bypass -h Quest SaveTheCow 32476-08.htm">"Can I help you?"</a>
+</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/events/SaveTheCow/32476-09.htm
===================================================================
--- dist/game/data/scripts/events/SaveTheCow/32476-09.htm (revision 0)
+++ dist/game/data/scripts/events/SaveTheCow/32476-09.htm (working copy)
@@ -0,0 +1,4 @@
+<html><body>Employee of Magic Research Institute:<br>
+Enscribed on the Apiga is the figure of a smiling pig, a traditional image of wealth and luck. Adventurers particularly favor them as tokens of good fortune. They often give Apigas to friends as gifts.<br>
+I don't know if Apigas really will bring you luck, but since we need adventurers right now, I'm very glad that they believe that!
+</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/events/SaveTheCow/32476-10.htm
===================================================================
--- dist/game/data/scripts/events/SaveTheCow/32476-10.htm (revision 0)
+++ dist/game/data/scripts/events/SaveTheCow/32476-10.htm (working copy)
@@ -0,0 +1,3 @@
+<html><body>Employee of Magic Research Institute:<br>
+We have prepared <font color="LEVEL">Fresh Milk</font> from the cows, lots of <font color="LEVEL">Facelifting Potions</font> and even <font color="LEVEL">level 14 to 16 Soul Crystals</font> for adventurers who help us. As a reward for bringing us Golden Apigas, we will give you an <font color="LEVEL">S Grade Gemstone</font>, an <font color="LEVEL">Attribute Stone</font> and also a <font color="LEVEL">Vitality Maintaining Potion</font> which restores your vitality.<br>
+</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/events/SaveTheCow/32476-02.htm
===================================================================
--- dist/game/data/scripts/events/SaveTheCow/32476-02.htm (revision 0)
+++ dist/game/data/scripts/events/SaveTheCow/32476-02.htm (working copy)
@@ -0,0 +1,9 @@
+<html><body>Employee of Magic Research Institute:<br>
+Thank you very much!<br>
+Bring 50 Apigas or Golden Apigas and we will give you a reward.<br>
+<br>
+<br>
+<a action="bypass -h Quest SaveTheCow give_reward">Give her 50 Apigas.</a><br>
+<a action="bypass -h Quest SaveTheCow give_adv_reward">Give her 50 Golden Apigas.</a><br>
+<a action="bypass -h Quest SaveTheCow 32476-10.htm">Ask about the reward.</a>
+</body></html>
\ No newline at end of file
Index: dist/game/data/stats/npcs/13100-13200.xml
===================================================================
--- dist/game/data/stats/npcs/13100-13200.xml (revision 10487)
+++ dist/game/data/stats/npcs/13100-13200.xml (working copy)
@@ -3307,7 +3307,7 @@
  <height normal="50" />
  </collision>
  </npc>
- <npc id="13187" level="85" type="L2Npc" name="Milk Cow">
+ <npc id="13187" level="85" type="L2Monster" name="Milk Cow">
  <!-- Confirmed CT2.5 -->
  <race>ANIMAL</race>
  <sex>MALE</sex>
@@ -3343,7 +3343,7 @@
  <height normal="12.5" />
  </collision>
  </npc>
- <npc id="13188" level="85" type="L2Npc" name="Head Milk Cow">
+ <npc id="13188" level="85" type="L2Monster" name="Head Milk Cow">
  <!-- Confirmed CT2.5 -->
  <race>ANIMAL</race>
  <sex>MALE</sex>
@@ -3379,7 +3379,7 @@
  <height normal="28.5" />
  </collision>
  </npc>
- <npc id="13189" level="85" type="L2Npc" name="Bull">
+ <npc id="13189" level="85" type="L2Monster" name="Bull">
  <!-- Confirmed CT2.5 -->
  <race>ANIMAL</race>
  <sex>MALE</sex>
@@ -3415,7 +3415,7 @@
  <height normal="12.5" />
  </collision>
  </npc>
- <npc id="13190" level="85" type="L2Npc" name="Head Bull">
+ <npc id="13190" level="85" type="L2Monster" name="Head Bull">
  <!-- Confirmed CT2.5 -->
  <race>ANIMAL</race>
  <sex>MALE</sex>
@@ -3451,7 +3451,7 @@
  <height normal="28.5" />
  </collision>
  </npc>
- <npc id="13191" level="85" type="L2Npc" name="Gloomy Milk Cow">
+ <npc id="13191" level="85" type="L2Monster" name="Gloomy Milk Cow">
  <!-- Confirmed CT2.5 -->
  <race>ANIMAL</race>
  <sex>MALE</sex>
@@ -3487,7 +3487,7 @@
  <height normal="12.5" />
  </collision>
  </npc>
- <npc id="13192" level="85" type="L2Npc" name="Gloomy Head Milk Cow">
+ <npc id="13192" level="85" type="L2Monster" name="Gloomy Head Milk Cow">
  <!-- Confirmed CT2.5 -->
  <race>ANIMAL</race>
  <sex>MALE</sex>
Index: dist/game/data/scripts/events/SaveTheCow/config.xml
===================================================================
--- dist/game/data/scripts/events/SaveTheCow/config.xml (revision 0)
+++ dist/game/data/scripts/events/SaveTheCow/config.xml (working copy)
@@ -0,0 +1,49 @@
+<Event name="Save the Cow" active="12 10 2009-26 10 2009" dropPeriod="12 10 2009-25 10 2009">
+ <Droplist>
+ <add item="14724" min="1" max="1" chance="1%" /> <!-- Milk Cow Scroll -->
+ <add item="14725" min="1" max="1" chance="1%" /> <!-- Head Milk Cow Scroll -->
+ <add item="14726" min="1" max="1" chance="1%" /> <!-- Gloomy Milk Cow Scroll -->
+ <add item="14727" min="1" max="1" chance="1%" /> <!-- Gloomy Milk Head Cow Scroll -->
+ </Droplist>
+ <Spawnlist>
+ <add npc="32476" x="16111" y="142850" z="-2707" heading="16000" />
+ <add npc="32476" x="17275" y="145000" z="-3037" heading="25000" />
+ <add npc="32476" x="83037" y="149324" z="-3470" heading="44000" />
+ <add npc="32476" x="82145" y="148609" z="-3468" heading="0" />
+ <add npc="32476" x="81755" y="146487" z="-3534" heading="32768" />
+ <add npc="32476" x="-81031" y="150038" z="-3045" heading="0" />
+ <add npc="32476" x="-83156" y="150994" z="-3130" heading="0" />
+ <add npc="32476" x="-13727" y="122117" z="-2990" heading="16384" />
+ <add npc="32476" x="-14129" y="123869" z="-3118" heading="40959" />
+ <add npc="32476" x="-84411" y="244813" z="-3730" heading="57343" />
+ <add npc="32476" x="-84023" y="243051" z="-3730" heading="4096" />
+ <add npc="32476" x="46908" y="50856" z="-2997" heading="8192" />
+ <add npc="32476" x="45538" y="48357" z="-3061" heading="18000" />
+ <add npc="32476" x="9929" y="16324" z="-4576" heading="62999" />
+ <add npc="32476" x="11546" y="17599" z="-4586" heading="46900" />
+ <add npc="32476" x="81987" y="53723" z="-1497" heading="0" />
+ <add npc="32476" x="81083" y="56118" z="-1562" heading="32768" />
+ <add npc="32476" x="147200" y="25614" z="-2014" heading="16384" />
+ <add npc="32476" x="148557" y="26806" z="-2206" heading="32768" />
+ <add npc="32476" x="117356" y="76708" z="-2695" heading="49151" />
+ <add npc="32476" x="115887" y="76382" z="-2714" heading="0" />
+ <add npc="32476" x="-117239" y="46842" z="367" heading="49151" />
+ <add npc="32476" x="-119494" y="44882" z="367" heading="24576" />
+ <add npc="32476" x="111004" y="218928" z="-3544" heading="16384" />
+ <add npc="32476" x="108426" y="221876" z="-3600" heading="49151" />
+ <add npc="32476" x="-45278" y="-112766" z="-241" heading="0" />
+ <add npc="32476" x="-45372" y="-114104" z="-241" heading="16384" />
+ <add npc="32476" x="115096" y="-178370" z="-891" heading="0" />
+ <add npc="32476" x="116199" y="-182694" z="-1506" heading="0" />
+ <add npc="32476" x="86865" y="-142915" z="-1341" heading="26000" />
+ <add npc="32476" x="85584" y="-142490" z="-1343" heading="0" />
+ <add npc="32476" x="147421" y="-55435" z="-2736" heading="49151" />
+ <add npc="32476" x="148206" y="-55786" z="-2782" heading="61439" />
+ <add npc="32476" x="43165" y="-48461" z="-797" heading="17000" />
+ <add npc="32476" x="43966" y="-47709" z="-798" heading="49999" />
+ </Spawnlist>
+ <messages>
+ <add type="onEnd" text="Save the Cow: Event end!" />
+ <add type="onEnter" text="Save the Cow: Event ongoing!" />
+ </messages>
+</Event>
\ No newline at end of file
Index: dist/game/data/scripts/events/SaveTheCow/32476-06.htm
===================================================================
--- dist/game/data/scripts/events/SaveTheCow/32476-06.htm (revision 0)
+++ dist/game/data/scripts/events/SaveTheCow/32476-06.htm (working copy)
@@ -0,0 +1,4 @@
+<html><body>Employee of Magic Research Institute:<br>
+Please take it with our thanks for a job well done!<br>
+You have our undying gratitude!
+</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/events/SaveTheCow/32476-11.htm
===================================================================
--- dist/game/data/scripts/events/SaveTheCow/32476-11.htm (revision 0)
+++ dist/game/data/scripts/events/SaveTheCow/32476-11.htm (working copy)
@@ -0,0 +1,8 @@
+<html><body>Employee of Magic Research Institute:<br>
+Whew!<br>
+We were able to restore order quickly thanks to the help of so many adventurers.<br>
+Bring back Agigas or Golden Apigas and you will be rewarded.<br>
+<br>
+<br>
+<a action="bypass -h Quest SaveTheCow give_potions">Buy 200 Cupid's Fatigue Recovery Potions (10,000 Adena).</a>
+<a action="bypass -h Quest SaveTheCow 32476-02.htm">Receive a reward.</a></body></html>
\ No newline at end of file
Index: dist/game/data/scripts/events/SaveTheCow/32476-01.htm
===================================================================
--- dist/game/data/scripts/events/SaveTheCow/32476-01.htm (revision 0)
+++ dist/game/data/scripts/events/SaveTheCow/32476-01.htm (working copy)
@@ -0,0 +1,10 @@
+<html><body>Employee of Magic Research Institute:<br>
+Arghh! I am so busy! The work never stops!<br>
+It's worse than usual -- one of our prized devices has broken, and unless we can fix it all our research will screech to a stop. Please help us!<br>
+<br>
+<br>
+<a action="bypass -h Quest SaveTheCow 32476-07.htm">Ask what happened.</a><br>
+<a action="bypass -h Quest SaveTheCow give_package">Buy a "Save a Cow" Event Pack (10,000 Adena).</a><br>
+<a action="bypass -h Quest SaveTheCow give_potions">Buy 200 Cupid's Fatigue Recovery Potions (10,000 Adena).</a><br>
+<a action="bypass -h Quest SaveTheCow 32476-02.htm">Receive a reward.</a>
+</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/events/SaveTheCow/32476-05.htm
===================================================================
--- dist/game/data/scripts/events/SaveTheCow/32476-05.htm (revision 0)
+++ dist/game/data/scripts/events/SaveTheCow/32476-05.htm (working copy)
@@ -0,0 +1,4 @@
+<html><body>Employee of Magic Research Institute:<br>
+You must bring at least <font color="LEVEL">50 Golden Apigas</font> in order to receive a reward.<br>
+Come again when you have enough.
+</body></html>
\ No newline at end of file