PacketHandler.cs
Code:
public static void Send_Effect(Client.GameState Client, uint data_8, ushort Type, ushort direction, uint LoopTime, string EffectName) { // Send_Effect(Client, 220, 164, 1, 5, "Pick"); //38 + 1 + 8 + EffectName.Length = 47 + EffectName.Length //Where 38 is the normal 10010 packet length, 1 for the extra byte at offset 38, 8 for the Server Stamp byte[] Packet = new byte[47 + EffectName.Length]; Writer.WriteUInt16((ushort)(Packet.Length - 8), 0, Packet); Writer.WriteUInt16(10010, 2, Packet); Writer.WriteUInt32(Client.Entity.UID, 4, Packet); Writer.WriteUInt32(data_8, 8, Packet); Writer.WriteUInt16(Type, 20, Packet); Writer.WriteUInt16(direction, 22, Packet); Writer.WriteUInt32(LoopTime, 32, Packet); Writer.WriteByte(1, 37, Packet); Writer.WriteByte((byte)(EffectName.Length), 38, Packet); Writer.WriteString(EffectName, 39, Packet); Client.Send(Packet); }
Entity.cs
Code:
public byte AncestorHonored = 0;
Code:
#region DailyQuest [TeamXor] #region DailyQuestEnvoy case 1994://my birth date :P { switch (npcRequest.OptionID) { case 0: { dialog.Text("All hereoesn can talk to me to learn about the daily tasks,"); dialog.Text("And go to the required places to accept work"); dialog.Option("Honoring The Ancestors[L50]", 1); dialog.Option("Everything Has A Price[L60]", 2); dialog.Option("Release The Souls[L70]", 3); dialog.Option("Magnolias All Around[L80]", 4); dialog.Option("Everything Has A Price[L60]", 5); dialog.Option("Exorcism[L90]", 6); dialog.Option("Spirit Beads.[L100]", 7); dialog.Option("Leave.", 255); dialog.Send(); break; } case 1: { dialog.Text("Go to the Ancestral Hall and worship the Ancestors."); dialog.Text("Then you will recive a reward."); dialog.Text("If you've devoted enough, you will have the chance to receive 200 study points and 20 CPS (B) as a bonus Blessing!"); dialog.Option("Go to the Ancestral Hall", 8); dialog.Option("Leave.", 255); dialog.Send(); break; } case 8: { client.Entity.Teleport(3081, 53, 56); Kernel.SendWorldMessage(new Message("You were teleported to the Ancestral Hall. what a respectful and solmen place! [Team-Xor]", System.Drawing.Color.White, Message.System ), Kernel.GamePool.Values); break; } } break; } #endregion #region Honoring Ancestors #region goodmanLui case 1995: { switch (npcRequest.OptionID) { case 0: { dialog.Text("When You finish i can send you back to town.if you want if you want to back to twin city, I can send you back."); dialog.Option("How to worship them?", 1); dialog.Option(" Back to Twin City.", 2); dialog.Option("Im just passing by.", 255); dialog.Send(); break; } case 1: { dialog.Text("When You enter the Hall. you will see the images of Nuwa,HuangDi and YanDi , Diffrent Ancestors will grant you diffrent Blessing."); dialog.Option("Worship HuangDi", 3); dialog.Option("Worship Nuwa", 4); dialog.Option("WorshipYangDi", 5); dialog.Option("I see.", 255); dialog.Send(); break; } case 2: { client.Entity.Teleport(1002, 421, 377); break; } case 3: { dialog.Text("HuangDi is a legendary Chinese sovereign and cultral hero. if you worship him, you'll recieve 60 minutes of EXP, 50 Study points and 1 Chi Token. "); dialog.Option("I see.", 255); dialog.Send(); break; } case 4: { dialog.Text("Nuwa is known for creating mankind and repairing the wall of heaven . if you worship her, you'll recieve 5 hours of blessing of EXP, 60 minutes of EXP and 1 Chi Token. "); dialog.Option("I see.", 255); dialog.Send(); break; } case 5: { dialog.Text("YanDi is another Legendary ruler of Ancient China. if you worship him, you'll recieve 5 hours of blessing of EXP, 50 study points and 1 Chi Token. "); dialog.Option("I see.", 255); dialog.Send(); break; } } break; } #endregion #region HuanDi case 1997: { switch (npcRequest.OptionID) { case 0: { dialog.Text("HuangDi is a legendary Chinese sovereign and cultral hero. if you worship him, you'll recieve 60 minutes of EXP, 50 Study points and 1 Chi Token. "); dialog.Option("Worship him.", 1); dialog.Option("I see.", 255); dialog.Send(); break; } case 1: { if (client.Entity.AncestorHonored == 0) { if (client.Entity.X == 45 && client.Entity.Y == 53) { PacketHandler.Send_Effect(client, 220, 164, 1, 5, "worship"); client.IncreaseExperience(client.ExpBalls += 1, false); client.Entity.SubClasses.StudyPoints += 50; client.Inventory.Add(729304, 0, 1); client.Entity.AncestorHonored++; } else { dialog.Text(" You must stand infront of the Ancestor to Honor Him![Team-Xor]"); dialog.Send(); } break; } else { dialog.Text(" you have honored the ancestor today please come back tomorrow"); dialog.Send(); } } break; } break; } case 1996: { switch (npcRequest.OptionID) { case 0: { dialog.Text("HuangDi is a legendary Chinese sovereign and cultral hero. if you worship him, you'll recieve 60 minutes of EXP, 50 Study points and 1 Chi Token. "); dialog.Option("Worship him.", 1); dialog.Option("Leave.", 255); dialog.Send(); break; } case 1: { if (client.Entity.AncestorHonored == 0) { if (client.Entity.X == 45 && client.Entity.Y == 53) { PacketHandler.Send_Effect(client, 220, 164, 1, 5, "Honoring"); client.IncreaseExperience(client.ExpBalls += 1, false); client.Entity.SubClasses.StudyPoints += 50; client.Inventory.Add(729304, 0, 1); _String str = new _String(true); str.UID = client.Entity.UID; str.TextsCount = 1; str.Type = _String.Effect; str.Texts.Add("end_task"); client.SendScreen(str, true); client.Entity.AncestorHonored++; } else { dialog.Text(" You must stand infront of the Ancestor to Honor Him![Team-Xor]"); dialog.Send(); } } else { dialog.Text(" you have honored the ancestor today please come back tomorrow"); dialog.Send(); } break; } } break; } #endregion #region Nuwa case 19991: { switch (npcRequest.OptionID) { case 0: { dialog.Text("Nuwa is known for creating mankind and repairing the wall of heaven . if you worship her, you'll recieve 5 hours of blessing of EXP, 60 minutes of EXP and 1 Chi Token."); dialog.Option("Worship her.", 1); dialog.Option("I see.", 255); dialog.Send(); break; } case 1: { if (client.Entity.AncestorHonored == 0) { if (client.Entity.X == 53 && client.Entity.Y == 45) { PacketHandler.Send_Effect(client, 220, 164, 1, 5, "worship"); uint value = (uint)(5 * 60 * 60); client.AddBless(value); client.Entity.Update(Network.GamePackets.Update.OnlineTraining, client.OnlineTrainingPoints, false); client.Inventory.Add(729304, 0, 1); client.IncreaseExperience(client.ExpBall, false); _String str = new _String(true); str.UID = client.Entity.UID; str.TextsCount = 1; str.Type = _String.Effect; str.Texts.Add("end_task"); client.SendScreen(str, true); client.Entity.AncestorHonored++; } else { dialog.Text(" You must stand infront of the Ancestor to Honor Him![Team-Xor]"); dialog.Send(); } } else { dialog.Text(" you have honored the ancestor today please come back tomorrow"); dialog.Send(); } break; } } break; } case 1998: { switch (npcRequest.OptionID) { case 0: { dialog.Text("Nuwa is known for creating mankind and repairing the wall of heaven . if you worship her, you'll recieve 5 hours of blessing of EXP, 60 minutes of EXP and 1 Chi Token."); dialog.Option("Worship her.", 1); dialog.Option("Leave.", 255); dialog.Send(); break; } case 1: { if (client.Entity.AncestorHonored == 0) { if (client.Entity.X == 54 && client.Entity.Y == 53) { PacketHandler.Send_Effect(client, 220, 164, 1, 5, "worship"); uint value = (uint)(5 * 60 * 60); client.AddBless(value); client.Entity.Update(Network.GamePackets.Update.OnlineTraining, client.OnlineTrainingPoints, false); client.Inventory.Add(729304, 0, 1); client.IncreaseExperience(client.ExpBall, false); _String str = new _String(true); str.UID = client.Entity.UID; str.TextsCount = 1; str.Type = _String.Effect; str.Texts.Add("end_task"); client.SendScreen(str, true); client.Entity.AncestorHonored++; } else { dialog.Text(" You must stand infront of the Ancestor to Honor Him![Team-Xor]"); dialog.Send(); } } else { dialog.Text(" you have honored the ancestor today please come back tomorrow"); dialog.Send(); } break; } } break; } #endregion #region YanDi case 19992: { switch (npcRequest.OptionID) { case 0: { dialog.Text("YanDi is another Legendary ruler of Ancient China. if you worship him, you'll recieve 5 hours of blessing of EXP, 50 study points and 1 Chi Token. "); dialog.Option("Worship him", 1); dialog.Option("I see.", 255); dialog.Send(); break; } case 1: { if (client.Entity.AncestorHonored == 0) { if (client.Entity.X == 63 && client.Entity.Y == 53) { PacketHandler.Send_Effect(client, 220, 164, 1, 5, "worship"); uint value = (uint)(5 * 60 * 60); client.AddBless(value); client.Entity.Update(Network.GamePackets.Update.OnlineTraining, client.OnlineTrainingPoints, false); client.Inventory.Add(729304, 0, 1); client.Entity.SubClasses.StudyPoints += 50; _String str = new _String(true); str.UID = client.Entity.UID; str.TextsCount = 1; str.Type = _String.Effect; client.Entity.AncestorHonored++; str.Texts.Add("end_task"); client.SendScreen(str, true); } else { dialog.Text(" You must stand infront of the Ancestor to Honor Him![Team-Xor]"); dialog.Send(); } } else { dialog.Text(" you have honored the ancestor today please come back tomorrow"); dialog.Send(); } break; } } break; } case 1999: { switch (npcRequest.OptionID) { case 0: { dialog.Text("YanDi is another Legendary ruler of Ancient China. if you worship him, you'll recieve 5 hours of blessing of EXP, 50 study points and 1 Chi Token. "); dialog.Option("Worship him", 1); dialog.Option("Leave.", 255); dialog.Send(); break; } case 1: { if (client.Entity.AncestorHonored == 0) { if (client.Entity.X == 63 && client.Entity.Y == 53) { PacketHandler.Send_Effect(client, 220, 164, 1, 5, "worship"); uint value = (uint)(5 * 60 * 60); client.AddBless(value); client.Entity.Update(Network.GamePackets.Update.OnlineTraining, client.OnlineTrainingPoints, false); client.Inventory.Add(729304, 0, 1); client.Entity.SubClasses.StudyPoints += 50; _String str = new _String(true); str.UID = client.Entity.UID; str.TextsCount = 1; str.Type = _String.Effect; str.Texts.Add("end_task"); client.SendScreen(str, true); client.Entity.AncestorHonored++; } else { dialog.Text(" You must stand infront of the Ancestor to Honor Him![Team-Xor]"); dialog.Send(); } } else { dialog.Text(" you have honored the ancestor today please come back tomorrow"); dialog.Send(); } break; } } break; } #endregion #endregion #endregion
ScreenShots
any comments would be appreciated and plz admit it that I'm less than a beginner.