Пример #1
0
        /// <summary>
        /// Sends damage information to damage dealer, and damage getter entities, if they have a connection.
        /// </summary>
        /// <param name="damageDealer">The entity that is dealing the damage.</param>
        /// <param name="damageGetter">The entity that is getting the damage.</param>
        /// <param name="effectType">The effect type of the damage.</param>
        /// <param name="damageValue">The value of the damage.</param>
        /// <param name="crit">True if the damage is critical damage.</param>
        public void SendDamageInfo(Entity damageDealer, Entity damageGetter, SkillSchool effectType, int damageValue, bool crit = false)
        {
            NetOutgoingMessage msgOut;
            NetBuffer          buffer = new NetBuffer();

            buffer.Write((byte)MessageType.DamageInfo);

            buffer.Write(damageGetter.Id);
            buffer.Write(damageValue);
            buffer.Write((byte)effectType);
            buffer.Write(crit);

            if (damageDealer.GetConnection() != null)
            {
                msgOut = Server.CreateMessage();
                msgOut.Write(buffer);
                damageDealer.GetConnection().SendMessage(msgOut, NetDeliveryMethod.Unreliable, 0);
            }
            if (damageGetter.GetConnection() != null)
            {
                msgOut = Server.CreateMessage();
                msgOut.Write(buffer);
                damageGetter.GetConnection().SendMessage(msgOut, NetDeliveryMethod.Unreliable, 0);
            }
        }
        // Token: 0x0600001C RID: 28 RVA: 0x000034EC File Offset: 0x000016EC
        public static void SetupAltarInteraction(ref Trainer altarTrainer, ref SkillSchool templarTreeInstance)
        {
            GameObject gameObject = GameObject.Find("DialogueAltar/NPC/InteractionActivatorSettings");
            bool       flag       = gameObject != null;

            if (flag)
            {
                NPCInteraction componentInChildren = gameObject.GetComponentInChildren <NPCInteraction>();
                bool           flag2 = componentInChildren != null;
                if (flag2)
                {
                    bool flag3 = componentInChildren.ActorLocKey == "name_unpc_altar_01";
                    if (flag3)
                    {
                        DialogueTreeController dialogueController = componentInChildren.NPCDialogue.DialogueController;
                        Graph                 graph    = dialogueController.graph;
                        List <Node>           allNodes = graph.allNodes;
                        MultipleChoiceNodeExt multipleChoiceNodeExt = allNodes.FirstOrDefault(delegate(Node n)
                        {
                            bool result;
                            if (n != null && n is MultipleChoiceNodeExt)
                            {
                                result = ((from m in ((MultipleChoiceNodeExt)n).availableChoices
                                           where m.statement.text == "(Offer a prayer to Elatt)"
                                           select m).ToList <MultipleChoiceNodeExt.Choice>().Count > 0);
                            }
                            else
                            {
                                result = false;
                            }
                            return(result);
                        }) as MultipleChoiceNodeExt;
                        bool flag4 = multipleChoiceNodeExt == null;
                        if (!flag4)
                        {
                            string text = "(Swear an oath to Elatt.)";
                            MultipleChoiceNodeExt.Choice choice = new MultipleChoiceNodeExt.Choice();
                            choice.statement      = new Statement();
                            choice.statement.text = text;
                            choice.isUnfolded     = true;
                            multipleChoiceNodeExt.availableChoices.Insert(0, choice);
                            ActionNode actionNode = graph.AddNode <ActionNode>();
                            allNodes.Add(actionNode);
                            altarTrainer = new Trainer();
                            At.SetValue <UID>(UID.Generate(), typeof(Trainer), altarTrainer, "m_uid");
                            At.SetValue <UID>(templarTreeInstance.UID, typeof(Trainer), altarTrainer, "m_skillTreeUID");
                            actionNode.action = new TrainDialogueAction();
                            ((TrainDialogueAction)actionNode.action).Trainer = new BBParameter <Trainer>(altarTrainer);
                            BBParameter <Character> bbparameter = new BBParameter <Character>();
                            bbparameter.name = "gInstigator";
                            ((TrainDialogueAction)actionNode.action).PlayerCharacter = bbparameter;
                            graph.ConnectNodes(multipleChoiceNodeExt, actionNode, 0, -1);
                            FinishNode finishNode = graph.AddNode <FinishNode>();
                            allNodes.Add(finishNode);
                            graph.ConnectNodes(actionNode, finishNode, -1, -1);
                        }
                    }
                }
            }
        }
Пример #3
0
        /// <summary>
        /// If this Entity dies, adds experience to the damage dealer.
        /// </summary>
        /// <param name="effectType">Effect type of the skill.</param>
        /// <param name="damageMultiplier">Skill damage multiplier.</param>
        /// <param name="caster">Damage dealer.</param>
        /// <returns></returns>
        public override int TakeDamage(SkillSchool effectType, float damageMultiplier, Entity caster)
        {
            int damageDealt = 0;

            if (Health.Value > 0)
            {
                damageDealt = base.TakeDamage(effectType, damageMultiplier, caster);
                Server.OutgoingMessageHandler.SendEntityUpdate(this);
                if (Health.Value > 0)
                {
                    if (!IsReseting)
                    {
                        SetTarget(caster);
                    }
                    if (new Random().Next(0, 100) < 10)
                    {
                        AddSkill(SkillFactory.Instance.GetSkill(SkillID.Rage).Create(this, caster, Server));
                    }
                }
                else
                {
                    SetTarget(null);
                    caster.AddExperience(Level * 100);
                }
            }
            return(damageDealt);
        }
Пример #4
0
        public override int TakeDamage(SkillSchool effectType, float damageMultiplier, Entity caster)
        {
            int damageDealt = base.TakeDamage(effectType, damageMultiplier, caster);

            Server.OutgoingMessageHandler.SendEntityUpdate(this);
            if (Health.Value <= 0)
            {
                isDead = true;
                Server.OutgoingMessageHandler.SendSystemInfo(Connection, SystemMessageType.YouAreDead);
            }
            return(damageDealt);
        }
        internal override void OnPrepare()
        {
            if (this.SkillTree != null)
            {
                if (string.IsNullOrEmpty(SkillTree.SLPackName))
                {
                    SkillTree.SLPackName = this.SerializedSLPackName;
                }

                m_skillTree = this.SkillTree.CreateBaseSchool(true);
            }
        }
Пример #6
0
        static bool TrainerPanel_OnSkillSlotSelected_Pre(TrainerPanel __instance, SkillTreeSlotDisplay _display)
        {
            // Cache
            SkillSlot          slot            = _display.FocusedSkillSlot;
            SkillSchool        tree            = __instance.m_trainerTree;
            Image              currencyIcon    = __instance.m_imgRemainingCurrency;
            Text               currencyLeft    = __instance.m_remainingSilver;
            Image              currencyReqIcon = __instance.m_requirementDisplay.m_imgSilverIcon;
            CharacterInventory inventory       = __instance.LocalCharacter.Inventory;

            // Defaults
            tree.AlternateCurrecy                    = -1;
            tree.AlternateCurrencyIcon               = null;
            currencyIcon.overrideSprite              = null;
            currencyIcon.rectTransform.pivot         = 0.5f.ToVector2();
            currencyIcon.rectTransform.localScale    = 1f.ToVector2();
            currencyReqIcon.rectTransform.pivot      = 0.5f.ToVector2();
            currencyReqIcon.rectTransform.localScale = 1f.ToVector2();
            currencyLeft.text = inventory.ContainedSilver.ToString();

            // Price
            if (_formulaToggle)
            {
                slot.m_requiredMoney = GetPrice(__instance.LocalCharacter, slot);
            }

            // Currency
            if (_learnMutuallyExclusiveSkills && HasMutuallyExclusiveSkill(__instance.LocalCharacter, slot))
            {
                if (_exclusiveSkillCostsTsar)
                {
                    tree.AlternateCurrecy                    = SkillPrices._exclusiveSkillRequirement.ItemID;
                    tree.AlternateCurrencyIcon               = _exclusiveSkillRequirement.Icon;
                    currencyIcon.overrideSprite              = _exclusiveSkillRequirement.Icon;
                    currencyIcon.rectTransform.pivot         = ALTERNATE_CURRENCY_ICON_PIVOT;
                    currencyIcon.rectTransform.localScale    = ALTERNATE_CURRENCY_ICON_SCALE;
                    currencyReqIcon.rectTransform.pivot      = ALTERNATE_CURRENCY_ICON_PIVOT;
                    currencyReqIcon.rectTransform.localScale = ALTERNATE_CURRENCY_ICON_SCALE;
                    currencyLeft.text    = inventory.ItemCount(_exclusiveSkillRequirement.ItemID).ToString();
                    slot.m_requiredMoney = _exclusiveSkillRequirement.Amount;
                }
                else
                {
                    slot.m_requiredMoney = (slot.m_requiredMoney * _exclusiveSkillCostMultiplier / 100f).Round();
                }
            }

            return(true);
        }
Пример #7
0
        // Token: 0x06000019 RID: 25 RVA: 0x000030BC File Offset: 0x000012BC
        public static void SetupSkillTree(ref SkillSchool templarTreeInstance)
        {
            SL_SkillTree sl_SkillTree = new SL_SkillTree
            {
                Name      = "Templar",
                SkillRows = new List <SL_SkillRow>
                {
                    new SL_SkillRow
                    {
                        RowIndex = 1,
                        Slots    = new List <SL_BaseSkillSlot>
                        {
                            new SL_SkillSlot
                            {
                                ColumnIndex       = 1,
                                SilverCost        = 50,
                                SkillID           = 2502000,
                                Breakthrough      = false,
                                RequiredSkillSlot = Vector2.zero
                            },
                            new SL_SkillSlot
                            {
                                ColumnIndex       = 3,
                                SilverCost        = 50,
                                SkillID           = 2502026,
                                Breakthrough      = false,
                                RequiredSkillSlot = Vector2.zero
                            }
                        }
                    },
                    new SL_SkillRow
                    {
                        RowIndex = 2,
                        Slots    = new List <SL_BaseSkillSlot>()
                    },
                    new SL_SkillRow
                    {
                        RowIndex = 3,
                        Slots    = new List <SL_BaseSkillSlot>
                        {
                            new SL_SkillSlot
                            {
                                ColumnIndex       = 2,
                                SilverCost        = 500,
                                SkillID           = 2502002,
                                Breakthrough      = true,
                                RequiredSkillSlot = Vector2.zero
                            }
                        }
                    },
                    new SL_SkillRow
                    {
                        RowIndex = 4,
                        Slots    = new List <SL_BaseSkillSlot>
                        {
                            new SL_SkillSlot
                            {
                                ColumnIndex       = 2,
                                SilverCost        = 600,
                                SkillID           = 2502001,
                                Breakthrough      = false,
                                RequiredSkillSlot = new Vector2(3f, 2f)
                            },
                            new SL_SkillSlot
                            {
                                ColumnIndex       = 3,
                                SilverCost        = 600,
                                SkillID           = 2502009,
                                Breakthrough      = false,
                                RequiredSkillSlot = new Vector2(3f, 2f)
                            },
                            new SL_SkillSlot
                            {
                                ColumnIndex       = 1,
                                SilverCost        = 600,
                                SkillID           = 2502010,
                                Breakthrough      = false,
                                RequiredSkillSlot = new Vector2(3f, 2f)
                            }
                        }
                    },
                    new SL_SkillRow
                    {
                        RowIndex = 5,
                        Slots    = new List <SL_BaseSkillSlot>
                        {
                            new SL_SkillSlotFork
                            {
                                ColumnIndex       = 2,
                                RequiredSkillSlot = new Vector2(4f, 2f),
                                Choice1           = new SL_SkillSlot
                                {
                                    ColumnIndex       = 2,
                                    SilverCost        = 600,
                                    SkillID           = 2502006,
                                    RequiredSkillSlot = new Vector2(4f, 2f)
                                },
                                Choice2 = new SL_SkillSlot
                                {
                                    ColumnIndex       = 2,
                                    SilverCost        = 600,
                                    SkillID           = 2502008,
                                    RequiredSkillSlot = new Vector2(4f, 2f)
                                }
                            }
                        }
                    }
                }
            };

            templarTreeInstance = sl_SkillTree.CreateBaseSchool();
            sl_SkillTree.ApplyRows();
        }
Пример #8
0
        // Skill Tree setup, and add to SkillTreeHolder (game manager)

        private void SetupSkillTree()
        {
            var tree = new SL_SkillTree()
            {
                Name      = "Necromancy",
                SkillRows = new List <SL_SkillRow>()
                {
                    new SL_SkillRow()
                    {
                        RowIndex = 1,
                        Slots    = new List <SL_BaseSkillSlot>()
                        {
                            new SL_SkillSlot() // Summon
                            {
                                ColumnIndex       = 2,
                                SilverCost        = 50,
                                SkillID           = 8890103,
                                Breakthrough      = false,
                                RequiredSkillSlot = Vector2.zero,
                            },
                            new SL_SkillSlot() // Vital Attunement
                            {
                                ColumnIndex       = 3,
                                SilverCost        = 50,
                                SkillID           = 8890101,
                                Breakthrough      = false,
                                RequiredSkillSlot = Vector2.zero,
                            },
                        }
                    },
                    new SL_SkillRow()
                    {
                        RowIndex = 2,
                        Slots    = new List <SL_BaseSkillSlot>()
                        {
                            new SL_SkillSlot() // Life Ritual
                            {
                                ColumnIndex       = 2,
                                SkillID           = 8890105,
                                SilverCost        = 100,
                                Breakthrough      = false,
                                RequiredSkillSlot = new Vector2(1, 2), // requires Summon (row 1, slot 2)
                            },
                            new SL_SkillSlot()                         // Tendrils
                            {
                                ColumnIndex       = 3,
                                SkillID           = 8890100,
                                SilverCost        = 100,
                                Breakthrough      = false,
                                RequiredSkillSlot = new Vector2(1, 3), // requires Vital Attunement (row 1, slot 3)
                            }
                        }
                    },
                    new SL_SkillRow()
                    {
                        RowIndex = 3,
                        Slots    = new List <SL_BaseSkillSlot>() // Transcendence (Breakthrough)
                        {
                            new SL_SkillSlot()
                            {
                                Breakthrough      = true,
                                SkillID           = 8890104,
                                RequiredSkillSlot = new Vector2(2, 2), // requires Life Ritual (row 2, slot 2),
                                SilverCost        = 500,
                                ColumnIndex       = 2
                            }
                        }
                    },
                    new SL_SkillRow()
                    {
                        RowIndex = 4,
                        Slots    = new List <SL_BaseSkillSlot>() // Death Ritual
                        {
                            new SL_SkillSlot()
                            {
                                ColumnIndex       = 2,
                                RequiredSkillSlot = new Vector2(3, 2), // requires breakthrough
                                SkillID           = 8890106,
                                SilverCost        = 600,
                                Breakthrough      = false
                            }
                        }
                    },
                    new SL_SkillRow()
                    {
                        RowIndex = 5,
                        Slots    = new List <SL_BaseSkillSlot>() // fork choice
                        {
                            new SL_SkillSlotFork()
                            {
                                ColumnIndex       = 2,
                                RequiredSkillSlot = new Vector2(4, 2), // requires Death Ritual
                                Choice1           = new SL_SkillSlot() // Plague Aura
                                {
                                    ColumnIndex       = 2,
                                    Breakthrough      = false,
                                    SilverCost        = 600,
                                    SkillID           = 8890107,
                                    RequiredSkillSlot = new Vector2(4, 2), // requires Death Ritual
                                },
                                Choice2 = new SL_SkillSlot()               // Army of Death
                                {
                                    ColumnIndex       = 2,
                                    Breakthrough      = false,
                                    SilverCost        = 600,
                                    SkillID           = 8890108,
                                    RequiredSkillSlot = new Vector2(4, 2), // requires Death Ritual
                                }
                            }
                        }
                    }
                }
            };

            NecromancyTree = tree.CreateBaseSchool();

            tree.ApplyRows();

            //Debug.Log("Set up necromancy tree. Components: " + NecromancyTree.gameObject.GetComponentsInChildren<BaseSkillSlot>().Length);
        }
Пример #9
0
        // Token: 0x06000066 RID: 102 RVA: 0x00004698 File Offset: 0x00002898
        public static void SetupSkillTree(ref SkillSchool juggernautTreeInstance)
        {
            SL_SkillTree sl_SkillTree = new SL_SkillTree
            {
                Name      = "Juggernaut",
                SkillRows = new List <SL_SkillRow>
                {
                    new SL_SkillRow
                    {
                        RowIndex = 1,
                        Slots    = new List <SL_BaseSkillSlot>
                        {
                            new SL_SkillSlotFork
                            {
                                ColumnIndex       = 2,
                                RequiredSkillSlot = Vector2.zero,
                                Choice1           = new SL_SkillSlot
                                {
                                    ColumnIndex       = 2,
                                    SilverCost        = 50,
                                    SkillID           = 2502020,
                                    RequiredSkillSlot = Vector2.zero,
                                    Breakthrough      = false
                                },
                                Choice2 = new SL_SkillSlot
                                {
                                    ColumnIndex       = 2,
                                    SilverCost        = 50,
                                    SkillID           = 2502019,
                                    RequiredSkillSlot = Vector2.zero,
                                    Breakthrough      = false
                                }
                            }
                        }
                    },
                    new SL_SkillRow
                    {
                        RowIndex = 2,
                        Slots    = new List <SL_BaseSkillSlot>
                        {
                            new SL_SkillSlot
                            {
                                ColumnIndex       = 1,
                                SilverCost        = 100,
                                SkillID           = 2502017,
                                Breakthrough      = false,
                                RequiredSkillSlot = Vector2.zero
                            }
                        }
                    },
                    new SL_SkillRow
                    {
                        RowIndex = 3,
                        Slots    = new List <SL_BaseSkillSlot>
                        {
                            new SL_SkillSlot
                            {
                                ColumnIndex       = 2,
                                SilverCost        = 500,
                                SkillID           = 2502022,
                                Breakthrough      = true,
                                RequiredSkillSlot = new Vector2(1f, 2f)
                            }
                        }
                    },
                    new SL_SkillRow
                    {
                        RowIndex = 4,
                        Slots    = new List <SL_BaseSkillSlot>
                        {
                            new SL_SkillSlot
                            {
                                ColumnIndex       = 1,
                                SilverCost        = 600,
                                SkillID           = 2502021,
                                Breakthrough      = false,
                                RequiredSkillSlot = new Vector2(3f, 2f)
                            },
                            new SL_SkillSlot
                            {
                                ColumnIndex       = 3,
                                SilverCost        = 600,
                                SkillID           = 2502015,
                                Breakthrough      = false,
                                RequiredSkillSlot = new Vector2(3f, 2f)
                            }
                        }
                    },
                    new SL_SkillRow
                    {
                        RowIndex = 5,
                        Slots    = new List <SL_BaseSkillSlot>
                        {
                            new SL_SkillSlotFork
                            {
                                ColumnIndex       = 2,
                                RequiredSkillSlot = new Vector2(3f, 2f),
                                Choice1           = new SL_SkillSlot
                                {
                                    ColumnIndex       = 2,
                                    SilverCost        = 600,
                                    SkillID           = 2502025,
                                    RequiredSkillSlot = new Vector2(3f, 2f),
                                    Breakthrough      = false
                                },
                                Choice2 = new SL_SkillSlot
                                {
                                    ColumnIndex       = 2,
                                    SilverCost        = 600,
                                    SkillID           = 2502024,
                                    RequiredSkillSlot = new Vector2(3f, 2f),
                                    Breakthrough      = false
                                }
                            }
                        }
                    }
                }
            };

            juggernautTreeInstance = sl_SkillTree.CreateBaseSchool();
            sl_SkillTree.ApplyRows();
        }