All pastes #676180 Raw Edit

Stuff

public text v1 · immutable
#676180 ·published 2007-08-30 20:55 UTC
rendered paste body
Index: C:/Documents and Settings/Sparrowhawk/workspace/l2J/java/config/l2jmods.properties
===================================================================
--- C:/Documents and Settings/Sparrowhawk/workspace/l2J/java/config/l2jmods.properties	(revision 1062)
+++ C:/Documents and Settings/Sparrowhawk/workspace/l2J/java/config/l2jmods.properties	(working copy)
@@ -122,4 +122,46 @@
 # TvTEvent Rules
 TvTEventTargetTeamMembersAllowed = true
 TvTEventPotionsAllowed = false
-TvTEventSummonByItemAllowed = false
\ No newline at end of file
+TvTEventSummonByItemAllowed = false
+
+
+#---------------------------------------------------------------
+# Fishing event                                                -
+#---------------------------------------------------------------
+# System:
+# For every colour of fish the chance is increased by a count. 
+# The formula is "begin + count * order of colour". Green doesn't count.
+# Example:
+# Blue beginner fish, 2'nd colour: 9% chance
+# Red chest, 6'th colour: 5 + 5*6 = 35% chance
+#
+# Player gain fish or reward.
+# Colors: green, jade, blue, yellow, orange, purple, red, white, black
+#
+# Enable Fishing Event
+FishingEventEnable = true
+# Chance:
+# Beginners fish
+FishingEventBeginnersBegin = 5
+FishingEventBeginnersCount = 4
+# Normal fish
+FishingEventNormalBegin = 20
+FishingEventNormalCount = 8
+# Upper grade fish
+FishingEventUpperBegin = 25
+FishingEventUpperCount = 8
+# Chest
+FishingEventChestBegin = 5
+FishingEventChestCount = 10
+# Event reward id
+FishingEventRewardId = 8959
+# Event reward amount (qty is random qty from 1(inclusive) to x(inclusive))
+FishingEventFishRewardQty = 1
+FishingEventChestRewardQty = 3
+# Penalty monster drop reward itemu (monster do not drop reward item if Fishing event is not enabled)
+# Formula for drop from penalty monster is "begin + count * (lvl/10 -1)
+# Example:
+# Caught frog lvl 10, chance 20 + 5 * (10/10 -1) = 20
+FishingEventMonsterDrop = true
+FishingEventMonsterDropChanceBegin = 20
+FishingEventMonsterDropChanceCount = 5
\ No newline at end of file
Index: C:/Documents and Settings/Sparrowhawk/workspace/l2J/java/net/sf/l2j/Config.java
===================================================================
--- C:/Documents and Settings/Sparrowhawk/workspace/l2J/java/net/sf/l2j/Config.java	(revision 1062)
+++ C:/Documents and Settings/Sparrowhawk/workspace/l2J/java/net/sf/l2j/Config.java	(working copy)
@@ -805,6 +805,23 @@
     public static boolean L2JMOD_WEDDING_SAMESEX;
     public static boolean L2JMOD_WEDDING_FORMALWEAR;
     public static int L2JMOD_WEDDING_DIVORCE_COSTS;
+    
+    /** L2JMOD Fishing event */
+    public static boolean FISHING_EVENT_ENABLE;
+    public static int FISHING_EVENT_BEGINNERS_BEGIN;
+    public static int FISHING_EVENT_BEGINNERS_COUNT;
+    public static int FISHING_EVENT_NORMAL_BEGIN;
+    public static int FISHING_EVENT_NORMAL_COUNT;
+    public static int FISHING_EVENT_UPPER_BEGIN;
+    public static int FISHING_EVENT_UPPER_COUNT;
+    public static int FISHING_EVENT_CHEST_BEGIN;
+    public static int FISHING_EVENT_CHEST_COUNT;
+    public static int FISHING_EVENT_REWARD_ID;
+    public static int FISHING_EVENT_FISH_REWARD_QTY;
+    public static int FISHING_EVENT_CHEST_REWARD_QTY;
+    public static boolean FISHING_EVENT_MONSTER_DROP;
+    public static int FISHING_EVENT_MONSTER_DROP_CHANCE_BEGIN;
+    public static int FISHING_EVENT_MONSTER_DROP_CHANCE_COUNT;
 
     // Packet information
     /** Count the amount of packets per minute ? */  
@@ -1739,7 +1756,24 @@
                 L2JMOD_WEDDING_SAMESEX                  = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingAllowSameSex", "False"));
                 L2JMOD_WEDDING_FORMALWEAR               = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingFormalWear", "True"));
                 L2JMOD_WEDDING_DIVORCE_COSTS            = Integer.parseInt(L2JModSettings.getProperty("WeddingDivorceCosts", "20"));
-
+                
+                /** L2JMOD Fishing event  */
+                FISHING_EVENT_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("FishingEventEnable", "false"));
+                FISHING_EVENT_BEGINNERS_BEGIN = Integer.parseInt(L2JModSettings.getProperty("FishingEventBeginnersBegin", "5"));
+                FISHING_EVENT_BEGINNERS_COUNT = Integer.parseInt(L2JModSettings.getProperty("FishingEventBeginnersCount", "2"));
+                FISHING_EVENT_NORMAL_BEGIN = Integer.parseInt(L2JModSettings.getProperty("FishingEventNormalBegin", "10"));
+                FISHING_EVENT_NORMAL_COUNT = Integer.parseInt(L2JModSettings.getProperty("FishingEventNormalCount", "3"));
+                FISHING_EVENT_UPPER_BEGIN = Integer.parseInt(L2JModSettings.getProperty("FishingEventUpperBegin", "15"));
+                FISHING_EVENT_UPPER_COUNT = Integer.parseInt(L2JModSettings.getProperty("FishingEventUpperCount", "3"));
+                FISHING_EVENT_CHEST_BEGIN = Integer.parseInt(L2JModSettings.getProperty("FishingEventChestBegin", "5"));
+                FISHING_EVENT_CHEST_COUNT = Integer.parseInt(L2JModSettings.getProperty("FishingEventChestCount", "5"));
+                FISHING_EVENT_REWARD_ID = Integer.parseInt(L2JModSettings.getProperty("FishingEventRewardId", "8959"));
+                FISHING_EVENT_FISH_REWARD_QTY = Integer.parseInt(L2JModSettings.getProperty("FishingEventFishRewardQty", "1"));
+                FISHING_EVENT_CHEST_REWARD_QTY = Integer.parseInt(L2JModSettings.getProperty("FishingEventChestRewardQty", "3"));
+                FISHING_EVENT_MONSTER_DROP = Boolean.parseBoolean(L2JModSettings.getProperty("FishingEventMonsterDrop", "false"));
+                FISHING_EVENT_MONSTER_DROP_CHANCE_BEGIN = Integer.parseInt(L2JModSettings.getProperty("FishingEventMonsterDropChanceBegin", "20"));
+                FISHING_EVENT_MONSTER_DROP_CHANCE_COUNT = Integer.parseInt(L2JModSettings.getProperty("FishingEventMonsterDropChanceCount", "5"));
+                
                 if (TVT_EVENT_PARTICIPATION_NPC_ID == 0)
                 {
                     TVT_EVENT_ENABLED = false;
Index: C:/Documents and Settings/Sparrowhawk/workspace/l2J/java/net/sf/l2j/gameserver/model/L2Attackable.java
===================================================================
--- C:/Documents and Settings/Sparrowhawk/workspace/l2J/java/net/sf/l2j/gameserver/model/L2Attackable.java	(revision 1062)
+++ C:/Documents and Settings/Sparrowhawk/workspace/l2J/java/net/sf/l2j/gameserver/model/L2Attackable.java	(working copy)
@@ -1218,6 +1218,16 @@
     		 if (Config.AUTO_LOOT) player.addItem("ChampionLoot", item.getItemId(), item.getCount(), this, true); // Give this or these Item(s) to the L2PcInstance that has killed the L2Attackable
              else DropItem(player, item);	 
     	 }
+    	 
+    	 if (Config.FISHING_EVENT_ENABLE == true && Config.FISHING_EVENT_MONSTER_DROP == true){
+        	 if (this.getTemplate().type.toString().equals("L2PenaltyMonster")){
+        		 int amount = this.getTemplate().level/10; 
+        		 if (Rnd.get(100)<= (Config.FISHING_EVENT_MONSTER_DROP_CHANCE_BEGIN+Config.FISHING_EVENT_MONSTER_DROP_CHANCE_COUNT*(amount-1))){
+        			 RewardItem item = new RewardItem(Config.FISHING_EVENT_REWARD_ID,amount);
+        			 player.addItem("FishingLoot", item.getItemId(), item.getCount(), this, true); 
+        		 }
+        	 }
+         }
          
          //Instant Item Drop :>
     	 double rateHp = getStat().calcStat(Stats.MAX_HP , 1, this, null);
Index: C:/Documents and Settings/Sparrowhawk/workspace/l2J/java/net/sf/l2j/gameserver/model/L2Fishing.java
===================================================================
--- C:/Documents and Settings/Sparrowhawk/workspace/l2J/java/net/sf/l2j/gameserver/model/L2Fishing.java	(revision 1062)
+++ C:/Documents and Settings/Sparrowhawk/workspace/l2J/java/net/sf/l2j/gameserver/model/L2Fishing.java	(working copy)
@@ -18,7 +18,7 @@
 package net.sf.l2j.gameserver.model;
 
 import java.util.concurrent.Future;
-
+import net.sf.l2j.Config;
 import net.sf.l2j.gameserver.ThreadPoolManager;
 import net.sf.l2j.gameserver.datatables.NpcTable;
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
@@ -50,6 +50,7 @@
 	private double _regenHp;
 	private boolean _isUpperGrade;
 	private int _lureType;
+	private FishData _FishData;
 
 	public void run()
 	{
@@ -72,6 +73,7 @@
 	public L2Fishing(L2PcInstance Fisher, FishData fish, boolean isNoob, boolean isUpperGrade)
 	{
 		_fisher = Fisher;
+		_FishData = fish;
 		_fishMaxHp = fish.getHP();
 		_fishCurHp = _fishMaxHp;
 		_regenHp = fish.getHpRegen();
@@ -136,7 +138,41 @@
 			}
 			else {
 				_fisher.sendPacket(new SystemMessage(SystemMessageId.YOU_CAUGHT_SOMETHING));
-				_fisher.addItem("Fishing", _fishId, 1, null, true);
+				if(Config.FISHING_EVENT_ENABLE == true){
+					int begin = 0;
+					int count = 0;
+					int drop = Rnd.get(Config.FISHING_EVENT_FISH_REWARD_QTY) + 1;
+					if (_FishData.getGroup() == 0){ //beginners 
+						 begin = Config.FISHING_EVENT_BEGINNERS_BEGIN;
+						 count = Config.FISHING_EVENT_BEGINNERS_COUNT;
+					}
+					else if (_FishData.getGroup() == 1){ //normal 
+						 begin = Config.FISHING_EVENT_NORMAL_BEGIN;
+						 count = Config.FISHING_EVENT_NORMAL_COUNT;
+					} 
+					else if (_FishData.getGroup() == 2){ //upper grade
+						begin = Config.FISHING_EVENT_UPPER_BEGIN;
+						count = Config.FISHING_EVENT_UPPER_COUNT;
+					}
+					if (_FishData.getType()==3){ //chest
+						begin = Config.FISHING_EVENT_CHEST_BEGIN;
+						count = Config.FISHING_EVENT_CHEST_COUNT;
+						drop = Rnd.get(Config.FISHING_EVENT_CHEST_REWARD_QTY);
+					}
+					int lvlmultiplier = _FishData.getLevel() / 3;
+					if(_FishData.getLevel()%3 == 0) {
+						lvlmultiplier -= 1;
+					}
+					if(Rnd.get(100) <= (begin + count*lvlmultiplier)){
+						_fisher.addItem("Fishing", Config.FISHING_EVENT_REWARD_ID, drop, null, true);
+					}
+					else {
+						_fisher.addItem("Fishing", _fishId, 1, null, true);
+					}
+				}
+				else {
+					_fisher.addItem("Fishing", _fishId, 1, null, true);
+				}
 			}
 		}
 		_fisher.EndFishing(win);