
varens
Members-
Posts
174 -
Credits
0 -
Joined
-
Last visited
-
Feedback
0%
Content Type
Articles
Profiles
Forums
Store
Everything posted by varens
-
ok i FIXED and TESTED that, work very good ;] Index: C:/Program Files/Eclipse/workspace/L2_GameServer_T2.3_2x/java/config/l2jmods.properties =================================================================== --- C:/Program Files/Eclipse/workspace/L2_GameServer_T2.3_2x/java/config/l2jmods.properties (revision 4013) +++ C:/Program Files/Eclipse/workspace/L2_GameServer_T2.3_2x/java/config/l2jmods.properties (working copy) @@ -256,4 +256,8 @@ # This option will enable core support for: # Mana Drug (item ID 726), using skill ID 9007. # Mana Potion (item ID 728), using skill ID 9008. -EnableManaPotionSupport = False \ No newline at end of file +EnableManaPotionSupport = False + +#KS Protected moobs id +#Format: moobId1,moobid2 +KsProtectedMoobs = 20001,20002 \ No newline at end of file Index: C:/Program Files/Eclipse/workspace/L2_GameServer_T2.3_2x/java/net/sf/l2j/gameserver/model/actor/L2Npc.java =================================================================== --- C:/Program Files/Eclipse/workspace/L2_GameServer_T2.3_2x/java/net/sf/l2j/gameserver/model/actor/L2Npc.java (revision 4013) +++ C:/Program Files/Eclipse/workspace/L2_GameServer_T2.3_2x/java/net/sf/l2j/gameserver/model/actor/L2Npc.java (working copy) @@ -17,11 +17,15 @@ import static net.sf.l2j.gameserver.ai.CtrlIntention.AI_INTENTION_ACTIVE; import java.text.DateFormat; +import java.util.ArrayList; import java.util.Collection; import java.util.List; +import java.util.Map; +import java.util.Vector; import java.util.logging.Level; import javolution.util.FastList; +import javolution.util.FastMap; import net.sf.l2j.Config; import net.sf.l2j.gameserver.SevenSigns; import net.sf.l2j.gameserver.SevenSignsFestival; @@ -161,6 +165,9 @@ private int _currentRHandId; // normally this shouldn't change from the template, but there exist exceptions private int _currentCollisionHeight; // used for npc grow effect skills private int _currentCollisionRadius; // used for npc grow effect skills + + public ArrayList<L2PcInstance> _attackedBy = new ArrayList<L2PcInstance>(); + public ArrayList<Double> _attackedByDmg = new ArrayList<Double>(); /** Task launching the function onRandomAnimation() */ protected class RandomAnimationTask implements Runnable @@ -2457,6 +2464,20 @@ @Override public boolean doDie(L2Character killer) { + if(Config.KS_PROTECT_MOOBS.contains(this.getNpcId())) + { + double bestDmg = 0; + for(int i=0;i<_attackedBy.size();i++) + if (_attackedByDmg.get(i) > bestDmg) + { + bestDmg = _attackedByDmg.get(i); + killer = _attackedBy.get(i); + } + } + + _attackedBy.clear(); + _attackedByDmg.clear(); + if (!super.doDie(killer)) return false; Index: C:/Program Files/Eclipse/workspace/L2_GameServer_T2.3_2x/java/net/sf/l2j/gameserver/skills/Formulas.java =================================================================== --- C:/Program Files/Eclipse/workspace/L2_GameServer_T2.3_2x/java/net/sf/l2j/gameserver/skills/Formulas.java (revision 4013) +++ C:/Program Files/Eclipse/workspace/L2_GameServer_T2.3_2x/java/net/sf/l2j/gameserver/skills/Formulas.java (working copy) @@ -1269,6 +1269,23 @@ damage *= attacker.calcStat(Stats.PVP_PHYS_SKILL_DMG, 1, null, null); } + if((attacker instanceof L2PcInstance) && (target instanceof L2Npc)) + { + L2Npc moob = ((L2Npc)target); + if(Config.KS_PROTECT_MOOBS.contains(moob.getNpcId())) + { + L2PcInstance player = ((L2PcInstance)attacker); + + if(moob._attackedBy.contains(player)) + moob._attackedByDmg.set(moob._attackedBy.indexOf(player), (moob._attackedByDmg.get(moob._attackedBy.indexOf(player))+damage)); + else + { + moob._attackedBy.add(player); + moob._attackedByDmg.add(damage); + } + } + } + return damage < 1 ? 1. : damage; } /** Calculated damage caused by ATTACK of attacker on target, @@ -1490,6 +1507,23 @@ damage *= calcElemental(attacker, target, skill); + if((attacker instanceof L2PcInstance) && (target instanceof L2Npc)) + { + L2Npc moob = ((L2Npc)target); + if(Config.KS_PROTECT_MOOBS.contains(moob.getNpcId())) + { + L2PcInstance player = ((L2PcInstance)attacker); + + if(moob._attackedBy.contains(player)) + moob._attackedByDmg.set(moob._attackedBy.indexOf(player), (moob._attackedByDmg.get(moob._attackedBy.indexOf(player))+damage)); + else + { + moob._attackedBy.add(player); + moob._attackedByDmg.add(damage); + } + } + } + return damage; } @@ -1596,6 +1630,23 @@ damage *= calcElemental(attacker, target, skill); + if((attacker instanceof L2PcInstance) && (target instanceof L2Npc)) + { + L2Npc moob = ((L2Npc)target); + if(Config.KS_PROTECT_MOOBS.contains(moob.getNpcId())) + { + L2PcInstance player = ((L2PcInstance)attacker); + + if(moob._attackedBy.contains(player)) + moob._attackedByDmg.set(moob._attackedBy.indexOf(player), (moob._attackedByDmg.get(moob._attackedBy.indexOf(player))+damage)); + else + { + moob._attackedBy.add(player); + moob._attackedByDmg.add(damage); + } + } + } + return damage; } @@ -1659,6 +1710,23 @@ damage *= calcElemental(owner, target, skill); + if(target instanceof L2Npc) + { + L2Npc moob = ((L2Npc)target); + if(Config.KS_PROTECT_MOOBS.contains(moob.getNpcId())) + { + L2PcInstance player = attacker.getOwner(); + + if(moob._attackedBy.contains(player)) + moob._attackedByDmg.set(moob._attackedBy.indexOf(player), (moob._attackedByDmg.get(moob._attackedBy.indexOf(player))+damage)); + else + { + moob._attackedBy.add(player); + moob._attackedByDmg.add(damage); + } + } + } + return damage; } Index: C:/Program Files/Eclipse/workspace/L2_GameServer_T2.3_2x/java/net/sf/l2j/Config.java =================================================================== --- C:/Program Files/Eclipse/workspace/L2_GameServer_T2.3_2x/java/net/sf/l2j/Config.java (revision 4013) +++ C:/Program Files/Eclipse/workspace/L2_GameServer_T2.3_2x/java/net/sf/l2j/Config.java (working copy) @@ -616,6 +616,7 @@ public static boolean OFFLINE_SET_NAME_COLOR; public static int OFFLINE_NAME_COLOR; public static boolean L2JMOD_ENABLE_MANA_POTIONS_SUPPORT; + public static List<Integer> KS_PROTECT_MOOBS = new ArrayList<Integer>(); //-------------------------------------------------- @@ -2014,6 +2015,20 @@ OFFLINE_NAME_COLOR = Integer.decode("0x" + L2JModSettings.getProperty("OfflineNameColor", "808080")); L2JMOD_ENABLE_MANA_POTIONS_SUPPORT = Boolean.parseBoolean(L2JModSettings.getProperty("EnableManaPotionSupport", "false")); + + String[] propertySplit = L2JModSettings.getProperty("KsProtectedMoobs", "0").split(","); + for(String moobId: propertySplit) + { + try + { + KS_PROTECT_MOOBS.add(Integer.parseInt(moobId)); + } + catch (NumberFormatException nfe) + { + if (propertySplit.length > 0) + _log.warning("Error in load config."); + } + } } catch (Exception e) {
-
ok but not now, when i back to home i will
-
i hate all damn moobs then i kill them all :P but most annoying raid boss(that is too moob ;)) for my is cabrio because when receive this wonderful moment of his respawn you can not find anyone to kill his :/
-
yes ofc but for what? he can test taht by self in hmm 5min, yep?
-
[SHARE] Configurable Olympiad Countdown
varens replied to Levi4than's topic in Server Shares & Files [L2J]
hmm, i am not guru like you say, and i dont know wher you read that, i just dont want more noob servers with corrupt admins etc then plz dont offend me -
if you want get it now just look in topic , DragonHunter give a link:
-
Best PvP Class on L2 oFF Gracia FINAL
varens replied to repxl's topic in General Discussion [English]
that topic is useless becouse ppl just spam, all have self "best class" and nathing change it then plz close topic and stop spam, ty for attention -
prapobly noob question ;]
varens replied to zwyro's question in Request Server Development Help [L2J]
you need download l2encdec from here http://dstuff.l2wh.com/l2.php and path the system file then with L2 FileEditor you can change it -
[HELP]Mana Potion L2JDB
varens replied to HaxFixer's question in Request Server Development Help [L2J]
sry i miss that, then i cant help you becouse i never use HB, but why you want use that, hb have only l2off servers becouse teams what make l2off have actualy only that version, better make gracja epilogue or interlude, like you want, ther for 100% work that, sry agen for no help -
[HELP]Mana Potion L2JDB
varens replied to HaxFixer's question in Request Server Development Help [L2J]
and what version? interlude or gracja? your potion dont work or you dont know what id that have? -
[HELP]Mana Potion L2JDB
varens replied to HaxFixer's question in Request Server Development Help [L2J]
what team files you use -
you have radar on l2 control, then that is dont needed, but better is have all in one program
-
why you make duble topic, if no one sey then no one have that or just dont want sey
-
l2w is limited and you cant do many thiings with his scripts, better try l2net with that you can make amazing scripts;]
-
change it in altsettings.properties(in interlued), Character.properties(in gracja final):
-
[HELP]Mana Potion L2JDB
varens replied to HaxFixer's question in Request Server Development Help [L2J]
sey something more, i dont understand your question -
first dont spam and no one sey you that, do you want easy way to get answer? test it by self
-
prapobly noob question ;]
varens replied to zwyro's question in Request Server Development Help [L2J]
lol you need edit that on client side, just open system/servername-e.dat by program hmm l2 FileEdit and exchange that OFC only if you give in hex generator: server id 1 then add that file to your server path and Mission completed! ;P -
what work wrong? your need sey my that becouse i not tested it so I do not know
-
[SHARE] Configurable Olympiad Countdown
varens replied to Levi4than's topic in Server Shares & Files [L2J]
do you read my post? if someone dont know java then dont make server, we have to many lol servers, java isnt so hard and al who want start server need know minimum base java -
[SHARE] Configurable Olympiad Countdown
varens replied to Levi4than's topic in Server Shares & Files [L2J]
that type server should never occur, becouse 90% of them are one week servers -
in free time i will change it on l2jfree for you
-
that is for l2j nightly gracja final
-
i dont know for 100% but i think that is wrong item id in shop or something like that;]
-
ok then i w8 for description of errors when you test