public QuestViewModel(IQuestTemplate template, IMiniIcons miniIcons)
    {
        RequiresConnector     = AddInputConnector(ConnectorAttachMode.Top, "", Colors.Aqua);
        IsRequiredByConnector = AddOutputConnector(ConnectorAttachMode.Bottom, "", Colors.Aqua);
        LeftInputConnector    = AddInputConnector(ConnectorAttachMode.Left, "", Colors.Red);
        RightOutputConnector  = AddOutputConnector(ConnectorAttachMode.Right, "", Colors.Red);
        Entry = template.Entry;
        Name  = template.Name;

        if (template.AllowableClasses != CharacterClasses.None &&
            !miniIcons.IsAllClasses(template.AllowableClasses))
        {
            Classes = new();
            foreach (var classMiniIconViewModel in miniIcons.SupportedClasses)
            {
                if (template.AllowableClasses.HasFlag(classMiniIconViewModel.Class))
                {
                    Classes.Add(classMiniIconViewModel);
                }
            }
        }

        foreach (var icon in miniIcons.GetRaceIcons(template.AllowableRaces))
        {
            Races ??= new();
            Races.Add(icon);
        }
    }
Ejemplo n.º 2
0
 public ChainRawData(IQuestTemplate template)
 {
     Id                = template.Entry;
     PrevQuestId       = template.PrevQuestId;
     NextQuestId       = template.NextQuestId;
     ExclusiveGroup    = template.ExclusiveGroup;
     NextQuestInChain  = template.NextQuestInChain;
     BreadcrumbQuestId = template.BreadcrumbForQuestId;
 }
Ejemplo n.º 3
0
        public string GetName(SmartScriptSolutionItem item)
        {
            int entry = (int)item.Entry;

            if (entry > 0)
            {
                switch (item.SmartType)
                {
                case SmartScriptType.Creature:
                    ICreatureTemplate cr = database.GetCreatureTemplate((uint)entry);
                    return(cr == null || cr.Name == null ? "Creature " + entry : cr.Name);

                case SmartScriptType.GameObject:
                    IGameObjectTemplate g = database.GetGameObjectTemplate((uint)entry);
                    return(g == null || g.Name == null ? "GameObject " + entry : g.Name);

                case SmartScriptType.AreaTrigger:
                    return("Clientside area trigger " + entry);

                case SmartScriptType.Quest:
                    IQuestTemplate q = database.GetQuestTemplate((uint)entry);
                    return(q == null || q.Name == null ? "Quest " + entry : q.Name);

                case SmartScriptType.Spell:
                case SmartScriptType.Aura:
                    if (spellStore.HasSpell((uint)entry))
                    {
                        return(spellStore.GetName((uint)entry));
                    }
                    return((item.SmartType == SmartScriptType.Aura ? "Aura " : "Spell ") + entry);

                case SmartScriptType.TimedActionList:
                    return("Timed list " + entry);

                case SmartScriptType.AreaTriggerEntity:
                    return("Area trigger entity " + entry);

                case SmartScriptType.AreaTriggerEntityServerSide:
                    return("Serverside area trigger entity " + entry);
                }
            }

            return("Guid " + entry);
        }
Ejemplo n.º 4
0
 public Quest(IQuestTemplate questTemplate)
 {
     Entry    = questTemplate.Entry;
     Template = questTemplate;
 }