public void ForceLoot(Character c) { int offset = 4; Converter.ToBytes(c.Guid, tempBuff, ref offset); Converter.ToBytes(Guid, tempBuff, ref offset); c.Send(OpCodes.CMSG_LOOT, tempBuff, offset); }
public void Quit(Character c) { if (members == null) { return; } ArrayList al = new ArrayList(); foreach (Member m in members) { if (m.Char == c) { c.Send(OpCodes.SMSG_GROUP_DESTROYED, c.tempBuff, 4); } else { // Console.WriteLine("Stay in group {0}", m.Char.Name ); al.Add(m); } } members = al; if (Count > 1) { if (groupLeader.Char == c) { groupLeader = (Member)al[0]; } UpdateList(); } else if (Count == 1) { (members[0] as Member).Char.Send(OpCodes.SMSG_GROUP_DESTROYED, c.tempBuff, 4); (members[0] as Member).Char.QuitGroup(); } }
void SendMessageTo( Character c, ChatMsgType chat, string txt, int langue ) { int offset = 4; bool understand = false; switch( langue ) { case 7:// Common if ( c.HaveSkill( 98 ) ) understand = true; break; case 1:// Orcish if ( c.HaveSkill( 109 ) ) understand = true; break; case 13:// Gnomish if ( c.HaveSkill( 313 ) ) understand = true; break; case 33:// Gutter if ( c.HaveSkill( 673 ) ) understand = true; break; case 3:// Tauren if ( c.HaveSkill( 115 ) ) understand = true; break; case 14:// Troll if ( c.HaveSkill( 315 ) ) understand = true; break; case 2:// Elf if ( c.HaveSkill( 113 ) ) understand = true; break; case 6:// Dwarf if ( c.HaveSkill( 111 ) ) understand = true; break; } if ( understand ) { tempBuff[ offset++ ] = (byte)chat;//type, CHAT_MSG_SAY, CHAT_MSG_CHANNEL, CHAT_MSG_WHISPER, CHAT_MSG_YELL, CHAT_MSG_PARTY Converter.ToBytes( langue, tempBuff, ref offset ); } else { tempBuff[ offset++ ] = (byte)chat;//type Converter.ToBytes( langue, tempBuff, ref offset ); } Converter.ToBytes( Guid, tempBuff, ref offset ); Converter.ToBytes( Guid, tempBuff, ref offset ); // string tx = txt + " ( " + r.ToString() + " )"; // r = (ushort)( r << 1 ); Converter.ToBytes( txt.Length + 1, tempBuff, ref offset ); Converter.ToBytes( txt, tempBuff, ref offset ); Converter.ToBytes( (short)1, tempBuff, ref offset );// Togle afk int len = offset; c.Send( OpCodes.SMSG_MESSAGECHAT, tempBuff, len ); }
public void ForceLoot( Character c ) { int offset = 4; Converter.ToBytes( c.Guid, tempBuff, ref offset ); Converter.ToBytes( Guid, tempBuff, ref offset ); c.Send( OpCodes.CMSG_LOOT, tempBuff, offset ); }
public void Quit( Character c ) { if ( members == null ) return; ArrayList al = new ArrayList(); foreach( Member m in members ) { if ( m.Char == c ) { c.Send( OpCodes.SMSG_GROUP_DESTROYED, c.tempBuff, 4 ); } else { // Console.WriteLine("Stay in group {0}", m.Char.Name ); al.Add( m ); } } members = al; if ( Count > 1 ) { if ( groupLeader.Char == c ) groupLeader = (Member)al[ 0 ]; UpdateList(); } else if ( Count == 1 ) { ( members[ 0 ] as Member ).Char.Send( OpCodes.SMSG_GROUP_DESTROYED, c.tempBuff, 4 ); ( members[ 0 ] as Member ).Char.QuitGroup(); } }
public static void TaxiMountAndMove(Character ch, TaxiPath path) { PathForTaxi taxiPFT = new PathForTaxi(path.Id,ch); int MountId = 0; foreach(Object o in ch.KnownObjects) { if(o is TaxiVendor) if((o as TaxiVendor).MountId != 0) MountId = (o as TaxiVendor).MountId; } if (MountId == 0) MountId = 1147; ch.MountModel = (int)MountId; ch.taxiOn = true; ch.GodMode = true; ch.UnInteractible = true; if(ch.Summon != null) ch.Summon.Freeze = true; ch.Speed = 20f; ch.RunSpeed = 40f; int offset = 4; Converter.ToBytes( 1, ch.tempBuff, ref offset ); Converter.ToBytes( (byte)0, ch.tempBuff, ref offset ); ch.PrepareUpdateData( ch.tempBuff, ref offset , UpdateType.UpdateFull, false ); ch.Send( OpCodes.SMSG_UPDATE_OBJECT, ch.tempBuff, offset ); ch.ItemsUpdate(); ch.MoveTaxiTo(taxiPFT.T,taxiPFT.mapIds, taxiPFT.mapChange); }
public static void OnUnmountTaxi(Character ch,Trajet t) { ch.MountModel = (int)0; ch.taxiOn = false; ch.Copper =(uint)(ch.Copper - ch.TaxiPrice); if(ch.Summon != null) ch.Summon.Freeze = false; int offset = 4; ch.Speed = 8f; ch.RunSpeed = 7f; Converter.ToBytes( 1, ch.tempBuff, ref offset ); Converter.ToBytes( (byte)0, ch.tempBuff, ref offset ); ch.PrepareUpdateData( ch.tempBuff, ref offset , UpdateType.UpdateFull, false ); ch.Send( OpCodes.SMSG_UPDATE_OBJECT, ch.tempBuff, offset ); ch.ItemsUpdate(); ch.ForcePosition(t[t.Count - 1].x,t[t.Count - 1].y,t[t.Count - 1].z,ch.Orientation); }
public static void OnCMSG_TAXIQUERYAVAILABLENODES(Character ch) { ushort block; uint part; uint []TaxiField = new uint[8]; uint CurrentNode = Taxi.ChoseTaxiNode(ch); block = (ushort)((CurrentNode - 1) / 32); part = (uint)1 << (ushort)((CurrentNode - 1) % 32); if((ch.TaxiField[block] & part) != part) { ch.TaxiField[block] |=(uint)part; ch.SendMessage("You find new taxi position"); byte []b = new byte[16]; int w = 4; Converter.ToBytes( ch.Guid, b, ref w ); Converter.ToBytes( (ushort)1, b, ref w ); ch.Send( OpCodes.SMSG_TAXINODE_STATUS, b, w ); } uint []AvailableTaxiField = AvailableTaxiPaths(CurrentNode); TaxiField[block] |= part; AvailableTaxiField[block] = AvailableTaxiField[block] | TaxiField[block]; byte []c = new byte[388]; int t = 4; Converter.ToBytes( (uint)1, c, ref t ); Converter.ToBytes( ch.Guid, c, ref t ); Converter.ToBytes( (uint)CurrentNode, c, ref t ); for(int i = 0; i < 8;i++) { /* if (ch.Player.AccessLevel == AccessLevels.GM || ch.Player.AccessLevel == AccessLevels.Admin) { if(i == 0 || i == 1) TaxiField[ i ] = 0xffffffff; } else */ TaxiField[i] = TaxiField[i] | ch.TaxiField[i]; TaxiField[i] = TaxiField[i] & AvailableTaxiField[i]; Converter.ToBytes( (uint)TaxiField[i], c, ref t ); } ch.Send( OpCodes.SMSG_SHOWTAXINODES, c, t ); }
public static void OnCMSG_TAXINODE_STATUS_QUERY(Character ch) { ushort block; uint part; uint CurrentNode = Taxi.ChoseTaxiNode(ch); block = (ushort)((CurrentNode - 1) / 32); part = (uint)1 << (ushort)((CurrentNode - 1) % 32); if( ( ch.TaxiField[block] & part ) != part ) { byte []b = new byte[16]; int t = 4; Converter.ToBytes( ch.Guid, b, ref t ); Converter.ToBytes( (ushort)0, b, ref t ); ch.Send( OpCodes.SMSG_TAXINODE_STATUS, b, t ); } else { byte []b = new byte[16]; int t = 4; Converter.ToBytes( ch.Guid, b, ref t ); Converter.ToBytes( (ushort)1, b, ref t ); ch.Send( OpCodes.SMSG_TAXINODE_STATUS, b, t ); } }
public static void OnCMSG_ACTIVATETAXI(Character ch, uint from, uint to) { uint MountId; TaxiPath tpath = Taxi.FindTaxiPath(from, to); byte []b; int t; if(tpath != null) { ch.to = ChoseTaxiNode((int)to); if(tpath.Price < ch.Copper || (ch.Player.AccessLevel == AccessLevels.GM || ch.Player.AccessLevel == AccessLevels.Admin)) { ch.TaxiPrice = tpath.Price; MountId = 1147; if(MountId == 0) { b = new byte[16]; t = 4; Converter.ToBytes( (uint)1, b, ref t ); ch.Send( OpCodes.SMSG_ACTIVATETAXIREPLY, b, t ); return; } b = new byte[16]; t = 4; Converter.ToBytes( (uint)0, b, ref t ); ch.Send( OpCodes.SMSG_ACTIVATETAXIREPLY, b, t ); Taxi.TaxiMountAndMove(ch,tpath); } else { b = new byte[16]; t = 4; Converter.ToBytes( (uint)3, b, ref t ); ch.Send( OpCodes.SMSG_ACTIVATETAXIREPLY, b, t ); return; } } else { b = new byte[16]; t = 4; Converter.ToBytes( (uint)3, b, ref t ); ch.Send( OpCodes.SMSG_ACTIVATETAXIREPLY, b, t ); return; } }
public virtual void SendSmallUpdateToPlayer( Character ch, int []pos, object []val ) { int offset = 4; tempBuff[ offset++ ] = (byte)1; Converter.ToBytes( 0, tempBuff, ref offset ); tempBuff[ offset++ ] = (byte)UpdateType.UpdatePartial; Converter.ToBytes( Guid, tempBuff, ref offset ); int max = 2 + ( ( pos[ pos.Length - 1 ] + 1 ) / 32 ); if ( max > 0x21 ) max = 0x21; tempBuff[ offset++ ] = (byte)max;//0x1C; Buffer.BlockCopy( Object.Blank, 0, tempBuff, offset, Object.Blank.Length ); foreach( int p in pos ) { int rpos = p; int l = rpos >> 3; int m = rpos & 0x7; m = 0x1 << m;//( 7 - m ); tempBuff[ offset + l ] += (byte)m; } offset += max * 4;// 112; foreach( object o in val ) { Converter.ToBytes( o, tempBuff, ref offset ); } ch.Send( OpCodes.SMSG_UPDATE_OBJECT, tempBuff, offset ); }
public void Summon(Mobile c) { if (c.Summon != null) { c.Summon.Delete(); if (World.allMobiles.Contains(c.Summon)) { World.Remove(c.Summon, c); } } ConstructorInfo ci = World.MobilePool(mountId); BaseCreature bc = (BaseCreature)ci.Invoke(null); bc.Faction = c.Faction; bc.AIEngine = new SummonedAI(c, bc); bc.SummonedBy = c; c.Summon = bc; bc.Level = c.Level; bc.Stamina = bc.Str = bc.Iq = bc.Spirit = bc.HitPoints = bc.BaseHitPoints = bc.Agility = bc.BaseMana = 0; bc.InitStats(); // bc.AIEngine = new SummonedAI( c, bc ); if (c.Classe == Classes.Warlock) { #region Fel Intellect if (bc.Id == 416 || bc.Id == 1863 || bc.Id == 1860 || bc.Id == 417) { if (c.HaveTalent(Talents.FelIntellect)) { AuraEffect ae = (AuraEffect)c.GetTalentEffect(Talents.FelIntellect); float bm = (float)bc.BaseMana; bm += bm * ((float)ae.S1) / 100f; bc.BaseMana = bc.Mana = (int)bm; } } #endregion #region Fel Stamina if (bc.Id == 416 || bc.Id == 1863 || bc.Id == 1860 || bc.Id == 417) { if (c.HaveTalent(Talents.FelStamina)) { AuraEffect ae = (AuraEffect)c.GetTalentEffect(Talents.FelStamina); float bm = (float)bc.BaseHitPoints; bm += bm * ((float)ae.S1) / 100f; bc.BaseHitPoints = bc.HitPoints = (int)bm; } } #endregion } World.Add(bc, c.X, c.Y, c.Z, c.MapId); if (c is Character) { // c.SendSmallUpdate( new int[] { (int)UpdateFields.UNIT_FIELD_CHARM, (int)UpdateFields.UNIT_FIELD_SUMMON }, new object[] { bc.Guid, bc.Guid } ); Character ch = c as Character; int offset = 4; Converter.ToBytes(1, c.tempBuff, ref offset); Converter.ToBytes((byte)0, c.tempBuff, ref offset); c.PrepareUpdateData(c.tempBuff, ref offset, UpdateType.UpdateFull, false); // bc.PrepareUpdateData( c.tempBuff, ref offset , UpdateType.UpdateFull, false ); ch.Send(OpCodes.SMSG_UPDATE_OBJECT, c.tempBuff, offset); ch.ItemsUpdate(); if (bc.Id == 89 || bc.Id == 416 || bc.Id == 1863 || bc.Id == 1860 || bc.Id == 304 || bc.Id == 417) { ch.SendPetActionBar(); } } }
/// <summary> /// private effect show bind /// created 30.10.05 /// </summary> private void BindPointEffect( Character c ) { // SpellHelp.GraphicEffectTarget( this, 3286,c ); int num1 = 4; Converter.ToBytes((float)c.X, c.tempBuff, ref num1); Converter.ToBytes((float)c.Y, c.tempBuff, ref num1); Converter.ToBytes((float)c.Z, c.tempBuff, ref num1); Converter.ToBytes((int)c.MapId, c.tempBuff, ref num1); Converter.ToBytes((int)c.ZoneId, c.tempBuff, ref num1); c.Send(OpCodes.SMSG_BINDPOINTUPDATE, c.tempBuff, num1); }