Jump to content

varens

Members
  • Posts

    174
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by varens

  1. i update that script becouse on that last if player will attack by pole or with mass skill then he will get some bugs, now it will work 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) @@ -19,9 +19,12 @@ import java.text.DateFormat; 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 +164,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 L2PcInstance[] _attackedBy; + public Double[] _attackedByDmg; /** Task launching the function onRandomAnimation() */ protected class RandomAnimationTask implements Runnable @@ -2457,6 +2463,17 @@ @Override public boolean doDie(L2Character killer) { + if(Config.KS_PROTECT_MOOBS.contains(this.getNpcId())) + { + double bestDmg = 0; + for(int i=0;i<_attackedBy.length;i++) + if (_attackedByDmg[i] > bestDmg) + { + bestDmg = _attackedByDmg[i]; + killer = _attackedBy[i]; + } + } + 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) @@ -32,6 +32,7 @@ import net.sf.l2j.gameserver.model.actor.L2Summon; import net.sf.l2j.gameserver.model.actor.instance.L2CubicInstance; import net.sf.l2j.gameserver.model.actor.instance.L2DoorInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; import net.sf.l2j.gameserver.model.actor.instance.L2PetInstance; import net.sf.l2j.gameserver.model.base.PlayerState; @@ -1269,6 +1270,26 @@ damage *= attacker.calcStat(Stats.PVP_PHYS_SKILL_DMG, 1, null, null); } + if((attacker instanceof L2PcInstance) && (target instanceof L2Npc)) + { + L2PcInstance player = ((L2PcInstance)attacker); + L2NpcInstance moob = ((L2NpcInstance)target); + + if(moob._attackedBy.equals(player)) + { + for(int i=0;i<moob._attackedBy.length;i++) + { + if(moob._attackedBy[i] == player) + moob._attackedByDmg[i] += damage; + } + } + else + { + moob._attackedBy[moob._attackedBy.length] = player; + moob._attackedByDmg[moob._attackedByDmg.length] = damage; + } + } + return damage < 1 ? 1. : damage; } /** Calculated damage caused by ATTACK of attacker on target, @@ -1490,6 +1511,26 @@ damage *= calcElemental(attacker, target, skill); + if((attacker instanceof L2PcInstance) && (target instanceof L2Npc)) + { + L2PcInstance player = ((L2PcInstance)attacker); + L2NpcInstance moob = ((L2NpcInstance)target); + + if(moob._attackedBy.equals(player)) + { + for(int i=0;i<moob._attackedBy.length;i++) + { + if(moob._attackedBy[i] == player) + moob._attackedByDmg[i] += damage; + } + } + else + { + moob._attackedBy[moob._attackedBy.length] = player; + moob._attackedByDmg[moob._attackedByDmg.length] = damage; + } + } + return damage; } @@ -1596,6 +1637,26 @@ damage *= calcElemental(attacker, target, skill); + if((attacker instanceof L2PcInstance) && (target instanceof L2Npc)) + { + L2PcInstance player = ((L2PcInstance)attacker); + L2NpcInstance moob = ((L2NpcInstance)target); + + if(moob._attackedBy.equals(player)) + { + for(int i=0;i<moob._attackedBy.length;i++) + { + if(moob._attackedBy[i] == player) + moob._attackedByDmg[i] += damage; + } + } + else + { + moob._attackedBy[moob._attackedBy.length] = player; + moob._attackedByDmg[moob._attackedByDmg.length] = damage; + } + } + return damage; } @@ -1659,6 +1720,26 @@ damage *= calcElemental(owner, target, skill); + if(target instanceof L2Npc) + { + L2PcInstance player = attacker.getOwner(); + L2NpcInstance moob = ((L2NpcInstance)target); + + if(moob._attackedBy.equals(player)) + { + for(int i=0;i<moob._attackedBy.length;i++) + { + if(moob._attackedBy[i] == player) + moob._attackedByDmg[i] += damage; + } + } + else + { + moob._attackedBy[moob._attackedBy.length] = player; + moob._attackedByDmg[moob._attackedByDmg.length] = 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) {
  2. no, who make biggest dmg on moob get the drop
  3. for what make new instance? here you have config for protect moobs by ID: 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/instance/L2PcInstance.java =================================================================== --- C:/Program Files/Eclipse/workspace/L2_GameServer_T2.3_2x/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 4013) +++ C:/Program Files/Eclipse/workspace/L2_GameServer_T2.3_2x/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy) @@ -771,6 +771,9 @@ private boolean _isRidingStrider = false; private boolean _isFlyingMounted = false; + public L2NpcInstance _lastMoob = null; + public double _lastMoobDmg = 0; + /** Herbs Task Time **/ private int _herbstask = 0; /** Task for Herbs */ 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) @@ -19,9 +19,12 @@ import java.text.DateFormat; 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 +164,8 @@ 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 + + private Vector<L2PcInstance> _attackedBy = new Vector<L2PcInstance>(); /** Task launching the function onRandomAnimation() */ protected class RandomAnimationTask implements Runnable @@ -2457,6 +2462,18 @@ @Override public boolean doDie(L2Character killer) { + if(Config.KS_PROTECT_MOOBS.contains(this.getNpcId())) + { + double bestDmg = 0; + for(L2PcInstance player: _attackedBy) + if (player._lastMoob == this) + if(player._lastMoobDmg > bestDmg) + { + bestDmg = player._lastMoobDmg; + killer = player; + } + } + 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) @@ -32,6 +32,7 @@ import net.sf.l2j.gameserver.model.actor.L2Summon; import net.sf.l2j.gameserver.model.actor.instance.L2CubicInstance; import net.sf.l2j.gameserver.model.actor.instance.L2DoorInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; import net.sf.l2j.gameserver.model.actor.instance.L2PetInstance; import net.sf.l2j.gameserver.model.base.PlayerState; @@ -1269,6 +1270,20 @@ damage *= attacker.calcStat(Stats.PVP_PHYS_SKILL_DMG, 1, null, null); } + if((attacker instanceof L2PcInstance) && (target instanceof L2Npc)) + { + L2PcInstance player = ((L2PcInstance)attacker); + L2NpcInstance moob = ((L2NpcInstance)target); + + if(player._lastMoob == moob) + player._lastMoobDmg += damage; + else + { + player._lastMoob = moob; + player._lastMoobDmg = damage; + } + } + return damage < 1 ? 1. : damage; } /** Calculated damage caused by ATTACK of attacker on target, @@ -1490,6 +1505,20 @@ damage *= calcElemental(attacker, target, skill); + if((attacker instanceof L2PcInstance) && (target instanceof L2Npc)) + { + L2PcInstance player = ((L2PcInstance)attacker); + L2NpcInstance moob = ((L2NpcInstance)target); + + if(player._lastMoob == moob) + player._lastMoobDmg += damage; + else + { + player._lastMoob = moob; + player._lastMoobDmg = damage; + } + } + return damage; } @@ -1596,6 +1625,20 @@ damage *= calcElemental(attacker, target, skill); + if((attacker instanceof L2PcInstance) && (target instanceof L2Npc)) + { + L2PcInstance player = ((L2PcInstance)attacker); + L2NpcInstance moob = ((L2NpcInstance)target); + + if(player._lastMoob == moob) + player._lastMoobDmg += damage; + else + { + player._lastMoob = moob; + player._lastMoobDmg = damage; + } + } + return damage; } @@ -1659,6 +1702,20 @@ damage *= calcElemental(owner, target, skill); + if(target instanceof L2Npc) + { + L2PcInstance player = attacker.getOwner(); + L2NpcInstance moob = ((L2NpcInstance)target); + + if(player._lastMoob == moob) + player._lastMoobDmg += damage; + else + { + player._lastMoob = moob; + player._lastMoobDmg = 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) {
  4. Index: C:/Program Files/Eclipse/workspace/L2_GameServer_T2.3_2x/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- C:/Program Files/Eclipse/workspace/L2_GameServer_T2.3_2x/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 4013) +++ C:/Program Files/Eclipse/workspace/L2_GameServer_T2.3_2x/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy) @@ -771,6 +771,9 @@ private boolean _isRidingStrider = false; private boolean _isFlyingMounted = false; + public L2NpcInstance _lastMoob = null; + public double _lastMoobDmg = 0; + /** Herbs Task Time **/ private int _herbstask = 0; /** Task for Herbs */ 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) @@ -19,9 +19,12 @@ import java.text.DateFormat; 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 +164,8 @@ 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 + + private Vector<L2PcInstance> _attackedBy = new Vector<L2PcInstance>(); /** Task launching the function onRandomAnimation() */ protected class RandomAnimationTask implements Runnable @@ -2457,6 +2462,15 @@ @Override public boolean doDie(L2Character killer) { + double bestDmg = 0; + for(L2PcInstance player: _attackedBy) + if (player._lastMoob == this) + if(player._lastMoobDmg > bestDmg) + { + bestDmg = player._lastMoobDmg; + killer = player; + } + 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) @@ -32,6 +32,7 @@ import net.sf.l2j.gameserver.model.actor.L2Summon; import net.sf.l2j.gameserver.model.actor.instance.L2CubicInstance; import net.sf.l2j.gameserver.model.actor.instance.L2DoorInstance; +import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; import net.sf.l2j.gameserver.model.actor.instance.L2PetInstance; import net.sf.l2j.gameserver.model.base.PlayerState; @@ -1269,6 +1270,20 @@ damage *= attacker.calcStat(Stats.PVP_PHYS_SKILL_DMG, 1, null, null); } + if((attacker instanceof L2PcInstance) && (target instanceof L2Npc)) + { + L2PcInstance player = ((L2PcInstance)attacker); + L2NpcInstance moob = ((L2NpcInstance)target); + + if(player._lastMoob == moob) + player._lastMoobDmg += damage; + else + { + player._lastMoob = moob; + player._lastMoobDmg = damage; + } + } + return damage < 1 ? 1. : damage; } /** Calculated damage caused by ATTACK of attacker on target, @@ -1490,6 +1505,20 @@ damage *= calcElemental(attacker, target, skill); + if((attacker instanceof L2PcInstance) && (target instanceof L2Npc)) + { + L2PcInstance player = ((L2PcInstance)attacker); + L2NpcInstance moob = ((L2NpcInstance)target); + + if(player._lastMoob == moob) + player._lastMoobDmg += damage; + else + { + player._lastMoob = moob; + player._lastMoobDmg = damage; + } + } + return damage; } @@ -1596,6 +1625,20 @@ damage *= calcElemental(attacker, target, skill); + if((attacker instanceof L2PcInstance) && (target instanceof L2Npc)) + { + L2PcInstance player = ((L2PcInstance)attacker); + L2NpcInstance moob = ((L2NpcInstance)target); + + if(player._lastMoob == moob) + player._lastMoobDmg += damage; + else + { + player._lastMoob = moob; + player._lastMoobDmg = damage; + } + } + return damage; } @@ -1659,6 +1702,20 @@ damage *= calcElemental(owner, target, skill); + if(target instanceof L2Npc) + { + L2PcInstance player = attacker.getOwner(); + L2NpcInstance moob = ((L2NpcInstance)target); + + if(player._lastMoob == moob) + player._lastMoobDmg += damage; + else + { + player._lastMoob = moob; + player._lastMoobDmg = damage; + } + } + return damage; } not tested, test and sey;p
  5. you need w8 becouse my internet is so sh it and i need download that file souroce;p
  6. i have better idea, but sey my what chronicle and what team files you use:)
  7. that topic is so old and you have now other ways to get status checker like that web http://status.blackout-gaming.net/
  8. i dont want sey nathing but that code is so useless, all who know only little java can make that
  9. yep but 90% l2j servers have auto create account ;p BTW i am agree with your signature, ucoz use servers who can't make website by self, they dont need make full of script website just in html, that is so easy
  10. rly i dont know i just find that and give here link, just look but auto open fish is nathing specjal if you want little script for that make something like that DO USE_ITEM ItemID SLEEP 100 LOOP ZERO == ZERO
  11. that is only if server have online status or is registered on hopzone, i dont write nathing else, then i dont understand question
  12. like in name, if server have profil on http://hopzone.net then we can easy get server ip and port just left click on website and press button "website source" then we yest need search that: second, uf server make online status from http://status.blackout-gaming.net/ and admin dont choice ther "Encrypt data:" then same in "website source" we have ip and port just search that http://status.blackout-gaming.net/status.php?dns=88.88.88.88&port=2106&style=1 88.88.88.88 is IP and 2106 is port that is small thing but with that life is easier :)
  13. man what do you think, you have google and search here, people will not find everything for you
  14. why you double post, next time try edit
  15. i test that script some time ago and that dont work, i need make another fix but now i havent that problem btw dont spam, text like "nice share" is useless
  16. that is useless becouse you can add adena for start, that is same like gb
  17. http://www.maxcheaters.com/forum/index.php?topic=126284.0 - Biohazard http://www.maxcheaters.com/forum/index.php?topic=82733.0 - DM try search option and you find more :)
  18. i dont know who make that website but that is copied, then i think copyright is for www.l2insanity.gr, just look in code <!-- Mirrored from www.l2insanity.gr/ by HTTrack Website Copier/3.x [XR&CO'2010], Thu, 11 Mar 2010 10:23:04 GMT --> btw nice graphic, but toplist are usefull then if you can try add :)
  19. for what you want givemore points for hero if he have biggest number of points in class? that is good idea but i think that is not fer
  20. and if you know how to use eclipse you dont need that config becouse change it is 20sec ;]
  21. you mean "love you"? XD if yes np xD
  22. http://ltwonet.com/showthread.php/4147-Fishing-Script catch :)
  23. one man share something about that here http://www.maxcheaters.com/forum/index.php?topic=129526.0 that is almost same but too can help :)
  24. that is for c6 but work on all chronicles, just you dont have ls lvl 80 etc;p
  25. heh will be more helpfull when i add option to choice all option of augment, i write before about that but i dont find actualy time for that ;]
×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock