Fixed dice rolling.
This commit is contained in:
parent
3efc7c11df
commit
776162c7ec
@ -17,7 +17,9 @@
|
||||
package handlers.itemhandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.handler.IItemHandler;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Playable;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
@ -26,6 +28,7 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.Dice;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jmobius.gameserver.util.Broadcast;
|
||||
import com.l2jmobius.gameserver.util.Util;
|
||||
|
||||
public class RollingDice implements IItemHandler
|
||||
{
|
||||
@ -54,7 +57,18 @@ public class RollingDice implements IItemHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
Broadcast.toSelfAndKnownPlayers(activeChar, new Dice(activeChar.getObjectId(), itemId, number, activeChar.getX() - 30, activeChar.getY() - 30, activeChar.getZ()));
|
||||
// Mobius: Retail dice position land calculation.
|
||||
final double angle = Util.convertHeadingToDegree(activeChar.getHeading());
|
||||
final double radian = Math.toRadians(angle);
|
||||
final double course = Math.toRadians(180);
|
||||
final int x1 = (int) (Math.cos(Math.PI + radian + course) * 40);
|
||||
final int y1 = (int) (Math.sin(Math.PI + radian + course) * 40);
|
||||
final int x = activeChar.getX() + x1;
|
||||
final int y = activeChar.getY() + y1;
|
||||
final int z = activeChar.getZ();
|
||||
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(activeChar.getX(), activeChar.getY(), activeChar.getZ(), x, y, z, activeChar.getInstanceWorld());
|
||||
|
||||
Broadcast.toSelfAndKnownPlayers(activeChar, new Dice(activeChar.getObjectId(), itemId, number, destination.getX(), destination.getY(), destination.getZ()));
|
||||
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_HAS_ROLLED_A_S2);
|
||||
sm.addString(activeChar.getName());
|
||||
|
@ -505,8 +505,11 @@
|
||||
<set name="default_action" val="DICE" />
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="is_destroyable" val="false" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
</item>
|
||||
<item id="4233" name="Knuckle Duster" type="Weapon">
|
||||
<!-- Bestows one of the following functions, Rsk. Evasion, Rsk. Haste or Haste. -->
|
||||
|
@ -282,6 +282,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
@ -293,6 +294,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
@ -304,6 +306,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
@ -315,6 +318,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
|
@ -17,7 +17,9 @@
|
||||
package handlers.itemhandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.handler.IItemHandler;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Playable;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
@ -26,6 +28,7 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.Dice;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jmobius.gameserver.util.Broadcast;
|
||||
import com.l2jmobius.gameserver.util.Util;
|
||||
|
||||
public class RollingDice implements IItemHandler
|
||||
{
|
||||
@ -54,7 +57,18 @@ public class RollingDice implements IItemHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
Broadcast.toSelfAndKnownPlayers(activeChar, new Dice(activeChar.getObjectId(), itemId, number, activeChar.getX() - 30, activeChar.getY() - 30, activeChar.getZ()));
|
||||
// Mobius: Retail dice position land calculation.
|
||||
final double angle = Util.convertHeadingToDegree(activeChar.getHeading());
|
||||
final double radian = Math.toRadians(angle);
|
||||
final double course = Math.toRadians(180);
|
||||
final int x1 = (int) (Math.cos(Math.PI + radian + course) * 40);
|
||||
final int y1 = (int) (Math.sin(Math.PI + radian + course) * 40);
|
||||
final int x = activeChar.getX() + x1;
|
||||
final int y = activeChar.getY() + y1;
|
||||
final int z = activeChar.getZ();
|
||||
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(activeChar.getX(), activeChar.getY(), activeChar.getZ(), x, y, z, activeChar.getInstanceWorld());
|
||||
|
||||
Broadcast.toSelfAndKnownPlayers(activeChar, new Dice(activeChar.getObjectId(), itemId, number, destination.getX(), destination.getY(), destination.getZ()));
|
||||
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_HAS_ROLLED_A_S2);
|
||||
sm.addString(activeChar.getName());
|
||||
|
@ -505,8 +505,11 @@
|
||||
<set name="default_action" val="DICE" />
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="is_destroyable" val="false" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
</item>
|
||||
<item id="4233" name="Knuckle Duster" type="Weapon">
|
||||
<!-- When enchanted, P. Atk. of a dualsword increases more significantly than that of one-handed or fist weapon. Can bestow 1 regular Soul Crystal and 1 Special Soul Crystal. -->
|
||||
|
@ -282,6 +282,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
@ -293,6 +294,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
@ -304,6 +306,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
@ -315,6 +318,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
|
@ -17,7 +17,9 @@
|
||||
package handlers.itemhandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.handler.IItemHandler;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Playable;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
@ -26,6 +28,7 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.Dice;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jmobius.gameserver.util.Broadcast;
|
||||
import com.l2jmobius.gameserver.util.Util;
|
||||
|
||||
public class RollingDice implements IItemHandler
|
||||
{
|
||||
@ -54,7 +57,18 @@ public class RollingDice implements IItemHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
Broadcast.toSelfAndKnownPlayers(activeChar, new Dice(activeChar.getObjectId(), itemId, number, activeChar.getX() - 30, activeChar.getY() - 30, activeChar.getZ()));
|
||||
// Mobius: Retail dice position land calculation.
|
||||
final double angle = Util.convertHeadingToDegree(activeChar.getHeading());
|
||||
final double radian = Math.toRadians(angle);
|
||||
final double course = Math.toRadians(180);
|
||||
final int x1 = (int) (Math.cos(Math.PI + radian + course) * 40);
|
||||
final int y1 = (int) (Math.sin(Math.PI + radian + course) * 40);
|
||||
final int x = activeChar.getX() + x1;
|
||||
final int y = activeChar.getY() + y1;
|
||||
final int z = activeChar.getZ();
|
||||
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(activeChar.getX(), activeChar.getY(), activeChar.getZ(), x, y, z, activeChar.getInstanceWorld());
|
||||
|
||||
Broadcast.toSelfAndKnownPlayers(activeChar, new Dice(activeChar.getObjectId(), itemId, number, destination.getX(), destination.getY(), destination.getZ()));
|
||||
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_HAS_ROLLED_A_S2);
|
||||
sm.addString(activeChar.getName());
|
||||
|
@ -505,8 +505,11 @@
|
||||
<set name="default_action" val="DICE" />
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="is_destroyable" val="false" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
</item>
|
||||
<item id="4233" name="Knuckle Duster" type="Weapon">
|
||||
<!-- When enchanted, P. Atk. of a dualsword increases more significantly than that of one-handed or fist weapon. Can bestow 1 regular Soul Crystal and 1 Special Soul Crystal. -->
|
||||
|
@ -282,6 +282,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
@ -293,6 +294,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
@ -304,6 +306,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
@ -315,6 +318,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
|
@ -17,7 +17,9 @@
|
||||
package handlers.itemhandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.handler.IItemHandler;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Playable;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
@ -26,6 +28,7 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.Dice;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jmobius.gameserver.util.Broadcast;
|
||||
import com.l2jmobius.gameserver.util.Util;
|
||||
|
||||
public class RollingDice implements IItemHandler
|
||||
{
|
||||
@ -54,7 +57,18 @@ public class RollingDice implements IItemHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
Broadcast.toSelfAndKnownPlayers(activeChar, new Dice(activeChar.getObjectId(), itemId, number, activeChar.getX() - 30, activeChar.getY() - 30, activeChar.getZ()));
|
||||
// Mobius: Retail dice position land calculation.
|
||||
final double angle = Util.convertHeadingToDegree(activeChar.getHeading());
|
||||
final double radian = Math.toRadians(angle);
|
||||
final double course = Math.toRadians(180);
|
||||
final int x1 = (int) (Math.cos(Math.PI + radian + course) * 40);
|
||||
final int y1 = (int) (Math.sin(Math.PI + radian + course) * 40);
|
||||
final int x = activeChar.getX() + x1;
|
||||
final int y = activeChar.getY() + y1;
|
||||
final int z = activeChar.getZ();
|
||||
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(activeChar.getX(), activeChar.getY(), activeChar.getZ(), x, y, z, activeChar.getInstanceWorld());
|
||||
|
||||
Broadcast.toSelfAndKnownPlayers(activeChar, new Dice(activeChar.getObjectId(), itemId, number, destination.getX(), destination.getY(), destination.getZ()));
|
||||
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_HAS_ROLLED_A_S2);
|
||||
sm.addString(activeChar.getName());
|
||||
|
@ -505,8 +505,11 @@
|
||||
<set name="default_action" val="DICE" />
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="is_destroyable" val="false" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
</item>
|
||||
<item id="4233" name="Knuckle Duster" type="Weapon">
|
||||
<!-- When enchanted, P. Atk. of a dualsword increases more significantly than that of one-handed or fist weapon. Can bestow 1 regular Soul Crystal and 1 Special Soul Crystal. -->
|
||||
|
@ -282,6 +282,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
@ -293,6 +294,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
@ -304,6 +306,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
@ -315,6 +318,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
|
@ -17,21 +17,23 @@
|
||||
package com.l2jmobius.gameserver.handler.itemhandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.handler.IItemHandler;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Playable;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.position.Location;
|
||||
import com.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.Dice;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jmobius.gameserver.util.Broadcast;
|
||||
import com.l2jmobius.gameserver.util.Util;
|
||||
|
||||
/**
|
||||
* This class ...
|
||||
* @version $Revision: 1.1.4.2 $ $Date: 2005/03/27 15:30:07 $
|
||||
*/
|
||||
|
||||
public class RollingDice implements IItemHandler
|
||||
{
|
||||
private static final int[] ITEM_IDS =
|
||||
@ -76,8 +78,18 @@ public class RollingDice implements IItemHandler
|
||||
return;
|
||||
}
|
||||
|
||||
Dice d = new Dice(activeChar.getObjectId(), item.getItemId(), number, activeChar.getX() - 30, activeChar.getY() - 30, activeChar.getZ());
|
||||
Broadcast.toSelfAndKnownPlayers(activeChar, d);
|
||||
// Mobius: Retail dice position land calculation.
|
||||
final double angle = Util.convertHeadingToDegree(activeChar.getHeading());
|
||||
final double radian = Math.toRadians(angle);
|
||||
final double course = Math.toRadians(180);
|
||||
final int x1 = (int) (Math.cos(Math.PI + radian + course) * 40);
|
||||
final int y1 = (int) (Math.sin(Math.PI + radian + course) * 40);
|
||||
final int x = activeChar.getX() + x1;
|
||||
final int y = activeChar.getY() + y1;
|
||||
final int z = activeChar.getZ();
|
||||
final Location destination = GeoData.getInstance().moveCheck(activeChar.getX(), activeChar.getY(), activeChar.getZ(), x, y, z);
|
||||
|
||||
Broadcast.toSelfAndKnownPlayers(activeChar, new Dice(activeChar.getObjectId(), item.getItemId(), number, destination.getX(), destination.getY(), destination.getZ()));
|
||||
|
||||
SystemMessage sm = new SystemMessage(SystemMessageId.S1_ROLLED_S2);
|
||||
sm.addString(activeChar.getName());
|
||||
|
@ -17,7 +17,9 @@
|
||||
package handlers.itemhandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.handler.IItemHandler;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Playable;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
@ -26,6 +28,7 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.Dice;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jmobius.gameserver.util.Broadcast;
|
||||
import com.l2jmobius.gameserver.util.Util;
|
||||
|
||||
public class RollingDice implements IItemHandler
|
||||
{
|
||||
@ -54,7 +57,18 @@ public class RollingDice implements IItemHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
Broadcast.toSelfAndKnownPlayers(activeChar, new Dice(activeChar.getObjectId(), itemId, number, activeChar.getX() - 30, activeChar.getY() - 30, activeChar.getZ()));
|
||||
// Mobius: Retail dice position land calculation.
|
||||
final double angle = Util.convertHeadingToDegree(activeChar.getHeading());
|
||||
final double radian = Math.toRadians(angle);
|
||||
final double course = Math.toRadians(180);
|
||||
final int x1 = (int) (Math.cos(Math.PI + radian + course) * 40);
|
||||
final int y1 = (int) (Math.sin(Math.PI + radian + course) * 40);
|
||||
final int x = activeChar.getX() + x1;
|
||||
final int y = activeChar.getY() + y1;
|
||||
final int z = activeChar.getZ();
|
||||
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(activeChar.getX(), activeChar.getY(), activeChar.getZ(), x, y, z, activeChar.getInstanceId());
|
||||
|
||||
Broadcast.toSelfAndKnownPlayers(activeChar, new Dice(activeChar.getObjectId(), itemId, number, destination.getX(), destination.getY(), destination.getZ()));
|
||||
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_HAS_ROLLED_A_S2);
|
||||
sm.addString(activeChar.getName());
|
||||
|
@ -417,7 +417,10 @@
|
||||
<set name="default_action" val="DICE" />
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="is_destroyable" val="false" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
</item>
|
||||
<item id="4233" type="Weapon" name="Knuckle Duster">
|
||||
<set name="icon" val="icon.weapon_knuckle_dust_i00" />
|
||||
|
@ -231,6 +231,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
</item>
|
||||
@ -240,6 +241,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
</item>
|
||||
@ -249,6 +251,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
</item>
|
||||
@ -258,6 +261,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
</item>
|
||||
|
@ -17,7 +17,9 @@
|
||||
package handlers.itemhandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.handler.IItemHandler;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Playable;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
@ -26,6 +28,7 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.Dice;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jmobius.gameserver.util.Broadcast;
|
||||
import com.l2jmobius.gameserver.util.Util;
|
||||
|
||||
public class RollingDice implements IItemHandler
|
||||
{
|
||||
@ -54,7 +57,18 @@ public class RollingDice implements IItemHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
Broadcast.toSelfAndKnownPlayers(activeChar, new Dice(activeChar.getObjectId(), itemId, number, activeChar.getX() - 30, activeChar.getY() - 30, activeChar.getZ()));
|
||||
// Mobius: Retail dice position land calculation.
|
||||
final double angle = Util.convertHeadingToDegree(activeChar.getHeading());
|
||||
final double radian = Math.toRadians(angle);
|
||||
final double course = Math.toRadians(180);
|
||||
final int x1 = (int) (Math.cos(Math.PI + radian + course) * 40);
|
||||
final int y1 = (int) (Math.sin(Math.PI + radian + course) * 40);
|
||||
final int x = activeChar.getX() + x1;
|
||||
final int y = activeChar.getY() + y1;
|
||||
final int z = activeChar.getZ();
|
||||
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(activeChar.getX(), activeChar.getY(), activeChar.getZ(), x, y, z, activeChar.getInstanceWorld());
|
||||
|
||||
Broadcast.toSelfAndKnownPlayers(activeChar, new Dice(activeChar.getObjectId(), itemId, number, destination.getX(), destination.getY(), destination.getZ()));
|
||||
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_HAS_ROLLED_A_S2);
|
||||
sm.addString(activeChar.getName());
|
||||
|
@ -518,8 +518,11 @@
|
||||
<set name="default_action" val="DICE" />
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="is_destroyable" val="false" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
</item>
|
||||
<item id="4233" name="Fist" type="Weapon">
|
||||
<!-- When enchanted, P. Atk. of a dualsword increases more significantly than that of one-handed or fist weapon. Can bestow 1 regular Soul Crystal and 1 Special Soul Crystal. -->
|
||||
|
@ -282,6 +282,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
@ -293,6 +294,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
@ -304,6 +306,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
@ -315,6 +318,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
|
@ -17,7 +17,9 @@
|
||||
package handlers.itemhandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.handler.IItemHandler;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Playable;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
@ -26,6 +28,7 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.Dice;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jmobius.gameserver.util.Broadcast;
|
||||
import com.l2jmobius.gameserver.util.Util;
|
||||
|
||||
public class RollingDice implements IItemHandler
|
||||
{
|
||||
@ -54,7 +57,18 @@ public class RollingDice implements IItemHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
Broadcast.toSelfAndKnownPlayers(activeChar, new Dice(activeChar.getObjectId(), itemId, number, activeChar.getX() - 30, activeChar.getY() - 30, activeChar.getZ()));
|
||||
// Mobius: Retail dice position land calculation.
|
||||
final double angle = Util.convertHeadingToDegree(activeChar.getHeading());
|
||||
final double radian = Math.toRadians(angle);
|
||||
final double course = Math.toRadians(180);
|
||||
final int x1 = (int) (Math.cos(Math.PI + radian + course) * 40);
|
||||
final int y1 = (int) (Math.sin(Math.PI + radian + course) * 40);
|
||||
final int x = activeChar.getX() + x1;
|
||||
final int y = activeChar.getY() + y1;
|
||||
final int z = activeChar.getZ();
|
||||
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(activeChar.getX(), activeChar.getY(), activeChar.getZ(), x, y, z, activeChar.getInstanceWorld());
|
||||
|
||||
Broadcast.toSelfAndKnownPlayers(activeChar, new Dice(activeChar.getObjectId(), itemId, number, destination.getX(), destination.getY(), destination.getZ()));
|
||||
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_HAS_ROLLED_A_S2);
|
||||
sm.addString(activeChar.getName());
|
||||
|
@ -518,8 +518,11 @@
|
||||
<set name="default_action" val="DICE" />
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="is_destroyable" val="false" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
</item>
|
||||
<item id="4233" name="Fist" type="Weapon">
|
||||
<!-- When enchanted, P. Atk. of a dualsword increases more significantly than that of one-handed or fist weapon. Can bestow 1 regular Soul Crystal and 1 Special Soul Crystal. -->
|
||||
|
@ -282,6 +282,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
@ -293,6 +294,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
@ -304,6 +306,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
@ -315,6 +318,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
|
@ -17,7 +17,9 @@
|
||||
package handlers.itemhandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.handler.IItemHandler;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Playable;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
@ -26,6 +28,7 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.Dice;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jmobius.gameserver.util.Broadcast;
|
||||
import com.l2jmobius.gameserver.util.Util;
|
||||
|
||||
public class RollingDice implements IItemHandler
|
||||
{
|
||||
@ -54,7 +57,18 @@ public class RollingDice implements IItemHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
Broadcast.toSelfAndKnownPlayers(activeChar, new Dice(activeChar.getObjectId(), itemId, number, activeChar.getX() - 30, activeChar.getY() - 30, activeChar.getZ()));
|
||||
// Mobius: Retail dice position land calculation.
|
||||
final double angle = Util.convertHeadingToDegree(activeChar.getHeading());
|
||||
final double radian = Math.toRadians(angle);
|
||||
final double course = Math.toRadians(180);
|
||||
final int x1 = (int) (Math.cos(Math.PI + radian + course) * 40);
|
||||
final int y1 = (int) (Math.sin(Math.PI + radian + course) * 40);
|
||||
final int x = activeChar.getX() + x1;
|
||||
final int y = activeChar.getY() + y1;
|
||||
final int z = activeChar.getZ();
|
||||
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(activeChar.getX(), activeChar.getY(), activeChar.getZ(), x, y, z, activeChar.getInstanceWorld());
|
||||
|
||||
Broadcast.toSelfAndKnownPlayers(activeChar, new Dice(activeChar.getObjectId(), itemId, number, destination.getX(), destination.getY(), destination.getZ()));
|
||||
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_HAS_ROLLED_A_S2);
|
||||
sm.addString(activeChar.getName());
|
||||
|
@ -518,8 +518,11 @@
|
||||
<set name="default_action" val="DICE" />
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="is_destroyable" val="false" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
</item>
|
||||
<item id="4233" name="Fist" type="Weapon">
|
||||
<!-- When enchanted, P. Atk. of a dualsword increases more significantly than that of one-handed or fist weapon. Can bestow 1 regular Soul Crystal and 1 Special Soul Crystal. -->
|
||||
|
@ -282,6 +282,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
@ -293,6 +294,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
@ -304,6 +306,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
@ -315,6 +318,7 @@
|
||||
<set name="immediate_effect" val="true" />
|
||||
<set name="material" val="STEEL" />
|
||||
<set name="price" val="500" />
|
||||
<set name="reuse_delay" val="5000" />
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="commissionItemType" val="OTHER_ITEM" />
|
||||
<set name="handler" val="RollingDice" />
|
||||
|
Loading…
Reference in New Issue
Block a user