Esempio n. 1
0
        public static void setPvPZone(string set)
        {
            GameNPC last = null;

            GameNPC[] search = WorldMgr.GetNPCsByName(m_PvPZone, eRealm.None);
            foreach (GameNPC searching in search)
            {
                if (searching.GuildName == "PvP Setup")
                {
                    last = searching;
                }
            }
            if (last != null)
            {
                lastRegionID = last.CurrentRegionID;
            }
            m_PvPZone = set;
            foreach (GameClient client in WorldMgr.GetAllPlayingClients())
            {
                bool ok = lastRegionID == 69 ? false : true;
                if (client.Player.CurrentRegionID == lastRegionID && ok)
                {
                    PortToPvPZone(client.Player);
                }
                client.Player.Out.SendMessage("The PvP Zone has changed to " + m_PvPZone + "!", eChatType.CT_Important, eChatLoc.CL_ChatWindow);
            }
        }
Esempio n. 2
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.GetNPCsByName("Sir Dorian", eRealm.Albion);
            if (npcs == null || npcs.Length == 0)
            {
                return;
            }

            sirDorian = npcs[0];

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

            GameEventMgr.AddHandler(sirDorian, GameLivingEvent.Interact, new DOLEventHandler(TalkToSirDorian));
            GameEventMgr.AddHandler(sirDorian, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToSirDorian));

            sirDorian.AddQuestToGive(typeof(NoHopeForTheHopeful));

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Esempio n. 3
0
        public static GameNPC GetAddrir()
        {
            GameNPC[] npcs = WorldMgr.GetNPCsByName("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);
        }
Esempio n. 4
0
        public override bool WhisperReceive(GameLiving source, string str)
        {
            if (!base.WhisperReceive(source, str))
            {
                return(false);
            }
            if (!(source is GamePlayer))
            {
                return(false);
            }
            GamePlayer player = (GamePlayer)source;

            TurnTo(player.X, player.Y);
            ClearChat(player);
            if (player.InCombat)
            {
                return(false);
            }
            List <GameNPC> npcs = WorldMgr.GetNPCsByGuild(str, eRealm.None);

            if (npcs.Count != 0)
            {
                foreach (GameNPC portto in npcs)
                {
                    msg += "[" + portto.Name + "]\n";
                }
                SayTo(player, msg);
            }
            else
            {
                GameNPC[] npctoportto = WorldMgr.GetNPCsByName(str, eRealm.None);
                GameNPC   portnow     = null;
                foreach (GameNPC np in npctoportto)
                {
                    if (np.GuildName == this.GuildName)
                    {
                        portnow = np;
                    }
                }
                if (portnow != null)
                {
                    if (player.Group != null)
                    {
                        foreach (GamePlayer grupee in player.Group.GetPlayersInTheGroup())
                        {
                            grupee.Out.SendMessage(player.Name + " has ported to " + portnow.Name, eChatType.CT_Group, eChatLoc.CL_ChatWindow);
                        }
                    }
                    player.MoveTo(portnow.CurrentRegionID, portnow.X, portnow.Y, portnow.Z, portnow.Heading);
                    npcs = null;
                    return(true);
                }
            }
            msg = "";


            return(true);
        }
Esempio n. 5
0
 public bool CheckIfStrIsAMob(string text)
 {
     GameNPC[] npcs = WorldMgr.GetNPCsByName(text, eRealm.None);
     if (npcs.Length > 0 && npcs != null)
     {
         GameNPC theNPC = npcs[0];
         if (theNPC != null)
         {
             if (theNPC.GuildName == "PvP Setup")
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Esempio n. 6
0
 public static GameNPC currentPvPPort()
 {
     GameNPC[] npcs = WorldMgr.GetNPCsByName(m_PvPZone, eRealm.None);
     if (npcs.Length > 0 && npcs != null)
     {
         GameNPC theNPC = npcs[0];
         if (theNPC != null)
         {
             if (theNPC.GuildName == "PvP Setup")
             {
                 return(theNPC);
             }
         }
     }
     return(null);
 }
Esempio n. 7
0
        /// <summary>
        /// Searches for a GameLiving with the given id or name either in worldMgr or Database if lookukDB is true
        /// </summary>
        /// <param name="identifier"></param>
        /// <param name="defaultLiving"></param>
        /// <param name="lookupDB"></param>
        /// <returns></returns>
        public static GameLiving ResolveLiving(object identifier, GameLiving defaultLiving, bool lookupDB)
        {
            GameLiving living = null;

            if (identifier is string || identifier is int)
            {
                string tempID = Convert.ToString(identifier);

                // TODO: Dirty Hack this should be done better
                Mob mob = GameServer.Database.SelectObject <Mob>("MobID='" + GameServer.Database.Escape(tempID) + "' OR Name='" + GameServer.Database.Escape(tempID) + "'");

                GameNPC[] livings = WorldMgr.GetNPCsByName(mob.Name, (eRealm)mob.Realm);

                if (livings.Length == 1)
                {
                    living = livings[0];
                }
                else if (livings.Length > 1)
                {
                    if (log.IsWarnEnabled)
                    {
                        log.Warn("Found more than one living with name :" + tempID + " in " + (lookupDB ? "Database" : "WorldMgr"));
                    }
                }
                else
                {
                    if (log.IsWarnEnabled)
                    {
                        log.Warn("Couldn't find GameLiving with id or name:" + tempID + " in " + (lookupDB ? "Database" : "WorldMgr"));
                    }
                }
            }
            else if (identifier is GameLiving)
            {
                living = (GameLiving)identifier;
            }

            // use default otherwise
            if (living == null)
            {
                living = defaultLiving;
            }

            return(living);
        }
Esempio n. 8
0
        /// <summary>
        /// Searches for a NPC with the given id or name either in worldMgr or Database if lookukDB is true
        /// </summary>
        /// <param name="identifier"></param>
        /// <param name="defaultNPC"></param>
        /// <param name="lookupDB"></param>
        /// <returns></returns>
        public static GameNPC ResolveNPC(object identifier, GameNPC defaultNPC, bool lookupDB)
        {
            GameNPC npc = null;

            if (identifier is string || identifier is int)
            {
                string tempID = Convert.ToString(identifier);

                Mob mob = GameServer.Database.SelectObject <Mob>("MobID='" + GameServer.Database.Escape(tempID) + "' OR Name='" + GameServer.Database.Escape(tempID) + "'");

                GameNPC[] npcs = WorldMgr.GetNPCsByName(mob.Name, (eRealm)mob.Realm);

                if (npcs.Length == 1)
                {
                    npc = npcs[0];
                }
                else if (npcs.Length > 1)
                {
                    if (log.IsWarnEnabled)
                    {
                        log.Warn("Found more than one npc with id or name:" + tempID + " in WorldMgr");
                    }
                }
                else
                {
                    if (log.IsWarnEnabled)
                    {
                        log.Warn("Couldn't find NPC with id or name:" + tempID + " in WorldMgr");
                    }
                }
            }
            else if (identifier is GameNPC)
            {
                npc = (GameNPC)identifier;
            }

            // use default otherwise
            if (npc == null)
            {
                npc = defaultNPC;
            }

            return(npc);
        }
Esempio n. 9
0
        /// <summary>
        /// Searches for a NPC with the given id or name either in worldMgr or Database if lookukDB is true
        /// </summary>
        /// <param name="identifier"></param>
        /// <param name="defaultNPC"></param>
        /// <param name="lookupDB"></param>
        /// <returns></returns>
        public static GameNPC ResolveNPC(object identifier, GameNPC defaultNPC, bool lookupDB)
        {
            GameNPC npc = null;

            if (identifier is string || identifier is int)
            {
                string tempID = Convert.ToString(identifier);

                Mob mob = GameServer.Database.SelectObjects <Mob>("`Mob_ID` = @MobID OR `Name` = @Name", new[] { new QueryParameter("@MobID", tempID), new QueryParameter("@Name", tempID) }).FirstOrDefault();

                GameNPC[] npcs = WorldMgr.GetNPCsByName(mob.Name, (eRealm)mob.Realm);

                if (npcs.Length == 1)
                {
                    npc = npcs[0];
                }
                else if (npcs.Length > 1)
                {
                    if (log.IsWarnEnabled)
                    {
                        log.Warn("Found more than one npc with id or name:" + tempID + " in WorldMgr");
                    }
                }
                else
                {
                    if (log.IsWarnEnabled)
                    {
                        log.Warn("Couldn't find NPC with id or name:" + tempID + " in WorldMgr");
                    }
                }
            }
            else if (identifier is GameNPC)
            {
                npc = (GameNPC)identifier;
            }

            // use default otherwise
            if (npc == null)
            {
                npc = defaultNPC;
            }

            return(npc);
        }
Esempio n. 10
0
        /// <summary>
        /// Searches for a NPC with the given id or name either in worldMgr or Database if lookukDB is true
        /// </summary>
        /// <param name="identifier"></param>
        /// <param name="defaultNPC"></param>
        /// <param name="lookupDB"></param>
        /// <returns></returns>
        public static GameNPC ResolveNPC(object identifier, GameNPC defaultNPC, bool lookupDB)
        {
            GameNPC npc = null;

            if (identifier is string || identifier is int)
            {
                string tempID = Convert.ToString(identifier);

                var mob = DOLDB <Mob> .SelectObject(DB.Column("Mob_ID").IsEqualTo(tempID).Or(DB.Column("Name").IsEqualTo(tempID)));

                GameNPC[] npcs = WorldMgr.GetNPCsByName(mob.Name, (eRealm)mob.Realm);

                if (npcs.Length == 1)
                {
                    npc = npcs[0];
                }
                else if (npcs.Length > 1)
                {
                    if (log.IsWarnEnabled)
                    {
                        log.Warn("Found more than one npc with id or name:" + tempID + " in WorldMgr");
                    }
                }
                else
                {
                    if (log.IsWarnEnabled)
                    {
                        log.Warn("Couldn't find NPC with id or name:" + tempID + " in WorldMgr");
                    }
                }
            }
            else if (identifier is GameNPC)
            {
                npc = (GameNPC)identifier;
            }

            // use default otherwise
            if (npc == null)
            {
                npc = defaultNPC;
            }

            return(npc);
        }
Esempio n. 11
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("Kealan", 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)
            {
                kealan       = new GameNPC();
                kealan.Model = 281;
                kealan.Name  = "Kealan";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + kealan.Name + ", creating him ...");
                }

                kealan.GuildName       = "Part of " + questTitle + " Quest";
                kealan.Realm           = eRealm.Albion;
                kealan.CurrentRegionID = 1;
                kealan.Size            = 48;
                kealan.Level           = 32;
                kealan.X       = 493414;
                kealan.Y       = 593089;
                kealan.Z       = 1797;
                kealan.Heading = 830;

                kealan.EquipmentTemplateID = "11704675";

                //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)
                {
                    kealan.SaveIntoDatabase();
                }


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

            npcs = WorldMgr.GetNPCsByName("Arachneida", eRealm.None);
            if (npcs.Length == 0)
            {
                arachneida       = new GameNPC();
                arachneida.Model = 72;
                arachneida.Name  = "Arachneida";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + arachneida.Name + ", creating her ...");
                }

                arachneida.GuildName       = "Part of " + questTitle + " Quest";
                arachneida.Realm           = eRealm.None;
                arachneida.CurrentRegionID = 1;
                arachneida.Size            = 90;
                arachneida.Level           = 12;
                arachneida.X       = 534851;
                arachneida.Y       = 609656;
                arachneida.Z       = 2456;
                arachneida.Heading = 2080;

                arachneida.EquipmentTemplateID = "2";

                //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)
                {
                    arachneida.SaveIntoDatabase();
                }

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

            #endregion

            #region defineItems

            spiderSilkenRobe = GameServer.Database.FindObjectByKey <ItemTemplate>("spider_silken_robe");
            if (spiderSilkenRobe == null)
            {
                spiderSilkenRobe      = new ItemTemplate();
                spiderSilkenRobe.Name = "Spider Silken Robe";

                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + spiderSilkenRobe.Name + ", creating it ...");
                }
                spiderSilkenRobe.Level  = 20;
                spiderSilkenRobe.Weight = 5;
                spiderSilkenRobe.Model  = 58;

                spiderSilkenRobe.Bonus      = 5;
                spiderSilkenRobe.Bonus1     = 3;
                spiderSilkenRobe.Bonus1Type = (int)eStat.DEX;
                ;

                spiderSilkenRobe.Bonus2     = 3;
                spiderSilkenRobe.Bonus2Type = (int)eStat.INT;

                spiderSilkenRobe.Bonus3     = 6;
                spiderSilkenRobe.Bonus3Type = (int)eProperty.MaxHealth;

                spiderSilkenRobe.DPS_AF  = 18;
                spiderSilkenRobe.SPD_ABS = 0;

                spiderSilkenRobe.Object_Type = (int)eObjectType.Cloth;
                spiderSilkenRobe.Item_Type   = (int)eEquipmentItems.TORSO;
                spiderSilkenRobe.Id_nb       = "spider_silken_robe";
                spiderSilkenRobe.Price       = Money.GetMoney(0, 0, 0, 8, 3);
                spiderSilkenRobe.IsPickable  = true;
                spiderSilkenRobe.IsDropable  = true;
                //spiderSilkenRobe.Color = 44;
                spiderSilkenRobe.Quality       = 100;
                spiderSilkenRobe.Condition     = 1000;
                spiderSilkenRobe.MaxCondition  = 1000;
                spiderSilkenRobe.Durability    = 1000;
                spiderSilkenRobe.MaxDurability = 1000;


                //You don't have to store the created wolfPeltCloak 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(spiderSilkenRobe);
            }

            ringedSpiderChitinTunic = GameServer.Database.FindObjectByKey <ItemTemplate>("ringed_spider_chitin_tunic");
            if (ringedSpiderChitinTunic == null)
            {
                ringedSpiderChitinTunic      = new ItemTemplate();
                ringedSpiderChitinTunic.Name = "Ringed Spider Chitin Tunic";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + ringedSpiderChitinTunic.Name + ", creating it ...");
                }

                ringedSpiderChitinTunic.Level  = 17;
                ringedSpiderChitinTunic.Weight = 80;
                ringedSpiderChitinTunic.Model  = 41;

                ringedSpiderChitinTunic.Bonus      = 5;
                ringedSpiderChitinTunic.Bonus1     = 4;
                ringedSpiderChitinTunic.Bonus1Type = (int)eStat.STR;

                ringedSpiderChitinTunic.Bonus2     = 3;
                ringedSpiderChitinTunic.Bonus2Type = (int)eStat.QUI;

                ringedSpiderChitinTunic.Bonus3     = 9;
                ringedSpiderChitinTunic.Bonus3Type = (int)eProperty.MaxHealth;

                ringedSpiderChitinTunic.DPS_AF  = 28;
                ringedSpiderChitinTunic.SPD_ABS = 27;

                ringedSpiderChitinTunic.Object_Type = (int)eObjectType.Chain;
                ringedSpiderChitinTunic.Item_Type   = (int)eEquipmentItems.TORSO;
                ringedSpiderChitinTunic.Id_nb       = "ringed_spider_chitin_tunic";
                ringedSpiderChitinTunic.Price       = Money.GetMoney(0, 0, 0, 9, 3);
                ringedSpiderChitinTunic.IsPickable  = true;
                ringedSpiderChitinTunic.IsDropable  = true;

                ringedSpiderChitinTunic.Color         = 45;
                ringedSpiderChitinTunic.Quality       = 100;
                ringedSpiderChitinTunic.Condition     = 1000;
                ringedSpiderChitinTunic.MaxCondition  = 1000;
                ringedSpiderChitinTunic.Durability    = 1000;
                ringedSpiderChitinTunic.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(ringedSpiderChitinTunic);
            }

            studdedSpiderEyeVest = GameServer.Database.FindObjectByKey <ItemTemplate>("studded_spider_eye_vest");
            if (studdedSpiderEyeVest == null)
            {
                studdedSpiderEyeVest      = new ItemTemplate();
                studdedSpiderEyeVest.Name = "Studded Spider Eye Vest";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + studdedSpiderEyeVest.Name + ", creating it ...");
                }

                studdedSpiderEyeVest.Level  = 17;
                studdedSpiderEyeVest.Weight = 60;
                studdedSpiderEyeVest.Model  = 51;

                studdedSpiderEyeVest.Bonus      = 5;
                studdedSpiderEyeVest.Bonus1     = 3;
                studdedSpiderEyeVest.Bonus1Type = (int)eStat.QUI;

                studdedSpiderEyeVest.Bonus2     = 2;
                studdedSpiderEyeVest.Bonus2Type = (int)eStat.PIE;

                studdedSpiderEyeVest.Bonus3     = 9;
                studdedSpiderEyeVest.Bonus3Type = (int)eProperty.MaxHealth;

                studdedSpiderEyeVest.DPS_AF  = 28;
                studdedSpiderEyeVest.SPD_ABS = 19;

                studdedSpiderEyeVest.Object_Type = (int)eObjectType.Studded;
                studdedSpiderEyeVest.Item_Type   = (int)eEquipmentItems.TORSO;
                studdedSpiderEyeVest.Id_nb       = "studded_spider_eye_vest";
                studdedSpiderEyeVest.Price       = Money.GetMoney(0, 0, 0, 9, 3);
                studdedSpiderEyeVest.IsPickable  = true;
                studdedSpiderEyeVest.IsDropable  = true;

                studdedSpiderEyeVest.Color         = 45;
                studdedSpiderEyeVest.Quality       = 100;
                studdedSpiderEyeVest.Condition     = 1000;
                studdedSpiderEyeVest.MaxCondition  = 1000;
                studdedSpiderEyeVest.Durability    = 1000;
                studdedSpiderEyeVest.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(studdedSpiderEyeVest);
            }

            spiderEmblazonedTunic = GameServer.Database.FindObjectByKey <ItemTemplate>("spider_emblazoned_tunic");
            if (spiderEmblazonedTunic == null)
            {
                spiderEmblazonedTunic      = new ItemTemplate();
                spiderEmblazonedTunic.Name = "Spider Emblazoned Tunic";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + spiderEmblazonedTunic.Name + ", creating it ...");
                }
                spiderEmblazonedTunic.Level  = 17;
                spiderEmblazonedTunic.Weight = 40;
                spiderEmblazonedTunic.Model  = 31;

                spiderEmblazonedTunic.Bonus      = 5;
                spiderEmblazonedTunic.Bonus1     = 2;
                spiderEmblazonedTunic.Bonus1Type = (int)eStat.STR;

                spiderEmblazonedTunic.Bonus2     = 3;
                spiderEmblazonedTunic.Bonus2Type = (int)eStat.PIE;

                spiderEmblazonedTunic.Bonus3     = 9;
                spiderEmblazonedTunic.Bonus3Type = (int)eProperty.MaxHealth;

                spiderEmblazonedTunic.DPS_AF  = 28;
                spiderEmblazonedTunic.SPD_ABS = 10;

                spiderEmblazonedTunic.Object_Type = (int)eObjectType.Leather;
                spiderEmblazonedTunic.Item_Type   = (int)eEquipmentItems.TORSO;
                spiderEmblazonedTunic.Id_nb       = "spider_emblazoned_tunic";
                spiderEmblazonedTunic.Price       = Money.GetMoney(0, 0, 0, 9, 3);
                spiderEmblazonedTunic.IsPickable  = true;
                spiderEmblazonedTunic.IsDropable  = true;

                spiderEmblazonedTunic.Color         = 45;
                spiderEmblazonedTunic.Quality       = 100;
                spiderEmblazonedTunic.Condition     = 1000;
                spiderEmblazonedTunic.MaxCondition  = 1000;
                spiderEmblazonedTunic.Durability    = 1000;
                spiderEmblazonedTunic.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(spiderEmblazonedTunic);
            }

            embossedSpiderTunic = GameServer.Database.FindObjectByKey <ItemTemplate>("embossed_spider_tunic");
            if (embossedSpiderTunic == null)
            {
                embossedSpiderTunic      = new ItemTemplate();
                embossedSpiderTunic.Name = "Embossed Spider Tunic";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + embossedSpiderTunic.Name + ", creating it ...");
                }

                embossedSpiderTunic.Level  = 17;
                embossedSpiderTunic.Weight = 40;
                embossedSpiderTunic.Model  = 31;

                embossedSpiderTunic.Bonus      = 5;
                embossedSpiderTunic.Bonus1     = 2;
                embossedSpiderTunic.Bonus1Type = (int)eStat.STR;

                embossedSpiderTunic.Bonus2     = 2;
                embossedSpiderTunic.Bonus2Type = (int)eStat.DEX;

                embossedSpiderTunic.Bonus3     = 12;
                embossedSpiderTunic.Bonus3Type = (int)eProperty.MaxHealth;

                embossedSpiderTunic.DPS_AF  = 28;
                embossedSpiderTunic.SPD_ABS = 10;

                embossedSpiderTunic.Object_Type = (int)eObjectType.Leather;
                embossedSpiderTunic.Item_Type   = (int)eEquipmentItems.TORSO;
                embossedSpiderTunic.Id_nb       = "embossed_spider_tunic";
                embossedSpiderTunic.Price       = Money.GetMoney(0, 0, 0, 9, 3);
                embossedSpiderTunic.IsPickable  = true;
                embossedSpiderTunic.IsDropable  = true;

                embossedSpiderTunic.Color         = 45;
                embossedSpiderTunic.Quality       = 100;
                embossedSpiderTunic.Condition     = 1000;
                embossedSpiderTunic.MaxCondition  = 1000;
                embossedSpiderTunic.Durability    = 1000;
                embossedSpiderTunic.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(embossedSpiderTunic);
            }

            bloatedFang = GameServer.Database.FindObjectByKey <ItemTemplate>("bloated_spider_fang");
            if (bloatedFang == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find  Bloated spider fang, creating it ...");
                }
                bloatedFang             = new ItemTemplate();
                bloatedFang.Object_Type = (int)eObjectType.GenericItem;
                bloatedFang.Weight      = 10;
                bloatedFang.Id_nb       = "bloated_spider_fang";
                bloatedFang.Name        = "Bloated spider fang";
                bloatedFang.Model       = 106;
                bloatedFang.IsDropable  = false;
                bloatedFang.IsPickable  = 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(bloatedFang);
            }

            spiderChitin = GameServer.Database.FindObjectByKey <ItemTemplate>("arachneida_spider_chitin");
            if (spiderChitin == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Arachneida's Chitin, creating it ...");
                }
                spiderChitin             = new ItemTemplate();
                spiderChitin.Object_Type = (int)eObjectType.GenericItem;
                spiderChitin.Weight      = 25;
                spiderChitin.Id_nb       = "arachneida_spider_chitin";
                spiderChitin.Name        = "Arachneida's Chitin";
                spiderChitin.Model       = 108;
                spiderChitin.IsDropable  = false;
                spiderChitin.IsPickable  = 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(spiderChitin);
            }

            #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(GamePlayerEvent.GameEntered, new DOLEventHandler(PlayerEnterWorld));

            GameEventMgr.AddHandler(kealan, GameLivingEvent.Interact, new DOLEventHandler(TalkToKealan));
            GameEventMgr.AddHandler(kealan, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToKealan));

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

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Esempio n. 12
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("Masrim", eRealm.Midgard);

            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Masrim , creating it ...");
                }
                Masrim                 = new GameNPC();
                Masrim.Model           = 177;
                Masrim.Name            = "Masrim";
                Masrim.GuildName       = "";
                Masrim.Realm           = eRealm.Midgard;
                Masrim.CurrentRegionID = 100;
                Masrim.Size            = 52;
                Masrim.Level           = 40;
                Masrim.X               = 749099;
                Masrim.Y               = 813104;
                Masrim.Z               = 4437;
                Masrim.Heading         = 2605;
                Masrim.AddToWorld();
                if (SAVE_INTO_DATABASE)
                {
                    Masrim.SaveIntoDatabase();
                }
            }
            else
            {
                Masrim = npcs[0];
            }
            // end npc

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

            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Oona , creating it ...");
                }
                Oona                 = new GameNPC();
                Oona.Model           = 356;
                Oona.Name            = "Oona";
                Oona.GuildName       = "";
                Oona.Realm           = eRealm.None;
                Oona.CurrentRegionID = 100;
                Oona.Size            = 50;
                Oona.Level           = 65;
                Oona.X               = 607233;
                Oona.Y               = 786850;
                Oona.Z               = 4384;
                Oona.Heading         = 3891;
                Oona.Flags          ^= GameNPC.eFlags.GHOST;
                Oona.AddToWorld();
                if (SAVE_INTO_DATABASE)
                {
                    Oona.SaveIntoDatabase();
                }
            }
            else
            {
                Oona = npcs[0];
            }
            // end npc

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

            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Morlin Caan , creating it ...");
                }
                MorlinCaan                 = new GameNPC();
                MorlinCaan.Model           = 235;
                MorlinCaan.Name            = "Morlin Caan";
                MorlinCaan.GuildName       = "Smith";
                MorlinCaan.Realm           = eRealm.Midgard;
                MorlinCaan.CurrentRegionID = 101;
                MorlinCaan.Size            = 50;
                MorlinCaan.Level           = 54;
                MorlinCaan.X               = 33400;
                MorlinCaan.Y               = 33620;
                MorlinCaan.Z               = 8023;
                MorlinCaan.Heading         = 523;
                MorlinCaan.AddToWorld();
                if (SAVE_INTO_DATABASE)
                {
                    MorlinCaan.SaveIntoDatabase();
                }
            }
            else
            {
                MorlinCaan = npcs[0];
            }
            // end npc

            #endregion

            #region defineItems

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

            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

            HunterEpicBoots = GameServer.Database.FindObjectByKey <ItemTemplate>("HunterEpicBoots");
            if (HunterEpicBoots == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Hunters Epic Boots , creating it ...");
                }
                HunterEpicBoots               = new ItemTemplate();
                HunterEpicBoots.Id_nb         = "HunterEpicBoots";
                HunterEpicBoots.Name          = "Call of the Hunt Boots";
                HunterEpicBoots.Level         = 50;
                HunterEpicBoots.Item_Type     = 23;
                HunterEpicBoots.Model         = 760;
                HunterEpicBoots.IsDropable    = true;
                HunterEpicBoots.IsPickable    = true;
                HunterEpicBoots.DPS_AF        = 100;
                HunterEpicBoots.SPD_ABS       = 19;
                HunterEpicBoots.Object_Type   = 34;
                HunterEpicBoots.Quality       = 100;
                HunterEpicBoots.Weight        = 22;
                HunterEpicBoots.Bonus         = 35;
                HunterEpicBoots.MaxCondition  = 50000;
                HunterEpicBoots.MaxDurability = 50000;
                HunterEpicBoots.Condition     = 50000;
                HunterEpicBoots.Durability    = 50000;

                HunterEpicBoots.Bonus1     = 19;
                HunterEpicBoots.Bonus1Type = (int)eStat.CON;

                HunterEpicBoots.Bonus2     = 19;
                HunterEpicBoots.Bonus2Type = (int)eStat.DEX;

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

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(HunterEpicBoots);
                }
            }
//end item
            //Call of the Hunt Coif
            HunterEpicHelm = GameServer.Database.FindObjectByKey <ItemTemplate>("HunterEpicHelm");
            if (HunterEpicHelm == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Hunters Epic Helm , creating it ...");
                }
                HunterEpicHelm               = new ItemTemplate();
                HunterEpicHelm.Id_nb         = "HunterEpicHelm";
                HunterEpicHelm.Name          = "Call of the Hunt Coif";
                HunterEpicHelm.Level         = 50;
                HunterEpicHelm.Item_Type     = 21;
                HunterEpicHelm.Model         = 829;         //NEED TO WORK ON..
                HunterEpicHelm.IsDropable    = true;
                HunterEpicHelm.IsPickable    = true;
                HunterEpicHelm.DPS_AF        = 100;
                HunterEpicHelm.SPD_ABS       = 19;
                HunterEpicHelm.Object_Type   = 34;
                HunterEpicHelm.Quality       = 100;
                HunterEpicHelm.Weight        = 22;
                HunterEpicHelm.Bonus         = 35;
                HunterEpicHelm.MaxCondition  = 50000;
                HunterEpicHelm.MaxDurability = 50000;
                HunterEpicHelm.Condition     = 50000;
                HunterEpicHelm.Durability    = 50000;

                HunterEpicHelm.Bonus1     = 3;
                HunterEpicHelm.Bonus1Type = (int)eProperty.Skill_Spear;

                HunterEpicHelm.Bonus2     = 3;
                HunterEpicHelm.Bonus2Type = (int)eProperty.Skill_Stealth;

                HunterEpicHelm.Bonus3     = 3;
                HunterEpicHelm.Bonus3Type = (int)eProperty.Skill_Composite;

                HunterEpicHelm.Bonus4     = 19;
                HunterEpicHelm.Bonus4Type = (int)eStat.DEX;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(HunterEpicHelm);
                }
            }
//end item
            //Call of the Hunt Gloves
            HunterEpicGloves = GameServer.Database.FindObjectByKey <ItemTemplate>("HunterEpicGloves");
            if (HunterEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Hunters Epic Gloves , creating it ...");
                }
                HunterEpicGloves               = new ItemTemplate();
                HunterEpicGloves.Id_nb         = "HunterEpicGloves";
                HunterEpicGloves.Name          = "Call of the Hunt Gloves ";
                HunterEpicGloves.Level         = 50;
                HunterEpicGloves.Item_Type     = 22;
                HunterEpicGloves.Model         = 759;
                HunterEpicGloves.IsDropable    = true;
                HunterEpicGloves.IsPickable    = true;
                HunterEpicGloves.DPS_AF        = 100;
                HunterEpicGloves.SPD_ABS       = 19;
                HunterEpicGloves.Object_Type   = 34;
                HunterEpicGloves.Quality       = 100;
                HunterEpicGloves.Weight        = 22;
                HunterEpicGloves.Bonus         = 35;
                HunterEpicGloves.MaxCondition  = 50000;
                HunterEpicGloves.MaxDurability = 50000;
                HunterEpicGloves.Condition     = 50000;
                HunterEpicGloves.Durability    = 50000;

                HunterEpicGloves.Bonus1     = 5;
                HunterEpicGloves.Bonus1Type = (int)eProperty.Skill_Composite;

                HunterEpicGloves.Bonus2     = 15;
                HunterEpicGloves.Bonus2Type = (int)eStat.QUI;

                HunterEpicGloves.Bonus3     = 33;
                HunterEpicGloves.Bonus3Type = (int)eProperty.MaxHealth;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(HunterEpicGloves);
                }
            }
            //Call of the Hunt Hauberk
            HunterEpicVest = GameServer.Database.FindObjectByKey <ItemTemplate>("HunterEpicVest");
            if (HunterEpicVest == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Hunters Epic Vest , creating it ...");
                }
                HunterEpicVest               = new ItemTemplate();
                HunterEpicVest.Id_nb         = "HunterEpicVest";
                HunterEpicVest.Name          = "Call of the Hunt Jerkin";
                HunterEpicVest.Level         = 50;
                HunterEpicVest.Item_Type     = 25;
                HunterEpicVest.Model         = 756;
                HunterEpicVest.IsDropable    = true;
                HunterEpicVest.IsPickable    = true;
                HunterEpicVest.DPS_AF        = 100;
                HunterEpicVest.SPD_ABS       = 19;
                HunterEpicVest.Object_Type   = 34;
                HunterEpicVest.Quality       = 100;
                HunterEpicVest.Weight        = 22;
                HunterEpicVest.Bonus         = 35;
                HunterEpicVest.MaxCondition  = 50000;
                HunterEpicVest.MaxDurability = 50000;
                HunterEpicVest.Condition     = 50000;
                HunterEpicVest.Durability    = 50000;

                HunterEpicVest.Bonus1     = 13;
                HunterEpicVest.Bonus1Type = (int)eStat.STR;

                HunterEpicVest.Bonus2     = 15;
                HunterEpicVest.Bonus2Type = (int)eStat.CON;

                HunterEpicVest.Bonus3     = 13;
                HunterEpicVest.Bonus3Type = (int)eStat.DEX;

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

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(HunterEpicVest);
                }
            }
            //Call of the Hunt Legs
            HunterEpicLegs = GameServer.Database.FindObjectByKey <ItemTemplate>("HunterEpicLegs");
            if (HunterEpicLegs == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Hunters Epic Legs , creating it ...");
                }
                HunterEpicLegs               = new ItemTemplate();
                HunterEpicLegs.Id_nb         = "HunterEpicLegs";
                HunterEpicLegs.Name          = "Call of the Hunt Legs";
                HunterEpicLegs.Level         = 50;
                HunterEpicLegs.Item_Type     = 27;
                HunterEpicLegs.Model         = 757;
                HunterEpicLegs.IsDropable    = true;
                HunterEpicLegs.IsPickable    = true;
                HunterEpicLegs.DPS_AF        = 100;
                HunterEpicLegs.SPD_ABS       = 19;
                HunterEpicLegs.Object_Type   = 34;
                HunterEpicLegs.Quality       = 100;
                HunterEpicLegs.Weight        = 22;
                HunterEpicLegs.Bonus         = 35;
                HunterEpicLegs.MaxCondition  = 50000;
                HunterEpicLegs.MaxDurability = 50000;
                HunterEpicLegs.Condition     = 50000;
                HunterEpicLegs.Durability    = 50000;

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

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

                HunterEpicLegs.Bonus3     = 7;
                HunterEpicLegs.Bonus3Type = (int)eStat.QUI;

                HunterEpicLegs.Bonus4     = 12;
                HunterEpicLegs.Bonus4Type = (int)eResist.Matter;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(HunterEpicLegs);
                }
            }
            //Call of the Hunt Sleeves
            HunterEpicArms = GameServer.Database.FindObjectByKey <ItemTemplate>("HunterEpicArms");
            if (HunterEpicArms == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Hunter Epic Arms , creating it ...");
                }
                HunterEpicArms               = new ItemTemplate();
                HunterEpicArms.Id_nb         = "HunterEpicArms";
                HunterEpicArms.Name          = "Call of the Hunt Sleeves";
                HunterEpicArms.Level         = 50;
                HunterEpicArms.Item_Type     = 28;
                HunterEpicArms.Model         = 758;
                HunterEpicArms.IsDropable    = true;
                HunterEpicArms.IsPickable    = true;
                HunterEpicArms.DPS_AF        = 100;
                HunterEpicArms.SPD_ABS       = 19;
                HunterEpicArms.Object_Type   = 34;
                HunterEpicArms.Quality       = 100;
                HunterEpicArms.Weight        = 22;
                HunterEpicArms.Bonus         = 35;
                HunterEpicArms.MaxCondition  = 50000;
                HunterEpicArms.MaxDurability = 50000;
                HunterEpicArms.Condition     = 50000;
                HunterEpicArms.Durability    = 50000;

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

                HunterEpicArms.Bonus2     = 15;
                HunterEpicArms.Bonus2Type = (int)eStat.QUI;

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

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

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

                ShadowbladeEpicBoots.Bonus1     = 5;
                ShadowbladeEpicBoots.Bonus1Type = (int)eProperty.Skill_Stealth;

                ShadowbladeEpicBoots.Bonus2     = 13;
                ShadowbladeEpicBoots.Bonus2Type = (int)eStat.DEX;

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

                ShadowbladeEpicBoots.Bonus4     = 6;
                ShadowbladeEpicBoots.Bonus4Type = (int)eResist.Heat;

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

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

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

                ShadowbladeEpicHelm.Bonus3     = 10;
                ShadowbladeEpicHelm.Bonus3Type = (int)eStat.DEX;

                ShadowbladeEpicHelm.Bonus4     = 10;
                ShadowbladeEpicHelm.Bonus4Type = (int)eStat.QUI;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ShadowbladeEpicHelm);
                }
            }
            //Shadow Shrouded Gloves
            ShadowbladeEpicGloves = GameServer.Database.FindObjectByKey <ItemTemplate>("ShadowbladeEpicGloves");
            if (ShadowbladeEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Shadowblade Epic Gloves , creating it ...");
                }
                ShadowbladeEpicGloves               = new ItemTemplate();
                ShadowbladeEpicGloves.Id_nb         = "ShadowbladeEpicGloves";
                ShadowbladeEpicGloves.Name          = "Shadow Shrouded Gloves";
                ShadowbladeEpicGloves.Level         = 50;
                ShadowbladeEpicGloves.Item_Type     = 22;
                ShadowbladeEpicGloves.Model         = 764;
                ShadowbladeEpicGloves.IsDropable    = true;
                ShadowbladeEpicGloves.IsPickable    = true;
                ShadowbladeEpicGloves.DPS_AF        = 100;
                ShadowbladeEpicGloves.SPD_ABS       = 10;
                ShadowbladeEpicGloves.Object_Type   = 33;
                ShadowbladeEpicGloves.Quality       = 100;
                ShadowbladeEpicGloves.Weight        = 22;
                ShadowbladeEpicGloves.Bonus         = 35;
                ShadowbladeEpicGloves.MaxCondition  = 50000;
                ShadowbladeEpicGloves.MaxDurability = 50000;
                ShadowbladeEpicGloves.Condition     = 50000;
                ShadowbladeEpicGloves.Durability    = 50000;

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

                ShadowbladeEpicGloves.Bonus2     = 12;
                ShadowbladeEpicGloves.Bonus2Type = (int)eStat.QUI;

                ShadowbladeEpicGloves.Bonus3     = 33;
                ShadowbladeEpicGloves.Bonus3Type = (int)eProperty.MaxHealth;

                ShadowbladeEpicGloves.Bonus4     = 4;
                ShadowbladeEpicGloves.Bonus4Type = (int)eProperty.Skill_Envenom;


                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ShadowbladeEpicGloves);
                }
            }
            //Shadow Shrouded Hauberk
            ShadowbladeEpicVest = GameServer.Database.FindObjectByKey <ItemTemplate>("ShadowbladeEpicVest");
            if (ShadowbladeEpicVest == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Shadowblade Epic Vest , creating it ...");
                }
                ShadowbladeEpicVest               = new ItemTemplate();
                ShadowbladeEpicVest.Id_nb         = "ShadowbladeEpicVest";
                ShadowbladeEpicVest.Name          = "Shadow Shrouded Jerkin";
                ShadowbladeEpicVest.Level         = 50;
                ShadowbladeEpicVest.Item_Type     = 25;
                ShadowbladeEpicVest.Model         = 761;
                ShadowbladeEpicVest.IsDropable    = true;
                ShadowbladeEpicVest.IsPickable    = true;
                ShadowbladeEpicVest.DPS_AF        = 100;
                ShadowbladeEpicVest.SPD_ABS       = 10;
                ShadowbladeEpicVest.Object_Type   = 33;
                ShadowbladeEpicVest.Quality       = 100;
                ShadowbladeEpicVest.Weight        = 22;
                ShadowbladeEpicVest.Bonus         = 35;
                ShadowbladeEpicVest.MaxCondition  = 50000;
                ShadowbladeEpicVest.MaxDurability = 50000;
                ShadowbladeEpicVest.Condition     = 50000;
                ShadowbladeEpicVest.Durability    = 50000;

                ShadowbladeEpicVest.Bonus1     = 13;
                ShadowbladeEpicVest.Bonus1Type = (int)eStat.STR;

                ShadowbladeEpicVest.Bonus2     = 13;
                ShadowbladeEpicVest.Bonus2Type = (int)eStat.DEX;

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

                ShadowbladeEpicVest.Bonus4     = 6;
                ShadowbladeEpicVest.Bonus4Type = (int)eResist.Heat;

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

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

                ShadowbladeEpicLegs.Bonus2     = 15;
                ShadowbladeEpicLegs.Bonus2Type = (int)eStat.CON;

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

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

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

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

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

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

                ShadowbladeEpicArms.Bonus4     = 10;
                ShadowbladeEpicArms.Bonus4Type = (int)eResist.Thrust;

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

            #endregion

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

            GameEventMgr.AddHandler(Masrim, GameObjectEvent.Interact, new DOLEventHandler(TalkToMasrim));
            GameEventMgr.AddHandler(Masrim, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMasrim));

            GameEventMgr.AddHandler(MorlinCaan, GameObjectEvent.Interact, new DOLEventHandler(TalkToMorlinCaan));
            GameEventMgr.AddHandler(MorlinCaan, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMorlinCaan));

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

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Esempio n. 13
0
        /// <summary>
        /// Quest initialisation.
        /// </summary>
        public static void Init(String artifactID, Type questType)
        {
            if (artifactID == null || questType == null)
            {
                return;
            }

            String[] scholars = ArtifactMgr.GetScholars(artifactID);
            if (scholars != null)
            {
                eRealm    realm = eRealm.Albion;
                GameNPC[] npcs;

                foreach (String scholar in scholars)
                {
                    String title;

                    switch (realm)
                    {
                    case eRealm.Albion:
                        title = "Scholar";
                        npcs  = WorldMgr.GetNPCsByName(String.Format("{0} {1}", title, scholar), realm);
                        break;

                    case eRealm.Midgard:
                        title = "Loremaster";
                        npcs  = WorldMgr.GetNPCsByName(String.Format("{0} {1}", title, scholar), realm);

                        if (npcs.Length == 0)
                        {
                            title = "Loremistress";
                            npcs  = WorldMgr.GetNPCsByName(String.Format("{0} {1}", title, scholar), realm);
                        }
                        break;

                    case eRealm.Hibernia:
                        title = "Sage";
                        npcs  = WorldMgr.GetNPCsByName(String.Format("{0} {1}", title, scholar), realm);
                        break;

                    default:
                        title = "<unknown title>";
                        npcs  = new GameNPC[0];
                        break;
                    }

                    if (npcs.Length == 0)
                    {
                        log.Warn(String.Format("ARTIFACTQUEST: {0} {1} not found in {2} for artifact {3}", title, scholar, GlobalConstants.RealmToName(realm), artifactID));
                    }
                    else
                    {
                        npcs[0].AddQuestToGive(questType);
                    }

                    ++realm;
                }
            }
            else
            {
                log.Warn("ARTIFACTQUEST: scholars is null for artifact " + artifactID);
            }
        }
Esempio n. 14
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("Lady Legada", eRealm.None);
            if (npcs.Length == 0)
            {
                //if (Log.IsWarnEnabled) Log.Warn("Could not find Lady Felin, creating her ...");
                ladyLegada                 = new GameNPC();
                ladyLegada.Model           = 679;
                ladyLegada.Name            = "Lady Legada";
                ladyLegada.GuildName       = "Part of " + questTitle + " Quest";
                ladyLegada.Realm           = eRealm.None;
                ladyLegada.CurrentRegionID = legadaStart.RegionID;
                ladyLegada.Size            = 50;
                ladyLegada.Level           = 30;
                ladyLegada.X               = legadaStart.X;
                ladyLegada.Y               = legadaStart.Y;
                ladyLegada.Z               = legadaStart.Z;
                ladyLegada.Heading         = legadaStart.Heading;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                ladyLegada.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
                //ladyFelin.SaveIntoDatabase();
                //ladyFelin.AddToWorld();
            }
            else
            {
                ladyLegada = npcs[0];
            }

            #endregion

            #region defineItems

            // item db check
            necklaceOfDoppelganger = GameServer.Database.FindObjectByKey <ItemTemplate>("necklace_of_the_doppelganger");
            if (necklaceOfDoppelganger == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Necklace of the Doppelganger, creating it ...");
                }
                necklaceOfDoppelganger        = new ItemTemplate();
                necklaceOfDoppelganger.Name   = "Necklace of the Doppelganger";
                necklaceOfDoppelganger.Level  = 2;
                necklaceOfDoppelganger.Weight = 2;
                necklaceOfDoppelganger.Model  = 101;

                necklaceOfDoppelganger.Object_Type = (int)eObjectType.Magical;
                necklaceOfDoppelganger.Item_Type   = (int)eEquipmentItems.NECK;
                necklaceOfDoppelganger.Id_nb       = "necklace_of_the_doppelganger";
                necklaceOfDoppelganger.Price       = 0;
                necklaceOfDoppelganger.IsPickable  = true;
                necklaceOfDoppelganger.IsDropable  = false;

                necklaceOfDoppelganger.Quality       = 100;
                necklaceOfDoppelganger.Condition     = 1000;
                necklaceOfDoppelganger.MaxCondition  = 1000;
                necklaceOfDoppelganger.Durability    = 1000;
                necklaceOfDoppelganger.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(necklaceOfDoppelganger);
                }
            }

            // item db check
            sluaghPlans = GameServer.Database.FindObjectByKey <ItemTemplate>("sluagh_plans");
            if (sluaghPlans == null)
            {
                sluaghPlans      = new ItemTemplate();
                sluaghPlans.Name = "Sluagh Plans";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find" + sluaghPlans.Name + " , creating it ...");
                }

                sluaghPlans.Weight = 3;
                sluaghPlans.Model  = 498;

                sluaghPlans.Object_Type = (int)eObjectType.GenericItem;

                sluaghPlans.Id_nb      = "sluagh_plans";
                sluaghPlans.IsPickable = true;
                sluaghPlans.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(sluaghPlans);
                }
            }

            // item db check
            recruitsBoots = GameServer.Database.FindObjectByKey <ItemTemplate>("recruits_cailiocht_boots");
            if (recruitsBoots == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Recruit's Cailiocht Boots, creating it ...");
                }
                recruitsBoots       = new ItemTemplate();
                recruitsBoots.Name  = "Recruit's Cailiocht Boots";
                recruitsBoots.Level = 7;

                recruitsBoots.Weight = 24;
                recruitsBoots.Model  = 84;                // studded Boots

                recruitsBoots.DPS_AF  = 12;               // Armour
                recruitsBoots.SPD_ABS = 19;               // Absorption

                recruitsBoots.Object_Type = (int)eObjectType.Reinforced;
                recruitsBoots.Item_Type   = (int)eEquipmentItems.FEET;
                recruitsBoots.Id_nb       = "recruits_cailiocht_boots";
                recruitsBoots.Price       = Money.GetMoney(0, 0, 0, 10, 0);
                recruitsBoots.IsPickable  = true;
                recruitsBoots.IsDropable  = true;
                recruitsBoots.Color       = 13;          // green leather

                recruitsBoots.Bonus = 1;                 // default bonus

                recruitsBoots.Bonus1     = 3;
                recruitsBoots.Bonus1Type = (int)eStat.STR;

                recruitsBoots.Bonus2     = 1;
                recruitsBoots.Bonus2Type = (int)eStat.DEX;

                recruitsBoots.Quality       = 100;
                recruitsBoots.Condition     = 1000;
                recruitsBoots.MaxCondition  = 1000;
                recruitsBoots.Durability    = 1000;
                recruitsBoots.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(recruitsBoots);
                }
            }

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

                recruitsQuiltedBoots.Weight = 8;
                recruitsQuiltedBoots.Model  = 155;               // studded Boots

                recruitsQuiltedBoots.DPS_AF  = 6;                // Armour
                recruitsQuiltedBoots.SPD_ABS = 0;                // Absorption

                recruitsQuiltedBoots.Object_Type = (int)eObjectType.Cloth;
                recruitsQuiltedBoots.Item_Type   = (int)eEquipmentItems.FEET;
                recruitsQuiltedBoots.Id_nb       = "recruits_quilted_boots";
                recruitsQuiltedBoots.Price       = Money.GetMoney(0, 0, 0, 10, 0);
                recruitsQuiltedBoots.IsPickable  = true;
                recruitsQuiltedBoots.IsDropable  = true;
                recruitsQuiltedBoots.Color       = 32;

                recruitsQuiltedBoots.Bonus = 5;                 // default bonus

                recruitsQuiltedBoots.Bonus1     = 3;
                recruitsQuiltedBoots.Bonus1Type = (int)eStat.CON;


                recruitsQuiltedBoots.Bonus2     = 1;
                recruitsQuiltedBoots.Bonus2Type = (int)eStat.STR;

                recruitsQuiltedBoots.Bonus3     = 1;
                recruitsQuiltedBoots.Bonus3Type = (int)eResist.Spirit;

                recruitsQuiltedBoots.Quality       = 100;
                recruitsQuiltedBoots.Condition     = 1000;
                recruitsQuiltedBoots.MaxCondition  = 1000;
                recruitsQuiltedBoots.Durability    = 1000;
                recruitsQuiltedBoots.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(recruitsQuiltedBoots);
                }
            }

            #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(addrir, GameLivingEvent.Interact, new DOLEventHandler(TalkToAddrir));
            GameEventMgr.AddHandler(addrir, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToAddrir));

            GameEventMgr.AddHandler(ladyLegada, GameLivingEvent.Interact, new DOLEventHandler(TalkToLadyLegada));
            GameEventMgr.AddHandler(ladyLegada, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToLadyLegada));

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

            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");
            }
        }
Esempio n. 16
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");
            }
        }
Esempio n. 17
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");
            }
        }
Esempio n. 18
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("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

            #region defineItems

            // item db check
            farmerAsmasMap = GameServer.Database.FindObjectByKey <ItemTemplate>("farmer_asma_map");
            if (farmerAsmasMap == null)
            {
                farmerAsmasMap      = new ItemTemplate();
                farmerAsmasMap.Name = "Farmer Asma's Map";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + farmerAsmasMap.Name + ", creating it ...");
                }
                farmerAsmasMap.Level  = 0;
                farmerAsmasMap.Weight = 1;
                farmerAsmasMap.Model  = 499;

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

                farmerAsmasMap.Quality       = 100;
                farmerAsmasMap.Condition     = 1000;
                farmerAsmasMap.MaxCondition  = 1000;
                farmerAsmasMap.Durability    = 1000;
                farmerAsmasMap.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(farmerAsmasMap);
            }

            #endregion


            firstFieldArea = WorldMgr.GetRegion(firstField.RegionID).AddArea(new Area.Circle("First Vacant Field", firstField.X, firstField.Y, 0, 1450));
            firstFieldArea.RegisterPlayerEnter(new DOLEventHandler(PlayerEnterFirstFieldArea));

            secondFieldArea = WorldMgr.GetRegion(secondField.RegionID).AddArea(new Area.Circle("Second Vacant Field", secondField.X, secondField.Y, 0, 1100));
            secondFieldArea.RegisterPlayerEnter(new DOLEventHandler(PlayerEnterSecondFieldArea));

            thirdFieldArea = WorldMgr.GetRegion(thirdField.RegionID).AddArea(new Area.Circle("Third Vacant Field", thirdField.X, thirdField.Y, 0, 1100));
            thirdFieldArea.RegisterPlayerEnter(new DOLEventHandler(PlayerEnterThirdFieldArea));

            /* 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(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 */
            farmerAsma.AddQuestToGive(typeof(GreenerPastures));

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Esempio n. 19
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 :)
             */

            dalikor = GetDalikor();

            #region defineNPCs

            generalLocations[0] = new GameLocation(generalNames[0], 100, 100, 40124, 44594, 4712, 216);
            generalLocations[1] = new GameLocation(generalNames[1], 100, 100, 46821, 40884, 4972, 21);
            generalLocations[2] = new GameLocation(generalNames[2], 100, 100, 56104, 43865, 5460, 48);

            GameNPC[] npcs = null;
            for (int i = 0; i < general.Length; i++)
            {
                npcs = WorldMgr.GetNPCsByName(generalNames[i], eRealm.None);
                if (npcs.Length > 0)
                {
                    general[i] = npcs[0] as GameNPC;
                }
                else
                {
                    if (log.IsWarnEnabled)
                    {
                        log.Warn("Could not find " + generalNames[i] + ", creating ...");
                    }
                    general[i] = new GameNPC();

                    general[i].Model = 678;

                    general[i].GuildName = "Part of " + questTitle + " Quest";
                    general[i].Name      = generalNames[i];
                    general[i].Position  = generalLocations[i].Position;
                    general[i].Heading   = generalLocations[i].Heading;

                    general[i].Realm           = eRealm.None;
                    general[i].CurrentRegionID = generalLocations[i].RegionID;
                    general[i].Size            = 49;
                    general[i].Level           = 2;

                    StandardMobBrain brain = new StandardMobBrain();
                    brain.AggroLevel = 80;
                    brain.AggroRange = 1000;
                    general[i].SetOwnBrain(brain);

                    if (SAVE_INTO_DATABASE)
                    {
                        general[i].SaveIntoDatabase();
                    }

                    general[i].AddToWorld();
                }
            }

            #endregion

            #region defineItems

            /*
             * TODO Model for Campfire doesn't work. Very Stange!
             */
            /*
             * // Add campfires to generals
             * for (int i = 0; i < generalLocations.Length; i++)
             * {
             *      GameStaticItem campfire = null;
             *
             *      IEnumerable items =  WorldMgr.GetItemsCloseToSpot(generalLocations[i].RegionID,generalLocations[i].X, generalLocations[i].Y, generalLocations[i].Z, 400,true);
             *      foreach (GameObject obj in items)
             *      {
             *              if (obj is GameStaticItem && obj.Name=="Camp Fire")
             *              {
             *                      campfire= (GameStaticItem) obj;
             *                      break;
             *              }
             *      }
             *
             *      if (campfire==null)
             *      {
             *              campfire = new GameStaticItem();
             *              campfire.Name="Camp Fire";
             *
             *              campfire.Model = 2593;
             *              campfire.Heading = generalLocations[i].Heading;
             *              campfire.X = generalLocations[i].X;
             *              campfire.Y = generalLocations[i].Y;
             *              campfire.Z = generalLocations[i].Z;
             *              campfire.CurrentRegionID = generalLocations[i].RegionID;
             *
             *              if (SAVE_INTO_DATABASE)
             *                      campfire.SaveIntoDatabase();
             *
             *              campfire.AddToWorld();
             *
             *              DOLConsole.WriteLine("Camp Fire added"+generalNames[i]);
             *      }
             * }
             */

            askefruerWings = GameServer.Database.FindObjectByKey <ItemTemplate>("askefruer_wings");
            if (askefruerWings == null)
            {
                askefruerWings      = new ItemTemplate();
                askefruerWings.Name = "Wings of Askefruer";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + askefruerWings.Name + " , creating it ...");
                }

                askefruerWings.Weight = 2;
                askefruerWings.Model  = 551;

                askefruerWings.Object_Type = (int)eObjectType.GenericItem;

                askefruerWings.Id_nb      = "askefruer_wings";
                askefruerWings.IsPickable = true;
                askefruerWings.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(askefruerWings);
                }
            }

            dustyOldMap = GameServer.Database.FindObjectByKey <ItemTemplate>("dusty_old_map");
            if (dustyOldMap == null)
            {
                dustyOldMap      = new ItemTemplate();
                dustyOldMap.Name = "Dusty Old Map";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + dustyOldMap.Name + " , creating it ...");
                }

                dustyOldMap.Weight = 10;
                dustyOldMap.Model  = 498;

                dustyOldMap.Object_Type = (int)eObjectType.GenericItem;

                dustyOldMap.Id_nb      = "dusty_old_map";
                dustyOldMap.IsPickable = true;
                dustyOldMap.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(dustyOldMap);
                }
            }


            // item db check
            recruitsArms = GameServer.Database.FindObjectByKey <ItemTemplate>("recruits_studded_arms_mid");
            if (recruitsArms == null)
            {
                recruitsArms      = new ItemTemplate();
                recruitsArms.Name = "Recruit's Studded Arms (Mid)";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + recruitsArms.Name + ", creating it ...");
                }
                recruitsArms.Level = 7;

                recruitsArms.Weight = 36;
                recruitsArms.Model  = 83;                // studded Boots

                recruitsArms.DPS_AF  = 10;               // Armour
                recruitsArms.SPD_ABS = 19;               // Absorption

                recruitsArms.Object_Type = (int)eObjectType.Studded;
                recruitsArms.Item_Type   = (int)eEquipmentItems.ARMS;
                recruitsArms.Id_nb       = "recruits_studded_arms_mid";
                recruitsArms.Price       = Money.GetMoney(0, 0, 0, 4, 0);
                recruitsArms.IsPickable  = true;
                recruitsArms.IsDropable  = true;
                recruitsArms.Color       = 36;          // blue cloth

                recruitsArms.Bonus = 5;                 // default bonus

                recruitsArms.Bonus1     = 4;
                recruitsArms.Bonus1Type = (int)eStat.QUI;

                recruitsArms.Bonus2     = 1;
                recruitsArms.Bonus2Type = (int)eResist.Body;

                recruitsArms.Quality       = 100;
                recruitsArms.Condition     = 1000;
                recruitsArms.MaxCondition  = 1000;
                recruitsArms.Durability    = 1000;
                recruitsArms.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(recruitsArms);
                }
            }

            recruitsSleeves = GameServer.Database.FindObjectByKey <ItemTemplate>("recruits_quilted_sleeves");
            if (recruitsSleeves == null)
            {
                recruitsSleeves      = new ItemTemplate();
                recruitsSleeves.Name = "Recruit's Quilted Sleeves";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + recruitsSleeves.Name + ", creating it ...");
                }
                recruitsSleeves.Level = 7;

                recruitsSleeves.Weight = 12;
                recruitsSleeves.Model  = 153;

                recruitsSleeves.DPS_AF  = 6;                // Armour
                recruitsSleeves.SPD_ABS = 0;                // Absorption

                recruitsSleeves.Object_Type = (int)eObjectType.Cloth;
                recruitsSleeves.Item_Type   = (int)eEquipmentItems.ARMS;
                recruitsSleeves.Id_nb       = "recruits_quilted_sleeves";
                recruitsSleeves.Price       = Money.GetMoney(0, 0, 0, 4, 0);
                recruitsSleeves.IsPickable  = true;
                recruitsSleeves.IsDropable  = true;
                recruitsSleeves.Color       = 27;          // red cloth

                recruitsSleeves.Bonus = 5;                 // default bonus

                recruitsSleeves.Bonus1     = 4;
                recruitsSleeves.Bonus1Type = (int)eStat.DEX;

                recruitsSleeves.Bonus2     = 1;
                recruitsSleeves.Bonus2Type = (int)eResist.Body;

                recruitsSleeves.Quality       = 100;
                recruitsSleeves.Condition     = 1000;
                recruitsSleeves.MaxCondition  = 1000;
                recruitsSleeves.Durability    = 1000;
                recruitsSleeves.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(recruitsSleeves);
                }
            }

            #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.
             */
            //We want to be notified whenever a player enters the world
            GameEventMgr.AddHandler(GamePlayerEvent.GameEntered, new DOLEventHandler(PlayerEnterWorld));

            GameEventMgr.AddHandler(dalikor, GameLivingEvent.Interact, new DOLEventHandler(TalkToDalikor));
            GameEventMgr.AddHandler(dalikor, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToDalikor));

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

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

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Esempio n. 20
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("Farmer Asma", 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)
            {
                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(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 */
            farmerAsma.AddQuestToGive(typeof(RevengeTheOtherWhiteMeat));

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Esempio n. 21
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);
        }
Esempio n. 22
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("Richael", eRealm.Hibernia);

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

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 416, 37);                       //Slot 22
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 413, 37);                       //Slot 25
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 417, 37);                        //Slot 23
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 414, 35);                        //Slot 27
                template.AddNPCEquipment(eInventorySlot.Cloak, 57, 35);                             //Slot 26
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 415, 37);                        //Slot 28
                Richael.Inventory = template.CloseTemplate();
                Richael.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                Richael.Size    = 48;
                Richael.Level   = 38;
                Richael.X       = 347089;
                Richael.Y       = 491290;
                Richael.Z       = 5247;
                Richael.Heading = 978;

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

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

            #endregion
            #region defineAreas
            Demons_Breach_Area = WorldMgr.GetRegion(Demons_Breach.RegionID).AddArea(new Area.Circle("", Demons_Breach.Position, 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(Richael, GameLivingEvent.Interact, new DOLEventHandler(TalkToRichael));
            GameEventMgr.AddHandler(Richael, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToRichael));

            Richael.AddQuestToGive(typeof(ToReachTheBreach));

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Esempio n. 23
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("Master Gerol", eRealm.Albion);
            if (npcs.Length == 0)
            {
                masterGerol       = new GameNPC();
                masterGerol.Model = 10;
                masterGerol.Name  = "Master Gerol";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + masterGerol.Name + ", creating him ...");
                }
                masterGerol.GuildName       = "Healer";
                masterGerol.Realm           = eRealm.Albion;
                masterGerol.CurrentRegionID = 1;
                masterGerol.Size            = 45;
                masterGerol.Level           = 20;
                masterGerol.X            = 578668;
                masterGerol.Y            = 556823;
                masterGerol.Z            = 2184;
                masterGerol.Heading      = 79;
                masterGerol.MaxSpeedBase = 200;

                //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)
                {
                    masterGerol.SaveIntoDatabase();
                }


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



            #endregion

            #region defineItems



            boarCarcass = GameServer.Database.FindObjectByKey <ItemTemplate>("huge_boar_carcass");
            if (boarCarcass == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Elder Wood, creating it ...");
                }
                boarCarcass             = new ItemTemplate();
                boarCarcass.Object_Type = 0;
                boarCarcass.Id_nb       = "huge_boar_carcass";
                boarCarcass.Name        = "Huge Boar Carcass";
                boarCarcass.Level       = 1;
                boarCarcass.Model       = 540;
                boarCarcass.IsDropable  = false;
                boarCarcass.IsPickable  = false;
                GameServer.Database.AddObject(boarCarcass);
            }


            #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(masterGerol, GameLivingEvent.Interact, new DOLEventHandler(TalkToMasterGerol));
            GameEventMgr.AddHandler(masterGerol, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMasterGerol));


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

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Esempio n. 24
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("Audun", (eRealm)2);
            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(101).IsDisabled)
                {
                    Audun       = new DOL.GS.GameNPC();
                    Audun.Model = 232;
                    Audun.Name  = "Audun";
                    if (log.IsWarnEnabled)
                    {
                        log.Warn("Could not find " + Audun.Name + ", creating ...");
                    }
                    Audun.GuildName       = "Part of " + questTitle + " Quest";
                    Audun.Realm           = eRealm.Midgard;
                    Audun.CurrentRegionID = 101;
                    Audun.Size            = 48;
                    Audun.Level           = 49;
                    Audun.MaxSpeedBase    = 191;
                    Audun.Faction         = FactionMgr.GetFactionByID(0);
                    Audun.X               = 33283;
                    Audun.Y               = 35305;
                    Audun.Z               = 8027;
                    Audun.Heading         = 1763;
                    Audun.RespawnInterval = -1;
                    Audun.BodyType        = 0;


                    StandardMobBrain brain = new StandardMobBrain();
                    brain.AggroLevel = 0;
                    brain.AggroRange = 500;
                    Audun.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)
                    {
                        Audun.SaveIntoDatabase();
                    }

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

            npcs = WorldMgr.GetNPCsByName("Guard Olja", (eRealm)2);
            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(229).IsDisabled)
                {
                    GuardOlja       = new DOL.GS.GameNPC();
                    GuardOlja.Model = 180;
                    GuardOlja.Name  = "Guard Olja";
                    if (log.IsWarnEnabled)
                    {
                        log.Warn("Could not find " + GuardOlja.Name + ", creating ...");
                    }
                    GuardOlja.GuildName       = "Part of " + questTitle + " Quest";
                    GuardOlja.Realm           = eRealm.Midgard;
                    GuardOlja.CurrentRegionID = 229;
                    GuardOlja.Size            = 50;
                    GuardOlja.Level           = 50;
                    GuardOlja.MaxSpeedBase    = 191;
                    GuardOlja.Faction         = FactionMgr.GetFactionByID(0);
                    GuardOlja.X               = 47994;
                    GuardOlja.Y               = 37341;
                    GuardOlja.Z               = 21812;
                    GuardOlja.Heading         = 204;
                    GuardOlja.RespawnInterval = -1;
                    GuardOlja.BodyType        = 0;


                    StandardMobBrain brain = new StandardMobBrain();
                    brain.AggroLevel = 0;
                    brain.AggroRange = 500;
                    GuardOlja.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)
                    {
                        GuardOlja.SaveIntoDatabase();
                    }

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


            #endregion

            #region defineItems

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


            #endregion

            #region defineAreas

            #endregion

            #region defineQuestParts

            QuestBuilder   builder = QuestMgr.getBuilder(typeof(meadrun));
            QuestBehaviour a;
            a = builder.CreateBehaviour(Audun, -1);
            a.AddTrigger(eTriggerType.Interact, null, Audun);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.meadrun), Audun);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.meadrun), null, (eComparator)5);
            a.AddAction(eActionType.Talk, "Greetings. You appear to be down on your luck. I have a [proposition] for you if you're interested.", null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Audun, -1);
            a.AddTrigger(eTriggerType.Whisper, "proposition", Audun);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.meadrun), Audun);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.meadrun), null, (eComparator)5);
            a.AddAction(eActionType.Talk, "I need to deliver some mead to the guards just inside the Burial Grounds. There is a bit of coin to be had if you would deliver the mead for me.", Audun);
            a.AddAction(eActionType.OfferQuest, typeof(DOL.GS.Quests.Midgard.meadrun), "Will you deliver the mead for Audun? [Levels 1-4]");
            AddBehaviour(a);
            a = builder.CreateBehaviour(Audun, -1);
            a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(DOL.GS.Quests.Midgard.meadrun));
            a.AddAction(eActionType.Talk, "No problem. See you", Audun);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Audun, -1);
            a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(DOL.GS.Quests.Midgard.meadrun));
            a.AddAction(eActionType.Talk, "Here take the mead to Guard Olja inside the entrance of the Burial Grounds.", Audun);
            a.AddAction(eActionType.GiveItem, bottleofmead, Audun);
            a.AddAction(eActionType.GiveQuest, typeof(DOL.GS.Quests.Midgard.meadrun), Audun);
            AddBehaviour(a);
            a = builder.CreateBehaviour(GuardOlja, -1);
            a.AddTrigger(eTriggerType.GiveItem, GuardOlja, bottleofmead);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.meadrun), null);
            a.AddAction(eActionType.Talk, "Thanks. Here, take this empty bottle back to Auduan.", GuardOlja);
            a.AddAction(eActionType.GiveItem, emptybottle, GuardOlja);
            a.AddAction(eActionType.TakeItem, bottleofmead, null);
            a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.meadrun), null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Audun, -1);
            a.AddTrigger(eTriggerType.GiveItem, Audun, emptybottle);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.meadrun), 2, (eComparator)3);
            a.AddAction(eActionType.Talk, "Good work. Here is that bit of coin I was talking about. Check back with me later, and I may have more work for you.", Audun);
            a.AddAction(eActionType.GiveXP, 5, null);
            a.AddAction(eActionType.GiveGold, 27, null);
            a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.meadrun), null);
            AddBehaviour(a);

            #endregion

            // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End
            if (Audun != null)
            {
                Audun.AddQuestToGive(typeof(meadrun));
            }
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Esempio n. 25
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");
            }
        }
Esempio n. 26
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("Josson", eRealm.Hibernia);

            if (npcs.Length == 0)
            {
                Josson       = new GameNPC();
                Josson.Model = 382;
                Josson.Name  = "Josson";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + Josson.Name + ", creating him ...");
                }
                //k109: My preference, no guildname for quest NPCs.  Uncomment if you like that...
                //Josson.GuildName = "Part of " + questTitle + " Quest";
                Josson.Realm           = eRealm.Hibernia;
                Josson.CurrentRegionID = 200;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 386);                   //Slot 22
                template.AddNPCEquipment(eInventorySlot.HeadArmor, 835);                    //Slot 21
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 387);                    //Slot 23
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 383);                   //Slot 25
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 384);                    //Slot 27
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 385);                    //Slot 28
                Josson.Inventory = template.CloseTemplate();
                Josson.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                Josson.Size    = 48;
                Josson.Level   = 50;
                Josson.X       = 346627;
                Josson.Y       = 491453;
                Josson.Z       = 5247;
                Josson.Heading = 2946;

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

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

            #endregion

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

            GameEventMgr.AddHandler(Josson, GameLivingEvent.Interact, new DOLEventHandler(TalkToJosson));
            GameEventMgr.AddHandler(Josson, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToJosson));

            Josson.AddQuestToGive(typeof(MagicalBacklash));

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Esempio n. 27
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("Guard Alakyrr", eRealm.None);

            if (npcs.Length == 0)
            {
                GuardAlakyrr       = new DOL.GS.GameNPC();
                GuardAlakyrr.Model = 748;
                GuardAlakyrr.Name  = "Guard Alakyrr";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + GuardAlakyrr.Name + ", creating ...");
                }
                GuardAlakyrr.GuildName       = "Part of " + questTitle + " Quest";
                GuardAlakyrr.Realm           = eRealm.Albion;
                GuardAlakyrr.CurrentRegionID = 63;
                GuardAlakyrr.Size            = 50;
                GuardAlakyrr.Level           = 30;
                GuardAlakyrr.MaxSpeedBase    = 191;
                GuardAlakyrr.Faction         = FactionMgr.GetFactionByID(0);
                GuardAlakyrr.X               = 28707;
                GuardAlakyrr.Y               = 20147;
                GuardAlakyrr.Z               = 16760;
                GuardAlakyrr.Heading         = 4016;
                GuardAlakyrr.RespawnInterval = -1;
                GuardAlakyrr.BodyType        = 0;


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

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

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

            #endregion

            #region defineItems

            enchantedtenebrousflask = GameServer.Database.FindObjectByKey <ItemTemplate>("enchantedtenebrousflask");
            if (enchantedtenebrousflask == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Enchanted Tenebrous Flask, creating it ...");
                }
                enchantedtenebrousflask               = new ItemTemplate();
                enchantedtenebrousflask.Name          = "enchanted tenebrous flask";
                enchantedtenebrousflask.Level         = 1;
                enchantedtenebrousflask.Weight        = 10;
                enchantedtenebrousflask.Model         = 1610;
                enchantedtenebrousflask.Object_Type   = (int)eObjectType.GenericItem;
                enchantedtenebrousflask.Id_nb         = "enchantedtenebrousflask";
                enchantedtenebrousflask.Price         = 0;
                enchantedtenebrousflask.IsPickable    = false;
                enchantedtenebrousflask.IsDropable    = false;
                enchantedtenebrousflask.Quality       = 100;
                enchantedtenebrousflask.Condition     = 1000;
                enchantedtenebrousflask.MaxCondition  = 1000;
                enchantedtenebrousflask.Durability    = 1000;
                enchantedtenebrousflask.MaxDurability = 1000;

                GameServer.Database.AddObject(enchantedtenebrousflask);
            }
            quarterfulltenebrousflask = GameServer.Database.FindObjectByKey <ItemTemplate>("quarterfulltenebrousflask");
            if (quarterfulltenebrousflask == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Quarter Full Tenebrous Flask, creating it ...");
                }
                quarterfulltenebrousflask               = new ItemTemplate();
                quarterfulltenebrousflask.Name          = "quarter full tenebrous flask";
                quarterfulltenebrousflask.Level         = 1;
                quarterfulltenebrousflask.Weight        = 250;
                quarterfulltenebrousflask.Model         = 1610;
                quarterfulltenebrousflask.Object_Type   = (int)eObjectType.GenericItem;
                quarterfulltenebrousflask.Id_nb         = "quarterfulltenebrousflask";
                quarterfulltenebrousflask.Price         = 0;
                quarterfulltenebrousflask.IsPickable    = false;
                quarterfulltenebrousflask.IsDropable    = false;
                quarterfulltenebrousflask.Quality       = 100;
                quarterfulltenebrousflask.Condition     = 1000;
                quarterfulltenebrousflask.MaxCondition  = 1000;
                quarterfulltenebrousflask.Durability    = 1000;
                quarterfulltenebrousflask.MaxDurability = 1000;

                GameServer.Database.AddObject(quarterfulltenebrousflask);
            }
            halffulltenebrousflask = GameServer.Database.FindObjectByKey <ItemTemplate>("halffulltenebrousflask");
            if (halffulltenebrousflask == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Half Full Tenebrous Flask, creating it ...");
                }
                halffulltenebrousflask               = new ItemTemplate();
                halffulltenebrousflask.Name          = "half full tenebrous flask";
                halffulltenebrousflask.Level         = 1;
                halffulltenebrousflask.Weight        = 250;
                halffulltenebrousflask.Model         = 1610;
                halffulltenebrousflask.Object_Type   = (int)eObjectType.GenericItem;
                halffulltenebrousflask.Id_nb         = "halffulltenebrousflask";
                halffulltenebrousflask.Price         = 0;
                halffulltenebrousflask.IsPickable    = false;
                halffulltenebrousflask.IsDropable    = false;
                halffulltenebrousflask.Quality       = 100;
                halffulltenebrousflask.Condition     = 1000;
                halffulltenebrousflask.MaxCondition  = 1000;
                halffulltenebrousflask.Durability    = 1000;
                halffulltenebrousflask.MaxDurability = 1000;

                GameServer.Database.AddObject(halffulltenebrousflask);
            }
            threequarterfulltenebrousflask = GameServer.Database.FindObjectByKey <ItemTemplate>("threequarterfulltenebrousflask");
            if (threequarterfulltenebrousflask == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Three Quarter Full Tenebrous Flask, creating it ...");
                }
                threequarterfulltenebrousflask               = new ItemTemplate();
                threequarterfulltenebrousflask.Name          = "three quarter full tenebrous flask";
                threequarterfulltenebrousflask.Level         = 1;
                threequarterfulltenebrousflask.Weight        = 250;
                threequarterfulltenebrousflask.Model         = 1610;
                threequarterfulltenebrousflask.Object_Type   = (int)eObjectType.GenericItem;
                threequarterfulltenebrousflask.Id_nb         = "threequarterfulltenebrousflask";
                threequarterfulltenebrousflask.Price         = 0;
                threequarterfulltenebrousflask.IsPickable    = false;
                threequarterfulltenebrousflask.IsDropable    = false;
                threequarterfulltenebrousflask.Quality       = 100;
                threequarterfulltenebrousflask.Condition     = 1000;
                threequarterfulltenebrousflask.MaxCondition  = 1000;
                threequarterfulltenebrousflask.Durability    = 1000;
                threequarterfulltenebrousflask.MaxDurability = 1000;

                GameServer.Database.AddObject(threequarterfulltenebrousflask);
            }
            fullflaskoftenebrousessence = GameServer.Database.FindObjectByKey <ItemTemplate>("fullflaskoftenebrousessence");
            if (fullflaskoftenebrousessence == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Full Flask Of Tenebrous Essence, creating it ...");
                }
                fullflaskoftenebrousessence               = new ItemTemplate();
                fullflaskoftenebrousessence.Name          = "full flask of tenebrous essence";
                fullflaskoftenebrousessence.Level         = 1;
                fullflaskoftenebrousessence.Weight        = 250;
                fullflaskoftenebrousessence.Model         = 1610;
                fullflaskoftenebrousessence.Object_Type   = (int)eObjectType.GenericItem;
                fullflaskoftenebrousessence.Id_nb         = "fullflaskoftenebrousessence";
                fullflaskoftenebrousessence.Price         = 0;
                fullflaskoftenebrousessence.IsPickable    = false;
                fullflaskoftenebrousessence.IsDropable    = false;
                fullflaskoftenebrousessence.Quality       = 100;
                fullflaskoftenebrousessence.Condition     = 1000;
                fullflaskoftenebrousessence.MaxCondition  = 1000;
                fullflaskoftenebrousessence.Durability    = 1000;
                fullflaskoftenebrousessence.MaxDurability = 1000;

                GameServer.Database.AddObject(fullflaskoftenebrousessence);
            }

            #endregion

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

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

            GameEventMgr.AddHandler(GuardAlakyrr, GameLivingEvent.Interact, new DOLEventHandler(TalkToGuardAlakyrr));
            GameEventMgr.AddHandler(GuardAlakyrr, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToGuardAlakyrr));

            GuardAlakyrr.AddQuestToGive(typeof(AidingGuardAlakyrr));

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Esempio n. 28
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.Albion);

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

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 691, 0);                            //Slot 22
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 692, 0);                             //Slot 23
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 688, 0);                            //Slot 25
                template.AddNPCEquipment(eInventorySlot.Cloak, 676, 0);                                 //Slot 26
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 689, 0);                             //Slot 27
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 690, 0);                             //Slot 28
                questGiver.Inventory = template.CloseTemplate();
                questGiver.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                questGiver.Size    = 55;
                questGiver.Level   = 70;
                questGiver.X       = 95510;
                questGiver.Y       = 101313;
                questGiver.Z       = 5340;
                questGiver.Heading = 3060;

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

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

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

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

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 665, 0);                            //Slot 22
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 666, 0);                             //Slot 23
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 662, 0);                            //Slot 25
                template.AddNPCEquipment(eInventorySlot.Cloak, 676, 0);                                 //Slot 26
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 663, 0);                             //Slot 27
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 664, 0);                             //Slot 28
                questTarget.Inventory = template.CloseTemplate();
                questTarget.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                questTarget.Size    = 50;
                questTarget.Level   = 38;
                questTarget.X       = 94789;
                questTarget.Y       = 101439;
                questTarget.Z       = 5248;
                questTarget.Heading = 2878;

                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 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

            questGiver.AddQuestToGive(typeof(MovementAndInteraction));

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Esempio n. 29
0
        public void OnCommand(GameClient client, string[] args)
        {
            try
            {
                #region Refresh
                if (args.Length == 2 && args[1].ToLower() == "refresh")
                {
                    client.Player.LeaveHouse();
                    client.Player.RefreshWorld();
                    return;
                }
                #endregion Refresh
                #region Jump to GT
                if (args.Length == 3 && args[1].ToLower() == "to" && args[2].ToLower() == "gt")
                {
                    client.Player.MoveTo(client.Player.CurrentRegionID, client.Player.GroundTarget.X, client.Player.GroundTarget.Y, client.Player.GroundTarget.Z, client.Player.Heading);
                    return;
                }
                #endregion Jump to GT
                #region Jump to house
                else if (args.Length >= 3 && args[1].ToLower() == "to" && (args[2].ToLower() == "house" || args[2].ToLower() == "myhouse"))
                {
                    House house = null;
                    if (args[2] == "myhouse")
                    {
                        house = HouseMgr.GetHouseByPlayer(client.Player);
                    }
                    else
                    {
                        house = HouseMgr.GetHouse(Convert.ToInt32(args[3]));
                    }
                    if (house != null)
                    {
                        client.Player.MoveTo(house.OutdoorJumpPoint);
                    }
                    else
                    {
                        client.Out.SendMessage("This house number is not owned by anyone!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
                    }
                    return;
                }
                #endregion Jump to house
                #region Jump t region #
                if (args.Length == 4 && args[1] == "to" && args[2] == "region")
                {
                    client.Player.MoveTo(Convert.ToUInt16(args[3]), client.Player.X, client.Player.Y, client.Player.Z, client.Player.Heading);
                    return;
                }
                #endregion Jump t region #
                #region Jump to PlayerName or ClientID
                if (args.Length == 3 && args[1] == "to")
                {
                    GameClient clientc = null;
                    if (args[2].StartsWith("#"))
                    {
                        try
                        {
                            var sessionID = Convert.ToUInt32(args[2].Substring(1));
                            clientc = WorldMgr.GetClientFromID(sessionID);
                        }
                        catch
                        {
                        }
                    }
                    else
                    {
                        clientc = WorldMgr.GetClientByPlayerName(args[2], false, true);
                    }

                    if (clientc == null)
                    {
                        GameNPC[] npcs = WorldMgr.GetNPCsByName(args[2], eRealm.None);

                        if (npcs.Length > 0)
                        {
                            // for multiple npc's first try to jump to the npc in the players current region
                            GameNPC jumpTarget = npcs[0];

                            foreach (GameNPC npc in npcs)
                            {
                                if (npc.CurrentRegionID == client.Player.CurrentRegionID)
                                {
                                    jumpTarget = npc;
                                    break;
                                }
                            }

                            client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Jump.JumpToX", npcs[0].CurrentRegion.Description), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                            if (jumpTarget.InHouse && jumpTarget.CurrentHouse != null)
                            {
                                jumpTarget.CurrentHouse.Enter(client.Player);
                            }
                            else
                            {
                                client.Player.MoveTo(jumpTarget.CurrentRegionID, jumpTarget.X, jumpTarget.Y, jumpTarget.Z, jumpTarget.Heading);
                            }
                            return;
                        }

                        client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Jump.CannotBeFound", args[2]), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                        return;
                    }

                    if (CheckExpansion(client, clientc, clientc.Player.CurrentRegionID))
                    {
                        client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Jump.JumpToX", clientc.Player.CurrentRegion.Description), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                        if (clientc.Player.CurrentHouse != null && clientc.Player.InHouse)
                        {
                            clientc.Player.CurrentHouse.Enter(client.Player);
                        }
                        else
                        {
                            client.Player.MoveTo(clientc.Player.CurrentRegionID, clientc.Player.X, clientc.Player.Y, clientc.Player.Z, client.Player.Heading);
                        }
                        return;
                    }

                    client.Out.SendMessage("You don't have an expansion needed to jump to this location.", eChatType.CT_System, eChatLoc.CL_SystemWindow);

                    return;
                }
                #endregion Jump to PlayerName
                #region Jump to Name Realm
                else if (args.Length == 4 && args[1] == "to")
                {
                    GameClient clientc;
                    clientc = WorldMgr.GetClientByPlayerName(args[2], false, true);
                    if (clientc == null)
                    {
                        int realm = 0;
                        int.TryParse(args[3], out realm);

                        GameNPC[] npcs = WorldMgr.GetNPCsByName(args[2], (eRealm)realm);

                        if (npcs.Length > 0)
                        {
                            // for multiple npc's first try to jump to the npc in the players current region
                            GameNPC jumpTarget = npcs[0];

                            foreach (GameNPC npc in npcs)
                            {
                                if (npc.CurrentRegionID == client.Player.CurrentRegionID)
                                {
                                    jumpTarget = npc;
                                    break;
                                }
                            }

                            client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Jump.JumpToX", npcs[0].CurrentRegion.Description), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                            client.Player.MoveTo(jumpTarget.CurrentRegionID, jumpTarget.X, jumpTarget.Y, jumpTarget.Z, jumpTarget.Heading);
                            return;
                        }

                        client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Jump.CannotBeFoundInRealm", args[2], realm), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                        return;
                    }
                    if (CheckExpansion(client, clientc, clientc.Player.CurrentRegionID))
                    {
                        if (clientc.Player.InHouse)
                        {
                            client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Jump.CannotJumpToInsideHouse"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                            return;
                        }
                        client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Jump.JumpToX", clientc.Player.CurrentRegion.Description), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                        if (clientc.Player.CurrentHouse != null && clientc.Player.InHouse)
                        {
                            clientc.Player.CurrentHouse.Enter(client.Player);
                        }
                        else
                        {
                            client.Player.MoveTo(clientc.Player.CurrentRegionID, clientc.Player.X, clientc.Player.Y, clientc.Player.Z, client.Player.Heading);
                        }
                        return;
                    }
                    return;
                }
                #endregion Jump to Name Realm
                #region Jump to X Y Z
                else if (args.Length == 5 && args[1] == "to")
                {
                    client.Player.MoveTo(client.Player.CurrentRegionID, Convert.ToInt32(args[2]), Convert.ToInt32(args[3]), Convert.ToInt32(args[4]), client.Player.Heading);
                    return;
                }
                #endregion Jump to X Y Z
                #region Jump rel +/-X +/-Y +/-Z
                else if (args.Length == 5 && args[1] == "rel")
                {
                    client.Player.MoveTo(client.Player.CurrentRegionID,
                                         client.Player.X + Convert.ToInt32(args[2]),
                                         client.Player.Y + Convert.ToInt32(args[3]),
                                         client.Player.Z + Convert.ToInt32(args[4]),
                                         client.Player.Heading);
                    return;
                }
                #endregion Jump rel +/-X +/-Y +/-Z
                #region Jump to X Y Z RegionID
                else if (args.Length == 6 && args[1] == "to")
                {
                    if (CheckExpansion(client, client, (ushort)Convert.ToUInt16(args[5])))
                    {
                        client.Player.MoveTo(Convert.ToUInt16(args[5]), Convert.ToInt32(args[2]), Convert.ToInt32(args[3]), Convert.ToInt32(args[4]), client.Player.Heading);
                        return;
                    }
                    return;
                }
                #endregion Jump to X Y Z RegionID
                #region Jump PlayerName to X Y Z
                else if (args.Length == 6 && args[2] == "to")
                {
                    GameClient clientc;
                    clientc = WorldMgr.GetClientByPlayerName(args[1], false, true);
                    if (clientc == null)
                    {
                        client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Jump.PlayerIsNotInGame", args[1]), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                        return;
                    }
                    clientc.Player.MoveTo(clientc.Player.CurrentRegionID, Convert.ToInt32(args[3]), Convert.ToInt32(args[4]), Convert.ToInt32(args[5]), clientc.Player.Heading);
                    return;
                }
                #endregion Jump PlayerName to X Y Z
                #region Jump PlayerName to X Y Z RegionID
                else if (args.Length == 7 && args[2] == "to")
                {
                    GameClient clientc;
                    clientc = WorldMgr.GetClientByPlayerName(args[1], false, true);
                    if (clientc == null)
                    {
                        client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Jump.PlayerIsNotInGame", args[1]), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                        return;
                    }
                    if (CheckExpansion(clientc, clientc, (ushort)Convert.ToUInt16(args[6])))
                    {
                        clientc.Player.MoveTo(Convert.ToUInt16(args[6]), Convert.ToInt32(args[3]), Convert.ToInt32(args[4]), Convert.ToInt32(args[5]), clientc.Player.Heading);
                        return;
                    }
                    return;
                }
                #endregion Jump PlayerName to X Y Z RegionID
                #region Jump PlayerName to PlayerCible
                else if (args.Length == 4 && args[2] == "to")
                {
                    GameClient clientc;
                    GameClient clientto;
                    clientc = WorldMgr.GetClientByPlayerName(args[1], false, true);
                    if (clientc == null)
                    {
                        client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Jump.PlayerIsNotInGame", args[1]), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                        return;
                    }
                    if (args[3] == "me")
                    {
                        clientto = client;
                    }
                    else
                    {
                        clientto = WorldMgr.GetClientByPlayerName(args[3], false, false);
                    }

                    if (clientto == null)
                    {
                        client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Jump.PlayerIsNotInGame", args[3]), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                        return;
                    }
                    else
                    {
                        if (CheckExpansion(clientto, clientc, clientto.Player.CurrentRegionID))
                        {
                            if (clientto.Player.CurrentHouse != null && clientto.Player.InHouse)
                            {
                                clientto.Player.CurrentHouse.Enter(clientc.Player);
                            }
                            else
                            {
                                clientc.Player.MoveTo(clientto.Player.CurrentRegionID, clientto.Player.X, clientto.Player.Y, clientto.Player.Z, client.Player.Heading);
                            }
                            return;
                        }
                        return;
                    }
                }
                #endregion Jump PlayerName to PlayerCible
                #region push/pop
                else if (args.Length > 1 && args[1] == "push")
                {
                    Stack <GameLocation> locations;

                    locations = client.Player.TempProperties.getProperty <object>(TEMP_KEY_JUMP, null) as Stack <GameLocation>;

                    if (locations == null)
                    {
                        locations = new Stack <GameLocation>(3);
                        client.Player.TempProperties.setProperty(TEMP_KEY_JUMP, locations);
                    }

                    locations.Push(new GameLocation("temploc", client.Player.CurrentRegionID, client.Player.X, client.Player.Y, client.Player.Z, client.Player.Heading));

                    string message = LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Jump.Pushed");

                    if (locations.Count > 1)
                    {
                        message += " " + LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Jump.PushedTotal", locations.Count);
                    }

                    message += " - " + LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Jump.PopInstructions");

                    client.Out.SendMessage(message, eChatType.CT_System, eChatLoc.CL_SystemWindow);
                }
                else if (args.Length > 1 && args[1] == "pop")
                {
                    Stack <GameLocation> locations;

                    locations = client.Player.TempProperties.getProperty <object>(TEMP_KEY_JUMP, null) as Stack <GameLocation>;

                    if (locations == null || locations.Count < 1)
                    {
                        client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Jump.NothingPushed"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                        return;
                    }

                    GameLocation jumploc = locations.Pop();

                    // slight abuse of the stack principle, but convenient to always have your last popped loc jumpable
                    if (locations.Count < 1)
                    {
                        locations.Push(jumploc);
                    }

                    client.Player.MoveTo(jumploc.RegionID, jumploc.X, jumploc.Y, jumploc.Z, jumploc.Heading);
                }
                #endregion push/pop
                #region DisplaySyntax
                else
                {
                    DisplaySyntax(client);
                    return;
                }
                #endregion DisplaySyntax
            }

            catch (Exception ex)
            {
                DisplayMessage(client, ex.Message);
            }
        }
Esempio n. 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 defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Cemmeth Budgwold", eRealm.Albion);

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

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 49);                    //Slot 22
                template.AddNPCEquipment(eInventorySlot.HeadArmor, 93);                     //Slot 21
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 50);                     //Slot 23
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 46);                    //Slot 25
                template.AddNPCEquipment(eInventorySlot.Cloak, 91);                         //Slot 26
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 47);                     //Slot 27
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 48);                     //Slot 28
                template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 68);                 //Slot 12
                CemmethBudgwold.Inventory = template.CloseTemplate();
                CemmethBudgwold.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                CemmethBudgwold.Size    = 50;
                CemmethBudgwold.Level   = 38;
                CemmethBudgwold.X       = 560528;
                CemmethBudgwold.Y       = 513140;
                CemmethBudgwold.Z       = 2394;
                CemmethBudgwold.Heading = 2275;

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

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

            #endregion

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

            GameEventMgr.AddHandler(CemmethBudgwold, GameLivingEvent.Interact, new DOLEventHandler(TalkToCemmethBudgwold));
            GameEventMgr.AddHandler(CemmethBudgwold, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToCemmethBudgwold));

            CemmethBudgwold.AddQuestToGive(typeof(CemmethsOrders));

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