protected static void PlayerUseSlot(DOLEvent e, object sender, EventArgs args)
        {
            GamePlayer player = (GamePlayer)sender;

            // player already morphed...
            if (player.Model == ladyHinda.Model)
            {
                return;
            }

            TraitorInMularn quest = (TraitorInMularn)player.IsDoingQuest(typeof(TraitorInMularn));

            if (quest == null)
            {
                return;
            }

            if (quest.Step == 2 || quest.Step == 3)
            {
                UseSlotEventArgs uArgs = (UseSlotEventArgs)args;

                InventoryItem item = player.Inventory.GetItem((eInventorySlot)uArgs.Slot);
                if (item != null && item.Id_nb == necklaceOfDoppelganger.Id_nb)
                {
                    if (player.IsWithinRadius(hindaEnd, 2500))
                    {
                        foreach (GamePlayer visPlayer in player.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
                        {
                            visPlayer.Out.SendSpellCastAnimation(player, 1, 20);
                        }

                        player.Model = ladyHinda.Model;                                                  // morph to fairie
                        SendSystemMessage(player, "You change into a new form!");
                        new RegionTimer(player, new RegionTimerCallback(quest.ResetPlayerModel), 60000); // call after 10 minutes

                        if (!ladyHinda.IsAlive || ladyHinda.ObjectState != GameObject.eObjectState.Active)
                        {
                            ladyHinda.X       = hindaStart.X;
                            ladyHinda.Y       = hindaStart.Y;
                            ladyHinda.Z       = hindaStart.Z;
                            ladyHinda.Heading = hindaStart.Heading;
                            ladyHinda.AddToWorld();
                            ladyHinda.WalkTo(hindaEnd.X, hindaEnd.Y, hindaEnd.Z, ladyHinda.MaxSpeed);
                        }

                        quest.Step = 3;
                    }
                }
            }
        }
        private void Zephyr(GamePlayer target)
        {
            if (!target.IsAlive || target.ObjectState != GameLiving.eObjectState.Active)
            {
                return;
            }
            GameNPC npc = new GameNPC();

            m_npc = npc;

            npc.Realm         = Caster.Realm;
            npc.Heading       = Caster.Heading;
            npc.Model         = 1269;
            npc.Y             = Caster.Y;
            npc.X             = Caster.X;
            npc.Z             = Caster.Z;
            npc.Name          = "Forceful Zephyr";
            npc.MaxSpeedBase  = 400;
            npc.Level         = 55;
            npc.CurrentRegion = Caster.CurrentRegion;
            npc.Flags        |= GameNPC.eFlags.PEACE;
            npc.Flags        |= GameNPC.eFlags.DONTSHOWNAME;
            npc.Flags        |= GameNPC.eFlags.CANTTARGET;
            BlankBrain brain = new BlankBrain();

            npc.SetOwnBrain(brain);
            npc.AddToWorld();
            npc.TempProperties.setProperty("target", target);
            GameEventMgr.AddHandler(npc, GameNPCEvent.ArriveAtTarget, new DOLEventHandler(ArriveAtTarget));
            npc.Follow(target, 10, 1500);

            m_target = target;

            StartTimer();
        }
Example #3
0
        public override void OnEffectStart(GameSpellEffect effect)
        {
            base.OnEffectStart(effect);
            m_effect = effect;
            if (effect.Owner == null || !effect.Owner.IsAlive)
            {
                return;
            }

            if ((effect.Owner is GamePlayer))
            {
                GamePlayer casterPlayer = effect.Owner as GamePlayer;
                if (casterPlayer.GroundTarget != null && casterPlayer.GroundTargetInView)
                {
                    GameEventMgr.AddHandler(casterPlayer, GamePlayerEvent.Moving, new DOLEventHandler(PlayerMoves));
                    GameEventMgr.AddHandler(warder, GameLivingEvent.Dying, new DOLEventHandler(BattleWarderDie));
                    GameEventMgr.AddHandler(casterPlayer, GamePlayerEvent.CastStarting, new DOLEventHandler(PlayerMoves));
                    GameEventMgr.AddHandler(casterPlayer, GamePlayerEvent.AttackFinished, new DOLEventHandler(PlayerMoves));
                    warder.X = casterPlayer.GroundTarget.X;
                    warder.Y = casterPlayer.GroundTarget.Y;
                    warder.Z = casterPlayer.GroundTarget.Z;
                    warder.AddBrain(new MLBrain());
                    warder.AddToWorld();
                }
                else
                {
                    MessageToCaster("Your area target is out of range.  Set a closer ground position.", eChatType.CT_SpellResisted);
                    effect.Cancel(false);
                }
            }
        }
        public static GameNPC GetAddrir()
        {
            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>("Addrir", eRealm.Hibernia);

            GameNPC addrir = null;

            if (npcs.Length == 0)
            {
                addrir       = new GameNPC();
                addrir.Model = 335;
                addrir.Name  = "Addrir";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + addrir.Name + ", creating him ...");
                }

                addrir.GuildName       = "Part of Addrir Quests";
                addrir.Realm           = eRealm.Hibernia;
                addrir.CurrentRegionID = 200;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 58, 35);
                template.AddNPCEquipment(eInventorySlot.Cloak, 57, 32);
                template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 1173);
                addrir.Inventory = template.CloseTemplate();
                addrir.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

// addrir.AddNPCEquipment((byte) eVisibleItems.TORSO, 58, 35, 0, 0);
//              addrir.AddNPCEquipment((byte) eVisibleItems.CLOAK, 57, 32, 0, 0);
//              addrir.AddNPCEquipment((byte) eVisibleItems.RIGHT_HAND, 1173, 0, 0, 0);
                addrir.Size    = 50;
                addrir.Level   = 50;
                addrir.X       = GameLocation.ConvertLocalXToGlobalX(26955, 200);
                addrir.Y       = GameLocation.ConvertLocalYToGlobalY(7789, 200);
                addrir.Z       = 5196;
                addrir.Heading = 22;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                addrir.SetOwnBrain(brain);

                // You don't have to store the created mob in the db if you don't want,
                // it will be recreated each time it is not found, just comment the following
                // line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                {
                    addrir.SaveIntoDatabase();
                }

                addrir.AddToWorld();
            }
            else
            {
                addrir = npcs[0];
            }

            return(addrir);
        }
        public void AddRemoveObjects()
        {
            const int count = 30000;

            GameNPC[] mobs = new GameNPC[count];

            Console.Out.WriteLine("[{0}] init {1} mobs", id, count);

            // init mobs
            for (int i = 0; i < count; i++)
            {
                GameNPC mob = mobs[i] = new GameNPC();
                Assert.IsTrue(mob.ObjectID == -1, "mob {0} oid={1}, should be -1", i, mob.ObjectID);
                Assert.IsFalse(mob.ObjectState == GameObject.eObjectState.Active, "mob {0} state={1}, should be not Active", i, mob.ObjectState);
                mob.Name          = "test mob " + i;
                mob.CurrentRegion = m_reg;
                m_reg.PreAllocateRegionSpace(1953);
            }

            for (int x = 10; x > 0; x--)
            {
                Console.Out.WriteLine("[{0}] loop {1} add mobs", id, count - x);

                // add mobs
                for (int i = 0; i <= count - x; i++)
                {
// Console.Out.WriteLine("add "+i);
                    GameNPC mob = mobs[i];
                    Assert.IsTrue(mob.AddToWorld(), "failed to add {0} to the world", mob.Name);
                    Assert.IsTrue(mob.ObjectID > 0 && mob.ObjectID <= DOL.GS.ServerProperties.Properties.REGION_MAX_OBJECTS, "{0} oid={1}", mob.Name, mob.ObjectID);
                }

                for (int i = count - x; i >= 0; i--)
                {
// Console.Out.WriteLine("check "+i);
                    GameNPC mob    = mobs[i];
                    GameNPC regMob = (GameNPC)m_reg.GetObject((ushort)mob.ObjectID);
                    Assert.AreSame(mob, regMob, "expected to read '{0}' oid={1} but read '{2}' oid={3}", mob.Name, mob.ObjectID, regMob == null ? "null" : regMob.Name, regMob == null ? "null" : regMob.ObjectID.ToString());
                }

                Console.Out.WriteLine("[{0}] loop {1} remove mobs", id, count - x);

                // remove mobs
                for (int i = count - x; i >= 0; i--)
                {
// Console.Out.WriteLine("remove "+i);
                    GameNPC mob = mobs[i];
                    int     oid = mob.ObjectID;
                    Assert.IsTrue(mob.RemoveFromWorld(), "failed to remove {0}", mob.Name);
                    Assert.IsTrue(mob.ObjectID == -1, "{0}: oid is not -1 (oid={1})", mob.Name, mob.ObjectID);
                    Assert.IsFalse(mob.ObjectState == GameObject.eObjectState.Active, "{0} is still active after remove", mob.Name);
                    GameNPC regMob = (GameNPC)m_reg.GetObject((ushort)oid);
                    Assert.IsNull(regMob, "{0} was removed from the region but oid {1} is still used by {2}", mob.Name, oid, regMob == null ? "null" : regMob.Name);
                }
            }
        }
Example #6
0
        /// <summary>
        /// Summon the pet
        /// </summary>
        protected virtual void SummonPet()
        {
            if (PetTemplate != null && PetLevel != 0 && m_pet == null)
            {
                m_pet = new GameNPC(PetTemplate);
                if (m_pet != null)
                {
                    m_pet.CurrentRegion = CurrentRegion;

                    // Summon pet to the left or right of the summoner
                    ushort sideHeading = (ushort)(Heading + 900);
                    if (Util.Random(1) < 1)
                    {
                        sideHeading += 1800;
                    }
                    Point2D point = GetPointFromHeading(sideHeading, PetSummonDistance);
                    m_pet.X = point.X;
                    m_pet.Y = point.Y;
                    m_pet.Z = Z;

                    m_pet.Heading          = Heading;
                    m_pet.Realm            = eRealm.None;
                    m_pet.LoadedFromScript = true;
                    m_pet.MaxDistance      = PetMaxDistance;
                    m_pet.TetherRange      = PetTetherRange;
                    m_pet.RespawnInterval  = -1;
                    m_pet.IsWorthReward    = false;

                    if (PetSize > 0)
                    {
                        m_pet.Size = PetSize;
                    }

                    if (PetLevel > 0)
                    {
                        m_pet.Level = PetLevel;
                    }
                    else
                    {
                        m_pet.Level = (byte)(Level * PetLevel / -100);
                    }

                    m_pet.AutoSetStats();

                    if (m_pet.Brain is StandardMobBrain petBrain && Brain is StandardMobBrain brain && TargetObject is GameLiving living)
                    {
                        petBrain.CanBAF = false;
                        brain.AddAggroListTo(petBrain);
                    }

                    m_pet.AddToWorld();

                    m_resummonTime = CurrentRegion.Time + PetResummonTime;
                }
            }
        }
Example #7
0
        public override void Notify(DOLEvent e, object sender, EventArgs args)
        {
            GamePlayer player = sender as GamePlayer;

            if (player == null || player.IsDoingQuest(typeof(HuntForSlith)) == null)
            {
                return;
            }

            if (e == GameLivingEvent.EnemyKilled)
            {
                EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args;
                if (Step == 1)
                {
                    if (gArgs.Target.Name == "slith broodling")
                    {
                        if (Util.Chance(25))
                        {
                            if (slith == null)
                            {
                                slith                 = new GameNPC();
                                slith.Model           = 31;
                                slith.Name            = "Slith";
                                slith.Realm           = eRealm.None;
                                slith.CurrentRegionID = 1;

                                slith.Size    = 50;
                                slith.Level   = 7;
                                slith.X       = 524840;
                                slith.Y       = 490529;
                                slith.Z       = 2545;
                                slith.Heading = 2082;

                                StandardMobBrain brain = new StandardMobBrain();  // set a brain witch find a lot mob friend to attack the player
                                slith.SetOwnBrain(brain);

                                slith.RespawnInterval = 0; // don't respawn when killed

                                slith.AddToWorld();
                            }
                        }
                    }
                    else if (gArgs.Target.Name == "Slith")
                    {
                        GiveItem(gArgs.Target, player, slithsTail);
                        if (slith != null)
                        {
                            slith = null;
                        }
                        FinishQuest();
                    }
                }
            }
        }
Example #8
0
        public override void Notify(DOLEvent e, object sender, EventArgs args)
        {
            GamePlayer player = sender as GamePlayer;

            if (player == null || player.IsDoingQuest(typeof(ClericMulgrut)) == null)
            {
                return;
            }

            if (e == GameLivingEvent.EnemyKilled)
            {
                EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args;
                if (Step == 1)
                {
                    if (gArgs.Target.Name == "puny skeleton")
                    {
                        if (Util.Chance(25))
                        {
                            if (mulgrutMaggot == null)
                            {
                                mulgrutMaggot                 = new GameNPC();
                                mulgrutMaggot.Model           = 467;
                                mulgrutMaggot.Name            = "Mulgrut Maggot";
                                mulgrutMaggot.Realm           = eRealm.None;
                                mulgrutMaggot.CurrentRegionID = 1;

                                mulgrutMaggot.Size    = 60;
                                mulgrutMaggot.Level   = 5;
                                mulgrutMaggot.X       = 565941;
                                mulgrutMaggot.Y       = 528121;
                                mulgrutMaggot.Z       = 2152;
                                mulgrutMaggot.Heading = 2278;

                                StandardMobBrain brain = new StandardMobBrain();  // set a brain witch find a lot mob friend to attack the player
                                mulgrutMaggot.SetOwnBrain(brain);

                                mulgrutMaggot.RespawnInterval = 0; // don't respawn when killed

                                mulgrutMaggot.AddToWorld();
                            }
                        }
                    }
                    else if (gArgs.Target.Name == "Mulgrut Maggot")
                    {
                        GiveItem(gArgs.Target, player, beltOfAnimation);
                        if (mulgrutMaggot != null)
                        {
                            mulgrutMaggot = null;
                        }
                        FinishQuest();
                    }
                }
            }
        }
Example #9
0
        public override void ApplyEffectOnTarget(GameLiving target, double effectiveness)
        {
            var template = NpcTemplateMgr.GetTemplate((int)Spell.Value);

            base.ApplyEffectOnTarget(target, effectiveness);

            if (template.ClassType == "")
            {
                Npc = new GameNPC();
            }
            else
            {
                try
                {
                    Npc = new GameNPC();
                    Npc = (GameNPC)Assembly.GetAssembly(typeof(GameServer)).CreateInstance(template.ClassType, false);
                }
                catch (Exception e)
                {
                }
                if (Npc == null)
                {
                    try
                    {
                        Npc = (GameNPC)Assembly.GetExecutingAssembly().CreateInstance(template.ClassType, false);
                    }
                    catch (Exception e)
                    {
                    }
                }
                if (Npc == null)
                {
                    MessageToCaster("There was an error creating an instance of " + template.ClassType + "!",
                                    eChatType.CT_System);
                    return;
                }
                Npc.LoadTemplate(template);
            }

            int x, y;

            Caster.GetSpotFromHeading(64, out x, out y);
            Npc.X             = x;
            Npc.Y             = y;
            Npc.Z             = Caster.Z;
            Npc.CurrentRegion = Caster.CurrentRegion;
            Npc.Heading       = (ushort)((Caster.Heading + 2048) % 4096);
            Npc.Realm         = Caster.Realm;
            Npc.CurrentSpeed  = 0;
            Npc.Level         = Caster.Level;
            Npc.Name          = Caster.Name + " Buffbot " + "";
            Npc.SetOwnBrain(new BlankBrain());
            Npc.AddToWorld();
        }
        public static void OnScriptsCompiled(DOLEvent e, object sender, EventArgs args)
        {
            // What npctemplate should we use for the zonepoint ?
            NpcTemplate zp;

            try {
                var model = (ushort)ServerProperties.Properties.ZONEPOINT_NPCTEMPLATE;
                zp = new NpcTemplate(GameServer.Database.SelectObjects <DBNpcTemplate>("`TemplateId` = @TemplateId", new QueryParameter("@TemplateId", model)).FirstOrDefault());
                if (model <= 0)
                {
                    throw new ArgumentNullException();
                }
            }
            catch {
                return;
            }

            // processing all the ZP
            IList <ZonePoint> zonePoints = GameServer.Database.SelectAllObjects <ZonePoint>();

            foreach (ZonePoint z in zonePoints)
            {
                if (z.SourceRegion == 0)
                {
                    continue;
                }

                // find target region for the current zonepoint
                Region r = WorldMgr.GetRegion(z.TargetRegion);
                if (r == null)
                {
                    log.Warn($"Zonepoint Id ({z.Id}) references an inexistent target region {z.TargetRegion} - skipping, ZP not created");
                    continue;
                }

                GameNPC npc = new GameNPC(zp)
                {
                    CurrentRegionID = z.SourceRegion,
                    X         = z.SourceX,
                    Y         = z.SourceY,
                    Z         = z.SourceZ,
                    Name      = r.Description,
                    GuildName = "ZonePoint (Open)"
                };

                if (r.IsDisabled)
                {
                    npc.GuildName = "ZonePoint (Closed)";
                }

                npc.AddToWorld();
            }
        }
        public override void ApplyEffectOnTarget(GameLiving target, double effectiveness)
        {
            NpcTemplate template = NpcTemplateMgr.GetTemplate((int)m_spell.Value);

            base.ApplyEffectOnTarget(target, effectiveness);

            if (template.ClassType == "")
            {
                npc = new GameNPC();
            }
            else
            {
                try
                {
                    npc = new GameNPC();
                    npc = (GameNPC)Assembly.GetAssembly(typeof(GameServer)).CreateInstance(template.ClassType, false);
                }
                catch (Exception e)
                {
                }
                if (npc == null)
                {
                    try
                    {
                        npc = (GameNPC)Assembly.GetExecutingAssembly().CreateInstance(template.ClassType, false);
                    }
                    catch (Exception e)
                    {
                    }
                }
                if (npc == null)
                {
                    MessageToCaster("There was an error creating an instance of " + template.ClassType + "!", DOL.GS.PacketHandler.eChatType.CT_System);
                    return;
                }
                npc.LoadTemplate(template);
            }
            GameSpellEffect effect = CreateSpellEffect(npc, effectiveness);
            int             x, y;

            m_caster.GetSpotFromHeading(64, out x, out y);
            npc.X             = x;
            npc.Y             = y;
            npc.Z             = m_caster.Z;
            npc.CurrentRegion = m_caster.CurrentRegion;
            npc.Heading       = (ushort)((m_caster.Heading + 2048) % 4096);
            npc.Realm         = m_caster.Realm;
            npc.CurrentSpeed  = 0;
            npc.Level         = 1;
            npc.SetOwnBrain(new AI.Brain.BlankBrain());
            npc.AddToWorld();
            effect.Start(npc);
        }
Example #12
0
        /// <summary>
        /// Apply effect on target or do spell action if non duration spell
        /// </summary>
        /// <param name="target">target that gets the effect</param>
        /// <param name="effectiveness">factor from 0..1 (0%-100%)</param>
        public override void ApplyEffectOnTarget(GameLiving target, double effectiveness)
        {
            if (!(Caster is GamePlayer player))
            {
                return;
            }

            INpcTemplate template = NpcTemplateMgr.GetTemplate(Spell.LifeDrainReturn);

            if (template == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn($"NPC template {Spell.LifeDrainReturn} not found! Spell: {Spell}");
                }

                MessageToCaster($"NPC template {Spell.LifeDrainReturn} not found!", eChatType.CT_System);
                return;
            }

            GameSpellEffect effect          = CreateSpellEffect(target, effectiveness);
            TitanBrain      controlledBrain = new TitanBrain(player)
            {
                IsMainPet = false,
                WalkState = eWalkState.Stay
            };

            summoned = new GameNPC(template);
            summoned.SetOwnBrain(controlledBrain);

            // Suncheck:
            //  Is needed, else it can cause error (i.e. /cast-command)
            if (x == 0 || y == 0)
            {
                CheckCastLocation();
            }

            summoned.X             = x;
            summoned.Y             = y;
            summoned.Z             = z;
            summoned.CurrentRegion = player.CurrentRegion;
            summoned.Heading       = (ushort)((player.Heading + 2048) % 4096);
            summoned.Realm         = player.Realm;
            summoned.CurrentSpeed  = 0;
            summoned.Size          = 10;
            summoned.Level         = 100;
            summoned.Flags        |= GameNPC.eFlags.PEACE;
            summoned.AddToWorld();
            controlledBrain.AggressionState = eAggressionState.Aggressive;
            effect.Start(summoned);
            m_growTimer = new RegionTimer(Caster, new RegionTimerCallback(TitanGrows), C_GROWTIMER);
        }
Example #13
0
        public static void OnScriptsCompiled(DOLEvent e, object sender, EventArgs args)
        {
            // What npctemplate should we use for the zonepoint ?
            ushort      model;
            NpcTemplate zp;

            try{
                model = (ushort)ServerProperties.Properties.ZONEPOINT_NPCTEMPLATE;
                zp    = new NpcTemplate(GameServer.Database.SelectObject <DBNpcTemplate>("TemplateId =" + model.ToString()));
                if (model <= 0 || zp == null)
                {
                    throw new ArgumentNullException();
                }
            }
            catch {
                return;
            }

            // processing all the ZP
            IList <ZonePoint> zonePoints = GameServer.Database.SelectAllObjects <ZonePoint>();

            foreach (ZonePoint z in zonePoints)
            {
                if (z.SourceRegion == 0)
                {
                    continue;
                }

                // find target region for the current zonepoint
                Region r = WorldMgr.GetRegion(z.TargetRegion);
                if (r == null)
                {
                    log.Warn("Zonepoint Id (" + z.Id + ") references an inexistent target region " + z.TargetRegion + " - skipping, ZP not created");
                    continue;
                }

                GameNPC npc = new GameNPC(zp);

                npc.CurrentRegionID = z.SourceRegion;
                npc.X         = z.SourceX;
                npc.Y         = z.SourceY;
                npc.Z         = z.SourceZ;
                npc.Name      = r.Description;
                npc.GuildName = "ZonePoint (Open)";
                if (r.IsDisabled)
                {
                    npc.GuildName = "ZonePoint (Closed)";
                }

                npc.AddToWorld();
            }
        }
Example #14
0
        public override void Notify(DOLEvent e, object sender, EventArgs args)
        {
            GamePlayer player = sender as GamePlayer;

            if (player == null || player.IsDoingQuest(typeof(RevengeTheOtherWhiteMeat)) == null)
            {
                return;
            }


            if (e == GameLivingEvent.EnemyKilled)
            {
                if (Step == 2)
                {
                    EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args;
                    if (gArgs.Target.Name == "Wilbur")
                    {
                        player.Out.SendDialogBox(eDialogCode.SimpleWarning, 0x00, 0x00, 0x00, 0x00, eDialogType.Ok, true, "You've succeeded in killing Wilbur. In the \ndistance you hear the angry voice of \na pig herder. Make your escape!");
                        Step = 3;

                        player.GainExperience(GameLiving.eXPSource.Quest, player.ExperienceForNextLevel / 25, true);

                        GameNPC pigHerderWyatt = new GameNPC();
                        pigHerderWyatt.Model           = 39;
                        pigHerderWyatt.Name            = "Pig Herder Wyatt";
                        pigHerderWyatt.Realm           = eRealm.Albion;
                        pigHerderWyatt.CurrentRegionID = 1;

                        GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                        template.AddNPCEquipment(eInventorySlot.FeetArmor, 143);
                        template.AddNPCEquipment(eInventorySlot.TorsoArmor, 1005);
                        pigHerderWyatt.Inventory = template.CloseTemplate();
                        pigHerderWyatt.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                        pigHerderWyatt.Size    = 54;
                        pigHerderWyatt.Level   = 33;
                        pigHerderWyatt.X       = wilburSpawnLocation.X - 1000;
                        pigHerderWyatt.Y       = wilburSpawnLocation.Y + 1500;
                        pigHerderWyatt.Z       = wilburSpawnLocation.Z;
                        pigHerderWyatt.Heading = 2548;
                        pigHerderWyatt.AddToWorld();

                        GameEventMgr.AddHandler(pigHerderWyatt, GameNPCEvent.ArriveAtTarget, new DOLEventHandler(OnCloseToDeadWilbur));
                        pigHerderWyatt.WalkTo(gArgs.Target.X - 90, gArgs.Target.Y + 90, gArgs.Target.Z, 200);

                        return;
                    }
                }
            }
        }
Example #15
0
        /// <summary>
        /// Apply effect on target or do spell action if non duration spell
        /// </summary>
        /// <param name="target">target that gets the effect</param>
        /// <param name="effectiveness">factor from 0..1 (0%-100%)</param>
        public override void ApplyEffectOnTarget(GameLiving target, double effectiveness)
        {
            GamePlayer player = Caster as GamePlayer;

            if (player == null)
            {
                return;
            }

            INpcTemplate template = NpcTemplateMgr.GetTemplate(Spell.LifeDrainReturn);

            if (template == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.WarnFormat("NPC template {0} not found! Spell: {1}", Spell.LifeDrainReturn, Spell.ToString());
                }
                MessageToCaster("NPC template " + Spell.LifeDrainReturn + " not found!", eChatType.CT_System);
                return;
            }

            Point2D summonloc;

            beffect = CreateSpellEffect(target, effectiveness);
            {
                summonloc = target.GetPointFromHeading(target.Heading, 64);

                BrittleBrain controlledBrain = new BrittleBrain(player);
                controlledBrain.IsMainPet = false;
                summoned = new GameNPC(template);
                summoned.SetOwnBrain(controlledBrain);
                summoned.X             = summonloc.X;
                summoned.Y             = summonloc.Y;
                summoned.Z             = target.Z;
                summoned.CurrentRegion = target.CurrentRegion;
                summoned.Heading       = (ushort)((target.Heading + 2048) % 4096);
                summoned.Realm         = target.Realm;
                summoned.CurrentSpeed  = 0;
                summoned.Level         = 1;
                summoned.Size          = 10;
                summoned.AddToWorld();
                controlledBrain.AggressionState = eAggressionState.Passive;
                GameEventMgr.AddHandler(summoned, GameLivingEvent.Dying, new DOLEventHandler(GuardDie));
                beffect.Start(Caster);
            }
        }
Example #16
0
		public void AddObject()
		{
			Region region = WorldMgr.GetRegion(1);
			GameObject obj = new GameNPC();
			obj.Name="TestObject";
			obj.X = 400000;
			obj.Y = 200000;
			obj.Z = 2000;
			obj.CurrentRegion = region;

			obj.AddToWorld();

			if (obj.ObjectID<0)
				Assert.Fail("Failed to add object to Region. ObjectId < 0");

			Assert.AreEqual(region.GetObject((ushort)obj.ObjectID),obj);
		}
Example #17
0
        public static bool LockRelic()
        {
            //make sure the relic exists before you lock it!
            if (Relic == null)
            {
                return(false);
            }

            LockedEffect                 = new GameNPC();
            LockedEffect.Model           = 1583;
            LockedEffect.Name            = "LOCKED_RELIC";
            LockedEffect.Position        = Relic.Position;
            LockedEffect.Heading         = Relic.Heading;
            LockedEffect.CurrentRegionID = Relic.CurrentRegionID;
            LockedEffect.Flags           = GameNPC.eFlags.CANTTARGET;
            LockedEffect.AddToWorld();

            return(true);
        }
Example #18
0
        public static bool LockRelic()
        {
            //make sure the relic exists before you lock it!
            if (Relic == null)
                return false;

            LockedEffect = new GameNPC();
            LockedEffect.Model = 1583;
            LockedEffect.Name = "LOCKED_RELIC";
            LockedEffect.X = Relic.X;
            LockedEffect.Y = Relic.Y;
            LockedEffect.Z = Relic.Z;
            LockedEffect.Heading = Relic.Heading;
            LockedEffect.CurrentRegionID = Relic.CurrentRegionID;
            LockedEffect.Flags = GameNPC.eFlags.CANTTARGET;
            LockedEffect.AddToWorld();

            return true;
        }
Example #19
0
        /// <summary>
        /// Apply effect on target or do spell action if non duration spell
        /// </summary>
        /// <param name="target">target that gets the effect</param>
        /// <param name="effectiveness">factor from 0..1 (0%-100%)</param>
        public override void ApplyEffectOnTarget(GameLiving target, double effectiveness)
        {
            if (!(Caster is GamePlayer player))
            {
                return;
            }

            INpcTemplate template = NpcTemplateMgr.GetTemplate(Spell.LifeDrainReturn);

            if (template == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn($"NPC template {Spell.LifeDrainReturn} not found! Spell: {Spell}");
                }

                MessageToCaster($"NPC template {Spell.LifeDrainReturn} not found!", eChatType.CT_System);
                return;
            }

            beffect = CreateSpellEffect(target, effectiveness);
            {
                var summonloc = target.GetPointFromHeading(target.Heading, 64);

                BrittleBrain controlledBrain = new BrittleBrain(player);
                controlledBrain.IsMainPet = false;
                summoned = new GameNPC(template);
                summoned.SetOwnBrain(controlledBrain);
                summoned.X             = summonloc.X;
                summoned.Y             = summonloc.Y;
                summoned.Z             = target.Z;
                summoned.CurrentRegion = target.CurrentRegion;
                summoned.Heading       = (ushort)((target.Heading + 2048) % 4096);
                summoned.Realm         = target.Realm;
                summoned.CurrentSpeed  = 0;
                summoned.Level         = Caster.Level;
                summoned.Size          = 50;
                summoned.AddToWorld();
                controlledBrain.AggressionState = eAggressionState.Passive;
                beffect.Start(Caster);
            }
        }
Example #20
0
		public static void OnScriptsCompiled(DOLEvent e, object sender, EventArgs args)
		{

			// What npctemplate should we use for the zonepoint ?
			ushort model;
			NpcTemplate zp;
			try{
				model = (ushort)ServerProperties.Properties.ZONEPOINT_NPCTEMPLATE;
				zp = new NpcTemplate(GameServer.Database.SelectObjects<DBNpcTemplate>("`TemplateId` = @TemplateId", new QueryParameter("@TemplateId", model)).FirstOrDefault());
				if (model <= 0 || zp == null) throw new ArgumentNullException();
			}
			catch {
				return;
			}
			
			// processing all the ZP
			IList<ZonePoint> zonePoints = GameServer.Database.SelectAllObjects<ZonePoint>();
			foreach (ZonePoint z in zonePoints)
			{
				if (z.SourceRegion == 0) continue;
				
				// find target region for the current zonepoint
				Region r = WorldMgr.GetRegion(z.TargetRegion);
				if (r == null)
				{
					log.Warn("Zonepoint Id (" + z.Id +  ") references an inexistent target region " + z.TargetRegion + " - skipping, ZP not created");
					continue;
				}
				
				GameNPC npc = new GameNPC(zp);

				npc.CurrentRegionID = z.SourceRegion;
				npc.X = z.SourceX;
				npc.Y = z.SourceY;
				npc.Z = z.SourceZ;
				npc.Name = r.Description;
				npc.GuildName = "ZonePoint (Open)";			
				if (r.IsDisabled) npc.GuildName = "ZonePoint (Closed)";
				
				npc.AddToWorld();
			}
		}
Example #21
0
        /// <summary>
        /// Create an add from the specified template.
        /// </summary>
        /// <param name="templateID"></param>
        /// <param name="level"></param>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="uptime"></param>
        /// <returns></returns>
        protected GameNPC SpawnTimedAdd(int templateID, int level, int x, int y, int uptime, bool isRetriever)
        {
            GameNPC add = null;

            try
            {
                if (m_addTemplate == null || m_addTemplate.TemplateId != templateID)
                {
                    m_addTemplate = NpcTemplateMgr.GetTemplate(templateID);
                }

                // Create add from template.
                // The add will automatically despawn after 30 seconds.
                if (m_addTemplate != null)
                {
                    add = new GameNPC(m_addTemplate);

                    if (isRetriever)
                    {
                        add.SetOwnBrain(new RetrieverMobBrain());
                    }

                    add.CurrentRegion   = CurrentRegion;
                    add.Heading         = (ushort)Util.Random(0, 4095);
                    add.Realm           = 0;
                    add.X               = x;
                    add.Y               = y;
                    add.Z               = Z;
                    add.CurrentSpeed    = 0;
                    add.Level           = (byte)level;
                    add.RespawnInterval = -1;
                    add.AddToWorld();
                    new DespawnTimer(this, add, uptime * 1000);
                }
            }
            catch
            {
                log.Warn(string.Format("Unable to get template for {0}", Name));
            }

            return(add);
        }
Example #22
0
        protected virtual void CreateAskefruer()
        {
            askefruer                 = new GameNPC();
            askefruer.Model           = 678;
            askefruer.Name            = "Fallen Askefruer";
            askefruer.GuildName       = "Part of " + questTitle + " Quest";
            askefruer.Realm           = eRealm.None;
            askefruer.CurrentRegionID = askefruerLocation.RegionID;
            askefruer.Size            = 50;
            askefruer.Level           = 4;
            askefruer.Position        = askefruerLocation.Position + new Vector3(Util.Random(-150, 150), Util.Random(-150, 150), 0);
            askefruer.Heading         = askefruerLocation.Heading;

            StandardMobBrain brain = new StandardMobBrain();

            brain.AggroLevel = 20;
            brain.AggroRange = 200;
            askefruer.SetOwnBrain(brain);

            askefruer.AddToWorld();
        }
Example #23
0
        protected virtual void CreateSluagh()
        {
            sluagh                 = new GameNPC();
            sluagh.Model           = 603;
            sluagh.Name            = "Sluagh Footsoldier";
            sluagh.GuildName       = "Part of " + questTitle + " Quest";
            sluagh.Realm           = eRealm.None;
            sluagh.CurrentRegionID = 200;
            sluagh.Size            = 50;
            sluagh.Level           = 4;
            sluagh.Position        = sluaghLocation.Position + new Vector3(Util.Random(-150, 150), Util.Random(-150, 150), 0);
            sluagh.Heading         = sluaghLocation.Heading;

            StandardMobBrain brain = new StandardMobBrain();

            brain.AggroLevel = 20;
            brain.AggroRange = 200;
            sluagh.SetOwnBrain(brain);

            sluagh.AddToWorld();
        }
Example #24
0
        /// <summary>
        /// Apply effect on target or do spell action if non duration spell
        /// </summary>
        /// <param name="target">target that gets the effect</param>
        /// <param name="effectiveness">factor from 0..1 (0%-100%)</param>
        public override void ApplyEffectOnTarget(GameLiving target, double effectiveness)
        {
            GamePlayer player = Caster as GamePlayer;

            if (player == null)
            {
                return;
            }

            INpcTemplate template = NpcTemplateMgr.GetTemplate(Spell.LifeDrainReturn);

            if (template == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.WarnFormat("NPC template {0} not found! Spell: {1}", Spell.LifeDrainReturn, Spell.ToString());
                }
                MessageToCaster("NPC template " + Spell.LifeDrainReturn + " not found!", eChatType.CT_System);
                return;
            }

            beffect = CreateSpellEffect(target, effectiveness);
            var summonloc = GameMath.GetPointFromHeading(target, 64);

            BrittleBrain controlledBrain = new BrittleBrain(player);

            controlledBrain.IsMainPet = false;
            summoned = new GameNPC(template);
            summoned.SetOwnBrain(controlledBrain);
            summoned.Position      = new Vector3(summonloc, target.Position.Z);
            summoned.CurrentRegion = target.CurrentRegion;
            summoned.Heading       = (ushort)((target.Heading + 2048) % 4096);
            summoned.Realm         = target.Realm;
            summoned.CurrentSpeed  = 0;
            summoned.Level         = Caster.Level;
            summoned.Size          = 50;
            summoned.AddToWorld();
            controlledBrain.AggressionState = eAggressionState.Passive;
            beffect.Start(Caster);
        }
Example #25
0
        /// <summary>
        /// Override Add To World to Spawn Teleporters in Circle
        /// And start Timer.
        /// </summary>
        /// <returns></returns>
        public override bool AddToWorld()
        {
            if (!base.AddToWorld())
            {
                return(false);
            }

            // Add the Item Pad
            m_worldObject.X       = X;
            m_worldObject.Y       = Y;
            m_worldObject.Z       = Z;
            m_worldObject.Heading = Heading;
            m_worldObject.Model   = PortalWorldObjectModel;
            m_worldObject.AddToWorld();

            // Add the teleporters
            NpcTemplate teleporters = NpcTemplateMgr.GetTemplate(PortalTeleportersTemplateID);
            ushort      divisor     = (ushort)(4096 / PortalTeleporterCount);

            for (int cnt = 0; cnt < PortalTeleporterCount; cnt++)
            {
                GameNPC teleporter = new GameNPC(teleporters);
                var     tgt        = GameMath.GetPointFromHeading(Position, (ushort)((Heading + (cnt * divisor)) % 4096), PortalCeremonyRange);
                teleporter.X             = tgt.X;
                teleporter.Y             = tgt.Y;
                teleporter.Z             = Z;
                teleporter.CurrentRegion = CurrentRegion;
                teleporter.Heading       = (ushort)((Heading + (cnt * divisor) + 2048) % 4096);
                m_teleporters.Add(teleporter);
                teleporter.AddToWorld();
            }

            // Start Timer.
            m_teleportTimer          = new RegionTimer(this);
            m_teleportTimer.Callback = new RegionTimerCallback(TeleportTimerCallback);
            m_teleportTimer.Start((int)(PortalTeleportInterval >> 4));

            return(true);
        }
        public static void OnScriptsCompiled(DOLEvent e, object sender, EventArgs args)
        {
            // What npctemplate should we use for the zonepoint ?
            ushort model;
            NpcTemplate zp;
            try
            {
                model = (ushort)ServerProperties.Properties.ZONEPOINT_NPCTEMPLATE;
                zp = new NpcTemplate(GameServer.Database.SelectObject<DBNpcTemplate>("TemplateId =" + model.ToString()));
                if (model <= 0 || zp == null) throw new ArgumentNullException();
            }
            catch
            {
                return;
            }

            // processing all the ZP
            IList<ZonePoint> zonePoints = GameServer.Database.SelectAllObjects<ZonePoint>();
            foreach (ZonePoint z in zonePoints)
            {
                if (z.SourceRegion == 0)
                    continue;
                //find region
                Region r = WorldMgr.GetRegion(z.TargetRegion);
                GameNPC npc = new GameNPC(zp);

                npc.CurrentRegionID = z.SourceRegion;
                npc.X = z.SourceX;
                npc.Y = z.SourceY;
                npc.Z = z.SourceZ;

                npc.Name = r.Description;
                if (r.IsDisabled)
                    npc.GuildName = "ZonePoint (Closed)";
                else npc.GuildName = "ZonePoint (Open)";
                npc.AddToWorld();
            }
        }
Example #27
0
        public static bool LockRelic()
        {
            // make sure the relic exists before you lock it!
            if (Relic == null)
            {
                return(false);
            }

            LockedEffect = new GameNPC
            {
                Model           = 1583,
                Name            = "LOCKED_RELIC",
                X               = Relic.X,
                Y               = Relic.Y,
                Z               = Relic.Z,
                Heading         = Relic.Heading,
                CurrentRegionID = Relic.CurrentRegionID,
                Flags           = eFlags.CANTTARGET
            };
            LockedEffect.AddToWorld();

            return(true);
        }
Example #28
0
        protected virtual void CreateFairy()
        {
            ireFairy                 = new GameNPC();
            ireFairy.Model           = 603;
            ireFairy.Name            = "Ire Fairy";
            ireFairy.GuildName       = "Part of " + questTitle + " Quest";
            ireFairy.Realm           = eRealm.None;
            ireFairy.CurrentRegionID = 1;
            ireFairy.Size            = 50;
            ireFairy.Level           = 4;
            ireFairy.X               = GameLocation.ConvertLocalXToGlobalX(12336, 0) + Util.Random(-150, 150);
            ireFairy.Y               = GameLocation.ConvertLocalYToGlobalY(22623, 0) + Util.Random(-150, 150);
            ireFairy.Z               = 2405;
            ireFairy.Heading         = 226;

            StandardMobBrain brain = new StandardMobBrain();

            brain.AggroLevel = 20;
            brain.AggroRange = 200;
            ireFairy.SetOwnBrain(brain);

            ireFairy.AddToWorld();
        }
Example #29
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            /* First thing we do in here is to search for the NPCs inside
            * the world who comes from the certain Realm. If we find a the players,
            * this means we don't have to create a new one.
            *
            * NOTE: You can do anything you want in this method, you don't have
            * to search for NPC's ... you could create a custom item, place it
            * on the ground and if a player picks it up, he will get the quest!
            * Just examples, do anything you like and feel comfortable with :)
            */

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Laridia the Minstrel", eRealm.Albion);

            /* Whops, if the npcs array length is 0 then no npc exists in
                * this users Mob Database, so we simply create one ;-)
                * else we take the existing one. And if more than one exist, we take
                * the first ...
                */
            if (npcs.Length == 0)
            {
                laridiaTheMinstrel = new GameNPC();
                laridiaTheMinstrel.Model = 38;
                laridiaTheMinstrel.Name = "Laridia the Minstrel";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + laridiaTheMinstrel.Name + ", creating him ...");
                laridiaTheMinstrel.GuildName = "Part of " + questTitle + " Quest";
                laridiaTheMinstrel.Realm = eRealm.Albion;
                laridiaTheMinstrel.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 137, 9);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 138, 9);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 134, 9);
                template.AddNPCEquipment(eInventorySlot.Cloak, 96, 72);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 140, 43);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 141, 43);
                laridiaTheMinstrel.Inventory = template.CloseTemplate();
                laridiaTheMinstrel.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                laridiaTheMinstrel.Size = 49;
                laridiaTheMinstrel.Level = 25;
                laridiaTheMinstrel.X = 562280;
                laridiaTheMinstrel.Y = 512243;
                laridiaTheMinstrel.Z = 2448 ;
                laridiaTheMinstrel.Heading = 3049;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                if (SAVE_INTO_DATABASE)
                    laridiaTheMinstrel.SaveIntoDatabase();

                laridiaTheMinstrel.AddToWorld();
            }
            else
                laridiaTheMinstrel = npcs[0];

            npcs = WorldMgr.GetNPCsByName("Farmer Asma", eRealm.Albion);
            if (npcs.Length == 0)
            {
                farmerAsma = new GameNPC();
                farmerAsma.Model = 82;
                farmerAsma.Name = "Farmer Asma";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + farmerAsma.Name + ", creating him ...");
                farmerAsma.GuildName = "Part of " + questTitle + " Quest";
                farmerAsma.Realm = eRealm.Albion;
                farmerAsma.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 31);
                template.AddNPCEquipment(eInventorySlot.Cloak, 57);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 32);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 33);
                farmerAsma.Inventory = template.CloseTemplate();
                farmerAsma.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                farmerAsma.Size = 50;
                farmerAsma.Level = 35;
                farmerAsma.X = 563939;
                farmerAsma.Y = 509234;
                farmerAsma.Z = 2744 ;
                farmerAsma.Heading = 21;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    farmerAsma.SaveIntoDatabase();

                farmerAsma.AddToWorld();
            }
            else
                farmerAsma = npcs[0];

            #endregion

            /* Now we add some hooks to the npc we found.
            * Actually, we want to know when a player interacts with him.
            * So, we hook the right-click (interact) and the whisper method
            * of npc and set the callback method to the "TalkToXXX"
            * method. This means, the "TalkToXXX" method is called whenever
            * a player right clicks on him or when he whispers to him.
            */

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            GameEventMgr.AddHandler(laridiaTheMinstrel, GameLivingEvent.Interact, new DOLEventHandler(TalkToLaridiaTheMinstrel));
            GameEventMgr.AddHandler(laridiaTheMinstrel, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToLaridiaTheMinstrel));

            GameEventMgr.AddHandler(farmerAsma, GameObjectEvent.Interact, new DOLEventHandler(TalkToFarmerAsma));
            GameEventMgr.AddHandler(farmerAsma, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToFarmerAsma));

            /* Now we bring to Ydenia the possibility to give this quest to players */
            laridiaTheMinstrel.AddQuestToGive(typeof (AgainstTheGrain));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Example #30
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");

            #region NPC Declarations

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Brigit", eRealm.Hibernia);

            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Brigit , creating it ...");
                Brigit = new GameNPC();
                Brigit.Model = 384;
                Brigit.Name = "Brigit";
                Brigit.GuildName = "";
                Brigit.Realm = eRealm.Hibernia;
                Brigit.CurrentRegionID = 201;
                Brigit.Size = 51;
                Brigit.Level = 50;
                Brigit.X = 33131;
                Brigit.Y = 32922;
                Brigit.Z = 8008;
                Brigit.Heading = 3254;
                Brigit.AddToWorld();
                if (SAVE_INTO_DATABASE)
                {
                    Brigit.SaveIntoDatabase();
                }

            }
            else
                Brigit = npcs[0];
            // end npc

            npcs = WorldMgr.GetNPCsByName("Caithor", eRealm.None);

            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Caithor , creating it ...");
                Caithor = new GameNPC();
                Caithor.Model = 339;
                Caithor.Name = "Caithor";
                Caithor.GuildName = "";
                Caithor.Realm = eRealm.None;
                Caithor.CurrentRegionID = 200;
                Caithor.Size = 60;
                Caithor.Level = 65;
                Caithor.X = 470547;
                Caithor.Y = 531497;
                Caithor.Z = 4984;
                Caithor.Heading = 3319;
                Caithor.AddToWorld();
                if (SAVE_INTO_DATABASE)
                {
                    Caithor.SaveIntoDatabase();
                }

            }
            else
                Caithor = npcs[0];
            // end npc

            #endregion

            #region Item Declarations

            Moonstone = GameServer.Database.FindObjectByKey<ItemTemplate>("Moonstone");
            if (Moonstone == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Moonstone , creating it ...");
                Moonstone = new ItemTemplate();
                Moonstone.Id_nb = "Moonstone";
                Moonstone.Name = "Moonstone";
                Moonstone.Level = 8;
                Moonstone.Item_Type = 29;
                Moonstone.Model = 514;
                Moonstone.IsDropable = false;
                Moonstone.IsPickable = false;
                Moonstone.DPS_AF = 0;
                Moonstone.SPD_ABS = 0;
                Moonstone.Object_Type = 41;
                Moonstone.Hand = 0;
                Moonstone.Type_Damage = 0;
                Moonstone.Quality = 100;
                Moonstone.Weight = 12;
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(Moonstone);
                }

            }
            // end item
            BardEpicBoots = GameServer.Database.FindObjectByKey<ItemTemplate>("BardEpicBoots");
            if (BardEpicBoots == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Bards Epic Boots , creating it ...");
                BardEpicBoots = new ItemTemplate();
                BardEpicBoots.Id_nb = "BardEpicBoots";
                BardEpicBoots.Name = "Moonsung Boots";
                BardEpicBoots.Level = 50;
                BardEpicBoots.Item_Type = 23;
                BardEpicBoots.Model = 738;
                BardEpicBoots.IsDropable = true;
                BardEpicBoots.IsPickable = true;
                BardEpicBoots.DPS_AF = 100;
                BardEpicBoots.SPD_ABS = 19;
                BardEpicBoots.Object_Type = 37;
                BardEpicBoots.Quality = 100;
                BardEpicBoots.Weight = 22;
                BardEpicBoots.Bonus = 35;
                BardEpicBoots.MaxCondition = 50000;
                BardEpicBoots.MaxDurability = 50000;
                BardEpicBoots.Condition = 50000;
                BardEpicBoots.Durability = 50000;

                BardEpicBoots.Bonus1 = 15;
                BardEpicBoots.Bonus1Type = (int) eStat.QUI;

                BardEpicBoots.Bonus2 = 10;
                BardEpicBoots.Bonus2Type = (int) eResist.Matter;

                BardEpicBoots.Bonus3 = 4;
                BardEpicBoots.Bonus3Type = (int) eProperty.PowerRegenerationRate;

                BardEpicBoots.Bonus4 = 33;
                BardEpicBoots.Bonus4Type = (int) eProperty.MaxHealth;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(BardEpicBoots);
                }

            }
            //end item
            //Moonsung Coif
            BardEpicHelm = GameServer.Database.FindObjectByKey<ItemTemplate>("BardEpicHelm");
            if (BardEpicHelm == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Bards Epic Helm , creating it ...");
                BardEpicHelm = new ItemTemplate();
                BardEpicHelm.Id_nb = "BardEpicHelm";
                BardEpicHelm.Name = "Moonsung Coif";
                BardEpicHelm.Level = 50;
                BardEpicHelm.Item_Type = 21;
                BardEpicHelm.Model = 1292; //NEED TO WORK ON..
                BardEpicHelm.IsDropable = true;
                BardEpicHelm.IsPickable = true;
                BardEpicHelm.DPS_AF = 100;
                BardEpicHelm.SPD_ABS = 19;
                BardEpicHelm.Object_Type = 37;
                BardEpicHelm.Quality = 100;
                BardEpicHelm.Weight = 22;
                BardEpicHelm.Bonus = 35;
                BardEpicHelm.MaxCondition = 50000;
                BardEpicHelm.MaxDurability = 50000;
                BardEpicHelm.Condition = 50000;
                BardEpicHelm.Durability = 50000;

                BardEpicHelm.Bonus1 = 18;
                BardEpicHelm.Bonus1Type = (int) eStat.CHR;

                BardEpicHelm.Bonus2 = 4;
                BardEpicHelm.Bonus2Type = (int) eProperty.PowerRegenerationRate;

                BardEpicHelm.Bonus3 = 3;
                BardEpicHelm.Bonus3Type = (int) eProperty.Skill_Regrowth;

                BardEpicHelm.Bonus4 = 21;
                BardEpicHelm.Bonus4Type = (int) eProperty.MaxHealth;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(BardEpicHelm);
                }

            }
            //end item
            //Moonsung Gloves
            BardEpicGloves = GameServer.Database.FindObjectByKey<ItemTemplate>("BardEpicGloves");
            if (BardEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Bards Epic Gloves , creating it ...");
                BardEpicGloves = new ItemTemplate();
                BardEpicGloves.Id_nb = "BardEpicGloves";
                BardEpicGloves.Name = "Moonsung Gloves ";
                BardEpicGloves.Level = 50;
                BardEpicGloves.Item_Type = 22;
                BardEpicGloves.Model = 737;
                BardEpicGloves.IsDropable = true;
                BardEpicGloves.IsPickable = true;
                BardEpicGloves.DPS_AF = 100;
                BardEpicGloves.SPD_ABS = 19;
                BardEpicGloves.Object_Type = 37;
                BardEpicGloves.Quality = 100;
                BardEpicGloves.Weight = 22;
                BardEpicGloves.Bonus = 35;
                BardEpicGloves.MaxCondition = 50000;
                BardEpicGloves.MaxDurability = 50000;
                BardEpicGloves.Condition = 50000;
                BardEpicGloves.Durability = 50000;

                BardEpicGloves.Bonus1 = 3;
                BardEpicGloves.Bonus1Type = (int) eProperty.Skill_Nurture;

                BardEpicGloves.Bonus2 = 3;
                BardEpicGloves.Bonus2Type = (int) eProperty.Skill_Music;

                BardEpicGloves.Bonus3 = 12;
                BardEpicGloves.Bonus3Type = (int) eStat.DEX;

                BardEpicGloves.Bonus4 = 33;
                BardEpicGloves.Bonus4Type = (int) eProperty.MaxHealth;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(BardEpicGloves);
                }

            }
            //Moonsung Hauberk
            BardEpicVest = GameServer.Database.FindObjectByKey<ItemTemplate>("BardEpicVest");
            if (BardEpicVest == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Bards Epic Vest , creating it ...");
                BardEpicVest = new ItemTemplate();
                BardEpicVest.Id_nb = "BardEpicVest";
                BardEpicVest.Name = "Moonsung Hauberk";
                BardEpicVest.Level = 50;
                BardEpicVest.Item_Type = 25;
                BardEpicVest.Model = 734;
                BardEpicVest.IsDropable = true;
                BardEpicVest.IsPickable = true;
                BardEpicVest.DPS_AF = 100;
                BardEpicVest.SPD_ABS = 19;
                BardEpicVest.Object_Type = 37;
                BardEpicVest.Quality = 100;
                BardEpicVest.Weight = 22;
                BardEpicVest.Bonus = 35;
                BardEpicVest.MaxCondition = 50000;
                BardEpicVest.MaxDurability = 50000;
                BardEpicVest.Condition = 50000;
                BardEpicVest.Durability = 50000;

                BardEpicVest.Bonus1 = 3;
                BardEpicVest.Bonus1Type = (int) eProperty.Skill_Regrowth;

                BardEpicVest.Bonus2 = 3;
                BardEpicVest.Bonus2Type = (int) eProperty.Skill_Nurture;

                BardEpicVest.Bonus3 = 13;
                BardEpicVest.Bonus3Type = (int) eStat.CON;

                BardEpicVest.Bonus4 = 15;
                BardEpicVest.Bonus4Type = (int) eStat.CHR;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(BardEpicVest);
                }

            }
            //Moonsung Legs
            BardEpicLegs = GameServer.Database.FindObjectByKey<ItemTemplate>("BardEpicLegs");
            if (BardEpicLegs == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Bards Epic Legs , creating it ...");
                BardEpicLegs = new ItemTemplate();
                BardEpicLegs.Id_nb = "BardEpicLegs";
                BardEpicLegs.Name = "Moonsung Legs";
                BardEpicLegs.Level = 50;
                BardEpicLegs.Item_Type = 27;
                BardEpicLegs.Model = 735;
                BardEpicLegs.IsDropable = true;
                BardEpicLegs.IsPickable = true;
                BardEpicLegs.DPS_AF = 100;
                BardEpicLegs.SPD_ABS = 19;
                BardEpicLegs.Object_Type = 37;
                BardEpicLegs.Quality = 100;
                BardEpicLegs.Weight = 22;
                BardEpicLegs.Bonus = 35;
                BardEpicLegs.MaxCondition = 50000;
                BardEpicLegs.MaxDurability = 50000;
                BardEpicLegs.Condition = 50000;
                BardEpicLegs.Durability = 50000;

                BardEpicLegs.Bonus1 = 16;
                BardEpicLegs.Bonus1Type = (int) eStat.CON;

                BardEpicLegs.Bonus2 = 15;
                BardEpicLegs.Bonus2Type = (int) eStat.DEX;

                BardEpicLegs.Bonus3 = 10;
                BardEpicLegs.Bonus3Type = (int) eResist.Body;

                BardEpicLegs.Bonus4 = 10;
                BardEpicLegs.Bonus4Type = (int) eResist.Matter;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(BardEpicLegs);
                }

            }
            //Moonsung Sleeves
            BardEpicArms = GameServer.Database.FindObjectByKey<ItemTemplate>("BardEpicArms");
            if (BardEpicArms == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Bard Epic Arms , creating it ...");
                BardEpicArms = new ItemTemplate();
                BardEpicArms.Id_nb = "BardEpicArms";
                BardEpicArms.Name = "Moonsung Sleeves";
                BardEpicArms.Level = 50;
                BardEpicArms.Item_Type = 28;
                BardEpicArms.Model = 736;
                BardEpicArms.IsDropable = true;
                BardEpicArms.IsPickable = true;
                BardEpicArms.DPS_AF = 100;
                BardEpicArms.SPD_ABS = 19;
                BardEpicArms.Object_Type = 37;
                BardEpicArms.Quality = 100;
                BardEpicArms.Weight = 22;
                BardEpicArms.Bonus = 35;
                BardEpicArms.MaxCondition = 50000;
                BardEpicArms.MaxDurability = 50000;
                BardEpicArms.Condition = 50000;
                BardEpicArms.Durability = 50000;

                BardEpicArms.Bonus1 = 15;
                BardEpicArms.Bonus1Type = (int) eStat.STR;

                BardEpicArms.Bonus2 = 12;
                BardEpicArms.Bonus2Type = (int) eStat.CHR;

                BardEpicArms.Bonus3 = 10;
                BardEpicArms.Bonus3Type = (int) eStat.CON;

                BardEpicArms.Bonus4 = 12;
                BardEpicArms.Bonus4Type = (int) eResist.Energy;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(BardEpicArms);
                }

            }
            //Champion Epic Sleeves End
            ChampionEpicBoots = GameServer.Database.FindObjectByKey<ItemTemplate>("ChampionEpicBoots");
            if (ChampionEpicBoots == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Champions Epic Boots , creating it ...");
                ChampionEpicBoots = new ItemTemplate();
                ChampionEpicBoots.Id_nb = "ChampionEpicBoots";
                ChampionEpicBoots.Name = "Moonglow Boots";
                ChampionEpicBoots.Level = 50;
                ChampionEpicBoots.Item_Type = 23;
                ChampionEpicBoots.Model = 814;
                ChampionEpicBoots.IsDropable = true;
                ChampionEpicBoots.IsPickable = true;
                ChampionEpicBoots.DPS_AF = 100;
                ChampionEpicBoots.SPD_ABS = 27;
                ChampionEpicBoots.Object_Type = 38;
                ChampionEpicBoots.Quality = 100;
                ChampionEpicBoots.Weight = 22;
                ChampionEpicBoots.Bonus = 35;
                ChampionEpicBoots.MaxCondition = 50000;
                ChampionEpicBoots.MaxDurability = 50000;
                ChampionEpicBoots.Condition = 50000;
                ChampionEpicBoots.Durability = 50000;

                ChampionEpicBoots.Bonus1 = 33;
                ChampionEpicBoots.Bonus1Type = (int) eProperty.MaxHealth;

                ChampionEpicBoots.Bonus2 = 10;
                ChampionEpicBoots.Bonus2Type = (int) eResist.Heat;

                ChampionEpicBoots.Bonus3 = 10;
                ChampionEpicBoots.Bonus3Type = (int) eResist.Matter;

                ChampionEpicBoots.Bonus4 = 15;
                ChampionEpicBoots.Bonus4Type = (int) eStat.DEX;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ChampionEpicBoots);
                }

            }
            //end item
            //Moonglow Coif
            ChampionEpicHelm = GameServer.Database.FindObjectByKey<ItemTemplate>("ChampionEpicHelm");
            if (ChampionEpicHelm == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Champions Epic Helm , creating it ...");
                ChampionEpicHelm = new ItemTemplate();
                ChampionEpicHelm.Id_nb = "ChampionEpicHelm";
                ChampionEpicHelm.Name = "Moonglow Coif";
                ChampionEpicHelm.Level = 50;
                ChampionEpicHelm.Item_Type = 21;
                ChampionEpicHelm.Model = 1292; //NEED TO WORK ON..
                ChampionEpicHelm.IsDropable = true;
                ChampionEpicHelm.IsPickable = true;
                ChampionEpicHelm.DPS_AF = 100;
                ChampionEpicHelm.SPD_ABS = 27;
                ChampionEpicHelm.Object_Type = 38;
                ChampionEpicHelm.Quality = 100;
                ChampionEpicHelm.Weight = 22;
                ChampionEpicHelm.Bonus = 35;
                ChampionEpicHelm.MaxCondition = 50000;
                ChampionEpicHelm.MaxDurability = 50000;
                ChampionEpicHelm.Condition = 50000;
                ChampionEpicHelm.Durability = 50000;

                ChampionEpicHelm.Bonus1 = 3;
                ChampionEpicHelm.Bonus1Type = (int) eProperty.Skill_Valor;

                ChampionEpicHelm.Bonus2 = 12;
                ChampionEpicHelm.Bonus2Type = (int) eStat.CON;

                ChampionEpicHelm.Bonus3 = 12;
                ChampionEpicHelm.Bonus3Type = (int) eStat.QUI;

                ChampionEpicHelm.Bonus4 = 6;
                ChampionEpicHelm.Bonus4Type = (int) eProperty.PowerRegenerationRate;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ChampionEpicHelm);
                }

            }
            //end item
            //Moonglow Gloves
            ChampionEpicGloves = GameServer.Database.FindObjectByKey<ItemTemplate>("ChampionEpicGloves");
            if (ChampionEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Champions Epic Gloves , creating it ...");
                ChampionEpicGloves = new ItemTemplate();
                ChampionEpicGloves.Id_nb = "ChampionEpicGloves";
                ChampionEpicGloves.Name = "Moonglow Gloves ";
                ChampionEpicGloves.Level = 50;
                ChampionEpicGloves.Item_Type = 22;
                ChampionEpicGloves.Model = 813;
                ChampionEpicGloves.IsDropable = true;
                ChampionEpicGloves.IsPickable = true;
                ChampionEpicGloves.DPS_AF = 100;
                ChampionEpicGloves.SPD_ABS = 27;
                ChampionEpicGloves.Object_Type = 38;
                ChampionEpicGloves.Quality = 100;
                ChampionEpicGloves.Weight = 22;
                ChampionEpicGloves.Bonus = 35;
                ChampionEpicGloves.MaxCondition = 50000;
                ChampionEpicGloves.MaxDurability = 50000;
                ChampionEpicGloves.Condition = 50000;
                ChampionEpicGloves.Durability = 50000;

                ChampionEpicGloves.Bonus1 = 3;
                ChampionEpicGloves.Bonus1Type = (int) eProperty.Skill_Parry;

                ChampionEpicGloves.Bonus2 = 15;
                ChampionEpicGloves.Bonus2Type = (int) eStat.STR;

                ChampionEpicGloves.Bonus3 = 15;
                ChampionEpicGloves.Bonus3Type = (int) eStat.QUI;

                ChampionEpicGloves.Bonus4 = 10;
                ChampionEpicGloves.Bonus4Type = (int) eResist.Crush;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ChampionEpicGloves);
                }

            }
            //Moonglow Hauberk
            ChampionEpicVest = GameServer.Database.FindObjectByKey<ItemTemplate>("ChampionEpicVest");
            if (ChampionEpicVest == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Champions Epic Vest , creating it ...");
                ChampionEpicVest = new ItemTemplate();
                ChampionEpicVest.Id_nb = "ChampionEpicVest";
                ChampionEpicVest.Name = "Moonglow Brestplate";
                ChampionEpicVest.Level = 50;
                ChampionEpicVest.Item_Type = 25;
                ChampionEpicVest.Model = 810;
                ChampionEpicVest.IsDropable = true;
                ChampionEpicVest.IsPickable = true;
                ChampionEpicVest.DPS_AF = 100;
                ChampionEpicVest.SPD_ABS = 27;
                ChampionEpicVest.Object_Type = 38;
                ChampionEpicVest.Quality = 100;
                ChampionEpicVest.Weight = 22;
                ChampionEpicVest.Bonus = 35;
                ChampionEpicVest.MaxCondition = 50000;
                ChampionEpicVest.MaxDurability = 50000;
                ChampionEpicVest.Condition = 50000;
                ChampionEpicVest.Durability = 50000;

                ChampionEpicVest.Bonus1 = 4;
                ChampionEpicVest.Bonus1Type = (int) eProperty.Skill_Valor;

                ChampionEpicVest.Bonus2 = 13;
                ChampionEpicVest.Bonus2Type = (int) eStat.STR;

                ChampionEpicVest.Bonus3 = 13;
                ChampionEpicVest.Bonus3Type = (int) eStat.QUI;

                ChampionEpicVest.Bonus4 = 10;
                ChampionEpicVest.Bonus4Type = (int) eResist.Energy;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ChampionEpicVest);
                }

            }
            //Moonglow Legs
            ChampionEpicLegs = GameServer.Database.FindObjectByKey<ItemTemplate>("ChampionEpicLegs");
            if (ChampionEpicLegs == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Champions Epic Legs , creating it ...");
                ChampionEpicLegs = new ItemTemplate();
                ChampionEpicLegs.Id_nb = "ChampionEpicLegs";
                ChampionEpicLegs.Name = "Moonglow Legs";
                ChampionEpicLegs.Level = 50;
                ChampionEpicLegs.Item_Type = 27;
                ChampionEpicLegs.Model = 811;
                ChampionEpicLegs.IsDropable = true;
                ChampionEpicLegs.IsPickable = true;
                ChampionEpicLegs.DPS_AF = 100;
                ChampionEpicLegs.SPD_ABS = 27;
                ChampionEpicLegs.Object_Type = 38;
                ChampionEpicLegs.Quality = 100;
                ChampionEpicLegs.Weight = 22;
                ChampionEpicLegs.Bonus = 35;
                ChampionEpicLegs.MaxCondition = 50000;
                ChampionEpicLegs.MaxDurability = 50000;
                ChampionEpicLegs.Condition = 50000;
                ChampionEpicLegs.Durability = 50000;

                ChampionEpicLegs.Bonus1 = 15;
                ChampionEpicLegs.Bonus1Type = (int) eStat.CON;

                ChampionEpicLegs.Bonus2 = 15;
                ChampionEpicLegs.Bonus2Type = (int) eStat.DEX;

                ChampionEpicLegs.Bonus3 = 10;
                ChampionEpicLegs.Bonus3Type = (int) eResist.Crush;

                ChampionEpicLegs.Bonus4 = 18;
                ChampionEpicLegs.Bonus4Type = (int) eProperty.MaxHealth;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ChampionEpicLegs);
                }

            }
            //Moonglow Sleeves
            ChampionEpicArms = GameServer.Database.FindObjectByKey<ItemTemplate>("ChampionEpicArms");
            if (ChampionEpicArms == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Champion Epic Arms , creating it ...");
                ChampionEpicArms = new ItemTemplate();
                ChampionEpicArms.Id_nb = "ChampionEpicArms";
                ChampionEpicArms.Name = "Moonglow Sleeves";
                ChampionEpicArms.Level = 50;
                ChampionEpicArms.Item_Type = 28;
                ChampionEpicArms.Model = 812;
                ChampionEpicArms.IsDropable = true;
                ChampionEpicArms.IsPickable = true;
                ChampionEpicArms.DPS_AF = 100;
                ChampionEpicArms.SPD_ABS = 27;
                ChampionEpicArms.Object_Type = 38;
                ChampionEpicArms.Quality = 100;
                ChampionEpicArms.Weight = 22;
                ChampionEpicArms.Bonus = 35;
                ChampionEpicArms.MaxCondition = 50000;
                ChampionEpicArms.MaxDurability = 50000;
                ChampionEpicArms.Condition = 50000;
                ChampionEpicArms.Durability = 50000;

                ChampionEpicArms.Bonus1 = 3;
                ChampionEpicArms.Bonus1Type = (int) eProperty.Skill_Large_Weapon;

                ChampionEpicArms.Bonus2 = 10;
                ChampionEpicArms.Bonus2Type = (int) eStat.STR;

                ChampionEpicArms.Bonus3 = 10;
                ChampionEpicArms.Bonus3Type = (int) eStat.QUI;

                ChampionEpicArms.Bonus4 = 33;
                ChampionEpicArms.Bonus4Type = (int) eProperty.MaxHealth;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ChampionEpicArms);
                }

            }
            NightshadeEpicBoots = GameServer.Database.FindObjectByKey<ItemTemplate>("NightshadeEpicBoots");
            if (NightshadeEpicBoots == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Nightshade Epic Boots , creating it ...");
                NightshadeEpicBoots = new ItemTemplate();
                NightshadeEpicBoots.Id_nb = "NightshadeEpicBoots";
                NightshadeEpicBoots.Name = "Moonlit Boots";
                NightshadeEpicBoots.Level = 50;
                NightshadeEpicBoots.Item_Type = 23;
                NightshadeEpicBoots.Model = 750;
                NightshadeEpicBoots.IsDropable = true;
                NightshadeEpicBoots.IsPickable = true;
                NightshadeEpicBoots.DPS_AF = 100;
                NightshadeEpicBoots.SPD_ABS = 10;
                NightshadeEpicBoots.Object_Type = 33;
                NightshadeEpicBoots.Quality = 100;
                NightshadeEpicBoots.Weight = 22;
                NightshadeEpicBoots.Bonus = 35;
                NightshadeEpicBoots.MaxCondition = 50000;
                NightshadeEpicBoots.MaxDurability = 50000;
                NightshadeEpicBoots.Condition = 50000;
                NightshadeEpicBoots.Durability = 50000;

                NightshadeEpicBoots.Bonus1 = 12;
                NightshadeEpicBoots.Bonus1Type = (int) eStat.STR;

                NightshadeEpicBoots.Bonus2 = 15;
                NightshadeEpicBoots.Bonus2Type = (int) eStat.DEX;

                NightshadeEpicBoots.Bonus3 = 10;
                NightshadeEpicBoots.Bonus3Type = (int) eResist.Thrust;

                NightshadeEpicBoots.Bonus4 = 24;
                NightshadeEpicBoots.Bonus4Type = (int) eProperty.MaxHealth;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(NightshadeEpicBoots);
                }

            }
            //end item
            //Moonlit Coif
            NightshadeEpicHelm = GameServer.Database.FindObjectByKey<ItemTemplate>("NightshadeEpicHelm");
            if (NightshadeEpicHelm == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Nightshade Epic Helm , creating it ...");
                NightshadeEpicHelm = new ItemTemplate();
                NightshadeEpicHelm.Id_nb = "NightshadeEpicHelm";
                NightshadeEpicHelm.Name = "Moonlit Helm";
                NightshadeEpicHelm.Level = 50;
                NightshadeEpicHelm.Item_Type = 21;
                NightshadeEpicHelm.Model = 1292; //NEED TO WORK ON..
                NightshadeEpicHelm.IsDropable = true;
                NightshadeEpicHelm.IsPickable = true;
                NightshadeEpicHelm.DPS_AF = 100;
                NightshadeEpicHelm.SPD_ABS = 10;
                NightshadeEpicHelm.Object_Type = 33;
                NightshadeEpicHelm.Quality = 100;
                NightshadeEpicHelm.Weight = 22;
                NightshadeEpicHelm.Bonus = 35;
                NightshadeEpicHelm.MaxCondition = 50000;
                NightshadeEpicHelm.MaxDurability = 50000;
                NightshadeEpicHelm.Condition = 50000;
                NightshadeEpicHelm.Durability = 50000;

                NightshadeEpicHelm.Bonus1 = 9;
                NightshadeEpicHelm.Bonus1Type = (int) eStat.STR;

                NightshadeEpicHelm.Bonus2 = 9;
                NightshadeEpicHelm.Bonus2Type = (int) eStat.DEX;

                NightshadeEpicHelm.Bonus3 = 9;
                NightshadeEpicHelm.Bonus3Type = (int) eStat.QUI;

                NightshadeEpicHelm.Bonus4 = 39;
                NightshadeEpicHelm.Bonus4Type = (int) eProperty.MaxHealth;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(NightshadeEpicHelm);
                }

            }
            //end item
            //Moonlit Gloves
            NightshadeEpicGloves = GameServer.Database.FindObjectByKey<ItemTemplate>("NightshadeEpicGloves");
            if (NightshadeEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Nightshade Epic Gloves , creating it ...");
                NightshadeEpicGloves = new ItemTemplate();
                NightshadeEpicGloves.Id_nb = "NightshadeEpicGloves";
                NightshadeEpicGloves.Name = "Moonlit Gloves ";
                NightshadeEpicGloves.Level = 50;
                NightshadeEpicGloves.Item_Type = 22;
                NightshadeEpicGloves.Model = 749;
                NightshadeEpicGloves.IsDropable = true;
                NightshadeEpicGloves.IsPickable = true;
                NightshadeEpicGloves.DPS_AF = 100;
                NightshadeEpicGloves.SPD_ABS = 10;
                NightshadeEpicGloves.Object_Type = 33;
                NightshadeEpicGloves.Quality = 100;
                NightshadeEpicGloves.Weight = 22;
                NightshadeEpicGloves.Bonus = 35;
                NightshadeEpicGloves.MaxCondition = 50000;
                NightshadeEpicGloves.MaxDurability = 50000;
                NightshadeEpicGloves.Condition = 50000;
                NightshadeEpicGloves.Durability = 50000;

                NightshadeEpicGloves.Bonus1 = 2;
                NightshadeEpicGloves.Bonus1Type = (int) eProperty.Skill_Critical_Strike;

                NightshadeEpicGloves.Bonus2 = 12;
                NightshadeEpicGloves.Bonus2Type = (int) eStat.DEX;

                NightshadeEpicGloves.Bonus3 = 13;
                NightshadeEpicGloves.Bonus3Type = (int) eStat.QUI;

                NightshadeEpicGloves.Bonus4 = 5;
                NightshadeEpicGloves.Bonus4Type = (int) eProperty.Skill_Envenom;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(NightshadeEpicGloves);
                }

            }
            //Moonlit Hauberk
            NightshadeEpicVest = GameServer.Database.FindObjectByKey<ItemTemplate>("NightshadeEpicVest");
            if (NightshadeEpicVest == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Nightshade Epic Vest , creating it ...");
                NightshadeEpicVest = new ItemTemplate();
                NightshadeEpicVest.Id_nb = "NightshadeEpicVest";
                NightshadeEpicVest.Name = "Moonlit Leather Jerking";
                NightshadeEpicVest.Level = 50;
                NightshadeEpicVest.Item_Type = 25;
                NightshadeEpicVest.Model = 746;
                NightshadeEpicVest.IsDropable = true;
                NightshadeEpicVest.IsPickable = true;
                NightshadeEpicVest.DPS_AF = 100;
                NightshadeEpicVest.SPD_ABS = 10;
                NightshadeEpicVest.Object_Type = 33;
                NightshadeEpicVest.Quality = 100;
                NightshadeEpicVest.Weight = 22;
                NightshadeEpicVest.Bonus = 35;
                NightshadeEpicVest.MaxCondition = 50000;
                NightshadeEpicVest.MaxDurability = 50000;
                NightshadeEpicVest.Condition = 50000;
                NightshadeEpicVest.Durability = 50000;

                NightshadeEpicVest.Bonus1 = 10;
                NightshadeEpicVest.Bonus1Type = (int) eStat.STR;

                NightshadeEpicVest.Bonus2 = 10;
                NightshadeEpicVest.Bonus2Type = (int) eStat.DEX;

                NightshadeEpicVest.Bonus3 = 30;
                NightshadeEpicVest.Bonus3Type = (int) eProperty.MaxHealth;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(NightshadeEpicVest);
                }

            }
            //Moonlit Legs
            NightshadeEpicLegs = GameServer.Database.FindObjectByKey<ItemTemplate>("NightshadeEpicLegs");
            if (NightshadeEpicLegs == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Nightshade Epic Legs , creating it ...");
                NightshadeEpicLegs = new ItemTemplate();
                NightshadeEpicLegs.Id_nb = "NightshadeEpicLegs";
                NightshadeEpicLegs.Name = "Moonlit Leggings";
                NightshadeEpicLegs.Level = 50;
                NightshadeEpicLegs.Item_Type = 27;
                NightshadeEpicLegs.Model = 747;
                NightshadeEpicLegs.IsDropable = true;
                NightshadeEpicLegs.IsPickable = true;
                NightshadeEpicLegs.DPS_AF = 100;
                NightshadeEpicLegs.SPD_ABS = 10;
                NightshadeEpicLegs.Object_Type = 33;
                NightshadeEpicLegs.Quality = 100;
                NightshadeEpicLegs.Weight = 22;
                NightshadeEpicLegs.Bonus = 35;
                NightshadeEpicLegs.MaxCondition = 50000;
                NightshadeEpicLegs.MaxDurability = 50000;
                NightshadeEpicLegs.Condition = 50000;
                NightshadeEpicLegs.Durability = 50000;

                NightshadeEpicLegs.Bonus1 = 16;
                NightshadeEpicLegs.Bonus1Type = (int) eStat.CON;

                NightshadeEpicLegs.Bonus2 = 15;
                NightshadeEpicLegs.Bonus2Type = (int) eStat.DEX;

                NightshadeEpicLegs.Bonus3 = 10;
                NightshadeEpicLegs.Bonus3Type = (int) eResist.Crush;

                NightshadeEpicLegs.Bonus4 = 10;
                NightshadeEpicLegs.Bonus4Type = (int) eResist.Slash;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(NightshadeEpicLegs);
                }

            }
            //Moonlit Sleeves
            NightshadeEpicArms = GameServer.Database.FindObjectByKey<ItemTemplate>("NightshadeEpicArms");
            if (NightshadeEpicArms == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Nightshade Epic Arms , creating it ...");
                NightshadeEpicArms = new ItemTemplate();
                NightshadeEpicArms.Id_nb = "NightshadeEpicArms";
                NightshadeEpicArms.Name = "Moonlit Sleeves";
                NightshadeEpicArms.Level = 50;
                NightshadeEpicArms.Item_Type = 28;
                NightshadeEpicArms.Model = 748;
                NightshadeEpicArms.IsDropable = true;
                NightshadeEpicArms.IsPickable = true;
                NightshadeEpicArms.DPS_AF = 100;
                NightshadeEpicArms.SPD_ABS = 10;
                NightshadeEpicArms.Object_Type = 33;
                NightshadeEpicArms.Quality = 100;
                NightshadeEpicArms.Weight = 22;
                NightshadeEpicArms.Bonus = 35;
                NightshadeEpicArms.MaxCondition = 50000;
                NightshadeEpicArms.MaxDurability = 50000;
                NightshadeEpicArms.Condition = 50000;
                NightshadeEpicArms.Durability = 50000;

                NightshadeEpicArms.Bonus1 = 4;
                NightshadeEpicArms.Bonus1Type = (int) eProperty.Skill_Celtic_Dual;

                NightshadeEpicArms.Bonus2 = 16;
                NightshadeEpicArms.Bonus2Type = (int) eStat.CON;

                NightshadeEpicArms.Bonus3 = 15;
                NightshadeEpicArms.Bonus3Type = (int) eStat.DEX;

                NightshadeEpicArms.Bonus4 = 6;
                NightshadeEpicArms.Bonus4Type = (int) eResist.Cold;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(NightshadeEpicArms);
                }

            }
            EnchanterEpicBoots = GameServer.Database.FindObjectByKey<ItemTemplate>("EnchanterEpicBoots");
            if (EnchanterEpicBoots == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Enchanter Epic Boots , creating it ...");
                EnchanterEpicBoots = new ItemTemplate();
                EnchanterEpicBoots.Id_nb = "EnchanterEpicBoots";
                EnchanterEpicBoots.Name = "Moonspun Boots";
                EnchanterEpicBoots.Level = 50;
                EnchanterEpicBoots.Item_Type = 23;
                EnchanterEpicBoots.Model = 382;
                EnchanterEpicBoots.IsDropable = true;
                EnchanterEpicBoots.IsPickable = true;
                EnchanterEpicBoots.DPS_AF = 50;
                EnchanterEpicBoots.SPD_ABS = 0;
                EnchanterEpicBoots.Object_Type = 32;
                EnchanterEpicBoots.Quality = 100;
                EnchanterEpicBoots.Weight = 22;
                EnchanterEpicBoots.Bonus = 35;
                EnchanterEpicBoots.MaxCondition = 50000;
                EnchanterEpicBoots.MaxDurability = 50000;
                EnchanterEpicBoots.Condition = 50000;
                EnchanterEpicBoots.Durability = 50000;

                EnchanterEpicBoots.Bonus1 = 12;
                EnchanterEpicBoots.Bonus1Type = (int) eStat.CON;

                EnchanterEpicBoots.Bonus2 = 12;
                EnchanterEpicBoots.Bonus2Type = (int) eStat.DEX;

                EnchanterEpicBoots.Bonus3 = 12;
                EnchanterEpicBoots.Bonus3Type = (int) eResist.Body;

                EnchanterEpicBoots.Bonus4 = 39;
                EnchanterEpicBoots.Bonus4Type = (int) eProperty.MaxHealth;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(EnchanterEpicBoots);
                }

            }
            //end item
            //Moonspun Coif
            EnchanterEpicHelm = GameServer.Database.FindObjectByKey<ItemTemplate>("EnchanterEpicHelm");
            if (EnchanterEpicHelm == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Enchanter Epic Helm , creating it ...");
                EnchanterEpicHelm = new ItemTemplate();
                EnchanterEpicHelm.Id_nb = "EnchanterEpicHelm";
                EnchanterEpicHelm.Name = "Moonspun Cap";
                EnchanterEpicHelm.Level = 50;
                EnchanterEpicHelm.Item_Type = 21;
                EnchanterEpicHelm.Model = 1298; //NEED TO WORK ON..
                EnchanterEpicHelm.IsDropable = true;
                EnchanterEpicHelm.IsPickable = true;
                EnchanterEpicHelm.DPS_AF = 50;
                EnchanterEpicHelm.SPD_ABS = 0;
                EnchanterEpicHelm.Object_Type = 32;
                EnchanterEpicHelm.Quality = 100;
                EnchanterEpicHelm.Weight = 22;
                EnchanterEpicHelm.Bonus = 35;
                EnchanterEpicHelm.MaxCondition = 50000;
                EnchanterEpicHelm.MaxDurability = 50000;
                EnchanterEpicHelm.Condition = 50000;
                EnchanterEpicHelm.Durability = 50000;

                EnchanterEpicHelm.Bonus1 = 21;
                EnchanterEpicHelm.Bonus1Type = (int) eProperty.MaxHealth;

                EnchanterEpicHelm.Bonus2 = 8;
                EnchanterEpicHelm.Bonus2Type = (int) eResist.Energy;

                EnchanterEpicHelm.Bonus3 = 4;
                EnchanterEpicHelm.Bonus3Type = (int) eProperty.Skill_Enchantments;

                EnchanterEpicHelm.Bonus4 = 18;
                EnchanterEpicHelm.Bonus4Type = (int) eStat.INT;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(EnchanterEpicHelm);
                }

            }
            //end item
            //Moonspun Gloves
            EnchanterEpicGloves = GameServer.Database.FindObjectByKey<ItemTemplate>("EnchanterEpicGloves");
            if (EnchanterEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Enchanter Epic Gloves , creating it ...");
                EnchanterEpicGloves = new ItemTemplate();
                EnchanterEpicGloves.Id_nb = "EnchanterEpicGloves";
                EnchanterEpicGloves.Name = "Moonspun Gloves ";
                EnchanterEpicGloves.Level = 50;
                EnchanterEpicGloves.Item_Type = 22;
                EnchanterEpicGloves.Model = 381;
                EnchanterEpicGloves.IsDropable = true;
                EnchanterEpicGloves.IsPickable = true;
                EnchanterEpicGloves.DPS_AF = 50;
                EnchanterEpicGloves.SPD_ABS = 0;
                EnchanterEpicGloves.Object_Type = 32;
                EnchanterEpicGloves.Quality = 100;
                EnchanterEpicGloves.Weight = 22;
                EnchanterEpicGloves.Bonus = 35;
                EnchanterEpicGloves.MaxCondition = 50000;
                EnchanterEpicGloves.MaxDurability = 50000;
                EnchanterEpicGloves.Condition = 50000;
                EnchanterEpicGloves.Durability = 50000;

                EnchanterEpicGloves.Bonus1 = 30;
                EnchanterEpicGloves.Bonus1Type = (int) eProperty.MaxHealth;

                EnchanterEpicGloves.Bonus2 = 4;
                EnchanterEpicGloves.Bonus2Type = (int) eProperty.Skill_Mana;

                EnchanterEpicGloves.Bonus3 = 6;
                EnchanterEpicGloves.Bonus3Type = (int) eStat.INT;

                EnchanterEpicGloves.Bonus4 = 13;
                EnchanterEpicGloves.Bonus4Type = (int) eStat.DEX;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(EnchanterEpicGloves);
                }

            }
            //Moonspun Hauberk
            EnchanterEpicVest = GameServer.Database.FindObjectByKey<ItemTemplate>("EnchanterEpicVest");
            if (EnchanterEpicVest == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Enchanter Epic Vest , creating it ...");
                EnchanterEpicVest = new ItemTemplate();
                EnchanterEpicVest.Id_nb = "EnchanterEpicVest";
                EnchanterEpicVest.Name = "Moonspun Vest";
                EnchanterEpicVest.Level = 50;
                EnchanterEpicVest.Item_Type = 25;
                EnchanterEpicVest.Model = 781;
                EnchanterEpicVest.IsDropable = true;
                EnchanterEpicVest.IsPickable = true;
                EnchanterEpicVest.DPS_AF = 50;
                EnchanterEpicVest.SPD_ABS = 0;
                EnchanterEpicVest.Object_Type = 32;
                EnchanterEpicVest.Quality = 100;
                EnchanterEpicVest.Weight = 22;
                EnchanterEpicVest.Bonus = 35;
                EnchanterEpicVest.MaxCondition = 50000;
                EnchanterEpicVest.MaxDurability = 50000;
                EnchanterEpicVest.Condition = 50000;
                EnchanterEpicVest.Durability = 50000;

                EnchanterEpicVest.Bonus1 = 30;
                EnchanterEpicVest.Bonus1Type = (int) eProperty.MaxHealth;

                EnchanterEpicVest.Bonus2 = 15;
                EnchanterEpicVest.Bonus2Type = (int) eStat.INT;

                EnchanterEpicVest.Bonus3 = 15;
                EnchanterEpicVest.Bonus3Type = (int) eStat.DEX;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(EnchanterEpicVest);
                }

            }
            //Moonspun Legs
            EnchanterEpicLegs = GameServer.Database.FindObjectByKey<ItemTemplate>("EnchanterEpicLegs");
            if (EnchanterEpicLegs == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Enchanter Epic Legs , creating it ...");
                EnchanterEpicLegs = new ItemTemplate();
                EnchanterEpicLegs.Id_nb = "EnchanterEpicLegs";
                EnchanterEpicLegs.Name = "Moonspun Pants";
                EnchanterEpicLegs.Level = 50;
                EnchanterEpicLegs.Item_Type = 27;
                EnchanterEpicLegs.Model = 379;
                EnchanterEpicLegs.IsDropable = true;
                EnchanterEpicLegs.IsPickable = true;
                EnchanterEpicLegs.DPS_AF = 50;
                EnchanterEpicLegs.SPD_ABS = 0;
                EnchanterEpicLegs.Object_Type = 32;
                EnchanterEpicLegs.Quality = 100;
                EnchanterEpicLegs.Weight = 22;
                EnchanterEpicLegs.Bonus = 35;
                EnchanterEpicLegs.MaxCondition = 50000;
                EnchanterEpicLegs.MaxDurability = 50000;
                EnchanterEpicLegs.Condition = 50000;
                EnchanterEpicLegs.Durability = 50000;

                EnchanterEpicLegs.Bonus1 = 16;
                EnchanterEpicLegs.Bonus1Type = (int) eStat.CON;

                EnchanterEpicLegs.Bonus2 = 15;
                EnchanterEpicLegs.Bonus2Type = (int) eStat.DEX;

                EnchanterEpicLegs.Bonus3 = 10;
                EnchanterEpicLegs.Bonus3Type = (int) eResist.Heat;

                EnchanterEpicLegs.Bonus4 = 10;
                EnchanterEpicLegs.Bonus4Type = (int) eResist.Cold;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(EnchanterEpicLegs);
                }

            }
            //Moonspun Sleeves
            EnchanterEpicArms = GameServer.Database.FindObjectByKey<ItemTemplate>("EnchanterEpicArms");
            if (EnchanterEpicArms == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Enchanter Epic Arms , creating it ...");
                EnchanterEpicArms = new ItemTemplate();
                EnchanterEpicArms.Id_nb = "EnchanterEpicArms";
                EnchanterEpicArms.Name = "Moonspun Sleeves";
                EnchanterEpicArms.Level = 50;
                EnchanterEpicArms.Item_Type = 28;
                EnchanterEpicArms.Model = 380;
                EnchanterEpicArms.IsDropable = true;
                EnchanterEpicArms.IsPickable = true;
                EnchanterEpicArms.DPS_AF = 50;
                EnchanterEpicArms.SPD_ABS = 0;
                EnchanterEpicArms.Object_Type = 32;
                EnchanterEpicArms.Quality = 100;
                EnchanterEpicArms.Weight = 22;
                EnchanterEpicArms.Bonus = 35;
                EnchanterEpicArms.MaxCondition = 50000;
                EnchanterEpicArms.MaxDurability = 50000;
                EnchanterEpicArms.Condition = 50000;
                EnchanterEpicArms.Durability = 50000;

                EnchanterEpicArms.Bonus1 = 27;
                EnchanterEpicArms.Bonus1Type = (int) eProperty.MaxHealth;

                EnchanterEpicArms.Bonus2 = 10;
                EnchanterEpicArms.Bonus2Type = (int) eStat.INT;

                EnchanterEpicArms.Bonus3 = 5;
                EnchanterEpicArms.Bonus3Type = (int) eProperty.Skill_Light;

                EnchanterEpicArms.Bonus4 = 10;
                EnchanterEpicArms.Bonus4Type = (int) eStat.DEX;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(EnchanterEpicArms);
                }

            }

            //Champion Epic Sleeves End
            //Item Descriptions End

            #endregion

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            GameEventMgr.AddHandler(Brigit, GameObjectEvent.Interact, new DOLEventHandler(TalkToBrigit));
            GameEventMgr.AddHandler(Brigit, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToBrigit));

            /* Now we bring to Brigit the possibility to give this quest to players */
            Brigit.AddQuestToGive(typeof (Essence_50));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Example #31
0
        public static GameNPC GetMasterFrederick()
        {
            GameNPC[] npcs = WorldMgr.GetNPCsByName("Master Frederick", eRealm.Albion);

            GameNPC masterFrederick = null;

            if (npcs.Length == 0)
            {
                masterFrederick = new GameNPC();
                masterFrederick.Model = 32;
                masterFrederick.Name = "Master Frederick";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + masterFrederick.Name + ", creating him ...");
                masterFrederick.GuildName = "Part of Frederick Quests";
                masterFrederick.Realm = eRealm.Albion;
                masterFrederick.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 41);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 42);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 40);
                template.AddNPCEquipment(eInventorySlot.Cloak, 91);
                template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 4);
                masterFrederick.Inventory = template.CloseTemplate();
                masterFrederick.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

            //				masterFrederick.AddNPCEquipment((byte) eVisibleItems.TORSO, 41, 0, 0, 0);
            //				masterFrederick.AddNPCEquipment((byte) eVisibleItems.LEG, 42, 0, 0, 0);
            //				masterFrederick.AddNPCEquipment((byte) eVisibleItems.BOOT, 40, 0, 0, 0);
            //				masterFrederick.AddNPCEquipment((byte) eVisibleItems.CLOAK, 91, 0, 0, 0);
            //				masterFrederick.AddNPCEquipment((byte) eVisibleItems.RIGHT_HAND, 4, 0, 0, 0);

                masterFrederick.Size = 50;
                masterFrederick.Level = 50;
                masterFrederick.X = 567969;
                masterFrederick.Y = 509880;
                masterFrederick.Z = 2861;
                masterFrederick.Heading = 65;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                masterFrederick.SetOwnBrain(brain);

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    masterFrederick.SaveIntoDatabase();

                masterFrederick.AddToWorld();
            }
            else
                masterFrederick = npcs[0];

            return masterFrederick;
        }
Example #32
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Lady Grynoch", eRealm.Albion);

            if (npcs.Length == 0)
            {
                LadyGrynoch = new GameNPC();
                LadyGrynoch.Model = 5;
                LadyGrynoch.Name = "Lady Grynoch";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + LadyGrynoch.Name + ", creating her ...");
                //k109: My preference, no guildname for quest NPCs.  Uncomment if you like that...
                //LadyGrynoch.GuildName = "Part of " + questTitle + " Quest";
                LadyGrynoch.Realm = eRealm.Albion;
                LadyGrynoch.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 58);    //Slot 25
                LadyGrynoch.Inventory = template.CloseTemplate();
                LadyGrynoch.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                LadyGrynoch.Size = 51;
                LadyGrynoch.Level = 38;
                LadyGrynoch.X = 559698;
                LadyGrynoch.Y = 513578;
                LadyGrynoch.Z = 2428;
                LadyGrynoch.Heading = 2742;

                if (SAVE_INTO_DATABASE)
                    LadyGrynoch.SaveIntoDatabase();

                LadyGrynoch.AddToWorld();
            }
            else
                LadyGrynoch = npcs[0];

            #endregion
            #region defineAreas
            Demons_Breach_Area = WorldMgr.GetRegion(Demons_Breach.RegionID).AddArea(new Area.Circle("", Demons_Breach.X, Demons_Breach.Y, Demons_Breach.Z, 200));
            Demons_Breach_Area.RegisterPlayerEnter(new DOLEventHandler(PlayerEnterDemonBreachArea));
            #endregion

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            GameEventMgr.AddHandler(LadyGrynoch, GameLivingEvent.Interact, new DOLEventHandler(TalkToLadyGrynoch));
            GameEventMgr.AddHandler(LadyGrynoch, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToLadyGrynoch));

            LadyGrynoch.AddQuestToGive(typeof(ToReachTheBreach));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Example #33
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            return;
            if (log.IsInfoEnabled)
            log.Info("Quest \"" + questTitle + "\" initializing ...");

            #region defineNPCs
            GameNPC[] npcs;

            npcs = WorldMgr.GetNPCsByName("Lycla",(eRealm) 2);
            if (npcs.Length == 0)
            {
                Lycla = new DOL.GS.GameNPC();
                    Lycla.Model = 178;
                Lycla.Name = "Lycla";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + Lycla.Name + ", creating ...");
                Lycla.GuildName = "Part of " + questTitle + " Quest";
                Lycla.Realm = eRealm.Midgard;
                Lycla.CurrentRegionID = 100;
                Lycla.Size = 48;
                Lycla.Level = 50;
                Lycla.MaxSpeedBase = 191;
                Lycla.Faction = FactionMgr.GetFactionByID(0);
                Lycla.X = 749032;
                Lycla.Y = 814613;
                Lycla.Z = 4408;
                Lycla.Heading = 170;
                Lycla.RespawnInterval = -1;
                Lycla.BodyType = 0;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 500;
                Lycla.SetOwnBrain(brain);

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    Lycla.SaveIntoDatabase();

                Lycla.AddToWorld();

            }
            else
            {
                Lycla = npcs[0];
            }

            npcs = WorldMgr.GetNPCsByName("Amora",(eRealm) 2);
            if (npcs.Length == 0)
            {
                Amora = new DOL.GS.GameNPC();
                    Amora.Model = 216;
                Amora.Name = "Amora";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + Amora.Name + ", creating ...");
                Amora.GuildName = "Part of " + questTitle + " Quest";
                Amora.Realm = eRealm.Midgard;
                Amora.CurrentRegionID = 100;
                Amora.Size = 49;
                Amora.Level = 28;
                Amora.MaxSpeedBase = 191;
                Amora.Faction = FactionMgr.GetFactionByID(0);
                Amora.X = 747714;
                Amora.Y = 814910;
                Amora.Z = 4636;
                Amora.Heading = 3456;
                Amora.RespawnInterval = -1;
                Amora.BodyType = 0;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 500;
                Amora.SetOwnBrain(brain);

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    Amora.SaveIntoDatabase();

                Amora.AddToWorld();

            }
            else
            {
                Amora = npcs[0];
            }

            npcs = WorldMgr.GetNPCsByName("Kari",(eRealm) 2);
            if (npcs.Length == 0)
            {
                Kari = new GameHealer();
                    Kari.Model = 216;
                Kari.Name = "Kari";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + Kari.Name + ", creating ...");
                Kari.GuildName = "Part of " + questTitle + " Quest";
                Kari.Realm = eRealm.Midgard;
                Kari.CurrentRegionID = 100;
                Kari.Size = 51;
                Kari.Level = 20;
                Kari.MaxSpeedBase = 191;
                Kari.Faction = FactionMgr.GetFactionByID(0);
                Kari.X = 749114;
                Kari.Y = 814019;
                Kari.Z = 4408;
                Kari.Heading = 3595;
                Kari.RespawnInterval = -1;
                Kari.BodyType = 0;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 500;
                Kari.SetOwnBrain(brain);

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    Kari.SaveIntoDatabase();

                Kari.AddToWorld();

            }
            else
            {
                Kari = npcs[0];
            }

            #endregion

            #region defineItems

            snakevenom = GameServer.Database.FindObjectByKey<ItemTemplate>("snakevenom");
            if (snakevenom == null)
            {
                snakevenom = new ItemTemplate();
                snakevenom.Name = "Snake Venom";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + snakevenom.Name + ", creating it ...");
                snakevenom.Level = 1;
                snakevenom.Weight = 1;
                snakevenom.Model = 488;
                snakevenom.Object_Type = 46;
                snakevenom.Item_Type = -1;
                snakevenom.Id_nb = "snakevenom";
                snakevenom.Hand = 0;
                snakevenom.Price = 0;
                snakevenom.IsPickable = true;
                snakevenom.IsDropable = true;
                snakevenom.IsTradable = true;
                snakevenom.CanDropAsLoot = true;
                snakevenom.Color = 0;
                snakevenom.Bonus = 0; // default bonus
                snakevenom.Bonus1 = 0;
                snakevenom.Bonus1Type = (int) 0;
                snakevenom.Bonus2 = 0;
                snakevenom.Bonus2Type = (int) 0;
                snakevenom.Bonus3 = 0;
                snakevenom.Bonus3Type = (int) 0;
                snakevenom.Bonus4 = 0;
                snakevenom.Bonus4Type = (int) 0;
                snakevenom.Bonus5 = 0;
                snakevenom.Bonus5Type = (int) 0;
                snakevenom.Bonus6 = 0;
                snakevenom.Bonus6Type = (int) 0;
                snakevenom.Bonus7 = 0;
                snakevenom.Bonus7Type = (int) 0;
                snakevenom.Bonus8 = 0;
                snakevenom.Bonus8Type = (int) 0;
                snakevenom.Bonus9 = 0;
                snakevenom.Bonus9Type = (int) 0;
                snakevenom.Bonus10 = 0;
                snakevenom.Bonus10Type = (int) 0;
                snakevenom.ExtraBonus = 0;
                snakevenom.ExtraBonusType = (int) 0;
                snakevenom.Effect = 0;
                snakevenom.Emblem = 0;
                snakevenom.Charges = 0;
                snakevenom.MaxCharges = 0;
                snakevenom.SpellID = 0;
                snakevenom.ProcSpellID = 0;
                snakevenom.Type_Damage = 0;
                snakevenom.Realm = 0;
                snakevenom.MaxCount = 1;
                snakevenom.PackSize = 1;
                snakevenom.Extension = 0;
                snakevenom.Quality = 100;
                snakevenom.Condition = 100;
                snakevenom.MaxCondition = 100;
                snakevenom.Durability = 100;
                snakevenom.MaxDurability = 100;
                snakevenom.PoisonCharges = 0;
                snakevenom.PoisonMaxCharges = 0;
                snakevenom.PoisonSpellID = 0;
                snakevenom.ProcSpellID1 = 0;
                snakevenom.SpellID1 = 0;
                snakevenom.MaxCharges1 = 0;
                snakevenom.Charges1 = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(snakevenom);
                }

            #endregion

            #region defineAreas

            #endregion

            #region defineQuestParts

            QuestBuilder builder = QuestMgr.getBuilder(typeof(Amorasaidmistyc));
            QuestBehaviour a;
            a = builder.CreateBehaviour(Lycla,-1);
                a.AddTrigger(eTriggerType.Interact,null,Lycla);
            a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc),Lycla);
            a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc),null,(eComparator)5);
            a.AddAction(eActionType.Talk,"The lady Amora here in Fort Atla has been here for several weeks because she is [unable] to travel.",Lycla);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Lycla,-1);
                a.AddTrigger(eTriggerType.Whisper,"unable",Lycla);
            a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc),Lycla);
            a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc),null,(eComparator)5);
            a.AddAction(eActionType.Talk,"Her daughter, Magnild has fallen [ill].",Lycla);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Lycla,-1);
                a.AddTrigger(eTriggerType.Whisper,"ill",Lycla);
            a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc),Lycla);
            a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc),null,(eComparator)5);
            a.AddAction(eActionType.Talk,"They have been staying in one of the homes here in town to keep the poor girl warm. Please help them, they are in great need.",Lycla);
            a.AddAction(eActionType.OfferQuest,typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc),"The Lady Amora needs your help in curing her sick daughter.");
            AddBehaviour(a);
            a = builder.CreateBehaviour(Lycla,-1);
                a.AddTrigger(eTriggerType.DeclineQuest,null,typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc));
            a.AddAction(eActionType.Talk,"No problem. See you.",Lycla);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Lycla,-1);
                a.AddTrigger(eTriggerType.AcceptQuest,null,typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc));
            a.AddAction(eActionType.GiveQuest,typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc),Lycla);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Amora,-1);
                a.AddTrigger(eTriggerType.Interact,null,Amora);
            a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc),1,(eComparator)3);
            a.AddAction(eActionType.Talk,"Be still Magnild, all will be alright soon and you will be well once again.",Amora);
            a.AddAction(eActionType.Talk,"Hello stranger, may I ask your [name]?",Amora);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Amora,-1);
                a.AddTrigger(eTriggerType.Whisper,"name",Amora);
            a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc),1,(eComparator)3);
            a.AddAction(eActionType.Talk,"It is a pleasure to meet you. I am so glad you have come to aid me and [Magnild].",Amora);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Amora,-1);
                a.AddTrigger(eTriggerType.Whisper,"Magnild",Amora);
            a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc),1,(eComparator)3);
            a.AddAction(eActionType.Talk,"Yes, my poor darling Magnild was bitten by a [water snake] while traveling into town. Unfortunately, the bite has not healed and she is not feeling very well at all.",Amora);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Amora,-1);
                a.AddTrigger(eTriggerType.Whisper,"water snake",Amora);
            a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc),1,(eComparator)3);
            a.AddAction(eActionType.Talk,"Oh, it seems the venom of the snake was very powerful. I have sent word to t he healer and she has told me she needs five vials of [snake venom] to cure the child.",Amora);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Amora,-1);
                a.AddTrigger(eTriggerType.Whisper,"snake venom",Amora);
            a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc),1,(eComparator)3);
            a.AddAction(eActionType.Talk,"I do not feel right leaving Magnild [here alone] this ill, so I fear I can't hunt the snakes myself.",Amora);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Amora,-1);
                a.AddTrigger(eTriggerType.Whisper,"here alone",Amora);
            a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc),1,(eComparator)3);
            a.AddAction(eActionType.Talk,"Please go outside the city and [collect] the five vials of venom and take them to Kari, the healer.",Amora);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Amora,-1);
                a.AddTrigger(eTriggerType.Whisper,"collect",Amora);
            a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc),1,(eComparator)3);
            a.AddAction(eActionType.Talk,"I am indebted to you always if you do the for me.",Amora);
            a.AddAction(eActionType.SetQuestStep,typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc),2);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Lycla,-1);
                a.AddTrigger(eTriggerType.EnemyKilled,"water snake",null);
            a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc),2,(eComparator)3);
            a.AddRequirement(eRequirementType.InventoryItem,snakevenom,4,(eComparator)1);
            a.AddAction(eActionType.GiveItem,snakevenom,null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Lycla,-1);
                a.AddTrigger(eTriggerType.EnemyKilled,"water snake",null);
            a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc),2,(eComparator)3);
            a.AddRequirement(eRequirementType.InventoryItem,snakevenom,4,(eComparator)3);
            a.AddAction(eActionType.SetQuestStep,typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc),3);
            a.AddAction(eActionType.GiveItem,snakevenom,null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Kari,-1);
                a.AddTrigger(eTriggerType.Interact,null,Kari);
            a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc),3,(eComparator)3);
            a.AddAction(eActionType.Talk,"Ahh, you look as if you have been having a rough time. Have you brought me the vials of snake venom?",Kari);
            a.AddAction(eActionType.TakeItem,snakevenom,5);
            a.AddAction(eActionType.Talk,"\"I shall begin [work] at once in making the potion to cure the sick girl, hopefully all my training will not fail me.",Kari);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Kari,-1);
                a.AddTrigger(eTriggerType.Whisper,"work",Kari);
            a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc),3,(eComparator)3);
            a.AddAction(eActionType.Talk,"You have aided in this situation beyond what is expected. I thnk you.",Kari);
            a.AddAction(eActionType.GiveXP,10,null);
            a.AddAction(eActionType.GiveGold,42,null);
            a.AddAction(eActionType.FinishQuest,typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc),null);
            AddBehaviour(a);

            #endregion

            // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End

            Lycla.AddQuestToGive(typeof (Amorasaidmistyc));
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            /* First thing we do in here is to search for the NPCs inside
            * the world who comes from the certain Realm. If we find a the players,
            * this means we don't have to create a new one.
            *
            * NOTE: You can do anything you want in this method, you don't have
            * to search for NPC's ... you could create a custom item, place it
            * on the ground and if a player picks it up, he will get the quest!
            * Just examples, do anything you like and feel comfortable with :)
            */

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Eowyln Astos", eRealm.Albion);

            /* Whops, if the npcs array length is 0 then no npc exists in
                * this users Mob Database, so we simply create one ;-)
                * else we take the existing one. And if more than one exist, we take
                * the first ...
                */
            if (npcs.Length == 0)
            {
                eowylnAstos = new GameNPC();
                eowylnAstos.Model = 35;
                eowylnAstos.Name = "Eowyln Astos";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + eowylnAstos.Name + ", creating him ...");
                eowylnAstos.GuildName = "Part of " + questTitle + " Quest";
                eowylnAstos.Realm = eRealm.Albion;
                eowylnAstos.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 58, 40);
                eowylnAstos.Inventory = template.CloseTemplate();
                eowylnAstos.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                eowylnAstos.Size = 54;
                eowylnAstos.Level = 17;
                eowylnAstos.X = 559680;
                eowylnAstos.Y = 513793;
                eowylnAstos.Z = 2619;
                eowylnAstos.Heading = 3185;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                if (SAVE_INTO_DATABASE)
                    eowylnAstos.SaveIntoDatabase();

                eowylnAstos.AddToWorld();
            }
            else
                eowylnAstos = npcs[0];

            #endregion defineNPCS

            #region defineItems

            // item db check
            sephucothsHeart = GameServer.Database.FindObjectByKey<ItemTemplate>("sephucoths_heart");
            if (sephucothsHeart == null)
            {
                sephucothsHeart = new ItemTemplate();
                sephucothsHeart.Name = "Sephucoth's Heart";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + sephucothsHeart.Name + ", creating it ...");
                sephucothsHeart.Level = 0;
                sephucothsHeart.Weight = 0;
                sephucothsHeart.Model = 595;

                sephucothsHeart.Object_Type = (int)eObjectType.GenericItem;
                sephucothsHeart.Id_nb = "sephucoths_heart";
                sephucothsHeart.Price = 0;
                sephucothsHeart.IsPickable = false;
                sephucothsHeart.IsDropable = false;

                sephucothsHeart.Quality = 100;
                sephucothsHeart.Condition = 1000;
                sephucothsHeart.MaxCondition = 1000;
                sephucothsHeart.Durability = 1000;
                sephucothsHeart.MaxDurability = 1000;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                GameServer.Database.AddObject(sephucothsHeart);
            }

            // item db check
            polishedBone = GameServer.Database.FindObjectByKey<ItemTemplate>("polished_bone");
            if (polishedBone == null)
            {
                polishedBone = new ItemTemplate();
                polishedBone.Name = "Polished Bone";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + polishedBone.Name + ", creating it ...");
                polishedBone.Level = 0;
                polishedBone.Weight = 15;
                polishedBone.Model = 497;

                polishedBone.Object_Type = (int)eObjectType.GenericItem;
                polishedBone.Id_nb = "polished_bone";
                polishedBone.Price = 0;
                polishedBone.IsPickable = false;
                polishedBone.IsDropable = false;

                polishedBone.Quality = 100;
                polishedBone.Condition = 1000;
                polishedBone.MaxCondition = 1000;
                polishedBone.Durability = 1000;
                polishedBone.MaxDurability = 1000;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                GameServer.Database.AddObject(polishedBone);
            }

            // item db check
            fieryCrystalPendant = GameServer.Database.FindObjectByKey<ItemTemplate>("fiery_crystal_pendant");
            if (fieryCrystalPendant == null)
            {
                fieryCrystalPendant = new ItemTemplate();
                fieryCrystalPendant.Name = "Fiery Crystal Pendant";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + fieryCrystalPendant.Name + ", creating it ...");

                fieryCrystalPendant.Level = 8;
                fieryCrystalPendant.Weight = 8;
                fieryCrystalPendant.Model = 101;

                fieryCrystalPendant.Object_Type = (int)eObjectType.Magical;
                fieryCrystalPendant.Item_Type = (int)eEquipmentItems.NECK;
                fieryCrystalPendant.Id_nb = "fiery_crystal_pendant";
                fieryCrystalPendant.Price = Money.GetMoney(0, 0, 0, 0, 30);
                fieryCrystalPendant.IsPickable = true;
                fieryCrystalPendant.IsDropable = true;

                fieryCrystalPendant.Bonus1 = 1;
                fieryCrystalPendant.Bonus1Type = (int)eProperty.Skill_Fire;
                fieryCrystalPendant.Bonus2 = 1;
                fieryCrystalPendant.Bonus2Type = (int)eProperty.Intelligence;

                fieryCrystalPendant.Quality = 100;
                fieryCrystalPendant.Condition = 1000;
                fieryCrystalPendant.MaxCondition = 1000;
                fieryCrystalPendant.Durability = 1000;
                fieryCrystalPendant.MaxDurability = 1000;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                GameServer.Database.AddObject(fieryCrystalPendant);
            }

            #endregion defineItems

            /* Now we add some hooks to the npc we found.
			* Actually, we want to know when a player interacts with him.
			* So, we hook the right-click (interact) and the whisper method
			* of npc and set the callback method to the "TalkToXXX"
			* method. This means, the "TalkToXXX" method is called whenever
			* a player right clicks on him or when he whispers to him.
			*/

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            GameEventMgr.AddHandler(eowylnAstos, GameLivingEvent.Interact, new DOLEventHandler(TalkToEowylnAstos));
            GameEventMgr.AddHandler(eowylnAstos, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToEowylnAstos));

            /* Now we bring to Yetta Fletcher the possibility to give this quest to players */
            eowylnAstos.AddQuestToGive(typeof(HeartOfSephucoth));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Example #35
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");

            #region defineNPCS
            GameNPC[] npcs = WorldMgr.GetNPCsByName(questGiverName, eRealm.Hibernia);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + questGiverName + ", creating her ...");

                questGiver = new GameNPC();
                questGiver.Name = questGiverName;
                questGiver.Realm = eRealm.Hibernia;
                questGiver.CurrentRegionID = 200;

                // select * from NPCEquipment where TemplateID in (select EquipmentTemplateID from Mob where name = ?)
                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 448, 0);		// Slot 12
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 427, 0);			// Slot 23
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 423, 0);		// Slot 25
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 424, 0);			// Slot 27
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 425, 0);			// Slot 28
                questGiver.Inventory = template.CloseTemplate();
                questGiver.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                questGiver.Model = 388;
                questGiver.Size = 51;
                questGiver.Level = 35;
                questGiver.X = 346768;
                questGiver.Y = 489521;
                questGiver.Z = 5200;
                questGiver.Heading = 2594;

                if (SAVE_INTO_DATABASE)
                    questGiver.SaveIntoDatabase();

                questGiver.AddToWorld();
            }
            else
                questGiver = npcs[0];

            npcs = WorldMgr.GetNPCsByName(questTargetName, eRealm.Hibernia);

            if (npcs.Length == 0)
            {
                questTarget = new GameNPC();
                questTarget.Name = questTargetName;
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + questTarget.Name + ", creating him ...");
                questTarget.Realm = eRealm.Hibernia;
                questTarget.CurrentRegionID = 200;

                // select * from NPCEquipment where TemplateID in (select EquipmentTemplateID from Mob where name = ?)
                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 411, 0);		// Slot 22
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 412, 0);		// Slot 23
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 408, 0);		// Slot 25
                template.AddNPCEquipment(eInventorySlot.Cloak, 57, 34);				// Slot 26
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 409, 0);		// Slot 27
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 410, 0);		// Slot 28
                questTarget.Inventory = template.CloseTemplate();
                questTarget.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                questTarget.Model = 381;
                questTarget.Size = 50;
                questTarget.Level = 12;
                questTarget.X = 347327;
                questTarget.Y = 492700;
                questTarget.Z = 5199;
                questTarget.Heading = 2468;

                if (SAVE_INTO_DATABASE)
                    questTarget.SaveIntoDatabase();

                questTarget.AddToWorld();
            }
            else
                questTarget = npcs[0];
            #endregion

            /*
            #region defineAreas
            targetArea = WorldMgr.GetRegion(targetLocation.RegionID).AddArea(new Area.Circle("", targetLocation.X, targetLocation.Y, targetLocation.Z, 200));
            #endregion
            */

            #region defineItems
            armBone = GameServer.Database.FindObjectByKey<ItemTemplate>("BonesToBlades-armbone");
            if (armBone == null) {
                armBone = new ItemTemplate();
                armBone.Name = "Arm Bone";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + armBone.Name + ", creating it ...");
                armBone.Level = 1;
                armBone.Weight = 1;
                armBone.Model = 497;
                armBone.Object_Type = (int) eObjectType.GenericItem;
                armBone.Item_Type = -1;
                armBone.Id_nb = "BonesToBlades-armbone";
                armBone.Hand = 0;
                armBone.Price = 0;
                armBone.IsTradable = false;
                armBone.Color = 0;
                armBone.Bonus = 0; // default bonus
                armBone.Bonus1 = 0;
                armBone.Bonus1Type = (int)0;
                armBone.Bonus2 = 0;
                armBone.Bonus2Type = (int)0;
                armBone.Bonus3 = 0;
                armBone.Bonus3Type = (int)0;
                armBone.Bonus4 = 0;
                armBone.Bonus4Type = (int)0;
                armBone.Bonus5 = 0;
                armBone.Bonus5Type = (int)0;
                armBone.Bonus6 = 0;
                armBone.Bonus6Type = (int)0;
                armBone.Bonus7 = 0;
                armBone.Bonus7Type = (int)0;
                armBone.Bonus8 = 0;
                armBone.Bonus8Type = (int)0;
                armBone.Bonus9 = 0;
                armBone.Bonus9Type = (int)0;
                armBone.Bonus10 = 0;
                armBone.Bonus10Type = (int)0;
                armBone.ExtraBonus = 0;
                armBone.ExtraBonusType = (int)0;
                armBone.Effect = 0;
                armBone.Emblem = 0;
                armBone.Charges = 0;
                armBone.MaxCharges = 0;
                armBone.SpellID = 0;
                armBone.ProcSpellID = 0;
                armBone.Type_Damage = 0;
                armBone.Realm = 0;
                armBone.MaxCount = 1;
                armBone.PackSize = 1;
                armBone.Extension = 0;
                armBone.Quality = 100;
                armBone.Condition = 100;
                armBone.MaxCondition = 100;
                armBone.Durability = 100;
                armBone.MaxDurability = 100;
                armBone.PoisonCharges = 0;
                armBone.PoisonMaxCharges = 0;
                armBone.PoisonSpellID = 0;
                armBone.ProcSpellID1 = 0;
                armBone.SpellID1 = 0;
                armBone.MaxCharges1 = 0;
                armBone.Charges1 = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(armBone);
            }

            carvedBoneHilt = GameServer.Database.FindObjectByKey<ItemTemplate>("BonesToBlades-carvedBoneHilts");
            if (carvedBoneHilt == null)
            {
                carvedBoneHilt = new ItemTemplate();
                carvedBoneHilt.Name = "Two Carved Bone Hilts";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + carvedBoneHilt.Name + ", creating it ...");
                carvedBoneHilt.Level = 1;
                carvedBoneHilt.Weight = 1;
                carvedBoneHilt.Model = 497;
                carvedBoneHilt.Object_Type = (int)eObjectType.GenericItem;
                carvedBoneHilt.Item_Type = -1;
                carvedBoneHilt.Id_nb = "BonesToBlades-carvedBoneHilts";
                carvedBoneHilt.Hand = 0;
                carvedBoneHilt.Price = 0;
                carvedBoneHilt.IsTradable = false;
                carvedBoneHilt.Color = 0;
                carvedBoneHilt.Bonus = 0; // default bonus
                carvedBoneHilt.Bonus1 = 0;
                carvedBoneHilt.Bonus1Type = (int)0;
                carvedBoneHilt.Bonus2 = 0;
                carvedBoneHilt.Bonus2Type = (int)0;
                carvedBoneHilt.Bonus3 = 0;
                carvedBoneHilt.Bonus3Type = (int)0;
                carvedBoneHilt.Bonus4 = 0;
                carvedBoneHilt.Bonus4Type = (int)0;
                carvedBoneHilt.Bonus5 = 0;
                carvedBoneHilt.Bonus5Type = (int)0;
                carvedBoneHilt.Bonus6 = 0;
                carvedBoneHilt.Bonus6Type = (int)0;
                carvedBoneHilt.Bonus7 = 0;
                carvedBoneHilt.Bonus7Type = (int)0;
                carvedBoneHilt.Bonus8 = 0;
                carvedBoneHilt.Bonus8Type = (int)0;
                carvedBoneHilt.Bonus9 = 0;
                carvedBoneHilt.Bonus9Type = (int)0;
                carvedBoneHilt.Bonus10 = 0;
                carvedBoneHilt.Bonus10Type = (int)0;
                carvedBoneHilt.ExtraBonus = 0;
                carvedBoneHilt.ExtraBonusType = (int)0;
                carvedBoneHilt.Effect = 0;
                carvedBoneHilt.Emblem = 0;
                carvedBoneHilt.Charges = 0;
                carvedBoneHilt.MaxCharges = 0;
                carvedBoneHilt.SpellID = 0;
                carvedBoneHilt.ProcSpellID = 0;
                carvedBoneHilt.Type_Damage = 0;
                carvedBoneHilt.Realm = 0;
                carvedBoneHilt.MaxCount = 1;
                carvedBoneHilt.PackSize = 1;
                carvedBoneHilt.Extension = 0;
                carvedBoneHilt.Quality = 100;
                carvedBoneHilt.Condition = 100;
                carvedBoneHilt.MaxCondition = 100;
                carvedBoneHilt.Durability = 100;
                carvedBoneHilt.MaxDurability = 100;
                carvedBoneHilt.PoisonCharges = 0;
                carvedBoneHilt.PoisonMaxCharges = 0;
                carvedBoneHilt.PoisonSpellID = 0;
                carvedBoneHilt.ProcSpellID1 = 0;
                carvedBoneHilt.SpellID1 = 0;
                carvedBoneHilt.MaxCharges1 = 0;
                carvedBoneHilt.Charges1 = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(carvedBoneHilt);
            }
            #endregion

            #region defineBehaviours
            QuestBuilder builder = QuestMgr.getBuilder(typeof(BonesToBlades));
            QuestBehaviour a = null;
            string message1 = "Oh, have you been standing there long, <Class>? If you have, I apologize for ignoring you. I find my mind is quite distracted these days after the meeting I had yesterday with a [new client].";
            string message2 = "Ah, I would love to tell you the name of the client, but I promised to keep their identity a secret. I keep the identity of all my clients secret because I don't want the other merchants in this area to try to steal them away from me! See, there I go again, getting distracted when I should be thinking about [those blades].";
            string message3 = "Day in and day out I sell these plain, everyday blades. But from time to time clients do approach me to commission special blades to be made. My newest client came to me and requested that I make a set of matched falcatas to be given as [a gift] to this client's daughter upon her next birthday.";
            string message4 = "The daughter is a highly skilled blademaster who is preparing to venture into the Frontiers. My client wants the daughter to be as well armed as possible and I seemed to have developed a reputation as a maker of some of the best custom blades out there. I hope I can [live up to] that reputation.";
            string message5 = "I fear I have agreed to make these falcatas before I checked to see if I have all the supplies I need. It turns out I'm missing a few things, and I need to have the blades done within a few days. Making the blades alone will take me all that time without having to gather the materials for [the hilt] of each blade.";
            string message6 = "My client has asked that the hilts of these falcatas be carved from bone. I would be happy to do that, but I don't have the bones I need. I need to get them and send them over to Jahan so he can carve them for me. Say, if you're not busy, perhaps [you can go] get the bones I need. I can pay you for your time.";
            string message7 = "I cannot thank you enough for agreeing to help me. I've found that when people ask for carved bone hilts that the best bones come from the skeletal pawns and minions that roam the lands [just outside] of Mag Mell.";
            string message8 = "You'll find the skeletal pawns and minions across the road on the hill northwest of here. I've also seen them in the field and by the standing stone in the woods east-southeast of Rumdor the Stable Master here in Mag Mell. Get two arm bones from either the pawns or the minions. When you have them, take them to Jahan here in Mag Mell. He will carve them for me. Good luck, <Class>!";
            string message9 = "Ah, you must be the young <Class> that Wony told me about. She said you would have two arm bones that needed carving for hilts. Wony thinks it will take me a few days to get those bones carved but I have [a surprise] for her.";
            string message10 = "I already had some bones among my supplies. I went ahead and carved them while you were out obtaining more bones. I'll give you the carved ones and I'll take the ones you have so I can keep my supplies well stocked. Why don't you hand me those two arm bones now?";
            string message11 = "There you go, <Class>. Take those two carved bones to Wony right now. It will put her mind at ease having those hilts already taken care of. Don't worry about payment for my work; Wony has taken care of that already.";
            string message12 = "<Class>, what are you doing back here already? I told you to take the arm bones to Jahan so he can carve them! You should have listened to me! Now what am I going to do?";
            string message13 = "What is this? These hilts are already carved! Jahan played a trick on me, didn't he? He already had these done. I guess the arm bones I had you collect will get used the next time I need bone hilts. I am sorry for yelling at you when I should have been offering you [the payment] I promised you.";
            string message14 = "There we go, <Class>. Thank you so much for helping me get these bone hilts. I shall be able to get the matching falcatas done on time and keep my new client. Perhaps one day you will have enough platinum to hire me to make custom blades for you. Until then, be well!";

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Interact, null, questGiver);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(BonesToBlades), questGiver);
            a.AddRequirement(eRequirementType.QuestPending, typeof(BonesToBlades), null, (eComparator)5);
            a.AddAction(eActionType.Talk, message1, questGiver);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Whisper, "new client", questGiver);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(BonesToBlades), questGiver);
            a.AddRequirement(eRequirementType.QuestPending, typeof(BonesToBlades), null, (eComparator)5);
            a.AddAction(eActionType.Talk, message2, questGiver);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Whisper, "those blades", questGiver);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(BonesToBlades), questGiver);
            a.AddRequirement(eRequirementType.QuestPending, typeof(BonesToBlades), null, (eComparator)5);
            a.AddAction(eActionType.Talk, message3, questGiver);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Whisper, "a gift", questGiver);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(BonesToBlades), questGiver);
            a.AddRequirement(eRequirementType.QuestPending, typeof(BonesToBlades), null, (eComparator)5);
            a.AddAction(eActionType.Talk, message4, questGiver);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Whisper, "live up to", questGiver);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(BonesToBlades), questGiver);
            a.AddRequirement(eRequirementType.QuestPending, typeof(BonesToBlades), null, (eComparator)5);
            a.AddAction(eActionType.Talk, message5, questGiver);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Whisper, "the hilt", questGiver);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(BonesToBlades), questGiver);
            a.AddRequirement(eRequirementType.QuestPending, typeof(BonesToBlades), null, (eComparator)5);
            a.AddAction(new MessageAction(questGiver, questGiverName + " blushes a deep red.", eTextType.Emote));
            a.AddAction(eActionType.Talk, message6, questGiver);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Whisper, "you can go", questGiver);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(BonesToBlades), questGiver);
            a.AddRequirement(eRequirementType.QuestPending, typeof(BonesToBlades), null, (eComparator)5);
            a.AddAction(eActionType.OfferQuest, typeof(BonesToBlades), "Do you want to help Wony?");
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, 1);
            a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(BonesToBlades));
            a.AddAction(eActionType.Talk, message7, questGiver);
            a.AddAction(eActionType.GiveQuest, typeof(BonesToBlades), questGiver);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Whisper, "just outside", questGiver);
            a.AddRequirement(eRequirementType.QuestStep, typeof(BonesToBlades), 1, eComparator.Equal);
            a.AddAction(eActionType.Talk, message8, questGiver);
            AddBehaviour(a);

            //a = builder.CreateBehaviour(questGiver, -1);
            //a.AddTrigger(eTriggerType.EnemyKilled, "skeletal pawn", null);
            //a.AddTrigger(eTriggerType.EnemyKilled, "skeletal minion", null);
            //a.AddRequirement(eRequirementType.QuestStep, typeof(BonesToBlades), 0, eComparator.Greater);
            //a.AddRequirement(eRequirementType.InventoryItem, armBone, 2, eComparator.Less);
            //a.AddAction(eActionType.GiveItem, armBone, null);
            //AddBehaviour(a);

            //a = builder.CreateBehaviour(questGiver, -1);
            //a.AddTrigger(eTriggerType.EnemyKilled, mobTypes[0], null);
            //a.AddTrigger(eTriggerType.EnemyKilled, mobTypes[1], null);
            //a.AddRequirement(eRequirementType.QuestStep, typeof(BonesToBlades), 1, eComparator.Equal);
            //a.AddRequirement(eRequirementType.InventoryItem, armBone, 1, eComparator.Greater);
            //a.AddAction(eActionType.SetQuestStep, typeof(BonesToBlades), 2);
            //AddBehaviour(a);

            a = builder.CreateBehaviour(questTarget, -1);
            a.AddTrigger(eTriggerType.Interact, null, questTarget);
            a.AddRequirement(eRequirementType.QuestStep, typeof(BonesToBlades), 2, eComparator.Equal);
            a.AddAction(eActionType.Talk, message9, questTarget);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questTarget, -1);
            a.AddTrigger(eTriggerType.Whisper, "a surprise", questTarget);
            a.AddRequirement(eRequirementType.QuestStep, typeof(BonesToBlades), 2, eComparator.Equal);
            a.AddAction(eActionType.Talk, message10, questTarget);
            a.AddAction(eActionType.SetQuestStep, typeof(BonesToBlades), 3);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questTarget, -1);
            a.AddTrigger(eTriggerType.GiveItem, questTarget, armBone);
            a.AddRequirement(eRequirementType.QuestStep, typeof(BonesToBlades), 4, eComparator.Equal);
            a.AddAction(eActionType.SetQuestStep, typeof(BonesToBlades), 5);
            a.AddAction(eActionType.TakeItem, armBone, null);
            a.AddAction(eActionType.GiveItem, carvedBoneHilt, null);
            a.AddAction(eActionType.Talk, message11, questTarget);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questTarget, -1);
            a.AddTrigger(eTriggerType.GiveItem, questTarget, armBone);
            a.AddRequirement(eRequirementType.QuestStep, typeof(BonesToBlades), 3, eComparator.Equal);
            a.AddAction(eActionType.SetQuestStep, typeof(BonesToBlades), 4);
            a.AddAction(eActionType.TakeItem, armBone, null);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Interact, null, questGiver);
            a.AddRequirement(eRequirementType.QuestStep, typeof(BonesToBlades), 5, eComparator.Equal);
            a.AddAction(eActionType.Talk, message12, questGiver);
            a.AddAction(eActionType.SetQuestStep, typeof(BonesToBlades), 6);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.GiveItem, questGiver, carvedBoneHilt);
            a.AddRequirement(eRequirementType.QuestStep, typeof(BonesToBlades), 6, eComparator.Equal);
            a.AddAction(eActionType.SetQuestStep, typeof(BonesToBlades), 7);
            a.AddAction(eActionType.TakeItem, carvedBoneHilt, null);
            a.AddAction(eActionType.Talk, message13, questGiver);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Whisper, "the payment", questGiver);
            a.AddRequirement(eRequirementType.QuestStep, typeof(BonesToBlades), 7, eComparator.Equal);
            a.AddAction(eActionType.Talk, message14, questGiver);
            a.AddAction(eActionType.GiveXP, 20, null);
            a.AddAction(eActionType.GiveGold, 37, null);
            a.AddAction(eActionType.FinishQuest, typeof(BonesToBlades), null);
            AddBehaviour(a);
            #endregion

            questGiver.AddQuestToGive(typeof(BonesToBlades));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Example #36
0
        public override void Notify(DOLEvent e, object sender, EventArgs args)
        {
            GamePlayer player = sender as GamePlayer;

            if (player == null || player.IsDoingQuest(typeof (ClericMulgrut)) == null)
                return;

            if (e == GameLivingEvent.EnemyKilled)
            {
                EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs) args;
                if(Step == 1)
                {
                    if (gArgs.Target.Name == "puny skeleton")
                    {
                        if (Util.Chance(25))
                        {
                            if(mulgrutMaggot == null)
                            {
                                mulgrutMaggot = new GameNPC();
                                mulgrutMaggot.Model = 467;
                                mulgrutMaggot.Name = "Mulgrut Maggot";
                                mulgrutMaggot.Realm = eRealm.None;
                                mulgrutMaggot.CurrentRegionID = 1;

                                mulgrutMaggot.Size = 60;
                                mulgrutMaggot.Level = 5;
                                mulgrutMaggot.X = 565941;
                                mulgrutMaggot.Y = 528121;
                                mulgrutMaggot.Z = 2152;
                                mulgrutMaggot.Heading = 2278;

                                StandardMobBrain brain = new StandardMobBrain();  // set a brain witch find a lot mob friend to attack the player
                                mulgrutMaggot.SetOwnBrain(brain);

                                mulgrutMaggot.RespawnInterval = 0; // don't respawn when killed

                                mulgrutMaggot.AddToWorld();
                            }
                        }
                    }
                    else if (gArgs.Target.Name == "Mulgrut Maggot")
                    {
                        GiveItem(gArgs.Target, player, beltOfAnimation);
                        if(mulgrutMaggot != null) { mulgrutMaggot = null; }
                        FinishQuest();
                    }
                }
            }
        }
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Blercyn", eRealm.Hibernia);

            /* Whops, if the npcs array length is 0 then no npc exists in
             * this users Mob Database, so we simply create one ;-)
             * else we take the existing one. And if more than one exist, we take
             * the first ...
             */
            if (npcs.Length == 0)
            {
                Blercyn = new GameNPC();
                Blercyn.Model = 700;
                Blercyn.Name = "Blercyn";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + Blercyn.Name + ", creating him ...");
                //Blercyn.GuildName = "Part of " + questTitle + " Quest";
                Blercyn.Realm = eRealm.Hibernia;
                Blercyn.CurrentRegionID = 200;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 58);
                Blercyn.Inventory = template.CloseTemplate();
                Blercyn.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                Blercyn.Size = 50;
                Blercyn.Level = 50;
                Blercyn.X = 348614;
                Blercyn.Y = 492141;
                Blercyn.Z = 5199;
                Blercyn.Heading = 1539;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                if (SAVE_INTO_DATABASE)
                    Blercyn.SaveIntoDatabase();

                Blercyn.AddToWorld();
            }
            else
                Blercyn = npcs[0];

            //Pompin The Crier
            npcs = WorldMgr.GetNPCsByName("Epona", eRealm.Hibernia);
            if (npcs.Length == 0)
            {
                Epona = new GameNPC();
                Epona.Model = 10;
                Epona.Name = "Epona";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + Epona.Name + ", creating him ...");
                //Blercyn.GuildName = "Part of " + questTitle + " Quest";
                Epona.Realm = eRealm.Hibernia;
                Epona.CurrentRegionID = 200;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 58);
                Epona.Inventory = template.CloseTemplate();
                Epona.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                Epona.Size = 50;
                Epona.Level = 50;
                Epona.X = 347606;
                Epona.Y = 490658;
                Epona.Z = 5227;
                Epona.Heading = 1342;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                if (SAVE_INTO_DATABASE)
                    Epona.SaveIntoDatabase();

                Epona.AddToWorld();
            }
            else
                Epona = npcs[0];

            #endregion defineNPCS

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            GameEventMgr.AddHandler(Blercyn, GameLivingEvent.Interact, new DOLEventHandler(TalkToBlercyn));
            GameEventMgr.AddHandler(Blercyn, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToBlercyn));

            GameEventMgr.AddHandler(Epona, GameLivingEvent.Interact, new DOLEventHandler(TalkToEpona));
            GameEventMgr.AddHandler(Epona, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToEpona));

            Blercyn.AddQuestToGive(typeof(SearchForKnowledge));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Example #38
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            }

            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>("Blercyn", eRealm.Hibernia);

            /* Whops, if the npcs array length is 0 then no npc exists in
             * this users Mob Database, so we simply create one ;-)
             * else we take the existing one. And if more than one exist, we take
             * the first ...
             */
            if (npcs.Length == 0)
            {
                Blercyn       = new GameNPC();
                Blercyn.Model = 700;
                Blercyn.Name  = "Blercyn";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + Blercyn.Name + ", creating him ...");
                }

                // Blercyn.GuildName = "Part of " + questTitle + " Quest";
                Blercyn.Realm           = eRealm.Hibernia;
                Blercyn.CurrentRegionID = 200;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 58);
                Blercyn.Inventory = template.CloseTemplate();
                Blercyn.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                Blercyn.Size    = 50;
                Blercyn.Level   = 50;
                Blercyn.X       = 348614;
                Blercyn.Y       = 492141;
                Blercyn.Z       = 5199;
                Blercyn.Heading = 1539;

                // You don't have to store the created mob in the db if you don't want,
                // it will be recreated each time it is not found, just comment the following
                // line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                {
                    Blercyn.SaveIntoDatabase();
                }

                Blercyn.AddToWorld();
            }
            else
            {
                Blercyn = npcs[0];
            }

            // Pompin The Crier
            npcs = WorldMgr.GetObjectsByName <GameNPC>("Epona", eRealm.Hibernia);
            if (npcs.Length == 0)
            {
                Epona       = new GameNPC();
                Epona.Model = 10;
                Epona.Name  = "Epona";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + Epona.Name + ", creating him ...");
                }

                // Blercyn.GuildName = "Part of " + questTitle + " Quest";
                Epona.Realm           = eRealm.Hibernia;
                Epona.CurrentRegionID = 200;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 58);
                Epona.Inventory = template.CloseTemplate();
                Epona.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                Epona.Size    = 50;
                Epona.Level   = 50;
                Epona.X       = 347606;
                Epona.Y       = 490658;
                Epona.Z       = 5227;
                Epona.Heading = 1342;

                // You don't have to store the created mob in the db if you don't want,
                // it will be recreated each time it is not found, just comment the following
                // line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                {
                    Epona.SaveIntoDatabase();
                }

                Epona.AddToWorld();
            }
            else
            {
                Epona = npcs[0];
            }

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            GameEventMgr.AddHandler(Blercyn, GameLivingEvent.Interact, new DOLEventHandler(TalkToBlercyn));
            GameEventMgr.AddHandler(Blercyn, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToBlercyn));

            GameEventMgr.AddHandler(Epona, GameLivingEvent.Interact, new DOLEventHandler(TalkToEpona));
            GameEventMgr.AddHandler(Epona, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToEpona));

            Blercyn.AddQuestToGive(typeof(SearchForKnowledge));

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Example #39
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            /* First thing we do in here is to search for the NPCs inside
            * the world who comes from the certain Realm. If we find a the players,
            * this means we don't have to create a new one.
            *
            * NOTE: You can do anything you want in this method, you don't have
            * to search for NPC's ... you could create a custom item, place it
            * on the ground and if a player picks it up, he will get the quest!
            * Just examples, do anything you like and feel comfortable with :)
            */

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Godeleva Dowden", eRealm.Albion);

            /* Whops, if the npcs array length is 0 then no npc exists in
                * this users Mob Database, so we simply create one ;-)
                * else we take the existing one. And if more than one exist, we take
                * the first ...
                */
            if (npcs.Length == 0)
            {
                godelevaDowden = new GameNPC();
                godelevaDowden.Model = 7;
                godelevaDowden.Name = "Godeleva Dowden";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + godelevaDowden.Name + ", creating him ...");
                godelevaDowden.GuildName = "Part of " + questTitle + " Quest";
                godelevaDowden.Realm = eRealm.Albion;
                godelevaDowden.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 138);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 134);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 135);
                godelevaDowden.Inventory = template.CloseTemplate();
                godelevaDowden.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                godelevaDowden.Size = 48;
                godelevaDowden.Level = 40;
                godelevaDowden.X = 559528;
                godelevaDowden.Y = 510953;
                godelevaDowden.Z = 2488;
                godelevaDowden.Heading = 1217;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                if (SAVE_INTO_DATABASE)
                    godelevaDowden.SaveIntoDatabase();

                godelevaDowden.AddToWorld();
            }
            else
                godelevaDowden = npcs[0];

            #endregion

            #region defineItems

            // item db check
            woodenBucket = GameServer.Database.FindObjectByKey<ItemTemplate>("wooden_bucket");
            if (woodenBucket == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Wooden Bucket, creating it ...");
                woodenBucket = new ItemTemplate();
                woodenBucket.Name = "Wooden Bucket";
                woodenBucket.Level = 1;
                woodenBucket.Weight = 10;
                woodenBucket.Model = 1610;

                woodenBucket.Object_Type = (int)eObjectType.GenericItem;
                woodenBucket.Id_nb = "wooden_bucket";
                woodenBucket.Price = 0;
                woodenBucket.IsPickable = false;
                woodenBucket.IsDropable = false;

                woodenBucket.Quality = 100;
                woodenBucket.Condition = 1000;
                woodenBucket.MaxCondition = 1000;
                woodenBucket.Durability = 1000;
                woodenBucket.MaxDurability = 1000;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(woodenBucket);
            }

            // item db check
            fullWoodenBucket = GameServer.Database.FindObjectByKey<ItemTemplate>("full_wooden_bucket");
            if (fullWoodenBucket == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Full Wooden Bucket, creating it ...");
                fullWoodenBucket = new ItemTemplate();
                fullWoodenBucket.Name = "Full Wooden Bucket";
                fullWoodenBucket.Level = 1;
                fullWoodenBucket.Weight = 250;
                fullWoodenBucket.Model = 1610;

                fullWoodenBucket.Object_Type = (int)eObjectType.GenericItem;
                fullWoodenBucket.Id_nb = "full_wooden_bucket";
                fullWoodenBucket.Price = 0;
                fullWoodenBucket.IsPickable = false;
                fullWoodenBucket.IsDropable = false;

                fullWoodenBucket.Quality = 100;
                fullWoodenBucket.Condition = 1000;
                fullWoodenBucket.MaxCondition = 1000;
                fullWoodenBucket.Durability = 1000;
                fullWoodenBucket.MaxDurability = 1000;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(fullWoodenBucket);
            }

            // item db check
            reedBracer = GameServer.Database.FindObjectByKey<ItemTemplate>("reed_bracer");
            if (reedBracer == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Reed Bracer of Health creating it ...");
                reedBracer = new ItemTemplate();
                reedBracer.Name = "Reed Bracer";
                reedBracer.Level = 3;
                reedBracer.Weight = 1;
                reedBracer.Model = 598;

                reedBracer.Object_Type = (int)eObjectType.Magical;
                reedBracer.Item_Type = (int)eEquipmentItems.L_BRACER;
                reedBracer.Id_nb = "reed_bracer";

                reedBracer.Price = Money.GetMoney(0,0,0,0,30);
                reedBracer.IsPickable = true;
                reedBracer.IsDropable = true;

                reedBracer.Bonus = 1;
                reedBracer.Bonus1Type = (int)eProperty.MaxHealth;
                reedBracer.Bonus1 = 8;
                reedBracer.Bonus2Type = (int)eProperty.Resist_Cold;
                reedBracer.Bonus2 = 1;

                reedBracer.Quality = 100;
                reedBracer.Condition = 1000;
                reedBracer.MaxCondition = 1000;
                reedBracer.Durability = 1000;
                reedBracer.MaxDurability = 1000;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(reedBracer);
            }

            #endregion

            /* Now we add some hooks to the npc we found.
            * Actually, we want to know when a player interacts with him.
            * So, we hook the right-click (interact) and the whisper method
            * of npc and set the callback method to the "TalkToXXX"
            * method. This means, the "TalkToXXX" method is called whenever
            * a player right clicks on him or when he whispers to him.
            */

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            GameEventMgr.AddHandler(GamePlayerEvent.GameEntered, new DOLEventHandler(PlayerEnterWorld));

            GameEventMgr.AddHandler(godelevaDowden, GameLivingEvent.Interact, new DOLEventHandler(TalkToGodelevaDowden));
            GameEventMgr.AddHandler(godelevaDowden, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToGodelevaDowden));

            /* Now we bring to Ydenia the possibility to give this quest to players */
            godelevaDowden.AddQuestToGive(typeof(GodelevasNeed));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Example #40
0
        protected void CreateBriediClone()
        {
            GameNpcInventoryTemplate template;
            if (briediClone == null)
            {
                briediClone = new GameNPC();
                briediClone.Model = 157;
                briediClone.Name = "Master Briedi";
                briediClone.GuildName = "Part of " + questTitle + " Quest";
                briediClone.Realm = eRealm.Midgard;
                briediClone.CurrentRegionID = 100;

                briediClone.Size = 50;
                briediClone.Level = 45;
                briediClone.X = GameLocation.ConvertLocalXToGlobalX(45394, 100);
                briediClone.Y = GameLocation.ConvertLocalYToGlobalY(39768, 100);
                briediClone.Z = 4709;
                briediClone.Heading = 107;

                template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 348);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 349);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 350);
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 351);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 352);
                template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 640);
                briediClone.Inventory = template.CloseTemplate();
                briediClone.SwitchWeapon(GameLiving.eActiveWeaponSlot.TwoHanded);

                //				briediClone.AddNPCEquipment((byte) eEquipmentItems.TORSO, 348, 0, 0, 0);
                //				briediClone.AddNPCEquipment((byte) eEquipmentItems.LEGS, 349, 0, 0, 0);
                //				briediClone.AddNPCEquipment((byte) eEquipmentItems.ARMS, 350, 0, 0, 0);
                //				briediClone.AddNPCEquipment((byte) eEquipmentItems.HAND, 351, 0, 0, 0);
                //				briediClone.AddNPCEquipment((byte) eEquipmentItems.FEET, 352, 0, 0, 0);
                //				briediClone.AddNPCEquipment((byte) eEquipmentItems.TWO_HANDED, 640, 0, 0, 0);

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                briediClone.SetOwnBrain(brain);

                briediClone.AddToWorld();

                GameEventMgr.AddHandler(briediClone, GameLivingEvent.Interact, new DOLEventHandler(TalkToMasterBriedi));
                GameEventMgr.AddHandler(briediClone, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMasterBriedi));
            }
            else
            {
                briediClone.MoveTo(100, GameLocation.ConvertLocalXToGlobalX(45394, 100), GameLocation.ConvertLocalYToGlobalY(39768, 100), 4709, 107);
            }

            foreach (GamePlayer visPlayer in briediClone.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
            {
                visPlayer.Out.SendEmoteAnimation(briediClone, eEmote.Bind);
            }

            for (int i = 0; i < recruits.Length; i++)
            {
                recruits[i] = new GameNPC();

                recruits[i].Name = "Recruit";

                recruits[i].GuildName = "Part of " + questTitle + " Quest";
                recruits[i].Realm = eRealm.Midgard;
                recruits[i].CurrentRegionID = briediClone.CurrentRegionID;

                recruits[i].Size = 50;
                recruits[i].Level = 6;
                recruits[i].X = briediClone.X + Util.Random(-150, 150);
                recruits[i].Y = briediClone.Y + Util.Random(-150, 150);

                recruits[i].Z = briediClone.Z;
                recruits[i].Heading = 187;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                recruits[i].SetOwnBrain(brain);
            }

            recruits[0].Name = "Recruit Hietan";
            recruits[0].Model = 189;
            template = new GameNpcInventoryTemplate();
            template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 69);
            template.AddNPCEquipment(eInventorySlot.TorsoArmor, 46);
            template.AddNPCEquipment(eInventorySlot.LegsArmor, 47);
            template.AddNPCEquipment(eInventorySlot.FeetArmor, 50);
            template.AddNPCEquipment(eInventorySlot.ArmsArmor, 48);
            template.AddNPCEquipment(eInventorySlot.HandsArmor, 49);
            recruits[0].Inventory = template.CloseTemplate();
            recruits[0].SwitchWeapon(GameLiving.eActiveWeaponSlot.TwoHanded);

            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.TWO_HANDED, 69, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.TORSO, 46, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.LEGS, 47, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.FEET, 50, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.ARMS, 48, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.HAND, 49, 0, 0, 0);

            recruits[1].Name = "Recruit Iduki";
            recruits[1].Model = 190;
            template = new GameNpcInventoryTemplate();
            template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 6);
            template.AddNPCEquipment(eInventorySlot.TorsoArmor, 41);
            template.AddNPCEquipment(eInventorySlot.LegsArmor, 42);
            template.AddNPCEquipment(eInventorySlot.FeetArmor, 45);
            template.AddNPCEquipment(eInventorySlot.ArmsArmor, 43);
            template.AddNPCEquipment(eInventorySlot.HandsArmor, 44);
            recruits[1].Inventory = template.CloseTemplate();
            recruits[1].SwitchWeapon(GameLiving.eActiveWeaponSlot.TwoHanded);

            //			recruits[1].AddNPCEquipment((byte) eEquipmentItems.TWO_HANDED, 6, 0, 0, 0);
            //			recruits[1].AddNPCEquipment((byte) eEquipmentItems.TORSO, 41, 0, 0, 0);
            //			recruits[1].AddNPCEquipment((byte) eEquipmentItems.LEGS, 42, 0, 0, 0);
            //			recruits[1].AddNPCEquipment((byte) eEquipmentItems.FEET, 45, 0, 0, 0);
            //			recruits[1].AddNPCEquipment((byte) eEquipmentItems.ARMS, 43, 0, 0, 0);
            //			recruits[1].AddNPCEquipment((byte) eEquipmentItems.HAND, 44, 0, 0, 0);

            recruits[2].Name = "Recruit Odigi";
            recruits[2].Model = 774;
            template = new GameNpcInventoryTemplate();
            template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 4);
            template.AddNPCEquipment(eInventorySlot.TorsoArmor, 36);
            template.AddNPCEquipment(eInventorySlot.LegsArmor, 37);
            recruits[2].Inventory = template.CloseTemplate();
            recruits[2].SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

            //			recruits[2].AddNPCEquipment((byte) eEquipmentItems.RIGHT_HAND, 4, 0, 0, 0);
            //			recruits[2].AddNPCEquipment((byte) eEquipmentItems.TORSO, 36, 0, 0, 0);
            //			recruits[2].AddNPCEquipment((byte) eEquipmentItems.LEGS, 37, 0, 0, 0);

            recruits[3].Name = "Recruit Thulder";
            recruits[3].Model = 775;
            template = new GameNpcInventoryTemplate();
            template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 5);
            template.AddNPCEquipment(eInventorySlot.TorsoArmor, 36);
            template.AddNPCEquipment(eInventorySlot.LegsArmor, 37);
            recruits[3].Inventory = template.CloseTemplate();
            recruits[3].SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

            //			recruits[3].AddNPCEquipment((byte) eEquipmentItems.RIGHT_HAND, 5, 0, 0, 0);
            //			recruits[3].AddNPCEquipment((byte) eEquipmentItems.TORSO, 36, 0, 0, 0);
            //			recruits[3].AddNPCEquipment((byte) eEquipmentItems.LEGS, 37, 0, 0, 0);

            for (int i = 0; i < recruits.Length; i++)
            {
                recruits[i].AddToWorld();
            }
        }
        public override void Notify(DOLEvent e, object sender, EventArgs args)
        {
            GamePlayer player = sender as GamePlayer;

            if (player == null || player.IsDoingQuest(typeof(HeartOfSephucoth)) == null)
                return;

            if (e == GameLivingEvent.EnemyKilled)
            {
                EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args;
                if (Step == 1)
                {
                    if (gArgs.Target.Name == "river sprite")
                    {
                        if (Util.Chance(25))
                        {
                            if (sephucoth == null)
                            {
                                sephucoth = new GameNPC();
                                sephucoth.Model = 136;
                                sephucoth.Name = "Sephucoth";
                                sephucoth.Realm = eRealm.None;
                                sephucoth.CurrentRegionID = 1;

                                sephucoth.Size = 55;
                                sephucoth.Level = 7;
                                sephucoth.X = 560836;
                                sephucoth.Y = 527260;
                                sephucoth.Z = 2082;
                                sephucoth.Heading = 1480;

                                StandardMobBrain brain = new StandardMobBrain();  // set a brain witch find a lot mob friend to attack the player
                                sephucoth.SetOwnBrain(brain);					  // so this mob must be abble to cast

                                sephucoth.RespawnInterval = 0; // don't respawn when killed

                                sephucoth.AddToWorld();
                            }
                        }
                    }
                    else if (gArgs.Target.Name == "Sephucoth")
                    {
                        GiveItem(gArgs.Target, player, sephucothsHeart);
                        if (sephucoth != null) { sephucoth = null; }

                        Step = 2;
                    }
                }
                else if (Step == 3)
                {
                    if (gArgs.Target.Name == "large skeleton")
                    {
                        if (Util.Chance(50))
                        {
                            GiveItem(gArgs.Target, player, polishedBone);
                            Step = 4;
                        }
                    }
                }
            }
            else if (e == GamePlayerEvent.GiveItem)
            {
                GiveItemEventArgs gArgs = (GiveItemEventArgs)args;
                if (gArgs.Target.Name == eowylnAstos.Name)
                {
                    if (gArgs.Item.Id_nb == sephucothsHeart.Id_nb && Step == 2)
                    {
                        RemoveItem(eowylnAstos, m_questPlayer, sephucothsHeart);

                        eowylnAstos.TurnTo(m_questPlayer);
                        eowylnAstos.SayTo(m_questPlayer, "You have done well traveler! I will still require one final object to complete the pendant. Seek out a large skeleton and bring from it a piece of polished bone! Return this to me and I shall finish your pendant.");
                        Step = 3;
                    }
                    else if (gArgs.Item.Id_nb == polishedBone.Id_nb && Step == 4)
                    {
                        RemoveItem(eowylnAstos, m_questPlayer, polishedBone);

                        eowylnAstos.TurnTo(m_questPlayer);
                        eowylnAstos.SayTo(m_questPlayer, "Eowyln draws two items before her. Gathering her strength, she shouts.");

                        new RegionTimer(eowylnAstos, new RegionTimerCallback(BuildNecklace), 5000);
                    }
                }
            }
        }
Example #42
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            /* First thing we do in here is to search for the NPCs inside
            * the world who comes from the certain Realm. If we find a the players,
            * this means we don't have to create a new one.
            *
            * NOTE: You can do anything you want in this method, you don't have
            * to search for NPC's ... you could create a custom item, place it
            * on the ground and if a player picks it up, he will get the quest!
            * Just examples, do anything you like and feel comfortable with :)
            */

            #region defineNPCs

            masterFrederick = GetMasterFrederick();

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Queen Tatiana", eRealm.None);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Queen Tatiana, creating ...");
                queenTatiana = new GameNPC();

                queenTatiana.Name = "Queen Tatiana";
                queenTatiana.X = 558500;
                queenTatiana.Y = 533042;
                queenTatiana.Z = 2573;
                queenTatiana.Heading = 174;
                queenTatiana.Model = 603;
                queenTatiana.GuildName = "Part of " + questTitle + " Quest";
                queenTatiana.Realm = eRealm.None;
                queenTatiana.CurrentRegionID = 1;
                queenTatiana.Size = 49;
                queenTatiana.Level = 5;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 30;
                brain.AggroRange = 600;
                queenTatiana.SetOwnBrain(brain);

                if (SAVE_INTO_DATABASE)
                    queenTatiana.SaveIntoDatabase();

                queenTatiana.AddToWorld();
            }
            else
            {
                queenTatiana = (GameNPC) npcs[0];
            }

            int counter = 0;
            foreach (GameNPC npc in queenTatiana.GetNPCsInRadius(500))
            {
                if (npc.Name == "ire fairy sorceress")
                {
                    fairySorceress[counter] = (GameNPC) npc;
                    counter++;
                }
                if (counter == fairySorceress.Length)
                    break;
            }

            for (int i = 0; i < fairySorceress.Length; i++)
            {
                if (fairySorceress[i] == null)
                {
                    if (log.IsWarnEnabled)
                        log.Warn("Could not find ire fairy sorceress, creating ...");
                    fairySorceress[i] = new GameNPC();
                    fairySorceress[i].Model = 603; // //819;
                    fairySorceress[i].Name = "ire fairy sorceress";
                    fairySorceress[i].GuildName = "Part of " + questTitle + " Quest";
                    fairySorceress[i].Realm = eRealm.None;
                    fairySorceress[i].CurrentRegionID = 1;
                    fairySorceress[i].Size = 35;
                    fairySorceress[i].Level = 5;
                    fairySorceress[i].X = queenTatiana.X + Util.Random(30, 150);
                    fairySorceress[i].Y = queenTatiana.Y + Util.Random(30, 150);
                    fairySorceress[i].Z = queenTatiana.Z;

                    StandardMobBrain brain = new StandardMobBrain();
                    brain.AggroLevel = 30;
                    brain.AggroRange = 600;
                    fairySorceress[i].SetOwnBrain(brain);

                    fairySorceress[i].Heading = 93;
                    //fairySorceress[i].EquipmentTemplateID = 200276;

                    //You don't have to store the created mob in the db if you don't want,
                    //it will be recreated each time it is not found, just comment the following
                    //line if you rather not modify your database
                    if (SAVE_INTO_DATABASE)
                        fairySorceress[i].SaveIntoDatabase();
                    fairySorceress[i].AddToWorld();
                }
            }

            #endregion

            #region defineItems

            queenTatianasHead = GameServer.Database.FindObjectByKey<ItemTemplate>("queen_tatianas_head");
            if (queenTatianasHead == null)
            {
                queenTatianasHead = new ItemTemplate();
                queenTatianasHead.Name = "Queen Tatiana's Head";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + queenTatianasHead.Name + " , creating it ...");

                queenTatianasHead.Weight = 15;
                queenTatianasHead.Model = 503;

                queenTatianasHead.Object_Type = (int) eObjectType.GenericItem;

                queenTatianasHead.Id_nb = "queen_tatianas_head";
                queenTatianasHead.IsPickable = true;
                queenTatianasHead.IsDropable = false;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(queenTatianasHead);
            }

            // item db check
            recruitsGauntlets = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_studded_gauntlets");
            if (recruitsGauntlets == null)
            {
                recruitsGauntlets = new ItemTemplate();
                recruitsGauntlets.Name = "Recruit's Studded Gauntles";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + recruitsGauntlets.Name + ", creating it ...");
                recruitsGauntlets.Level = 8;

                recruitsGauntlets.Weight = 24;
                recruitsGauntlets.Model = 80;

                recruitsGauntlets.DPS_AF = 14; // Armour
                recruitsGauntlets.SPD_ABS = 19; // Absorption

                recruitsGauntlets.Object_Type = (int) eObjectType.Studded;
                recruitsGauntlets.Item_Type = (int) eEquipmentItems.HAND;
                recruitsGauntlets.Id_nb = "recruits_studded_gauntlets";
                recruitsGauntlets.Price = Money.GetMoney(0,0,0,9,0);
                recruitsGauntlets.IsPickable = true;
                recruitsGauntlets.IsDropable = true;
                recruitsGauntlets.Color = 9; // red leather

                recruitsGauntlets.Bonus = 5; // default bonus

                recruitsGauntlets.Bonus1 = 4;
                recruitsGauntlets.Bonus1Type = (int) eStat.STR;

                recruitsGauntlets.Bonus2 = 3;
                recruitsGauntlets.Bonus2Type = (int) eStat.DEX;

                recruitsGauntlets.Quality = 100;
                recruitsGauntlets.Condition = 1000;
                recruitsGauntlets.MaxCondition = 1000;
                recruitsGauntlets.Durability = 1000;
                recruitsGauntlets.MaxDurability = 1000;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(recruitsGauntlets);
            }

            // item db check
            recruitsGloves = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_quilted_gloves");
            if (recruitsGloves == null)
            {
                recruitsGloves = new ItemTemplate();
                recruitsGloves.Name = "Recruit's Quilted Gloves";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + recruitsGloves.Name + ", creating it ...");
                recruitsGloves.Level = 8;

                recruitsGloves.Weight = 8;
                recruitsGloves.Model = 154;

                recruitsGloves.DPS_AF = 7; // Armour
                recruitsGloves.SPD_ABS = 0; // Absorption

                recruitsGloves.Object_Type = (int) eObjectType.Cloth;
                recruitsGloves.Item_Type = (int) eEquipmentItems.HAND;
                recruitsGloves.Id_nb = "recruits_quilted_gloves";
                recruitsGloves.Price = Money.GetMoney(0,0,0,9,0);
                recruitsGloves.IsPickable = true;
                recruitsGloves.IsDropable = true;
                recruitsGloves.Color = 27; // red leather

                recruitsGloves.Bonus = 5; // default bonus

                recruitsGloves.Bonus1 = 4;
                recruitsGloves.Bonus1Type = (int) eStat.INT;

                recruitsGloves.Bonus2 = 3;
                recruitsGloves.Bonus2Type = (int) eStat.DEX;

                recruitsGloves.Quality = 100;
                recruitsGloves.Condition = 1000;
                recruitsGloves.MaxCondition = 1000;
                recruitsGloves.Durability = 1000;
                recruitsGloves.MaxDurability = 1000;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(recruitsGloves);
            }

            recruitsJewel = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_cloudy_jewel");
            if (recruitsJewel == null)
            {
                recruitsJewel = new ItemTemplate();
                recruitsJewel.Name = "Recruit's Cloudy Jewel";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + recruitsJewel.Name + ", creating it ...");
                recruitsJewel.Level = 7;

                recruitsJewel.Weight = 2;
                recruitsJewel.Model = 110;

                recruitsJewel.Object_Type = (int) eObjectType.Magical;
                recruitsJewel.Item_Type = (int) eEquipmentItems.JEWEL;
                recruitsJewel.Id_nb = "recruits_cloudy_jewel";
                recruitsJewel.Price = Money.GetMoney(0,0,0,9,0);
                recruitsJewel.IsPickable = true;
                recruitsJewel.IsDropable = true;

                recruitsJewel.Bonus = 5; // default bonus

                recruitsJewel.Bonus1 = 6;
                recruitsJewel.Bonus1Type = (int) eStat.STR;

                recruitsJewel.Quality = 100;
                recruitsJewel.Condition = 1000;
                recruitsJewel.MaxCondition = 1000;
                recruitsJewel.Durability = 1000;
                recruitsJewel.MaxDurability = 1000;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(recruitsJewel);
            }

            recruitsJewelCloth = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_cloudy_jewel_cloth");
            if (recruitsJewelCloth == null)
            {
                recruitsJewelCloth = new ItemTemplate();
                recruitsJewelCloth.Name = "Recruit's Cloudy Jewel";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + recruitsJewelCloth.Name + ", creating it ...");
                recruitsJewelCloth.Level = 7;

                recruitsJewelCloth.Weight = 2;
                recruitsJewelCloth.Model = 110;

                recruitsJewelCloth.Object_Type = (int) eObjectType.Magical;
                recruitsJewelCloth.Item_Type = (int) eEquipmentItems.JEWEL;
                recruitsJewelCloth.Id_nb = "recruits_cloudy_jewel_cloth";
                recruitsJewelCloth.Price = Money.GetMoney(0,0,0,9,0);
                recruitsJewelCloth.IsPickable = true;
                recruitsJewelCloth.IsDropable = true;

                recruitsJewelCloth.Bonus = 5; // default bonus

                recruitsJewelCloth.Bonus1 = 4;
                recruitsJewelCloth.Bonus1Type = (int) eStat.INT;

                recruitsJewelCloth.Bonus2 = 3;
                recruitsJewelCloth.Bonus2Type = (int) eStat.CON;

                recruitsJewelCloth.Bonus3 = 1;
                recruitsJewelCloth.Bonus3Type = (int) eResist.Body;

                recruitsJewelCloth.Quality = 100;
                recruitsJewelCloth.Condition = 1000;
                recruitsJewelCloth.MaxCondition = 1000;
                recruitsJewelCloth.Durability = 1000;
                recruitsJewelCloth.MaxDurability = 1000;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(recruitsJewelCloth);
            }

            recruitsBracer = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_golden_bracer");
            if (recruitsBracer == null)
            {
                recruitsBracer = new ItemTemplate();
                recruitsBracer.Name = "Recruit's Golden Bracer";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + recruitsBracer.Name + ", creating it ...");
                recruitsBracer.Level = 7;

                recruitsBracer.Weight = 2;
                recruitsBracer.Model = 121;

                recruitsBracer.Object_Type = (int) eObjectType.Magical;
                recruitsBracer.Item_Type = (int) eEquipmentItems.R_BRACER;
                recruitsBracer.Id_nb = "recruits_golden_bracer";
                recruitsBracer.Price = Money.GetMoney(0,0,0,9,0);
                recruitsBracer.IsPickable = true;
                recruitsBracer.IsDropable = true;

                recruitsBracer.Bonus = 5; // default bonus

                recruitsBracer.Bonus1 = 4;
                recruitsBracer.Bonus1Type = (int) eStat.STR;

                recruitsBracer.Bonus2 = 3;
                recruitsBracer.Bonus2Type = (int) eStat.CON;

                recruitsBracer.Bonus3 = 1;
                recruitsBracer.Bonus3Type = (int) eResist.Body;

                recruitsBracer.Quality = 100;
                recruitsBracer.Condition = 1000;
                recruitsBracer.MaxCondition = 1000;
                recruitsBracer.Durability = 1000;
                recruitsBracer.MaxDurability = 1000;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(recruitsBracer);
            }

            #endregion

            /* Now we add some hooks to the npc we found.
            * Actually, we want to know when a player interacts with him.
            * So, we hook the right-click (interact) and the whisper method
            * of npc and set the callback method to the "TalkToXXX"
            * method. This means, the "TalkToXXX" method is called whenever
            * a player right clicks on him or when he whispers to him.
            */

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            //We want to be notified whenever a player enters the world
            GameEventMgr.AddHandler(GamePlayerEvent.GameEntered, new DOLEventHandler(PlayerEnterWorld));

            GameEventMgr.AddHandler(masterFrederick, GameLivingEvent.Interact, new DOLEventHandler(TalkToMasterFrederick));
            GameEventMgr.AddHandler(masterFrederick, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMasterFrederick));

            GameEventMgr.AddHandler(queenTatiana, GameNPCEvent.OnAICallback, new DOLEventHandler(CheckNearQueenTatiana));

            /* Now we bring to masterFrederick the possibility to give this quest to players */
            masterFrederick.AddQuestToGive(typeof (Culmination));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Example #43
0
        protected void CreateDunwynClone()
        {
            GameNpcInventoryTemplate template;
            if (dunwynClone == null)
            {
                dunwynClone = new GameNPC();
                dunwynClone.Name = "Master Dunwyn";
                dunwynClone.Model = 9;
                dunwynClone.GuildName = "Part of " + questTitle + " Quest";
                dunwynClone.Realm = eRealm.Albion;
                dunwynClone.CurrentRegionID = 1;
                dunwynClone.Size = 50;
                dunwynClone.Level = 14;

                dunwynClone.X = GameLocation.ConvertLocalXToGlobalX(8602, 0) + Util.Random(-150, 150);
                dunwynClone.Y = GameLocation.ConvertLocalYToGlobalY(47193, 0) + Util.Random(-150, 150);
                dunwynClone.Z = 2409;
                dunwynClone.Heading = 342;

                template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 798);
                template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 19);
                dunwynClone.Inventory = template.CloseTemplate();
                dunwynClone.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

            //				dunwynClone.AddNPCEquipment((byte) eEquipmentItems.TORSO, 798, 0, 0, 0);
            //				dunwynClone.AddNPCEquipment((byte) eEquipmentItems.RIGHT_HAND, 19, 0, 0, 0);

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                dunwynClone.SetOwnBrain(brain);

                dunwynClone.AddToWorld();

                GameEventMgr.AddHandler(dunwynClone, GameLivingEvent.Interact, new DOLEventHandler(TalkToMasterDunwyn));
                GameEventMgr.AddHandler(dunwynClone, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMasterDunwyn));
            }
            else
            {
                dunwynClone.MoveTo(1, 567604, 509619, 2813, 3292);
            }

            foreach (GamePlayer visPlayer in dunwynClone.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
            {
                visPlayer.Out.SendEmoteAnimation(dunwynClone, eEmote.Bind);
            }

            for (int i = 0; i < recruits.Length; i++)
            {
                recruits[i] = new GameNPC();

                recruits[i].Name = "Recruit";

                recruits[i].GuildName = "Part of " + questTitle + " Quest";
                recruits[i].Realm = eRealm.Albion;
                recruits[i].CurrentRegionID = 1;

                recruits[i].Size = 50;
                recruits[i].Level = 6;
                recruits[i].X = GameLocation.ConvertLocalXToGlobalX(8602, 0) + Util.Random(-150, 150);
                recruits[i].Y = GameLocation.ConvertLocalYToGlobalY(47193, 0) + Util.Random(-150, 150);

                recruits[i].Z = 2409;
                recruits[i].Heading = 187;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                recruits[i].SetOwnBrain(brain);

            }

            recruits[0].Name = "Recruit Armsman McTavish";
            recruits[0].Model = 40;
            template = new GameNpcInventoryTemplate();
            template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 69);
            template.AddNPCEquipment(eInventorySlot.TorsoArmor, 46);
            template.AddNPCEquipment(eInventorySlot.LegsArmor, 47);
            template.AddNPCEquipment(eInventorySlot.FeetArmor, 50);
            template.AddNPCEquipment(eInventorySlot.ArmsArmor, 48);
            template.AddNPCEquipment(eInventorySlot.HandsArmor, 49);
            recruits[0].Inventory = template.CloseTemplate();
            recruits[0].SwitchWeapon(GameLiving.eActiveWeaponSlot.TwoHanded);

            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.TWO_HANDED, 69, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.TORSO, 46, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.LEGS, 47, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.FEET, 50, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.ARMS, 48, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.HAND, 49, 0, 0, 0);

            recruits[1].Name = "Recruit Paladin Andral";
            recruits[1].Model = 41;
            template = new GameNpcInventoryTemplate();
            template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 6);
            template.AddNPCEquipment(eInventorySlot.TorsoArmor, 41);
            template.AddNPCEquipment(eInventorySlot.LegsArmor, 42);
            template.AddNPCEquipment(eInventorySlot.FeetArmor, 45);
            template.AddNPCEquipment(eInventorySlot.ArmsArmor, 43);
            template.AddNPCEquipment(eInventorySlot.HandsArmor, 44);
            recruits[1].Inventory = template.CloseTemplate();
            recruits[1].SwitchWeapon(GameLiving.eActiveWeaponSlot.TwoHanded);

            //			recruits[1].AddNPCEquipment((byte) eEquipmentItems.TWO_HANDED, 6, 0, 0, 0);
            //			recruits[1].AddNPCEquipment((byte) eEquipmentItems.TORSO, 41, 0, 0, 0);
            //			recruits[1].AddNPCEquipment((byte) eEquipmentItems.LEGS, 42, 0, 0, 0);
            //			recruits[1].AddNPCEquipment((byte) eEquipmentItems.FEET, 45, 0, 0, 0);
            //			recruits[1].AddNPCEquipment((byte) eEquipmentItems.ARMS, 43, 0, 0, 0);
            //			recruits[1].AddNPCEquipment((byte) eEquipmentItems.HAND, 44, 0, 0, 0);

            recruits[2].Name = "Recruit Scout Gillman";
            recruits[2].Model = 32;
            template = new GameNpcInventoryTemplate();
            template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 4);
            template.AddNPCEquipment(eInventorySlot.TorsoArmor, 36);
            template.AddNPCEquipment(eInventorySlot.LegsArmor, 37);
            recruits[2].Inventory = template.CloseTemplate();
            recruits[2].SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

            //			recruits[2].AddNPCEquipment((byte) eEquipmentItems.RIGHT_HAND, 4, 0, 0, 0);
            //			recruits[2].AddNPCEquipment((byte) eEquipmentItems.TORSO, 36, 0, 0, 0);
            //			recruits[2].AddNPCEquipment((byte) eEquipmentItems.LEGS, 37, 0, 0, 0);

            recruits[3].Name = "Recruit Scout Stuart";
            recruits[3].Model = 32;
            template = new GameNpcInventoryTemplate();
            template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 5);
            template.AddNPCEquipment(eInventorySlot.TorsoArmor, 36);
            template.AddNPCEquipment(eInventorySlot.LegsArmor, 37);
            recruits[3].Inventory = template.CloseTemplate();
            recruits[3].SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

            //			recruits[3].AddNPCEquipment((byte) eEquipmentItems.RIGHT_HAND, 5, 0, 0, 0);
            //			recruits[3].AddNPCEquipment((byte) eEquipmentItems.TORSO, 36, 0, 0, 0);
            //			recruits[3].AddNPCEquipment((byte) eEquipmentItems.LEGS, 37, 0, 0, 0);

            for (int i = 0; i < recruits.Length; i++)
            {
                recruits[i].AddToWorld();
            }
        }
Example #44
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            }

            /* First thing we do in here is to search for the NPCs inside
             * the world who comes from the certain Realm. If we find a the players,
             * this means we don't have to create a new one.
             *
             * NOTE: You can do anything you want in this method, you don't have
             * to search for NPC's ... you could create a custom item, place it
             * on the ground and if a player picks it up, he will get the quest!
             * Just examples, do anything you like and feel comfortable with :)
             */

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Sir Jerem", eRealm.Albion);

            /* Whops, if the npcs array length is 0 then no npc exists in
             * this users Mob Database, so we simply create one ;-)
             * else we take the existing one. And if more than one exist, we take
             * the first ...
             */
            if (npcs.Length == 0)
            {
                sirJerem       = new GameNPC();
                sirJerem.Model = 254;
                sirJerem.Name  = "Sir Jerem";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + sirJerem.Name + ", creating him ...");
                }
                sirJerem.GuildName       = "Part of " + questTitle + " Quest";
                sirJerem.Realm           = eRealm.Albion;
                sirJerem.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 68, 21);
                template.AddNPCEquipment(eInventorySlot.HeadArmor, 64);
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 49);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 50);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 46);
                template.AddNPCEquipment(eInventorySlot.Cloak, 57, 27);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 47);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 158);
                sirJerem.Inventory = template.CloseTemplate();
                sirJerem.SwitchWeapon(GameLiving.eActiveWeaponSlot.TwoHanded);

                sirJerem.Size    = 51;
                sirJerem.Level   = 38;
                sirJerem.X       = 573815;
                sirJerem.Y       = 530850;
                sirJerem.Z       = 2933;
                sirJerem.Heading = 2685;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                if (SAVE_INTO_DATABASE)
                {
                    sirJerem.SaveIntoDatabase();
                }

                sirJerem.AddToWorld();
            }
            else
            {
                sirJerem = npcs[0];
            }

            npcs = WorldMgr.GetNPCsByName("Squire Galune", eRealm.Albion);
            if (npcs.Length == 0)
            {
                squireGalune       = new GameNPC();
                squireGalune.Model = 254;
                squireGalune.Name  = "Squire Galune";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + squireGalune.Name + ", creating him ...");
                }
                squireGalune.GuildName       = "Part of " + questTitle + " Quest";
                squireGalune.Realm           = eRealm.Albion;
                squireGalune.CurrentRegionID = 21;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 320);
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 137);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 138);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 134);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 135);
                squireGalune.Inventory = template.CloseTemplate();
                squireGalune.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                squireGalune.Size    = 45;
                squireGalune.Level   = 8;
                squireGalune.X       = 33219;
                squireGalune.Y       = 31931;
                squireGalune.Z       = 16240;
                squireGalune.Heading = 477;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                {
                    squireGalune.SaveIntoDatabase();
                }

                squireGalune.AddToWorld();
            }
            else
            {
                squireGalune = npcs[0];
            }


            foreach (GameNPC npc in squireGalune.GetNPCsInRadius(400))
            {
                if (npc.Name == "small spider")
                {
                    smallSpider = npc;
                    break;
                }
            }

            if (smallSpider == null)
            {
                smallSpider       = new GameNPC();
                smallSpider.Model = 72;
                smallSpider.Name  = "small spider";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + smallSpider.Name + ", creating him ...");
                }
                smallSpider.GuildName       = "Part of " + questTitle + " Quest";
                smallSpider.Realm           = eRealm.None;
                smallSpider.CurrentRegionID = 21;
                smallSpider.Size            = 17;
                smallSpider.Level           = 5;
                smallSpider.X = 33158;
                smallSpider.Y = 31973;
                smallSpider.Z = 16240;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                smallSpider.SetOwnBrain(brain);

                smallSpider.Heading      = 2605;
                smallSpider.MaxSpeedBase = 0;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                if (SAVE_INTO_DATABASE)
                {
                    smallSpider.SaveIntoDatabase();
                }

                smallSpider.AddToWorld();
            }

            #endregion


            /* Now we add some hooks to the npc we found.
             * Actually, we want to know when a player interacts with him.
             * So, we hook the right-click (interact) and the whisper method
             * of npc and set the callback method to the "TalkToXXX"
             * method. This means, the "TalkToXXX" method is called whenever
             * a player right clicks on him or when he whispers to him.
             */

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            GameEventMgr.AddHandler(sirJerem, GameLivingEvent.Interact, new DOLEventHandler(TalkToSirJerem));
            GameEventMgr.AddHandler(sirJerem, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToSirJerem));

            GameEventMgr.AddHandler(squireGalune, GameLivingEvent.Interact, new DOLEventHandler(TalkToSquireGalune));
            GameEventMgr.AddHandler(squireGalune, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToSquireGalune));

            /* Now we bring to Ydenia the possibility to give this quest to players */
            sirJerem.AddQuestToGive(typeof(ShakenSquire));

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Example #45
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            }

            #region defineNPCs

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Inaksha", eRealm.Midgard);

            if (npcs.Length > 0)
            {
                foreach (GameNPC npc in npcs)
                {
                    if (npc.CurrentRegionID == 100 && npc.X == 805929 && npc.Y == 702449)
                    {
                        Inaksha = npc;
                        break;
                    }
                }
            }

            if (Inaksha == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Inaksha , creating it ...");
                }
                Inaksha                 = new GameNPC();
                Inaksha.Model           = 193;
                Inaksha.Name            = "Inaksha";
                Inaksha.GuildName       = "";
                Inaksha.Realm           = eRealm.Midgard;
                Inaksha.CurrentRegionID = 100;
                Inaksha.Size            = 50;
                Inaksha.Level           = 41;
                Inaksha.X               = 805929;
                Inaksha.Y               = 702449;
                Inaksha.Z               = 4960;
                Inaksha.Heading         = 2116;
                Inaksha.AddToWorld();
                if (SAVE_INTO_DATABASE)
                {
                    Inaksha.SaveIntoDatabase();
                }
            }
            // end npc

            npcs = WorldMgr.GetNPCsByName("Loken", eRealm.None);

            if (npcs.Length > 0)
            {
                foreach (GameNPC npc in npcs)
                {
                    if (npc.CurrentRegionID == 100 && npc.X == 636784 && npc.Y == 762433)
                    {
                        Loken = npc;
                        break;
                    }
                }
            }

            if (Loken == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Loken , creating it ...");
                }
                Loken                 = new GameNPC();
                Loken.Model           = 212;
                Loken.Name            = "Loken";
                Loken.GuildName       = "";
                Loken.Realm           = eRealm.None;
                Loken.CurrentRegionID = 100;
                Loken.Size            = 50;
                Loken.Level           = 65;
                Loken.X               = 636784;
                Loken.Y               = 762433;
                Loken.Z               = 4596;
                Loken.Heading         = 3777;
                Loken.AddToWorld();
                if (SAVE_INTO_DATABASE)
                {
                    Loken.SaveIntoDatabase();
                }
            }
            // end npc

            npcs = WorldMgr.GetNPCsByName("Miri", eRealm.Midgard);

            if (npcs.Length > 0)
            {
                foreach (GameNPC npc in npcs)
                {
                    if (npc.CurrentRegionID == 101 && npc.X == 30641 && npc.Y == 32093)
                    {
                        Miri = npc;
                        break;
                    }
                }
            }

            if (Miri == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Miri , creating it ...");
                }
                Miri                 = new GameNPC();
                Miri.Model           = 220;
                Miri.Name            = "Miri";
                Miri.GuildName       = "";
                Miri.Realm           = eRealm.Midgard;
                Miri.CurrentRegionID = 101;
                Miri.Size            = 50;
                Miri.Level           = 43;
                Miri.X               = 30641;
                Miri.Y               = 32093;
                Miri.Z               = 8305;
                Miri.Heading         = 3037;
                Miri.AddToWorld();
                if (SAVE_INTO_DATABASE)
                {
                    Miri.SaveIntoDatabase();
                }
            }
            // end npc

            #endregion

            #region defineItems

            ball_of_flame = GameServer.Database.FindObjectByKey <ItemTemplate>("ball_of_flame");
            if (ball_of_flame == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find ball_of_flame , creating it ...");
                }
                ball_of_flame             = new ItemTemplate();
                ball_of_flame.Id_nb       = "ball_of_flame";
                ball_of_flame.Name        = "Ball of Flame";
                ball_of_flame.Level       = 8;
                ball_of_flame.Item_Type   = 29;
                ball_of_flame.Model       = 601;
                ball_of_flame.IsDropable  = false;
                ball_of_flame.IsPickable  = false;
                ball_of_flame.DPS_AF      = 0;
                ball_of_flame.SPD_ABS     = 0;
                ball_of_flame.Object_Type = 41;
                ball_of_flame.Hand        = 0;
                ball_of_flame.Type_Damage = 0;
                ball_of_flame.Quality     = 100;
                ball_of_flame.Weight      = 12;
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ball_of_flame);
                }
            }

// end item
            sealed_pouch = GameServer.Database.FindObjectByKey <ItemTemplate>("sealed_pouch");
            if (sealed_pouch == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Sealed Pouch , creating it ...");
                }
                sealed_pouch             = new ItemTemplate();
                sealed_pouch.Id_nb       = "sealed_pouch";
                sealed_pouch.Name        = "Sealed Pouch";
                sealed_pouch.Level       = 8;
                sealed_pouch.Item_Type   = 29;
                sealed_pouch.Model       = 488;
                sealed_pouch.IsDropable  = false;
                sealed_pouch.IsPickable  = false;
                sealed_pouch.DPS_AF      = 0;
                sealed_pouch.SPD_ABS     = 0;
                sealed_pouch.Object_Type = 41;
                sealed_pouch.Hand        = 0;
                sealed_pouch.Type_Damage = 0;
                sealed_pouch.Quality     = 100;
                sealed_pouch.Weight      = 12;
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(sealed_pouch);
                }
            }
// end item

            //Valhalla Touched Boots
            HealerEpicBoots = GameServer.Database.FindObjectByKey <ItemTemplate>("HealerEpicBoots");
            if (HealerEpicBoots == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Healers Epic Boots , creating it ...");
                }
                HealerEpicBoots               = new ItemTemplate();
                HealerEpicBoots.Id_nb         = "HealerEpicBoots";
                HealerEpicBoots.Name          = "Valhalla Touched Boots";
                HealerEpicBoots.Level         = 50;
                HealerEpicBoots.Item_Type     = 23;
                HealerEpicBoots.Model         = 702;
                HealerEpicBoots.IsDropable    = true;
                HealerEpicBoots.IsPickable    = true;
                HealerEpicBoots.DPS_AF        = 100;
                HealerEpicBoots.SPD_ABS       = 27;
                HealerEpicBoots.Object_Type   = 35;
                HealerEpicBoots.Quality       = 100;
                HealerEpicBoots.Weight        = 22;
                HealerEpicBoots.Bonus         = 35;
                HealerEpicBoots.MaxCondition  = 50000;
                HealerEpicBoots.MaxDurability = 50000;
                HealerEpicBoots.Condition     = 50000;
                HealerEpicBoots.Durability    = 50000;

                HealerEpicBoots.Bonus1     = 12;
                HealerEpicBoots.Bonus1Type = (int)eStat.CON;

                HealerEpicBoots.Bonus2     = 12;
                HealerEpicBoots.Bonus2Type = (int)eStat.DEX;

                HealerEpicBoots.Bonus3     = 12;
                HealerEpicBoots.Bonus3Type = (int)eStat.QUI;

                HealerEpicBoots.Bonus4     = 21;
                HealerEpicBoots.Bonus4Type = (int)eProperty.MaxHealth;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(HealerEpicBoots);
                }
            }
//end item
            //Valhalla Touched Coif
            HealerEpicHelm = GameServer.Database.FindObjectByKey <ItemTemplate>("HealerEpicHelm");
            if (HealerEpicHelm == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Healers Epic Helm , creating it ...");
                }
                HealerEpicHelm               = new ItemTemplate();
                HealerEpicHelm.Id_nb         = "HealerEpicHelm";
                HealerEpicHelm.Name          = "Valhalla Touched Coif";
                HealerEpicHelm.Level         = 50;
                HealerEpicHelm.Item_Type     = 21;
                HealerEpicHelm.Model         = 1291;         //NEED TO WORK ON..
                HealerEpicHelm.IsDropable    = true;
                HealerEpicHelm.IsPickable    = true;
                HealerEpicHelm.DPS_AF        = 100;
                HealerEpicHelm.SPD_ABS       = 27;
                HealerEpicHelm.Object_Type   = 35;
                HealerEpicHelm.Quality       = 100;
                HealerEpicHelm.Weight        = 22;
                HealerEpicHelm.Bonus         = 35;
                HealerEpicHelm.MaxCondition  = 50000;
                HealerEpicHelm.MaxDurability = 50000;
                HealerEpicHelm.Condition     = 50000;
                HealerEpicHelm.Durability    = 50000;

                HealerEpicHelm.Bonus1     = 4;
                HealerEpicHelm.Bonus1Type = (int)eProperty.Skill_Augmentation;

                HealerEpicHelm.Bonus2     = 18;
                HealerEpicHelm.Bonus2Type = (int)eStat.PIE;

                HealerEpicHelm.Bonus3     = 4;
                HealerEpicHelm.Bonus3Type = (int)eResist.Slash;

                HealerEpicHelm.Bonus4     = 6;
                HealerEpicHelm.Bonus4Type = (int)eProperty.PowerRegenerationRate;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(HealerEpicHelm);
                }
            }
//end item
            //Valhalla Touched Gloves
            HealerEpicGloves = GameServer.Database.FindObjectByKey <ItemTemplate>("HealerEpicGloves");
            if (HealerEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Healers Epic Gloves , creating it ...");
                }
                HealerEpicGloves               = new ItemTemplate();
                HealerEpicGloves.Id_nb         = "HealerEpicGloves";
                HealerEpicGloves.Name          = "Valhalla Touched Gloves ";
                HealerEpicGloves.Level         = 50;
                HealerEpicGloves.Item_Type     = 22;
                HealerEpicGloves.Model         = 701;
                HealerEpicGloves.IsDropable    = true;
                HealerEpicGloves.IsPickable    = true;
                HealerEpicGloves.DPS_AF        = 100;
                HealerEpicGloves.SPD_ABS       = 27;
                HealerEpicGloves.Object_Type   = 35;
                HealerEpicGloves.Quality       = 100;
                HealerEpicGloves.Weight        = 22;
                HealerEpicGloves.Bonus         = 35;
                HealerEpicGloves.MaxCondition  = 50000;
                HealerEpicGloves.MaxDurability = 50000;
                HealerEpicGloves.Condition     = 50000;
                HealerEpicGloves.Durability    = 50000;

                HealerEpicGloves.Bonus1     = 4;
                HealerEpicGloves.Bonus1Type = (int)eProperty.Skill_Mending;

                HealerEpicGloves.Bonus2     = 16;
                HealerEpicGloves.Bonus2Type = (int)eStat.PIE;

                HealerEpicGloves.Bonus3     = 4;
                HealerEpicGloves.Bonus3Type = (int)eResist.Crush;

                HealerEpicGloves.Bonus4     = 6;
                HealerEpicGloves.Bonus4Type = (int)eProperty.PowerRegenerationRate;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(HealerEpicGloves);
                }
            }
            //Valhalla Touched Hauberk
            HealerEpicVest = GameServer.Database.FindObjectByKey <ItemTemplate>("HealerEpicVest");
            if (HealerEpicVest == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Healers Epic Vest , creating it ...");
                }
                HealerEpicVest               = new ItemTemplate();
                HealerEpicVest.Id_nb         = "HealerEpicVest";
                HealerEpicVest.Name          = "Valhalla Touched Haukberk";
                HealerEpicVest.Level         = 50;
                HealerEpicVest.Item_Type     = 25;
                HealerEpicVest.Model         = 698;
                HealerEpicVest.IsDropable    = true;
                HealerEpicVest.IsPickable    = true;
                HealerEpicVest.DPS_AF        = 100;
                HealerEpicVest.SPD_ABS       = 27;
                HealerEpicVest.Object_Type   = 35;
                HealerEpicVest.Quality       = 100;
                HealerEpicVest.Weight        = 22;
                HealerEpicVest.Bonus         = 35;
                HealerEpicVest.MaxCondition  = 50000;
                HealerEpicVest.MaxDurability = 50000;
                HealerEpicVest.Condition     = 50000;
                HealerEpicVest.Durability    = 50000;

                HealerEpicVest.Bonus1     = 16;
                HealerEpicVest.Bonus1Type = (int)eStat.CON;

                HealerEpicVest.Bonus2     = 16;
                HealerEpicVest.Bonus2Type = (int)eStat.PIE;

                HealerEpicVest.Bonus3     = 8;
                HealerEpicVest.Bonus3Type = (int)eResist.Cold;

                HealerEpicVest.Bonus4     = 10;
                HealerEpicVest.Bonus4Type = (int)eResist.Heat;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(HealerEpicVest);
                }
            }
            //Valhalla Touched Legs
            HealerEpicLegs = GameServer.Database.FindObjectByKey <ItemTemplate>("HealerEpicLegs");
            if (HealerEpicLegs == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Healers Epic Legs , creating it ...");
                }
                HealerEpicLegs               = new ItemTemplate();
                HealerEpicLegs.Id_nb         = "HealerEpicLegs";
                HealerEpicLegs.Name          = "Valhalla Touched Legs";
                HealerEpicLegs.Level         = 50;
                HealerEpicLegs.Item_Type     = 27;
                HealerEpicLegs.Model         = 699;
                HealerEpicLegs.IsDropable    = true;
                HealerEpicLegs.IsPickable    = true;
                HealerEpicLegs.DPS_AF        = 100;
                HealerEpicLegs.SPD_ABS       = 27;
                HealerEpicLegs.Object_Type   = 35;
                HealerEpicLegs.Quality       = 100;
                HealerEpicLegs.Weight        = 22;
                HealerEpicLegs.Bonus         = 35;
                HealerEpicLegs.MaxCondition  = 50000;
                HealerEpicLegs.MaxDurability = 50000;
                HealerEpicLegs.Condition     = 50000;
                HealerEpicLegs.Durability    = 50000;

                HealerEpicLegs.Bonus1     = 15;
                HealerEpicLegs.Bonus1Type = (int)eStat.STR;

                HealerEpicLegs.Bonus2     = 16;
                HealerEpicLegs.Bonus2Type = (int)eStat.CON;

                HealerEpicLegs.Bonus3     = 10;
                HealerEpicLegs.Bonus3Type = (int)eResist.Spirit;

                HealerEpicLegs.Bonus4     = 10;
                HealerEpicLegs.Bonus4Type = (int)eResist.Energy;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(HealerEpicLegs);
                }
            }
            //Valhalla Touched Sleeves
            HealerEpicArms = GameServer.Database.FindObjectByKey <ItemTemplate>("HealerEpicArms");
            if (HealerEpicArms == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Healer Epic Arms , creating it ...");
                }
                HealerEpicArms               = new ItemTemplate();
                HealerEpicArms.Id_nb         = "HealerEpicArms";
                HealerEpicArms.Name          = "Valhalla Touched Sleeves";
                HealerEpicArms.Level         = 50;
                HealerEpicArms.Item_Type     = 28;
                HealerEpicArms.Model         = 700;
                HealerEpicArms.IsDropable    = true;
                HealerEpicArms.IsPickable    = true;
                HealerEpicArms.DPS_AF        = 100;
                HealerEpicArms.SPD_ABS       = 27;
                HealerEpicArms.Object_Type   = 35;
                HealerEpicArms.Quality       = 100;
                HealerEpicArms.Weight        = 22;
                HealerEpicArms.Bonus         = 35;
                HealerEpicArms.MaxCondition  = 50000;
                HealerEpicArms.MaxDurability = 50000;
                HealerEpicArms.Condition     = 50000;
                HealerEpicArms.Durability    = 50000;

                HealerEpicArms.Bonus1     = 4;
                HealerEpicArms.Bonus1Type = (int)eProperty.Skill_Mending;

                HealerEpicArms.Bonus2     = 13;
                HealerEpicArms.Bonus2Type = (int)eStat.STR;

                HealerEpicArms.Bonus3     = 15;
                HealerEpicArms.Bonus3Type = (int)eStat.PIE;

                HealerEpicArms.Bonus4     = 6;
                HealerEpicArms.Bonus4Type = (int)eResist.Matter;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(HealerEpicArms);
                }
            }
            //Subterranean Boots
            ShamanEpicBoots = GameServer.Database.FindObjectByKey <ItemTemplate>("ShamanEpicBoots");
            if (ShamanEpicBoots == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Shaman Epic Boots , creating it ...");
                }
                ShamanEpicBoots               = new ItemTemplate();
                ShamanEpicBoots.Id_nb         = "ShamanEpicBoots";
                ShamanEpicBoots.Name          = "Subterranean Boots";
                ShamanEpicBoots.Level         = 50;
                ShamanEpicBoots.Item_Type     = 23;
                ShamanEpicBoots.Model         = 770;
                ShamanEpicBoots.IsDropable    = true;
                ShamanEpicBoots.IsPickable    = true;
                ShamanEpicBoots.DPS_AF        = 100;
                ShamanEpicBoots.SPD_ABS       = 27;
                ShamanEpicBoots.Object_Type   = 35;
                ShamanEpicBoots.Quality       = 100;
                ShamanEpicBoots.Weight        = 22;
                ShamanEpicBoots.Bonus         = 35;
                ShamanEpicBoots.MaxCondition  = 50000;
                ShamanEpicBoots.MaxDurability = 50000;
                ShamanEpicBoots.Condition     = 50000;
                ShamanEpicBoots.Durability    = 50000;

                ShamanEpicBoots.Bonus1     = 13;
                ShamanEpicBoots.Bonus1Type = (int)eStat.DEX;

                ShamanEpicBoots.Bonus2     = 13;
                ShamanEpicBoots.Bonus2Type = (int)eStat.QUI;

                ShamanEpicBoots.Bonus3     = 39;
                ShamanEpicBoots.Bonus3Type = (int)eProperty.MaxHealth;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ShamanEpicBoots);
                }
            }
            //Subterranean Coif
            ShamanEpicHelm = GameServer.Database.FindObjectByKey <ItemTemplate>("ShamanEpicHelm");
            if (ShamanEpicHelm == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Shaman Epic Helm , creating it ...");
                }
                ShamanEpicHelm               = new ItemTemplate();
                ShamanEpicHelm.Id_nb         = "ShamanEpicHelm";
                ShamanEpicHelm.Name          = "Subterranean Coif";
                ShamanEpicHelm.Level         = 50;
                ShamanEpicHelm.Item_Type     = 21;
                ShamanEpicHelm.Model         = 63;         //NEED TO WORK ON..
                ShamanEpicHelm.IsDropable    = true;
                ShamanEpicHelm.IsPickable    = true;
                ShamanEpicHelm.DPS_AF        = 100;
                ShamanEpicHelm.SPD_ABS       = 27;
                ShamanEpicHelm.Object_Type   = 35;
                ShamanEpicHelm.Quality       = 100;
                ShamanEpicHelm.Weight        = 22;
                ShamanEpicHelm.Bonus         = 35;
                ShamanEpicHelm.MaxCondition  = 50000;
                ShamanEpicHelm.MaxDurability = 50000;
                ShamanEpicHelm.Condition     = 50000;
                ShamanEpicHelm.Durability    = 50000;

                ShamanEpicHelm.Bonus1     = 4;
                ShamanEpicHelm.Bonus1Type = (int)eProperty.Skill_Mending;

                ShamanEpicHelm.Bonus2     = 18;
                ShamanEpicHelm.Bonus2Type = (int)eStat.PIE;

                ShamanEpicHelm.Bonus3     = 4;
                ShamanEpicHelm.Bonus3Type = (int)eResist.Thrust;

                ShamanEpicHelm.Bonus4     = 6;
                ShamanEpicHelm.Bonus4Type = (int)eProperty.PowerRegenerationRate;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ShamanEpicHelm);
                }
            }
            //Subterranean Gloves
            ShamanEpicGloves = GameServer.Database.FindObjectByKey <ItemTemplate>("ShamanEpicGloves");
            if (ShamanEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Shaman Epic Gloves , creating it ...");
                }
                ShamanEpicGloves               = new ItemTemplate();
                ShamanEpicGloves.Id_nb         = "ShamanEpicGloves";
                ShamanEpicGloves.Name          = "Subterranean Gloves";
                ShamanEpicGloves.Level         = 50;
                ShamanEpicGloves.Item_Type     = 22;
                ShamanEpicGloves.Model         = 769;
                ShamanEpicGloves.IsDropable    = true;
                ShamanEpicGloves.IsPickable    = true;
                ShamanEpicGloves.DPS_AF        = 100;
                ShamanEpicGloves.SPD_ABS       = 27;
                ShamanEpicGloves.Object_Type   = 35;
                ShamanEpicGloves.Quality       = 100;
                ShamanEpicGloves.Weight        = 22;
                ShamanEpicGloves.Bonus         = 35;
                ShamanEpicGloves.MaxCondition  = 50000;
                ShamanEpicGloves.MaxDurability = 50000;
                ShamanEpicGloves.Condition     = 50000;
                ShamanEpicGloves.Durability    = 50000;

                ShamanEpicGloves.Bonus1     = 4;
                ShamanEpicGloves.Bonus1Type = (int)eProperty.Skill_Subterranean;

                ShamanEpicGloves.Bonus2     = 18;
                ShamanEpicGloves.Bonus2Type = (int)eStat.PIE;

                ShamanEpicGloves.Bonus3     = 4;
                ShamanEpicGloves.Bonus3Type = (int)eResist.Crush;

                ShamanEpicGloves.Bonus4     = 6;
                ShamanEpicGloves.Bonus4Type = (int)eProperty.PowerRegenerationRate;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ShamanEpicGloves);
                }
            }
            //Subterranean Hauberk
            ShamanEpicVest = GameServer.Database.FindObjectByKey <ItemTemplate>("ShamanEpicVest");
            if (ShamanEpicVest == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Shaman Epic Vest , creating it ...");
                }
                ShamanEpicVest               = new ItemTemplate();
                ShamanEpicVest.Id_nb         = "ShamanEpicVest";
                ShamanEpicVest.Name          = "Subterranean Hauberk";
                ShamanEpicVest.Level         = 50;
                ShamanEpicVest.Item_Type     = 25;
                ShamanEpicVest.Model         = 766;
                ShamanEpicVest.IsDropable    = true;
                ShamanEpicVest.IsPickable    = true;
                ShamanEpicVest.DPS_AF        = 100;
                ShamanEpicVest.SPD_ABS       = 27;
                ShamanEpicVest.Object_Type   = 35;
                ShamanEpicVest.Quality       = 100;
                ShamanEpicVest.Weight        = 22;
                ShamanEpicVest.Bonus         = 35;
                ShamanEpicVest.MaxCondition  = 50000;
                ShamanEpicVest.MaxDurability = 50000;
                ShamanEpicVest.Condition     = 50000;
                ShamanEpicVest.Durability    = 50000;

                ShamanEpicVest.Bonus1     = 16;
                ShamanEpicVest.Bonus1Type = (int)eStat.CON;

                ShamanEpicVest.Bonus2     = 16;
                ShamanEpicVest.Bonus2Type = (int)eStat.PIE;

                ShamanEpicVest.Bonus3     = 10;
                ShamanEpicVest.Bonus3Type = (int)eResist.Matter;

                ShamanEpicVest.Bonus4     = 8;
                ShamanEpicVest.Bonus4Type = (int)eResist.Heat;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ShamanEpicVest);
                }
            }
            //Subterranean Legs
            ShamanEpicLegs = GameServer.Database.FindObjectByKey <ItemTemplate>("ShamanEpicLegs");
            if (ShamanEpicLegs == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Shaman Epic Legs , creating it ...");
                }
                ShamanEpicLegs               = new ItemTemplate();
                ShamanEpicLegs.Id_nb         = "ShamanEpicLegs";
                ShamanEpicLegs.Name          = "Subterranean Legs";
                ShamanEpicLegs.Level         = 50;
                ShamanEpicLegs.Item_Type     = 27;
                ShamanEpicLegs.Model         = 767;
                ShamanEpicLegs.IsDropable    = true;
                ShamanEpicLegs.IsPickable    = true;
                ShamanEpicLegs.DPS_AF        = 100;
                ShamanEpicLegs.SPD_ABS       = 27;
                ShamanEpicLegs.Object_Type   = 35;
                ShamanEpicLegs.Quality       = 100;
                ShamanEpicLegs.Weight        = 22;
                ShamanEpicLegs.Bonus         = 35;
                ShamanEpicLegs.MaxCondition  = 50000;
                ShamanEpicLegs.MaxDurability = 50000;
                ShamanEpicLegs.Condition     = 50000;
                ShamanEpicLegs.Durability    = 50000;

                ShamanEpicLegs.Bonus1     = 16;
                ShamanEpicLegs.Bonus1Type = (int)eStat.CON;

                ShamanEpicLegs.Bonus2     = 16;
                ShamanEpicLegs.Bonus2Type = (int)eStat.DEX;

                ShamanEpicLegs.Bonus3     = 8;
                ShamanEpicLegs.Bonus3Type = (int)eResist.Cold;

                ShamanEpicLegs.Bonus4     = 10;
                ShamanEpicLegs.Bonus4Type = (int)eResist.Spirit;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ShamanEpicLegs);
                }
            }
            //Subterranean Sleeves
            ShamanEpicArms = GameServer.Database.FindObjectByKey <ItemTemplate>("ShamanEpicArms");
            if (ShamanEpicArms == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Shaman Epic Arms , creating it ...");
                }
                ShamanEpicArms               = new ItemTemplate();
                ShamanEpicArms.Id_nb         = "ShamanEpicArms";
                ShamanEpicArms.Name          = "Subterranean Sleeves";
                ShamanEpicArms.Level         = 50;
                ShamanEpicArms.Item_Type     = 28;
                ShamanEpicArms.Model         = 768;
                ShamanEpicArms.IsDropable    = true;
                ShamanEpicArms.IsPickable    = true;
                ShamanEpicArms.DPS_AF        = 100;
                ShamanEpicArms.SPD_ABS       = 27;
                ShamanEpicArms.Object_Type   = 35;
                ShamanEpicArms.Quality       = 100;
                ShamanEpicArms.Weight        = 22;
                ShamanEpicArms.Bonus         = 35;
                ShamanEpicArms.MaxCondition  = 50000;
                ShamanEpicArms.MaxDurability = 50000;
                ShamanEpicArms.Condition     = 50000;
                ShamanEpicArms.Durability    = 50000;

                ShamanEpicArms.Bonus1     = 4;
                ShamanEpicArms.Bonus1Type = (int)eProperty.Skill_Augmentation;

                ShamanEpicArms.Bonus2     = 12;
                ShamanEpicArms.Bonus2Type = (int)eStat.STR;

                ShamanEpicArms.Bonus3     = 18;
                ShamanEpicArms.Bonus3Type = (int)eStat.PIE;

                ShamanEpicArms.Bonus4     = 6;
                ShamanEpicArms.Bonus4Type = (int)eResist.Energy;


                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ShamanEpicArms);
                }
            }
//Shaman Epic Sleeves End
//Item Descriptions End

            #endregion

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            GameEventMgr.AddHandler(Inaksha, GameObjectEvent.Interact, new DOLEventHandler(TalkToInaksha));
            GameEventMgr.AddHandler(Inaksha, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToInaksha));
            GameEventMgr.AddHandler(Miri, GameObjectEvent.Interact, new DOLEventHandler(TalkToMiri));
            GameEventMgr.AddHandler(Miri, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMiri));

            /* Now we bring to Inaksha the possibility to give this quest to players */
            Inaksha.AddQuestToGive(typeof(Seer_50));

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Example #46
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            return;
            if (log.IsInfoEnabled)
            log.Info("Quest \"" + questTitle + "\" initializing ...");

            #region defineNPCs
            GameNPC[] npcs;

            npcs = WorldMgr.GetNPCsByName("Aegan",(eRealm) 2);
            if (npcs.Length == 0)
            {
                Aegan = new DOL.GS.GameNPC();
                    Aegan.Model = 232;
                Aegan.Name = "Aegan";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + Aegan.Name + ", creating ...");
                Aegan.GuildName = "Part of " + questTitle + " Quest";
                Aegan.Realm = eRealm.Midgard;
                Aegan.CurrentRegionID = 100;
                Aegan.Size = 51;
                Aegan.Level = 41;
                Aegan.MaxSpeedBase = 191;
                Aegan.Faction = FactionMgr.GetFactionByID(0);
                Aegan.X = 805398;
                Aegan.Y = 725829;
                Aegan.Z = 4700;
                Aegan.Heading = 3595;
                Aegan.RespawnInterval = -1;
                Aegan.BodyType = 0;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 500;
                Aegan.SetOwnBrain(brain);

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    Aegan.SaveIntoDatabase();

                Aegan.AddToWorld();

            }
            else
            {
                Aegan = npcs[0];
            }

            #endregion

            #region defineItems

            clawofblackmauler = GameServer.Database.FindObjectByKey<ItemTemplate>("clawofblackmauler");
            if (clawofblackmauler == null)
            {
                clawofblackmauler = new ItemTemplate();
                clawofblackmauler.Name = "Claw of Black Mauler";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + clawofblackmauler.Name + ", creating it ...");
                clawofblackmauler.Level = 50;
                clawofblackmauler.Weight = 5;
                clawofblackmauler.Model = 1;
                clawofblackmauler.Object_Type = 0;
                clawofblackmauler.Item_Type = 40;
                clawofblackmauler.Id_nb = "clawofblackmauler";
                clawofblackmauler.Hand = 0;
                clawofblackmauler.Price = 0;
                clawofblackmauler.IsPickable = true;
                clawofblackmauler.IsDropable = true;
                clawofblackmauler.IsTradable = true;
                clawofblackmauler.CanDropAsLoot = false;
                clawofblackmauler.Color = 0;
                clawofblackmauler.Bonus = 35; // default bonus
                clawofblackmauler.Bonus1 = 0;
                clawofblackmauler.Bonus1Type = (int) 0;
                clawofblackmauler.Bonus2 = 0;
                clawofblackmauler.Bonus2Type = (int) 0;
                clawofblackmauler.Bonus3 = 0;
                clawofblackmauler.Bonus3Type = (int) 0;
                clawofblackmauler.Bonus4 = 0;
                clawofblackmauler.Bonus4Type = (int) 0;
                clawofblackmauler.Bonus5 = 0;
                clawofblackmauler.Bonus5Type = (int) 0;
                clawofblackmauler.Bonus6 = 0;
                clawofblackmauler.Bonus6Type = (int) 0;
                clawofblackmauler.Bonus7 = 0;
                clawofblackmauler.Bonus7Type = (int) 0;
                clawofblackmauler.Bonus8 = 0;
                clawofblackmauler.Bonus8Type = (int) 0;
                clawofblackmauler.Bonus9 = 0;
                clawofblackmauler.Bonus9Type = (int) 0;
                clawofblackmauler.Bonus10 = 0;
                clawofblackmauler.Bonus10Type = (int) 0;
                clawofblackmauler.ExtraBonus = 0;
                clawofblackmauler.ExtraBonusType = (int) 0;
                clawofblackmauler.Effect = 0;
                clawofblackmauler.Emblem = 0;
                clawofblackmauler.Charges = 0;
                clawofblackmauler.MaxCharges = 0;
                clawofblackmauler.SpellID = 0;
                clawofblackmauler.ProcSpellID = 0;
                clawofblackmauler.Type_Damage = 0;
                clawofblackmauler.Realm = 0;
                clawofblackmauler.MaxCount = 1;
                clawofblackmauler.PackSize = 1;
                clawofblackmauler.Extension = 0;
                clawofblackmauler.Quality = 99;
                clawofblackmauler.Condition = 100;
                clawofblackmauler.MaxCondition = 100;
                clawofblackmauler.Durability = 100;
                clawofblackmauler.MaxDurability = 100;
                clawofblackmauler.PoisonCharges = 0;
                clawofblackmauler.PoisonMaxCharges = 0;
                clawofblackmauler.PoisonSpellID = 0;
                clawofblackmauler.ProcSpellID1 = 0;
                clawofblackmauler.SpellID1 = 0;
                clawofblackmauler.MaxCharges1 = 0;
                clawofblackmauler.Charges1 = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(clawofblackmauler);
                }

            #endregion

            #region defineAreas

            #endregion

            #region defineQuestParts

            QuestBuilder builder = QuestMgr.getBuilder(typeof(Learnthehunt));
            QuestBehaviour a;
            a = builder.CreateBehaviour(Aegan,-1);
                a.AddTrigger(eTriggerType.Interact,null,Aegan);
            a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.Learnthehunt),Aegan);
            a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.Learnthehunt),null,(eComparator)5);
            a.AddAction(eActionType.Talk,"Greetings, are you [worthy of the hunt]?",Aegan);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Aegan,-1);
                a.AddTrigger(eTriggerType.Whisper,"worthy of the hunt",Aegan);
            a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.Learnthehunt),Aegan);
            a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.Learnthehunt),null,(eComparator)5);
            a.AddAction(eActionType.Talk,"Oh ho! Another bright young come to help Midgard fend off her enemies, eh? Wonderful, that's what I say! Wonderful! With the rise of the Albion and Hibernia armies,Midgard will need all the she can get!",Aegan);
            a.AddAction(eActionType.Talk,"I have spent a great deal of my life hunting the [maulers] of this region",Aegan);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Aegan,-1);
                a.AddTrigger(eTriggerType.Whisper,"maulers",Aegan);
            a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.Learnthehunt),Aegan);
            a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.Learnthehunt),null,(eComparator)5);
            a.AddAction(eActionType.Talk,"Bring me the claws of a mauler cub and I shall reward you",Aegan);
            a.AddAction(eActionType.OfferQuest,typeof(DOL.GS.Quests.Midgard.Learnthehunt),"Accept Learn the Hunt quest?");
            AddBehaviour(a);
            a = builder.CreateBehaviour(Aegan,-1);
                a.AddTrigger(eTriggerType.DeclineQuest,null,typeof(DOL.GS.Quests.Midgard.Learnthehunt));
            a.AddAction(eActionType.Talk,"No problem. See you.",Aegan);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Aegan,-1);
                a.AddTrigger(eTriggerType.AcceptQuest,null,typeof(DOL.GS.Quests.Midgard.Learnthehunt));
            a.AddAction(eActionType.GiveQuest,typeof(DOL.GS.Quests.Midgard.Learnthehunt),Aegan);
            a.AddAction(eActionType.SetQuestStep,typeof(DOL.GS.Quests.Midgard.Learnthehunt),2);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Aegan,-1);
                a.AddTrigger(eTriggerType.EnemyKilled,"black mauler cub",null);
            a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.Learnthehunt),1,(eComparator)2);
            a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.Learnthehunt),7,(eComparator)1);
            a.AddAction(eActionType.GiveItem,clawofblackmauler,null);
            a.AddAction(eActionType.IncQuestStep,typeof(DOL.GS.Quests.Midgard.Learnthehunt),null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Aegan,-1);
                a.AddTrigger(eTriggerType.Interact,null,Aegan);
            a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.Learnthehunt),7,(eComparator)3);
            a.AddAction(eActionType.Talk,"You are doing well! Continue to pass me the bear claws!",Aegan);
            a.AddAction(eActionType.Talk,"You have proven yourself well youngster! I hope the coin serves you well.",Aegan);
            a.AddAction(eActionType.GiveXP,20,null);
            a.AddAction(eActionType.GiveGold,100,null);
            a.AddAction(eActionType.FinishQuest,typeof(DOL.GS.Quests.Midgard.Learnthehunt),null);
            a.AddAction(eActionType.TakeItem,clawofblackmauler,5);
            AddBehaviour(a);

            #endregion

            // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End

            Aegan.AddQuestToGive(typeof (Learnthehunt));
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Example #47
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            }

            /* First thing we do in here is to search for the NPCs inside
             * the world who comes from the certain Realm. If we find a the players,
             * this means we don't have to create a new one.
             *
             * NOTE: You can do anything you want in this method, you don't have
             * to search for NPC's ... you could create a custom item, place it
             * on the ground and if a player picks it up, he will get the quest!
             * Just examples, do anything you like and feel comfortable with :)
             */

            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>("Argus Bowman", eRealm.Albion);

            /* Whops, if the npcs array length is 0 then no Sir Quait exists in
             * this users Mob Database, so we simply create one ;-)
             * else we take the existing one. And if more than one exist, we take
             * the first ...
             */
            if (npcs.Length == 0)
            {
                argusBowman       = new GameNPC();
                argusBowman.Model = 40;
                argusBowman.Name  = "Argus Bowman";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + argusBowman.Name + ", creating him ...");
                }

                argusBowman.GuildName       = "Weapon Merchant";
                argusBowman.Realm           = eRealm.Albion;
                argusBowman.CurrentRegionID = 1;
                argusBowman.Size            = 50;
                argusBowman.Level           = 18;
                argusBowman.X       = 530594;
                argusBowman.Y       = 480120;
                argusBowman.Z       = 2251;
                argusBowman.Heading = 1627;

                // You don't have to store the created mob in the db if you don't want,
                // it will be recreated each time it is not found, just comment the following
                // line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                {
                    argusBowman.SaveIntoDatabase();
                }

                argusBowman.AddToWorld();
            }
            else
            {
                argusBowman = npcs[0];
            }

            magicalWood = GameServer.Database.FindObjectByKey <ItemTemplate>("ludlow_magical_wood");
            if (magicalWood == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Ludlow Magical Wood, creating it ...");
                }

                magicalWood             = new ItemTemplate();
                magicalWood.Object_Type = 0;
                magicalWood.Id_nb       = "ludlow_magical_wood";
                magicalWood.Name        = "Ludlow Magical Wood";
                magicalWood.Level       = 1;
                magicalWood.Model       = 520;
                magicalWood.IsDropable  = false;
                magicalWood.IsPickable  = false;
                magicalWood.Weight      = 5;
                GameServer.Database.AddObject(magicalWood);
            }

            dullBlackGem = GameServer.Database.FindObjectByKey <ItemTemplate>("dull_black_gem");
            if (dullBlackGem == null)
            {
                dullBlackGem      = new ItemTemplate();
                dullBlackGem.Name = "Dull Black Gem";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + dullBlackGem.Name + ", creating it ...");
                }

                dullBlackGem.Level = 6;

                dullBlackGem.Weight = 3;
                dullBlackGem.Model  = 118;

                dullBlackGem.Object_Type = (int)eObjectType.Magical;
                dullBlackGem.Item_Type   = (int)eEquipmentItems.JEWEL;
                dullBlackGem.Id_nb       = "dull_black_gem";
                dullBlackGem.Price       = 0;
                dullBlackGem.IsPickable  = true;
                dullBlackGem.IsDropable  = true;

                dullBlackGem.Bonus = 5; // default bonus

                dullBlackGem.Bonus1     = 6;
                dullBlackGem.Bonus1Type = (int)eStat.DEX;

                dullBlackGem.Bonus2     = 1;
                dullBlackGem.Bonus2Type = (int)eResist.Spirit;

                dullBlackGem.Quality       = 100;
                dullBlackGem.Condition     = 1000;
                dullBlackGem.MaxCondition  = 1000;
                dullBlackGem.Durability    = 1000;
                dullBlackGem.MaxDurability = 1000;
                GameServer.Database.AddObject(dullBlackGem);
            }

            /* Now we add some hooks to the Sir Quait we found.
             * Actually, we want to know when a player interacts with him.
             * So, we hook the right-click (interact) and the whisper method
             * of Sir Quait and set the callback method to the "TalkToXXX"
             * method. This means, the "TalkToXXX" method is called whenever
             * a player right clicks on him or when he whispers to him.
             */
            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            GameEventMgr.AddHandler(argusBowman, GameLivingEvent.Interact, new DOLEventHandler(TalkToArgusBowman));
            GameEventMgr.AddHandler(argusBowman, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToArgusBowman));

            /* Now we bring to argusBowman the possibility to give this quest to players */
            argusBowman.AddQuestToGive(typeof(ArgussArrows));

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName(questGiverName, eRealm.Hibernia);

            if (npcs.Length == 0)
            {
                questGiver = new GameNPC();
                questGiver.Model = 386;
                questGiver.Name = questGiverName;
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + questGiver.Name + ", creating her ...");
                questGiver.Realm = eRealm.Hibernia;
                questGiver.CurrentRegionID = 27;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 813, 0);		//Slot 22
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 814, 0);			//Slot 23
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 810, 0);		//Slot 25
                template.AddNPCEquipment(eInventorySlot.Cloak, 678, 0);				//Slot 26
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 811, 0);			//Slot 27
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 812, 0);			//Slot 28
                questGiver.Inventory = template.CloseTemplate();
                questGiver.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                questGiver.Size = 50;
                questGiver.Level = 70;
                questGiver.X = 357695;
                questGiver.Y = 363457;
                questGiver.Z = 5340;
                questGiver.Heading = 3117;

                if (SAVE_INTO_DATABASE)
                    questGiver.SaveIntoDatabase();

                questGiver.AddToWorld();
            }
            else
                questGiver = npcs[0];

            npcs = WorldMgr.GetNPCsByName(questTargetName, eRealm.Hibernia);

            if (npcs.Length == 0)
            {
                questTarget = new GameNPC();
                questTarget.Model = 350;
                questTarget.Name = questTargetName;
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + questTarget.Name + ", creating him ...");
                questTarget.Realm = eRealm.Hibernia;
                questTarget.CurrentRegionID = 27;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 391, 0);		//Slot 22
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 392, 0);			//Slot 23
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 667, 0);		//Slot 25
                template.AddNPCEquipment(eInventorySlot.Cloak, 678, 0);				//Slot 26
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 389, 0);			//Slot 27
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 390, 0);			//Slot 28
                questTarget.Inventory = template.CloseTemplate();
                questTarget.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                questTarget.Size = 50;
                questTarget.Level = 65;
                questTarget.X = 356932;
                questTarget.Y = 363575;
                questTarget.Z = 5248;
                questTarget.Heading = 2912;

                if (SAVE_INTO_DATABASE)
                    questTarget.SaveIntoDatabase();

                questTarget.AddToWorld();
            }
            else
                questTarget = npcs[0];

            #endregion defineNPCS

            #region defineAreas

            targetArea = WorldMgr.GetRegion(targetLocation.RegionID).AddArea(new Area.Circle("", targetLocation.X, targetLocation.Y, targetLocation.Z, 200));

            #endregion defineAreas

            #region defineBehaviours

            QuestBuilder builder = QuestMgr.getBuilder(typeof(MovementAndInteraction));
            QuestBehaviour a = null;
            string message1 = "Welcome to " + zoneName + ", <Class>. Here you will learn the basic skills needed to defend yourself as you explore our realm and grow in power and wisdom. Now, without further delay, let's get you started on your [training].";
            string message2 = "If you exit through the doors behind me, you will enter the courtyard. In the courtyard, you will find Master Gethin, who will be your training instructor. Go now and speak to Master Gethin.";

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Interact, null, questGiver);
            a.AddRequirement(eRequirementType.QuestPending, typeof(MovementAndInteraction), null, (eComparator)5);
            a.AddAction(eActionType.GiveQuest, typeof(MovementAndInteraction), questGiver);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Interact, null, questGiver);
            a.AddRequirement(eRequirementType.QuestStep, typeof(MovementAndInteraction), 1, (eComparator)3);
            a.AddAction(eActionType.Talk, message1, questGiver);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Whisper, "training", questGiver);
            a.AddRequirement(eRequirementType.QuestStep, typeof(MovementAndInteraction), 1, (eComparator)3);
            a.AddAction(eActionType.IncQuestStep, typeof(MovementAndInteraction), null);
            a.AddAction(eActionType.Talk, message2, questGiver);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Interact, null, questGiver);
            a.AddRequirement(eRequirementType.QuestStep, typeof(MovementAndInteraction), 2, (eComparator)3);
            a.AddAction(eActionType.Talk, message2, questGiver);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.EnterArea, null, targetArea);
            a.AddRequirement(eRequirementType.QuestStep, typeof(MovementAndInteraction), 2, (eComparator)3);
            a.AddAction(eActionType.IncQuestStep, typeof(MovementAndInteraction), null);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questTarget, -1);
            a.AddTrigger(eTriggerType.Interact, null, questTarget);
            a.AddRequirement(eRequirementType.QuestStep, typeof(MovementAndInteraction), 3, (eComparator)3);
            a.AddAction(eActionType.FinishQuest, typeof(MovementAndInteraction), null);
            AddBehaviour(a);

            #endregion defineBehaviours

            questGiver.AddQuestToGive(typeof(MovementAndInteraction));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
		public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
		{
			if (!ServerProperties.Properties.LOAD_QUESTS)
				return;

			if (log.IsInfoEnabled)
				log.Info("Quest \"" + questTitle + "\" initializing ...");

			/* First thing we do in here is to search for the NPCs inside
			* the world who comes from the certain Realm. If we find the npc
			* this means we don't have to create a new one.
			* 
			* NOTE: You can do anything you want in this method, you don't have
			* to search for NPC's ... you could create a custom item, place it
			* on the ground and if a player picks it up, he will get the quest!
			* Just examples, do anything you like and feel comfortable with :)
			*/

			#region defineNPCS

			GameNPC[] npcs = WorldMgr.GetNPCsByName("Baeth", eRealm.Hibernia);

			/*  If the npcs array length is 0 then no npc exists in
				* this users Mob Database, so we simply create one ;-)
				* else we take the existing one. And if more than one exist, we take
				* the first ...
				*/
			if (npcs.Length == 0)
			{
				npcBaeth = new GameNPC();
				npcBaeth.Model = 361;
				npcBaeth.Name = "Baeth";
				if (log.IsWarnEnabled)
				{
					log.Warn("Could not find " + npcBaeth.Name + ", creating him ...");
				}
				npcBaeth.GuildName = "Part of " + questTitle + " Quest";
				npcBaeth.Realm = eRealm.Hibernia;
				npcBaeth.CurrentRegionID = 27;

				npcBaeth.Size = 52;
				npcBaeth.Level = 30;
				npcBaeth.X = 356650;
				npcBaeth.Y = 355078;
				npcBaeth.Z = 5015;
				npcBaeth.Heading = 2959;

				if (SAVE_INTO_DATABASE)
				{
					npcBaeth.SaveIntoDatabase();
				}

				npcBaeth.AddToWorld();
			}
			else
			{
				npcBaeth = npcs[0];
			}

			npcs = WorldMgr.GetNPCsByName("Jessica", eRealm.Hibernia);

			if (npcs.Length == 0)
			{
				npcJessica = new GameNPC();
				npcJessica.Model = 366;
				npcJessica.Name = "Jessica";
				if (log.IsWarnEnabled)
				{
					log.Warn("Could not find " + npcJessica.Name + ", creating him ...");
				}
				npcJessica.GuildName = "Part of " + questTitle + " Quest";
				npcJessica.Realm = eRealm.Hibernia;
				npcJessica.CurrentRegionID = 27;

				npcJessica.Size = 38;
				npcJessica.Level = 1;
				npcJessica.X = 358068;
				npcJessica.Y = 347553;
				npcJessica.Z = 5491;
				npcJessica.Heading = 49;

				if (SAVE_INTO_DATABASE)
				{
					npcJessica.SaveIntoDatabase();
				}

				npcJessica.AddToWorld();
			}
			else
			{
				npcJessica = npcs[0];
			}


			#endregion

			#region defineItems

			// item db check
			reedFlute = GameServer.Database.FindObjectByKey<ItemTemplate>("quest_reed_flute");
			if (reedFlute == null)
			{
				reedFlute = new ItemTemplate();
				reedFlute.Name = "Reed Flute";
				if (log.IsWarnEnabled)
				{
					log.Warn("Could not find " + reedFlute.Name + ", creating it ...");
				}
				
				reedFlute.Level = 1;
				reedFlute.Weight = 1;
				reedFlute.Model = 325;
				
				reedFlute.Object_Type = (int)eObjectType.Magical;
				reedFlute.Item_Type = (int)eInventorySlot.FirstBackpack;
				reedFlute.Id_nb = "quest_reed_flute";
				reedFlute.Price = 0;
				reedFlute.IsPickable = false;
				reedFlute.IsDropable = false;
				reedFlute.IsTradable = false;
				
				reedFlute.Quality = 100;
				reedFlute.Condition = 5000;
				reedFlute.MaxCondition = 5000;
				reedFlute.Durability = 5000;
				reedFlute.MaxDurability = 5000;

				reedFlute.SpellID = 65001;
				reedFlute.CanUseEvery = 300;

				GameServer.Database.AddObject(reedFlute);
			}

			// Add spell and npctemplate to the DB
			/*

			insert into spell (`Spell_ID`, `SpellID`, `ClientEffect`, `Icon`, `Name`, `Description`, `Target`, `Range`, `Power`, `CastTime`,
			`Damage`, `DamageType`, `Type`, `Duration`, `Frequency`, `Pulse`, `PulsePower`, `Radius`, `Value`, `LifeDrainReturn`, `Message1`, `PackageID`)
			values ('summon_dragonfly', 65001, 0, 0, 'Call Dragonfly', 'Summons a dragonfly to travel at your side, but cannot be used in the battlegrounds or the frontier regions.',
			'Self', 0, 0, 0, 1, 0, 'SummonNoveltyPet', 65535, 0, 0, 0, 0, 1, 65001, 'A small dragonfly appears as the sound of the whistle fades.', 'NoveltyPets');

			insert into npctemplate (`NpcTemplate_ID`, `TemplateId`, `Name`, `GuildName`, `Model`, `Size`, `MaxSpeed`, `Flags`, `Level`, `ClassType`, `PackageID`)
			values ('quest_pet_dragonfly', 65001, 'Dragonfly', '', 819, 12, 250, 48, 1, '', 'NoveltyPets');

			*/


			#endregion


			/* Now we add some hooks to the npc we found.
			* Actually, we want to know when a player interacts with him.
			* So, we hook the right-click (interact) and the whisper method
			* of npc and set the callback method to the "TalkToXXX"
			* method. This means, the "TalkToXXX" method is called whenever
			* a player right clicks on him or when he whispers to him.
			*/

			GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
			GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

			GameEventMgr.AddHandler(npcBaeth, GameLivingEvent.Interact, new DOLEventHandler(TalkToBaeth));
			GameEventMgr.AddHandler(npcBaeth, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToBaeth));
			GameEventMgr.AddHandler(npcJessica, GameLivingEvent.Interact, new DOLEventHandler(TalkToJessica));
			GameEventMgr.AddHandler(npcJessica, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToJessica));

			npcBaeth.AddQuestToGive(typeof(WingsOfTheIsleHibernia));

			if (log.IsInfoEnabled)
			{
				log.Info("Quest \"" + questTitle + "\" initialized");
			}
		}
Example #50
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            /* First thing we do in here is to search for the NPCs inside
            * the world who comes from the certain Realm. If we find a the players,
            * this means we don't have to create a new one.
            *
            * NOTE: You can do anything you want in this method, you don't have
            * to search for NPC's ... you could create a custom item, place it
            * on the ground and if a player picks it up, he will get the quest!
            * Just examples, do anything you like and feel comfortable with :)
            */

            #region defineNPCs

            masterFrederick = GetMasterFrederick();

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Apprentice Dunan", eRealm.Albion);
            if (npcs.Length == 0)
            {
                dunan = new GameNPC();
                dunan.Model = 49;
                dunan.Name = "Apprentice Dunan";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + dunan.Name + ", creating ...");
                dunan.GuildName = "Part of " + questTitle + " Quest";
                dunan.Realm = eRealm.Albion;
                dunan.CurrentRegionID = 1;
                dunan.Size = 49;
                dunan.Level = 21;
                dunan.X = 531663;
                dunan.Y = 479785;
                dunan.Z = 2200;
                dunan.Heading = 1579;
                dunan.EquipmentTemplateID = "1707754";
                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    dunan.SaveIntoDatabase();
                dunan.AddToWorld();
            }
            else
                dunan = npcs[0];

            npcs = WorldMgr.GetNPCsByName("Bombard", eRealm.Albion);
            if (npcs.Length == 0)
            {
                bombard = new GameStableMaster();
                bombard.Model = 8;
                bombard.Name = "Bombard";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + bombard.Name + ", creating ...");
                bombard.GuildName = "Stable Master";
                bombard.Realm = eRealm.Albion;
                bombard.CurrentRegionID = 1;
                bombard.Size = 49;
                bombard.Level = 4;
                bombard.X = 515718;
                bombard.Y = 496739;
                bombard.Z = 3352;
                bombard.Heading = 2500;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    bombard.SaveIntoDatabase();
                bombard.AddToWorld();
            }
            else
                bombard = npcs[0];

            npcs = WorldMgr.GetNPCsByName("Vuloch", eRealm.Albion);
            if (npcs.Length == 0)
            {
                vuloch = new GameStableMaster();
                vuloch.Model = 86;
                vuloch.Name = "Vuloch";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + vuloch.Name + ", creating ...");
                vuloch.GuildName = "Stable Master";
                vuloch.Realm = eRealm.Albion;
                vuloch.CurrentRegionID = 1;
                vuloch.Size = 50;
                vuloch.Level = 4;
                vuloch.X = 553089;
                vuloch.Y = 513380;
                vuloch.Z = 2896;
                vuloch.Heading = 2139;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    vuloch.SaveIntoDatabase();

                vuloch.AddToWorld();
            }
            else
                vuloch = npcs[0];

            npcs = WorldMgr.GetNPCsByName("Yaren", eRealm.Albion);
            if (npcs.Length == 0)
            {
                yaren = new GameStableMaster();
                yaren.Model = 79;
                yaren.Name = "Yaren";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + yaren.Name + ", creating ...");
                yaren.GuildName = "Stable Master";
                yaren.Realm = eRealm.Albion;
                yaren.CurrentRegionID = 1;
                yaren.Size = 48;
                yaren.Level = 4;
                yaren.X = 529638;
                yaren.Y = 478091;
                yaren.Z = 2200;
                yaren.Heading = 3160;
                yaren.EquipmentTemplateID = "11701347";

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    yaren.SaveIntoDatabase();
                yaren.AddToWorld();
            }
            else
                yaren = npcs[0];

            #endregion

            #region defineItems

            ticketToLudlow = CreateTicketTo("Ludlow", "hs_northcamelotgates_ludlow");
            ticketToBombard = CreateTicketTo("North Camelot Gates", "hs_ludlow_northcamelotgates");

            sackOfSupplies = GameServer.Database.FindObjectByKey<ItemTemplate>("sack_of_supplies");
            if (sackOfSupplies == null)
            {
                sackOfSupplies = new ItemTemplate();
                sackOfSupplies.Name = "Sack of Supplies";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + sackOfSupplies.Name + " , creating it ...");

                sackOfSupplies.Weight = 10;
                sackOfSupplies.Model = 488;

                sackOfSupplies.Object_Type = (int) eObjectType.GenericItem;

                sackOfSupplies.Id_nb = "sack_of_supplies";
                sackOfSupplies.IsPickable = true;
                sackOfSupplies.IsDropable = false;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(sackOfSupplies);
            }

            crateOfVegetables = GameServer.Database.FindObjectByKey<ItemTemplate>("crate_of_vegetables");
            if (crateOfVegetables == null)
            {
                crateOfVegetables = new ItemTemplate();
                crateOfVegetables.Name = "Crate of Vegetables";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + crateOfVegetables.Name + " , creating it ...");

                crateOfVegetables.Weight = 15;
                crateOfVegetables.Model = 602;

                crateOfVegetables.Object_Type = (int) eObjectType.GenericItem;

                crateOfVegetables.Id_nb = "crate_of_vegetables";
                crateOfVegetables.IsPickable = true;
                crateOfVegetables.IsDropable = false;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(crateOfVegetables);
            }

            // item db check
            recruitsCloak = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_cloak");
            if (recruitsCloak == null)
            {
                recruitsCloak = new ItemTemplate();
                recruitsCloak.Name = "Recruit's Cloak";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + recruitsCloak.Name + ", creating it ...");
                recruitsCloak.Level = 3;

                recruitsCloak.Weight = 3;
                recruitsCloak.Model = 57; // studded Boots

                recruitsCloak.Object_Type = (int) eObjectType.Cloth;
                recruitsCloak.Item_Type = (int) eEquipmentItems.CLOAK;
                recruitsCloak.Id_nb = "recruits_cloak";
                recruitsCloak.Price = Money.GetMoney(0,0,0,1,0);
                recruitsCloak.IsPickable = true;
                recruitsCloak.IsDropable = true;
                recruitsCloak.Color = 36;

                recruitsCloak.Bonus = 1; // default bonus

                recruitsCloak.Bonus1 = 1;
                recruitsCloak.Bonus1Type = (int) eStat.CON;

                recruitsCloak.Bonus2 = 1;
                recruitsCloak.Bonus2Type = (int) eResist.Slash;

                recruitsCloak.Quality = 100;
                recruitsCloak.Condition = 1000;
                recruitsCloak.MaxCondition = 1000;
                recruitsCloak.Durability = 1000;
                recruitsCloak.MaxDurability = 1000;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(recruitsCloak);
            }

            #endregion

            /* Now we add some hooks to the npc we found.
            * Actually, we want to know when a player interacts with him.
            * So, we hook the right-click (interact) and the whisper method
            * of npc and set the callback method to the "TalkToXXX"
            * method. This means, the "TalkToXXX" method is called whenever
            * a player right clicks on him or when he whispers to him.
            */

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            //We want to be notified whenever a player enters the world
            GameEventMgr.AddHandler(masterFrederick, GameLivingEvent.Interact, new DOLEventHandler(TalkToMasterFrederick));
            GameEventMgr.AddHandler(masterFrederick, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMasterFrederick));

            GameEventMgr.AddHandler(bombard, GameLivingEvent.Interact, new DOLEventHandler(TalkToBombard));
            GameEventMgr.AddHandler(bombard, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToBombard));

            GameEventMgr.AddHandler(dunan, GameLivingEvent.Interact, new DOLEventHandler(TalkToDunan));
            GameEventMgr.AddHandler(dunan, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToDunan));

            /* Now we bring to masterFrederick the possibility to give this quest to players */
            masterFrederick.AddQuestToGive(typeof (ImportantDelivery));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Example #51
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            /* First thing we do in here is to search for the NPCs inside
                * the world who comes from the Albion realm. If we find a the players,
                * this means we don't have to create a new one.
                *
                * NOTE: You can do anything you want in this method, you don't have
                * to search for NPC's ... you could create a custom item, place it
                * on the ground and if a player picks it up, he will get the quest!
                * Just examples, do anything you like and feel comfortable with :)
                */

            #region defineNPCs

            addrir = GetAddrir();

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Aethic", eRealm.Hibernia);
            if (npcs.Length == 0)
            {
                aethic = new GameNPC();
                aethic.Model = 361;
                aethic.Name = "Aethic";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find" + aethic.Name + " , creating ...");
                aethic.GuildName = "Part of " + questTitle + " Quest";
                aethic.Realm = eRealm.Hibernia;
                aethic.CurrentRegionID = 200;
                aethic.Size = 49;
                aethic.Level = 21;
                aethic.X = GameLocation.ConvertLocalXToGlobalX(23761, 200);
                aethic.Y = GameLocation.ConvertLocalYToGlobalY(45658, 200);
                aethic.Z = 5448;
                aethic.Heading = 320;
                //aethic.EquipmentTemplateID = "1707754";
                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    aethic.SaveIntoDatabase();
                aethic.AddToWorld();
            }
            else
                aethic = npcs[0] as GameStableMaster;

            npcs = WorldMgr.GetNPCsByName("Freagus", eRealm.Hibernia);
            if (npcs.Length == 0)
            {
                freagus = new GameStableMaster();
                freagus.Model = 361;
                freagus.Name = "Freagus";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + freagus.Name + ", creating ...");
                freagus.GuildName = "Stable Master";
                freagus.Realm = eRealm.Hibernia;
                freagus.CurrentRegionID = 200;
                freagus.Size = 48;
                freagus.Level = 30;
                freagus.X = 341008;
                freagus.Y = 469180;
                freagus.Z = 5200;
                freagus.Heading = 1934;
                freagus.EquipmentTemplateID = "3800664";

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    freagus.SaveIntoDatabase();
                freagus.AddToWorld();
            }
            else
                freagus = npcs[0];

            npcs = WorldMgr.GetNPCsByName("Rumdor", eRealm.Hibernia);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Rumdor, creating ...");
                rumdor = new GameStableMaster();
                rumdor.Model = 361;
                rumdor.Name = "Rumdor";
                rumdor.GuildName = "Stable Master";
                rumdor.Realm = eRealm.Hibernia;
                rumdor.CurrentRegionID = 200;
                rumdor.Size = 53;
                rumdor.Level = 33;
                rumdor.X = 347175;
                rumdor.Y = 491836;
                rumdor.Z = 5226;
                rumdor.Heading = 1262;
                rumdor.EquipmentTemplateID = "3800664";

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    rumdor.SaveIntoDatabase();

                rumdor.AddToWorld();
            }
            else
                rumdor = npcs[0] as GameStableMaster;

            GameObject[] objects = WorldMgr.GetObjectsByName("Truichon", eRealm.Hibernia,typeof(GameStableMaster));
            if (npcs.Length == 0)
            {
                truichon = new GameStableMaster();
                truichon.Model = 361;
                truichon.Name = "Truichon";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + truichon.Name + ", creating ...");
                truichon.GuildName = "Stable Master";
                truichon.Realm = eRealm.Hibernia;
                truichon.CurrentRegionID = 1;
                truichon.Size = 50;
                truichon.Level = 33;
                truichon.X = 343464;
                truichon.Y = 526708;
                truichon.Z = 5448;
                truichon.Heading = 68;
                //truichon.EquipmentTemplateID = "5448";

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    truichon.SaveIntoDatabase();
                truichon.AddToWorld();
            }
            else
                truichon = npcs[0] as GameStableMaster;

            #endregion

            #region defineItems

            ticketToTirnamBeo = GameServer.Database.FindObjectByKey<ItemTemplate>("hs_magmell_tirnambeo");
            if (ticketToTirnamBeo == null)
                ticketToTirnamBeo = CreateTicketTo("Tir na mBeo", "hs_magmell_tirnambeo");
            ticketToArdee = GameServer.Database.FindObjectByKey<ItemTemplate>("hs_tirnambeo_ardee");
            if (ticketToArdee == null)
                ticketToArdee = CreateTicketTo("Ardee", "hs_tirnambeo_ardee");

            recruitsDiary = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_diary");
            if (recruitsDiary == null)
            {
                recruitsDiary = new ItemTemplate();
                recruitsDiary.Name = "Recruits Diary";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + recruitsDiary.Name + " , creating it ...");
                recruitsDiary.Weight = 3;
                recruitsDiary.Model = 500;
                recruitsDiary.Object_Type = (int)eObjectType.GenericItem;
                recruitsDiary.Id_nb = "recruits_diary";
                recruitsDiary.IsPickable = true;
                recruitsDiary.IsDropable = false;

                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(recruitsDiary);
            }

            sackOfSupplies = GameServer.Database.FindObjectByKey<ItemTemplate>("sack_of_supplies");
            if (sackOfSupplies == null)
            {
                sackOfSupplies = new ItemTemplate();
                sackOfSupplies.Name = "Sack of Supplies";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + sackOfSupplies.Name + " , creating it ...");

                sackOfSupplies.Weight = 10;
                sackOfSupplies.Model = 488;

                sackOfSupplies.Object_Type = (int) eObjectType.GenericItem;

                sackOfSupplies.Id_nb = "sack_of_supplies";
                sackOfSupplies.IsPickable = true;
                sackOfSupplies.IsDropable = false;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(sackOfSupplies);
            }

            crateOfVegetables = GameServer.Database.FindObjectByKey<ItemTemplate>("crate_of_vegetables");
            if (crateOfVegetables == null)
            {
                crateOfVegetables = new ItemTemplate();
                crateOfVegetables.Name = "Crate of Vegetables";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + crateOfVegetables.Name + " , creating it ...");

                crateOfVegetables.Weight = 15;
                crateOfVegetables.Model = 602;

                crateOfVegetables.Object_Type = (int) eObjectType.GenericItem;

                crateOfVegetables.Id_nb = "crate_of_vegetables";
                crateOfVegetables.IsPickable = true;
                crateOfVegetables.IsDropable = false;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(crateOfVegetables);
            }

            // item db check
            recruitsCloak = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_cloak_hib");
            if (recruitsCloak == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Recruit's Cloak, creating it ...");
                recruitsCloak = new ItemTemplate();
                recruitsCloak.Name = "Recruit's Cloak (Hib)";
                recruitsCloak.Level = 3;

                recruitsCloak.Weight = 3;
                recruitsCloak.Model = 57;

                recruitsCloak.Object_Type = (int) eObjectType.Cloth;
                recruitsCloak.Item_Type = (int) eEquipmentItems.CLOAK;
                recruitsCloak.Id_nb = "recruits_cloak_hib";
                recruitsCloak.Price = Money.GetMoney(0,0,0,1,0);
                recruitsCloak.IsPickable = true;
                recruitsCloak.IsDropable = true;
                recruitsCloak.Color = 69;

                recruitsCloak.Bonus = 1; // default bonus

                recruitsCloak.Bonus1 = 1;
                recruitsCloak.Bonus1Type = (int) eStat.CON;

                recruitsCloak.Bonus2 = 1;
                recruitsCloak.Bonus2Type = (int) eResist.Slash;

                recruitsCloak.Quality = 100;
                recruitsCloak.Condition = 1000;
                recruitsCloak.MaxCondition = 1000;
                recruitsCloak.Durability = 1000;
                recruitsCloak.MaxDurability = 1000;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(recruitsCloak);
            }

            #endregion

            /* Now we add some hooks to the npc we found.
            * Actually, we want to know when a player interacts with him.
            * So, we hook the right-click (interact) and the whisper method
            * of npc and set the callback method to the "TalkToXXX"
            * method. This means, the "TalkToXXX" method is called whenever
            * a player right clicks on him or when he whispers to him.
            */
            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            //We want to be notified whenever a player enters the world
            GameEventMgr.AddHandler(addrir, GameLivingEvent.Interact, new DOLEventHandler(TalkToAddrir));
            GameEventMgr.AddHandler(addrir, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToAddrir));

            GameEventMgr.AddHandler(freagus, GameLivingEvent.Interact, new DOLEventHandler(TalkToFreagus));
            GameEventMgr.AddHandler(freagus, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToFreagus));

            GameEventMgr.AddHandler(aethic, GameLivingEvent.Interact, new DOLEventHandler(TalkToAethic));
            GameEventMgr.AddHandler(aethic, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToAethic));

            /* Now we bring to addrir the possibility to give this quest to players */
            addrir.AddQuestToGive(typeof (ImportantDelivery));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Example #52
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            /* First thing we do in here is to search for the NPCs inside
            * the world who comes from the certain Realm. If we find a the players,
            * this means we don't have to create a new one.
            *
            * NOTE: You can do anything you want in this method, you don't have
            * to search for NPC's ... you could create a custom item, place it
            * on the ground and if a player picks it up, he will get the quest!
            * Just examples, do anything you like and feel comfortable with :)
            */

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Sir Jerem", eRealm.Albion);

            /* Whops, if the npcs array length is 0 then no npc exists in
                * this users Mob Database, so we simply create one ;-)
                * else we take the existing one. And if more than one exist, we take
                * the first ...
                */
            if (npcs.Length == 0)
            {
                sirJerem = new GameNPC();
                sirJerem.Model = 254;
                sirJerem.Name = "Sir Jerem";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + sirJerem.Name + ", creating him ...");
                sirJerem.GuildName = "Part of " + questTitle + " Quest";
                sirJerem.Realm = eRealm.Albion;
                sirJerem.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 68, 21);
                template.AddNPCEquipment(eInventorySlot.HeadArmor, 64);
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 49);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 50);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 46);
                template.AddNPCEquipment(eInventorySlot.Cloak, 57, 27);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 47);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 158);
                sirJerem.Inventory = template.CloseTemplate();
                sirJerem.SwitchWeapon(GameLiving.eActiveWeaponSlot.TwoHanded);

                sirJerem.Size = 51;
                sirJerem.Level = 38;
                sirJerem.X = 573815;
                sirJerem.Y = 530850;
                sirJerem.Z = 2933;
                sirJerem.Heading = 2685;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                if (SAVE_INTO_DATABASE)
                    sirJerem.SaveIntoDatabase();

                sirJerem.AddToWorld();
            }
            else
                sirJerem = npcs[0];

            npcs = WorldMgr.GetNPCsByName("Squire Galune", eRealm.Albion);
            if (npcs.Length == 0)
            {
                squireGalune = new GameNPC();
                squireGalune.Model = 254;
                squireGalune.Name = "Squire Galune";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + squireGalune.Name + ", creating him ...");
                squireGalune.GuildName = "Part of " + questTitle + " Quest";
                squireGalune.Realm = eRealm.Albion;
                squireGalune.CurrentRegionID = 21;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 320);
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 137);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 138);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 134);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 135);
                squireGalune.Inventory = template.CloseTemplate();
                squireGalune.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                squireGalune.Size = 45;
                squireGalune.Level = 8;
                squireGalune.X = 33219;
                squireGalune.Y = 31931;
                squireGalune.Z = 16240;
                squireGalune.Heading = 477;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    squireGalune.SaveIntoDatabase();

                squireGalune.AddToWorld();
            }
            else
                squireGalune = npcs[0];

            foreach (GameNPC npc in squireGalune.GetNPCsInRadius(400))
            {
                if (npc.Name == "small spider")
                {
                    smallSpider = npc;
                    break;
                }
            }

            if (smallSpider == null)
            {
                smallSpider = new GameNPC();
                smallSpider.Model = 72;
                smallSpider.Name = "small spider";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + smallSpider.Name + ", creating him ...");
                smallSpider.GuildName = "Part of " + questTitle + " Quest";
                smallSpider.Realm = eRealm.None;
                smallSpider.CurrentRegionID = 21;
                smallSpider.Size = 17;
                smallSpider.Level = 5;
                smallSpider.X = 33158;
                smallSpider.Y = 31973;
                smallSpider.Z = 16240;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                smallSpider.SetOwnBrain(brain);

                smallSpider.Heading = 2605;
                smallSpider.MaxSpeedBase = 0;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                if (SAVE_INTO_DATABASE)
                    smallSpider.SaveIntoDatabase();

                smallSpider.AddToWorld();
            }

            #endregion

            /* Now we add some hooks to the npc we found.
            * Actually, we want to know when a player interacts with him.
            * So, we hook the right-click (interact) and the whisper method
            * of npc and set the callback method to the "TalkToXXX"
            * method. This means, the "TalkToXXX" method is called whenever
            * a player right clicks on him or when he whispers to him.
            */

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            GameEventMgr.AddHandler(sirJerem, GameLivingEvent.Interact, new DOLEventHandler(TalkToSirJerem));
            GameEventMgr.AddHandler(sirJerem, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToSirJerem));

            GameEventMgr.AddHandler(squireGalune, GameLivingEvent.Interact, new DOLEventHandler(TalkToSquireGalune));
            GameEventMgr.AddHandler(squireGalune, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToSquireGalune));

            /* Now we bring to Ydenia the possibility to give this quest to players */
            sirJerem.AddQuestToGive(typeof (ShakenSquire));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            }

            /* First thing we do in here is to search for the NPCs inside
             * the world who comes from the certain Realm. If we find a the players,
             * this means we don't have to create a new one.
             *
             * NOTE: You can do anything you want in this method, you don't have
             * to search for NPC's ... you could create a custom item, place it
             * on the ground and if a player picks it up, he will get the quest!
             * Just examples, do anything you like and feel comfortable with :)
             */

            #region defineNPCs

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Sentinel Maitias", eRealm.Hibernia);

            /* Whops, if the npcs array length is 0 then no Sir Quait exists in
             * this users Mob Database, so we simply create one ;-)
             * else we take the existing one. And if more than one exist, we take
             * the first ...
             */
            if (npcs.Length == 0)
            {
                sentinelMaitias       = new GameGuard();
                sentinelMaitias.Model = 381;
                sentinelMaitias.Name  = "Sentinel Maitias";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + sentinelMaitias.Name + ", creating him ...");
                }
                sentinelMaitias.GuildName       = "Part of " + questTitle;
                sentinelMaitias.Realm           = eRealm.Hibernia;
                sentinelMaitias.CurrentRegionID = 200;
                sentinelMaitias.Size            = 50;
                sentinelMaitias.Level           = 51;
                sentinelMaitias.X                   = 348237;
                sentinelMaitias.Y                   = 493406;
                sentinelMaitias.Z                   = 5176;
                sentinelMaitias.Heading             = 1695;
                sentinelMaitias.EquipmentTemplateID = "15bc1cc4-6c01-4cd1-a26c-8e20c9377114";

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                {
                    sentinelMaitias.SaveIntoDatabase();
                }


                sentinelMaitias.AddToWorld();
            }
            else
            {
                sentinelMaitias = npcs[0];
            }

            /* Now we do the same for the Lynnet.
             */
            npcs = WorldMgr.GetNPCsByName("Sentinel Moya", eRealm.Hibernia);
            if (npcs.Length == 0)
            {
                sentinelMoya       = new GameGuard();
                sentinelMoya.Model = 378;
                sentinelMoya.Name  = "Sentinel Moya";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + sentinelMoya.Name + ", creating ...");
                }
                sentinelMoya.GuildName       = "Part of " + questTitle;
                sentinelMoya.Realm           = eRealm.Hibernia;       //Needs to be none, else we can't kill him ;-)
                sentinelMoya.CurrentRegionID = 1;
                sentinelMoya.Size            = 50;
                sentinelMoya.Level           = 51;
                sentinelMoya.X                   = 341784;
                sentinelMoya.Y                   = 467817;
                sentinelMoya.Z                   = 5200;
                sentinelMoya.Heading             = 3948;
                sentinelMoya.EquipmentTemplateID = "64356d42-041a-489d-9ca7-a738bdc81d5c";

                //You don't have to store the creted mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                {
                    sentinelMoya.SaveIntoDatabase();
                }

                sentinelMoya.AddToWorld();
            }
            else
            {
                sentinelMoya = npcs[0];
            }

            #endregion

            #region defineItems

            boxTrain = GameServer.Database.FindObjectByKey <ItemTemplate>("Crate_of_Training_Supplies");
            if (boxTrain == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Crate of Training Supplies, creating it ...");
                }
                boxTrain               = new ItemTemplate();
                boxTrain.Name          = "Crate of Training Supplies";
                boxTrain.Level         = 1;
                boxTrain.Weight        = 0;
                boxTrain.Model         = 602;
                boxTrain.Id_nb         = "Crate_of_Training_Supplies";
                boxTrain.IsPickable    = true;
                boxTrain.IsDropable    = true;
                boxTrain.Color         = 0;
                boxTrain.Quality       = 0;
                boxTrain.Condition     = 0;
                boxTrain.MaxCondition  = 0;
                boxTrain.Durability    = 1;
                boxTrain.MaxDurability = 1;


                //You don't have to store the created TheDevilsintheDetails in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                GameServer.Database.AddObject(boxTrain);
            }

            #endregion

            /* Now we add some hooks to the Sir Quait we found.
             * Actually, we want to know when a player interacts with him.
             * So, we hook the right-click (interact) and the whisper method
             * of Sir Quait and set the callback method to the "TalkToXXX"
             * method. This means, the "TalkToXXX" method is called whenever
             * a player right clicks on him or when he whispers to him.
             */

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            GameEventMgr.AddHandler(sentinelMaitias, GameLivingEvent.Interact, new DOLEventHandler(TalkTosentinelMaitias));
            GameEventMgr.AddHandler(sentinelMaitias, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkTosentinelMaitias));

            GameEventMgr.AddHandler(sentinelMoya, GameLivingEvent.Interact, new DOLEventHandler(TalkTosentinelMoya));
            GameEventMgr.AddHandler(sentinelMoya, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkTosentinelMoya));

            /* Now we bring to stewardWillie the possibility to give this quest to players */
            sentinelMaitias.AddQuestToGive(typeof(TheDevilsintheDetails));
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Example #54
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName(LanguageMgr.GetTranslation(ServerProperties.Properties.DB_LANGUAGE, "Alb.ANewHeroesWelcome.ScriptLoaded.Text1"), eRealm.Albion);

            /* Whops, if the npcs array length is 0 then no npc exists in
             * this users Mob Database, so we simply create one ;-)
             * else we take the existing one. And if more than one exist, we take
             * the first ...
             */
            if (npcs.Length == 0)
            {
                MasterClaistan = new GameNPC();
                MasterClaistan.Model = 33;
                MasterClaistan.Name = LanguageMgr.GetTranslation(ServerProperties.Properties.DB_LANGUAGE, "Alb.ANewHeroesWelcome.ScriptLoaded.Text1");
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + MasterClaistan.Name + ", creating him ...");
                //MasterClaistan.GuildName = "Part of " + questTitle + " Quest";
                MasterClaistan.Realm = eRealm.Albion;
                MasterClaistan.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 39);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 40);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 36);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 37);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 38);
                MasterClaistan.Inventory = template.CloseTemplate();
                MasterClaistan.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                MasterClaistan.Size = 52;
                MasterClaistan.Level = 51;
                MasterClaistan.X = 562190;
                MasterClaistan.Y = 512571;
                MasterClaistan.Z = 2500;
                MasterClaistan.Heading = 1592;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                if (SAVE_INTO_DATABASE)
                    MasterClaistan.SaveIntoDatabase();

                MasterClaistan.AddToWorld();
            }
            else
                MasterClaistan = npcs[0];

            //Pompin The Crier
            npcs = WorldMgr.GetNPCsByName(LanguageMgr.GetTranslation(ServerProperties.Properties.DB_LANGUAGE, "Alb.ANewHeroesWelcome.ScriptLoaded.Text2"), eRealm.Albion);
            if (npcs.Length == 0)
            {
                PompinTheCrier = new GameNPC();
                PompinTheCrier.Model = 10;
                PompinTheCrier.Name = LanguageMgr.GetTranslation(ServerProperties.Properties.DB_LANGUAGE, "Alb.ANewHeroesWelcome.ScriptLoaded.Text2");
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + PompinTheCrier.Name + ", creating him ...");
                //MasterClaistan.GuildName = "Part of " + questTitle + " Quest";
                PompinTheCrier.Realm = eRealm.Albion;
                PompinTheCrier.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 39);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 40);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 36);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 37);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 38);
                PompinTheCrier.Inventory = template.CloseTemplate();
                PompinTheCrier.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                PompinTheCrier.Size = 50;
                PompinTheCrier.Level = 5;
                PompinTheCrier.X = 560484;
                PompinTheCrier.Y = 511756;
                PompinTheCrier.Z = 2344;
                PompinTheCrier.Heading = 420;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                if (SAVE_INTO_DATABASE)
                    PompinTheCrier.SaveIntoDatabase();

                PompinTheCrier.AddToWorld();
            }
            else
                PompinTheCrier = npcs[0];

            #endregion

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            GameEventMgr.AddHandler(MasterClaistan, GameLivingEvent.Interact, new DOLEventHandler(TalkToMasterClaistan));
            GameEventMgr.AddHandler(MasterClaistan, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMasterClaistan));

            GameEventMgr.AddHandler(PompinTheCrier, GameLivingEvent.Interact, new DOLEventHandler(TalkToPompinTheCrier));
            GameEventMgr.AddHandler(PompinTheCrier, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToPompinTheCrier));

            MasterClaistan.AddQuestToGive(typeof(ANewHeroesWelcome));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Example #55
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            /* First thing we do in here is to search for the NPCs inside
            * the world who comes from the certain Realm. If we find a the players,
            * this means we don't have to create a new one.
            *
            * NOTE: You can do anything you want in this method, you don't have
            * to search for NPC's ... you could create a custom item, place it
            * on the ground and if a player picks it up, he will get the quest!
            * Just examples, do anything you like and feel comfortable with :)
            */

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Elvar Ironhand", eRealm.Albion);

            /* Whops, if the npcs array length is 0 then no npc exists in
                * this users Mob Database, so we simply create one ;-)
                * else we take the existing one. And if more than one exist, we take
                * the first ...
                */
            if (npcs.Length == 0)
            {
                elvarIronhand = new GameNPC();
                elvarIronhand.Model = 10;
                elvarIronhand.Name = "Elvar Ironhand";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + elvarIronhand.Name + ", creating him ...");
                elvarIronhand.GuildName = "Part of " + questTitle + " Quest";
                elvarIronhand.Realm = eRealm.Albion;
                elvarIronhand.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 12);
                elvarIronhand.Inventory = template.CloseTemplate();
                elvarIronhand.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                elvarIronhand.Size = 54;
                elvarIronhand.Level = 17;
                elvarIronhand.X = 561351;
                elvarIronhand.Y = 510292;
                elvarIronhand.Z = 2400;
                elvarIronhand.Heading = 3982;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                if (SAVE_INTO_DATABASE)
                    elvarIronhand.SaveIntoDatabase();

                elvarIronhand.AddToWorld();
            }
            else
                elvarIronhand = npcs[0];

            #endregion

            #region defineItems

            // item db check
            wellPreservedBones = GameServer.Database.FindObjectByKey<ItemTemplate>("well_preserved_bone");
            if (wellPreservedBones == null)
            {
                wellPreservedBones = new ItemTemplate();
                wellPreservedBones.Name = "Well-Preserved Bone";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find "+wellPreservedBones.Name+", creating it ...");

                wellPreservedBones.Level = 0;
                wellPreservedBones.Weight = 1;
                wellPreservedBones.Model = 497;

                wellPreservedBones.Object_Type = (int) eObjectType.GenericItem;
                wellPreservedBones.Id_nb = "well_preserved_bone";
                wellPreservedBones.Price = 0;
                wellPreservedBones.IsPickable = false;
                wellPreservedBones.IsDropable = false;

                wellPreservedBones.Quality = 100;
                wellPreservedBones.Condition = 1000;
                wellPreservedBones.MaxCondition = 1000;
                wellPreservedBones.Durability = 1000;
                wellPreservedBones.MaxDurability = 1000;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(wellPreservedBones);
            }

            // item db check
            twoWellPreservedBones = GameServer.Database.FindObjectByKey<ItemTemplate>("two_well_preserved_bones");
            if (twoWellPreservedBones == null)
            {
                twoWellPreservedBones = new ItemTemplate();
                twoWellPreservedBones.Name = "Two Well-Preserved Bones";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find "+twoWellPreservedBones.Name+", creating it ...");

                twoWellPreservedBones.Level = 0;
                twoWellPreservedBones.Weight = 1;
                twoWellPreservedBones.Model = 497;

                twoWellPreservedBones.Object_Type = (int) eObjectType.GenericItem;
                twoWellPreservedBones.Id_nb = "two_well_preserved_bones";
                twoWellPreservedBones.Price = 0;
                twoWellPreservedBones.IsPickable = false;
                twoWellPreservedBones.IsDropable = false;

                twoWellPreservedBones.Quality = 100;
                twoWellPreservedBones.Condition = 1000;
                twoWellPreservedBones.MaxCondition = 1000;
                twoWellPreservedBones.Durability = 1000;
                twoWellPreservedBones.MaxDurability = 1000;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(twoWellPreservedBones);
            }

            #endregion

            /* Now we add some hooks to the npc we found.
            * Actually, we want to know when a player interacts with him.
            * So, we hook the right-click (interact) and the whisper method
            * of npc and set the callback method to the "TalkToXXX"
            * method. This means, the "TalkToXXX" method is called whenever
            * a player right clicks on him or when he whispers to him.
            */

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            GameEventMgr.AddHandler(elvarIronhand, GameLivingEvent.Interact, new DOLEventHandler(TalkToElvarIronhand));
            GameEventMgr.AddHandler(elvarIronhand, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToElvarIronhand));

            /* Now we bring to Ydenia the possibility to give this quest to players */
            elvarIronhand.AddQuestToGive(typeof (BuildingABetterBow));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Example #56
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");

            #region defineNPCs

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Roben Fraomar", eRealm.Albion);

            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Roben , creating it ...");
                Roben = new GameNPC();
                Roben.Model = 36;
                Roben.Name = "Roben Fraomar";
                Roben.GuildName = "";
                Roben.Realm = eRealm.Albion;
                Roben.CurrentRegionID = 1;
                Roben.Size = 52;
                Roben.Level = 50;
                Roben.X = 408557;
                Roben.Y = 651675;
                Roben.Z = 5200;
                Roben.Heading = 3049;
                Roben.AddToWorld();

                if (SAVE_INTO_DATABASE)
                    Roben.SaveIntoDatabase();
            }
            else
                Roben = npcs[0];
            // end npc

            npcs = WorldMgr.GetNPCsByName("Sister Blythe", eRealm.None);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Blythe , creating it ...");
                Blythe = new GameNPC();
                Blythe.Model = 67;
                Blythe.Name = "Sister Blythe";
                Blythe.GuildName = "";
                Blythe.Realm = eRealm.None;
                Blythe.CurrentRegionID = 1;
                Blythe.Size = 50;
                Blythe.Level = 69;
                Blythe.X = 322231;
                Blythe.Y = 671546;
                Blythe.Z = 2762;
                Blythe.Heading = 1683;
                Blythe.AddToWorld();

                if (SAVE_INTO_DATABASE)
                    Blythe.SaveIntoDatabase();
            }
            else
                Blythe = npcs[0];
            // end npc

            #endregion

            #region defineItems

            statue_of_arawn = GameServer.Database.FindObjectByKey<ItemTemplate>("statue_of_arawn");
            if (statue_of_arawn == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Statue of Arawn, creating it ...");
                statue_of_arawn = new ItemTemplate();
                statue_of_arawn.Id_nb = "statue_of_arawn";
                statue_of_arawn.Name = "Statue of Arawn";
                statue_of_arawn.Level = 8;
                statue_of_arawn.Item_Type = 29;
                statue_of_arawn.Model = 593;
                statue_of_arawn.IsDropable = false;
                statue_of_arawn.IsPickable = false;
                statue_of_arawn.DPS_AF = 0;
                statue_of_arawn.SPD_ABS = 0;
                statue_of_arawn.Object_Type = 41;
                statue_of_arawn.Hand = 0;
                statue_of_arawn.Type_Damage = 0;
                statue_of_arawn.Quality = 100;
                statue_of_arawn.Weight = 12;
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(statue_of_arawn);
                }

            }
            // end item
            ItemTemplate i = null;
            ClericEpicBoots = GameServer.Database.FindObjectByKey<ItemTemplate>("ClericEpicBoots");
            if (ClericEpicBoots == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Clerics Epic Boots , creating it ...");
                i = new ItemTemplate();
                i.Id_nb = "ClericEpicBoots";
                i.Name = "Boots of Defiant Soul";
                i.Level = 50;
                i.Item_Type = 23;
                i.Model = 717;
                i.IsDropable = true;
                i.IsPickable = true;
                i.DPS_AF = 100;
                i.SPD_ABS = 27;
                i.Object_Type = 35;
                i.Quality = 100;
                i.Weight = 22;
                i.Bonus = 35;
                i.MaxCondition = 50000;
                i.MaxDurability = 50000;
                i.Condition = 50000;
                i.Durability = 50000;

                i.Bonus1 = 13;
                i.Bonus1Type = (int) eStat.CON;

                i.Bonus2 = 13;
                i.Bonus2Type = (int) eStat.DEX;

                i.Bonus3 = 13;
                i.Bonus3Type = (int) eStat.QUI;

                i.Bonus4 = 8;
                i.Bonus4Type = (int) eResist.Spirit;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(i);
                }
                ClericEpicBoots = i;

            }
            //end item
            //of the Defiant Soul  Coif
            ClericEpicHelm = GameServer.Database.FindObjectByKey<ItemTemplate>("ClericEpicHelm");
            if (ClericEpicHelm == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Clerics Epic Helm , creating it ...");
                i = new ItemTemplate();
                i.Id_nb = "ClericEpicHelm";
                i.Name = "Coif of Defiant Soul";
                i.Level = 50;
                i.Item_Type = 21;
                i.Model = 1290; //NEED TO WORK ON..
                i.IsDropable = true;
                i.IsPickable = true;
                i.DPS_AF = 100;
                i.SPD_ABS = 27;
                i.Object_Type = 35;
                i.Quality = 100;
                i.Weight = 22;
                i.Bonus = 35;
                i.MaxCondition = 50000;
                i.MaxDurability = 50000;
                i.Condition = 50000;
                i.Durability = 50000;

                i.Bonus1 = 4;
                i.Bonus1Type = (int) eProperty.Focus_Enchantments;

                i.Bonus2 = 12;
                i.Bonus2Type = (int) eStat.CON;

                i.Bonus3 = 19;
                i.Bonus3Type = (int) eStat.PIE;

                i.Bonus4 = 8;
                i.Bonus4Type = (int) eResist.Energy;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(i);
                }

                ClericEpicHelm = i;

            }
            //end item
            //of the Defiant Soul  Gloves
            ClericEpicGloves = GameServer.Database.FindObjectByKey<ItemTemplate>("ClericEpicGloves");
            if (ClericEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Clerics Epic Gloves , creating it ...");
                i = new ItemTemplate();
                i.Id_nb = "ClericEpicGloves";
                i.Name = "Gauntlets of Defiant Soul";
                i.Level = 50;
                i.Item_Type = 22;
                i.Model = 716;
                i.IsDropable = true;
                i.IsPickable = true;
                i.DPS_AF = 100;
                i.SPD_ABS = 27;
                i.Object_Type = 35;
                i.Quality = 100;
                i.Weight = 22;
                i.Bonus = 35;
                i.MaxCondition = 50000;
                i.MaxDurability = 50000;
                i.Condition = 50000;
                i.Durability = 50000;

                i.Bonus1 = 4;
                i.Bonus1Type = (int) eProperty.Skill_Smiting;

                i.Bonus2 = 22;
                i.Bonus2Type = (int) eStat.PIE;

                i.Bonus3 = 8;
                i.Bonus3Type = (int) eResist.Crush;

                i.Bonus4 = 8;
                i.Bonus4Type = (int) eResist.Matter;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(i);
                }

                ClericEpicGloves = i;

            }
            //of the Defiant Soul  Hauberk
            ClericEpicVest = GameServer.Database.FindObjectByKey<ItemTemplate>("ClericEpicVest");
            if (ClericEpicVest == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Clerics Epic Vest , creating it ...");
                i = new ItemTemplate();
                i.Id_nb = "ClericEpicVest";
                i.Name = "Habergeon of Defiant Soul";
                i.Level = 50;
                i.Item_Type = 25;
                i.Model = 713;
                i.IsDropable = true;
                i.IsPickable = true;
                i.DPS_AF = 100;
                i.SPD_ABS = 27;
                i.Object_Type = 35;
                i.Quality = 100;
                i.Weight = 22;
                i.Bonus = 35;
                i.MaxCondition = 50000;
                i.MaxDurability = 50000;
                i.Condition = 50000;
                i.Durability = 50000;

                i.Bonus1 = 4;
                i.Bonus1Type = (int) eResist.Crush;

                i.Bonus2 = 4;
                i.Bonus2Type = (int) eResist.Spirit;

                i.Bonus3 = 12;
                i.Bonus3Type = (int) eProperty.PowerRegenerationRate;

                i.Bonus4 = 27;
                i.Bonus4Type = (int) eProperty.MaxHealth;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(i);
                }
                ClericEpicVest = i;

            }
            //of the Defiant Soul  Legs
            ClericEpicLegs = GameServer.Database.FindObjectByKey<ItemTemplate>("ClericEpicLegs");
            if (ClericEpicLegs == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Clerics Epic Legs , creating it ...");
                i = new ItemTemplate();
                i.Id_nb = "ClericEpicLegs";
                i.Name = "Chaussess of Defiant Soul";
                i.Level = 50;
                i.Item_Type = 27;
                i.Model = 714;
                i.IsDropable = true;
                i.IsPickable = true;
                i.DPS_AF = 100;
                i.SPD_ABS = 27;
                i.Object_Type = 35;
                i.Quality = 100;
                i.Weight = 22;
                i.Bonus = 35;
                i.MaxCondition = 50000;
                i.MaxDurability = 50000;
                i.Condition = 50000;
                i.Durability = 50000;

                i.Bonus1 = 4;
                i.Bonus1Type = (int) eProperty.Skill_Rejuvenation;

                i.Bonus2 = 22;
                i.Bonus2Type = (int) eStat.CON;

                i.Bonus3 = 8;
                i.Bonus3Type = (int) eResist.Slash;

                i.Bonus4 = 8;
                i.Bonus4Type = (int) eResist.Cold;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(i);
                }

                ClericEpicLegs = i;

            }
            //of the Defiant Soul  Sleeves
            ClericEpicArms = GameServer.Database.FindObjectByKey<ItemTemplate>("ClericEpicArms");
            if (ClericEpicArms == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Cleric Epic Arms , creating it ...");
                i = new ItemTemplate();
                i.Id_nb = "ClericEpicArms";
                i.Name = "Sleeves of Defiant Soul";
                i.Level = 50;
                i.Item_Type = 28;
                i.Model = 715;
                i.IsDropable = true;
                i.IsPickable = true;
                i.DPS_AF = 100;
                i.SPD_ABS = 27;
                i.Object_Type = 35;
                i.Quality = 100;
                i.Weight = 22;
                i.Bonus = 35;
                i.MaxCondition = 50000;
                i.MaxDurability = 50000;
                i.Condition = 50000;
                i.Durability = 50000;

                i.Bonus1 = 16;
                i.Bonus1Type = (int) eStat.STR;

                i.Bonus2 = 18;
                i.Bonus2Type = (int) eStat.PIE;

                i.Bonus3 = 8;
                i.Bonus3Type = (int) eResist.Thrust;

                i.Bonus4 = 8;
                i.Bonus4Type = (int) eResist.Heat;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(i);
                }

                ClericEpicArms = i;
            }

            PaladinEpicBoots = GameServer.Database.FindObjectByKey<ItemTemplate>("PaladinEpicBoots");
            if (PaladinEpicBoots == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Paladin Epic Boots , creating it ...");
                i = new ItemTemplate();
                i.Id_nb = "PaladinEpicBoots";
                i.Name = "Sabaton of the Iron Will";
                i.Level = 50;
                i.Item_Type = 23;
                i.Model = 697;
                i.IsDropable = true;
                i.IsPickable = true;
                i.DPS_AF = 100;
                i.SPD_ABS = 34;
                i.Object_Type = 36;
                i.Quality = 100;
                i.Weight = 22;
                i.Bonus = 35;
                i.MaxCondition = 50000;
                i.MaxDurability = 50000;
                i.Condition = 50000;
                i.Durability = 50000;

                i.Bonus1 = 18;
                i.Bonus1Type = (int) eStat.STR;

                i.Bonus2 = 19;
                i.Bonus2Type = (int) eStat.QUI;

                i.Bonus3 = 6;
                i.Bonus3Type = (int) eResist.Slash;

                i.Bonus4 = 6;
                i.Bonus4Type = (int) eResist.Energy;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(i);
                }

                PaladinEpicBoots = i;

            }
            //end item
            //of the Iron Will Coif
            PaladinEpicHelm = GameServer.Database.FindObjectByKey<ItemTemplate>("PaladinEpicHelm");
            if (PaladinEpicHelm == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Paladin Epic Helm , creating it ...");
                i = new ItemTemplate();
                i.Id_nb = "PaladinEpicHelm";
                i.Name = "Hounskull of the Iron Will";
                i.Level = 50;
                i.Item_Type = 21;
                i.Model = 1290; //NEED TO WORK ON..
                i.IsDropable = true;
                i.IsPickable = true;
                i.DPS_AF = 100;
                i.SPD_ABS = 34;
                i.Object_Type = 36;
                i.Quality = 100;
                i.Weight = 22;
                i.Bonus = 35;
                i.MaxCondition = 50000;
                i.MaxDurability = 50000;
                i.Condition = 50000;
                i.Durability = 50000;

                i.Bonus1 = 18;
                i.Bonus1Type = (int) eStat.CON;

                i.Bonus2 = 19;
                i.Bonus2Type = (int) eStat.DEX;

                i.Bonus3 = 6;
                i.Bonus3Type = (int) eResist.Crush;

                i.Bonus4 = 6;
                i.Bonus4Type = (int) eResist.Matter;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(i);
                }

                PaladinEpicHelm = i;

            }
            //end item
            //of the Iron Will Gloves
            PaladinEpicGloves = GameServer.Database.FindObjectByKey<ItemTemplate>("PaladinEpicGloves");
            if (PaladinEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Paladin Epic Gloves , creating it ...");
                i = new ItemTemplate();
                i.Id_nb = "PaladinEpicGloves";
                i.Name = "Gauntlets of the Iron Will";
                i.Level = 50;
                i.Item_Type = 22;
                i.Model = 696;
                i.IsDropable = true;
                i.IsPickable = true;
                i.DPS_AF = 100;
                i.SPD_ABS = 34;
                i.Object_Type = 36;
                i.Quality = 100;
                i.Weight = 22;
                i.Bonus = 35;
                i.MaxCondition = 50000;
                i.MaxDurability = 50000;
                i.Condition = 50000;
                i.Durability = 50000;

                i.Bonus1 = 19;
                i.Bonus1Type = (int) eStat.STR;

                i.Bonus2 = 18;
                i.Bonus2Type = (int) eStat.QUI;

                i.Bonus3 = 6;
                i.Bonus3Type = (int) eResist.Crush;

                i.Bonus4 = 6;
                i.Bonus4Type = (int) eResist.Heat;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(i);
                }

                PaladinEpicGloves = i;

            }
            //of the Iron Will Hauberk
            PaladinEpicVest = GameServer.Database.FindObjectByKey<ItemTemplate>("PaladinEpicVest");
            if (PaladinEpicVest == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Paladin Epic Vest , creating it ...");
                i = new ItemTemplate();
                i.Id_nb = "PaladinEpicVest";
                i.Name = "Curiass of the Iron Will";
                i.Level = 50;
                i.Item_Type = 25;
                i.Model = 693;
                i.IsDropable = true;
                i.IsPickable = true;
                i.DPS_AF = 100;
                i.SPD_ABS = 34;
                i.Object_Type = 36;
                i.Quality = 100;
                i.Weight = 22;
                i.Bonus = 35;
                i.MaxCondition = 50000;
                i.MaxDurability = 50000;
                i.Condition = 50000;
                i.Durability = 50000;

                i.Bonus1 = 15;
                i.Bonus1Type = (int) eStat.STR;

                i.Bonus2 = 6;
                i.Bonus2Type = (int) eResist.Body;

                i.Bonus3 = 6;
                i.Bonus3Type = (int) eResist.Spirit;

                i.Bonus4 = 24;
                i.Bonus4Type = (int) eProperty.MaxHealth;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(i);
                }

                PaladinEpicVest = i;

            }
            //of the Iron Will Legs
            PaladinEpicLegs = GameServer.Database.FindObjectByKey<ItemTemplate>("PaladinEpicLegs");
            if (PaladinEpicLegs == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Paladin Epic Legs , creating it ...");
                i = new ItemTemplate();
                i.Id_nb = "PaladinEpicLegs";
                i.Name = "Greaves of the Iron Will";
                i.Level = 50;
                i.Item_Type = 27;
                i.Model = 694;
                i.IsDropable = true;
                i.IsPickable = true;
                i.DPS_AF = 100;
                i.SPD_ABS = 34;
                i.Object_Type = 36;
                i.Quality = 100;
                i.Weight = 22;
                i.Bonus = 35;
                i.MaxCondition = 50000;
                i.MaxDurability = 50000;
                i.Condition = 50000;
                i.Durability = 50000;

                i.Bonus1 = 22;
                i.Bonus1Type = (int) eStat.CON;

                i.Bonus2 = 15;
                i.Bonus2Type = (int) eStat.DEX;

                i.Bonus3 = 6;
                i.Bonus3Type = (int) eResist.Crush;

                i.Bonus4 = 6;
                i.Bonus4Type = (int) eResist.Cold;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(i);
                }

                PaladinEpicLegs = i;

            }
            //of the Iron Will Sleeves
            PaladinEpicArms = GameServer.Database.FindObjectByKey<ItemTemplate>("PaladinEpicArms");
            if (PaladinEpicArms == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Paladin Epic Arms , creating it ...");
                i = new ItemTemplate();
                i.Id_nb = "PaladinEpicArms";
                i.Name = "Spaulders of the Iron Will";
                i.Level = 50;
                i.Item_Type = 28;
                i.Model = 695;
                i.IsDropable = true;
                i.IsPickable = true;
                i.DPS_AF = 100;
                i.SPD_ABS = 34;
                i.Object_Type = 36;
                i.Quality = 100;
                i.Weight = 22;
                i.Bonus = 35;
                i.MaxCondition = 50000;
                i.MaxDurability = 50000;
                i.Condition = 50000;
                i.Durability = 50000;

                i.Bonus1 = 19;
                i.Bonus1Type = (int) eStat.CON;

                i.Bonus2 = 15;
                i.Bonus2Type = (int) eStat.DEX;

                i.Bonus3 = 9;
                i.Bonus3Type = (int) eStat.QUI;

                i.Bonus4 = 6;
                i.Bonus4Type = (int) eResist.Spirit;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(i);
                }

                PaladinEpicArms = i;
            }

            #endregion

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            GameEventMgr.AddHandler(Roben, GameObjectEvent.Interact, new DOLEventHandler(TalkToRoben));
            GameEventMgr.AddHandler(Roben, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToRoben));

            /* Now we bring to Roben the possibility to give this quest to players */
            Roben.AddQuestToGive(typeof (Church_50));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Example #57
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            /* First thing we do in here is to search for the NPCs inside
            * the world who comes from the certain Realm. If we find a the players,
            * this means we don't have to create a new one.
            *
            * NOTE: You can do anything you want in this method, you don't have
            * to search for NPC's ... you could create a custom item, place it
            * on the ground and if a player picks it up, he will get the quest!
            * Just examples, do anything you like and feel comfortable with :)
            */

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Hugh Gallen", eRealm.Albion);

            /* Whops, if the npcs array length is 0 then no npc exists in
                * this users Mob Database, so we simply create one ;-)
                * else we take the existing one. And if more than one exist, we take
                * the first ...
                */
            if (npcs.Length == 0)
            {
                hughGallen = new GameNPC();
                hughGallen.Model = 40;
                hughGallen.Name = "Hugh Gallen";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + hughGallen.Name + ", creating him ...");
                hughGallen.GuildName = "Part of " + questTitle + " Quest";
                hughGallen.Realm = eRealm.Albion;
                hughGallen.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 39);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 40);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 36);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 37);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 38);
                hughGallen.Inventory = template.CloseTemplate();
                hughGallen.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                hughGallen.Size = 49;
                hughGallen.Level = 38;
                hughGallen.X = 574640;
                hughGallen.Y = 531109;
                hughGallen.Z = 2896;
                hughGallen.Heading = 2275;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                if (SAVE_INTO_DATABASE)
                    hughGallen.SaveIntoDatabase();

                hughGallen.AddToWorld();
            }
            else
                hughGallen = npcs[0];

            #endregion

            #region defineItems

            // item db check
            beltOfAnimation = GameServer.Database.FindObjectByKey<ItemTemplate>("belt_of_animation");
            if (beltOfAnimation == null)
            {
                beltOfAnimation = new ItemTemplate();
                beltOfAnimation.Name = "Belt of Animation";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find "+beltOfAnimation.Name+", creating it ...");

                beltOfAnimation.Level = 5;
                beltOfAnimation.Weight = 3;
                beltOfAnimation.Model = 597;

                beltOfAnimation.Object_Type = (int) eObjectType.Magical;
                beltOfAnimation.Item_Type = (int) eEquipmentItems.WAIST;
                beltOfAnimation.Id_nb = "belt_of_animation";
                beltOfAnimation.Price = 0;
                beltOfAnimation.IsPickable = true;
                beltOfAnimation.IsDropable = false; // can't be sold to merchand

                beltOfAnimation.Bonus1 = 6;
                beltOfAnimation.Bonus1Type = (int)eProperty.MaxHealth;

                beltOfAnimation.Quality = 100;
                beltOfAnimation.Condition = 1000;
                beltOfAnimation.MaxCondition = 1000;
                beltOfAnimation.Durability = 1000;
                beltOfAnimation.MaxDurability = 1000;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(beltOfAnimation);
            }

            #endregion

            /* Now we add some hooks to the npc we found.
            * Actually, we want to know when a player interacts with him.
            * So, we hook the right-click (interact) and the whisper method
            * of npc and set the callback method to the "TalkToXXX"
            * method. This means, the "TalkToXXX" method is called whenever
            * a player right clicks on him or when he whispers to him.
            */

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            GameEventMgr.AddHandler(hughGallen, GameLivingEvent.Interact, new DOLEventHandler(TalkToHughGallen));
            GameEventMgr.AddHandler(hughGallen, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToHughGallen));

            /* Now we bring to Yetta Fletcher the possibility to give this quest to players */
            hughGallen.AddQuestToGive(typeof (ClericMulgrut));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Example #58
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" (Alb) initializing ...");

            #region defineNPCs
            GameNPC[] npcs;

            npcs = WorldMgr.GetNPCsByName("Charles", (eRealm)1);
            if (npcs.Length == 0)
            {
                Charles = new DOL.GS.GameNPC();
                Charles.Model = 92;
                Charles.Name = "Charles";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + Charles.Name + ", creating ...");
                Charles.Realm = eRealm.Albion;
                Charles.CurrentRegionID = 1;
                Charles.Size = 37;
                Charles.Level = 1;
                Charles.MaxSpeedBase = 191;
                Charles.Faction = FactionMgr.GetFactionByID(0);
                Charles.X = 559883;
                Charles.Y = 511489;
                Charles.Z = 2382;
                Charles.Heading = 3515;
                Charles.RespawnInterval = -1;
                Charles.BodyType = 0;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 500;
                Charles.SetOwnBrain(brain);

                if (SAVE_INTO_DATABASE)
                    Charles.SaveIntoDatabase();

                Charles.AddToWorld();

            }
            else
            {
                Charles = npcs[0];
            }

            #endregion

            #region defineItems

            daringpaddedboots_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringpaddedboots_alb");
            if (daringpaddedboots_alb == null)
            {
                daringpaddedboots_alb = new ItemTemplate();
                daringpaddedboots_alb.Name = "Daring Padded Boots";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringpaddedboots_alb.Name + ", creating it ...");
                daringpaddedboots_alb.Level = 5;
                daringpaddedboots_alb.Weight = 8;
                daringpaddedboots_alb.Model = 143;
                daringpaddedboots_alb.Object_Type = 32;
                daringpaddedboots_alb.Item_Type = 23;
                daringpaddedboots_alb.Id_nb = "daringpaddedboots_alb";
                daringpaddedboots_alb.Hand = 0;
                daringpaddedboots_alb.Price = 0;
                daringpaddedboots_alb.IsPickable = true;
                daringpaddedboots_alb.IsDropable = true;
                daringpaddedboots_alb.IsTradable = true;
                daringpaddedboots_alb.CanDropAsLoot = false;
                daringpaddedboots_alb.Color = 0;
                daringpaddedboots_alb.Bonus = 0; // default bonus
                daringpaddedboots_alb.Bonus1 = 4;
                daringpaddedboots_alb.Bonus1Type = (int)3;
                daringpaddedboots_alb.Bonus2 = 0;
                daringpaddedboots_alb.Bonus2Type = (int)0;
                daringpaddedboots_alb.Bonus3 = 0;
                daringpaddedboots_alb.Bonus3Type = (int)0;
                daringpaddedboots_alb.Bonus4 = 0;
                daringpaddedboots_alb.Bonus4Type = (int)0;
                daringpaddedboots_alb.Bonus5 = 0;
                daringpaddedboots_alb.Bonus5Type = (int)0;
                daringpaddedboots_alb.Bonus6 = 0;
                daringpaddedboots_alb.Bonus6Type = (int)0;
                daringpaddedboots_alb.Bonus7 = 0;
                daringpaddedboots_alb.Bonus7Type = (int)0;
                daringpaddedboots_alb.Bonus8 = 0;
                daringpaddedboots_alb.Bonus8Type = (int)0;
                daringpaddedboots_alb.Bonus9 = 0;
                daringpaddedboots_alb.Bonus9Type = (int)0;
                daringpaddedboots_alb.Bonus10 = 0;
                daringpaddedboots_alb.Bonus10Type = (int)0;
                daringpaddedboots_alb.ExtraBonus = 0;
                daringpaddedboots_alb.ExtraBonusType = (int)0;
                daringpaddedboots_alb.Effect = 0;
                daringpaddedboots_alb.DPS_AF = 6;
                daringpaddedboots_alb.Charges = 0;
                daringpaddedboots_alb.MaxCharges = 0;
                daringpaddedboots_alb.SpellID = 0;
                daringpaddedboots_alb.ProcSpellID = 0;
                daringpaddedboots_alb.SPD_ABS = 0;
                daringpaddedboots_alb.Realm = 0;
                daringpaddedboots_alb.MaxCount = 1;
                daringpaddedboots_alb.PackSize = 1;
                daringpaddedboots_alb.Extension = 0;
                daringpaddedboots_alb.Quality =89;
                daringpaddedboots_alb.Condition = 50000;
                daringpaddedboots_alb.MaxCondition = 50000;
                daringpaddedboots_alb.Durability = 50000;
                daringpaddedboots_alb.MaxDurability = 50000;
                daringpaddedboots_alb.PoisonCharges = 0;
                daringpaddedboots_alb.PoisonMaxCharges = 0;
                daringpaddedboots_alb.PoisonSpellID = 0;
                daringpaddedboots_alb.ProcSpellID1 = 0;
                daringpaddedboots_alb.SpellID1 = 0;
                daringpaddedboots_alb.MaxCharges1 = 0;
                daringpaddedboots_alb.Charges1 = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(daringpaddedboots_alb);
            }
            daringpaddedcap_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringpaddedcap_alb");
            if (daringpaddedcap_alb == null)
            {
                daringpaddedcap_alb = new ItemTemplate();
                daringpaddedcap_alb.Name = "Daring Padded Cap";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringpaddedcap_alb.Name + ", creating it ...");
                daringpaddedcap_alb.Level = 5;
                daringpaddedcap_alb.Weight = 8;
                daringpaddedcap_alb.Model = 822;
                daringpaddedcap_alb.Object_Type = 32;
                daringpaddedcap_alb.Item_Type = 21;
                daringpaddedcap_alb.Id_nb = "daringpaddedcap_alb";
                daringpaddedcap_alb.Hand = 0;
                daringpaddedcap_alb.Price = 0;
                daringpaddedcap_alb.IsPickable = true;
                daringpaddedcap_alb.IsDropable = true;
                daringpaddedcap_alb.IsTradable = true;
                daringpaddedcap_alb.CanDropAsLoot = false;
                daringpaddedcap_alb.Color = 0;
                daringpaddedcap_alb.Bonus = 0; // default bonus
                daringpaddedcap_alb.Bonus1 = 4;
                daringpaddedcap_alb.Bonus1Type = (int)2;
                daringpaddedcap_alb.Bonus2 = 0;
                daringpaddedcap_alb.Bonus2Type = (int)0;
                daringpaddedcap_alb.Bonus3 = 0;
                daringpaddedcap_alb.Bonus3Type = (int)0;
                daringpaddedcap_alb.Bonus4 = 0;
                daringpaddedcap_alb.Bonus4Type = (int)0;
                daringpaddedcap_alb.Bonus5 = 0;
                daringpaddedcap_alb.Bonus5Type = (int)0;
                daringpaddedcap_alb.Bonus6 = 0;
                daringpaddedcap_alb.Bonus6Type = (int)0;
                daringpaddedcap_alb.Bonus7 = 0;
                daringpaddedcap_alb.Bonus7Type = (int)0;
                daringpaddedcap_alb.Bonus8 = 0;
                daringpaddedcap_alb.Bonus8Type = (int)0;
                daringpaddedcap_alb.Bonus9 = 0;
                daringpaddedcap_alb.Bonus9Type = (int)0;
                daringpaddedcap_alb.Bonus10 = 0;
                daringpaddedcap_alb.Bonus10Type = (int)0;
                daringpaddedcap_alb.ExtraBonus = 0;
                daringpaddedcap_alb.ExtraBonusType = (int)0;
                daringpaddedcap_alb.Effect = 0;
                daringpaddedcap_alb.DPS_AF = 6;
                daringpaddedcap_alb.Charges = 0;
                daringpaddedcap_alb.MaxCharges = 0;
                daringpaddedcap_alb.SpellID = 0;
                daringpaddedcap_alb.ProcSpellID = 0;
                daringpaddedcap_alb.SPD_ABS = 0;
                daringpaddedcap_alb.Realm = 0;
                daringpaddedcap_alb.MaxCount = 1;
                daringpaddedcap_alb.PackSize = 1;
                daringpaddedcap_alb.Extension = 0;
                daringpaddedcap_alb.Quality =89;
                daringpaddedcap_alb.Condition = 50000;
                daringpaddedcap_alb.MaxCondition = 50000;
                daringpaddedcap_alb.Durability = 50000;
                daringpaddedcap_alb.MaxDurability = 50000;
                daringpaddedcap_alb.PoisonCharges = 0;
                daringpaddedcap_alb.PoisonMaxCharges = 0;
                daringpaddedcap_alb.PoisonSpellID = 0;
                daringpaddedcap_alb.ProcSpellID1 = 0;
                daringpaddedcap_alb.SpellID1 = 0;
                daringpaddedcap_alb.MaxCharges1 = 0;
                daringpaddedcap_alb.Charges1 = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(daringpaddedcap_alb);
            }
            daringpaddedgloves_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringpaddedgloves_alb");
            if (daringpaddedgloves_alb == null)
            {
                daringpaddedgloves_alb = new ItemTemplate();
                daringpaddedgloves_alb.Name = "Daring Padded Gloves";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringpaddedgloves_alb.Name + ", creating it ...");
                daringpaddedgloves_alb.Level = 5;
                daringpaddedgloves_alb.Weight = 8;
                daringpaddedgloves_alb.Model = 142;
                daringpaddedgloves_alb.Object_Type = 32;
                daringpaddedgloves_alb.Item_Type = 22;
                daringpaddedgloves_alb.Id_nb = "daringpaddedgloves_alb";
                daringpaddedgloves_alb.Hand = 0;
                daringpaddedgloves_alb.Price = 0;
                daringpaddedgloves_alb.IsPickable = true;
                daringpaddedgloves_alb.IsDropable = true;
                daringpaddedgloves_alb.IsTradable = true;
                daringpaddedgloves_alb.CanDropAsLoot = false;
                daringpaddedgloves_alb.Color = 0;
                daringpaddedgloves_alb.Bonus = 0; // default bonus
                daringpaddedgloves_alb.Bonus1 = 4;
                daringpaddedgloves_alb.Bonus1Type = (int)3;
                daringpaddedgloves_alb.Bonus2 = 0;
                daringpaddedgloves_alb.Bonus2Type = (int)0;
                daringpaddedgloves_alb.Bonus3 = 0;
                daringpaddedgloves_alb.Bonus3Type = (int)0;
                daringpaddedgloves_alb.Bonus4 = 0;
                daringpaddedgloves_alb.Bonus4Type = (int)0;
                daringpaddedgloves_alb.Bonus5 = 0;
                daringpaddedgloves_alb.Bonus5Type = (int)0;
                daringpaddedgloves_alb.Bonus6 = 0;
                daringpaddedgloves_alb.Bonus6Type = (int)0;
                daringpaddedgloves_alb.Bonus7 = 0;
                daringpaddedgloves_alb.Bonus7Type = (int)0;
                daringpaddedgloves_alb.Bonus8 = 0;
                daringpaddedgloves_alb.Bonus8Type = (int)0;
                daringpaddedgloves_alb.Bonus9 = 0;
                daringpaddedgloves_alb.Bonus9Type = (int)0;
                daringpaddedgloves_alb.Bonus10 = 0;
                daringpaddedgloves_alb.Bonus10Type = (int)0;
                daringpaddedgloves_alb.ExtraBonus = 0;
                daringpaddedgloves_alb.ExtraBonusType = (int)0;
                daringpaddedgloves_alb.Effect = 0;
                daringpaddedgloves_alb.DPS_AF = 6;
                daringpaddedgloves_alb.Charges = 0;
                daringpaddedgloves_alb.MaxCharges = 0;
                daringpaddedgloves_alb.SpellID = 0;
                daringpaddedgloves_alb.ProcSpellID = 0;
                daringpaddedgloves_alb.SPD_ABS = 0;
                daringpaddedgloves_alb.Realm = 0;
                daringpaddedgloves_alb.MaxCount = 1;
                daringpaddedgloves_alb.PackSize = 1;
                daringpaddedgloves_alb.Extension = 0;
                daringpaddedgloves_alb.Quality =89;
                daringpaddedgloves_alb.Condition = 50000;
                daringpaddedgloves_alb.MaxCondition = 50000;
                daringpaddedgloves_alb.Durability = 50000;
                daringpaddedgloves_alb.MaxDurability = 50000;
                daringpaddedgloves_alb.PoisonCharges = 0;
                daringpaddedgloves_alb.PoisonMaxCharges = 0;
                daringpaddedgloves_alb.PoisonSpellID = 0;
                daringpaddedgloves_alb.ProcSpellID1 = 0;
                daringpaddedgloves_alb.SpellID1 = 0;
                daringpaddedgloves_alb.MaxCharges1 = 0;
                daringpaddedgloves_alb.Charges1 = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(daringpaddedgloves_alb);
            }
            daringpaddedpants_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringpaddedpants_alb");
            if (daringpaddedpants_alb == null)
            {
                daringpaddedpants_alb = new ItemTemplate();
                daringpaddedpants_alb.Name = "Daring Padded Pants";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringpaddedpants_alb.Name + ", creating it ...");
                daringpaddedpants_alb.Level = 5;
                daringpaddedpants_alb.Weight = 14;
                daringpaddedpants_alb.Model = 140;
                daringpaddedpants_alb.Object_Type = 32;
                daringpaddedpants_alb.Item_Type = 27;
                daringpaddedpants_alb.Id_nb = "daringpaddedpants_alb";
                daringpaddedpants_alb.Hand = 0;
                daringpaddedpants_alb.Price  = 0;
                daringpaddedpants_alb.IsPickable = true;
                daringpaddedpants_alb.IsDropable = true;
                daringpaddedpants_alb.IsTradable = true;
                daringpaddedpants_alb.CanDropAsLoot = false;
                daringpaddedpants_alb.Color = 0;
                daringpaddedpants_alb.Bonus = 0; // default bonus
                daringpaddedpants_alb.Bonus1 = 4;
                daringpaddedpants_alb.Bonus1Type = (int)2;
                daringpaddedpants_alb.Bonus2 = 0;
                daringpaddedpants_alb.Bonus2Type = (int)0;
                daringpaddedpants_alb.Bonus3 = 0;
                daringpaddedpants_alb.Bonus3Type = (int)0;
                daringpaddedpants_alb.Bonus4 = 0;
                daringpaddedpants_alb.Bonus4Type = (int)0;
                daringpaddedpants_alb.Bonus5 = 0;
                daringpaddedpants_alb.Bonus5Type = (int)0;
                daringpaddedpants_alb.Bonus6 = 0;
                daringpaddedpants_alb.Bonus6Type = (int)0;
                daringpaddedpants_alb.Bonus7 = 0;
                daringpaddedpants_alb.Bonus7Type = (int)0;
                daringpaddedpants_alb.Bonus8 = 0;
                daringpaddedpants_alb.Bonus8Type = (int)0;
                daringpaddedpants_alb.Bonus9 = 0;
                daringpaddedpants_alb.Bonus9Type = (int)0;
                daringpaddedpants_alb.Bonus10 = 0;
                daringpaddedpants_alb.Bonus10Type = (int)0;
                daringpaddedpants_alb.ExtraBonus = 0;
                daringpaddedpants_alb.ExtraBonusType = (int)0;
                daringpaddedpants_alb.Effect = 0;
                daringpaddedpants_alb.DPS_AF = 6;
                daringpaddedpants_alb.Charges = 0;
                daringpaddedpants_alb.MaxCharges = 0;
                daringpaddedpants_alb.SpellID = 0;
                daringpaddedpants_alb.ProcSpellID = 0;
                daringpaddedpants_alb.SPD_ABS = 0;
                daringpaddedpants_alb.Realm = 0;
                daringpaddedpants_alb.MaxCount = 1;
                daringpaddedpants_alb.PackSize = 1;
                daringpaddedpants_alb.Extension = 0;
                daringpaddedpants_alb.Quality =89;
                daringpaddedpants_alb.Condition = 50000;
                daringpaddedpants_alb.MaxCondition = 50000;
                daringpaddedpants_alb.Durability = 50000;
                daringpaddedpants_alb.MaxDurability = 50000;
                daringpaddedpants_alb.PoisonCharges = 0;
                daringpaddedpants_alb.PoisonMaxCharges = 0;
                daringpaddedpants_alb.PoisonSpellID = 0;
                daringpaddedpants_alb.ProcSpellID1 = 0;
                daringpaddedpants_alb.SpellID1 = 0;
                daringpaddedpants_alb.MaxCharges1 = 0;
                daringpaddedpants_alb.Charges1 = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(daringpaddedpants_alb);
            }
            daringpaddedsleeves_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringpaddedsleeves_alb");
            if (daringpaddedsleeves_alb == null)
            {
                daringpaddedsleeves_alb = new ItemTemplate();
                daringpaddedsleeves_alb.Name = "Daring Padded Sleeves";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringpaddedsleeves_alb.Name + ", creating it ...");
                daringpaddedsleeves_alb.Level = 5;
                daringpaddedsleeves_alb.Weight = 12;
                daringpaddedsleeves_alb.Model = 141;
                daringpaddedsleeves_alb.Object_Type = 32;
                daringpaddedsleeves_alb.Item_Type = 28;
                daringpaddedsleeves_alb.Id_nb = "daringpaddedsleeves_alb";
                daringpaddedsleeves_alb.Hand = 0;
                daringpaddedsleeves_alb.Price = 0;
                daringpaddedsleeves_alb.IsPickable = true;
                daringpaddedsleeves_alb.IsDropable = true;
                daringpaddedsleeves_alb.IsTradable = true;
                daringpaddedsleeves_alb.CanDropAsLoot = false;
                daringpaddedsleeves_alb.Color = 0;
                daringpaddedsleeves_alb.Bonus = 0; // default bonus
                daringpaddedsleeves_alb.Bonus1 = 4;
                daringpaddedsleeves_alb.Bonus1Type = (int)6;
                daringpaddedsleeves_alb.Bonus2 = 0;
                daringpaddedsleeves_alb.Bonus2Type = (int)0;
                daringpaddedsleeves_alb.Bonus3 = 0;
                daringpaddedsleeves_alb.Bonus3Type = (int)0;
                daringpaddedsleeves_alb.Bonus4 = 0;
                daringpaddedsleeves_alb.Bonus4Type = (int)0;
                daringpaddedsleeves_alb.Bonus5 = 0;
                daringpaddedsleeves_alb.Bonus5Type = (int)0;
                daringpaddedsleeves_alb.Bonus6 = 0;
                daringpaddedsleeves_alb.Bonus6Type = (int)0;
                daringpaddedsleeves_alb.Bonus7 = 0;
                daringpaddedsleeves_alb.Bonus7Type = (int)0;
                daringpaddedsleeves_alb.Bonus8 = 0;
                daringpaddedsleeves_alb.Bonus8Type = (int)0;
                daringpaddedsleeves_alb.Bonus9 = 0;
                daringpaddedsleeves_alb.Bonus9Type = (int)0;
                daringpaddedsleeves_alb.Bonus10 = 0;
                daringpaddedsleeves_alb.Bonus10Type = (int)0;
                daringpaddedsleeves_alb.ExtraBonus = 0;
                daringpaddedsleeves_alb.ExtraBonusType = (int)0;
                daringpaddedsleeves_alb.Effect = 0;
                daringpaddedsleeves_alb.DPS_AF = 6;
                daringpaddedsleeves_alb.Charges = 0;
                daringpaddedsleeves_alb.MaxCharges = 0;
                daringpaddedsleeves_alb.SpellID = 0;
                daringpaddedsleeves_alb.ProcSpellID = 0;
                daringpaddedsleeves_alb.SPD_ABS = 0;
                daringpaddedsleeves_alb.Realm = 0;
                daringpaddedsleeves_alb.MaxCount = 1;
                daringpaddedsleeves_alb.PackSize = 1;
                daringpaddedsleeves_alb.Extension = 0;
                daringpaddedsleeves_alb.Quality =89;
                daringpaddedsleeves_alb.Condition = 50000;
                daringpaddedsleeves_alb.MaxCondition = 50000;
                daringpaddedsleeves_alb.Durability = 50000;
                daringpaddedsleeves_alb.MaxDurability = 50000;
                daringpaddedsleeves_alb.PoisonCharges = 0;
                daringpaddedsleeves_alb.PoisonMaxCharges = 0;
                daringpaddedsleeves_alb.PoisonSpellID = 0;
                daringpaddedsleeves_alb.ProcSpellID1 = 0;
                daringpaddedsleeves_alb.SpellID1 = 0;
                daringpaddedsleeves_alb.MaxCharges1 = 0;
                daringpaddedsleeves_alb.Charges1 = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(daringpaddedsleeves_alb);
            }
            daringpaddedvest_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringpaddedvest_alb");
            if (daringpaddedvest_alb == null)
            {
                daringpaddedvest_alb = new ItemTemplate();
                daringpaddedvest_alb.Name = "Daring Padded Vest";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringpaddedvest_alb.Name + ", creating it ...");
                daringpaddedvest_alb.Level = 5;
                daringpaddedvest_alb.Weight = 20;
                daringpaddedvest_alb.Model = 139;
                daringpaddedvest_alb.Object_Type = 32;
                daringpaddedvest_alb.Item_Type = 25;
                daringpaddedvest_alb.Id_nb = "daringpaddedvest_alb";
                daringpaddedvest_alb.Hand = 0;
                daringpaddedvest_alb.Price = 0;
                daringpaddedvest_alb.IsPickable = true;
                daringpaddedvest_alb.IsDropable = true;
                daringpaddedvest_alb.IsTradable = true;
                daringpaddedvest_alb.CanDropAsLoot = false;
                daringpaddedvest_alb.Color = 0;
                daringpaddedvest_alb.Bonus = 0; // default bonus
                daringpaddedvest_alb.Bonus1 = 12;
                daringpaddedvest_alb.Bonus1Type = (int)10;
                daringpaddedvest_alb.Bonus2 = 0;
                daringpaddedvest_alb.Bonus2Type = (int)0;
                daringpaddedvest_alb.Bonus3 = 0;
                daringpaddedvest_alb.Bonus3Type = (int)0;
                daringpaddedvest_alb.Bonus4 = 0;
                daringpaddedvest_alb.Bonus4Type = (int)0;
                daringpaddedvest_alb.Bonus5 = 0;
                daringpaddedvest_alb.Bonus5Type = (int)0;
                daringpaddedvest_alb.Bonus6 = 0;
                daringpaddedvest_alb.Bonus6Type = (int)0;
                daringpaddedvest_alb.Bonus7 = 0;
                daringpaddedvest_alb.Bonus7Type = (int)0;
                daringpaddedvest_alb.Bonus8 = 0;
                daringpaddedvest_alb.Bonus8Type = (int)0;
                daringpaddedvest_alb.Bonus9 = 0;
                daringpaddedvest_alb.Bonus9Type = (int)0;
                daringpaddedvest_alb.Bonus10 = 0;
                daringpaddedvest_alb.Bonus10Type = (int)0;
                daringpaddedvest_alb.ExtraBonus = 0;
                daringpaddedvest_alb.ExtraBonusType = (int)0;
                daringpaddedvest_alb.Effect = 0;
                daringpaddedvest_alb.DPS_AF = 6;
                daringpaddedvest_alb.Charges = 0;
                daringpaddedvest_alb.MaxCharges = 0;
                daringpaddedvest_alb.SpellID = 0;
                daringpaddedvest_alb.ProcSpellID = 0;
                daringpaddedvest_alb.SPD_ABS = 0;
                daringpaddedvest_alb.Realm = 0;
                daringpaddedvest_alb.MaxCount = 1;
                daringpaddedvest_alb.PackSize = 1;
                daringpaddedvest_alb.Extension = 0;
                daringpaddedvest_alb.Quality =89;
                daringpaddedvest_alb.Condition = 50000;
                daringpaddedvest_alb.MaxCondition = 50000;
                daringpaddedvest_alb.Durability = 50000;
                daringpaddedvest_alb.MaxDurability = 50000;
                daringpaddedvest_alb.PoisonCharges = 0;
                daringpaddedvest_alb.PoisonMaxCharges = 0;
                daringpaddedvest_alb.PoisonSpellID = 0;
                daringpaddedvest_alb.ProcSpellID1 = 0;
                daringpaddedvest_alb.SpellID1 = 0;
                daringpaddedvest_alb.MaxCharges1 = 0;
                daringpaddedvest_alb.Charges1 = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(daringpaddedvest_alb);
            }
            daringleatherboots_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringleatherboots_alb");
            if (daringleatherboots_alb == null)
            {
                daringleatherboots_alb = new ItemTemplate();
                daringleatherboots_alb.Name = "Daring Leather Boots";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringleatherboots_alb.Name + ", creating it ...");
                daringleatherboots_alb.Level = 5;
                daringleatherboots_alb.Weight = 16;
                daringleatherboots_alb.Model = 133;
                daringleatherboots_alb.Object_Type = 33;
                daringleatherboots_alb.Item_Type = 23;
                daringleatherboots_alb.Id_nb = "daringleatherboots_alb";
                daringleatherboots_alb.Hand = 0;
                daringleatherboots_alb.Price = 0;
                daringleatherboots_alb.IsPickable = true;
                daringleatherboots_alb.IsDropable = true;
                daringleatherboots_alb.IsTradable = true;
                daringleatherboots_alb.CanDropAsLoot = false;
                daringleatherboots_alb.Color = 0;
                daringleatherboots_alb.Bonus = 0; // default bonus
                daringleatherboots_alb.Bonus1 = 4;
                daringleatherboots_alb.Bonus1Type = (int)3;
                daringleatherboots_alb.Bonus2 = 0;
                daringleatherboots_alb.Bonus2Type = (int)0;
                daringleatherboots_alb.Bonus3 = 0;
                daringleatherboots_alb.Bonus3Type = (int)0;
                daringleatherboots_alb.Bonus4 = 0;
                daringleatherboots_alb.Bonus4Type = (int)0;
                daringleatherboots_alb.Bonus5 = 0;
                daringleatherboots_alb.Bonus5Type = (int)0;
                daringleatherboots_alb.Bonus6 = 0;
                daringleatherboots_alb.Bonus6Type = (int)0;
                daringleatherboots_alb.Bonus7 = 0;
                daringleatherboots_alb.Bonus7Type = (int)0;
                daringleatherboots_alb.Bonus8 = 0;
                daringleatherboots_alb.Bonus8Type = (int)0;
                daringleatherboots_alb.Bonus9 = 0;
                daringleatherboots_alb.Bonus9Type = (int)0;
                daringleatherboots_alb.Bonus10 = 0;
                daringleatherboots_alb.Bonus10Type = (int)0;
                daringleatherboots_alb.ExtraBonus = 0;
                daringleatherboots_alb.ExtraBonusType = (int)0;
                daringleatherboots_alb.Effect = 0;
                daringleatherboots_alb.DPS_AF = 10;
                daringleatherboots_alb.Charges = 0;
                daringleatherboots_alb.MaxCharges = 0;
                daringleatherboots_alb.SpellID = 0;
                daringleatherboots_alb.ProcSpellID = 0;
                daringleatherboots_alb.SPD_ABS = 10;
                daringleatherboots_alb.Realm = 0;
                daringleatherboots_alb.MaxCount = 1;
                daringleatherboots_alb.PackSize = 1;
                daringleatherboots_alb.Extension = 0;
                daringleatherboots_alb.Quality =89;
                daringleatherboots_alb.Condition = 50000;
                daringleatherboots_alb.MaxCondition = 50000;
                daringleatherboots_alb.Durability = 50000;
                daringleatherboots_alb.MaxDurability = 50000;
                daringleatherboots_alb.PoisonCharges = 0;
                daringleatherboots_alb.PoisonMaxCharges = 0;
                daringleatherboots_alb.PoisonSpellID = 0;
                daringleatherboots_alb.ProcSpellID1 = 0;
                daringleatherboots_alb.SpellID1 = 0;
                daringleatherboots_alb.MaxCharges1 = 0;
                daringleatherboots_alb.Charges1 = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(daringleatherboots_alb);
            }
            daringleathercap_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringleathercap_alb");
            if (daringleathercap_alb == null)
            {
                daringleathercap_alb = new ItemTemplate();
                daringleathercap_alb.Name = "Daring Leather Cap";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringleathercap_alb.Name + ", creating it ...");
                daringleathercap_alb.Level = 5;
                daringleathercap_alb.Weight = 16;
                daringleathercap_alb.Model = 62;
                daringleathercap_alb.Object_Type = 33;
                daringleathercap_alb.Item_Type = 21;
                daringleathercap_alb.Id_nb = "daringleathercap_alb";
                daringleathercap_alb.Hand = 0;
                daringleathercap_alb.Price = 0;
                daringleathercap_alb.IsPickable = true;
                daringleathercap_alb.IsDropable = true;
                daringleathercap_alb.IsTradable = true;
                daringleathercap_alb.CanDropAsLoot = false;
                daringleathercap_alb.Color = 0;
                daringleathercap_alb.Bonus = 0; // default bonus
                daringleathercap_alb.Bonus1 = 4;
                daringleathercap_alb.Bonus1Type = (int)3;
                daringleathercap_alb.Bonus2 = 0;
                daringleathercap_alb.Bonus2Type = (int)0;
                daringleathercap_alb.Bonus3 = 0;
                daringleathercap_alb.Bonus3Type = (int)0;
                daringleathercap_alb.Bonus4 = 0;
                daringleathercap_alb.Bonus4Type = (int)0;
                daringleathercap_alb.Bonus5 = 0;
                daringleathercap_alb.Bonus5Type = (int)0;
                daringleathercap_alb.Bonus6 = 0;
                daringleathercap_alb.Bonus6Type = (int)0;
                daringleathercap_alb.Bonus7 = 0;
                daringleathercap_alb.Bonus7Type = (int)0;
                daringleathercap_alb.Bonus8 = 0;
                daringleathercap_alb.Bonus8Type = (int)0;
                daringleathercap_alb.Bonus9 = 0;
                daringleathercap_alb.Bonus9Type = (int)0;
                daringleathercap_alb.Bonus10 = 0;
                daringleathercap_alb.Bonus10Type = (int)0;
                daringleathercap_alb.ExtraBonus = 0;
                daringleathercap_alb.ExtraBonusType = (int)0;
                daringleathercap_alb.Effect = 0;
                daringleathercap_alb.DPS_AF = 10;
                daringleathercap_alb.Charges = 0;
                daringleathercap_alb.MaxCharges = 0;
                daringleathercap_alb.SpellID = 0;
                daringleathercap_alb.ProcSpellID = 0;
                daringleathercap_alb.SPD_ABS = 10;
                daringleathercap_alb.Realm = 0;
                daringleathercap_alb.MaxCount = 1;
                daringleathercap_alb.PackSize = 1;
                daringleathercap_alb.Extension = 0;
                daringleathercap_alb.Quality =89;
                daringleathercap_alb.Condition = 50000;
                daringleathercap_alb.MaxCondition = 50000;
                daringleathercap_alb.Durability = 50000;
                daringleathercap_alb.MaxDurability = 50000;
                daringleathercap_alb.PoisonCharges = 0;
                daringleathercap_alb.PoisonMaxCharges = 0;
                daringleathercap_alb.PoisonSpellID = 0;
                daringleathercap_alb.ProcSpellID1 = 0;
                daringleathercap_alb.SpellID1 = 0;
                daringleathercap_alb.MaxCharges1 = 0;
                daringleathercap_alb.Charges1 = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(daringleathercap_alb);
            }
            daringleathergloves_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringleathergloves_alb");
            if (daringleathergloves_alb == null)
            {
                daringleathergloves_alb = new ItemTemplate();
                daringleathergloves_alb.Name = "Daring Leather Gloves";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringleathergloves_alb.Name + ", creating it ...");
                daringleathergloves_alb.Level = 5;
                daringleathergloves_alb.Weight = 16;
                daringleathergloves_alb.Model = 34;
                daringleathergloves_alb.Object_Type = 33;
                daringleathergloves_alb.Item_Type = 22;
                daringleathergloves_alb.Id_nb = "daringleathergloves_alb";
                daringleathergloves_alb.Hand = 0;
                daringleathergloves_alb.Price = 0;
                daringleathergloves_alb.IsPickable = true;
                daringleathergloves_alb.IsDropable = true;
                daringleathergloves_alb.IsTradable = true;
                daringleathergloves_alb.CanDropAsLoot = false;
                daringleathergloves_alb.Color = 0;
                daringleathergloves_alb.Bonus = 0; // default bonus
                daringleathergloves_alb.Bonus1 = 4;
                daringleathergloves_alb.Bonus1Type = (int)2;
                daringleathergloves_alb.Bonus2 = 0;
                daringleathergloves_alb.Bonus2Type = (int)0;
                daringleathergloves_alb.Bonus3 = 0;
                daringleathergloves_alb.Bonus3Type = (int)0;
                daringleathergloves_alb.Bonus4 = 0;
                daringleathergloves_alb.Bonus4Type = (int)0;
                daringleathergloves_alb.Bonus5 = 0;
                daringleathergloves_alb.Bonus5Type = (int)0;
                daringleathergloves_alb.Bonus6 = 0;
                daringleathergloves_alb.Bonus6Type = (int)0;
                daringleathergloves_alb.Bonus7 = 0;
                daringleathergloves_alb.Bonus7Type = (int)0;
                daringleathergloves_alb.Bonus8 = 0;
                daringleathergloves_alb.Bonus8Type = (int)0;
                daringleathergloves_alb.Bonus9 = 0;
                daringleathergloves_alb.Bonus9Type = (int)0;
                daringleathergloves_alb.Bonus10 = 0;
                daringleathergloves_alb.Bonus10Type = (int)0;
                daringleathergloves_alb.ExtraBonus = 0;
                daringleathergloves_alb.ExtraBonusType = (int)0;
                daringleathergloves_alb.Effect = 0;
                daringleathergloves_alb.DPS_AF = 10;
                daringleathergloves_alb.Charges = 0;
                daringleathergloves_alb.MaxCharges = 0;
                daringleathergloves_alb.SpellID = 0;
                daringleathergloves_alb.ProcSpellID = 0;
                daringleathergloves_alb.SPD_ABS = 10;
                daringleathergloves_alb.Realm = 0;
                daringleathergloves_alb.MaxCount = 1;
                daringleathergloves_alb.PackSize = 1;
                daringleathergloves_alb.Extension = 0;
                daringleathergloves_alb.Quality =89;
                daringleathergloves_alb.Condition = 50000;
                daringleathergloves_alb.MaxCondition = 50000;
                daringleathergloves_alb.Durability = 50000;
                daringleathergloves_alb.MaxDurability = 50000;
                daringleathergloves_alb.PoisonCharges = 0;
                daringleathergloves_alb.PoisonMaxCharges = 0;
                daringleathergloves_alb.PoisonSpellID = 0;
                daringleathergloves_alb.ProcSpellID1 = 0;
                daringleathergloves_alb.SpellID1 = 0;
                daringleathergloves_alb.MaxCharges1 = 0;
                daringleathergloves_alb.Charges1 = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(daringleathergloves_alb);
            }
            daringleatherjerkin_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringleatherjerkin_alb");
            if (daringleatherjerkin_alb == null)
            {
                daringleatherjerkin_alb = new ItemTemplate();
                daringleatherjerkin_alb.Name = "Daring Leather Jerkin";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringleatherjerkin_alb.Name + ", creating it ...");
                daringleatherjerkin_alb.Level = 5;
                daringleatherjerkin_alb.Weight = 16;
                daringleatherjerkin_alb.Model = 31;
                daringleatherjerkin_alb.Object_Type = 33;
                daringleatherjerkin_alb.Item_Type = 25;
                daringleatherjerkin_alb.Id_nb = "daringleatherjerkin_alb";
                daringleatherjerkin_alb.Hand = 0;
                daringleatherjerkin_alb.Price = 0;
                daringleatherjerkin_alb.IsPickable = true;
                daringleatherjerkin_alb.IsDropable = true;
                daringleatherjerkin_alb.IsTradable = true;
                daringleatherjerkin_alb.CanDropAsLoot = false;
                daringleatherjerkin_alb.Color = 0;
                daringleatherjerkin_alb.Bonus = 0; // default bonus
                daringleatherjerkin_alb.Bonus1 = 12;
                daringleatherjerkin_alb.Bonus1Type = (int)10;
                daringleatherjerkin_alb.Bonus2 = 0;
                daringleatherjerkin_alb.Bonus2Type = (int)0;
                daringleatherjerkin_alb.Bonus3 = 0;
                daringleatherjerkin_alb.Bonus3Type = (int)0;
                daringleatherjerkin_alb.Bonus4 = 0;
                daringleatherjerkin_alb.Bonus4Type = (int)0;
                daringleatherjerkin_alb.Bonus5 = 0;
                daringleatherjerkin_alb.Bonus5Type = (int)0;
                daringleatherjerkin_alb.Bonus6 = 0;
                daringleatherjerkin_alb.Bonus6Type = (int)0;
                daringleatherjerkin_alb.Bonus7 = 0;
                daringleatherjerkin_alb.Bonus7Type = (int)0;
                daringleatherjerkin_alb.Bonus8 = 0;
                daringleatherjerkin_alb.Bonus8Type = (int)0;
                daringleatherjerkin_alb.Bonus9 = 0;
                daringleatherjerkin_alb.Bonus9Type = (int)0;
                daringleatherjerkin_alb.Bonus10 = 0;
                daringleatherjerkin_alb.Bonus10Type = (int)0;
                daringleatherjerkin_alb.ExtraBonus = 0;
                daringleatherjerkin_alb.ExtraBonusType = (int)0;
                daringleatherjerkin_alb.Effect = 0;
                daringleatherjerkin_alb.DPS_AF = 10;
                daringleatherjerkin_alb.Charges = 0;
                daringleatherjerkin_alb.MaxCharges = 0;
                daringleatherjerkin_alb.SpellID = 0;
                daringleatherjerkin_alb.ProcSpellID = 0;
                daringleatherjerkin_alb.SPD_ABS = 10;
                daringleatherjerkin_alb.Realm = 0;
                daringleatherjerkin_alb.MaxCount = 1;
                daringleatherjerkin_alb.PackSize = 1;
                daringleatherjerkin_alb.Extension = 0;
                daringleatherjerkin_alb.Quality =89;
                daringleatherjerkin_alb.Condition = 50000;
                daringleatherjerkin_alb.MaxCondition = 50000;
                daringleatherjerkin_alb.Durability = 50000;
                daringleatherjerkin_alb.MaxDurability = 50000;
                daringleatherjerkin_alb.PoisonCharges = 0;
                daringleatherjerkin_alb.PoisonMaxCharges = 0;
                daringleatherjerkin_alb.PoisonSpellID = 0;
                daringleatherjerkin_alb.ProcSpellID1 = 0;
                daringleatherjerkin_alb.SpellID1 = 0;
                daringleatherjerkin_alb.MaxCharges1 = 0;
                daringleatherjerkin_alb.Charges1 = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(daringleatherjerkin_alb);
            }
            daringleatherleggings_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringleatherleggings_alb");
            if (daringleatherleggings_alb == null)
            {
                daringleatherleggings_alb = new ItemTemplate();
                daringleatherleggings_alb.Name = "Daring Leather Leggings";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringleatherleggings_alb.Name + ", creating it ...");
                daringleatherleggings_alb.Level = 5;
                daringleatherleggings_alb.Weight = 16;
                daringleatherleggings_alb.Model = 32;
                daringleatherleggings_alb.Object_Type = 33;
                daringleatherleggings_alb.Item_Type = 27;
                daringleatherleggings_alb.Id_nb = "daringleatherleggings_alb";
                daringleatherleggings_alb.Hand = 0;
                daringleatherleggings_alb.Price = 0;
                daringleatherleggings_alb.IsPickable = true;
                daringleatherleggings_alb.IsDropable = true;
                daringleatherleggings_alb.IsTradable = true;
                daringleatherleggings_alb.CanDropAsLoot = false;
                daringleatherleggings_alb.Color = 0;
                daringleatherleggings_alb.Bonus = 0; // default bonus
                daringleatherleggings_alb.Bonus1 = 4;
                daringleatherleggings_alb.Bonus1Type = (int)2;
                daringleatherleggings_alb.Bonus2 = 0;
                daringleatherleggings_alb.Bonus2Type = (int)0;
                daringleatherleggings_alb.Bonus3 = 0;
                daringleatherleggings_alb.Bonus3Type = (int)0;
                daringleatherleggings_alb.Bonus4 = 0;
                daringleatherleggings_alb.Bonus4Type = (int)0;
                daringleatherleggings_alb.Bonus5 = 0;
                daringleatherleggings_alb.Bonus5Type = (int)0;
                daringleatherleggings_alb.Bonus6 = 0;
                daringleatherleggings_alb.Bonus6Type = (int)0;
                daringleatherleggings_alb.Bonus7 = 0;
                daringleatherleggings_alb.Bonus7Type = (int)0;
                daringleatherleggings_alb.Bonus8 = 0;
                daringleatherleggings_alb.Bonus8Type = (int)0;
                daringleatherleggings_alb.Bonus9 = 0;
                daringleatherleggings_alb.Bonus9Type = (int)0;
                daringleatherleggings_alb.Bonus10 = 0;
                daringleatherleggings_alb.Bonus10Type = (int)0;
                daringleatherleggings_alb.ExtraBonus = 0;
                daringleatherleggings_alb.ExtraBonusType = (int)0;
                daringleatherleggings_alb.Effect = 0;
                daringleatherleggings_alb.DPS_AF = 10;
                daringleatherleggings_alb.Charges = 0;
                daringleatherleggings_alb.MaxCharges = 0;
                daringleatherleggings_alb.SpellID = 0;
                daringleatherleggings_alb.ProcSpellID = 0;
                daringleatherleggings_alb.SPD_ABS = 10;
                daringleatherleggings_alb.Realm = 0;
                daringleatherleggings_alb.MaxCount = 1;
                daringleatherleggings_alb.PackSize = 1;
                daringleatherleggings_alb.Extension = 0;
                daringleatherleggings_alb.Quality =89;
                daringleatherleggings_alb.Condition = 50000;
                daringleatherleggings_alb.MaxCondition = 50000;
                daringleatherleggings_alb.Durability = 50000;
                daringleatherleggings_alb.MaxDurability = 50000;
                daringleatherleggings_alb.PoisonCharges = 0;
                daringleatherleggings_alb.PoisonMaxCharges = 0;
                daringleatherleggings_alb.PoisonSpellID = 0;
                daringleatherleggings_alb.ProcSpellID1 = 0;
                daringleatherleggings_alb.SpellID1 = 0;
                daringleatherleggings_alb.MaxCharges1 = 0;
                daringleatherleggings_alb.Charges1 = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(daringleatherleggings_alb);
            }
            daringleathersleeves_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringleathersleeves_alb");
            if (daringleathersleeves_alb == null)
            {
                daringleathersleeves_alb = new ItemTemplate();
                daringleathersleeves_alb.Name = "Daring Leather Sleeves";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringleathersleeves_alb.Name + ", creating it ...");
                daringleathersleeves_alb.Level = 5;
                daringleathersleeves_alb.Weight = 16;
                daringleathersleeves_alb.Model = 33;
                daringleathersleeves_alb.Object_Type = 33;
                daringleathersleeves_alb.Item_Type = 28;
                daringleathersleeves_alb.Id_nb = "daringleathersleeves_alb";
                daringleathersleeves_alb.Hand = 0;
                daringleathersleeves_alb.Price = 0;
                daringleathersleeves_alb.IsPickable = true;
                daringleathersleeves_alb.IsDropable = true;
                daringleathersleeves_alb.IsTradable = true;
                daringleathersleeves_alb.CanDropAsLoot = false;
                daringleathersleeves_alb.Color = 0;
                daringleathersleeves_alb.Bonus = 0; // default bonus
                daringleathersleeves_alb.Bonus1 = 4;
                daringleathersleeves_alb.Bonus1Type = (int)1;
                daringleathersleeves_alb.Bonus2 = 0;
                daringleathersleeves_alb.Bonus2Type = (int)0;
                daringleathersleeves_alb.Bonus3 = 0;
                daringleathersleeves_alb.Bonus3Type = (int)0;
                daringleathersleeves_alb.Bonus4 = 0;
                daringleathersleeves_alb.Bonus4Type = (int)0;
                daringleathersleeves_alb.Bonus5 = 0;
                daringleathersleeves_alb.Bonus5Type = (int)0;
                daringleathersleeves_alb.Bonus6 = 0;
                daringleathersleeves_alb.Bonus6Type = (int)0;
                daringleathersleeves_alb.Bonus7 = 0;
                daringleathersleeves_alb.Bonus7Type = (int)0;
                daringleathersleeves_alb.Bonus8 = 0;
                daringleathersleeves_alb.Bonus8Type = (int)0;
                daringleathersleeves_alb.Bonus9 = 0;
                daringleathersleeves_alb.Bonus9Type = (int)0;
                daringleathersleeves_alb.Bonus10 = 0;
                daringleathersleeves_alb.Bonus10Type = (int)0;
                daringleathersleeves_alb.ExtraBonus = 0;
                daringleathersleeves_alb.ExtraBonusType = (int)0;
                daringleathersleeves_alb.Effect = 0;
                daringleathersleeves_alb.DPS_AF = 10;
                daringleathersleeves_alb.Charges = 0;
                daringleathersleeves_alb.MaxCharges = 0;
                daringleathersleeves_alb.SpellID = 0;
                daringleathersleeves_alb.ProcSpellID = 0;
                daringleathersleeves_alb.SPD_ABS = 10;
                daringleathersleeves_alb.Realm = 0;
                daringleathersleeves_alb.MaxCount = 1;
                daringleathersleeves_alb.PackSize = 1;
                daringleathersleeves_alb.Extension = 0;
                daringleathersleeves_alb.Quality =89;
                daringleathersleeves_alb.Condition = 50000;
                daringleathersleeves_alb.MaxCondition = 50000;
                daringleathersleeves_alb.Durability = 50000;
                daringleathersleeves_alb.MaxDurability = 50000;
                daringleathersleeves_alb.PoisonCharges = 0;
                daringleathersleeves_alb.PoisonMaxCharges = 0;
                daringleathersleeves_alb.PoisonSpellID = 0;
                daringleathersleeves_alb.ProcSpellID1 = 0;
                daringleathersleeves_alb.SpellID1 = 0;
                daringleathersleeves_alb.MaxCharges1 = 0;
                daringleathersleeves_alb.Charges1 = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(daringleathersleeves_alb);
            }
            daringstuddedboots_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringstuddedboots_alb");
            if (daringstuddedboots_alb == null)
            {
                daringstuddedboots_alb = new ItemTemplate();
                daringstuddedboots_alb.Name = "Daring Studded Boots";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringstuddedboots_alb.Name + ", creating it ...");
                daringstuddedboots_alb.Level = 5;
                daringstuddedboots_alb.Weight = 24;
                daringstuddedboots_alb.Model = 84;
                daringstuddedboots_alb.Object_Type = 34;
                daringstuddedboots_alb.Item_Type = 23;
                daringstuddedboots_alb.Id_nb = "daringstuddedboots_alb";
                daringstuddedboots_alb.Hand = 0;
                daringstuddedboots_alb.Price = 0;
                daringstuddedboots_alb.IsPickable = true;
                daringstuddedboots_alb.IsDropable = true;
                daringstuddedboots_alb.IsTradable = true;
                daringstuddedboots_alb.CanDropAsLoot = false;
                daringstuddedboots_alb.Color = 0;
                daringstuddedboots_alb.Bonus = 0; // default bonus
                daringstuddedboots_alb.Bonus1 = 4;
                daringstuddedboots_alb.Bonus1Type = (int)3;
                daringstuddedboots_alb.Bonus2 = 0;
                daringstuddedboots_alb.Bonus2Type = (int)0;
                daringstuddedboots_alb.Bonus3 = 0;
                daringstuddedboots_alb.Bonus3Type = (int)0;
                daringstuddedboots_alb.Bonus4 = 0;
                daringstuddedboots_alb.Bonus4Type = (int)0;
                daringstuddedboots_alb.Bonus5 = 0;
                daringstuddedboots_alb.Bonus5Type = (int)0;
                daringstuddedboots_alb.Bonus6 = 0;
                daringstuddedboots_alb.Bonus6Type = (int)0;
                daringstuddedboots_alb.Bonus7 = 0;
                daringstuddedboots_alb.Bonus7Type = (int)0;
                daringstuddedboots_alb.Bonus8 = 0;
                daringstuddedboots_alb.Bonus8Type = (int)0;
                daringstuddedboots_alb.Bonus9 = 0;
                daringstuddedboots_alb.Bonus9Type = (int)0;
                daringstuddedboots_alb.Bonus10 = 0;
                daringstuddedboots_alb.Bonus10Type = (int)0;
                daringstuddedboots_alb.ExtraBonus = 0;
                daringstuddedboots_alb.ExtraBonusType = (int)0;
                daringstuddedboots_alb.Effect = 0;
                daringstuddedboots_alb.DPS_AF = 12;
                daringstuddedboots_alb.Charges = 0;
                daringstuddedboots_alb.MaxCharges = 0;
                daringstuddedboots_alb.SpellID = 0;
                daringstuddedboots_alb.ProcSpellID = 0;
                daringstuddedboots_alb.SPD_ABS = 19;
                daringstuddedboots_alb.Realm = 0;
                daringstuddedboots_alb.MaxCount = 1;
                daringstuddedboots_alb.PackSize = 1;
                daringstuddedboots_alb.Extension = 0;
                daringstuddedboots_alb.Quality =89;
                daringstuddedboots_alb.Condition = 50000;
                daringstuddedboots_alb.MaxCondition = 50000;
                daringstuddedboots_alb.Durability = 50000;
                daringstuddedboots_alb.MaxDurability = 50000;
                daringstuddedboots_alb.PoisonCharges = 0;
                daringstuddedboots_alb.PoisonMaxCharges = 0;
                daringstuddedboots_alb.PoisonSpellID = 0;
                daringstuddedboots_alb.ProcSpellID1 = 0;
                daringstuddedboots_alb.SpellID1 = 0;
                daringstuddedboots_alb.MaxCharges1 = 0;
                daringstuddedboots_alb.Charges1 = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(daringstuddedboots_alb);
            }
            daringstuddedcap_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringstuddedcap_alb");
            if (daringstuddedcap_alb == null)
            {
                daringstuddedcap_alb = new ItemTemplate();
                daringstuddedcap_alb.Name = "Daring Studded Cap";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringstuddedcap_alb.Name + ", creating it ...");
                daringstuddedcap_alb.Level = 5;
                daringstuddedcap_alb.Weight = 24;
                daringstuddedcap_alb.Model = 824;
                daringstuddedcap_alb.Object_Type = 34;
                daringstuddedcap_alb.Item_Type = 21;
                daringstuddedcap_alb.Id_nb = "daringstuddedcap_alb";
                daringstuddedcap_alb.Hand = 0;
                daringstuddedcap_alb.Price = 0;
                daringstuddedcap_alb.IsPickable = true;
                daringstuddedcap_alb.IsDropable = true;
                daringstuddedcap_alb.IsTradable = true;
                daringstuddedcap_alb.CanDropAsLoot = false;
                daringstuddedcap_alb.Color = 0;
                daringstuddedcap_alb.Bonus = 0; // default bonus
                daringstuddedcap_alb.Bonus1 = 4;
                daringstuddedcap_alb.Bonus1Type = (int)3;
                daringstuddedcap_alb.Bonus2 = 0;
                daringstuddedcap_alb.Bonus2Type = (int)0;
                daringstuddedcap_alb.Bonus3 = 0;
                daringstuddedcap_alb.Bonus3Type = (int)0;
                daringstuddedcap_alb.Bonus4 = 0;
                daringstuddedcap_alb.Bonus4Type = (int)0;
                daringstuddedcap_alb.Bonus5 = 0;
                daringstuddedcap_alb.Bonus5Type = (int)0;
                daringstuddedcap_alb.Bonus6 = 0;
                daringstuddedcap_alb.Bonus6Type = (int)0;
                daringstuddedcap_alb.Bonus7 = 0;
                daringstuddedcap_alb.Bonus7Type = (int)0;
                daringstuddedcap_alb.Bonus8 = 0;
                daringstuddedcap_alb.Bonus8Type = (int)0;
                daringstuddedcap_alb.Bonus9 = 0;
                daringstuddedcap_alb.Bonus9Type = (int)0;
                daringstuddedcap_alb.Bonus10 = 0;
                daringstuddedcap_alb.Bonus10Type = (int)0;
                daringstuddedcap_alb.ExtraBonus = 0;
                daringstuddedcap_alb.ExtraBonusType = (int)0;
                daringstuddedcap_alb.Effect = 0;
                daringstuddedcap_alb.DPS_AF = 12;
                daringstuddedcap_alb.Charges = 0;
                daringstuddedcap_alb.MaxCharges = 0;
                daringstuddedcap_alb.SpellID = 0;
                daringstuddedcap_alb.ProcSpellID = 0;
                daringstuddedcap_alb.SPD_ABS = 19;
                daringstuddedcap_alb.Realm = 0;
                daringstuddedcap_alb.MaxCount = 1;
                daringstuddedcap_alb.PackSize = 1;
                daringstuddedcap_alb.Extension = 0;
                daringstuddedcap_alb.Quality =89;
                daringstuddedcap_alb.Condition = 50000;
                daringstuddedcap_alb.MaxCondition = 50000;
                daringstuddedcap_alb.Durability = 50000;
                daringstuddedcap_alb.MaxDurability = 50000;
                daringstuddedcap_alb.PoisonCharges = 0;
                daringstuddedcap_alb.PoisonMaxCharges = 0;
                daringstuddedcap_alb.PoisonSpellID = 0;
                daringstuddedcap_alb.ProcSpellID1 = 0;
                daringstuddedcap_alb.SpellID1 = 0;
                daringstuddedcap_alb.MaxCharges1 = 0;
                daringstuddedcap_alb.Charges1 = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(daringstuddedcap_alb);
            }
            daringstuddedgloves_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringstuddedgloves_alb");
            if (daringstuddedgloves_alb == null)
            {
                daringstuddedgloves_alb = new ItemTemplate();
                daringstuddedgloves_alb.Name = "Daring Studded Gloves";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringstuddedgloves_alb.Name + ", creating it ...");
                daringstuddedgloves_alb.Level = 5;
                daringstuddedgloves_alb.Weight = 24;
                daringstuddedgloves_alb.Model = 85;
                daringstuddedgloves_alb.Object_Type = 34;
                daringstuddedgloves_alb.Item_Type = 22;
                daringstuddedgloves_alb.Id_nb = "daringstuddedgloves_alb";
                daringstuddedgloves_alb.Hand = 0;
                daringstuddedgloves_alb.Price = 0;
                daringstuddedgloves_alb.IsPickable = true;
                daringstuddedgloves_alb.IsDropable = true;
                daringstuddedgloves_alb.IsTradable = true;
                daringstuddedgloves_alb.CanDropAsLoot = false;
                daringstuddedgloves_alb.Color = 0;
                daringstuddedgloves_alb.Bonus = 0; // default bonus
                daringstuddedgloves_alb.Bonus1 = 4;
                daringstuddedgloves_alb.Bonus1Type = (int)4;
                daringstuddedgloves_alb.Bonus2 = 0;
                daringstuddedgloves_alb.Bonus2Type = (int)0;
                daringstuddedgloves_alb.Bonus3 = 0;
                daringstuddedgloves_alb.Bonus3Type = (int)0;
                daringstuddedgloves_alb.Bonus4 = 0;
                daringstuddedgloves_alb.Bonus4Type = (int)0;
                daringstuddedgloves_alb.Bonus5 = 0;
                daringstuddedgloves_alb.Bonus5Type = (int)0;
                daringstuddedgloves_alb.Bonus6 = 0;
                daringstuddedgloves_alb.Bonus6Type = (int)0;
                daringstuddedgloves_alb.Bonus7 = 0;
                daringstuddedgloves_alb.Bonus7Type = (int)0;
                daringstuddedgloves_alb.Bonus8 = 0;
                daringstuddedgloves_alb.Bonus8Type = (int)0;
                daringstuddedgloves_alb.Bonus9 = 0;
                daringstuddedgloves_alb.Bonus9Type = (int)0;
                daringstuddedgloves_alb.Bonus10 = 0;
                daringstuddedgloves_alb.Bonus10Type = (int)0;
                daringstuddedgloves_alb.ExtraBonus = 0;
                daringstuddedgloves_alb.ExtraBonusType = (int)0;
                daringstuddedgloves_alb.Effect = 0;
                daringstuddedgloves_alb.DPS_AF = 12;
                daringstuddedgloves_alb.Charges = 0;
                daringstuddedgloves_alb.MaxCharges = 0;
                daringstuddedgloves_alb.SpellID = 0;
                daringstuddedgloves_alb.ProcSpellID = 0;
                daringstuddedgloves_alb.SPD_ABS = 19;
                daringstuddedgloves_alb.Realm = 0;
                daringstuddedgloves_alb.MaxCount = 1;
                daringstuddedgloves_alb.PackSize = 1;
                daringstuddedgloves_alb.Extension = 0;
                daringstuddedgloves_alb.Quality =89;
                daringstuddedgloves_alb.Condition = 50000;
                daringstuddedgloves_alb.MaxCondition = 50000;
                daringstuddedgloves_alb.Durability = 50000;
                daringstuddedgloves_alb.MaxDurability = 50000;
                daringstuddedgloves_alb.PoisonCharges = 0;
                daringstuddedgloves_alb.PoisonMaxCharges = 0;
                daringstuddedgloves_alb.PoisonSpellID = 0;
                daringstuddedgloves_alb.ProcSpellID1 = 0;
                daringstuddedgloves_alb.SpellID1 = 0;
                daringstuddedgloves_alb.MaxCharges1 = 0;
                daringstuddedgloves_alb.Charges1 = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(daringstuddedgloves_alb);
            }
            daringstuddedjerkin_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringstuddedjerkin_alb");
            if (daringstuddedjerkin_alb == null)
            {
                daringstuddedjerkin_alb = new ItemTemplate();
                daringstuddedjerkin_alb.Name = "Daring Studded Jerkin";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringstuddedjerkin_alb.Name + ", creating it ...");
                daringstuddedjerkin_alb.Level = 5;
                daringstuddedjerkin_alb.Weight = 60;
                daringstuddedjerkin_alb.Model = 81;
                daringstuddedjerkin_alb.Object_Type = 34;
                daringstuddedjerkin_alb.Item_Type = 25;
                daringstuddedjerkin_alb.Id_nb = "daringstuddedjerkin_alb";
                daringstuddedjerkin_alb.Hand = 0;
                daringstuddedjerkin_alb.Price = 0;
                daringstuddedjerkin_alb.IsPickable = true;
                daringstuddedjerkin_alb.IsDropable = true;
                daringstuddedjerkin_alb.IsTradable = true;
                daringstuddedjerkin_alb.CanDropAsLoot = false;
                daringstuddedjerkin_alb.Color = 0;
                daringstuddedjerkin_alb.Bonus = 0; // default bonus
                daringstuddedjerkin_alb.Bonus1 = 12;
                daringstuddedjerkin_alb.Bonus1Type = (int)10;
                daringstuddedjerkin_alb.Bonus2 = 0;
                daringstuddedjerkin_alb.Bonus2Type = (int)0;
                daringstuddedjerkin_alb.Bonus3 = 0;
                daringstuddedjerkin_alb.Bonus3Type = (int)0;
                daringstuddedjerkin_alb.Bonus4 = 0;
                daringstuddedjerkin_alb.Bonus4Type = (int)0;
                daringstuddedjerkin_alb.Bonus5 = 0;
                daringstuddedjerkin_alb.Bonus5Type = (int)0;
                daringstuddedjerkin_alb.Bonus6 = 0;
                daringstuddedjerkin_alb.Bonus6Type = (int)0;
                daringstuddedjerkin_alb.Bonus7 = 0;
                daringstuddedjerkin_alb.Bonus7Type = (int)0;
                daringstuddedjerkin_alb.Bonus8 = 0;
                daringstuddedjerkin_alb.Bonus8Type = (int)0;
                daringstuddedjerkin_alb.Bonus9 = 0;
                daringstuddedjerkin_alb.Bonus9Type = (int)0;
                daringstuddedjerkin_alb.Bonus10 = 0;
                daringstuddedjerkin_alb.Bonus10Type = (int)0;
                daringstuddedjerkin_alb.ExtraBonus = 0;
                daringstuddedjerkin_alb.ExtraBonusType = (int)0;
                daringstuddedjerkin_alb.Effect = 0;
                daringstuddedjerkin_alb.DPS_AF = 12;
                daringstuddedjerkin_alb.Charges = 0;
                daringstuddedjerkin_alb.MaxCharges = 0;
                daringstuddedjerkin_alb.SpellID = 0;
                daringstuddedjerkin_alb.ProcSpellID = 0;
                daringstuddedjerkin_alb.SPD_ABS = 19;
                daringstuddedjerkin_alb.Realm = 0;
                daringstuddedjerkin_alb.MaxCount = 1;
                daringstuddedjerkin_alb.PackSize = 1;
                daringstuddedjerkin_alb.Extension = 0;
                daringstuddedjerkin_alb.Quality =89;
                daringstuddedjerkin_alb.Condition = 50000;
                daringstuddedjerkin_alb.MaxCondition = 50000;
                daringstuddedjerkin_alb.Durability = 50000;
                daringstuddedjerkin_alb.MaxDurability = 50000;
                daringstuddedjerkin_alb.PoisonCharges = 0;
                daringstuddedjerkin_alb.PoisonMaxCharges = 0;
                daringstuddedjerkin_alb.PoisonSpellID = 0;
                daringstuddedjerkin_alb.ProcSpellID1 = 0;
                daringstuddedjerkin_alb.SpellID1 = 0;
                daringstuddedjerkin_alb.MaxCharges1 = 0;
                daringstuddedjerkin_alb.Charges1 = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(daringstuddedjerkin_alb);
            }
            daringstuddedleggings_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringstuddedleggings_alb");
            if (daringstuddedleggings_alb == null)
            {
                daringstuddedleggings_alb = new ItemTemplate();
                daringstuddedleggings_alb.Name = "Daring Studded Leggings";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringstuddedleggings_alb.Name + ", creating it ...");
                daringstuddedleggings_alb.Level = 5;
                daringstuddedleggings_alb.Weight = 42;
                daringstuddedleggings_alb.Model = 82;
                daringstuddedleggings_alb.Object_Type = 34;
                daringstuddedleggings_alb.Item_Type = 27;
                daringstuddedleggings_alb.Id_nb = "daringstuddedleggings_alb";
                daringstuddedleggings_alb.Hand = 0;
                daringstuddedleggings_alb.Price = 0;
                daringstuddedleggings_alb.IsPickable = true;
                daringstuddedleggings_alb.IsDropable = true;
                daringstuddedleggings_alb.IsTradable = true;
                daringstuddedleggings_alb.CanDropAsLoot = false;
                daringstuddedleggings_alb.Color = 0;
                daringstuddedleggings_alb.Bonus = 0; // default bonus
                daringstuddedleggings_alb.Bonus1 = 4;
                daringstuddedleggings_alb.Bonus1Type = (int)4;
                daringstuddedleggings_alb.Bonus2 = 0;
                daringstuddedleggings_alb.Bonus2Type = (int)0;
                daringstuddedleggings_alb.Bonus3 = 0;
                daringstuddedleggings_alb.Bonus3Type = (int)0;
                daringstuddedleggings_alb.Bonus4 = 0;
                daringstuddedleggings_alb.Bonus4Type = (int)0;
                daringstuddedleggings_alb.Bonus5 = 0;
                daringstuddedleggings_alb.Bonus5Type = (int)0;
                daringstuddedleggings_alb.Bonus6 = 0;
                daringstuddedleggings_alb.Bonus6Type = (int)0;
                daringstuddedleggings_alb.Bonus7 = 0;
                daringstuddedleggings_alb.Bonus7Type = (int)0;
                daringstuddedleggings_alb.Bonus8 = 0;
                daringstuddedleggings_alb.Bonus8Type = (int)0;
                daringstuddedleggings_alb.Bonus9 = 0;
                daringstuddedleggings_alb.Bonus9Type = (int)0;
                daringstuddedleggings_alb.Bonus10 = 0;
                daringstuddedleggings_alb.Bonus10Type = (int)0;
                daringstuddedleggings_alb.ExtraBonus = 0;
                daringstuddedleggings_alb.ExtraBonusType = (int)0;
                daringstuddedleggings_alb.Effect = 0;
                daringstuddedleggings_alb.DPS_AF = 12;
                daringstuddedleggings_alb.Charges = 0;
                daringstuddedleggings_alb.MaxCharges = 0;
                daringstuddedleggings_alb.SpellID = 0;
                daringstuddedleggings_alb.ProcSpellID = 0;
                daringstuddedleggings_alb.SPD_ABS = 19;
                daringstuddedleggings_alb.Realm = 0;
                daringstuddedleggings_alb.MaxCount = 1;
                daringstuddedleggings_alb.PackSize = 1;
                daringstuddedleggings_alb.Extension = 0;
                daringstuddedleggings_alb.Quality =89;
                daringstuddedleggings_alb.Condition = 50000;
                daringstuddedleggings_alb.MaxCondition = 50000;
                daringstuddedleggings_alb.Durability = 50000;
                daringstuddedleggings_alb.MaxDurability = 50000;
                daringstuddedleggings_alb.PoisonCharges = 0;
                daringstuddedleggings_alb.PoisonMaxCharges = 0;
                daringstuddedleggings_alb.PoisonSpellID = 0;
                daringstuddedleggings_alb.ProcSpellID1 = 0;
                daringstuddedleggings_alb.SpellID1 = 0;
                daringstuddedleggings_alb.MaxCharges1 = 0;
                daringstuddedleggings_alb.Charges1 = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(daringstuddedleggings_alb);
            }
            daringstuddedsleeves_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringstuddedsleeves_alb");
            if (daringstuddedsleeves_alb == null)
            {
                daringstuddedsleeves_alb = new ItemTemplate();
                daringstuddedsleeves_alb.Name = "Daring Studded Sleeves";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringstuddedsleeves_alb.Name + ", creating it ...");
                daringstuddedsleeves_alb.Level = 5;
                daringstuddedsleeves_alb.Weight = 36;
                daringstuddedsleeves_alb.Model = 83;
                daringstuddedsleeves_alb.Object_Type = 34;
                daringstuddedsleeves_alb.Item_Type = 28;
                daringstuddedsleeves_alb.Id_nb = "daringstuddedsleeves_alb";
                daringstuddedsleeves_alb.Hand = 0;
                daringstuddedsleeves_alb.Price = 0;
                daringstuddedsleeves_alb.IsPickable = true;
                daringstuddedsleeves_alb.IsDropable = true;
                daringstuddedsleeves_alb.IsTradable = true;
                daringstuddedsleeves_alb.CanDropAsLoot = false;
                daringstuddedsleeves_alb.Color = 0;
                daringstuddedsleeves_alb.Bonus = 0; // default bonus
                daringstuddedsleeves_alb.Bonus1 = 4;
                daringstuddedsleeves_alb.Bonus1Type = (int)1;
                daringstuddedsleeves_alb.Bonus2 = 0;
                daringstuddedsleeves_alb.Bonus2Type = (int)0;
                daringstuddedsleeves_alb.Bonus3 = 0;
                daringstuddedsleeves_alb.Bonus3Type = (int)0;
                daringstuddedsleeves_alb.Bonus4 = 0;
                daringstuddedsleeves_alb.Bonus4Type = (int)0;
                daringstuddedsleeves_alb.Bonus5 = 0;
                daringstuddedsleeves_alb.Bonus5Type = (int)0;
                daringstuddedsleeves_alb.Bonus6 = 0;
                daringstuddedsleeves_alb.Bonus6Type = (int)0;
                daringstuddedsleeves_alb.Bonus7 = 0;
                daringstuddedsleeves_alb.Bonus7Type = (int)0;
                daringstuddedsleeves_alb.Bonus8 = 0;
                daringstuddedsleeves_alb.Bonus8Type = (int)0;
                daringstuddedsleeves_alb.Bonus9 = 0;
                daringstuddedsleeves_alb.Bonus9Type = (int)0;
                daringstuddedsleeves_alb.Bonus10 = 0;
                daringstuddedsleeves_alb.Bonus10Type = (int)0;
                daringstuddedsleeves_alb.ExtraBonus = 0;
                daringstuddedsleeves_alb.ExtraBonusType = (int)0;
                daringstuddedsleeves_alb.Effect = 0;
                daringstuddedsleeves_alb.DPS_AF = 12;
                daringstuddedsleeves_alb.Charges = 0;
                daringstuddedsleeves_alb.MaxCharges = 0;
                daringstuddedsleeves_alb.SpellID = 0;
                daringstuddedsleeves_alb.ProcSpellID = 0;
                daringstuddedsleeves_alb.SPD_ABS = 19;
                daringstuddedsleeves_alb.Realm = 0;
                daringstuddedsleeves_alb.MaxCount = 1;
                daringstuddedsleeves_alb.PackSize = 1;
                daringstuddedsleeves_alb.Extension = 0;
                daringstuddedsleeves_alb.Quality =89;
                daringstuddedsleeves_alb.Condition = 50000;
                daringstuddedsleeves_alb.MaxCondition = 50000;
                daringstuddedsleeves_alb.Durability = 50000;
                daringstuddedsleeves_alb.MaxDurability = 50000;
                daringstuddedsleeves_alb.PoisonCharges = 0;
                daringstuddedsleeves_alb.PoisonMaxCharges = 0;
                daringstuddedsleeves_alb.PoisonSpellID = 0;
                daringstuddedsleeves_alb.ProcSpellID1 = 0;
                daringstuddedsleeves_alb.SpellID1 = 0;
                daringstuddedsleeves_alb.MaxCharges1 = 0;
                daringstuddedsleeves_alb.Charges1 = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(daringstuddedsleeves_alb);
            }

            #endregion

            #region defineAreas
            Albion_Statue_Area = WorldMgr.GetRegion(Albion_Statue.RegionID).AddArea(new Area.Circle("", Albion_Statue.X, Albion_Statue.Y, Albion_Statue.Z, 500));
            Albion_Statue_Area.RegisterPlayerEnter(new DOLEventHandler(PlayerEnterStatueArea));

            #endregion

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            GameEventMgr.AddHandler(Charles, GameLivingEvent.Interact, new DOLEventHandler(TalkToCharles));
            GameEventMgr.AddHandler(Charles, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToCharles));

            Charles.AddQuestToGive(typeof(childsplay));
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Example #59
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");

            #region defineNPCs

            GameNPC[] npcs;

            npcs = WorldMgr.GetNPCsByName("Sir Quait", (eRealm)1);
            if (npcs.Length == 0)
            {
                SirQuait = new DOL.GS.GameNPC();
                SirQuait.Model = 40;
                SirQuait.Name = "Sir Quait";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + SirQuait.Name + ", creating ...");
                SirQuait.GuildName = "Part of " + questTitle + " Quest";
                SirQuait.Realm = eRealm.Albion;
                SirQuait.CurrentRegionID = 1;
                SirQuait.Size = 50;
                SirQuait.Level = 10;
                SirQuait.MaxSpeedBase = 100;
                SirQuait.Faction = FactionMgr.GetFactionByID(0);
                SirQuait.X = 531971;
                SirQuait.Y = 478955;
                SirQuait.Z = 0;
                SirQuait.Heading = 3570;
                SirQuait.RespawnInterval = 0;
                SirQuait.BodyType = 0;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                SirQuait.SetOwnBrain(brain);

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    SirQuait.SaveIntoDatabase();

                SirQuait.AddToWorld();
            }
            else
            {
                SirQuait = npcs[0];
            }

            npcs = WorldMgr.GetNPCsByName("Evil Thief of the Shadowclan", (eRealm)0);
            if (npcs.Length == 0)
            {
                EvilThiefoftheShadowclan = new DOL.GS.GameNPC();
                EvilThiefoftheShadowclan.Model = 55;
                EvilThiefoftheShadowclan.Name = "Evil Thief of the Shadowclan";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + EvilThiefoftheShadowclan.Name + ", creating ...");
                EvilThiefoftheShadowclan.GuildName = "Part of " + questTitle + " Quest";
                EvilThiefoftheShadowclan.Realm = eRealm.None;
                EvilThiefoftheShadowclan.CurrentRegionID = 1;
                EvilThiefoftheShadowclan.Size = 50;
                EvilThiefoftheShadowclan.Level = 1;
                EvilThiefoftheShadowclan.MaxSpeedBase = 100;
                EvilThiefoftheShadowclan.Faction = FactionMgr.GetFactionByID(0);
                EvilThiefoftheShadowclan.X = 532571;
                EvilThiefoftheShadowclan.Y = 479055;
                EvilThiefoftheShadowclan.Z = 2200;
                EvilThiefoftheShadowclan.Heading = 3570;
                EvilThiefoftheShadowclan.RespawnInterval = 0;
                EvilThiefoftheShadowclan.BodyType = 0;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                EvilThiefoftheShadowclan.SetOwnBrain(brain);

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    EvilThiefoftheShadowclan.SaveIntoDatabase();

                EvilThiefoftheShadowclan.AddToWorld();
            }
            else
            {
                EvilThiefoftheShadowclan = npcs[0];
            }

            #endregion defineNPCs

            #region defineItems

            SirQuaitsSword = GameServer.Database.FindObjectByKey<ItemTemplate>("SirQuaitsSword");
            if (SirQuaitsSword == null)
            {
                SirQuaitsSword = new ItemTemplate();
                SirQuaitsSword.Name = "Sir Quait's Sword";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + SirQuaitsSword.Name + ", creating it ...");
                SirQuaitsSword.Level = 1;
                SirQuaitsSword.Weight = 0;
                SirQuaitsSword.Model = 847;
                SirQuaitsSword.Object_Type = 0;
                SirQuaitsSword.Item_Type = 0;
                SirQuaitsSword.Id_nb = "SirQuaitsSword";
                SirQuaitsSword.Hand = 0;
                SirQuaitsSword.Price = 0;
                SirQuaitsSword.IsPickable = false;
                SirQuaitsSword.IsDropable = false;
                SirQuaitsSword.IsTradable = true;
                SirQuaitsSword.CanDropAsLoot = true;
                SirQuaitsSword.Color = 0;
                SirQuaitsSword.Bonus = 0; // default bonus
                SirQuaitsSword.Bonus1 = 0;
                SirQuaitsSword.Bonus1Type = (int)0;
                SirQuaitsSword.Bonus2 = 0;
                SirQuaitsSword.Bonus2Type = (int)0;
                SirQuaitsSword.Bonus3 = 0;
                SirQuaitsSword.Bonus3Type = (int)0;
                SirQuaitsSword.Bonus4 = 0;
                SirQuaitsSword.Bonus4Type = (int)0;
                SirQuaitsSword.Bonus5 = 0;
                SirQuaitsSword.Bonus5Type = (int)0;
                SirQuaitsSword.Bonus6 = 0;
                SirQuaitsSword.Bonus6Type = (int)0;
                SirQuaitsSword.Bonus7 = 0;
                SirQuaitsSword.Bonus7Type = (int)0;
                SirQuaitsSword.Bonus8 = 0;
                SirQuaitsSword.Bonus8Type = (int)0;
                SirQuaitsSword.Bonus9 = 0;
                SirQuaitsSword.Bonus9Type = (int)0;
                SirQuaitsSword.Bonus10 = 0;
                SirQuaitsSword.Bonus10Type = (int)0;
                SirQuaitsSword.ExtraBonus = 0;
                SirQuaitsSword.ExtraBonusType = (int)0;
                SirQuaitsSword.Effect = 0;
                SirQuaitsSword.Emblem = 0;
                SirQuaitsSword.Charges = 0;
                SirQuaitsSword.MaxCharges = 0;
                SirQuaitsSword.SpellID = 0;
                SirQuaitsSword.ProcSpellID = 0;
                SirQuaitsSword.Type_Damage = 0;
                SirQuaitsSword.Realm = 0;
                SirQuaitsSword.MaxCount = 1;
                SirQuaitsSword.PackSize = 1;
                SirQuaitsSword.Extension = 0;
                SirQuaitsSword.Quality = 1;
                SirQuaitsSword.Condition = 1;
                SirQuaitsSword.MaxCondition = 1;
                SirQuaitsSword.Durability = 1;
                SirQuaitsSword.MaxDurability = 1;
                SirQuaitsSword.PoisonCharges = 0;
                SirQuaitsSword.PoisonMaxCharges = 0;
                SirQuaitsSword.PoisonSpellID = 0;
                SirQuaitsSword.ProcSpellID1 = 0;
                SirQuaitsSword.SpellID1 = 0;
                SirQuaitsSword.MaxCharges1 = 0;
                SirQuaitsSword.Charges1 = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                GameServer.Database.AddObject(SirQuaitsSword);
            }

            #endregion defineItems

            #region defineAreas

            #endregion defineAreas

            #region defineQuestParts

            QuestBuilder builder = QuestMgr.getBuilder(typeof(HelpSirQuait));
            QuestBehaviour a;
            a = builder.CreateBehaviour(SirQuait, -1);
            a.AddTrigger(eTriggerType.Interact, null, SirQuait);
            a.AddRequirement(eRequirementType.QuestPending, typeof(HelpSirQuait), null, (eComparator)5);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(HelpSirQuait), SirQuait);
            a.AddAction(eActionType.Talk, "Hello adventurer, an [evil thief] has stolen my [sword], can [you help me] get it back?", SirQuait);
            AddBehaviour(a);
            a = builder.CreateBehaviour(SirQuait, -1);
            a.AddTrigger(eTriggerType.Whisper, "sword", SirQuait);
            a.AddRequirement(eRequirementType.QuestPending, typeof(HelpSirQuait), null, (eComparator)5);
            a.AddAction(eActionType.Talk, "I really need it and if [you help me], I will give you a little reward!", SirQuait);
            AddBehaviour(a);
            a = builder.CreateBehaviour(SirQuait, -1);
            a.AddTrigger(eTriggerType.Whisper, "sword", SirQuait);
            a.AddRequirement(eRequirementType.QuestPending, typeof(HelpSirQuait), null);
            a.AddAction(eActionType.Talk, "I really need it I am so glad you are helping me!", SirQuait);
            AddBehaviour(a);
            a = builder.CreateBehaviour(SirQuait, -1);
            a.AddTrigger(eTriggerType.Whisper, "evil thief", SirQuait);
            a.AddRequirement(eRequirementType.QuestPending, typeof(HelpSirQuait), null, (eComparator)5);
            a.AddAction(eActionType.Talk, "This evil thief of the shadowclan bastard, he stole it! Kill him and get my [sword] back to me!", SirQuait);
            AddBehaviour(a);
            a = builder.CreateBehaviour(SirQuait, -1);
            a.AddTrigger(eTriggerType.Whisper, "you help me", SirQuait);
            a.AddRequirement(eRequirementType.QuestPending, typeof(HelpSirQuait), null, (eComparator)5);
            a.AddAction(eActionType.OfferQuest, typeof(HelpSirQuait), "Do you want to help Sir Quait?");
            AddBehaviour(a);
            a = builder.CreateBehaviour(SirQuait, -1);
            a.AddTrigger(eTriggerType.Whisper, "find", SirQuait);
            a.AddRequirement(eRequirementType.QuestPending, typeof(HelpSirQuait), null);
            a.AddAction(eActionType.Talk, "Really!? Please give it to me!", SirQuait);
            AddBehaviour(a);
            a = builder.CreateBehaviour(SirQuait, -1);
            a.AddTrigger(eTriggerType.Interact, null, SirQuait);
            a.AddRequirement(eRequirementType.QuestPending, typeof(HelpSirQuait), null);
            a.AddAction(eActionType.Talk, "Did you [find] my [sword]?", SirQuait);
            AddBehaviour(a);
            a = builder.CreateBehaviour(SirQuait, -1);
            a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(HelpSirQuait));
            a.AddRequirement(eRequirementType.QuestGivable, typeof(HelpSirQuait), SirQuait);
            a.AddAction(eActionType.Talk, "Oh well, if you change your mind, please come back!", SirQuait);
            AddBehaviour(a);
            a = builder.CreateBehaviour(SirQuait, -1);
            a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(HelpSirQuait));
            a.AddRequirement(eRequirementType.QuestGivable, typeof(HelpSirQuait), SirQuait);
            a.AddAction(eActionType.Talk, "Thank you! Please bring the [sword] back to me!", SirQuait);
            a.AddAction(eActionType.GiveQuest, typeof(HelpSirQuait), SirQuait);
            AddBehaviour(a);
            a = builder.CreateBehaviour(EvilThiefoftheShadowclan, -1);
            a.AddTrigger(eTriggerType.EnemyKilled, null, EvilThiefoftheShadowclan);
            a.AddRequirement(eRequirementType.QuestStep, typeof(HelpSirQuait), 1, (eComparator)3);
            a.AddAction(eActionType.Message, "You defeated the evil thief and quickly pick up Sir Quait's sword!", (eTextType)1);
            a.AddAction(eActionType.GiveItem, SirQuaitsSword, null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(SirQuait, -1);
            a.AddTrigger(eTriggerType.GiveItem, SirQuait, SirQuaitsSword);
            a.AddRequirement(eRequirementType.QuestStep, typeof(HelpSirQuait), 1, (eComparator)3);
            a.AddAction(eActionType.Message, "Sir Quait thanks you for bringing back his holy sword!", (eTextType)1);
            a.AddAction(eActionType.TakeItem, SirQuaitsSword, null);
            a.AddAction(eActionType.FinishQuest, typeof(HelpSirQuait), null);
            AddBehaviour(a);

            #endregion defineQuestParts

            // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End

            SirQuait.AddQuestToGive(typeof(HelpSirQuait));
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Example #60
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");

            #region defineNPCs

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Master Ferowl", eRealm.Albion);
            if (npcs.Length == 0)
            {
                Ferowl = new GameNPC();
                Ferowl.Model = 61;
                Ferowl.Name = "Master Ferowl";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + Ferowl.Name + " , creating it ...");
                Ferowl.GuildName = "";
                Ferowl.Realm = eRealm.Albion;
                Ferowl.CurrentRegionID = 1;
                Ferowl.Size = 51;
                Ferowl.Level = 40;
                Ferowl.X = 559716;
                Ferowl.Y = 510733;
                Ferowl.Z = 2720;
                Ferowl.Heading = 703;
                Ferowl.AddToWorld();

                if (SAVE_INTO_DATABASE)
                    Ferowl.SaveIntoDatabase();
            }
            else
                Ferowl = npcs[0];
            // end npc

            npcs = WorldMgr.GetNPCsByName("Morgana", eRealm.None);
            if (npcs.Length == 0)
            {
                Morgana = new GameNPC();
                Morgana.Model = 283;
                Morgana.Name = "Morgana";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + Morgana.Name + " , creating it ...");
                Morgana.GuildName = "";
                Morgana.Realm = eRealm.None;
                Morgana.CurrentRegionID = 1;
                Morgana.Size = 51;
                Morgana.Level = 90;
                Morgana.X = 306056;
                Morgana.Y = 670106;
                Morgana.Z = 3095;
                Morgana.Heading = 3261;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                Morgana.SetOwnBrain(brain);

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 98, 43);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 133, 61);
                Morgana.Inventory = template.CloseTemplate();

            //				Morgana.AddNPCEquipment((byte) eVisibleItems.TORSO, 98, 43, 0, 0);
            //				Morgana.AddNPCEquipment((byte) eVisibleItems.BOOT, 133, 61, 0, 0);

                //Morgana.AddToWorld(); will be added later during quest

                if (SAVE_INTO_DATABASE)
                    Morgana.SaveIntoDatabase();
            }
            else
                Morgana = npcs[0];

            npcs = WorldMgr.GetNPCsByName("Bechard", eRealm.None);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Bechard , creating it ...");
                Bechard = new GameNPC();
                Bechard.Model = 606;
                Bechard.Name = "Bechard";
                Bechard.GuildName = "";
                Bechard.Realm = eRealm.None;
                Bechard.CurrentRegionID = 1;
                Bechard.Size = 50;
                Bechard.Level = 63;
                Bechard.X = 306025;
                Bechard.Y = 670473;
                Bechard.Z = 2863;
                Bechard.Heading = 3754;
                Bechard.AddToWorld();

                if (SAVE_INTO_DATABASE)
                    Bechard.SaveIntoDatabase();
            }
            else
                Bechard = npcs[0];
            // end npc

            npcs = WorldMgr.GetNPCsByName("Silcharde", eRealm.None);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Silcharde , creating it ...");
                Silcharde = new GameNPC();
                Silcharde.Model = 606;
                Silcharde.Name = "Silcharde";
                Silcharde.GuildName = "";
                Silcharde.Realm = eRealm.None;
                Silcharde.CurrentRegionID = 1;
                Silcharde.Size = 50;
                Silcharde.Level = 63;
                Silcharde.X = 306252;
                Silcharde.Y = 670274;
                Silcharde.Z = 2857;
                Silcharde.Heading = 3299;
                Silcharde.AddToWorld();

                if (SAVE_INTO_DATABASE)
                    Silcharde.SaveIntoDatabase();

            }
            else
                Silcharde = npcs[0];
            // end npc

            #endregion

            #region Item Declarations

            sealed_pouch = GameServer.Database.FindObjectByKey<ItemTemplate>("sealed_pouch");
            if (sealed_pouch == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Sealed Pouch , creating it ...");
                sealed_pouch = new ItemTemplate();
                sealed_pouch.Id_nb = "sealed_pouch";
                sealed_pouch.Name = "Sealed Pouch";
                sealed_pouch.Level = 8;
                sealed_pouch.Item_Type = 29;
                sealed_pouch.Model = 488;
                sealed_pouch.IsDropable = false;
                sealed_pouch.IsPickable = false;
                sealed_pouch.DPS_AF = 0;
                sealed_pouch.SPD_ABS = 0;
                sealed_pouch.Object_Type = 41;
                sealed_pouch.Hand = 0;
                sealed_pouch.Type_Damage = 0;
                sealed_pouch.Quality = 100;
                sealed_pouch.Weight = 12;

                    GameServer.Database.AddObject(sealed_pouch);
            }
            // end item

            ItemTemplate item = null;

            WizardEpicBoots = GameServer.Database.FindObjectByKey<ItemTemplate>("WizardEpicBoots");
            if (WizardEpicBoots == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Wizards Epic Boots , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "WizardEpicBoots";
                item.Name = "Bernor's Numinous Boots";
                item.Level = 50;
                item.Item_Type = 23;
                item.Model = 143;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 50;
                item.SPD_ABS = 0;
                item.Object_Type = 32;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 4;
                item.Bonus1Type = (int) eProperty.Skill_Cold;

                item.Bonus2 = 22;
                item.Bonus2Type = (int) eStat.DEX;

                item.Bonus3 = 8;
                item.Bonus3Type = (int) eResist.Body;

                item.Bonus4 = 8;
                item.Bonus4Type = (int) eResist.Energy;

                    GameServer.Database.AddObject(item);

                WizardEpicBoots = item;
            }
            //end item
            //Bernor's Numinous Coif
            WizardEpicHelm = GameServer.Database.FindObjectByKey<ItemTemplate>("WizardEpicHelm");
            if (WizardEpicHelm == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Wizards Epic Helm , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "WizardEpicHelm";
                item.Name = "Bernor's Numinous Cap";
                item.Level = 50;
                item.Item_Type = 21;
                item.Model = 1290; //NEED TO WORK ON..
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 50;
                item.SPD_ABS = 0;
                item.Object_Type = 32;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 13;
                item.Bonus1Type = (int) eStat.DEX;

                item.Bonus2 = 21;
                item.Bonus2Type = (int) eStat.INT;

                item.Bonus3 = 8;
                item.Bonus3Type = (int) eResist.Thrust;

                item.Bonus4 = 8;
                item.Bonus4Type = (int) eResist.Spirit;

                    GameServer.Database.AddObject(item);

                WizardEpicHelm = item;
            }
            //end item
            //Bernor's Numinous Gloves
            WizardEpicGloves = GameServer.Database.FindObjectByKey<ItemTemplate>("WizardEpicGloves");
            if (WizardEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Wizards Epic Gloves , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "WizardEpicGloves";
                item.Name = "Bernor's Numinous Gloves ";
                item.Level = 50;
                item.Item_Type = 22;
                item.Model = 142;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 50;
                item.SPD_ABS = 0;
                item.Object_Type = 32;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 16;
                item.Bonus1Type = (int) eStat.DEX;

                item.Bonus2 = 18;
                item.Bonus2Type = (int) eStat.INT;

                item.Bonus3 = 8;
                item.Bonus3Type = (int) eResist.Matter;

                item.Bonus4 = 8;
                item.Bonus4Type = (int) eResist.Heat;

                    GameServer.Database.AddObject(item);

                WizardEpicGloves = item;
            }

            //Bernor's Numinous Hauberk
            WizardEpicVest = GameServer.Database.FindObjectByKey<ItemTemplate>("WizardEpicVest");
            if (WizardEpicVest == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Wizards Epic Vest , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "WizardEpicVest";
                item.Name = "Bernor's Numinous Robes";
                item.Level = 50;
                item.Item_Type = 25;
                item.Model = 798;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 50;
                item.SPD_ABS = 0;
                item.Object_Type = 32;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 4;
                item.Bonus1Type = (int) eResist.Cold;

                item.Bonus2 = 14;
                item.Bonus2Type = (int) eProperty.PowerRegenerationRate;

                item.Bonus3 = 24;
                item.Bonus3Type = (int) eProperty.MaxHealth;

                    GameServer.Database.AddObject(item);

                WizardEpicVest = item;

            }
            //Bernor's Numinous Legs
            WizardEpicLegs = GameServer.Database.FindObjectByKey<ItemTemplate>("WizardEpicLegs");
            if (WizardEpicLegs == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Wizards Epic Legs , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "WizardEpicLegs";
                item.Name = "Bernor's Numinous Pants";
                item.Level = 50;
                item.Item_Type = 27;
                item.Model = 140;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 50;
                item.SPD_ABS = 0;
                item.Object_Type = 32;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 4;
                item.Bonus1Type = (int) eProperty.Skill_Fire;

                item.Bonus2 = 8;
                item.Bonus2Type = (int) eResist.Cold;

                item.Bonus3 = 8;
                item.Bonus3Type = (int) eResist.Energy;

                    GameServer.Database.AddObject(item);

                WizardEpicLegs = item;

            }
            //Bernor's Numinous Sleeves
            WizardEpicArms = GameServer.Database.FindObjectByKey<ItemTemplate>("WizardEpicArms");
            if (WizardEpicArms == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Wizard Epic Arms , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "WizardEpicArms";
                item.Name = "Bernor's Numinous Sleeves";
                item.Level = 50;
                item.Item_Type = 28;
                item.Model = 141;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 50;
                item.SPD_ABS = 0;
                item.Object_Type = 32;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 4;
                item.Bonus1Type = (int) eProperty.Skill_Earth;

                item.Bonus2 = 18;
                item.Bonus2Type = (int) eStat.DEX;

                item.Bonus3 = 16;
                item.Bonus3Type = (int) eStat.INT;

                    GameServer.Database.AddObject(item);

                WizardEpicArms = item;

            }
            //Minstrel Epic Sleeves End
            MinstrelEpicBoots = GameServer.Database.FindObjectByKey<ItemTemplate>("MinstrelEpicBoots");
            if (MinstrelEpicBoots == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Minstrels Epic Boots , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "MinstrelEpicBoots";
                item.Name = "Boots of Coruscating Harmony";
                item.Level = 50;
                item.Item_Type = 23;
                item.Model = 727;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 100;
                item.SPD_ABS = 27;
                item.Object_Type = 35;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 7;
                item.Bonus1Type = (int) eStat.DEX;

                item.Bonus2 = 27;
                item.Bonus2Type = (int) eStat.QUI;

                item.Bonus3 = 8;
                item.Bonus3Type = (int) eResist.Slash;

                item.Bonus4 = 8;
                item.Bonus4Type = (int) eResist.Cold;

                    GameServer.Database.AddObject(item);

                MinstrelEpicBoots = item;

            }
            //end item
            //of Coruscating Harmony  Coif
            MinstrelEpicHelm = GameServer.Database.FindObjectByKey<ItemTemplate>("MinstrelEpicHelm");
            if (MinstrelEpicHelm == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Minstrels Epic Helm , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "MinstrelEpicHelm";
                item.Name = "Coif of Coruscating Harmony";
                item.Level = 50;
                item.Item_Type = 21;
                item.Model = 1290; //NEED TO WORK ON..
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 100;
                item.SPD_ABS = 27;
                item.Object_Type = 35;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 16;
                item.Bonus1Type = (int) eStat.CON;

                item.Bonus2 = 18;
                item.Bonus2Type = (int) eStat.CHR;

                item.Bonus3 = 8;
                item.Bonus3Type = (int) eResist.Thrust;

                item.Bonus4 = 8;
                item.Bonus4Type = (int) eResist.Energy;

                    GameServer.Database.AddObject(item);

                MinstrelEpicHelm = item;

            }
            //end item
            //of Coruscating Harmony  Gloves
            MinstrelEpicGloves = GameServer.Database.FindObjectByKey<ItemTemplate>("MinstrelEpicGloves");
            if (MinstrelEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Minstrels Epic Gloves , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "MinstrelEpicGloves";
                item.Name = "Gauntlets of Coruscating Harmony";
                item.Level = 50;
                item.Item_Type = 22;
                item.Model = 726;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 100;
                item.SPD_ABS = 27;
                item.Object_Type = 35;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 15;
                item.Bonus1Type = (int) eStat.CON;

                item.Bonus2 = 19;
                item.Bonus2Type = (int) eStat.DEX;

                item.Bonus3 = 8;
                item.Bonus3Type = (int) eResist.Crush;

                item.Bonus4 = 8;
                item.Bonus4Type = (int) eResist.Heat;

                    GameServer.Database.AddObject(item);

                MinstrelEpicGloves = item;

            }
            //of Coruscating Harmony  Hauberk
            MinstrelEpicVest = GameServer.Database.FindObjectByKey<ItemTemplate>("MinstrelEpicVest");
            if (MinstrelEpicVest == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Minstrels Epic Vest , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "MinstrelEpicVest";
                item.Name = "Habergeon of Coruscating Harmony";
                item.Level = 50;
                item.Item_Type = 25;
                item.Model = 723;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 100;
                item.SPD_ABS = 27;
                item.Object_Type = 35;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 6;
                item.Bonus1Type = (int) eResist.Cold;

                item.Bonus2 = 8;
                item.Bonus2Type = (int) eProperty.PowerRegenerationRate;

                item.Bonus3 = 39;
                item.Bonus3Type = (int) eProperty.MaxHealth;

                item.Bonus4 = 6;
                item.Bonus4Type = (int) eResist.Energy;

                    GameServer.Database.AddObject(item);

                MinstrelEpicVest = item;

            }
            //of Coruscating Harmony  Legs
            MinstrelEpicLegs = GameServer.Database.FindObjectByKey<ItemTemplate>("MinstrelEpicLegs");
            if (MinstrelEpicLegs == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Minstrels Epic Legs , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "MinstrelEpicLegs";
                item.Name = "Chaussess of Coruscating Harmony";
                item.Level = 50;
                item.Item_Type = 27;
                item.Model = 724;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 100;
                item.SPD_ABS = 27;
                item.Object_Type = 35;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 15;
                item.Bonus1Type = (int) eStat.STR;

                item.Bonus2 = 19;
                item.Bonus2Type = (int) eStat.CON;

                item.Bonus3 = 8;
                item.Bonus3Type = (int) eResist.Body;

                item.Bonus4 = 8;
                item.Bonus4Type = (int) eResist.Heat;

                    GameServer.Database.AddObject(item);

                MinstrelEpicLegs = item;

            }
            //of Coruscating Harmony  Sleeves
            MinstrelEpicArms = GameServer.Database.FindObjectByKey<ItemTemplate>("MinstrelEpicArms");
            if (MinstrelEpicArms == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Minstrel Epic Arms , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "MinstrelEpicArms";
                item.Name = "Sleeves of Coruscating Harmony";
                item.Level = 50;
                item.Item_Type = 28;
                item.Model = 725;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 100;
                item.SPD_ABS = 27;
                item.Object_Type = 35;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 16;
                item.Bonus1Type = (int) eStat.STR;

                item.Bonus2 = 21;
                item.Bonus2Type = (int) eStat.DEX;

                item.Bonus3 = 8;
                item.Bonus3Type = (int) eResist.Crush;

                item.Bonus4 = 8;
                item.Bonus4Type = (int) eResist.Body;

                    GameServer.Database.AddObject(item);

                MinstrelEpicArms = item;
            }

            SorcerorEpicBoots = GameServer.Database.FindObjectByKey<ItemTemplate>("SorcerorEpicBoots");
            if (SorcerorEpicBoots == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Sorceror Epic Boots , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "SorcerorEpicBoots";
                item.Name = "Boots of Mental Acuity";
                item.Level = 50;
                item.Item_Type = 23;
                item.Model = 143;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 50;
                item.SPD_ABS = 0;
                item.Object_Type = 32;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 4;
                item.Bonus1Type = (int) eProperty.Focus_Matter;

                item.Bonus2 = 22;
                item.Bonus2Type = (int) eStat.DEX;

                item.Bonus3 = 8;
                item.Bonus3Type = (int) eResist.Matter;

                item.Bonus4 = 8;
                item.Bonus4Type = (int) eResist.Energy;

                    GameServer.Database.AddObject(item);

                SorcerorEpicBoots = item;

            }
            //end item
            //of Mental Acuity Coif
            SorcerorEpicHelm = GameServer.Database.FindObjectByKey<ItemTemplate>("SorcerorEpicHelm");
            if (SorcerorEpicHelm == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Sorceror Epic Helm , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "SorcerorEpicHelm";
                item.Name = "Cap of Mental Acuity";
                item.Level = 50;
                item.Item_Type = 21;
                item.Model = 1290; //NEED TO WORK ON..
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 50;
                item.SPD_ABS = 0;
                item.Object_Type = 32;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 13;
                item.Bonus1Type = (int) eStat.DEX;

                item.Bonus2 = 21;
                item.Bonus2Type = (int) eStat.INT;

                item.Bonus3 = 8;
                item.Bonus3Type = (int) eResist.Slash;

                item.Bonus4 = 8;
                item.Bonus4Type = (int) eResist.Thrust;

                    GameServer.Database.AddObject(item);

                SorcerorEpicHelm = item;

            }
            //end item
            //of Mental Acuity Gloves
            SorcerorEpicGloves = GameServer.Database.FindObjectByKey<ItemTemplate>("SorcerorEpicGloves");
            if (SorcerorEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Sorceror Epic Gloves , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "SorcerorEpicGloves";
                item.Name = "Gloves of Mental Acuity";
                item.Level = 50;
                item.Item_Type = 22;
                item.Model = 142;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 50;
                item.SPD_ABS = 0;
                item.Object_Type = 32;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 16;
                item.Bonus1Type = (int) eStat.DEX;

                item.Bonus2 = 18;
                item.Bonus2Type = (int) eStat.INT;

                item.Bonus3 = 8;
                item.Bonus3Type = (int) eResist.Cold;

                item.Bonus4 = 8;
                item.Bonus4Type = (int) eResist.Heat;

                    GameServer.Database.AddObject(item);

                SorcerorEpicGloves = item;

            }
            //of Mental Acuity Hauberk
            SorcerorEpicVest = GameServer.Database.FindObjectByKey<ItemTemplate>("SorcerorEpicVest");
            if (SorcerorEpicVest == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Sorceror Epic Vest , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "SorcerorEpicVest";
                item.Name = "Vest of Mental Acuity";
                item.Level = 50;
                item.Item_Type = 25;
                item.Model = 804;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 50;
                item.SPD_ABS = 0;
                item.Object_Type = 32;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 4;
                item.Bonus1Type = (int) eResist.Spirit;

                item.Bonus2 = 14;
                item.Bonus2Type = (int) eProperty.PowerRegenerationRate;

                item.Bonus3 = 24;
                item.Bonus3Type = (int) eProperty.MaxHealth;

                    GameServer.Database.AddObject(item);

                SorcerorEpicVest = item;

            }
            //of Mental Acuity Legs
            SorcerorEpicLegs = GameServer.Database.FindObjectByKey<ItemTemplate>("SorcerorEpicLegs");
            if (SorcerorEpicLegs == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Sorceror Epic Legs , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "SorcerorEpicLegs";
                item.Name = "Pants of Mental Acuity";
                item.Level = 50;
                item.Item_Type = 27;
                item.Model = 140;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 50;
                item.SPD_ABS = 0;
                item.Object_Type = 32;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 4;
                item.Bonus1Type = (int) eProperty.Focus_Mind;

                item.Bonus2 = 19;
                item.Bonus2Type = (int) eStat.CON;

                item.Bonus3 = 8;
                item.Bonus3Type = (int) eResist.Body;

                item.Bonus4 = 8;
                item.Bonus4Type = (int) eResist.Spirit;

                    GameServer.Database.AddObject(item);

                SorcerorEpicLegs = item;

            }
            //of Mental Acuity Sleeves
            SorcerorEpicArms = GameServer.Database.FindObjectByKey<ItemTemplate>("SorcerorEpicArms");
            if (SorcerorEpicArms == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Sorceror Epic Arms , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "SorcerorEpicArms";
                item.Name = "Sleeves of Mental Acuity";
                item.Level = 50;
                item.Item_Type = 28;
                item.Model = 141;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 50;
                item.SPD_ABS = 0;
                item.Object_Type = 32;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 4;
                item.Bonus1Type = (int) eProperty.Focus_Body;

                item.Bonus2 = 16;
                item.Bonus2Type = (int) eStat.DEX;

                item.Bonus3 = 18;
                item.Bonus3Type = (int) eStat.INT;

                    GameServer.Database.AddObject(item);

                SorcerorEpicArms = item;
            }
            //Item Descriptions End

            #endregion

            morganaArea = WorldMgr.GetRegion(Morgana.CurrentRegionID).AddArea(new Area.Circle(null, Morgana.X, Morgana.Y, 0, 1000));
            morganaArea.RegisterPlayerEnter(new DOLEventHandler(PlayerEnterMorganaArea));

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            GameEventMgr.AddHandler(Ferowl, GameObjectEvent.Interact, new DOLEventHandler(TalkToFerowl));
            GameEventMgr.AddHandler(Ferowl, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToFerowl));

            /* Now we bring to Ferowl the possibility to give this quest to players */
            Ferowl.AddQuestToGive(typeof (Academy_50));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }