Exemplo n.º 1
0
        public NPC CreateDummy(Faction faction)
        {
            var npc = DefaultMobEntry.Create();

            npc.Name       = "Dummy NPC";
            npc.Faction    = faction;
            npc.BaseHealth = 100;
            return(npc);
        }
Exemplo n.º 2
0
        public NPC CreateVendor(Faction faction)
        {
            var npc = DefaultVendorEntry.Create();

            npc.Name       = "Dummy Vendor";
            npc.Faction    = faction;
            npc.BaseHealth = 100;
            return(npc);
        }
Exemplo n.º 3
0
        public virtual NPC Summon(SpellCast cast, ref Vector3 targetLoc, NPCEntry entry)
        {
            var caster   = cast.CasterUnit;
            var duration = cast.Spell.GetDuration(cast.CasterReference);

            NPC minion;

            if (caster != null)
            {
                minion = caster.SpawnMinion(entry, ref targetLoc, duration);
            }
            else
            {
                minion = entry.Create(cast.TargetMap.DifficultyIndex);

                minion.Position        = targetLoc;
                minion.Brain.IsRunning = true;
                minion.Phase           = cast.Phase;
                cast.Map.AddObject(minion);
            }

            if (caster is Character)
            {
                minion.Level = caster.Level;
            }
            minion.Summoner = caster;
            minion.Creator  = cast.CasterReference.EntityId;
            if (caster != null)
            {
                caster.Summon = minion.EntityId;
                if (caster.HasMaster)
                {
                    minion.Master = caster.Master;
                }
            }

            return(minion);
        }
Exemplo n.º 4
0
        public virtual NPC Summon(SpellCast cast, ref Vector3 targetLoc, NPCEntry entry)
        {
            Unit casterUnit = cast.CasterUnit;
            int  duration   = cast.Spell.GetDuration(cast.CasterReference);
            NPC  npc;

            if (casterUnit != null)
            {
                npc = casterUnit.SpawnMinion(entry, ref targetLoc, duration);
            }
            else
            {
                npc                 = entry.Create(cast.TargetMap.DifficultyIndex);
                npc.Position        = targetLoc;
                npc.Brain.IsRunning = true;
                npc.Phase           = cast.Phase;
                cast.Map.AddObject((WorldObject)npc);
            }

            if (casterUnit is Character)
            {
                npc.Level = casterUnit.Level;
            }
            npc.Summoner = casterUnit;
            npc.Creator  = cast.CasterReference.EntityId;
            if (casterUnit != null)
            {
                casterUnit.Summon = npc.EntityId;
                if (casterUnit.HasMaster)
                {
                    npc.Master = casterUnit.Master;
                }
            }

            return(npc);
        }