public static void Packet_Time(ref byte[] data) { ByteStream buffer = new ByteStream(data); Time.Instance.TimeOfDay = (TimeOfDay)buffer.ReadByte(); if (Time.Instance.TimeOfDay == TimeOfDay.Dawn) { C_Text.AddText("A chilling, refreshing, breeze has come with the morning.", (System.Int32)Enums.ColorType.BrightBlue); } else if (Time.Instance.TimeOfDay == TimeOfDay.Day) { C_Text.AddText("Day has dawned in this region.", (System.Int32)Enums.ColorType.Yellow); } else if (Time.Instance.TimeOfDay == TimeOfDay.Dusk) { C_Text.AddText("Dusk has begun darkening the skies...", (System.Int32)Enums.ColorType.BrightRed); } else { C_Text.AddText("Night has fallen upon the weary travelers.", (System.Int32)Enums.ColorType.DarkGray); } buffer.Dispose(); }
public void BtnMapReport_Click(object sender, EventArgs e) { if (C_Player.GetPlayerAccess(C_Variables.Myindex) < (int)Enums.AdminType.Mapper) { C_Text.AddText("You need to be a high enough staff member to do this!", (System.Int32)Enums.QColorType.AlertColor); return; } C_NetworkSend.SendRequestMapreport(); }
public void BtnALoc_Click(object sender, EventArgs e) { if (C_Player.GetPlayerAccess(C_Variables.Myindex) < (int)Enums.AdminType.Mapper) { C_Text.AddText("You need to be a high enough staff member to do this!", (System.Int32)Enums.QColorType.AlertColor); return; } C_Variables.BLoc = !C_Variables.BLoc; }
public void BtnSpawnItem_Click(object sender, EventArgs e) { if (C_Player.GetPlayerAccess(C_Variables.Myindex) < (int)Enums.AdminType.Creator) { C_Text.AddText("You need to be a high enough staff member to do this!", (System.Int32)Enums.QColorType.AlertColor); return; } C_NetworkSend.SendSpawnItem(System.Convert.ToInt32(cmbSpawnItem.SelectedIndex + 1), System.Convert.ToInt32(nudSpawnItemAmount.Value)); }
internal static void SendCraftIt(string recipeName, int amount) { ByteStream buffer = new ByteStream(4); int i = 0; int recipeindex = 0; recipeindex = GetRecipeIndex(recipeName); if (recipeindex <= 0) { return; } //check,check, double check //we dont even know the damn recipe xD if (C_Types.Player[C_Variables.Myindex].RecipeLearned[recipeindex] == 0) { return; } //enough ingredients for (i = 1; i <= Constants.MAX_INGREDIENT; i++) { if (Recipe[recipeindex].Ingredients[i].ItemNum > 0 && C_Quest.HasItem(C_Variables.Myindex, Recipe[recipeindex].Ingredients[i].ItemNum) < (amount * Recipe[recipeindex].Ingredients[i].Value)) { C_Text.AddText(Strings.Get("crafting", "notenough"), (System.Int32)Enums.ColorType.Red); return; } } //all seems fine... buffer.WriteInt32((System.Int32)Packets.ClientPackets.CStartCraft); buffer.WriteInt32(recipeindex); buffer.WriteInt32(amount); C_NetworkConfig.Socket.SendData(buffer.Data, buffer.Head); buffer.Dispose(); CraftTimer = C_General.GetTickCount(); CraftTimerEnabled = true; BtnCraftEnabled = false; BtnCraftStopEnabled = false; BtnCraftStopEnabled = false; NudCraftAmountEnabled = false; LstRecipeEnabled = false; ChkKnownOnlyEnabled = false; }
public void BtnAdminBan_Click(object sender, EventArgs e) { if (C_Player.GetPlayerAccess(C_Variables.Myindex) < (int)Enums.AdminType.Mapper) { C_Text.AddText("You need to be a high enough staff member to do this!", (System.Int32)Enums.QColorType.AlertColor); return; } if (Microsoft.VisualBasic.Strings.Trim(System.Convert.ToString(txtAdminName.Text)).Length < 1) { return; } C_NetworkSend.SendBan(Microsoft.VisualBasic.Strings.Trim(System.Convert.ToString(txtAdminName.Text))); }
public void BtnAdminSetSprite_Click(object sender, EventArgs e) { if (C_Player.GetPlayerAccess(C_Variables.Myindex) < (int)Enums.AdminType.Mapper) { C_Text.AddText("You need to be a high enough staff member to do this!", (System.Int32)Enums.QColorType.AlertColor); return; } if (nudAdminSprite.Value < 1) { return; } C_NetworkSend.SendSetSprite(System.Convert.ToInt32(nudAdminSprite.Value)); }
public void BtnAdminWarpTo_Click(object sender, EventArgs e) { if (C_Player.GetPlayerAccess(C_Variables.Myindex) < (int)Enums.AdminType.Mapper) { C_Text.AddText("You need to be a high enough staff member to do this!", (System.Int32)Enums.QColorType.AlertColor); return; } // Check to make sure its a valid map # if (nudAdminMap.Value > 0 && nudAdminMap.Value <= Constants.MAX_MAPS) { C_NetworkSend.WarpTo(System.Convert.ToInt32(nudAdminMap.Value)); } else { C_Text.AddText("Invalid map number.", (System.Int32)Enums.ColorType.BrightRed); } }
public void LstMaps_DoubleClick(object sender, EventArgs e) { if (C_Player.GetPlayerAccess(C_Variables.Myindex) < (int)Enums.AdminType.Mapper) { C_Text.AddText("You need to be a high enough staff member to do this!", (System.Int32)Enums.QColorType.AlertColor); return; } // Check to make sure its a valid map # if (lstMaps.FocusedItem.Index + 1 > 0 && lstMaps.FocusedItem.Index + 1 <= Constants.MAX_MAPS) { C_NetworkSend.WarpTo(System.Convert.ToInt32(lstMaps.FocusedItem.Index + 1)); } else { C_Text.AddText("Invalid map number: " + (lstMaps.FocusedItem.Index + 1), (System.Int32)Enums.QColorType.AlertColor); } }
public void BtnAdminSetAccess_Click(object sender, EventArgs e) { if (C_Player.GetPlayerAccess(C_Variables.Myindex) < (int)Enums.AdminType.Creator) { C_Text.AddText("You need to be a high enough staff member to do this!", (System.Int32)Enums.QColorType.AlertColor); return; } if (Microsoft.VisualBasic.Strings.Trim(System.Convert.ToString(txtAdminName.Text)).Length < 2) { return; } if (Information.IsNumeric(Microsoft.VisualBasic.Strings.Trim(System.Convert.ToString(txtAdminName.Text))) || cmbAccess.SelectedIndex < 0) { return; } C_NetworkSend.SendSetAccess(Microsoft.VisualBasic.Strings.Trim(System.Convert.ToString(txtAdminName.Text)), System.Convert.ToByte(cmbAccess.SelectedIndex)); }
internal static void ForgetSkill(int skillslot) { ByteStream buffer = new ByteStream(4); // Check for subscript out of range if (skillslot < 1 || skillslot > Constants.MAX_PLAYER_SKILLS) { return; } // dont let them forget a skill which is in CD if (C_Variables.SkillCd[skillslot] > 0) { C_Text.AddText("Cannot forget a skill which is cooling down!", (System.Int32)Enums.QColorType.AlertColor); return; } // dont let them forget a skill which is buffered if (C_Variables.SkillBuffer == skillslot) { C_Text.AddText("Cannot forget a skill which you are casting!", (System.Int32)Enums.QColorType.AlertColor); return; } if (C_Variables.PlayerSkills[skillslot] > 0) { buffer.WriteInt32((System.Int32)Packets.ClientPackets.CForgetSkill); buffer.WriteInt32(skillslot); C_NetworkConfig.Socket.SendData(buffer.Data, buffer.Head); } else { C_Text.AddText("No skill found.", (System.Int32)Enums.QColorType.AlertColor); } buffer.Dispose(); }
public static void Packet_TradeStatus(ref byte[] data) { int tradestatus = 0; ByteStream buffer = new ByteStream(data); tradestatus = buffer.ReadInt32(); switch (tradestatus) { case 0: // clear break; //frmMainGame.lblTradeStatus.Text = "" case 1: // they've accepted C_Text.AddText(Strings.Get("trade", "tradestatusok"), (System.Int32)Enums.ColorType.White); break; case 2: // you've accepted C_Text.AddText(Strings.Get("trade", "tradestatuswait"), (System.Int32)Enums.ColorType.White); break; } buffer.Dispose(); }