Example #1
0
    void OnCreatureMix(C2G.CreatureMix packet, C2G.CreatureMixAck ack)
    {
        CreatureManager.Instance.Remove(packet.creature_idx);
        CreatureManager.Instance.Remove(packet.material_creature_idx);

        Network.PlayerInfo.UseGoodsValue(pe_GoodsType.token_gold, ack.use_gold);

        EquipManager.Instance.Add(ack.creature_loot_data.equip[0]);
        EquipManager.Instance.Add(ack.creature_loot_data.equip[1]);
        CreatureManager.Instance.Add(ack.creature_loot_data.creature);

        GameMain.Instance.BackMenu(false);
        GameMain.Instance.BackMenu(false);

        Popup.Instance.Show(ePopupMode.LootCharacter, ack.creature_loot_data.creature.creature_idx, true, true);

        GameMain.Instance.UpdatePlayerInfo();
        CreatureManager.Instance.SetUpdateNotify();
    }
Example #2
0
    void EnchantConfirm(bool confirm)
    {
        if (confirm == false)
        {
            return;
        }

        if (m_ToggleMix.value)
        {
            C2G.CreatureMix packet = new C2G.CreatureMix();
            packet.creature_idx          = m_EnchantBase.Creature.Idx;
            packet.creature_grade        = m_EnchantBase.Creature.Grade;
            packet.material_creature_idx = m_EnchantMaterial.Creature.Idx;

            if (Tutorial.Instance.Completed == false)
            {
                C2G.TutorialState tutorial_packet = new C2G.TutorialState();
                tutorial_packet.tutorial_state      = (short)Tutorial.Instance.CurrentState;
                tutorial_packet.next_tutorial_state = (short)Tutorial.Instance.NextState;
                tutorial_packet.creature_mix        = packet;
                Network.GameServer.JsonAsync <C2G.TutorialState, C2G.TutorialStateAck>(tutorial_packet, OnTutorialCreatureMix);
            }
            else
            {
                Network.GameServer.JsonAsync <C2G.CreatureMix, C2G.CreatureMixAck>(packet, OnCreatureMix);
            }
        }
        else
        {
            C2G.CreatureEvolve packet = new C2G.CreatureEvolve();
            packet.creature_idx          = m_EnchantBase.Creature.Idx;
            packet.creature_grade        = m_EnchantBase.Creature.Grade;
            packet.material_creature_idx = m_EnchantMaterial.Creature.Idx;
            Network.GameServer.JsonAsync <C2G.CreatureEvolve, C2G.CreatureEvolveAck>(packet, OnCreatureEvolve);
        }
    }