public void spawnMobView(WorldClient client, npc thismob, ClientView mobView) { Object599 viewData = thismob.getCreationData(); PacketContent pak = new PacketContent(); pak.addUint16(1, 1); pak.addByteArray(Store.world.objMan.GenerateCreationPacket(viewData, 0x0000, client.playerData.assignSpawnIdCounter()).getBytes()); pak.addUint16(mobView.ViewID, 1); pak.addByte(0x00); client.messageQueue.addObjectMessage(pak.returnFinalPacket(), false); client.flushQueue(); }
public Object599 getCreationData() { var themob = new Object599(); themob.DisableAllAttributes(); themob.CharacterName.enable(); themob.Health.enable(); themob.MaxHealth.enable(); themob.Level.enable(); themob.NPCRank.enable(); themob.RSIDescription.enable(); themob.MoreInfoID.enable(); themob.StopFollowActiveTracker.enable(); themob.ScriptCounter.enable(); themob.Description.enable(); themob.CombatantMode.enable(); themob.Position.enable(); themob.YawInterval.enable(); themob.IsDead.enable(); themob.IsEnemy.enable(); themob.IsFriendly.enable(); themob.StealthAwareness.enable(); themob.TitleAbility.enable(); themob.ConditionStateFlags.enable(); themob.CurrentState.enable(); themob.CharacterName.setValue(getName()); themob.Health.setValue(getHealthC()); themob.MaxHealth.setValue(getHealthM()); themob.Level.setValue(getLevel()); themob.NPCRank.setValue(1); themob.RSIDescription.setValue(StringUtils.hexStringToBytes(getRsiHex())); themob.MoreInfoID.setValue(StringUtils.hexStringToBytes(getRsiHex())); // ToDo: Make dynamic themob.StopFollowActiveTracker.setValue(0x01); themob.ScriptCounter.setValue(1); themob.Description.setValue(StringUtils.hexStringToBytes(getRsiHex())); // ToDo: Make dynamic themob.CombatantMode.setValue(0x22); themob.Position.setValue(NumericalUtils.doublesToLtVector3d(getXPos(), getYPos(), getZPos())); themob.YawInterval.setValue((byte)getRotation()); themob.IsDead.setValue(false); themob.IsEnemy.setValue(true); themob.IsFriendly.setValue(false); themob.StealthAwareness.setValue(0x11); byte[] titleAbility = { 0x00, 0x10, 0x00, 0x00 }; themob.TitleAbility.setValue(titleAbility); themob.ConditionStateFlags.setValue(StringUtils.hexStringToBytes("00001000")); themob.CurrentState.setValue(StringUtils.hexStringToBytes("06080000")); return(themob); }
public void SpawnMobView(WorldClient client, Mob thismob, ClientView mobView) { Output.WriteDebugLog("Spawn MobView Data ( Entity ID : " + thismob.getEntityId() + " Name:" + thismob.getName() + " ID: " + thismob.getMobId() + " RSI HEX: " + thismob.getRsiHex()); Object599 viewData = thismob.getCreationData(); PacketContent pak = new PacketContent(); pak.addUint16(1, 1); pak.addByteArray(Store.world.objMan.GenerateCreationPacket(viewData, 0x0000, client.playerData.assignSpawnIdCounter()).getBytes()); pak.addUint16(mobView.ViewID, 1); pak.addByte(0x00); client.messageQueue.addObjectMessage(pak.returnFinalPacket(), false); client.FlushQueue(); }
public Object599 getCreationData() { Object599 themob = new Object599(); themob.disableAllAttributes(); themob.CharacterName.enable(); themob.Health.enable(); themob.MaxHealth.enable(); themob.Level.enable(); themob.NPCRank.enable(); themob.RSIDescription.enable(); themob.MoreInfoID.enable(); themob.StopFollowActiveTracker.enable(); themob.ScriptCounter.enable(); themob.Description.enable(); themob.CombatantMode.enable(); themob.Position.enable(); themob.YawInterval.enable(); themob.IsDead.enable(); themob.IsEnemy.enable(); themob.IsFriendly.enable(); themob.StealthAwareness.enable(); themob.TitleAbility.enable(); themob.ConditionStateFlags.enable(); themob.CurrentState.enable(); themob.CharacterName.setValue((string)this.getName()); themob.Health.setValue(this.getHealthC()); themob.MaxHealth.setValue(this.getHealthM()); themob.Level.setValue(this.getLevel()); themob.NPCRank.setValue(1); themob.RSIDescription.setValue(StringUtils.hexStringToBytes(this.getRsiHex())); themob.MoreInfoID.setValue(StringUtils.hexStringToBytes(this.getRsiHex())); // ToDo: Make dynamic themob.StopFollowActiveTracker.setValue((byte)0x01); themob.ScriptCounter.setValue(1); themob.Description.setValue(StringUtils.hexStringToBytes(this.getRsiHex())); // ToDo: Make dynamic themob.CombatantMode.setValue((byte)0x22); themob.Position.setValue(NumericalUtils.doublesToLtVector3d(this.getXPos(), this.getYPos(), this.getZPos())); themob.YawInterval.setValue((byte)this.getRotation()); themob.IsDead.setValue(false); themob.IsEnemy.setValue(true); themob.IsFriendly.setValue(false); themob.StealthAwareness.setValue((byte)0x11); byte[] titleAbility = { 0x00, 0x10, 0x00, 0x00 }; themob.TitleAbility.setValue(titleAbility); themob.ConditionStateFlags.setValue(StringUtils.hexStringToBytes("00001000")); themob.CurrentState.setValue(StringUtils.hexStringToBytes("06080000")); return themob; }