Painel do usuário
Mensagens: 2
-
Alterar
-
Ver
-
Tópicos e mensagens
Últimos assuntos
Tópicos semelhantes
[C#] Tarefas São Valentim
2 participantes
Página 1 de 1
[C#] Tarefas São Valentim
jeanzinhuuh escreveu:Como ninguem posto isso aqui no forúm ainda, resolvi posta
Pra colocar é simples, vá em \Messages\Requests\Users.cs e procure por:
- Código:
public void RegisterUsers()
Adicione isso acima:
- Código:
private void OpenQuests()
{
//L`val11{{2}}JPASjJFIND_STUFF{{2}}bling_chair_c{{2}}QA1296543600000{{2}}EXTRA01{{2}}{{2}}PkHFIND_STUFF{{2}}val_table1{{2}}QA1296630000000{{2}}EXTRA02{{2}}{{2}}P]HFIND_STUFF{{2}}bling_bed{{2}}QA1296802800000{{2}}DAY02{{2}}{{2}}S\HFIND_STUFF{{2}}bath{{2}}QA1296716400000{{2}}DAY01{{2}}{{2}}
DataTable Data = null;
DataRow QuestCount = null;
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
Data = dbClient.ReadDataTable("SELECT * FROM quests");
QuestCount = dbClient.ReadDataRow("SELECT COUNT(*) AS total FROM quests");
}
if (Data == null)
{
return;
}
string Count = QuestCount["total"].ToString();
int TotalQuestCount = int.Parse(Count);
ServerMessage OpenQuest = new ServerMessage(800);
OpenQuest.AppendStringWithBreak("val11"); // val11 / xmas10
OpenQuest.AppendInt32(2);
OpenQuest.AppendInt32(TotalQuestCount);
foreach (DataRow Row in Data.Rows)
{
int QuestProcess = 0;
DataTable Data2 = null;
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
Data2 = dbClient.ReadDataTable("SELECT process FROM user_quests WHERE quest = '" + (int)Row["id"] + "' AND user = '" + Session.GetHabbo().Id + "'");
}
if (Data != null)
{
foreach (DataRow Row2 in Data2.Rows)
{
QuestProcess = (int)Row2["process"];
}
}
OpenQuest.AppendInt32((int)Row["id"]);
OpenQuest.AppendInt32(QuestProcess);
OpenQuest.AppendStringWithBreak("FIND_STUFF");
OpenQuest.AppendStringWithBreak((string)Row["item"]);
OpenQuest.AppendInt32((int)Row["hearts"]);
OpenQuest.AppendStringWithBreak((string)Row["time"]);
OpenQuest.AppendStringWithBreak((string)Row["data"]);
OpenQuest.AppendStringWithBreak("");
}
Session.SendMessage(OpenQuest);
}
private void AcceptQuest()
{
//Laval11{{2}}S\KFIND_STUFF{{2}}bath{{2}}QA1296716400000{{2}}DAY01{{2}}{{2}}{{1}}
DataTable Data = null;
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
Data = dbClient.ReadDataTable("SELECT * FROM quests WHERE id = '" + Request.PopWiredInt32() + "' LIMIT 1");
}
if (Data == null)
{
return;
}
foreach (DataRow Row in Data.Rows)
{
ServerMessage AcceptQuest = new ServerMessage(801);
AcceptQuest.AppendStringWithBreak("val11");
AcceptQuest.AppendInt32((int)Row["id"]);
AcceptQuest.AppendInt32(3);
AcceptQuest.AppendStringWithBreak("FIND_STUFF");
AcceptQuest.AppendStringWithBreak((string)Row["item"]);
AcceptQuest.AppendInt32((int)Row["hearts"]);
AcceptQuest.AppendStringWithBreak((string)Row["time"]);
AcceptQuest.AppendStringWithBreak((string)Row["data"]);
AcceptQuest.AppendStringWithBreak("");
Session.SendMessage(AcceptQuest);
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
dbClient.ExecuteQuery("INSERT INTO user_quests (`id`, `user`, `quest`, `process`) VALUES (NULL, '" + Session.GetHabbo().Id + "', '" + (int)Row["id"] + "', '3')");
}
}
}
Procure por:
- Código:
RequestHandlers[3000] = new RequestHandler(GetPetsInventory);
Adicione isso abaixo:
- Código:
RequestHandlers[3102] = new RequestHandler(OpenQuests);
RequestHandlers[3101] = new RequestHandler(AcceptQuest);
Agora vá em \Messages\Requests\Rooms.cs e procure por:
- Código:
Item.Interactor.OnTrigger(Session, Item, Request.PopWiredInt32(), hasRights);
Adicione isso acima:
- Código:
//Lbval11{{2}}P]IFIND_STUFF{{2}}bling_bed{{2}}QA1296802800000{{2}}DAY02{{2}}{{2}}{{1}}
DataTable Data = null;
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
Data = dbClient.ReadDataTable("SELECT * FROM user_quests WHERE user = '" + Session.GetHabbo().Id + "'");
}
if (Data == null)
{
return;
}
foreach (DataRow Row in Data.Rows)
{
if ((int)Row["process"] == 3)
{
DataTable Data2 = null;
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
Data2 = dbClient.ReadDataTable("SELECT * FROM quests WHERE id = '" + (int)Row["quest"] + "'");
}
if (Data2 == null)
{
return;
}
foreach (DataRow Row2 in Data2.Rows)
{
if ((string)Row2["item"] == Item.GetBaseItem().Name)
{
ServerMessage DoneQuest = new ServerMessage(802);
DoneQuest.AppendStringWithBreak("val11");
DoneQuest.AppendInt32((int)Row2["id"]);
DoneQuest.AppendInt32(1);
DoneQuest.AppendStringWithBreak("FIND_STUFF");
DoneQuest.AppendStringWithBreak((string)Row2["item"]);
DoneQuest.AppendInt32((int)Row2["hearts"]);
DoneQuest.AppendStringWithBreak((string)Row2["time"]);
DoneQuest.AppendStringWithBreak((string)Row2["data"]);
DoneQuest.AppendStringWithBreak("");
Session.SendMessage(DoneQuest);
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
dbClient.ExecuteQuery("UPDATE user_quests SET process = '1' WHERE quest = '" + (int)Row2["id"] + "' AND user = '" + Session.GetHabbo().Id + "'");
dbClient.ExecuteQuery("UPDATE users SET hearts = hearts + " + (int)Row2["hearts"] + " WHERE id = '" + Session.GetHabbo().Id + "'");
}
return;
}
}
}
}
MYSQL
Execute isso no seu banco de dados:
- Código:
CREATE TABLE IF NOT EXISTS `quests` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`item` varchar(255) NOT NULL,
`time` varchar(255) NOT NULL,
`data` varchar(255) NOT NULL,
`hearts` int(11) NOT NULL DEFAULT '5',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=173 ;
INSERT INTO `quests` (`id`, `item`, `time`, `data`, `hearts`) VALUES
(115, 'bath', '1296716400000', 'DAY01', 5),
(116, 'bling_bed', '1296802800000', 'DAY02', 5),
(172, 'val_table1', '1296630000000', 'EXTRA02', 5),
(171, 'bling_chair_c', '1296543600000', 'EXTRA01', 5),
(117, 'bling_toilet', '1296889200000', 'DAY03', 5);
- Código:
CREATE TABLE IF NOT EXISTS `user_quests` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user` int(11) NOT NULL,
`quest` int(11) NOT NULL,
`process` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
- Código:
ALTER TABLE `users` ADD `hearts` INT( 11 ) NOT NULL DEFAULT '0';
- Código:
ALTER TABLE `users` ADD `quests_passed` INT( 11 ) NOT NULL
IMAGENS
- Código:
http://images.habbo.com/c_images/Quests/icon_val11_reward_5.png
http://images.habbo.com/c_images/Quests/icon_val11_reward_1.png
http://images.habbo.com/c_images/Quests/header_val11.png
http://images.habbo.com/c_images/Quests/icon_val11_active.png
http://images.habbo.com/c_images/Quests/icon_val11_pixeltype.png
Coloque isso nas suas variables:
- Código:
questing.defaultCampaign=val11
Pra funcionar, você precisa baixar a Habbo.swf:
- Código:
http://www.mediafire.com/?p5jm97w4itc007f
Prints:
https://2img.net/r/ihimizer/img228/7181/questsb.png
https://2img.net/r/ihimizer/img560/2620/quests2.png
Créditos:
-> TopErwin (Criou o código)
-> anthony93260 (Crackeou a SWF)
-> DjInTrouble (Criou os Packets)
-> Meth0d (Criando o emulador)
-> Lts (Código nas variables)
-> =dj.matias= (Imagens)
Slash- Strike Avançado
- Localização : Ronaldo ..
Data de inscrição : 20/12/2010
Mensagens : 1520
Pontos : 2045
Re: [C#] Tarefas São Valentim
Muito bom , parabéns , ja i hoteis com as taferas mais em poucos funfavam
Re: [C#] Tarefas São Valentim
Vou colocar esses codigos tudo no meu Emu , e na minha CMS pro meu projeto .
Slash- Strike Avançado
- Localização : Ronaldo ..
Data de inscrição : 20/12/2010
Mensagens : 1520
Pontos : 2045
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos
Ter Nov 01, 2011 12:25 pm por Kayo Raphael
» Jogo do 1 até 200
Sáb Out 29, 2011 6:47 pm por JooneH
» [Parceria] Fórum Tecnofu [Fourkeys]
Sáb Out 29, 2011 6:46 pm por JooneH
» Dofus Strik
Ter Out 04, 2011 12:54 pm por karmo667
» Had Hotel - Surpresa!
Dom Set 04, 2011 4:18 pm por Malacus
» Strike Pixel - Nova Era
Sáb Set 03, 2011 3:24 pm por Slash
» Os Manow - Sabe Enredo - Inchentes Malvadas Indios Traiçoeiros
Seg Jun 20, 2011 6:18 pm por eXodo34
» [Download] Snowz Ots V12 (8.60)
Seg Jun 20, 2011 6:17 pm por eXodo34
» [Cheat]TibiaBOT [Cheat]
Seg Jun 20, 2011 6:17 pm por eXodo34