SEVERE: Failed executing HitTask.

Find the proper support area, Saga-Version.
Forum rules
READ NOW: L2j Forums Rules of Conduct
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: SEVERE: Failed executing HitTask.

Post by janiii »

fix (changed the way of dropping items in the way i understand it)

http://www.pastebin.cz/19471

Code: Select all

Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java===================================================================--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (revision 3119)+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (working copy)@@ -5232,10 +5232,11 @@                dropLimit = Config.PLAYER_DROP_LIMIT;            } -            int dropCount = 0;-           while (dropPercent > 0 && Rnd.get(100) < dropPercent && dropCount < dropLimit)+           if (dropPercent > 0 && Rnd.get(100) < dropPercent)            {-                int itemDropPercent = 0;+               int dropCount = 0;++               int itemDropPercent = 0;                List<Integer> nonDroppableList = new FastList<Integer>();                List<Integer> nonDroppableListPet = new FastList<Integer>(); @@ -5259,7 +5260,7 @@                    if (itemDrop.isEquipped())                    {                        // Set proper chance according to Item type of equipped Item-                        itemDropPercent = itemDrop.getItem().getType2() == L2Item.TYPE2_WEAPON ? dropEquipWeapon : dropEquip;+                       itemDropPercent = itemDrop.getItem().getType2() == L2Item.TYPE2_WEAPON ? dropEquipWeapon : dropEquip;                        getInventory().unEquipItemInSlotAndRecord(itemDrop.getLocationSlot());                    }                    else itemDropPercent = dropItem; // Item in inventory@@ -5274,8 +5275,8 @@                        else                            _log.warning(getName() + " dropped id = " + itemDrop.getItemId() + ", count = " + itemDrop.getCount()); -                       dropCount++;-                       break;+                       if (++dropCount >= dropLimit)+                           break;                    }                }            }
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
Bruteforce
Posts: 110
Joined: Wed Jan 21, 2009 8:22 pm

Re: SEVERE: Failed executing HitTask.

Post by Bruteforce »

Thanks a lot!
I will have a look at it first thing I get home from work! :)

If it works, I hope it will be committed!
User avatar
Notorious
Posts: 501
Joined: Thu May 28, 2009 3:50 pm
Location: Sweden

Re: SEVERE: Failed executing HitTask.

Post by Notorious »

Works like a charm! Killed myself plenty of times with no items in inventory, or too few items in inventory, and CPU remained at 0% :)

Thanks a LOT Janiii! :D
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: SEVERE: Failed executing HitTask.

Post by janiii »

may this be commited? the way i think PK drop should work..

- rate drop: the chance to drop asked only once on drop
- rate drop item/equip/weapon asked for each item in inventory

- on drop, the chance for drop is asked, if ok, the whole inventory is looped with chances to drop an item and if an item drops, the count of dropped items is checked if the limit is reached and the loop is exited. so if the PK doesnt have so many items in his inventory, it is dropped what can be dropped, checking each item only once for the chance to drop.
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: SEVERE: Failed executing HitTask.

Post by janiii »

fixed in http://www.l2jserver.com/trac/changeset/3166

feel free to comment the logic of pk drop ;)
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
Post Reply