Jump to content

Setekh

Legendary Member
  • Posts

    2,510
  • Credits

  • Joined

  • Last visited

  • Days Won

    2
  • Feedback

    0%

Everything posted by Setekh

  1. code cleanliness and performance should be of importance :P yours dose the same thing only that the code is every where :) And im not arguing im teaching :P
  2. Index: E:/L2j Development/workspace/L2_GameServer-clean/java/com/l2jserver/gameserver/model/actor/L2Character.java =================================================================== --- E:/L2j Development/workspace/L2_GameServer-clean/java/com/l2jserver/gameserver/model/actor/L2Character.java (revision 4014) +++ E:/L2j Development/workspace/L2_GameServer-clean/java/com/l2jserver/gameserver/model/actor/L2Character.java (working copy) @@ -2087,7 +2087,20 @@ if (this instanceof L2PcInstance && ((L2PcInstance)this).getAgathionId() != 0) ((L2PcInstance)this).setAgathionId(0); - calculateRewards(killer); + + DmgInfo dmger = null; + double dmg = 0; + + for(DmgInfo dmgs : _agroMap.values()) + { + if(dmgs.dmg > dmg) + { + dmg = dmgs.dmg; + dmger = dmgs; + } + } + + calculateRewards(dmger.attacker != null ? _agroMap.get(dmg).attacker : killer); + _agroMap.clear(); // Send the Server->Client packet StatusUpdate with current HP and MP to all other L2PcInstance to inform broadcastStatusUpdate(); @@ -6777,8 +6790,8 @@ public final int getWalkSpeed() { return getStat().getWalkSpeed(); } public int getWIT() { return getStat().getWIT(); } // ========================================================= - - + class DmgInfo{ L2Character attacker; double dmg; public DmgInfo(L2Character att) { attacker = att; }} + private FastMap<L2Character, DmgInfo> _agroMap; // ========================================================= // Status - NEED TO REMOVE ONCE L2CHARTATUS IS COMPLETE // Method - Public @@ -6791,6 +6804,13 @@ getStatus().reduceHp(i/Config.L2JMOD_CHAMPION_HP, attacker, awake, isDOT, false); else getStatus().reduceHp(i, attacker, awake, isDOT, false); + + if(this instanceof L2Attackable && attacker.getActingPlayer() != null) // simple check XD + { + DmgInfo lastDmg = _agroMap.containsKey(attacker) ? _agroMap.get(attacker) : new DmgInfo(attacker); + lastDmg.dmg += i; + _agroMap.put(attacker, lastDmg); + } } public void reduceCurrentMp(double i) { getStatus().reduceMp(i); } public void removeStatusListener(L2Character object) { getStatus().removeStatusListener(object); } There u go simple, clean and precise.
  3. if that didn't work u don't know how to apply a path >.> or u got a serious problem with ur pack... that code cant fail :/
  4. i live to see that lame day when xAddytzu is not a normal member anymore.. T_T Acu pot murii linistit le-am vazut pe toate..
  5. all the codes iv seen till now are over exaggerated >.> and the idea of it is confusing. U want some code that will calculate the rewords only to the one who did most dmg? or the one who hit him first?
  6. Its a kiddish forum :P Lol Ouch >.< bet it is..
  7. yep ady's implys l2 but this formus theme is not l2 related only ><
  8. return false la ce nubs? eu nu am nici un boolean si e greu sa schimbi importul ? anyway ur stillz a newbs XD
  9. probably yours would get removed. cus... eh well that's life :P
  10. unfair for who? no one is obligated to click it XD just scatter up on ur spam topic.
  11. whats ur problem, ur the one with the shitty attitude.
  12. since when do u need to care, its not advertising.
  13. /* * 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 2, 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, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. * * <http://www.gnu.org/copyleft/gpl.html> */ package com.l2jarchid; import com.l2jarchid.tools.Rnd; /** * @author Setekh */ public class xAddytzu { public String _txt; private xAddytzu() { switch(Rnd.get(10)) { case 0: _txt = "a Donkey."; break; case 1: _txt = "a Monkey."; break; case 2: _txt = "a Newb."; break; case 3: _txt = "a Retard."; break; case 4: _txt = "a Homo robot."; break; case 5: _txt = "a Cocalar."; break; case 6: _txt = "a Piti."; break; case 7: _txt = "a Gay."; break; case 8: _txt = "a Brain dead MaxChater."; break; case 9: _txt = "a Idiot"; break; case 10: _txt = "just a stupid guy."; break; } } public static void main(String[] abc) { String hisa = new xAddytzu()._txt; System.out.println("xAddytzu is "+hisa+" Jeezz"); } } Proest code evea! NOW WITH GNU LICENSE!!
  14. I like the idea, and a thing like this is very useful in many ways, and instead of a forum is less aggressive and wont be unlike this forum with half brain dead kids to spam or act smart =) I'll do my best in supporting it.
  15. google translate? u talk like a freaking homo-robot
×
×
  • Create New...