Removed custom poly system.

This commit is contained in:
MobiusDevelopment 2020-06-30 01:09:34 +00:00
parent ba916da04d
commit c126283ceb
36 changed files with 628 additions and 2100 deletions

View File

@ -217,10 +217,6 @@
<admin command="admin_para_all_menu" accessLevel="80" />
<admin command="admin_unpara_menu" accessLevel="80" />
<admin command="admin_para_menu" accessLevel="80" />
<admin command="admin_polyself" accessLevel="80" />
<admin command="admin_unpolyself" accessLevel="80" />
<admin command="admin_polyself_menu" accessLevel="80" />
<admin command="admin_unpolyself_menu" accessLevel="80" />
<admin command="admin_clearteams" accessLevel="80" />
<admin command="admin_setteam_close" accessLevel="80" /> <!-- set all Gm close players to val team -->
<admin command="admin_setteam" accessLevel="80" />
@ -274,8 +270,6 @@
<admin command="admin_event_name" accessLevel="80" />
<admin command="admin_event_control_kill" accessLevel="80" />
<admin command="admin_event_control_res" accessLevel="80" />
<admin command="admin_event_control_poly" accessLevel="80" />
<admin command="admin_event_control_unpoly" accessLevel="80" />
<admin command="admin_event_control_prize" accessLevel="80" />
<admin command="admin_event_control_chatban" accessLevel="80" />
<admin command="admin_event_control_finish" accessLevel="80" />
@ -427,12 +421,6 @@
<!-- Section: Pledge -->
<admin command="admin_pledge" accessLevel="90" /> <!-- Manage Clan -->
<!-- Section: Polymorph -->
<admin command="admin_polymorph" accessLevel="90" />
<admin command="admin_unpolymorph" accessLevel="90" />
<admin command="admin_polymorph_menu" accessLevel="90" />
<admin command="admin_unpolymorph_menu" accessLevel="90" />
<!-- Section: Quest -->
<admin command="admin_quest_reload" accessLevel="90" />

View File

@ -11,12 +11,8 @@
<td><edit var="menu_command" width=120 height=15></td>
<td><button value="Help" action="bypass -h admin_help help/effects_menu.htm" width=45 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
</tr></table><br>
<font color="aadd77">Trasformations</font><table width=240><tr>
<td><button value="PolyMorph" action="bypass -h admin_polymorph_menu $menu_command" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
<td><button value="UnPoly" action="bypass -h admin_unpolymorph_menu" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
<td><button value="PolySelf" action="bypass -h admin_polyself_menu $menu_command" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
<td><button value="UnPolySlf" action="bypass -h admin_unpolyself_menu" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
</tr><tr>
<font color="aadd77">Effects</font><table width=240>
<tr>
<td><button value="Para" action="bypass -h admin_para_menu $menu_command" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
<td><button value="UnPara" action="bypass -h admin_unpara_menu $menu_command" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
<td><button value="ParaAll" action="bypass -h admin_para_all_menu" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>

View File

@ -7,10 +7,6 @@
3-Effect Panel Buttons<br></font>
L2 special effects are here: earthquakes, sky changes, weird character and mob animations.<br>
<font color="LEVEL">3-1 First pack of effects.<br>
PolyMorph:</font> Make your target (player) look like the specified mob.<br>
<font color="LEVEL">Unpoly:</font> Cancel polymorph effects that specified target may have.<br>
<font color="LEVEL">PolySelf:</font> Polymorph yourself to specified npcId, you will see a title change only.<br>
<font color="LEVEL">UnPolySelf:</font> Cancel any polymorph effect you could have.<br>
<font color="LEVEL">Para:</font> Paralyze character (target/name).<br>
<font color="LEVEL">UnPara:</font> Cancel Paralysis effect (target/name).<br>
<font color="LEVEL">ParaAll:</font> Paralyze any character in the world, but yours. Use wisely, annoys people and causes lag.<br>

View File

@ -52,10 +52,5 @@
<font color="LEVEL">//setew value</font> - Sets enchantment of target player currently equipped weapon to value<br><font color="FF9933">Usage: //setew 9999</font><br>
<font color="LEVEL">//banchat</font> - Mutes a player<br><font color="FF9933">Usage: //banchat kadar </font><br>
<font color="LEVEL">//unbanchat</font> - Unmutes a player<br><font color="FF9933">Usage: //unbanchat kadar </font><br>
<font color="LEVEL">//polymorph character npc id </font><br>
<font color="LEVEL">//polymorph item id to poly target into id|</font><br>
<font color="LEVEL">//polyself &lt;npc id&gt;</font> - Used to polymorph yourself into a mob<br>
<font color="LEVEL">//unpolyself</font> - Returns you to the normal state<br>
<font color="LEVEL">//polymorph item &lt;itemid&gt;</font> - Polymorphs an item<br>
<center><button value="Index" action="bypass -h admin_help admhelp.htm" width=60 height=15 back="sek.cbui94" fore="sek.cbui92"></center>
</body></html>

View File

@ -67,7 +67,6 @@ import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminOnline;
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminPForge;
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminPetition;
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminPledge;
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminPolymorph;
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminQuest;
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminReload;
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminRepairChar;
@ -147,7 +146,6 @@ public class AdminCommandHandler
registerAdminCommandHandler(new AdminPetition());
registerAdminCommandHandler(new AdminPForge());
registerAdminCommandHandler(new AdminPledge());
registerAdminCommandHandler(new AdminPolymorph());
registerAdminCommandHandler(new AdminQuest());
registerAdminCommandHandler(new AdminReload());
registerAdminCommandHandler(new AdminRepairChar());

View File

@ -27,7 +27,6 @@ import org.l2jmobius.gameserver.model.actor.instance.ChestInstance;
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.CharInfo;
import org.l2jmobius.gameserver.network.serverpackets.Earthquake;
import org.l2jmobius.gameserver.network.serverpackets.ExRedSky;
import org.l2jmobius.gameserver.network.serverpackets.GameServerPacket;
@ -38,7 +37,6 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
import org.l2jmobius.gameserver.network.serverpackets.StopMove;
import org.l2jmobius.gameserver.network.serverpackets.SunRise;
import org.l2jmobius.gameserver.network.serverpackets.SunSet;
import org.l2jmobius.gameserver.network.serverpackets.UserInfo;
import org.l2jmobius.gameserver.util.BuilderUtil;
/**
@ -49,7 +47,6 @@ import org.l2jmobius.gameserver.util.BuilderUtil;
* <li>gmspeed = temporary Super Haste effect.
* <li>para/unpara = paralyze/remove paralysis from target
* <li>para_all/unpara_all = same as para/unpara, affects the whole world.
* <li>polyself/unpolyself = makes you look as a specified mob.
* <li>changename = temporary change name
* <li>clearteams/setteam_close/setteam = team related commands
* <li>social = forces an Creature instance to broadcast social action packets.
@ -80,10 +77,6 @@ public class AdminEffects implements IAdminCommandHandler
"admin_para_all_menu",
"admin_unpara_menu",
"admin_para_menu",
"admin_polyself",
"admin_unpolyself",
"admin_polyself_menu",
"admin_unpolyself_menu",
"admin_clearteams",
"admin_setteam_close",
"admin_setteam",
@ -333,34 +326,6 @@ public class AdminEffects implements IAdminCommandHandler
{
}
}
else if (command.startsWith("admin_polyself"))
{
try
{
final String id = st.nextToken();
activeChar.getPoly().setPolyInfo("npc", id);
activeChar.teleToLocation(activeChar.getX(), activeChar.getY(), activeChar.getZ(), false);
activeChar.broadcastPacket(new CharInfo(activeChar));
activeChar.sendPacket(new UserInfo(activeChar));
}
catch (Exception e)
{
}
}
else if (command.startsWith("admin_unpolyself"))
{
try
{
activeChar.getPoly().setPolyInfo(null, "1");
activeChar.decayMe();
activeChar.spawnMe(activeChar.getX(), activeChar.getY(), activeChar.getZ());
activeChar.broadcastPacket(new CharInfo(activeChar));
activeChar.sendPacket(new UserInfo(activeChar));
}
catch (Exception e)
{
}
}
else if (command.equals("admin_clear_teams"))
{
try

View File

@ -36,13 +36,11 @@ import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.entity.event.GameEvent;
import org.l2jmobius.gameserver.model.spawn.Spawn;
import org.l2jmobius.gameserver.network.serverpackets.CharInfo;
import org.l2jmobius.gameserver.network.serverpackets.ItemList;
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import org.l2jmobius.gameserver.network.serverpackets.PlaySound;
import org.l2jmobius.gameserver.network.serverpackets.Revive;
import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
import org.l2jmobius.gameserver.network.serverpackets.UserInfo;
/**
* This class handles following admin commands: - admin = shows menu
@ -70,8 +68,6 @@ public class AdminEventEngine implements IAdminCommandHandler
"admin_event_name",
"admin_event_control_kill",
"admin_event_control_res",
"admin_event_control_poly",
"admin_event_control_unpoly",
"admin_event_control_prize",
"admin_event_control_chatban",
"admin_event_control_finish"
@ -340,30 +336,6 @@ public class AdminEventEngine implements IAdminCommandHandler
showEventControl(activeChar);
}
else if (command.startsWith("admin_event_control_poly"))
{
final StringTokenizer st0 = new StringTokenizer(command.substring(25));
final StringTokenizer st = new StringTokenizer(st0.nextToken(), "-");
final String id = st0.nextToken();
while (st.hasMoreElements())
{
polyTeam(Integer.parseInt(st.nextToken()), id);
}
showEventControl(activeChar);
}
else if (command.startsWith("admin_event_control_unpoly"))
{
final StringTokenizer st = new StringTokenizer(command.substring(27), "-");
while (st.hasMoreElements())
{
unpolyTeam(Integer.parseInt(st.nextToken()));
}
showEventControl(activeChar);
}
else if (command.startsWith("admin_event_control_prize"))
{
final StringTokenizer st0 = new StringTokenizer(command.substring(26));
@ -599,11 +571,6 @@ public class AdminEventEngine implements IAdminCommandHandler
replyMSG.append("<tr><td>&nbsp;</td></tr>");
replyMSG.append("<tr><td><button value=\"Resurrect\" action=\"bypass -h admin_event_control_res $team_number\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td><td><font color=\"LEVEL\">Resurrect Team's members</font></td></tr>");
replyMSG.append("<tr><td>&nbsp;</td></tr>");
replyMSG.append("<tr><td><button value=\"Polymorph\" action=\"bypass -h admin_event_control_poly $team_number $poly_id\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td><td><edit var=\"poly_id\" width=100 height=15><font color=\"LEVEL\">Polymorphs the team into the NPC with the id specified</font></td></tr>");
replyMSG.append("<tr><td>&nbsp;</td></tr>");
replyMSG.append("<tr><td><button value=\"UnPolymorph\" action=\"bypass -h admin_event_control_unpoly $team_number\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td><td><font color=\"LEVEL\">Unpolymorph the team</font></td></tr>");
replyMSG.append("<tr><td>&nbsp;</td></tr>");
replyMSG.append("<tr><td>&nbsp;</td></tr>");
replyMSG.append("<tr><td><button value=\"Give Item\" action=\"bypass -h admin_event_control_prize $team_number $n $id\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"> number <edit var=\"n\" width=100 height=15> item id <edit var=\"id\" width=100 height=15></td><td><font color=\"LEVEL\">Give the specified item id to every single member of the team, you can put 5*level, 5*kills or 5 in the number field for example</font></td></tr>");
replyMSG.append("<tr><td>&nbsp;</td></tr>");
replyMSG.append("<tr><td><button value=\"End\" action=\"bypass -h admin_event_control_finish\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td><td><font color=\"LEVEL\">Will finish the event teleporting back all the players</font></td></tr>");
@ -763,49 +730,6 @@ public class AdminEventEngine implements IAdminCommandHandler
}
}
void polyTeam(int team, String id)
{
final LinkedList<String> linked = GameEvent.players.get(team);
final Iterator<String> it = linked.iterator();
while (it.hasNext())
{
try
{
final PlayerInstance target = World.getInstance().getPlayer(it.next());
target.getPoly().setPolyInfo("npc", id);
target.teleToLocation(target.getX(), target.getY(), target.getZ(), true);
target.broadcastPacket(new CharInfo(target));
target.sendPacket(new UserInfo(target));
}
catch (Exception e)
{
}
}
}
void unpolyTeam(int team)
{
final LinkedList<String> linked = GameEvent.players.get(team);
final Iterator<String> it = linked.iterator();
while (it.hasNext())
{
try
{
final PlayerInstance target = World.getInstance().getPlayer(it.next());
target.getPoly().setPolyInfo(null, "1");
target.decayMe();
target.spawnMe(target.getX(), target.getY(), target.getZ());
target.broadcastPacket(new CharInfo(target));
target.sendPacket(new UserInfo(target));
}
catch (Exception e)
{
}
}
}
private void createItem(PlayerInstance activeChar, PlayerInstance player, int id, int num)
{
player.getInventory().addItem("Event", id, num, player, activeChar);
@ -855,7 +779,6 @@ public class AdminEventEngine implements IAdminCommandHandler
void telePlayersBack(int team)
{
resTeam(team);
unpolyTeam(team);
final LinkedList<String> linked = GameEvent.players.get(team);
final Iterator<String> it = linked.iterator();

View File

@ -1,135 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.l2jmobius.gameserver.handler.admincommandhandlers;
import java.util.StringTokenizer;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
import org.l2jmobius.gameserver.network.serverpackets.SetupGauge;
import org.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles following admin commands: polymorph
* @version $Revision: 1.2.2.1.2.4 $ $Date: 2007/07/31 10:05:56 $
*/
public class AdminPolymorph implements IAdminCommandHandler
{
private static final String[] ADMIN_COMMANDS =
{
"admin_polymorph",
"admin_unpolymorph",
"admin_polymorph_menu",
"admin_unpolymorph_menu"
};
@Override
public boolean useAdminCommand(String command, PlayerInstance activeChar)
{
if (command.startsWith("admin_polymorph"))
{
final StringTokenizer st = new StringTokenizer(command);
final WorldObject target = activeChar.getTarget();
try
{
st.nextToken();
final String p1 = st.nextToken();
if (st.hasMoreTokens())
{
final String p2 = st.nextToken();
doPolymorph(activeChar, target, p2, p1);
}
else
{
doPolymorph(activeChar, target, p1, "npc");
}
}
catch (Exception e)
{
BuilderUtil.sendSysMessage(activeChar, "Usage: //polymorph [type] <id>");
}
}
else if (command.equals("admin_unpolymorph"))
{
doUnpoly(activeChar, activeChar.getTarget());
}
if (command.contains("menu"))
{
showMainPage(activeChar);
}
return true;
}
@Override
public String[] getAdminCommandList()
{
return ADMIN_COMMANDS;
}
private void doPolymorph(PlayerInstance activeChar, WorldObject obj, String id, String type)
{
if (obj != null)
{
obj.getPoly().setPolyInfo(type, id);
// animation
if (obj instanceof Creature)
{
final Creature creature = (Creature) obj;
creature.broadcastPacket(new MagicSkillUse(creature, creature, 1008, 1, 4000, 0));
creature.sendPacket(new SetupGauge(0, 4000));
}
// end of animation
obj.decayMe();
obj.spawnMe(obj.getX(), obj.getY(), obj.getZ());
BuilderUtil.sendSysMessage(activeChar, "Polymorph succeed");
}
else
{
activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
}
}
private void doUnpoly(PlayerInstance activeChar, WorldObject target)
{
if (target != null)
{
target.getPoly().setPolyInfo(null, "1");
target.decayMe();
target.spawnMe(target.getX(), target.getY(), target.getZ());
BuilderUtil.sendSysMessage(activeChar, "Unpolymorph succeed");
}
else
{
activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
}
}
private void showMainPage(PlayerInstance activeChar)
{
AdminHelpPage.showHelpPage(activeChar, "effects_menu.htm");
}
}

View File

@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.instancemanager.MercTicketManager;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.knownlist.WorldObjectKnownList;
import org.l2jmobius.gameserver.model.actor.poly.ObjectPoly;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
@ -47,7 +46,6 @@ public abstract class WorldObject
private WorldObjectKnownList _knownList;
private String _name;
private int _objectId;
private ObjectPoly _poly;
private ObjectPosition _position;
// Objects can only see objects in same instancezone, instance 0 is normal world -1 the all seeing world
@ -351,15 +349,6 @@ public abstract class WorldObject
return _objectId;
}
public ObjectPoly getPoly()
{
if (_poly == null)
{
_poly = new ObjectPoly(this);
}
return _poly;
}
public ObjectPosition getPosition()
{
if (_position == null)

View File

@ -4082,7 +4082,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
* In Server->Client packet, each effect is represented by 1 bit of the map (ex : BLEEDING = 0x0001 (bit 1), SLEEP = 0x0080 (bit 8)...). The map is calculated by applying a BINARY OR operation on each effect.<br>
* <br>
* <b><u>Example of use</u>:</b><br>
* <li>Server Packet : CharInfo, NpcInfo, NpcInfoPoly, UserInfo...</li>
* <li>Server Packet : CharInfo, NpcInfo, UserInfo...</li>
* @return the abnormal effect
*/
public int getAbnormalEffect()

View File

@ -44,7 +44,6 @@ import org.l2jmobius.gameserver.network.serverpackets.PrivateStoreMsgSell;
import org.l2jmobius.gameserver.network.serverpackets.RecipeShopMsg;
import org.l2jmobius.gameserver.network.serverpackets.RelationChanged;
import org.l2jmobius.gameserver.network.serverpackets.SpawnItem;
import org.l2jmobius.gameserver.network.serverpackets.SpawnItemPoly;
import org.l2jmobius.gameserver.network.serverpackets.StaticObject;
import org.l2jmobius.gameserver.network.serverpackets.VehicleInfo;
@ -119,126 +118,119 @@ public class PlayerKnownList extends PlayableKnownList
// On retail there is a similar, if not greater, delay as well.
ThreadPool.schedule(() ->
{
if (object.getPoly().isMorphed() && object.getPoly().getPolyType().equals("item"))
if (object.isItem())
{
activeChar.sendPacket(new SpawnItemPoly(object));
if (dropper != null)
{
activeChar.sendPacket(new DropItem((ItemInstance) object, dropper.getObjectId()));
}
else
{
activeChar.sendPacket(new SpawnItem((ItemInstance) object));
}
}
else
else if (object.isDoor())
{
if (object.isItem())
if (((DoorInstance) object).getCastle() != null)
{
if (dropper != null)
{
activeChar.sendPacket(new DropItem((ItemInstance) object, dropper.getObjectId()));
}
else
{
activeChar.sendPacket(new SpawnItem((ItemInstance) object));
}
activeChar.sendPacket(new DoorInfo((DoorInstance) object, true));
}
else if (object.isDoor())
else
{
if (((DoorInstance) object).getCastle() != null)
{
activeChar.sendPacket(new DoorInfo((DoorInstance) object, true));
}
else
{
activeChar.sendPacket(new DoorInfo((DoorInstance) object, false));
}
activeChar.sendPacket(new DoorStatusUpdate((DoorInstance) object));
activeChar.sendPacket(new DoorInfo((DoorInstance) object, false));
}
else if (object.isBoat())
activeChar.sendPacket(new DoorStatusUpdate((DoorInstance) object));
}
else if (object.isBoat())
{
if (!activeChar.isInBoat() && (object != activeChar.getBoat()))
{
if (!activeChar.isInBoat() && (object != activeChar.getBoat()))
{
activeChar.sendPacket(new VehicleInfo((BoatInstance) object));
((BoatInstance) object).sendVehicleDeparture(activeChar);
}
activeChar.sendPacket(new VehicleInfo((BoatInstance) object));
((BoatInstance) object).sendVehicleDeparture(activeChar);
}
else if (object.isNpc())
}
else if (object.isNpc())
{
activeChar.sendPacket(new NpcInfo((NpcInstance) object, activeChar));
}
else if (object.isSummon())
{
final Summon summon = (Summon) object;
// Check if the PlayerInstance is the owner of the Pet
if (activeChar.equals(summon.getOwner()))
{
activeChar.sendPacket(new NpcInfo((NpcInstance) object, activeChar));
}
else if (object.isSummon())
{
final Summon summon = (Summon) object;
activeChar.sendPacket(new PetInfo(summon));
// The PetInfo packet wipes the PartySpelled (list of active spells' icons). Re-add them
summon.updateEffectIcons(true);
// Check if the PlayerInstance is the owner of the Pet
if (activeChar.equals(summon.getOwner()))
if (summon instanceof PetInstance)
{
activeChar.sendPacket(new PetInfo(summon));
// The PetInfo packet wipes the PartySpelled (list of active spells' icons). Re-add them
summon.updateEffectIcons(true);
if (summon instanceof PetInstance)
{
activeChar.sendPacket(new PetItemList((PetInstance) summon));
}
}
else
{
activeChar.sendPacket(new NpcInfo(summon, activeChar));
activeChar.sendPacket(new PetItemList((PetInstance) summon));
}
}
else if (object.isPlayer())
else
{
final PlayerInstance otherPlayer = (PlayerInstance) object;
if (otherPlayer.isInBoat())
activeChar.sendPacket(new NpcInfo(summon, activeChar));
}
}
else if (object.isPlayer())
{
final PlayerInstance otherPlayer = (PlayerInstance) object;
if (otherPlayer.isInBoat())
{
otherPlayer.getPosition().setWorldPosition(otherPlayer.getBoat().getLocation());
activeChar.sendPacket(new CharInfo(otherPlayer));
final int relation = otherPlayer.getRelation(activeChar);
if ((otherPlayer.getKnownList().getKnownRelations().get(activeChar.getObjectId()) != null) && (otherPlayer.getKnownList().getKnownRelations().get(activeChar.getObjectId()) != relation))
{
otherPlayer.getPosition().setWorldPosition(otherPlayer.getBoat().getLocation());
activeChar.sendPacket(new CharInfo(otherPlayer));
final int relation = otherPlayer.getRelation(activeChar);
if ((otherPlayer.getKnownList().getKnownRelations().get(activeChar.getObjectId()) != null) && (otherPlayer.getKnownList().getKnownRelations().get(activeChar.getObjectId()) != relation))
{
activeChar.sendPacket(new RelationChanged(otherPlayer, relation, activeChar.isAutoAttackable(otherPlayer)));
}
activeChar.sendPacket(new GetOnVehicle(otherPlayer, otherPlayer.getBoat(), otherPlayer.getBoatPosition().getX(), otherPlayer.getBoatPosition().getY(), otherPlayer.getBoatPosition().getZ()));
}
else
{
activeChar.sendPacket(new CharInfo(otherPlayer));
final int relation = otherPlayer.getRelation(activeChar);
if ((otherPlayer.getKnownList().getKnownRelations().get(activeChar.getObjectId()) != null) && (otherPlayer.getKnownList().getKnownRelations().get(activeChar.getObjectId()) != relation))
{
activeChar.sendPacket(new RelationChanged(otherPlayer, relation, activeChar.isAutoAttackable(otherPlayer)));
}
activeChar.sendPacket(new RelationChanged(otherPlayer, relation, activeChar.isAutoAttackable(otherPlayer)));
}
if (otherPlayer.getPrivateStoreType() == PlayerInstance.STORE_PRIVATE_SELL)
{
activeChar.sendPacket(new PrivateStoreMsgSell(otherPlayer));
}
else if (otherPlayer.getPrivateStoreType() == PlayerInstance.STORE_PRIVATE_BUY)
{
activeChar.sendPacket(new PrivateStoreMsgBuy(otherPlayer));
}
else if (otherPlayer.getPrivateStoreType() == PlayerInstance.STORE_PRIVATE_MANUFACTURE)
{
activeChar.sendPacket(new RecipeShopMsg(otherPlayer));
}
activeChar.sendPacket(new GetOnVehicle(otherPlayer, otherPlayer.getBoat(), otherPlayer.getBoatPosition().getX(), otherPlayer.getBoatPosition().getY(), otherPlayer.getBoatPosition().getZ()));
}
else if (object instanceof FenceInstance)
else
{
((FenceInstance) object).sendInfo(activeChar);
}
else if (object instanceof StaticObjectInstance)
{
activeChar.sendPacket(new StaticObject((StaticObjectInstance) object));
activeChar.sendPacket(new CharInfo(otherPlayer));
final int relation = otherPlayer.getRelation(activeChar);
if ((otherPlayer.getKnownList().getKnownRelations().get(activeChar.getObjectId()) != null) && (otherPlayer.getKnownList().getKnownRelations().get(activeChar.getObjectId()) != relation))
{
activeChar.sendPacket(new RelationChanged(otherPlayer, relation, activeChar.isAutoAttackable(otherPlayer)));
}
}
if (object.isCreature())
if (otherPlayer.getPrivateStoreType() == PlayerInstance.STORE_PRIVATE_SELL)
{
// Update the state of the Creature object client side by sending Server->Client packet MoveToPawn/CharMoveToLocation and AutoAttackStart to the PlayerInstance
final Creature obj = (Creature) object;
final CreatureAI objAi = obj.getAI();
if (objAi != null)
{
objAi.describeStateToPlayer(activeChar);
}
activeChar.sendPacket(new PrivateStoreMsgSell(otherPlayer));
}
else if (otherPlayer.getPrivateStoreType() == PlayerInstance.STORE_PRIVATE_BUY)
{
activeChar.sendPacket(new PrivateStoreMsgBuy(otherPlayer));
}
else if (otherPlayer.getPrivateStoreType() == PlayerInstance.STORE_PRIVATE_MANUFACTURE)
{
activeChar.sendPacket(new RecipeShopMsg(otherPlayer));
}
}
else if (object instanceof FenceInstance)
{
((FenceInstance) object).sendInfo(activeChar);
}
else if (object instanceof StaticObjectInstance)
{
activeChar.sendPacket(new StaticObject((StaticObjectInstance) object));
}
if (object.isCreature())
{
// Update the state of the Creature object client side by sending Server->Client packet MoveToPawn/CharMoveToLocation and AutoAttackStart to the PlayerInstance
final Creature obj = (Creature) object;
final CreatureAI objAi = obj.getAI();
if (objAi != null)
{
objAi.describeStateToPlayer(activeChar);
}
}
}, _packetSendDelay + Rnd.get(50)); // Add additional 0-49ms in case of overlapping tasks on heavy load.

View File

@ -1,67 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.l2jmobius.gameserver.model.actor.poly;
import org.l2jmobius.gameserver.model.WorldObject;
public class ObjectPoly
{
private final WorldObject _activeObject;
private int _polyId;
private String _polyType;
public ObjectPoly(WorldObject activeObject)
{
_activeObject = activeObject;
}
public void setPolyInfo(String polyType, String polyId)
{
setPolyId(Integer.parseInt(polyId));
setPolyType(polyType);
}
public WorldObject getActiveObject()
{
return _activeObject;
}
public boolean isMorphed()
{
return _polyType != null;
}
public int getPolyId()
{
return _polyId;
}
public void setPolyId(int value)
{
_polyId = value;
}
public String getPolyType()
{
return _polyType;
}
public void setPolyType(String value)
{
_polyType = value;
}
}

View File

@ -35,7 +35,6 @@ import org.l2jmobius.gameserver.network.serverpackets.PetInfo;
import org.l2jmobius.gameserver.network.serverpackets.PetItemList;
import org.l2jmobius.gameserver.network.serverpackets.RelationChanged;
import org.l2jmobius.gameserver.network.serverpackets.SpawnItem;
import org.l2jmobius.gameserver.network.serverpackets.SpawnItemPoly;
import org.l2jmobius.gameserver.network.serverpackets.StaticObject;
import org.l2jmobius.gameserver.network.serverpackets.UserInfo;
import org.l2jmobius.gameserver.network.serverpackets.VehicleInfo;
@ -66,98 +65,91 @@ public class RequestRecordInfo extends GameClientPacket
continue;
}
if (object.getPoly().isMorphed() && object.getPoly().getPolyType().equals("item"))
if (object instanceof ItemInstance)
{
player.sendPacket(new SpawnItemPoly(object));
player.sendPacket(new SpawnItem((ItemInstance) object));
}
else
else if (object instanceof DoorInstance)
{
if (object instanceof ItemInstance)
if (((DoorInstance) object).getCastle() != null)
{
player.sendPacket(new SpawnItem((ItemInstance) object));
player.sendPacket(new DoorInfo((DoorInstance) object, true));
}
else if (object instanceof DoorInstance)
else
{
if (((DoorInstance) object).getCastle() != null)
{
player.sendPacket(new DoorInfo((DoorInstance) object, true));
}
else
{
player.sendPacket(new DoorInfo((DoorInstance) object, false));
}
player.sendPacket(new DoorStatusUpdate((DoorInstance) object));
player.sendPacket(new DoorInfo((DoorInstance) object, false));
}
else if (object instanceof BoatInstance)
player.sendPacket(new DoorStatusUpdate((DoorInstance) object));
}
else if (object instanceof BoatInstance)
{
if (!player.isInBoat() && (object != player.getBoat()))
{
if (!player.isInBoat() && (object != player.getBoat()))
player.sendPacket(new VehicleInfo((BoatInstance) object));
((BoatInstance) object).sendVehicleDeparture(player);
}
}
else if (object instanceof StaticObjectInstance)
{
player.sendPacket(new StaticObject((StaticObjectInstance) object));
}
else if (object instanceof NpcInstance)
{
player.sendPacket(new NpcInfo((NpcInstance) object, player));
}
else if (object instanceof Summon)
{
final Summon summon = (Summon) object;
// Check if the PlayerInstance is the owner of the Pet
if (player.equals(summon.getOwner()))
{
player.sendPacket(new PetInfo(summon));
if (summon instanceof PetInstance)
{
player.sendPacket(new VehicleInfo((BoatInstance) object));
((BoatInstance) object).sendVehicleDeparture(player);
player.sendPacket(new PetItemList((PetInstance) summon));
}
}
else if (object instanceof StaticObjectInstance)
else
{
player.sendPacket(new StaticObject((StaticObjectInstance) object));
}
else if (object instanceof NpcInstance)
{
player.sendPacket(new NpcInfo((NpcInstance) object, player));
}
else if (object instanceof Summon)
{
final Summon summon = (Summon) object;
// Check if the PlayerInstance is the owner of the Pet
if (player.equals(summon.getOwner()))
{
player.sendPacket(new PetInfo(summon));
if (summon instanceof PetInstance)
{
player.sendPacket(new PetItemList((PetInstance) summon));
}
}
else
{
player.sendPacket(new NpcInfo(summon, player));
}
// The PetInfo packet wipes the PartySpelled (list of active spells' icons). Re-add them
summon.updateEffectIcons(true);
}
else if (object instanceof PlayerInstance)
{
final PlayerInstance otherPlayer = (PlayerInstance) object;
if (otherPlayer.isInBoat())
{
otherPlayer.getPosition().setWorldPosition(otherPlayer.getBoat().getLocation());
player.sendPacket(new CharInfo(otherPlayer));
final int relation = otherPlayer.getRelation(player);
if ((otherPlayer.getKnownList().getKnownRelations().get(player.getObjectId()) != null) && (otherPlayer.getKnownList().getKnownRelations().get(player.getObjectId()) != relation))
{
player.sendPacket(new RelationChanged(otherPlayer, relation, player.isAutoAttackable(otherPlayer)));
}
player.sendPacket(new GetOnVehicle(otherPlayer, otherPlayer.getBoat(), otherPlayer.getBoatPosition().getX(), otherPlayer.getBoatPosition().getY(), otherPlayer.getBoatPosition().getZ()));
}
else
{
player.sendPacket(new CharInfo(otherPlayer));
final int relation = otherPlayer.getRelation(player);
if ((otherPlayer.getKnownList().getKnownRelations().get(player.getObjectId()) != null) && (otherPlayer.getKnownList().getKnownRelations().get(player.getObjectId()) != relation))
{
player.sendPacket(new RelationChanged(otherPlayer, relation, player.isAutoAttackable(otherPlayer)));
}
}
player.sendPacket(new NpcInfo(summon, player));
}
if (object instanceof Creature)
// The PetInfo packet wipes the PartySpelled (list of active spells' icons). Re-add them
summon.updateEffectIcons(true);
}
else if (object instanceof PlayerInstance)
{
final PlayerInstance otherPlayer = (PlayerInstance) object;
if (otherPlayer.isInBoat())
{
// Update the state of the Creature object client side by sending Server->Client packet MoveToPawn/CharMoveToLocation and AutoAttackStart to the PlayerInstance
final Creature obj = (Creature) object;
if (obj.hasAI())
otherPlayer.getPosition().setWorldPosition(otherPlayer.getBoat().getLocation());
player.sendPacket(new CharInfo(otherPlayer));
final int relation = otherPlayer.getRelation(player);
if ((otherPlayer.getKnownList().getKnownRelations().get(player.getObjectId()) != null) && (otherPlayer.getKnownList().getKnownRelations().get(player.getObjectId()) != relation))
{
obj.getAI().describeStateToPlayer(player);
player.sendPacket(new RelationChanged(otherPlayer, relation, player.isAutoAttackable(otherPlayer)));
}
player.sendPacket(new GetOnVehicle(otherPlayer, otherPlayer.getBoat(), otherPlayer.getBoatPosition().getX(), otherPlayer.getBoatPosition().getY(), otherPlayer.getBoatPosition().getZ()));
}
else
{
player.sendPacket(new CharInfo(otherPlayer));
final int relation = otherPlayer.getRelation(player);
if ((otherPlayer.getKnownList().getKnownRelations().get(player.getObjectId()) != null) && (otherPlayer.getKnownList().getKnownRelations().get(player.getObjectId()) != relation))
{
player.sendPacket(new RelationChanged(otherPlayer, relation, player.isAutoAttackable(otherPlayer)));
}
}
}
if (object instanceof Creature)
{
// Update the state of the Creature object client side by sending Server->Client packet MoveToPawn/CharMoveToLocation and AutoAttackStart to the PlayerInstance
final Creature obj = (Creature) object;
if (obj.hasAI())
{
obj.getAI().describeStateToPlayer(player);
}
}
}

View File

@ -16,45 +16,25 @@
*/
package org.l2jmobius.gameserver.network.serverpackets;
import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.datatables.sql.NpcTable;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
public class CharInfo extends GameServerPacket
{
private static final Logger LOGGER = Logger.getLogger(CharInfo.class.getName());
private final PlayerInstance _player;
private final Inventory _inventory;
private final int _x;
private final int _y;
private final int _z;
private final int _heading;
private final int _mAtkSpd;
private final int _pAtkSpd;
private final int _runSpd;
private final int _walkSpd;
private final int _flyRunSpd;
private final int _flyWalkSpd;
private final float _moveMultiplier;
private final float _attackSpeedMultiplier;
public CharInfo(PlayerInstance player)
{
_player = player;
_inventory = player.getInventory();
_x = player.getX();
_y = player.getY();
_z = player.getZ();
_heading = player.getHeading();
_mAtkSpd = player.getMAtkSpd();
_pAtkSpd = player.getPAtkSpd();
_attackSpeedMultiplier = player.getAttackSpeedMultiplier();
_moveMultiplier = player.getMovementSpeedMultiplier();
_runSpd = Math.round(player.getRunSpeed() / _moveMultiplier);
_walkSpd = Math.round(player.getWalkSpeed() / _moveMultiplier);
@ -66,237 +46,153 @@ public class CharInfo extends GameServerPacket
protected final void writeImpl()
{
boolean isGM = false;
final PlayerInstance tmp = getClient().getPlayer();
if ((tmp != null) && tmp.isGM())
{
isGM = true;
}
if (!isGM && _player.getAppearance().isInvisible())
{
return;
}
if (_player.getPoly().isMorphed())
writeC(0x03);
writeD(_player.getX());
writeD(_player.getY());
writeD(_player.getZ());
writeD(_player.getBoat() != null ? _player.getBoat().getObjectId() : 0);
writeD(_player.getObjectId());
writeS(_player.getName());
writeD(_player.getRace().ordinal());
writeD(_player.getAppearance().isFemale() ? 1 : 0);
if (_player.getClassIndex() == 0)
{
final NpcTemplate template = NpcTable.getInstance().getTemplate(_player.getPoly().getPolyId());
if (template != null)
{
writeC(0x16);
writeD(_player.getObjectId());
writeD(_player.getPoly().getPolyId() + 1000000); // npctype id
writeD(_player.getKarma() > 0 ? 1 : 0);
writeD(_x);
writeD(_y);
writeD(_z);
writeD(_heading);
writeD(0x00);
writeD(_mAtkSpd);
writeD(_pAtkSpd);
writeD(_runSpd); // base run speed
writeD(_walkSpd); // base walk speed
writeD(_runSpd); // swim run speed (calculated by getter)
writeD(_walkSpd); // swim walk speed (calculated by getter)
writeD(_flyRunSpd); // fly run speed ?
writeD(_flyWalkSpd); // fly walk speed ?
writeD(_flyRunSpd);
writeD(_flyWalkSpd);
writeF(_moveMultiplier);
writeF(_attackSpeedMultiplier);
writeF(template.getCollisionRadius());
writeF(template.getCollisionHeight());
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_RHAND)); // right hand weapon
writeD(0);
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_LHAND)); // left hand weapon
writeC(1); // name above char 1=true ... ??
writeC(_player.isRunning() ? 1 : 0);
writeC(_player.isInCombat() ? 1 : 0);
writeC(_player.isAlikeDead() ? 1 : 0);
// if(gmSeeInvis)
// {
writeC(0); // if the charinfo is written means receiver can see the char
// }
// else
// {
// writeC(_player.getAppearance().getInvisible() ? 1 : 0); // invisible ?? 0=false 1=true 2=summoned (only works if model has a summon animation)
// }
writeS(_player.getName());
if (_player.getAppearance().isInvisible())
{
writeS("Invisible");
}
else
{
writeS(_player.getTitle());
}
writeD(0);
writeD(0);
writeD(0); // hmm karma ??
if (_player.getAppearance().isInvisible())
{
writeD((_player.getAbnormalEffect() | Creature.ABNORMAL_EFFECT_STEALTH));
}
else
{
writeD(_player.getAbnormalEffect()); // C2
}
writeD(0); // C2
writeD(0); // C2
writeD(0); // C2
writeD(0); // C2
writeC(0); // C2
}
else
{
LOGGER.warning("Character " + _player.getName() + " (" + _player.getObjectId() + ") morphed in a Npc (" + _player.getPoly().getPolyId() + ") w/o template.");
}
writeD(_player.getClassId().getId());
}
else
{
writeC(0x03);
writeD(_x);
writeD(_y);
writeD(_z);
writeD(_player.getBoat() != null ? _player.getBoat().getObjectId() : 0);
writeD(_player.getObjectId());
writeS(_player.getName());
writeD(_player.getRace().ordinal());
writeD(_player.getAppearance().isFemale() ? 1 : 0);
if (_player.getClassIndex() == 0)
{
writeD(_player.getClassId().getId());
}
else
{
writeD(_player.getBaseClass());
}
writeD(0x00);
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_HEAD));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_RHAND));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_LHAND));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_GLOVES));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_CHEST));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_LEGS));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_FEET));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_BACK));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_LRHAND));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_HAIR));
writeD(_player.getPvpFlag());
writeD(_player.getKarma());
writeD(_mAtkSpd);
writeD(_pAtkSpd);
writeD(_player.getPvpFlag());
writeD(_player.getKarma());
writeD(_runSpd); // base run speed
writeD(_walkSpd); // base walk speed
writeD(_runSpd); // swim run speed (calculated by getter)
writeD(_walkSpd); // swim walk speed (calculated by getter)
writeD(_flyRunSpd); // fly run speed ?
writeD(_flyWalkSpd); // fly walk speed ?
writeD(_flyRunSpd);
writeD(_flyWalkSpd);
writeF(_moveMultiplier);
writeF(_attackSpeedMultiplier);
writeF(_player.getBaseTemplate().getCollisionRadius());
writeF(_player.getBaseTemplate().getCollisionHeight());
writeD(_player.getAppearance().getHairStyle());
writeD(_player.getAppearance().getHairColor());
writeD(_player.getAppearance().getFace());
if (_player.getAppearance().isInvisible())
{
writeS("[Invisible]");
}
else
{
writeS(_player.getTitle());
}
writeD(_player.getClanId());
writeD(_player.getClanCrestId());
writeD(_player.getAllyId());
writeD(_player.getAllyCrestId());
// In UserInfo leader rights and siege flags, but here found nothing??
// Therefore RelationChanged packet with that info is required
writeD(0x00);
writeC(_player.isSitting() ? 0 : 1); // standing = 1 sitting = 0
writeC(_player.isRunning() ? 1 : 0); // running = 1 walking = 0
writeC(_player.isInCombat() ? 1 : 0);
writeC(_player.isAlikeDead() ? 1 : 0);
// if(gmSeeInvis)
// {
writeC(0x00); // if the charinfo is written means receiver can see the char
// }
// else
// {
// writeC(_activeChar.getAppearance().getInvisible() ? 1 : 0); // invisible = 1 visible =0
// }
writeC(_player.getMountType()); // 1 on strider 2 on wyvern 0 no mount
writeC(_player.getPrivateStoreType()); // 1 - sellshop
writeH(_player.getCubics().size());
for (int cubicId : _player.getCubics().keySet())
{
writeH(cubicId);
}
writeC(_player.isInPartyMatchRoom() ? 1 : 0);
if (_player.getAppearance().isInvisible())
{
writeD((_player.getAbnormalEffect() | Creature.ABNORMAL_EFFECT_STEALTH));
}
else
{
writeD(_player.getAbnormalEffect());
}
writeC(_player.getRecomLeft());
writeH(_player.getRecomHave()); // Blue value for name (0 = white, 255 = pure blue)
writeD(_player.getClassId().getId());
writeD(_player.getMaxCp());
writeD((int) _player.getCurrentCp());
writeC(_player.isMounted() ? 0 : _player.getEnchantEffect());
if (_player.getTeam() == 1)
{
writeC(0x01); // team circle around feet 1= Blue, 2 = red
}
else if (_player.getTeam() == 2)
{
writeC(0x02); // team circle around feet 1= Blue, 2 = red
}
else
{
writeC(0x00); // team circle around feet 1= Blue, 2 = red
}
writeD(_player.getClanCrestLargeId());
writeC(_player.isNoble() ? 1 : 0); // Symbol on char menu ctrl+I
writeC((_player.isHero() || (_player.isGM() && Config.GM_HERO_AURA) || _player.isPVPHero()) ? 1 : 0); // Hero Aura
writeC(_player.isFishing() ? 1 : 0); // 0x01: Fishing Mode (Cant be undone by setting back to 0)
writeD(_player.getFishX());
writeD(_player.getFishY());
writeD(_player.getFishZ());
writeD(_player.getAppearance().getNameColor());
writeD(_player.getBaseClass());
}
writeD(0x00);
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_HEAD));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_RHAND));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_LHAND));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_GLOVES));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_CHEST));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_LEGS));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_FEET));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_BACK));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_LRHAND));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_HAIR));
writeD(_player.getPvpFlag());
writeD(_player.getKarma());
writeD(_player.getMAtkSpd());
writeD(_player.getPAtkSpd());
writeD(_player.getPvpFlag());
writeD(_player.getKarma());
writeD(_runSpd); // base run speed
writeD(_walkSpd); // base walk speed
writeD(_runSpd); // swim run speed (calculated by getter)
writeD(_walkSpd); // swim walk speed (calculated by getter)
writeD(_flyRunSpd); // fly run speed ?
writeD(_flyWalkSpd); // fly walk speed ?
writeD(_flyRunSpd);
writeD(_flyWalkSpd);
writeF(_moveMultiplier);
writeF(_player.getAttackSpeedMultiplier());
writeF(_player.getBaseTemplate().getCollisionRadius());
writeF(_player.getBaseTemplate().getCollisionHeight());
writeD(_player.getAppearance().getHairStyle());
writeD(_player.getAppearance().getHairColor());
writeD(_player.getAppearance().getFace());
if (_player.getAppearance().isInvisible())
{
writeS("[Invisible]");
}
else
{
writeS(_player.getTitle());
}
writeD(_player.getClanId());
writeD(_player.getClanCrestId());
writeD(_player.getAllyId());
writeD(_player.getAllyCrestId());
// In UserInfo leader rights and siege flags, but here found nothing??
// Therefore RelationChanged packet with that info is required
writeD(0x00);
writeC(_player.isSitting() ? 0 : 1); // standing = 1 sitting = 0
writeC(_player.isRunning() ? 1 : 0); // running = 1 walking = 0
writeC(_player.isInCombat() ? 1 : 0);
writeC(_player.isAlikeDead() ? 1 : 0);
// if(gmSeeInvis)
// {
writeC(0x00); // if the charinfo is written means receiver can see the char
// }
// else
// {
// writeC(_activeChar.getAppearance().getInvisible() ? 1 : 0); // invisible = 1 visible =0
// }
writeC(_player.getMountType()); // 1 on strider 2 on wyvern 0 no mount
writeC(_player.getPrivateStoreType()); // 1 - sellshop
writeH(_player.getCubics().size());
for (int cubicId : _player.getCubics().keySet())
{
writeH(cubicId);
}
writeC(_player.isInPartyMatchRoom() ? 1 : 0);
if (_player.getAppearance().isInvisible())
{
writeD((_player.getAbnormalEffect() | Creature.ABNORMAL_EFFECT_STEALTH));
}
else
{
writeD(_player.getAbnormalEffect());
}
writeC(_player.getRecomLeft());
writeH(_player.getRecomHave()); // Blue value for name (0 = white, 255 = pure blue)
writeD(_player.getClassId().getId());
writeD(_player.getMaxCp());
writeD((int) _player.getCurrentCp());
writeC(_player.isMounted() ? 0 : _player.getEnchantEffect());
if (_player.getTeam() == 1)
{
writeC(0x01); // team circle around feet 1= Blue, 2 = red
}
else if (_player.getTeam() == 2)
{
writeC(0x02); // team circle around feet 1= Blue, 2 = red
}
else
{
writeC(0x00); // team circle around feet 1= Blue, 2 = red
}
writeD(_player.getClanCrestLargeId());
writeC(_player.isNoble() ? 1 : 0); // Symbol on char menu ctrl+I
writeC((_player.isHero() || (_player.isGM() && Config.GM_HERO_AURA) || _player.isPVPHero()) ? 1 : 0); // Hero Aura
writeC(_player.isFishing() ? 1 : 0); // 0x01: Fishing Mode (Cant be undone by setting back to 0)
writeD(_player.getFishX());
writeD(_player.getFishY());
writeD(_player.getFishZ());
writeD(_player.getAppearance().getNameColor());
}
}

View File

@ -61,9 +61,6 @@ public class NpcInfo extends GameServerPacket
*/
public NpcInfo(NpcInstance cha, Creature attacker)
{
/*
* if(cha.getMxcPoly() != null) { attacker.sendPacket(new MxCPolyInfo(cha)); return; }
*/
if (cha.getCustomNpcInstance() != null)
{
attacker.sendPacket(new CustomNpcInfo(cha));

View File

@ -1,175 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.l2jmobius.gameserver.network.serverpackets;
import org.l2jmobius.gameserver.datatables.sql.NpcTable;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
* @version $Revision: 1.7.2.4.2.9 $ $Date: 2005/04/11 10:05:54 $
*/
public class NpcInfoPoly extends GameServerPacket
{
private Creature _creature;
private final WorldObject _obj;
private int _x;
private int _y;
private int _z;
private int _heading;
private final int _npcId;
private boolean _isAttackable;
private final boolean _isSummoned;
private boolean _isRunning;
private boolean _isInCombat;
private boolean _isAlikeDead;
private int _mAtkSpd;
private int _pAtkSpd;
private int _runSpd;
private int _walkSpd;
private int _swimRunSpd;
private int _swimWalkSpd;
private int _flRunSpd;
private int _flWalkSpd;
private int _flyRunSpd;
private int _flyWalkSpd;
private int _rhand;
private int _lhand;
private String _name;
private String _title;
private int _abnormalEffect;
NpcTemplate _template;
private final int _collisionRadius;
private final int _collisionHeight;
/**
* Instantiates a new npc info poly.
* @param obj the obj
* @param attacker the attacker
*/
public NpcInfoPoly(WorldObject obj, Creature attacker)
{
_obj = obj;
_npcId = obj.getPoly().getPolyId();
_template = NpcTable.getInstance().getTemplate(_npcId);
_isAttackable = true;
_rhand = 0;
_lhand = 0;
_isSummoned = false;
_collisionRadius = _template.getCollisionRadius();
_collisionHeight = _template.getCollisionHeight();
if (_obj instanceof Creature)
{
_creature = (Creature) obj;
_isAttackable = obj.isAutoAttackable(attacker);
_rhand = _template.getRhand();
_lhand = _template.getLhand();
}
if (_obj instanceof ItemInstance)
{
_x = _obj.getX();
_y = _obj.getY();
_z = _obj.getZ();
_heading = 0;
_mAtkSpd = 100; // yes, an item can be dread as death
_pAtkSpd = 100;
_runSpd = 120;
_walkSpd = 80;
_swimRunSpd = _flRunSpd = _flyRunSpd = _runSpd;
_swimWalkSpd = _flWalkSpd = _flyWalkSpd = _walkSpd;
_isRunning = _isInCombat = _isAlikeDead = false;
_name = "item";
_title = "polymorphed";
_abnormalEffect = 0;
}
else
{
_x = _creature.getX();
_y = _creature.getY();
_z = _creature.getZ();
_heading = _creature.getHeading();
_mAtkSpd = _creature.getMAtkSpd();
_pAtkSpd = _creature.getPAtkSpd();
_runSpd = _creature.getRunSpeed();
_walkSpd = _creature.getWalkSpeed();
_swimRunSpd = _flRunSpd = _flyRunSpd = _runSpd;
_swimWalkSpd = _flWalkSpd = _flyWalkSpd = _walkSpd;
_isRunning = _creature.isRunning();
_isInCombat = _creature.isInCombat();
_isAlikeDead = _creature.isAlikeDead();
_name = _creature.getName();
_title = _creature.getTitle();
_abnormalEffect = _creature.getAbnormalEffect();
}
}
/*
* (non-Javadoc)
* @see org.l2jmobius.gameserver.network.serverpackets.L2GameServerPacket#writeImpl()
*/
@Override
protected final void writeImpl()
{
writeC(0x16);
writeD(_obj.getObjectId());
writeD(_npcId + 1000000); // npctype id
writeD(_isAttackable ? 1 : 0);
writeD(_x);
writeD(_y);
writeD(_z);
writeD(_heading);
writeD(0x00);
writeD(_mAtkSpd);
writeD(_pAtkSpd);
writeD(_runSpd);
writeD(_walkSpd);
writeD(_swimRunSpd/* 0x32 */); // swimspeed
writeD(_swimWalkSpd/* 0x32 */); // swimspeed
writeD(_flRunSpd);
writeD(_flWalkSpd);
writeD(_flyRunSpd);
writeD(_flyWalkSpd);
writeF(1/* _activeChar.getProperMultiplier() */);
writeF(1/* _activeChar.getAttackSpeedMultiplier() */);
writeF(_collisionRadius);
writeF(_collisionHeight);
writeD(_rhand); // right hand weapon
writeD(0);
writeD(_lhand); // left hand weapon
writeC(1); // name above char 1=true ... ??
writeC(_isRunning ? 1 : 0);
writeC(_isInCombat ? 1 : 0);
writeC(_isAlikeDead ? 1 : 0);
writeC(_isSummoned ? 2 : 0); // invisible ?? 0=false 1=true 2=summoned (only works if model has a summon animation)
writeS(_name);
writeS(_title);
writeD(0);
writeD(0);
writeD(0000); // hmm karma ??
writeH(_abnormalEffect); // C2
writeH(0x00); // C2
writeD(0000); // C2
writeD(0000); // C2
writeD(0000); // C2
writeD(0000); // C2
writeC(0000); // C2
}
}

View File

@ -1,76 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.l2jmobius.gameserver.network.serverpackets;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
* 15 ee cc 11 43 object id 39 00 00 00 item id 8f 14 00 00 x b7 f1 00 00 y 60 f2 ff ff z 01 00 00 00 show item count 7a 00 00 00 count . format dddddddd
* @version $Revision: 1.3.2.1.2.3 $ $Date: 2005/03/27 15:29:39 $
*/
public class SpawnItemPoly extends GameServerPacket
{
private int _objectId;
private int _itemId;
private int _x;
private int _y;
private int _z;
private int _stackable;
private int _count;
public SpawnItemPoly(WorldObject object)
{
if (object instanceof ItemInstance)
{
final ItemInstance item = (ItemInstance) object;
_objectId = object.getObjectId();
_itemId = object.getPoly().getPolyId();
_x = item.getX();
_y = item.getY();
_z = item.getZ();
_stackable = item.isStackable() ? 0x01 : 0x00;
_count = item.getCount();
}
else
{
_objectId = object.getObjectId();
_itemId = object.getPoly().getPolyId();
_x = object.getX();
_y = object.getY();
_z = object.getZ();
_stackable = 0x00;
_count = 1;
}
}
@Override
protected final void writeImpl()
{
writeC(0x0b);
writeD(_objectId);
writeD(_itemId);
writeD(_x);
writeD(_y);
writeD(_z);
// only show item count if it is a stackable item
writeD(_stackable);
writeD(_count);
writeD(0x00); // c2
}
}

View File

@ -17,11 +17,9 @@
package org.l2jmobius.gameserver.network.serverpackets;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.datatables.sql.NpcTable;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Summon;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
public class UserInfo extends GameServerPacket
@ -180,14 +178,6 @@ public class UserInfo extends GameServerPacket
{
title = "[Invisible]";
}
if (_player.getPoly().isMorphed())
{
final NpcTemplate polyObj = NpcTable.getInstance().getTemplate(_player.getPoly().getPolyId());
if (polyObj != null)
{
title += " - " + polyObj.getName();
}
}
writeS(title);
writeD(_player.getClanId());

View File

@ -225,10 +225,6 @@
<admin command="admin_para_all_menu" accessLevel="80" />
<admin command="admin_unpara_menu" accessLevel="80" />
<admin command="admin_para_menu" accessLevel="80" />
<admin command="admin_polyself" accessLevel="80" />
<admin command="admin_unpolyself" accessLevel="80" />
<admin command="admin_polyself_menu" accessLevel="80" />
<admin command="admin_unpolyself_menu" accessLevel="80" />
<admin command="admin_clearteams" accessLevel="80" />
<admin command="admin_setteam_close" accessLevel="80" /> <!-- set all Gm close players to val team -->
<admin command="admin_setteam" accessLevel="80" />
@ -282,8 +278,6 @@
<admin command="admin_event_name" accessLevel="80" />
<admin command="admin_event_control_kill" accessLevel="80" />
<admin command="admin_event_control_res" accessLevel="80" />
<admin command="admin_event_control_poly" accessLevel="80" />
<admin command="admin_event_control_unpoly" accessLevel="80" />
<admin command="admin_event_control_prize" accessLevel="80" />
<admin command="admin_event_control_chatban" accessLevel="80" />
<admin command="admin_event_control_finish" accessLevel="80" />
@ -435,12 +429,6 @@
<!-- Section: Pledge -->
<admin command="admin_pledge" accessLevel="90" /> <!-- Manage Clan -->
<!-- Section: Polymorph -->
<admin command="admin_polymorph" accessLevel="90" />
<admin command="admin_unpolymorph" accessLevel="90" />
<admin command="admin_polymorph_menu" accessLevel="90" />
<admin command="admin_unpolymorph_menu" accessLevel="90" />
<!-- Section: Quest -->
<admin command="admin_quest_reload" accessLevel="90" />

View File

@ -11,12 +11,8 @@
<td><edit var="menu_command" width=120 height=15></td>
<td><button value="Help" action="bypass -h admin_help help/effects_menu.htm" width=45 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
</tr></table><br>
<font color="aadd77">Trasformations</font><table width=240><tr>
<td><button value="PolyMorph" action="bypass -h admin_polymorph_menu $menu_command" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
<td><button value="UnPoly" action="bypass -h admin_unpolymorph_menu" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
<td><button value="PolySelf" action="bypass -h admin_polyself_menu $menu_command" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
<td><button value="UnPolySlf" action="bypass -h admin_unpolyself_menu" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
</tr><tr>
<font color="aadd77">Effects</font><table width=240>
<tr>
<td><button value="Para" action="bypass -h admin_para_menu $menu_command" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
<td><button value="UnPara" action="bypass -h admin_unpara_menu $menu_command" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
<td><button value="ParaAll" action="bypass -h admin_para_all_menu" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>

View File

@ -7,10 +7,6 @@
3-Effect Panel Buttons<br></font>
L2 special effects are here: earthquakes, sky changes, weird character and mob animations.<br>
<font color="LEVEL">3-1 First pack of effects.<br>
PolyMorph:</font> Make your target (player) look like the specified mob.<br>
<font color="LEVEL">Unpoly:</font> Cancel polymorph effects that specified target may have.<br>
<font color="LEVEL">PolySelf:</font> Polymorph yourself to specified npcId, you will see a title change only.<br>
<font color="LEVEL">UnPolySelf:</font> Cancel any polymorph effect you could have.<br>
<font color="LEVEL">Para:</font> Paralyze character (target/name).<br>
<font color="LEVEL">UnPara:</font> Cancel Paralysis effect (target/name).<br>
<font color="LEVEL">ParaAll:</font> Paralyze any character in the world, but yours. Use wisely, annoys people and causes lag.<br>

View File

@ -52,10 +52,5 @@
<font color="LEVEL">//setew value</font> - Sets enchantment of target player currently equipped weapon to value<br><font color="FF9933">Usage: //setew 9999</font><br>
<font color="LEVEL">//banchat</font> - Mutes a player<br><font color="FF9933">Usage: //banchat kadar </font><br>
<font color="LEVEL">//unbanchat</font> - Unmutes a player<br><font color="FF9933">Usage: //unbanchat kadar </font><br>
<font color="LEVEL">//polymorph character npc id </font><br>
<font color="LEVEL">//polymorph item id to poly target into id|</font><br>
<font color="LEVEL">//polyself &lt;npc id&gt;</font> - Used to polymorph yourself into a mob<br>
<font color="LEVEL">//unpolyself</font> - Returns you to the normal state<br>
<font color="LEVEL">//polymorph item &lt;itemid&gt;</font> - Polymorphs an item<br>
<center><button value="Index" action="bypass -h admin_help admhelp.htm" width=60 height=15 back="sek.cbui94" fore="sek.cbui92"></center>
</body></html>

View File

@ -68,7 +68,6 @@ import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminOnline;
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminPForge;
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminPetition;
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminPledge;
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminPolymorph;
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminQuest;
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminReload;
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminRepairChar;
@ -149,7 +148,6 @@ public class AdminCommandHandler
registerAdminCommandHandler(new AdminPetition());
registerAdminCommandHandler(new AdminPForge());
registerAdminCommandHandler(new AdminPledge());
registerAdminCommandHandler(new AdminPolymorph());
registerAdminCommandHandler(new AdminQuest());
registerAdminCommandHandler(new AdminReload());
registerAdminCommandHandler(new AdminRepairChar());

View File

@ -27,7 +27,6 @@ import org.l2jmobius.gameserver.model.actor.instance.ChestInstance;
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.CharInfo;
import org.l2jmobius.gameserver.network.serverpackets.Earthquake;
import org.l2jmobius.gameserver.network.serverpackets.ExRedSky;
import org.l2jmobius.gameserver.network.serverpackets.GameServerPacket;
@ -38,7 +37,6 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
import org.l2jmobius.gameserver.network.serverpackets.StopMove;
import org.l2jmobius.gameserver.network.serverpackets.SunRise;
import org.l2jmobius.gameserver.network.serverpackets.SunSet;
import org.l2jmobius.gameserver.network.serverpackets.UserInfo;
import org.l2jmobius.gameserver.util.BuilderUtil;
/**
@ -49,7 +47,6 @@ import org.l2jmobius.gameserver.util.BuilderUtil;
* <li>gmspeed = temporary Super Haste effect.
* <li>para/unpara = paralyze/remove paralysis from target
* <li>para_all/unpara_all = same as para/unpara, affects the whole world.
* <li>polyself/unpolyself = makes you look as a specified mob.
* <li>changename = temporary change name
* <li>clearteams/setteam_close/setteam = team related commands
* <li>social = forces an Creature instance to broadcast social action packets.
@ -80,10 +77,6 @@ public class AdminEffects implements IAdminCommandHandler
"admin_para_all_menu",
"admin_unpara_menu",
"admin_para_menu",
"admin_polyself",
"admin_unpolyself",
"admin_polyself_menu",
"admin_unpolyself_menu",
"admin_clearteams",
"admin_setteam_close",
"admin_setteam",
@ -333,34 +326,6 @@ public class AdminEffects implements IAdminCommandHandler
{
}
}
else if (command.startsWith("admin_polyself"))
{
try
{
final String id = st.nextToken();
activeChar.getPoly().setPolyInfo("npc", id);
activeChar.teleToLocation(activeChar.getX(), activeChar.getY(), activeChar.getZ(), false);
activeChar.broadcastPacket(new CharInfo(activeChar));
activeChar.sendPacket(new UserInfo(activeChar));
}
catch (Exception e)
{
}
}
else if (command.startsWith("admin_unpolyself"))
{
try
{
activeChar.getPoly().setPolyInfo(null, "1");
activeChar.decayMe();
activeChar.spawnMe(activeChar.getX(), activeChar.getY(), activeChar.getZ());
activeChar.broadcastPacket(new CharInfo(activeChar));
activeChar.sendPacket(new UserInfo(activeChar));
}
catch (Exception e)
{
}
}
else if (command.equals("admin_clear_teams"))
{
try

View File

@ -36,13 +36,11 @@ import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.entity.event.GameEvent;
import org.l2jmobius.gameserver.model.spawn.Spawn;
import org.l2jmobius.gameserver.network.serverpackets.CharInfo;
import org.l2jmobius.gameserver.network.serverpackets.ItemList;
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import org.l2jmobius.gameserver.network.serverpackets.PlaySound;
import org.l2jmobius.gameserver.network.serverpackets.Revive;
import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
import org.l2jmobius.gameserver.network.serverpackets.UserInfo;
/**
* This class handles following admin commands: - admin = shows menu
@ -70,8 +68,6 @@ public class AdminEventEngine implements IAdminCommandHandler
"admin_event_name",
"admin_event_control_kill",
"admin_event_control_res",
"admin_event_control_poly",
"admin_event_control_unpoly",
"admin_event_control_prize",
"admin_event_control_chatban",
"admin_event_control_finish"
@ -340,30 +336,6 @@ public class AdminEventEngine implements IAdminCommandHandler
showEventControl(activeChar);
}
else if (command.startsWith("admin_event_control_poly"))
{
final StringTokenizer st0 = new StringTokenizer(command.substring(25));
final StringTokenizer st = new StringTokenizer(st0.nextToken(), "-");
final String id = st0.nextToken();
while (st.hasMoreElements())
{
polyTeam(Integer.parseInt(st.nextToken()), id);
}
showEventControl(activeChar);
}
else if (command.startsWith("admin_event_control_unpoly"))
{
final StringTokenizer st = new StringTokenizer(command.substring(27), "-");
while (st.hasMoreElements())
{
unpolyTeam(Integer.parseInt(st.nextToken()));
}
showEventControl(activeChar);
}
else if (command.startsWith("admin_event_control_prize"))
{
final StringTokenizer st0 = new StringTokenizer(command.substring(26));
@ -599,11 +571,6 @@ public class AdminEventEngine implements IAdminCommandHandler
replyMSG.append("<tr><td>&nbsp;</td></tr>");
replyMSG.append("<tr><td><button value=\"Resurrect\" action=\"bypass -h admin_event_control_res $team_number\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td><td><font color=\"LEVEL\">Resurrect Team's members</font></td></tr>");
replyMSG.append("<tr><td>&nbsp;</td></tr>");
replyMSG.append("<tr><td><button value=\"Polymorph\" action=\"bypass -h admin_event_control_poly $team_number $poly_id\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td><td><edit var=\"poly_id\" width=100 height=15><font color=\"LEVEL\">Polymorphs the team into the NPC with the id specified</font></td></tr>");
replyMSG.append("<tr><td>&nbsp;</td></tr>");
replyMSG.append("<tr><td><button value=\"UnPolymorph\" action=\"bypass -h admin_event_control_unpoly $team_number\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td><td><font color=\"LEVEL\">Unpolymorph the team</font></td></tr>");
replyMSG.append("<tr><td>&nbsp;</td></tr>");
replyMSG.append("<tr><td>&nbsp;</td></tr>");
replyMSG.append("<tr><td><button value=\"Give Item\" action=\"bypass -h admin_event_control_prize $team_number $n $id\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"> number <edit var=\"n\" width=100 height=15> item id <edit var=\"id\" width=100 height=15></td><td><font color=\"LEVEL\">Give the specified item id to every single member of the team, you can put 5*level, 5*kills or 5 in the number field for example</font></td></tr>");
replyMSG.append("<tr><td>&nbsp;</td></tr>");
replyMSG.append("<tr><td><button value=\"End\" action=\"bypass -h admin_event_control_finish\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td><td><font color=\"LEVEL\">Will finish the event teleporting back all the players</font></td></tr>");
@ -763,49 +730,6 @@ public class AdminEventEngine implements IAdminCommandHandler
}
}
void polyTeam(int team, String id)
{
final LinkedList<String> linked = GameEvent.players.get(team);
final Iterator<String> it = linked.iterator();
while (it.hasNext())
{
try
{
final PlayerInstance target = World.getInstance().getPlayer(it.next());
target.getPoly().setPolyInfo("npc", id);
target.teleToLocation(target.getX(), target.getY(), target.getZ(), true);
target.broadcastPacket(new CharInfo(target));
target.sendPacket(new UserInfo(target));
}
catch (Exception e)
{
}
}
}
void unpolyTeam(int team)
{
final LinkedList<String> linked = GameEvent.players.get(team);
final Iterator<String> it = linked.iterator();
while (it.hasNext())
{
try
{
final PlayerInstance target = World.getInstance().getPlayer(it.next());
target.getPoly().setPolyInfo(null, "1");
target.decayMe();
target.spawnMe(target.getX(), target.getY(), target.getZ());
target.broadcastPacket(new CharInfo(target));
target.sendPacket(new UserInfo(target));
}
catch (Exception e)
{
}
}
}
private void createItem(PlayerInstance activeChar, PlayerInstance player, int id, int num)
{
player.getInventory().addItem("Event", id, num, player, activeChar);
@ -855,7 +779,6 @@ public class AdminEventEngine implements IAdminCommandHandler
void telePlayersBack(int team)
{
resTeam(team);
unpolyTeam(team);
final LinkedList<String> linked = GameEvent.players.get(team);
final Iterator<String> it = linked.iterator();

View File

@ -1,135 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.l2jmobius.gameserver.handler.admincommandhandlers;
import java.util.StringTokenizer;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
import org.l2jmobius.gameserver.network.serverpackets.SetupGauge;
import org.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles following admin commands: polymorph
* @version $Revision: 1.2.2.1.2.4 $ $Date: 2007/07/31 10:05:56 $
*/
public class AdminPolymorph implements IAdminCommandHandler
{
private static final String[] ADMIN_COMMANDS =
{
"admin_polymorph",
"admin_unpolymorph",
"admin_polymorph_menu",
"admin_unpolymorph_menu"
};
@Override
public boolean useAdminCommand(String command, PlayerInstance activeChar)
{
if (command.startsWith("admin_polymorph"))
{
final StringTokenizer st = new StringTokenizer(command);
final WorldObject target = activeChar.getTarget();
try
{
st.nextToken();
final String p1 = st.nextToken();
if (st.hasMoreTokens())
{
final String p2 = st.nextToken();
doPolymorph(activeChar, target, p2, p1);
}
else
{
doPolymorph(activeChar, target, p1, "npc");
}
}
catch (Exception e)
{
BuilderUtil.sendSysMessage(activeChar, "Usage: //polymorph [type] <id>");
}
}
else if (command.equals("admin_unpolymorph"))
{
doUnpoly(activeChar, activeChar.getTarget());
}
if (command.contains("menu"))
{
showMainPage(activeChar);
}
return true;
}
@Override
public String[] getAdminCommandList()
{
return ADMIN_COMMANDS;
}
private void doPolymorph(PlayerInstance activeChar, WorldObject obj, String id, String type)
{
if (obj != null)
{
obj.getPoly().setPolyInfo(type, id);
// animation
if (obj instanceof Creature)
{
final Creature creature = (Creature) obj;
creature.broadcastPacket(new MagicSkillUse(creature, creature, 1008, 1, 4000, 0));
creature.sendPacket(new SetupGauge(0, 4000));
}
// end of animation
obj.decayMe();
obj.spawnMe(obj.getX(), obj.getY(), obj.getZ());
BuilderUtil.sendSysMessage(activeChar, "Polymorph succeed");
}
else
{
activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
}
}
private void doUnpoly(PlayerInstance activeChar, WorldObject target)
{
if (target != null)
{
target.getPoly().setPolyInfo(null, "1");
target.decayMe();
target.spawnMe(target.getX(), target.getY(), target.getZ());
BuilderUtil.sendSysMessage(activeChar, "Unpolymorph succeed");
}
else
{
activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
}
}
private void showMainPage(PlayerInstance activeChar)
{
AdminHelpPage.showHelpPage(activeChar, "effects_menu.htm");
}
}

View File

@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.instancemanager.MercTicketManager;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.knownlist.WorldObjectKnownList;
import org.l2jmobius.gameserver.model.actor.poly.ObjectPoly;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
@ -47,7 +46,6 @@ public abstract class WorldObject
private WorldObjectKnownList _knownList;
private String _name;
private int _objectId;
private ObjectPoly _poly;
private ObjectPosition _position;
// Objects can only see objects in same instancezone, instance 0 is normal world -1 the all seeing world
@ -351,15 +349,6 @@ public abstract class WorldObject
return _objectId;
}
public ObjectPoly getPoly()
{
if (_poly == null)
{
_poly = new ObjectPoly(this);
}
return _poly;
}
public ObjectPosition getPosition()
{
if (_position == null)

View File

@ -4130,7 +4130,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
* In Server->Client packet, each effect is represented by 1 bit of the map (ex : BLEEDING = 0x0001 (bit 1), SLEEP = 0x0080 (bit 8)...). The map is calculated by applying a BINARY OR operation on each effect.<br>
* <br>
* <b><u>Example of use</u>:</b><br>
* <li>Server Packet : CharInfo, NpcInfo, NpcInfoPoly, UserInfo...</li>
* <li>Server Packet : CharInfo, NpcInfo, UserInfo...</li>
* @return the abnormal effect
*/
public int getAbnormalEffect()

View File

@ -44,7 +44,6 @@ import org.l2jmobius.gameserver.network.serverpackets.PrivateStoreMsgSell;
import org.l2jmobius.gameserver.network.serverpackets.RecipeShopMsg;
import org.l2jmobius.gameserver.network.serverpackets.RelationChanged;
import org.l2jmobius.gameserver.network.serverpackets.SpawnItem;
import org.l2jmobius.gameserver.network.serverpackets.SpawnItemPoly;
import org.l2jmobius.gameserver.network.serverpackets.StaticObject;
import org.l2jmobius.gameserver.network.serverpackets.VehicleInfo;
@ -119,126 +118,119 @@ public class PlayerKnownList extends PlayableKnownList
// On retail there is a similar, if not greater, delay as well.
ThreadPool.schedule(() ->
{
if (object.getPoly().isMorphed() && object.getPoly().getPolyType().equals("item"))
if (object.isItem())
{
activeChar.sendPacket(new SpawnItemPoly(object));
if (dropper != null)
{
activeChar.sendPacket(new DropItem((ItemInstance) object, dropper.getObjectId()));
}
else
{
activeChar.sendPacket(new SpawnItem((ItemInstance) object));
}
}
else
else if (object.isDoor())
{
if (object.isItem())
if (((DoorInstance) object).getCastle() != null)
{
if (dropper != null)
{
activeChar.sendPacket(new DropItem((ItemInstance) object, dropper.getObjectId()));
}
else
{
activeChar.sendPacket(new SpawnItem((ItemInstance) object));
}
activeChar.sendPacket(new DoorInfo((DoorInstance) object, true));
}
else if (object.isDoor())
else
{
if (((DoorInstance) object).getCastle() != null)
{
activeChar.sendPacket(new DoorInfo((DoorInstance) object, true));
}
else
{
activeChar.sendPacket(new DoorInfo((DoorInstance) object, false));
}
activeChar.sendPacket(new DoorStatusUpdate((DoorInstance) object));
activeChar.sendPacket(new DoorInfo((DoorInstance) object, false));
}
else if (object.isBoat())
activeChar.sendPacket(new DoorStatusUpdate((DoorInstance) object));
}
else if (object.isBoat())
{
if (!activeChar.isInBoat() && (object != activeChar.getBoat()))
{
if (!activeChar.isInBoat() && (object != activeChar.getBoat()))
{
activeChar.sendPacket(new VehicleInfo((BoatInstance) object));
((BoatInstance) object).sendVehicleDeparture(activeChar);
}
activeChar.sendPacket(new VehicleInfo((BoatInstance) object));
((BoatInstance) object).sendVehicleDeparture(activeChar);
}
else if (object.isNpc())
}
else if (object.isNpc())
{
activeChar.sendPacket(new NpcInfo((NpcInstance) object, activeChar));
}
else if (object.isSummon())
{
final Summon summon = (Summon) object;
// Check if the PlayerInstance is the owner of the Pet
if (activeChar.equals(summon.getOwner()))
{
activeChar.sendPacket(new NpcInfo((NpcInstance) object, activeChar));
}
else if (object.isSummon())
{
final Summon summon = (Summon) object;
activeChar.sendPacket(new PetInfo(summon));
// The PetInfo packet wipes the PartySpelled (list of active spells' icons). Re-add them
summon.updateEffectIcons(true);
// Check if the PlayerInstance is the owner of the Pet
if (activeChar.equals(summon.getOwner()))
if (summon instanceof PetInstance)
{
activeChar.sendPacket(new PetInfo(summon));
// The PetInfo packet wipes the PartySpelled (list of active spells' icons). Re-add them
summon.updateEffectIcons(true);
if (summon instanceof PetInstance)
{
activeChar.sendPacket(new PetItemList((PetInstance) summon));
}
}
else
{
activeChar.sendPacket(new NpcInfo(summon, activeChar));
activeChar.sendPacket(new PetItemList((PetInstance) summon));
}
}
else if (object.isPlayer())
else
{
final PlayerInstance otherPlayer = (PlayerInstance) object;
if (otherPlayer.isInBoat())
activeChar.sendPacket(new NpcInfo(summon, activeChar));
}
}
else if (object.isPlayer())
{
final PlayerInstance otherPlayer = (PlayerInstance) object;
if (otherPlayer.isInBoat())
{
otherPlayer.getPosition().setWorldPosition(otherPlayer.getBoat().getLocation());
activeChar.sendPacket(new CharInfo(otherPlayer));
final int relation = otherPlayer.getRelation(activeChar);
if ((otherPlayer.getKnownList().getKnownRelations().get(activeChar.getObjectId()) != null) && (otherPlayer.getKnownList().getKnownRelations().get(activeChar.getObjectId()) != relation))
{
otherPlayer.getPosition().setWorldPosition(otherPlayer.getBoat().getLocation());
activeChar.sendPacket(new CharInfo(otherPlayer));
final int relation = otherPlayer.getRelation(activeChar);
if ((otherPlayer.getKnownList().getKnownRelations().get(activeChar.getObjectId()) != null) && (otherPlayer.getKnownList().getKnownRelations().get(activeChar.getObjectId()) != relation))
{
activeChar.sendPacket(new RelationChanged(otherPlayer, relation, activeChar.isAutoAttackable(otherPlayer)));
}
activeChar.sendPacket(new GetOnVehicle(otherPlayer, otherPlayer.getBoat(), otherPlayer.getBoatPosition().getX(), otherPlayer.getBoatPosition().getY(), otherPlayer.getBoatPosition().getZ()));
}
else
{
activeChar.sendPacket(new CharInfo(otherPlayer));
final int relation = otherPlayer.getRelation(activeChar);
if ((otherPlayer.getKnownList().getKnownRelations().get(activeChar.getObjectId()) != null) && (otherPlayer.getKnownList().getKnownRelations().get(activeChar.getObjectId()) != relation))
{
activeChar.sendPacket(new RelationChanged(otherPlayer, relation, activeChar.isAutoAttackable(otherPlayer)));
}
activeChar.sendPacket(new RelationChanged(otherPlayer, relation, activeChar.isAutoAttackable(otherPlayer)));
}
if (otherPlayer.getPrivateStoreType() == PlayerInstance.STORE_PRIVATE_SELL)
{
activeChar.sendPacket(new PrivateStoreMsgSell(otherPlayer));
}
else if (otherPlayer.getPrivateStoreType() == PlayerInstance.STORE_PRIVATE_BUY)
{
activeChar.sendPacket(new PrivateStoreMsgBuy(otherPlayer));
}
else if (otherPlayer.getPrivateStoreType() == PlayerInstance.STORE_PRIVATE_MANUFACTURE)
{
activeChar.sendPacket(new RecipeShopMsg(otherPlayer));
}
activeChar.sendPacket(new GetOnVehicle(otherPlayer, otherPlayer.getBoat(), otherPlayer.getBoatPosition().getX(), otherPlayer.getBoatPosition().getY(), otherPlayer.getBoatPosition().getZ()));
}
else if (object instanceof FenceInstance)
else
{
((FenceInstance) object).sendInfo(activeChar);
}
else if (object instanceof StaticObjectInstance)
{
activeChar.sendPacket(new StaticObject((StaticObjectInstance) object));
activeChar.sendPacket(new CharInfo(otherPlayer));
final int relation = otherPlayer.getRelation(activeChar);
if ((otherPlayer.getKnownList().getKnownRelations().get(activeChar.getObjectId()) != null) && (otherPlayer.getKnownList().getKnownRelations().get(activeChar.getObjectId()) != relation))
{
activeChar.sendPacket(new RelationChanged(otherPlayer, relation, activeChar.isAutoAttackable(otherPlayer)));
}
}
if (object.isCreature())
if (otherPlayer.getPrivateStoreType() == PlayerInstance.STORE_PRIVATE_SELL)
{
// Update the state of the Creature object client side by sending Server->Client packet MoveToPawn/CharMoveToLocation and AutoAttackStart to the PlayerInstance
final Creature obj = (Creature) object;
final CreatureAI objAi = obj.getAI();
if (objAi != null)
{
objAi.describeStateToPlayer(activeChar);
}
activeChar.sendPacket(new PrivateStoreMsgSell(otherPlayer));
}
else if (otherPlayer.getPrivateStoreType() == PlayerInstance.STORE_PRIVATE_BUY)
{
activeChar.sendPacket(new PrivateStoreMsgBuy(otherPlayer));
}
else if (otherPlayer.getPrivateStoreType() == PlayerInstance.STORE_PRIVATE_MANUFACTURE)
{
activeChar.sendPacket(new RecipeShopMsg(otherPlayer));
}
}
else if (object instanceof FenceInstance)
{
((FenceInstance) object).sendInfo(activeChar);
}
else if (object instanceof StaticObjectInstance)
{
activeChar.sendPacket(new StaticObject((StaticObjectInstance) object));
}
if (object.isCreature())
{
// Update the state of the Creature object client side by sending Server->Client packet MoveToPawn/CharMoveToLocation and AutoAttackStart to the PlayerInstance
final Creature obj = (Creature) object;
final CreatureAI objAi = obj.getAI();
if (objAi != null)
{
objAi.describeStateToPlayer(activeChar);
}
}
}, _packetSendDelay + Rnd.get(50)); // Add additional 0-49ms in case of overlapping tasks on heavy load.

View File

@ -1,67 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.l2jmobius.gameserver.model.actor.poly;
import org.l2jmobius.gameserver.model.WorldObject;
public class ObjectPoly
{
private final WorldObject _activeObject;
private int _polyId;
private String _polyType;
public ObjectPoly(WorldObject activeObject)
{
_activeObject = activeObject;
}
public void setPolyInfo(String polyType, String polyId)
{
setPolyId(Integer.parseInt(polyId));
setPolyType(polyType);
}
public WorldObject getActiveObject()
{
return _activeObject;
}
public boolean isMorphed()
{
return _polyType != null;
}
public int getPolyId()
{
return _polyId;
}
public void setPolyId(int value)
{
_polyId = value;
}
public String getPolyType()
{
return _polyType;
}
public void setPolyType(String value)
{
_polyType = value;
}
}

View File

@ -35,7 +35,6 @@ import org.l2jmobius.gameserver.network.serverpackets.PetInfo;
import org.l2jmobius.gameserver.network.serverpackets.PetItemList;
import org.l2jmobius.gameserver.network.serverpackets.RelationChanged;
import org.l2jmobius.gameserver.network.serverpackets.SpawnItem;
import org.l2jmobius.gameserver.network.serverpackets.SpawnItemPoly;
import org.l2jmobius.gameserver.network.serverpackets.StaticObject;
import org.l2jmobius.gameserver.network.serverpackets.UserInfo;
import org.l2jmobius.gameserver.network.serverpackets.VehicleInfo;
@ -66,98 +65,91 @@ public class RequestRecordInfo extends GameClientPacket
continue;
}
if (object.getPoly().isMorphed() && object.getPoly().getPolyType().equals("item"))
if (object instanceof ItemInstance)
{
player.sendPacket(new SpawnItemPoly(object));
player.sendPacket(new SpawnItem((ItemInstance) object));
}
else
else if (object instanceof DoorInstance)
{
if (object instanceof ItemInstance)
if (((DoorInstance) object).getCastle() != null)
{
player.sendPacket(new SpawnItem((ItemInstance) object));
player.sendPacket(new DoorInfo((DoorInstance) object, true));
}
else if (object instanceof DoorInstance)
else
{
if (((DoorInstance) object).getCastle() != null)
{
player.sendPacket(new DoorInfo((DoorInstance) object, true));
}
else
{
player.sendPacket(new DoorInfo((DoorInstance) object, false));
}
player.sendPacket(new DoorStatusUpdate((DoorInstance) object));
player.sendPacket(new DoorInfo((DoorInstance) object, false));
}
else if (object instanceof BoatInstance)
player.sendPacket(new DoorStatusUpdate((DoorInstance) object));
}
else if (object instanceof BoatInstance)
{
if (!player.isInBoat() && (object != player.getBoat()))
{
if (!player.isInBoat() && (object != player.getBoat()))
player.sendPacket(new VehicleInfo((BoatInstance) object));
((BoatInstance) object).sendVehicleDeparture(player);
}
}
else if (object instanceof StaticObjectInstance)
{
player.sendPacket(new StaticObject((StaticObjectInstance) object));
}
else if (object instanceof NpcInstance)
{
player.sendPacket(new NpcInfo((NpcInstance) object, player));
}
else if (object instanceof Summon)
{
final Summon summon = (Summon) object;
// Check if the PlayerInstance is the owner of the Pet
if (player.equals(summon.getOwner()))
{
player.sendPacket(new PetInfo(summon));
if (summon instanceof PetInstance)
{
player.sendPacket(new VehicleInfo((BoatInstance) object));
((BoatInstance) object).sendVehicleDeparture(player);
player.sendPacket(new PetItemList((PetInstance) summon));
}
}
else if (object instanceof StaticObjectInstance)
else
{
player.sendPacket(new StaticObject((StaticObjectInstance) object));
}
else if (object instanceof NpcInstance)
{
player.sendPacket(new NpcInfo((NpcInstance) object, player));
}
else if (object instanceof Summon)
{
final Summon summon = (Summon) object;
// Check if the PlayerInstance is the owner of the Pet
if (player.equals(summon.getOwner()))
{
player.sendPacket(new PetInfo(summon));
if (summon instanceof PetInstance)
{
player.sendPacket(new PetItemList((PetInstance) summon));
}
}
else
{
player.sendPacket(new NpcInfo(summon, player));
}
// The PetInfo packet wipes the PartySpelled (list of active spells' icons). Re-add them
summon.updateEffectIcons(true);
}
else if (object instanceof PlayerInstance)
{
final PlayerInstance otherPlayer = (PlayerInstance) object;
if (otherPlayer.isInBoat())
{
otherPlayer.getPosition().setWorldPosition(otherPlayer.getBoat().getLocation());
player.sendPacket(new CharInfo(otherPlayer));
final int relation = otherPlayer.getRelation(player);
if ((otherPlayer.getKnownList().getKnownRelations().get(player.getObjectId()) != null) && (otherPlayer.getKnownList().getKnownRelations().get(player.getObjectId()) != relation))
{
player.sendPacket(new RelationChanged(otherPlayer, relation, player.isAutoAttackable(otherPlayer)));
}
player.sendPacket(new GetOnVehicle(otherPlayer, otherPlayer.getBoat(), otherPlayer.getBoatPosition().getX(), otherPlayer.getBoatPosition().getY(), otherPlayer.getBoatPosition().getZ()));
}
else
{
player.sendPacket(new CharInfo(otherPlayer));
final int relation = otherPlayer.getRelation(player);
if ((otherPlayer.getKnownList().getKnownRelations().get(player.getObjectId()) != null) && (otherPlayer.getKnownList().getKnownRelations().get(player.getObjectId()) != relation))
{
player.sendPacket(new RelationChanged(otherPlayer, relation, player.isAutoAttackable(otherPlayer)));
}
}
player.sendPacket(new NpcInfo(summon, player));
}
if (object instanceof Creature)
// The PetInfo packet wipes the PartySpelled (list of active spells' icons). Re-add them
summon.updateEffectIcons(true);
}
else if (object instanceof PlayerInstance)
{
final PlayerInstance otherPlayer = (PlayerInstance) object;
if (otherPlayer.isInBoat())
{
// Update the state of the Creature object client side by sending Server->Client packet MoveToPawn/CharMoveToLocation and AutoAttackStart to the PlayerInstance
final Creature obj = (Creature) object;
if (obj.hasAI())
otherPlayer.getPosition().setWorldPosition(otherPlayer.getBoat().getLocation());
player.sendPacket(new CharInfo(otherPlayer));
final int relation = otherPlayer.getRelation(player);
if ((otherPlayer.getKnownList().getKnownRelations().get(player.getObjectId()) != null) && (otherPlayer.getKnownList().getKnownRelations().get(player.getObjectId()) != relation))
{
obj.getAI().describeStateToPlayer(player);
player.sendPacket(new RelationChanged(otherPlayer, relation, player.isAutoAttackable(otherPlayer)));
}
player.sendPacket(new GetOnVehicle(otherPlayer, otherPlayer.getBoat(), otherPlayer.getBoatPosition().getX(), otherPlayer.getBoatPosition().getY(), otherPlayer.getBoatPosition().getZ()));
}
else
{
player.sendPacket(new CharInfo(otherPlayer));
final int relation = otherPlayer.getRelation(player);
if ((otherPlayer.getKnownList().getKnownRelations().get(player.getObjectId()) != null) && (otherPlayer.getKnownList().getKnownRelations().get(player.getObjectId()) != relation))
{
player.sendPacket(new RelationChanged(otherPlayer, relation, player.isAutoAttackable(otherPlayer)));
}
}
}
if (object instanceof Creature)
{
// Update the state of the Creature object client side by sending Server->Client packet MoveToPawn/CharMoveToLocation and AutoAttackStart to the PlayerInstance
final Creature obj = (Creature) object;
if (obj.hasAI())
{
obj.getAI().describeStateToPlayer(player);
}
}
}

View File

@ -16,46 +16,26 @@
*/
package org.l2jmobius.gameserver.network.serverpackets;
import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.datatables.sql.NpcTable;
import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
public class CharInfo extends GameServerPacket
{
private static final Logger LOGGER = Logger.getLogger(CharInfo.class.getName());
private final PlayerInstance _player;
private final Inventory _inventory;
private final int _x;
private final int _y;
private final int _z;
private final int _heading;
private final int _mAtkSpd;
private final int _pAtkSpd;
private final int _runSpd;
private final int _walkSpd;
private final int _flyRunSpd;
private final int _flyWalkSpd;
private final float _moveMultiplier;
private final float _attackSpeedMultiplier;
public CharInfo(PlayerInstance player)
{
_player = player;
_inventory = player.getInventory();
_x = player.getX();
_y = player.getY();
_z = player.getZ();
_heading = player.getHeading();
_mAtkSpd = player.getMAtkSpd();
_pAtkSpd = player.getPAtkSpd();
_attackSpeedMultiplier = player.getAttackSpeedMultiplier();
_moveMultiplier = player.getMovementSpeedMultiplier();
_runSpd = Math.round(player.getRunSpeed() / _moveMultiplier);
_walkSpd = Math.round(player.getWalkSpeed() / _moveMultiplier);
@ -67,278 +47,194 @@ public class CharInfo extends GameServerPacket
protected final void writeImpl()
{
boolean isGM = false;
final PlayerInstance tmp = getClient().getPlayer();
if ((tmp != null) && tmp.isGM())
{
isGM = true;
}
if (!isGM && _player.getAppearance().isInvisible())
{
return;
}
if (_player.getPoly().isMorphed())
writeC(0x03);
writeD(_player.getX());
writeD(_player.getY());
writeD(_player.getZ());
writeD(_player.getBoat() != null ? _player.getBoat().getObjectId() : 0);
writeD(_player.getObjectId());
writeS(_player.getName());
writeD(_player.getRace().ordinal());
writeD(_player.getAppearance().isFemale() ? 1 : 0);
if (_player.getClassIndex() == 0)
{
final NpcTemplate template = NpcTable.getInstance().getTemplate(_player.getPoly().getPolyId());
if (template != null)
{
writeC(0x16);
writeD(_player.getObjectId());
writeD(_player.getPoly().getPolyId() + 1000000); // npctype id
writeD(_player.getKarma() > 0 ? 1 : 0);
writeD(_x);
writeD(_y);
writeD(_z);
writeD(_heading);
writeD(0x00);
writeD(_mAtkSpd);
writeD(_pAtkSpd);
writeD(_runSpd); // base run speed
writeD(_walkSpd); // base walk speed
writeD(_runSpd); // swim run speed (calculated by getter)
writeD(_walkSpd); // swim walk speed (calculated by getter)
writeD(_flyRunSpd); // fly run speed ?
writeD(_flyWalkSpd); // fly walk speed ?
writeD(_flyRunSpd);
writeD(_flyWalkSpd);
writeF(_moveMultiplier);
writeF(_attackSpeedMultiplier);
writeF(template.getCollisionRadius());
writeF(template.getCollisionHeight());
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_RHAND)); // right hand weapon
writeD(0);
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_LHAND)); // left hand weapon
writeC(1); // name above char 1=true ... ??
writeC(_player.isRunning() ? 1 : 0);
writeC(_player.isInCombat() ? 1 : 0);
writeC(_player.isAlikeDead() ? 1 : 0);
// if(gmSeeInvis)
// {
writeC(0); // if the charinfo is written means receiver can see the char
// }
// else
// {
// writeC(_player.getAppearance().getInvisible() ? 1 : 0); // invisible ?? 0=false 1=true 2=summoned (only works if model has a summon animation)
// }
writeS(_player.getName());
if (_player.getAppearance().isInvisible())
{
writeS("Invisible");
}
else
{
writeS(_player.getTitle());
}
writeD(0);
writeD(0);
writeD(0); // hmm karma ??
if (_player.getAppearance().isInvisible())
{
writeD((_player.getAbnormalEffect() | Creature.ABNORMAL_EFFECT_STEALTH));
}
else
{
writeD(_player.getAbnormalEffect()); // C2
}
writeD(0); // C2
writeD(0); // C2
writeD(0); // C2
writeD(0); // C2
writeC(0); // C2
}
else
{
LOGGER.warning("Character " + _player.getName() + " (" + _player.getObjectId() + ") morphed in a Npc (" + _player.getPoly().getPolyId() + ") w/o template.");
}
writeD(_player.getClassId().getId());
}
else
{
writeD(_player.getBaseClass());
}
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_DHAIR));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_HEAD));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_RHAND));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_LHAND));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_GLOVES));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_CHEST));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_LEGS));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_FEET));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_BACK));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_LRHAND));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_HAIR));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_FACE));
// c6 new h's
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeD(_inventory.getPaperdollAugmentationId(Inventory.PAPERDOLL_RHAND));
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeD(_inventory.getPaperdollAugmentationId(Inventory.PAPERDOLL_LRHAND));
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeD(_player.getPvpFlag());
writeD(_player.getKarma());
writeD(_player.getMAtkSpd());
writeD(_player.getPAtkSpd());
writeD(_player.getPvpFlag());
writeD(_player.getKarma());
writeD(_runSpd); // base run speed
writeD(_walkSpd); // base walk speed
writeD(_runSpd); // swim run speed (calculated by getter)
writeD(_walkSpd); // swim walk speed (calculated by getter)
writeD(_flyRunSpd); // fly run speed ?
writeD(_flyWalkSpd); // fly walk speed ?
writeD(_flyRunSpd);
writeD(_flyWalkSpd);
writeF(_moveMultiplier);
writeF(_player.getAttackSpeedMultiplier());
writeF(_player.getBaseTemplate().getCollisionRadius());
writeF(_player.getBaseTemplate().getCollisionHeight());
writeD(_player.getAppearance().getHairStyle());
writeD(_player.getAppearance().getHairColor());
writeD(_player.getAppearance().getFace());
if (_player.getAppearance().isInvisible())
{
writeS("[Invisible]");
}
else
{
writeS(_player.getTitle());
}
writeD(_player.getClanId());
writeD(_player.getClanCrestId());
writeD(_player.getAllyId());
writeD(_player.getAllyCrestId());
// In UserInfo leader rights and siege flags, but here found nothing??
// Therefore RelationChanged packet with that info is required
writeD(0x00);
writeC(_player.isSitting() ? 0 : 1); // standing = 1 sitting = 0
writeC(_player.isRunning() ? 1 : 0); // running = 1 walking = 0
writeC(_player.isInCombat() ? 1 : 0);
writeC(_player.isAlikeDead() ? 1 : 0);
// if(gmSeeInvis)
// {
writeC(0x00); // if the charinfo is written means receiver can see the char
// }
// else
// {
// writeC(_activeChar.getAppearance().getInvisible() ? 1 : 0); // invisible = 1 visible =0
// }
writeC(_player.getMountType()); // 1 on strider 2 on wyvern 0 no mount
writeC(_player.getPrivateStoreType()); // 1 - sellshop
writeH(_player.getCubics().size());
for (int cubicId : _player.getCubics().keySet())
{
writeH(cubicId);
}
writeC(_player.isInPartyMatchRoom() ? 1 : 0);
if (_player.getAppearance().isInvisible())
{
writeD((_player.getAbnormalEffect() | Creature.ABNORMAL_EFFECT_STEALTH));
}
else
{
writeD(_player.getAbnormalEffect());
}
writeC(_player.getRecomLeft());
writeH(_player.getRecomHave()); // Blue value for name (0 = white, 255 = pure blue)
writeD(_player.getClassId().getId());
writeD(_player.getMaxCp());
writeD((int) _player.getCurrentCp());
writeC(_player.isMounted() ? 0 : _player.getEnchantEffect());
if (_player.getTeam() == 1)
{
writeC(0x01); // team circle around feet 1= Blue, 2 = red
}
else if (_player.getTeam() == 2)
{
writeC(0x02); // team circle around feet 1= Blue, 2 = red
}
else
{
writeC(0x00); // team circle around feet 1= Blue, 2 = red
}
writeD(_player.getClanCrestLargeId());
writeC(_player.isNoble() ? 1 : 0); // Symbol on char menu ctrl+I
writeC((_player.isHero() || (_player.isGM() && Config.GM_HERO_AURA) || _player.isPVPHero()) ? 1 : 0); // Hero Aura
writeC(_player.isFishing() ? 1 : 0); // 0x01: Fishing Mode (Cant be undone by setting back to 0)
writeD(_player.getFishX());
writeD(_player.getFishY());
writeD(_player.getFishZ());
writeD(_player.getAppearance().getNameColor());
writeD(_player.getHeading());
writeD(_player.getPledgeClass());
writeD(_player.getPledgeType());
writeD(_player.getAppearance().getTitleColor());
if (_player.isCursedWeaponEquiped())
{
writeD(CursedWeaponsManager.getInstance().getLevel(_player.getCursedWeaponEquipedId()));
}
else
{
writeC(0x03);
writeD(_x);
writeD(_y);
writeD(_z);
writeD(_player.getBoat() != null ? _player.getBoat().getObjectId() : 0);
writeD(_player.getObjectId());
writeS(_player.getName());
writeD(_player.getRace().ordinal());
writeD(_player.getAppearance().isFemale() ? 1 : 0);
if (_player.getClassIndex() == 0)
{
writeD(_player.getClassId().getId());
}
else
{
writeD(_player.getBaseClass());
}
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_DHAIR));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_HEAD));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_RHAND));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_LHAND));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_GLOVES));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_CHEST));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_LEGS));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_FEET));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_BACK));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_LRHAND));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_HAIR));
writeD(_inventory.getPaperdollItemId(Inventory.PAPERDOLL_FACE));
// c6 new h's
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeD(_inventory.getPaperdollAugmentationId(Inventory.PAPERDOLL_RHAND));
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeD(_inventory.getPaperdollAugmentationId(Inventory.PAPERDOLL_LRHAND));
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeH(0x00);
writeD(_player.getPvpFlag());
writeD(_player.getKarma());
writeD(_mAtkSpd);
writeD(_pAtkSpd);
writeD(_player.getPvpFlag());
writeD(_player.getKarma());
writeD(_runSpd); // base run speed
writeD(_walkSpd); // base walk speed
writeD(_runSpd); // swim run speed (calculated by getter)
writeD(_walkSpd); // swim walk speed (calculated by getter)
writeD(_flyRunSpd); // fly run speed ?
writeD(_flyWalkSpd); // fly walk speed ?
writeD(_flyRunSpd);
writeD(_flyWalkSpd);
writeF(_moveMultiplier);
writeF(_attackSpeedMultiplier);
writeF(_player.getBaseTemplate().getCollisionRadius());
writeF(_player.getBaseTemplate().getCollisionHeight());
writeD(_player.getAppearance().getHairStyle());
writeD(_player.getAppearance().getHairColor());
writeD(_player.getAppearance().getFace());
if (_player.getAppearance().isInvisible())
{
writeS("[Invisible]");
}
else
{
writeS(_player.getTitle());
}
writeD(_player.getClanId());
writeD(_player.getClanCrestId());
writeD(_player.getAllyId());
writeD(_player.getAllyCrestId());
// In UserInfo leader rights and siege flags, but here found nothing??
// Therefore RelationChanged packet with that info is required
writeD(0x00);
writeC(_player.isSitting() ? 0 : 1); // standing = 1 sitting = 0
writeC(_player.isRunning() ? 1 : 0); // running = 1 walking = 0
writeC(_player.isInCombat() ? 1 : 0);
writeC(_player.isAlikeDead() ? 1 : 0);
// if(gmSeeInvis)
// {
writeC(0x00); // if the charinfo is written means receiver can see the char
// }
// else
// {
// writeC(_activeChar.getAppearance().getInvisible() ? 1 : 0); // invisible = 1 visible =0
// }
writeC(_player.getMountType()); // 1 on strider 2 on wyvern 0 no mount
writeC(_player.getPrivateStoreType()); // 1 - sellshop
writeH(_player.getCubics().size());
for (int cubicId : _player.getCubics().keySet())
{
writeH(cubicId);
}
writeC(_player.isInPartyMatchRoom() ? 1 : 0);
if (_player.getAppearance().isInvisible())
{
writeD((_player.getAbnormalEffect() | Creature.ABNORMAL_EFFECT_STEALTH));
}
else
{
writeD(_player.getAbnormalEffect());
}
writeC(_player.getRecomLeft());
writeH(_player.getRecomHave()); // Blue value for name (0 = white, 255 = pure blue)
writeD(_player.getClassId().getId());
writeD(_player.getMaxCp());
writeD((int) _player.getCurrentCp());
writeC(_player.isMounted() ? 0 : _player.getEnchantEffect());
if (_player.getTeam() == 1)
{
writeC(0x01); // team circle around feet 1= Blue, 2 = red
}
else if (_player.getTeam() == 2)
{
writeC(0x02); // team circle around feet 1= Blue, 2 = red
}
else
{
writeC(0x00); // team circle around feet 1= Blue, 2 = red
}
writeD(_player.getClanCrestLargeId());
writeC(_player.isNoble() ? 1 : 0); // Symbol on char menu ctrl+I
writeC((_player.isHero() || (_player.isGM() && Config.GM_HERO_AURA) || _player.isPVPHero()) ? 1 : 0); // Hero Aura
writeC(_player.isFishing() ? 1 : 0); // 0x01: Fishing Mode (Cant be undone by setting back to 0)
writeD(_player.getFishX());
writeD(_player.getFishY());
writeD(_player.getFishZ());
writeD(_player.getAppearance().getNameColor());
writeD(_heading);
writeD(_player.getPledgeClass());
writeD(_player.getPledgeType());
writeD(_player.getAppearance().getTitleColor());
if (_player.isCursedWeaponEquiped())
{
writeD(CursedWeaponsManager.getInstance().getLevel(_player.getCursedWeaponEquipedId()));
}
else
{
writeD(0x00);
}
}
}
}

View File

@ -61,9 +61,6 @@ public class NpcInfo extends GameServerPacket
*/
public NpcInfo(NpcInstance cha, Creature attacker)
{
/*
* if(cha.getMxcPoly() != null) { attacker.sendPacket(new MxCPolyInfo(cha)); return; }
*/
if (cha.getCustomNpcInstance() != null)
{
attacker.sendPacket(new CustomNpcInfo(cha));

View File

@ -1,175 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.l2jmobius.gameserver.network.serverpackets;
import org.l2jmobius.gameserver.datatables.sql.NpcTable;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
* @version $Revision: 1.7.2.4.2.9 $ $Date: 2005/04/11 10:05:54 $
*/
public class NpcInfoPoly extends GameServerPacket
{
private Creature _creature;
private final WorldObject _obj;
private int _x;
private int _y;
private int _z;
private int _heading;
private final int _npcId;
private boolean _isAttackable;
private final boolean _isSummoned;
private boolean _isRunning;
private boolean _isInCombat;
private boolean _isAlikeDead;
private int _mAtkSpd;
private int _pAtkSpd;
private int _runSpd;
private int _walkSpd;
private int _swimRunSpd;
private int _swimWalkSpd;
private int _flRunSpd;
private int _flWalkSpd;
private int _flyRunSpd;
private int _flyWalkSpd;
private int _rhand;
private int _lhand;
private String _name;
private String _title;
private int _abnormalEffect;
NpcTemplate _template;
private final int _collisionRadius;
private final int _collisionHeight;
/**
* Instantiates a new npc info poly.
* @param obj the obj
* @param attacker the attacker
*/
public NpcInfoPoly(WorldObject obj, Creature attacker)
{
_obj = obj;
_npcId = obj.getPoly().getPolyId();
_template = NpcTable.getInstance().getTemplate(_npcId);
_isAttackable = true;
_rhand = 0;
_lhand = 0;
_isSummoned = false;
_collisionRadius = _template.getCollisionRadius();
_collisionHeight = _template.getCollisionHeight();
if (_obj instanceof Creature)
{
_creature = (Creature) obj;
_isAttackable = obj.isAutoAttackable(attacker);
_rhand = _template.getRhand();
_lhand = _template.getLhand();
}
if (_obj instanceof ItemInstance)
{
_x = _obj.getX();
_y = _obj.getY();
_z = _obj.getZ();
_heading = 0;
_mAtkSpd = 100; // yes, an item can be dread as death
_pAtkSpd = 100;
_runSpd = 120;
_walkSpd = 80;
_swimRunSpd = _flRunSpd = _flyRunSpd = _runSpd;
_swimWalkSpd = _flWalkSpd = _flyWalkSpd = _walkSpd;
_isRunning = _isInCombat = _isAlikeDead = false;
_name = "item";
_title = "polymorphed";
_abnormalEffect = 0;
}
else
{
_x = _creature.getX();
_y = _creature.getY();
_z = _creature.getZ();
_heading = _creature.getHeading();
_mAtkSpd = _creature.getMAtkSpd();
_pAtkSpd = _creature.getPAtkSpd();
_runSpd = _creature.getRunSpeed();
_walkSpd = _creature.getWalkSpeed();
_swimRunSpd = _flRunSpd = _flyRunSpd = _runSpd;
_swimWalkSpd = _flWalkSpd = _flyWalkSpd = _walkSpd;
_isRunning = _creature.isRunning();
_isInCombat = _creature.isInCombat();
_isAlikeDead = _creature.isAlikeDead();
_name = _creature.getName();
_title = _creature.getTitle();
_abnormalEffect = _creature.getAbnormalEffect();
}
}
/*
* (non-Javadoc)
* @see org.l2jmobius.gameserver.network.serverpackets.L2GameServerPacket#writeImpl()
*/
@Override
protected final void writeImpl()
{
writeC(0x16);
writeD(_obj.getObjectId());
writeD(_npcId + 1000000); // npctype id
writeD(_isAttackable ? 1 : 0);
writeD(_x);
writeD(_y);
writeD(_z);
writeD(_heading);
writeD(0x00);
writeD(_mAtkSpd);
writeD(_pAtkSpd);
writeD(_runSpd);
writeD(_walkSpd);
writeD(_swimRunSpd/* 0x32 */); // swimspeed
writeD(_swimWalkSpd/* 0x32 */); // swimspeed
writeD(_flRunSpd);
writeD(_flWalkSpd);
writeD(_flyRunSpd);
writeD(_flyWalkSpd);
writeF(1/* _activeChar.getProperMultiplier() */);
writeF(1/* _activeChar.getAttackSpeedMultiplier() */);
writeF(_collisionRadius);
writeF(_collisionHeight);
writeD(_rhand); // right hand weapon
writeD(0);
writeD(_lhand); // left hand weapon
writeC(1); // name above char 1=true ... ??
writeC(_isRunning ? 1 : 0);
writeC(_isInCombat ? 1 : 0);
writeC(_isAlikeDead ? 1 : 0);
writeC(_isSummoned ? 2 : 0); // invisible ?? 0=false 1=true 2=summoned (only works if model has a summon animation)
writeS(_name);
writeS(_title);
writeD(0);
writeD(0);
writeD(0000); // hmm karma ??
writeH(_abnormalEffect); // C2
writeH(0x00); // C2
writeD(0000); // C2
writeD(0000); // C2
writeD(0000); // C2
writeD(0000); // C2
writeC(0000); // C2
}
}

View File

@ -1,76 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.l2jmobius.gameserver.network.serverpackets;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
/**
* 15 ee cc 11 43 object id 39 00 00 00 item id 8f 14 00 00 x b7 f1 00 00 y 60 f2 ff ff z 01 00 00 00 show item count 7a 00 00 00 count . format dddddddd
* @version $Revision: 1.3.2.1.2.3 $ $Date: 2005/03/27 15:29:39 $
*/
public class SpawnItemPoly extends GameServerPacket
{
private int _objectId;
private int _itemId;
private int _x;
private int _y;
private int _z;
private int _stackable;
private int _count;
public SpawnItemPoly(WorldObject object)
{
if (object instanceof ItemInstance)
{
final ItemInstance item = (ItemInstance) object;
_objectId = object.getObjectId();
_itemId = object.getPoly().getPolyId();
_x = item.getX();
_y = item.getY();
_z = item.getZ();
_stackable = item.isStackable() ? 0x01 : 0x00;
_count = item.getCount();
}
else
{
_objectId = object.getObjectId();
_itemId = object.getPoly().getPolyId();
_x = object.getX();
_y = object.getY();
_z = object.getZ();
_stackable = 0x00;
_count = 1;
}
}
@Override
protected final void writeImpl()
{
writeC(0x0b);
writeD(_objectId);
writeD(_itemId);
writeD(_x);
writeD(_y);
writeD(_z);
// only show item count if it is a stackable item
writeD(_stackable);
writeD(_count);
writeD(0x00); // c2
}
}

View File

@ -17,12 +17,10 @@
package org.l2jmobius.gameserver.network.serverpackets;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.datatables.sql.NpcTable;
import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Summon;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
public class UserInfo extends GameServerPacket
@ -217,14 +215,6 @@ public class UserInfo extends GameServerPacket
{
title = "[Invisible]";
}
if (_player.getPoly().isMorphed())
{
final NpcTemplate polyObj = NpcTable.getInstance().getTemplate(_player.getPoly().getPolyId());
if (polyObj != null)
{
title += " - " + polyObj.getName();
}
}
writeS(title);
writeD(_player.getClanId());