[ TUTORIAL ] Adicionar o super wired

+7
Maloma
edinei07
Niickk
aDuff
Luan Martins
Phytols
xNectar
11 participantes

xNectar xNectar  • 02.01.17 16:04

[ TUTORIAL ] Adicionar o super wired Empty [ TUTORIAL ] Adicionar o super wired 02.01.17 16:04

Reputação da mensagem: 100% (1 votos)
[Tens de ter uma conta e sessão iniciada para poderes visualizar esta imagem]

Com este wired, sua premiação em jogos / eventos ficará bem mais fácil.





Tutorial:
INFO: Antes de tudo você irá precisa do Microsoft Visual Studio.


1- Abra a source do seu emulador, como mostrado no print (destacado de amarelo):
[Tens de ter uma conta e sessão iniciada para poderes visualizar esta imagem]

2- Cole todo esse código lá dentro:
Código:

using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System.Collections.Concurrent;
using Plus.Communication.Packets.Outgoing.Handshake;

using Plus.Communication.Packets.Incoming;
using Plus.HabboHotel.Rooms;
using Plus.HabboHotel.Users;
using Plus.Communication.Packets.Outgoing.Rooms.Chat;
using Plus.Communication.Packets.Outgoing.Inventory.Furni;
using Plus.Communication.Packets.Outgoing.Catalog;

namespace Plus.HabboHotel.Items.Wired.Boxes.Effects
{
    class GiveRewardBox : IWiredItem
    {
        public Room Instance { get; set; }
        public Item Item { get; set; }
        public WiredBoxType Type { get { return WiredBoxType.EffectGiveReward; } }
        public ConcurrentDictionary<int, Item> SetItems { get; set; }
        public string StringData { get; set; }
        public bool BoolData { get; set; }
        public string ItemsData { get; set; }

        public GiveRewardBox(Room Instance, Item Item)
        {
            this.Instance = Instance;
            this.Item = Item;
            this.SetItems = new ConcurrentDictionary<int, Item>();
        }

        public void HandleSave(ClientPacket Packet)
        {
            int Unknown = Packet.PopInt();
            int Often = Packet.PopInt();
            bool Unique = (Packet.PopInt() == 1);
            int Limit = Packet.PopInt();
            int Often_No = Packet.PopInt();
            string Reward = Packet.PopString();

            this.BoolData = Unique;
            this.StringData = Reward + "-" + Often + "-" + Limit;
        }

        public bool Execute(params object[] Params)
        {
            if (Params == null || Params.Length == 0)
                return false;

            Habbo Owner = PlusEnvironment.GetHabboById(Item.UserID);
            if (Owner == null || !Owner.GetPermissions().HasRight("room_item_wired_rewards"))
                return false;

            Habbo Player = (Habbo)Params[0];
            if (Player == null || Player.GetClient() == null)
                return false;

            RoomUser User = Player.CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(Player.Username);
            if (User == null)
                return false;

            if (String.IsNullOrEmpty(StringData))
                return false;

            int amountLeft = int.Parse(this.StringData.Split('-')[2]);
            int often = int.Parse(this.StringData.Split('-')[1]);
            bool unique = this.BoolData;

            bool premied = false;

            if (amountLeft == 1)
            {
                Player.GetClient().SendNotification("Os prêmios acabaram, volte mais tarde.");
                return true;
            }

            foreach (var dataStr in (this.StringData.Split('-')[0]).Split(';'))
            {
                var dataArray = dataStr.Split(',');

                var isbadge = dataArray[0] == "0";
                var code = dataArray[1];
                var percentage = int.Parse(dataArray[2]);

                var random = PlusEnvironment.GetRandomNumber(0, 100);

                if (!unique && percentage < random)

                    continue;

                premied = true;


                if (isbadge)
                {

                    if (Player.GetBadgeComponent().HasBadge(code))
                        Player.GetClient().SendMessage(new WhisperComposer(User.VirtualId, "Oops, parece que você já tem este emblema.", 0, User.LastBubble));
                    
                    else
                    {
                        Player.GetBadgeComponent().GiveBadge(code, true, Player.GetClient());
                        Player.GetClient().SendNotification("Você recebeu um emblema!");
                    }
                }
                else
                {
                    ItemData ItemData = null;

                    if (!PlusEnvironment.GetGame().GetItemManager().GetItem(int.Parse(code), out ItemData))
                    {
                        Player.GetClient().SendMessage(new WhisperComposer(User.VirtualId, "ITEM ID não existe: " + code, 0, User.LastBubble));
                        return false;
                    }

                    Item Itemc = ItemFactory.CreateSingleItemNullable(ItemData, Player.GetClient().GetHabbo(), "", "", 0, 0, 0);


                    if (Itemc != null)
                    {
                        Player.GetClient().GetHabbo().GetInventoryComponent().TryAddItem(Itemc);
                        Player.GetClient().SendMessage(new FurniListNotificationComposer(Itemc.Id, 1));
                        Player.GetClient().SendMessage(new PurchaseOKComposer());
                        Player.GetClient().SendMessage(new FurniListAddComposer(Itemc));
                        Player.GetClient().SendMessage(new FurniListUpdateComposer());
                        Player.GetClient().SendNotification("Você acaba de receber um mobi, confira o seu inventário.");
                    }
                }
            }

            if (!premied)
            {
                Player.GetClient().SendNotification("Sorte da próxima vez. :(");
            }
            else if (amountLeft > 1)
            {
                amountLeft--;
                this.StringData.Split('-')[2] = amountLeft.ToString();
            }

            return true;
        }
    }

}

Ou se preferir aqui
3- Agora clique em START como mostrado no print: 


[Tens de ter uma conta e sessão iniciada para poderes visualizar esta imagem]


4- Vá até a sua DB, clique em Furniture e em seguida clique em PESQUISAR:

[Tens de ter uma conta e sessão iniciada para poderes visualizar esta imagem]

5- Procure por wf_act_give_userbadge e aperte em executar:
INFO: O Executar fica no final da página.

[Tens de ter uma conta e sessão iniciada para poderes visualizar esta imagem]

6- Você irá encontrar 1 resultado apenas, neste resultado você clique em EDITA:

[Tens de ter uma conta e sessão iniciada para poderes visualizar esta imagem]

7- Após ter efetuado o passo 6, vá até wired_id e mude-o mesmo para 40 e clique em Executar:

[Tens de ter uma conta e sessão iniciada para poderes visualizar esta imagem]

8- Dê update no catálogo e nos items (:update catalog; :update furnis) e teste.

Imagens do funcionamento:


[Tens de ter uma conta e sessão iniciada para poderes visualizar esta imagem]

Créditos:
~ [Tens de ter uma conta e sessão iniciada para poderes visualizar este link]
~ Unc. Team

Phytols Phytols  • 02.01.17 16:07

[ TUTORIAL ] Adicionar o super wired Empty Re: [ TUTORIAL ] Adicionar o super wired 02.01.17 16:07

Estava precisando pro meu hotel, obrigado mesmo!

xNectar xNectar  • 02.01.17 16:14

[ TUTORIAL ] Adicionar o super wired Empty Re: [ TUTORIAL ] Adicionar o super wired 02.01.17 16:14

Marshmello escreveu:Estava precisando pro meu hotel, obrigado mesmo!
É nois ehehe. Se ajudei da um like +

Luan Martins Luan Martins  • 02.01.17 16:16

[ TUTORIAL ] Adicionar o super wired Empty Re: [ TUTORIAL ] Adicionar o super wired 02.01.17 16:16

vai ajudar bastante a galera tava pedindo por isso ai.

xNectar xNectar  • 02.01.17 16:26

[ TUTORIAL ] Adicionar o super wired Empty Re: [ TUTORIAL ] Adicionar o super wired 02.01.17 16:26

Luan Martins escreveu:vai ajudar bastante a galera tava pedindo por isso ai.
É o que eu espero..

aDuff aDuff  • 17.02.17 21:26

[ TUTORIAL ] Adicionar o super wired Empty Re: [ TUTORIAL ] Adicionar o super wired 17.02.17 21:26

Muito bem, ajudou muito

Niickk Niickk  • 03.04.17 6:34

[ TUTORIAL ] Adicionar o super wired Empty Re: [ TUTORIAL ] Adicionar o super wired 03.04.17 6:34

.......

edinei07 edinei07  • 03.04.17 6:37

[ TUTORIAL ] Adicionar o super wired Empty Re: [ TUTORIAL ] Adicionar o super wired 03.04.17 6:37

[alerta=Moderação]
Niickk tome cuidado com os comentários inúteis.
Peço a todos os Iniciantes e Membros que leiam as regras clicando [Tens de ter uma conta e sessão iniciada para poderes visualizar este link]
[/alerta]

Maloma Maloma  • 03.04.17 10:36

[ TUTORIAL ] Adicionar o super wired Empty Re: [ TUTORIAL ] Adicionar o super wired 03.04.17 10:36

Eu ainda não tinha visto esse tutorial, mas enfim, é muito útil, obrigada por trazer para o fórum!

G'-'nz G'-'nz  • 22.05.17 11:06

[ TUTORIAL ] Adicionar o super wired Empty Re: [ TUTORIAL ] Adicionar o super wired 22.05.17 11:06

Gostei do tutorial, poderia min adicionar no skype pra eu conversa um assunto importante contigo.
Skp : facebook:jogohabbo2017

Marcondes Marcondes  • 22.05.17 22:28

[ TUTORIAL ] Adicionar o super wired Empty Re: [ TUTORIAL ] Adicionar o super wired 22.05.17 22:28

testando

Saigon Saigon  • 22.05.17 23:00

[ TUTORIAL ] Adicionar o super wired Empty Re: [ TUTORIAL ] Adicionar o super wired 22.05.17 23:00

MODERAÇÃO
Usuário: Marcondes
Quantidade: +1
Motivo: Postagem inútil
[Tens de ter uma conta e sessão iniciada para poderes visualizar este link]

TrY! TrY!  • 23.05.17 1:51

[ TUTORIAL ] Adicionar o super wired Empty Re: [ TUTORIAL ] Adicionar o super wired 23.05.17 1:51

Olá,

De fato o tutorial aparenta ser bem útil. Obrigado por compartilhar.
Permissões neste sub-fórum
Não podes responder a tópicos

BH Servers

Recomendamos a BH Servers com proteção DDOS gratuita em Cloud Server de alta performance. Entrega imediata.