This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..
Question
Gries
I have this code in doDie method inside L2MonsterInstance.java file:
int npcId = getTemplate().getId(); switch (npcId) { case 150: if (((L2PcInstance) killer).getClan() == null) { return false; } if (killer.getActingPlayer() != null) { ((L2PcInstance) killer).getClan().addReputationScore(10, true); // Change 1 with the reputation points you want to add upon kill monster ((L2PcInstance) killer).sendMessage("Your Clan Reputation is increased by 10."); } final L2Summon summon = killer.getSummon(); if (summon.getOwner() != null) { return false; } }However, when i am killing monster with ID 150 i am getting a NullPointerException. Instead if the monster is killed by a summon or a pet i am getting a ClassCasterException.
Edited by GriesHow to solve it?
10 answers to this question
Recommended Posts