Jeppi,
Nu jo, jau anksciau norejau pasakyt, kad bypassai su npc_objid per atstuma nelabai veikia, bet galvojau, kad apsirikau :D
action=\"bypass -h npc_" + getObjectId() + "_
ir kiek katik pastebejau tikrina papildomai atstuma(RequestBypassToServer.java), nes nebutinai yra naudot anoki koda instance'o kurimui.
else if (_command.startsWith("npc_"))
{
if (!activeChar.validateBypass(_command))
return;
int endOfId = _command.indexOf('_', 5);
String id;
if (endOfId > 0)
id = _command.substring(4, endOfId);
else
id = _command.substring(4);
try
{
L2Object object = L2World.getInstance().findObject(Integer.parseInt(id));
if (object != null && object instanceof L2Npc && endOfId > 0 &&
activeChar.isInsideRadius(object, L2Npc.INTERACTION_DISTANCE, false, false))
((L2Npc) object).onBypassFeedback(activeChar, _command.substring(endOfId + 1));
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
}
catch (NumberFormatException nfe)
{
}
}
tokiais atvejais as pasidarau papildoma bypass'a tarp RequestBypassToServer. Taciau, jei ir pas tave taip packe parasyta, gali bandyt ta pati dalykeli ten pat pasidaryt ir pazet.
if(object != null && !(object instanceof L2ClassMasterInstance))
if (object instanceof L2Npc && endOfId > 0 &&
activeChar.isInsideRadius(object, L2Npc.INTERACTION_DISTANCE, false, false))
((L2Npc) object).onBypassFeedback(activeChar, _command.substring(endOfId + 1));
kitas budas pati bool'a pasiredaguot
/**
* Check if this object is inside the given radius around the given object. Warning: doesn't cover collision radius!
* @param object the target
* @param radius the radius around the target
* @param checkZ should we check Z axis also
* @param strictCheck true if (distance < radius), false if (distance <= radius)
* @return true is the L2Character is inside the radius.
*/
public final boolean isInsideRadius(L2Object object, int radius, boolean checkZ, boolean strictCheck)
{
if(this instanceof L2ClassMasterInstance)
return true;
return isInsideRadius(object.getX(), object.getY(), object.getZ(), radius, checkZ, strictCheck);
}
Paskutinį kartą redagavo: 9 Spalio 2014 - 00:12