Package net.sf.l2j.gameserver.model.actor.instance

Examples of net.sf.l2j.gameserver.model.actor.instance.L2PetInstance.addExpAndSp()


        ratioTakenByPet = pet.getPetData().getOwnerExpTaken();

        // only give exp/sp to the pet by taking from the owner if the pet has a non-zero, positive ratio
        // allow possible customizations that would have the pet earning more than 100% of the owner's exp/sp
        if (ratioTakenByPet > 0 && !pet.isDead())
          pet.addExpAndSp((long)(addToExp*ratioTakenByPet), (int)(addToSp*ratioTakenByPet));
        // now adjust the max ratio to avoid the owner earning negative exp/sp
        if (ratioTakenByPet > 1)
          ratioTakenByPet = 1;
        addToExp = (long)(addToExp*(1-ratioTakenByPet));
        addToSp = (int)(addToSp*(1-ratioTakenByPet));
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.