Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region House Voting
- case 42493:
- {
- switch (npcRequest.OptionID)
- {
- case 0:
- {
- dialog.Text("Hello " + client.Entity.Name + " Iam House Voting Manger");
- dialog.Option("Tell Me About The System", 1);
- dialog.Option("Let Me join As Voter", 3);
- dialog.Option("Let Me Join As House Owner", 2);
- dialog.Option(" Change My House Title", 7);
- dialog.Option("Thanks Alot Man I will Check it Later", 255);
- dialog.Send();
- break;
- }
- case 1:
- {
- dialog.Text("Welcome, This system enable you if u have a house using it to join a big voting to select one house as the most nice house in the game");
- dialog.Text("and u can join as voter to make ur choice to select one of this house first time at a day");
- dialog.Option("Thanks For Information", 255);
- break;
- }
- case 2: //House Joine Owner
- {
- dialog.Text("Do U want To Join , you Should Know you will be need to make your house the best to win by voting from another player ");
- dialog.Option("I know that, lets go", 4);
- dialog.Option("Thanks I Check it later", 255);
- break;
- }
- case 3: // Voter
- {
- dialog.Text("Do U want To Vote For A House like you , be sure your choice maybe more affective for final result ");
- dialog.Option("I know that, lets go", 5);
- dialog.Option("Thanks I Check it later", 255);
- break;
- }
- case 5://voter
- {
- smartinv.Mido.House.HouseInfo voter = new smartinv.Mido.House.HouseInfo();
- smartinv.Mido.House.HouseInfo housjoin = new smartinv.Mido.House.HouseInfo();
- housjoin.Name = client.Entity.Name;
- voter.UID = client.Entity.UID;
- voter.Name = client.Entity.Name;
- voter.Times = client.Entity.Times;
- // Sent Dtat to Mysql && Get Owner House ID
- MySqlCommand command = new MySqlCommand(MySqlCommandType.INSERT);
- command.Insert("VoterHouse").Insert("VoterID", voter.UID)
- .Insert("VoterName", voter.Name).Insert("Tiems", voter.Times + 1);
- command.Execute();
- Console.WriteLine("Sent Dtat to Mysql && Get Owner House ID");
- //////////////////
- // MySqlCommand commands = new MySqlCommand(MySqlCommandType.INSERT);
- //commands.Insert("entities").Insert("VoterHouse", housjoin.Name);
- //commands.Execute();
- Console.WriteLine("Replace Name To voterHouse");
- client.Entity.kepspouse = client.Entity.Spouse;
- string house;
- using (var cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("housevotjoin"))
- using (var reader = new MySqlReader(cmd))
- if (reader.Read())
- {
- house = reader.ReadString("HouseName");
- client.Entity.Spouse = house;
- client.Entity.HouseOwner = house;
- dialog.Text(" Please Select One Of This Competitors");
- dialog.Option(client.Entity.HouseOwner, 10);
- dialog.Option("Never Mind", 255);
- }
- /////////
- Console.WriteLine("Done Case Vote");
- break;
- }
- case 10:
- {
- if (Mido.House.SpouseHouse(client.Entity.Spouse) != null)
- {
- var spouse = Mido.House.SpouseHouse(client.Entity.Spouse);
- Mido.House.TelePort(client, spouse);
- }
- else
- {
- dialog.Text("Sorry can't find one :(");
- dialog.Option("Oh Sorry!.", 0xff);
- dialog.Send();
- }
- int n = client.Entity.totalvoter;
- using (var cmd = new MySqlCommand(MySqlCommandType.UPDATE))
- cmd.Update("totalvoter").Set("totalvoter", n + 1).Where("totalvoter", n)
- .Execute();
- Console.WriteLine(" TotalVoter Updata Correctly");
- uint uid;
- uid = client.Entity.UID;
- using (var cmd = new MySqlCommand(MySqlCommandType.UPDATE))
- cmd.Update("entities").Set("spouse", client.Entity.kepspouse)
- .Where("UID", uid).Execute();
- Console.WriteLine(" Spouse Name keep done ");
- break;
- }
- case 4: //house owner
- {
- smartinv.Mido.House.HouseInfo housjoin = new smartinv.Mido.House.HouseInfo();
- housjoin.UID = client.Entity.UID;
- housjoin.Name = client.Entity.Name;
- housjoin.Percent = client.Entity.Percent;
- dialog.Text(" Your Request Has Been Done");
- dialog.Text(" Do u want to rename your House");
- dialog.Input("Here:", 6, 14);
- dialog.Option("Thanks i prefer My Name", 255);
- MySqlCommand command = new MySqlCommand(MySqlCommandType.INSERT);
- command.Insert("HouseVotJoin").Insert("HouseID", housjoin.UID)
- .Insert("HouseName", housjoin.Name).Insert("Percent", housjoin.Percent);
- command.Execute();
- /////////////
- uint uid;
- uid = client.Account.EntityID;
- using (var cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("housevotjoin").Where("HouseID", uid))
- using (var reader = new MySqlReader(cmd))
- client.Entity.HouseOwner = reader.ReadString("HouseName");
- break;
- }
- case 6:
- {
- smartinv.Mido.House.HouseInfo housjoin = new smartinv.Mido.House.HouseInfo();
- housjoin.title = npcRequest.Input;
- housjoin.Name = client.Entity.Name;
- MySqlCommand command = new MySqlCommand(MySqlCommandType.INSERT);
- command.Insert("HouseTitle")
- .Insert("TittleHouse", housjoin.title).Insert("HouseName", housjoin.Name);
- command.Execute();
- dialog.Text(" Your House Tittle Has Been Changed");
- dialog.Option("Thanks", 255);
- break;
- }
- case 7:
- {
- dialog.Text("Please Insert House Title U need");
- dialog.Input("Change My House Tittle", 6, 14);
- break;
- }
- }
- break;
- }
- #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement