All pastes #45118 Raw Edit

L2Character.java

public java v1 · immutable
#45118 ·published 2006-03-10 12:06 UTC
rendered paste body
double attackpercent = 85;+	int attackcountmax = 13;+	int attackcount = 0;+	if (this instanceof L2PcInstance)+	{+		if (getKnownSkill(216) == null) //216 = pole mastery skill id  +		{  +			attackcountmax = 3; //Can attack 3 monster dont have pole mastery   +		}  +		else if (getSkillLevel(216) < 9)  +		{  +			attackcountmax = 8; //Can attack 8 monster pole mastery lvl is to low   +		}  +	}           if (angleChar <= 0) angleChar += 360;        // ===========================================================        L2Character target;        for (L2Object obj : getKnownList().getKnownObjects())        {            //Check if the L2Object is a L2Character            if(obj instanceof L2Character)            {            	if (obj instanceof L2PetInstance &&            		this instanceof L2PcInstance &&            		((L2PetInstance)obj).getOwner() == ((L2PcInstance)this)) continue;                            	if (!Util.checkIfInRange(maxRadius, this, obj, true)) continue;                angleTarget = Util.calculateAngleFrom(this, obj);                if (                        Math.abs(angleChar - angleTarget) > maxAngleDiff &&                        Math.abs((angleChar + 360) - angleTarget) > maxAngleDiff &&     // Example: char is at 1 degree and target is at 359 degree                        Math.abs(angleChar - (angleTarget + 360)) > maxAngleDiff        // Example: target is at 1 degree and char is at 359 degree                    ) continue;                                target = (L2Character) obj;                // Launch a simple attack against the L2Character targeted                if(!target.isAlikeDead())                {+                	attackcount += 1;+                	if (attackcount > attackcountmax)+                		continue;                	if (target == getAI().getAttackTarget() || target.isAutoAttackable(this))                    {    			                		hitted |= doAttackHitSimple(attack, target, attackpercent);                		attackpercent /= 1.15;                		target.getAI().notifyEvent(CtrlEvent.EVT_ATTACKED, this);                    }	                }            }