Exemplo n.º 1
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }

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

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

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

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

                godelevaDowden.GuildName       = "Part of " + questTitle + " Quest";
                godelevaDowden.Realm           = eRealm.Albion;
                godelevaDowden.CurrentRegionID = 1;

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

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

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

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

            // item db check
            woodenBucket = GameServer.Database.FindObjectByKey <ItemTemplate>("wooden_bucket");
            if (woodenBucket == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Wooden Bucket, creating it ...");
                }

                woodenBucket        = new ItemTemplate();
                woodenBucket.Name   = "Wooden Bucket";
                woodenBucket.Level  = 1;
                woodenBucket.Weight = 10;
                woodenBucket.Model  = 1610;

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

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

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

            // item db check
            fullWoodenBucket = GameServer.Database.FindObjectByKey <ItemTemplate>("full_wooden_bucket");
            if (fullWoodenBucket == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Full Wooden Bucket, creating it ...");
                }

                fullWoodenBucket        = new ItemTemplate();
                fullWoodenBucket.Name   = "Full Wooden Bucket";
                fullWoodenBucket.Level  = 1;
                fullWoodenBucket.Weight = 250;
                fullWoodenBucket.Model  = 1610;

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

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

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

            // item db check
            reedBracer = GameServer.Database.FindObjectByKey <ItemTemplate>("reed_bracer");
            if (reedBracer == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Reed Bracer of Health creating it ...");
                }

                reedBracer        = new ItemTemplate();
                reedBracer.Name   = "Reed Bracer";
                reedBracer.Level  = 3;
                reedBracer.Weight = 1;
                reedBracer.Model  = 598;

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

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

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

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

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

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

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

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

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

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

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Exemplo 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.GetObjectsByName <GameNPC>("Inaksha", eRealm.Midgard);

            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Inaksha , creating it ...");
                }

                Inaksha                 = new GameNPC();
                Inaksha.Model           = 193;
                Inaksha.Name            = "Inaksha";
                Inaksha.GuildName       = string.Empty;
                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();
                }
            }
            else
            {
                Inaksha = npcs[0];
            }

            // end npc
            npcs = WorldMgr.GetObjectsByName <GameNPC>("Loken", eRealm.None);

            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Loken , creating it ...");
                }

                Loken                 = new GameNPC();
                Loken.Model           = 212;
                Loken.Name            = "Loken";
                Loken.GuildName       = string.Empty;
                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();
                }
            }
            else
            {
                Loken = npcs[0];
            }

            // end npc
            npcs = WorldMgr.GetObjectsByName <GameNPC>("Miri", eRealm.Midgard);

            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Miri , creating it ...");
                }

                Miri                 = new GameNPC();
                Miri.Model           = 220;
                Miri.Name            = "Miri";
                Miri.GuildName       = string.Empty;
                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();
                }
            }
            else
            {
                Miri = npcs[0];
            }

            // end npc

            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

            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");
            }
        }
Exemplo n.º 3
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }

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

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

            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>("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.GetObjectsByName <GameNPC>("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();
            }

            /* 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");
            }
        }
Exemplo n.º 4
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;

            npcs = WorldMgr.GetObjectsByName <GameNPC>("Mistress Laws", (eRealm)1);
            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(51).IsDisabled)
                {
                    MistressLaws       = new DOL.GS.GameNPC();
                    MistressLaws.Model = 68;
                    MistressLaws.Name  = "Mistress Laws";
                    if (log.IsWarnEnabled)
                    {
                        log.Warn("Could not find " + MistressLaws.Name + ", creating ...");
                    }

                    MistressLaws.GuildName       = "Part of " + questTitle + " Quest";
                    MistressLaws.Realm           = eRealm.Albion;
                    MistressLaws.CurrentRegionID = 51;
                    MistressLaws.Size            = 52;
                    MistressLaws.Level           = 40;
                    MistressLaws.MaxSpeedBase    = 191;
                    MistressLaws.Faction         = FactionMgr.GetFactionByID(0);
                    MistressLaws.X               = 536859;
                    MistressLaws.Y               = 548403;
                    MistressLaws.Z               = 4800;
                    MistressLaws.Heading         = 1035;
                    MistressLaws.RespawnInterval = -1;
                    MistressLaws.BodyType        = 0;

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

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

            npcs = WorldMgr.GetObjectsByName <GameNPC>("Ylaine Barrett", (eRealm)1);
            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(51).IsDisabled)
                {
                    YlaineBarrett       = new DOL.GS.GameMerchant();
                    YlaineBarrett.Model = 87;
                    YlaineBarrett.Name  = "Ylaine Barrett";
                    if (log.IsWarnEnabled)
                    {
                        log.Warn("Could not find " + YlaineBarrett.Name + ", creating ...");
                    }

                    YlaineBarrett.GuildName       = "Part of " + questTitle + " Quest";
                    YlaineBarrett.Realm           = eRealm.Albion;
                    YlaineBarrett.CurrentRegionID = 51;
                    YlaineBarrett.Size            = 50;
                    YlaineBarrett.Level           = 40;
                    YlaineBarrett.MaxSpeedBase    = 191;
                    YlaineBarrett.Faction         = FactionMgr.GetFactionByID(0);
                    YlaineBarrett.X               = 522790;
                    YlaineBarrett.Y               = 542142;
                    YlaineBarrett.Z               = 3230;
                    YlaineBarrett.Heading         = 1661;
                    YlaineBarrett.RespawnInterval = -1;
                    YlaineBarrett.BodyType        = 0;

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

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

            slimyswampgooskin = GameServer.Database.FindObjectByKey <ItemTemplate>("slimyswampgooskin");
            if (slimyswampgooskin == null)
            {
                slimyswampgooskin      = new ItemTemplate();
                slimyswampgooskin.Name = "Slimy Swamp Goo Skin";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + slimyswampgooskin.Name + ", creating it ...");
                }

                slimyswampgooskin.Level            = 1;
                slimyswampgooskin.Weight           = 1;
                slimyswampgooskin.Model            = 100;
                slimyswampgooskin.Object_Type      = 0;
                slimyswampgooskin.Item_Type        = -1;
                slimyswampgooskin.Id_nb            = "slimyswampgooskin";
                slimyswampgooskin.Hand             = 0;
                slimyswampgooskin.Price            = 0;
                slimyswampgooskin.IsPickable       = true;
                slimyswampgooskin.IsDropable       = true;
                slimyswampgooskin.IsTradable       = true;
                slimyswampgooskin.CanDropAsLoot    = false;
                slimyswampgooskin.Color            = 0;
                slimyswampgooskin.Bonus            = 0; // default bonus
                slimyswampgooskin.Bonus1           = 0;
                slimyswampgooskin.Bonus1Type       = (int)0;
                slimyswampgooskin.Bonus2           = 0;
                slimyswampgooskin.Bonus2Type       = (int)0;
                slimyswampgooskin.Bonus3           = 0;
                slimyswampgooskin.Bonus3Type       = (int)0;
                slimyswampgooskin.Bonus4           = 0;
                slimyswampgooskin.Bonus4Type       = (int)0;
                slimyswampgooskin.Bonus5           = 0;
                slimyswampgooskin.Bonus5Type       = (int)0;
                slimyswampgooskin.Bonus6           = 0;
                slimyswampgooskin.Bonus6Type       = (int)0;
                slimyswampgooskin.Bonus7           = 0;
                slimyswampgooskin.Bonus7Type       = (int)0;
                slimyswampgooskin.Bonus8           = 0;
                slimyswampgooskin.Bonus8Type       = (int)0;
                slimyswampgooskin.Bonus9           = 0;
                slimyswampgooskin.Bonus9Type       = (int)0;
                slimyswampgooskin.Bonus10          = 0;
                slimyswampgooskin.Bonus10Type      = (int)0;
                slimyswampgooskin.ExtraBonus       = 0;
                slimyswampgooskin.ExtraBonusType   = (int)0;
                slimyswampgooskin.Effect           = 0;
                slimyswampgooskin.Emblem           = 0;
                slimyswampgooskin.Charges          = 0;
                slimyswampgooskin.MaxCharges       = 0;
                slimyswampgooskin.SpellID          = 0;
                slimyswampgooskin.ProcSpellID      = 0;
                slimyswampgooskin.Type_Damage      = 0;
                slimyswampgooskin.Realm            = 0;
                slimyswampgooskin.MaxCount         = 1;
                slimyswampgooskin.PackSize         = 1;
                slimyswampgooskin.Extension        = 0;
                slimyswampgooskin.Quality          = 100;
                slimyswampgooskin.Condition        = 100;
                slimyswampgooskin.MaxCondition     = 100;
                slimyswampgooskin.Durability       = 100;
                slimyswampgooskin.MaxDurability    = 100;
                slimyswampgooskin.PoisonCharges    = 0;
                slimyswampgooskin.PoisonMaxCharges = 0;
                slimyswampgooskin.PoisonSpellID    = 0;
                slimyswampgooskin.ProcSpellID1     = 0;
                slimyswampgooskin.SpellID1         = 0;
                slimyswampgooskin.MaxCharges1      = 0;
                slimyswampgooskin.Charges1         = 0;

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

            QuestBuilder   builder = QuestMgr.GetBuilder(typeof(Cellarinfestation));
            QuestBehaviour a;

            a = builder.CreateBehaviour(MistressLaws, -1);
            a.AddTrigger(eTriggerType.Interact, null, MistressLaws);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Albion.Cellarinfestation), MistressLaws);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Albion.Cellarinfestation), null, (eComparator)5);
            a.AddAction(eActionType.Talk, "You have barely begun training; yet already there is a need for you to lend your strength for the protection of this town. I know some of the locals are suspicious of the Inconnu, well, that is not to be helped. They are a mysterious people, and their sudden appearance one stormy night, well, that causes a large amount of [suspicion], as you can imagine, They are here to help us, I do believe that, and so must you. But some of the locals, they are not so sure.", MistressLaws);
            AddBehaviour(a);
            a = builder.CreateBehaviour(MistressLaws, -1);
            a.AddTrigger(eTriggerType.Whisper, "suspicion", MistressLaws);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Albion.Cellarinfestation), MistressLaws);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Albion.Cellarinfestation), null, (eComparator)5);
            a.AddAction(eActionType.Talk, "They have seen the Drakoran ruin their lands, they have witnessed Morgana's terrible magic first hand, so they cannot be expected to trust these new, powerful allies. I expect you to treat the Inconnu as allies, and to try and avoid the idle gossip of the local townsfolk. Saying that, I must send you to one of the loudest of the rabble. Ylaine Barrett. The food cellar has been swarming with swamp goo, and she wants someone to go out and clear the immediate area of swamp goo. Don't worry, I don't expect you to kill them all, just do what you can.", MistressLaws);
            a.AddAction(eActionType.OfferQuest, typeof(DOL.GS.Quests.Albion.Cellarinfestation), "Will you aid Ylaine Barrett in her attempt to rid the cellars of swamp goo?");
            AddBehaviour(a);
            a = builder.CreateBehaviour(MistressLaws, -1);
            a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(DOL.GS.Quests.Albion.Cellarinfestation));
            a.AddAction(eActionType.Talk, "No problem. See you.", MistressLaws);
            AddBehaviour(a);
            a = builder.CreateBehaviour(MistressLaws, -1);
            a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(DOL.GS.Quests.Albion.Cellarinfestation));
            a.AddAction(eActionType.Talk, "Right, I expected you would do so. Now, go talk to Ylaine Barrett.", MistressLaws);
            a.AddAction(eActionType.GiveQuest, typeof(DOL.GS.Quests.Albion.Cellarinfestation), MistressLaws);
            AddBehaviour(a);
            a = builder.CreateBehaviour(YlaineBarrett, -1);
            a.AddTrigger(eTriggerType.Interact, null, YlaineBarrett);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Albion.Cellarinfestation), 1, (eComparator)3);
            a.AddAction(eActionType.Talk, "Ah. G'day. And who might you be?", YlaineBarrett);
            a.AddAction(eActionType.Message, "Tell Ylaine Barrett your name.", (eTextType)2);
            a.AddAction(eActionType.Talk, "I see, you're a fighter. Has Mistress Laws, Master Reginald, or Delore sent you here to help me out? Why don't they just send you out after the goo? That's all I really want. You know, I don't remember that there were that many of these strange creatures crawling around the village [before].", YlaineBarrett);
            AddBehaviour(a);
            a = builder.CreateBehaviour(YlaineBarrett, -1);
            a.AddTrigger(eTriggerType.Whisper, "before", YlaineBarrett);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Albion.Cellarinfestation), 1, (eComparator)3);
            a.AddAction(eActionType.Talk, "Yes, well, before, well, before they came. Don't you remember? That night? All day long, everything's fine. Set itself uop for a fine next day, as well! The night, it was clear. Not a sign of a storm in sight! Why, no one prepared for it! Then, in the darkest part, suddenly, the storm starts! We were woken from the noise of it! It was awful, but we didn't dare go outside! Some of the men, they did, but they came back pale as a corpse! Were shaken to their core! And some of these being the fightin' men! Best of the town! Aye, but the [swamp goo].", YlaineBarrett);
            AddBehaviour(a);
            a = builder.CreateBehaviour(YlaineBarrett, -1);
            a.AddTrigger(eTriggerType.Whisper, "swamp goo", YlaineBarrett);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Albion.Cellarinfestation), 1, (eComparator)3);
            a.AddAction(eActionType.Talk, "They've gotten into the food cellar! The slimy things were creeping all over that place! I've gotten rid of most of the swamp goo, but I know there's more just outside town working their way to my food stores. I think you could do a small favor for us all and get rid of some. Oh and while you are at it, the skin of the swamp goo, I've some uses for it. I'll pay you for a swamp goo skin. Just go and get me one of their skins, and I'll be satisfied with ya.", YlaineBarrett);
            a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Albion.Cellarinfestation), null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(MistressLaws, -1);
            a.AddTrigger(eTriggerType.EnemyKilled, "swamp goo", null);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Albion.Cellarinfestation), 2, (eComparator)3);
            a.AddAction(eActionType.GiveItem, slimyswampgooskin, null);
            a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Albion.Cellarinfestation), null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(YlaineBarrett, -1);
            a.AddTrigger(eTriggerType.Interact, null, YlaineBarrett);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Albion.Cellarinfestation), 3, (eComparator)3);
            a.AddAction(eActionType.Talk, "Oh, you're back! Did you see how many there were? They are a nuisance, aren't they! Well, have you got me the skin?", YlaineBarrett);
            AddBehaviour(a);
            a = builder.CreateBehaviour(YlaineBarrett, -1);
            a.AddTrigger(eTriggerType.GiveItem, YlaineBarrett, slimyswampgooskin);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Albion.Cellarinfestation), 3, (eComparator)3);
            a.AddAction(eActionType.Talk, "Ah, a good and slimy one! It's odd, these creatures, they've got some strangeness about them, but they've got their uses, as well. Thank you, then. Here, I promised I'd pay ya, and I will!", YlaineBarrett);
            a.AddAction(eActionType.GiveGold, 330, null);
            a.AddAction(eActionType.GiveXP, 11, null);
            a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Albion.Cellarinfestation), null);
            AddBehaviour(a);

            // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End
            if (MistressLaws != null)
            {
                MistressLaws.AddQuestToGive(typeof(Cellarinfestation));
            }

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

            npcs = WorldMgr.GetObjectsByName <GameNPC>("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.GetObjectsByName <GameNPC>("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];
            }

            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);
                }
            }

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

            // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End
            if (Audun != null)
            {
                Audun.AddQuestToGive(typeof(meadrun));
            }

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

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

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

            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>("Steward Willie", 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)
            {
                stewardWillie       = new GameNPC();
                stewardWillie.Model = 27;
                stewardWillie.Name  = "Steward Willie";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + stewardWillie.Name + ", creating him ...");
                }

                stewardWillie.GuildName       = "Part of " + questTitle;
                stewardWillie.Realm           = eRealm.Albion;
                stewardWillie.CurrentRegionID = 1;
                stewardWillie.Size            = 52;
                stewardWillie.Level           = 35;
                stewardWillie.X       = 503547;
                stewardWillie.Y       = 474330;
                stewardWillie.Z       = 2788;
                stewardWillie.Heading = 3163;

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

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

            /* Now we do the same for the Lynnet.
             */
            npcs = WorldMgr.GetObjectsByName <GameNPC>("Seamstress Lynnet", eRealm.Albion);
            if (npcs.Length == 0)
            {
                lynnet       = new GameNPC();
                lynnet.Model = 5;
                lynnet.Name  = "Seamstress Lynnet";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + lynnet.Name + ", creating ...");
                }

                lynnet.GuildName       = "Part of " + questTitle;
                lynnet.Realm           = eRealm.Albion; // Needs to be none, else we can't kill him ;-)
                lynnet.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 58, 30);
                lynnet.Inventory = template.CloseTemplate();

// lynnet.AddNPCEquipment((byte) eEquipmentItems.TORSO, 58, 30, 0, 0);
                lynnet.Size    = 48;
                lynnet.Level   = 15;
                lynnet.X       = 530112;
                lynnet.Y       = 478662;
                lynnet.Z       = 2200;
                lynnet.Heading = 3203;

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

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

            npcs = WorldMgr.GetObjectsByName <GameNPC>("Brother Don", eRealm.Albion);
            if (npcs.Length == 0)
            {
                don       = new GameNPC();
                don.Model = 34;
                don.Name  = "Brother Don";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + don.Name + ", creating ...");
                }

                don.GuildName       = "Part of " + questTitle;
                don.Realm           = eRealm.Albion; // Needs to be none, else we can't kill him ;-)
                don.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 58, 44);
                don.Inventory = template.CloseTemplate();

// don.AddNPCEquipment((byte) eEquipmentItems.TORSO, 58, 44, 0, 0);
                don.Size    = 48;
                don.Level   = 15;
                don.X       = 505411;
                don.Y       = 495024;
                don.Z       = 2495;
                don.Heading = 2048;

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

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

            wolfPeltCloak = GameServer.Database.FindObjectByKey <ItemTemplate>("wolf_pelt_cloak");
            if (wolfPeltCloak == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Wolf Pelt Cloak, creating it ...");
                }

                wolfPeltCloak            = new ItemTemplate();
                wolfPeltCloak.Name       = "Wolf Pelt Cloak";
                wolfPeltCloak.Level      = 3;
                wolfPeltCloak.Weight     = 3;
                wolfPeltCloak.Model      = 326;
                wolfPeltCloak.Bonus      = 1;
                wolfPeltCloak.Bonus1     = 1;
                wolfPeltCloak.Bonus1Type = (int)eStat.QUI;
                ;

                wolfPeltCloak.Bonus2     = -1;
                wolfPeltCloak.Bonus2Type = (int)eStat.CHR;

                wolfPeltCloak.Object_Type   = (int)eObjectType.Magical;
                wolfPeltCloak.Item_Type     = (int)eEquipmentItems.CLOAK;
                wolfPeltCloak.Id_nb         = "wolf_pelt_cloak";
                wolfPeltCloak.Price         = Money.GetMoney(0, 0, 0, 4, 3);
                wolfPeltCloak.IsPickable    = true;
                wolfPeltCloak.IsDropable    = true;
                wolfPeltCloak.Color         = 44;
                wolfPeltCloak.Quality       = 100;
                wolfPeltCloak.Condition     = 1000;
                wolfPeltCloak.MaxCondition  = 1000;
                wolfPeltCloak.Durability    = 1000;
                wolfPeltCloak.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(wolfPeltCloak);
            }

            wolfFur = GameServer.Database.FindObjectByKey <ItemTemplate>("wolf_fur");
            if (wolfFur == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Wolf Fur, creating it ...");
                }

                wolfFur             = new ItemTemplate();
                wolfFur.Object_Type = 0;
                wolfFur.Id_nb       = "wolf_fur";
                wolfFur.Name        = "Wolf Fur";
                wolfFur.Level       = 1;
                wolfFur.Model       = 57;
                wolfFur.IsDropable  = false;
                wolfFur.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(wolfFur);
            }

            wolfHeadToken = GameServer.Database.FindObjectByKey <ItemTemplate>("wolf_head_token");
            if (wolfHeadToken == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Wolf Head Token, creating it ...");
                }

                wolfHeadToken             = new ItemTemplate();
                wolfHeadToken.Object_Type = 0;
                wolfHeadToken.Id_nb       = "wolf_head_token";
                wolfHeadToken.Name        = "Wolf Head Token";
                wolfHeadToken.Level       = 1;
                wolfHeadToken.Model       = 1366;
                wolfHeadToken.IsDropable  = false;
                wolfHeadToken.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(wolfHeadToken);
            }

            /* 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(stewardWillie, GameLivingEvent.Interact, new DOLEventHandler(TalkToStewardWillie));
            GameEventMgr.AddHandler(stewardWillie, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToStewardWillie));

            GameEventMgr.AddHandler(don, GameLivingEvent.Interact, new DOLEventHandler(TalkToBrotherDon));
            GameEventMgr.AddHandler(don, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToBrotherDon));

            GameEventMgr.AddHandler(lynnet, GameLivingEvent.Interact, new DOLEventHandler(TalkToSeamstressLynnet));

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

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

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

            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Alb.WhenBloodSpeaks.ScriptLoaded.Text1"), eRealm.Albion);

            if (npcs.Length == 0)
            {
                MasterKless       = new GameNPC();
                MasterKless.Model = 64;
                MasterKless.Name  = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Alb.WhenBloodSpeaks.ScriptLoaded.Text1");
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + MasterKless.Name + ", creating him ...");
                }

                // k109: My preference, no guildname for quest NPCs.  Uncomment if you like that...
                // MasterKless.GuildName = "Part of " + questTitle + " Quest";
                MasterKless.Realm           = eRealm.Albion;
                MasterKless.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 1005);    // Slot 25
                template.AddNPCEquipment(eInventorySlot.Cloak, 96);           // Slot 26
                template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 1166); // Slot 12
                MasterKless.Inventory = template.CloseTemplate();
                MasterKless.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                MasterKless.Size    = 51;
                MasterKless.Level   = 50;
                MasterKless.X       = 559370;
                MasterKless.Y       = 513587;
                MasterKless.Z       = 2428;
                MasterKless.Heading = 2685;

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

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

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

            GameEventMgr.AddHandler(MasterKless, GameLivingEvent.Interact, new DOLEventHandler(TalkToMasterKless));
            GameEventMgr.AddHandler(MasterKless, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMasterKless));

            MasterKless.AddQuestToGive(typeof(WhenBloodSpeaks));

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

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

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

            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>("Andrew Wyatt", 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)
            {
                andrewWyatt       = new GameNPC();
                andrewWyatt.Model = 80;
                andrewWyatt.Name  = "Andrew Wyatt";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + andrewWyatt.Name + ", creating him ...");
                }

                andrewWyatt.GuildName       = "Part of " + questTitle + " Quest";
                andrewWyatt.Realm           = eRealm.Albion;
                andrewWyatt.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 80);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 54);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 51);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 52);
                andrewWyatt.Inventory = template.CloseTemplate();
                andrewWyatt.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                andrewWyatt.Size    = 48;
                andrewWyatt.Level   = 30;
                andrewWyatt.X       = 559590;
                andrewWyatt.Y       = 511039;
                andrewWyatt.Z       = 2488;
                andrewWyatt.Heading = 1524;

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

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

            npcs = WorldMgr.GetObjectsByName <GameNPC>("Geor Nadren", eRealm.Albion);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Geor Nadren, creating him ...");
                }

                georNadren                 = new GameNPC();
                georNadren.Model           = 9;
                georNadren.Name            = "Geor Nadren";
                georNadren.GuildName       = "Part of " + questTitle + " Quest";
                georNadren.Realm           = eRealm.Albion;
                georNadren.CurrentRegionID = 10;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 39);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 40);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 36);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 37);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 38);
                georNadren.Inventory = template.CloseTemplate();
                georNadren.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                georNadren.Size    = 51;
                georNadren.Level   = 8;
                georNadren.X       = 37355;
                georNadren.Y       = 30943;
                georNadren.Z       = 8002;
                georNadren.Heading = 3231;

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

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

            npcs = WorldMgr.GetObjectsByName <GameNPC>("Ver Nuren", eRealm.Albion);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Ver Nuren, creating him ...");
                }

                verNuren                 = new GameNPC();
                verNuren.Model           = 9;
                verNuren.Name            = "Ver Nuren";
                verNuren.GuildName       = "Part of " + questTitle + " Quest";
                verNuren.Realm           = eRealm.Albion;
                verNuren.CurrentRegionID = 10;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.LeftHandWeapon, 61);
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 39);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 40);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 36);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 37);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 38);
                verNuren.Inventory = template.CloseTemplate();
                verNuren.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                verNuren.Size    = 51;
                verNuren.Level   = 8;
                verNuren.X       = 36799;
                verNuren.Y       = 30786;
                verNuren.Z       = 8010;
                verNuren.Heading = 625;

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

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

            // item db check
            bundleOfBearSkins = GameServer.Database.FindObjectByKey <ItemTemplate>("bundle_of_bear_skins");
            if (bundleOfBearSkins == null)
            {
                bundleOfBearSkins      = new ItemTemplate();
                bundleOfBearSkins.Name = "Bundle of Bear Skins";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + bundleOfBearSkins.Name + ", creating it ...");
                }

                bundleOfBearSkins.Level  = 0;
                bundleOfBearSkins.Weight = 0;
                bundleOfBearSkins.Model  = 100;

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

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

            // item db check
            spoolOfLeatherworkingThread = GameServer.Database.FindObjectByKey <ItemTemplate>("spool_of_leatherworking_thread");
            if (spoolOfLeatherworkingThread == null)
            {
                spoolOfLeatherworkingThread      = new ItemTemplate();
                spoolOfLeatherworkingThread.Name = "Spool of Leatherworking Thread";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + spoolOfLeatherworkingThread.Name + ", creating it ...");
                }

                spoolOfLeatherworkingThread.Level  = 0;
                spoolOfLeatherworkingThread.Weight = 0;
                spoolOfLeatherworkingThread.Model  = 537;

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

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

            // item db check
            chokerOfTheBear = GameServer.Database.FindObjectByKey <ItemTemplate>("choker_of_the_bear");
            if (chokerOfTheBear == null)
            {
                chokerOfTheBear      = new ItemTemplate();
                chokerOfTheBear.Name = "Choker of the Bear";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + chokerOfTheBear.Name + ", creating it ...");
                }

                chokerOfTheBear.Level  = 5;
                chokerOfTheBear.Weight = 6;
                chokerOfTheBear.Model  = 101;

                chokerOfTheBear.Object_Type = (int)eObjectType.Magical;
                chokerOfTheBear.Item_Type   = (int)eEquipmentItems.NECK;
                chokerOfTheBear.Id_nb       = "choker_of_the_bear";

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

                chokerOfTheBear.Bonus      = 1;
                chokerOfTheBear.Bonus1Type = (int)eProperty.Strength;
                chokerOfTheBear.Bonus1     = 4;
                chokerOfTheBear.Bonus2Type = (int)eProperty.Resist_Thrust;
                chokerOfTheBear.Bonus2     = 1;

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

            /* 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(andrewWyatt, GameLivingEvent.Interact, new DOLEventHandler(TalkToAndrewWyatt));
            GameEventMgr.AddHandler(andrewWyatt, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToAndrewWyatt));

            GameEventMgr.AddHandler(georNadren, GameObjectEvent.Interact, new DOLEventHandler(TalkToGeorNadren));
            GameEventMgr.AddHandler(georNadren, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToGeorNadren));

            GameEventMgr.AddHandler(verNuren, GameObjectEvent.Interact, new DOLEventHandler(TalkToVerNuren));
            GameEventMgr.AddHandler(verNuren, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToVerNuren));

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

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

            npcs = WorldMgr.GetObjectsByName <GameNPC>(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.NPCBarkeepNognar"), (eRealm)2);

            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(100).IsDisabled)
                {
                    BarkeepNognar       = new DOL.GS.GameMerchant();
                    BarkeepNognar.Model = 212;
                    BarkeepNognar.Name  = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.NPCBarkeepNognar");
                    if (log.IsWarnEnabled)
                    {
                        log.Warn("Could not find " + BarkeepNognar.Name + ", creating ...");
                    }

                    BarkeepNognar.GuildName       = "Part of " + questTitle + " Quest";
                    BarkeepNognar.Realm           = eRealm.Midgard;
                    BarkeepNognar.CurrentRegionID = 100;
                    BarkeepNognar.Size            = 58;
                    BarkeepNognar.Level           = 15;
                    BarkeepNognar.MaxSpeedBase    = 191;
                    BarkeepNognar.Faction         = FactionMgr.GetFactionByID(0);
                    BarkeepNognar.X               = 805429;
                    BarkeepNognar.Y               = 726478;
                    BarkeepNognar.Z               = 4717;
                    BarkeepNognar.Heading         = 4073;
                    BarkeepNognar.RespawnInterval = -1;
                    BarkeepNognar.BodyType        = 0;

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

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

            npcs = WorldMgr.GetObjectsByName <GameNPC>(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.NPCBarkeepPrugar"), (eRealm)2);

            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(101).IsDisabled)
                {
                    BarkeepPrugar       = new DOL.GS.GameMerchant();
                    BarkeepPrugar.Model = 213;
                    BarkeepPrugar.Name  = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.NPCBarkeepPrugar");
                    if (log.IsWarnEnabled)
                    {
                        log.Warn("Could not find " + BarkeepPrugar.Name + ", creating ...");
                    }

                    BarkeepPrugar.GuildName       = "Part of " + questTitle + " Quest";
                    BarkeepPrugar.Realm           = eRealm.Midgard;
                    BarkeepPrugar.CurrentRegionID = 101;
                    BarkeepPrugar.Size            = 60;
                    BarkeepPrugar.Level           = 15;
                    BarkeepPrugar.MaxSpeedBase    = 191;
                    BarkeepPrugar.Faction         = FactionMgr.GetFactionByID(0);
                    BarkeepPrugar.X               = 33230;
                    BarkeepPrugar.Y               = 34802;
                    BarkeepPrugar.Z               = 8027;
                    BarkeepPrugar.Heading         = 1194;
                    BarkeepPrugar.RespawnInterval = -1;
                    BarkeepPrugar.BodyType        = 0;

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

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

            rattlingskeletonpendant = GameServer.Database.FindObjectByKey <ItemTemplate>("rattlingskeletonpendant");
            if (rattlingskeletonpendant == null)
            {
                rattlingskeletonpendant      = new ItemTemplate();
                rattlingskeletonpendant.Name = "Rattling Skeleton Pendant";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + rattlingskeletonpendant.Name + ", creating it ...");
                }

                rattlingskeletonpendant.Level            = 50;
                rattlingskeletonpendant.Weight           = 5;
                rattlingskeletonpendant.Model            = 101;
                rattlingskeletonpendant.Object_Type      = 0;
                rattlingskeletonpendant.Item_Type        = 40;
                rattlingskeletonpendant.Id_nb            = "rattlingskeletonpendant";
                rattlingskeletonpendant.Hand             = 0;
                rattlingskeletonpendant.Price            = 0;
                rattlingskeletonpendant.IsPickable       = true;
                rattlingskeletonpendant.IsDropable       = true;
                rattlingskeletonpendant.IsTradable       = true;
                rattlingskeletonpendant.CanDropAsLoot    = false;
                rattlingskeletonpendant.Color            = 0;
                rattlingskeletonpendant.Bonus            = 35; // default bonus
                rattlingskeletonpendant.Bonus1           = 0;
                rattlingskeletonpendant.Bonus1Type       = (int)0;
                rattlingskeletonpendant.Bonus2           = 0;
                rattlingskeletonpendant.Bonus2Type       = (int)0;
                rattlingskeletonpendant.Bonus3           = 0;
                rattlingskeletonpendant.Bonus3Type       = (int)0;
                rattlingskeletonpendant.Bonus4           = 0;
                rattlingskeletonpendant.Bonus4Type       = (int)0;
                rattlingskeletonpendant.Bonus5           = 0;
                rattlingskeletonpendant.Bonus5Type       = (int)0;
                rattlingskeletonpendant.Bonus6           = 0;
                rattlingskeletonpendant.Bonus6Type       = (int)0;
                rattlingskeletonpendant.Bonus7           = 0;
                rattlingskeletonpendant.Bonus7Type       = (int)0;
                rattlingskeletonpendant.Bonus8           = 0;
                rattlingskeletonpendant.Bonus8Type       = (int)0;
                rattlingskeletonpendant.Bonus9           = 0;
                rattlingskeletonpendant.Bonus9Type       = (int)0;
                rattlingskeletonpendant.Bonus10          = 0;
                rattlingskeletonpendant.Bonus10Type      = (int)0;
                rattlingskeletonpendant.ExtraBonus       = 0;
                rattlingskeletonpendant.ExtraBonusType   = (int)0;
                rattlingskeletonpendant.Effect           = 0;
                rattlingskeletonpendant.Emblem           = 0;
                rattlingskeletonpendant.Charges          = 0;
                rattlingskeletonpendant.MaxCharges       = 0;
                rattlingskeletonpendant.SpellID          = 0;
                rattlingskeletonpendant.ProcSpellID      = 0;
                rattlingskeletonpendant.Type_Damage      = 0;
                rattlingskeletonpendant.Realm            = 0;
                rattlingskeletonpendant.MaxCount         = 1;
                rattlingskeletonpendant.PackSize         = 1;
                rattlingskeletonpendant.Extension        = 0;
                rattlingskeletonpendant.Quality          = 99;
                rattlingskeletonpendant.Condition        = 50000;
                rattlingskeletonpendant.MaxCondition     = 50000;
                rattlingskeletonpendant.Durability       = 50000;
                rattlingskeletonpendant.MaxDurability    = 50000;
                rattlingskeletonpendant.PoisonCharges    = 0;
                rattlingskeletonpendant.PoisonMaxCharges = 0;
                rattlingskeletonpendant.PoisonSpellID    = 0;
                rattlingskeletonpendant.ProcSpellID1     = 0;
                rattlingskeletonpendant.SpellID1         = 0;
                rattlingskeletonpendant.MaxCharges1      = 0;
                rattlingskeletonpendant.Charges1         = 0;

                GameServer.Database.AddObject(rattlingskeletonpendant);
            }

            giftandnoteforprugar = GameServer.Database.FindObjectByKey <ItemTemplate>("giftandnoteforprugar");
            if (giftandnoteforprugar == null)
            {
                giftandnoteforprugar      = new ItemTemplate();
                giftandnoteforprugar.Name = "Gift and Note for Prugar";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + giftandnoteforprugar.Name + ", creating it ...");
                }

                giftandnoteforprugar.Level            = 50;
                giftandnoteforprugar.Weight           = 5;
                giftandnoteforprugar.Model            = 1347;
                giftandnoteforprugar.Object_Type      = 0;
                giftandnoteforprugar.Item_Type        = 40;
                giftandnoteforprugar.Id_nb            = "giftandnoteforprugar";
                giftandnoteforprugar.Hand             = 0;
                giftandnoteforprugar.Price            = 0;
                giftandnoteforprugar.IsPickable       = true;
                giftandnoteforprugar.IsDropable       = true;
                giftandnoteforprugar.IsTradable       = true;
                giftandnoteforprugar.CanDropAsLoot    = false;
                giftandnoteforprugar.Color            = 0;
                giftandnoteforprugar.Bonus            = 35; // default bonus
                giftandnoteforprugar.Bonus1           = 0;
                giftandnoteforprugar.Bonus1Type       = (int)0;
                giftandnoteforprugar.Bonus2           = 0;
                giftandnoteforprugar.Bonus2Type       = (int)0;
                giftandnoteforprugar.Bonus3           = 0;
                giftandnoteforprugar.Bonus3Type       = (int)0;
                giftandnoteforprugar.Bonus4           = 0;
                giftandnoteforprugar.Bonus4Type       = (int)0;
                giftandnoteforprugar.Bonus5           = 0;
                giftandnoteforprugar.Bonus5Type       = (int)0;
                giftandnoteforprugar.Bonus6           = 0;
                giftandnoteforprugar.Bonus6Type       = (int)0;
                giftandnoteforprugar.Bonus7           = 0;
                giftandnoteforprugar.Bonus7Type       = (int)0;
                giftandnoteforprugar.Bonus8           = 0;
                giftandnoteforprugar.Bonus8Type       = (int)0;
                giftandnoteforprugar.Bonus9           = 0;
                giftandnoteforprugar.Bonus9Type       = (int)0;
                giftandnoteforprugar.Bonus10          = 0;
                giftandnoteforprugar.Bonus10Type      = (int)0;
                giftandnoteforprugar.ExtraBonus       = 0;
                giftandnoteforprugar.ExtraBonusType   = (int)0;
                giftandnoteforprugar.Effect           = 0;
                giftandnoteforprugar.Emblem           = 0;
                giftandnoteforprugar.Charges          = 0;
                giftandnoteforprugar.MaxCharges       = 0;
                giftandnoteforprugar.SpellID          = 0;
                giftandnoteforprugar.ProcSpellID      = 0;
                giftandnoteforprugar.Type_Damage      = 0;
                giftandnoteforprugar.Realm            = 0;
                giftandnoteforprugar.MaxCount         = 1;
                giftandnoteforprugar.PackSize         = 1;
                giftandnoteforprugar.Extension        = 0;
                giftandnoteforprugar.Quality          = 99;
                giftandnoteforprugar.Condition        = 50000;
                giftandnoteforprugar.MaxCondition     = 50000;
                giftandnoteforprugar.Durability       = 50000;
                giftandnoteforprugar.MaxDurability    = 50000;
                giftandnoteforprugar.PoisonCharges    = 0;
                giftandnoteforprugar.PoisonMaxCharges = 0;
                giftandnoteforprugar.PoisonSpellID    = 0;
                giftandnoteforprugar.ProcSpellID1     = 0;
                giftandnoteforprugar.SpellID1         = 0;
                giftandnoteforprugar.MaxCharges1      = 0;
                giftandnoteforprugar.Charges1         = 0;

                GameServer.Database.AddObject(giftandnoteforprugar);
            }

            QuestBuilder   builder = QuestMgr.GetBuilder(typeof(thebirthdaygift));
            QuestBehaviour a;

            a = builder.CreateBehaviour(BarkeepNognar, -1);
            a.AddTrigger(eTriggerType.Interact, null, BarkeepNognar);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), BarkeepNognar);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), null, (eComparator)5);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk1"), BarkeepNognar);
            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepNognar, -1);
            a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper1"), BarkeepNognar);

            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), BarkeepNognar);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), null, (eComparator)5);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk2"), BarkeepNognar);

            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepNognar, -1);
            a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper2"), BarkeepNognar);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), BarkeepNognar);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), null, (eComparator)5);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk3"), BarkeepNognar);
            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepNognar, -1);
            a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper3"), BarkeepNognar);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), BarkeepNognar);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), null, (eComparator)5);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk4"), BarkeepNognar);
            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepNognar, -1);
            a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper4"), BarkeepNognar);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), BarkeepNognar);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), null, (eComparator)5);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk5"), BarkeepNognar);
            a.AddAction(eActionType.OfferQuest, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.OfferQuest"));
            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepNognar, -1);
            a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(DOL.GS.Quests.Midgard.thebirthdaygift));
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk6"), BarkeepNognar);
            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepNognar, -1);
            a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(DOL.GS.Quests.Midgard.thebirthdaygift));
            a.AddAction(eActionType.GiveQuest, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), BarkeepNognar);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk7"), BarkeepNognar);
            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepNognar, -1);
            a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper5"), BarkeepNognar);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), 1, (eComparator)3);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk8"), BarkeepNognar);
            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepNognar, -1);
            a.AddTrigger(eTriggerType.EnemyKilled, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.EnemyKilled"), null);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), 1, (eComparator)3);
            a.AddAction(eActionType.GiveItem, rattlingskeletonpendant, null);
            a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepNognar, -1);
            a.AddTrigger(eTriggerType.Interact, null, BarkeepNognar);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), 2, (eComparator)3);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk9"), BarkeepNognar);
            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepNognar, -1);
            a.AddTrigger(eTriggerType.GiveItem, BarkeepNognar, rattlingskeletonpendant);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), 2, (eComparator)3);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk10"), BarkeepNognar);
            a.AddAction(eActionType.TakeItem, rattlingskeletonpendant, null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepNognar, -1);
            a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper6"), BarkeepNognar);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), 2, (eComparator)3);
            a.AddRequirement(eRequirementType.InventoryItem, rattlingskeletonpendant, 0, (eComparator)3);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk11"), BarkeepNognar);
            a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), null);
            a.AddAction(eActionType.GiveItem, giftandnoteforprugar, BarkeepNognar);
            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepPrugar, -1);
            a.AddTrigger(eTriggerType.Interact, null, BarkeepPrugar);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), 3, (eComparator)3);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk12"), BarkeepPrugar);
            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepPrugar, -1);
            a.AddTrigger(eTriggerType.GiveItem, BarkeepPrugar, giftandnoteforprugar);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), 3, (eComparator)3);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk13"), BarkeepPrugar);
            a.AddAction(eActionType.TakeItem, giftandnoteforprugar, null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepPrugar, -1);
            a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper7"), BarkeepPrugar);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), 3, (eComparator)3);
            a.AddRequirement(eRequirementType.InventoryItem, giftandnoteforprugar, 0, (eComparator)3);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk14"), BarkeepPrugar);
            a.AddAction(eActionType.GiveXP, 20, null);
            a.AddAction(eActionType.GiveGold, 27, null);
            a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), null);
            AddBehaviour(a);

            // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End
            if (BarkeepNognar != null)
            {
                BarkeepNognar.AddQuestToGive(typeof(thebirthdaygift));
            }

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

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

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

            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>("Commander Burcrif", 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)
            {
                commanderBurcrif       = new GameNPC();
                commanderBurcrif.Model = 28;
                commanderBurcrif.Name  = "Commander Burcrif";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + commanderBurcrif.Name + ", creating him ...");
                }

                commanderBurcrif.GuildName       = "Part of " + questTitle + " Quest";
                commanderBurcrif.Realm           = eRealm.Albion;
                commanderBurcrif.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 26);
                template.AddNPCEquipment(eInventorySlot.HeadArmor, 93);
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 49);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 50);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 662);
                template.AddNPCEquipment(eInventorySlot.Cloak, 91);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 47);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 48);
                commanderBurcrif.Inventory = template.CloseTemplate();
                commanderBurcrif.SwitchWeapon(GameLiving.eActiveWeaponSlot.TwoHanded);

                commanderBurcrif.Size    = 53;
                commanderBurcrif.Level   = 45;
                commanderBurcrif.X       = 517270;
                commanderBurcrif.Y       = 495711;
                commanderBurcrif.Z       = 3352;
                commanderBurcrif.Heading = 2093;

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

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

            // item db check
            slithsTail = GameServer.Database.FindObjectByKey <ItemTemplate>("sliths_tail");
            if (slithsTail == null)
            {
                slithsTail      = new ItemTemplate();
                slithsTail.Name = "Slith's Tail";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + slithsTail.Name + ", creating it ...");
                }

                slithsTail.Level  = 7;
                slithsTail.Weight = 10;
                slithsTail.Model  = 515;

                slithsTail.Object_Type = (int)eObjectType.Magical;
                slithsTail.Item_Type   = (int)eEquipmentItems.L_RING;
                slithsTail.Id_nb       = "sliths_tail";
                slithsTail.Price       = Money.GetMoney(0, 0, 0, 0, 30);
                slithsTail.IsPickable  = true;
                slithsTail.IsDropable  = true;

                slithsTail.Bonus1     = 3;
                slithsTail.Bonus1Type = (int)eProperty.Dexterity;

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

            /* 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(commanderBurcrif, GameLivingEvent.Interact, new DOLEventHandler(TalkToCommanderBurcrif));
            GameEventMgr.AddHandler(commanderBurcrif, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToCommanderBurcrif));

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

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

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

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

                hughGallen.GuildName       = "Part of " + questTitle + " Quest";
                hughGallen.Realm           = eRealm.Albion;
                hughGallen.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 39);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 40);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 36);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 37);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 38);
                hughGallen.Inventory = template.CloseTemplate();
                hughGallen.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                hughGallen.Size    = 49;
                hughGallen.Level   = 38;
                hughGallen.X       = 574640;
                hughGallen.Y       = 531109;
                hughGallen.Z       = 2896;
                hughGallen.Heading = 2275;

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

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

            // item db check
            beltOfAnimation = GameServer.Database.FindObjectByKey <ItemTemplate>("belt_of_animation");
            if (beltOfAnimation == null)
            {
                beltOfAnimation      = new ItemTemplate();
                beltOfAnimation.Name = "Belt of Animation";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + beltOfAnimation.Name + ", creating it ...");
                }

                beltOfAnimation.Level  = 5;
                beltOfAnimation.Weight = 3;
                beltOfAnimation.Model  = 597;

                beltOfAnimation.Object_Type = (int)eObjectType.Magical;
                beltOfAnimation.Item_Type   = (int)eEquipmentItems.WAIST;
                beltOfAnimation.Id_nb       = "belt_of_animation";
                beltOfAnimation.Price       = 0;
                beltOfAnimation.IsPickable  = true;
                beltOfAnimation.IsDropable  = false; // can't be sold to merchand

                beltOfAnimation.Bonus1     = 6;
                beltOfAnimation.Bonus1Type = (int)eProperty.MaxHealth;

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

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

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

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

            GameEventMgr.AddHandler(hughGallen, GameLivingEvent.Interact, new DOLEventHandler(TalkToHughGallen));
            GameEventMgr.AddHandler(hughGallen, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToHughGallen));

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

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

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

            if (npcs.Length == 0)
            {
                LadyGrynoch       = new GameNPC();
                LadyGrynoch.Model = 5;
                LadyGrynoch.Name  = "Lady Grynoch";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + LadyGrynoch.Name + ", creating her ...");
                }

                // k109: My preference, no guildname for quest NPCs.  Uncomment if you like that...
                // LadyGrynoch.GuildName = "Part of " + questTitle + " Quest";
                LadyGrynoch.Realm           = eRealm.Albion;
                LadyGrynoch.CurrentRegionID = 1;

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

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

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

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

            Burial_Tomb_Area = WorldMgr.GetRegion(Burial_Tomb.RegionID).AddArea(new Area.Circle(string.Empty, Burial_Tomb.X, Burial_Tomb.Y, Burial_Tomb.Z, 200));
            Burial_Tomb_Area.RegisterPlayerEnter(new DOLEventHandler(PlayerEnterBurialTombArea));

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

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

            LadyGrynoch.AddQuestToGive(typeof(TombWithAView));

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

            masterFrederick = GetMasterFrederick();

            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>("Apprentice Dunan", eRealm.Albion);
            if (npcs.Length == 0)
            {
                dunan       = new GameNPC();
                dunan.Model = 49;
                dunan.Name  = "Apprentice Dunan";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + dunan.Name + ", creating ...");
                }

                dunan.GuildName       = "Part of " + questTitle + " Quest";
                dunan.Realm           = eRealm.Albion;
                dunan.CurrentRegionID = 1;
                dunan.Size            = 49;
                dunan.Level           = 21;
                dunan.X                   = 531663;
                dunan.Y                   = 479785;
                dunan.Z                   = 2200;
                dunan.Heading             = 1579;
                dunan.EquipmentTemplateID = "1707754";

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

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

            npcs = WorldMgr.GetObjectsByName <GameNPC>("Bombard", eRealm.Albion);
            if (npcs.Length == 0)
            {
                bombard       = new GameStableMaster();
                bombard.Model = 8;
                bombard.Name  = "Bombard";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + bombard.Name + ", creating ...");
                }

                bombard.GuildName       = "Stable Master";
                bombard.Realm           = eRealm.Albion;
                bombard.CurrentRegionID = 1;
                bombard.Size            = 49;
                bombard.Level           = 4;
                bombard.X       = 515718;
                bombard.Y       = 496739;
                bombard.Z       = 3352;
                bombard.Heading = 2500;

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

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

            npcs = WorldMgr.GetObjectsByName <GameNPC>("Vuloch", eRealm.Albion);
            if (npcs.Length == 0)
            {
                vuloch       = new GameStableMaster();
                vuloch.Model = 86;
                vuloch.Name  = "Vuloch";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + vuloch.Name + ", creating ...");
                }

                vuloch.GuildName       = "Stable Master";
                vuloch.Realm           = eRealm.Albion;
                vuloch.CurrentRegionID = 1;
                vuloch.Size            = 50;
                vuloch.Level           = 4;
                vuloch.X       = 553089;
                vuloch.Y       = 513380;
                vuloch.Z       = 2896;
                vuloch.Heading = 2139;

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

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

            npcs = WorldMgr.GetObjectsByName <GameNPC>("Yaren", eRealm.Albion);
            if (npcs.Length == 0)
            {
                yaren       = new GameStableMaster();
                yaren.Model = 79;
                yaren.Name  = "Yaren";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + yaren.Name + ", creating ...");
                }

                yaren.GuildName       = "Stable Master";
                yaren.Realm           = eRealm.Albion;
                yaren.CurrentRegionID = 1;
                yaren.Size            = 48;
                yaren.Level           = 4;
                yaren.X                   = 529638;
                yaren.Y                   = 478091;
                yaren.Z                   = 2200;
                yaren.Heading             = 3160;
                yaren.EquipmentTemplateID = "11701347";

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

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

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

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

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

                sackOfSupplies.Object_Type = (int)eObjectType.GenericItem;

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

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

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

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

                crateOfVegetables.Object_Type = (int)eObjectType.GenericItem;

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

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

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

                recruitsCloak.Level = 3;

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

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

                recruitsCloak.Bonus = 1; // default bonus

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

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

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

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

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

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

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

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

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

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

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

            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>(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.GetObjectsByName <GameNPC>(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];
            }

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

            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);
                }
            }

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

            questGiver.AddQuestToGive(typeof(BonesToBlades));

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

            masterFrederick = GetMasterFrederick();

            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>("Lady Felin", eRealm.None);
            if (npcs.Length == 0)
            {
                // if (Log.IsWarnEnabled) Log.Warn("Could not find Lady Felin, creating her ...");
                ladyFelin                 = new GameNPC();
                ladyFelin.Model           = 603;
                ladyFelin.Name            = "Lady Felin";
                ladyFelin.GuildName       = "Part of " + questTitle + " Quest";
                ladyFelin.Realm           = eRealm.None;
                ladyFelin.CurrentRegionID = 1;
                ladyFelin.Size            = 50;
                ladyFelin.Level           = 30;
                ladyFelin.X               = 558846;
                ladyFelin.Y               = 516434;
                ladyFelin.Z               = 2519;
                ladyFelin.Heading         = 2332;

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

            // 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
                GameServer.Database.AddObject(necklaceOfDoppelganger);
            }

            // item db check
            fairyPlans = GameServer.Database.FindObjectByKey <ItemTemplate>("ire_fairy_plans");
            if (fairyPlans == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Ire Fairy Plans, creating it ...");
                }

                fairyPlans      = new ItemTemplate();
                fairyPlans.Name = "Ire Fairy Plans";

                fairyPlans.Weight = 3;
                fairyPlans.Model  = 498;

                fairyPlans.Object_Type = (int)eObjectType.GenericItem;

                fairyPlans.Id_nb      = "ire_fairy_plans";
                fairyPlans.IsPickable = true;
                fairyPlans.IsDropable = false;

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

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

                recruitsBoots       = new ItemTemplate();
                recruitsBoots.Name  = "Recruit's Studded 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.Studded;
                recruitsBoots.Item_Type   = (int)eEquipmentItems.FEET;
                recruitsBoots.Id_nb       = "recruits_studded_boots";
                recruitsBoots.Price       = Money.GetMoney(0, 0, 0, 10, 0);
                recruitsBoots.IsPickable  = true;
                recruitsBoots.IsDropable  = true;
                recruitsBoots.Color       = 9; // red leather

                recruitsBoots.Bonus = 5;       // default bonus

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

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

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

                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
                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       = 27; // red leather

                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
                GameServer.Database.AddObject(recruitsQuiltedBoots);
            }

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

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

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

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

            GameEventMgr.AddHandler(ladyFelin, GameLivingEvent.Interact, new DOLEventHandler(TalkToLadyFelin));
            GameEventMgr.AddHandler(ladyFelin, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToLadyFelin));

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

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

            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>("Marlin Thuler", 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)
            {
                marlinThuler       = new GameNPC();
                marlinThuler.Model = 960;
                marlinThuler.Name  = "Marlin Thuler";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + marlinThuler.Name + ", creating him ...");
                }

                marlinThuler.GuildName       = "Instrument Merchant";
                marlinThuler.Realm           = eRealm.Albion;
                marlinThuler.CurrentRegionID = 1;
                marlinThuler.Size            = 52;
                marlinThuler.Level           = 40;
                marlinThuler.X       = 578189;
                marlinThuler.Y       = 557031;
                marlinThuler.Z       = 2340;
                marlinThuler.Heading = 1513;

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

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

            drum = GameServer.Database.FindObjectByKey <ItemTemplate>("finely_crafted_drum");
            if (drum == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Finely Crafted Drum from a wolf cub, creating it ...");
                }

                drum             = new ItemTemplate();
                drum.Object_Type = 0;
                drum.Id_nb       = "finely_crafted_drum";
                drum.Name        = "Finely Crafted Drum";
                drum.Level       = 1;
                drum.Model       = 2977;
                drum.IsDropable  = false;
                drum.IsPickable  = false;
                drum.Weight      = 15;

                // 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(drum);
            }

            /* 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(marlinThuler, GameLivingEvent.Interact, new DOLEventHandler(TalkToMarlinThuler));
            GameEventMgr.AddHandler(marlinThuler, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMarlinThuler));

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

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

            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>(LanguageMgr.GetTranslation(ServerProperties.Properties.DB_LANGUAGE, "Alb.ANewHeroesWelcome.ScriptLoaded.Text1"), eRealm.Albion);

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

                // MasterClaistan.GuildName = "Part of " + questTitle + " Quest";
                MasterClaistan.Realm           = eRealm.Albion;
                MasterClaistan.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 39);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 40);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 36);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 37);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 38);
                MasterClaistan.Inventory = template.CloseTemplate();
                MasterClaistan.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                MasterClaistan.Size    = 52;
                MasterClaistan.Level   = 51;
                MasterClaistan.X       = 562190;
                MasterClaistan.Y       = 512571;
                MasterClaistan.Z       = 2500;
                MasterClaistan.Heading = 1592;

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

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

            // Pompin The Crier
            npcs = WorldMgr.GetObjectsByName <GameNPC>(LanguageMgr.GetTranslation(ServerProperties.Properties.DB_LANGUAGE, "Alb.ANewHeroesWelcome.ScriptLoaded.Text2"), eRealm.Albion);
            if (npcs.Length == 0)
            {
                PompinTheCrier       = new GameNPC();
                PompinTheCrier.Model = 10;
                PompinTheCrier.Name  = LanguageMgr.GetTranslation(ServerProperties.Properties.DB_LANGUAGE, "Alb.ANewHeroesWelcome.ScriptLoaded.Text2");
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + PompinTheCrier.Name + ", creating him ...");
                }

                // MasterClaistan.GuildName = "Part of " + questTitle + " Quest";
                PompinTheCrier.Realm           = eRealm.Albion;
                PompinTheCrier.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 39);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 40);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 36);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 37);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 38);
                PompinTheCrier.Inventory = template.CloseTemplate();
                PompinTheCrier.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                PompinTheCrier.Size    = 50;
                PompinTheCrier.Level   = 5;
                PompinTheCrier.X       = 560484;
                PompinTheCrier.Y       = 511756;
                PompinTheCrier.Z       = 2344;
                PompinTheCrier.Heading = 420;

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

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

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

            GameEventMgr.AddHandler(MasterClaistan, GameLivingEvent.Interact, new DOLEventHandler(TalkToMasterClaistan));
            GameEventMgr.AddHandler(MasterClaistan, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMasterClaistan));

            GameEventMgr.AddHandler(PompinTheCrier, GameLivingEvent.Interact, new DOLEventHandler(TalkToPompinTheCrier));
            GameEventMgr.AddHandler(PompinTheCrier, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToPompinTheCrier));

            MasterClaistan.AddQuestToGive(typeof(ANewHeroesWelcome));

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Exemplo n.º 18
0
        public static GameNPC GetDalikor()
        {
            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>("Dalikor", eRealm.Midgard);

            GameNPC dalikor = null;

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

                dalikor.GuildName       = "Part of Dalikor Quests";
                dalikor.Realm           = eRealm.Midgard;
                dalikor.CurrentRegionID = locationDalikor.RegionID;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 348);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 349);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 350);
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 351);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 352);
                template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 4);
                dalikor.Inventory = template.CloseTemplate();
                dalikor.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

// dalikor.AddNPCEquipment((byte) eEquipmentItems.TORSO, 348, 0, 0, 0);
//              dalikor.AddNPCEquipment((byte) eEquipmentItems.LEGS, 349, 0, 0, 0);
//              dalikor.AddNPCEquipment((byte) eEquipmentItems.ARMS, 350, 0, 0, 0);
//              dalikor.AddNPCEquipment((byte) eEquipmentItems.HAND, 351, 0, 0, 0);
//              dalikor.AddNPCEquipment((byte) eEquipmentItems.FEET, 352, 0, 0, 0);
//              dalikor.AddNPCEquipment((byte) eVisibleItems.RIGHT_HAND, 4, 0, 0, 0);
                dalikor.Size    = 50;
                dalikor.Level   = 50;
                dalikor.X       = locationDalikor.X;
                dalikor.Y       = locationDalikor.Y;
                dalikor.Z       = locationDalikor.Z;
                dalikor.Heading = locationDalikor.Heading;

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

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

            return(dalikor);
        }
Exemplo 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 ...");
            }

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

            if (npcs == null || npcs.Length == 0)
            {
                captainKinzee       = new GameNPC();
                captainKinzee.Model = 39;
                captainKinzee.Name  = "Captain Kinzee";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + captainKinzee.Name + ", creating him ...");
                }

                captainKinzee.GuildName       = "Part of " + questTitle + " Quest";
                captainKinzee.Realm           = eRealm.Albion;
                captainKinzee.CurrentRegionID = 27;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 691);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 692);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 688);
                template.AddNPCEquipment(eInventorySlot.Cloak, 676);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 689);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 690);
                template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 3294);
                captainKinzee.Inventory = template.CloseTemplate();
                captainKinzee.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                captainKinzee.Size    = 50;
                captainKinzee.Level   = 50;
                captainKinzee.X       = 98343;
                captainKinzee.Y       = 90564;
                captainKinzee.Z       = 5716;
                captainKinzee.Heading = 3698;

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

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

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

            GameEventMgr.AddHandler(captainKinzee, GameLivingEvent.Interact, new DOLEventHandler(TalkToCaptainKinzee));
            GameEventMgr.AddHandler(captainKinzee, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToCaptainKinzee));

            captainKinzee.AddQuestToGive(typeof(GreetingsArmsman));

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

            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>("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];
            }

            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");
            }
        }
Exemplo n.º 21
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 :)
             */

            addrir = GetAddrir();

            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>("Aethic", eRealm.Hibernia);
            if (npcs.Length == 0)
            {
                aethic       = new GameNPC();
                aethic.Model = 361;
                aethic.Name  = "Aethic";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find" + aethic.Name + " , creating ...");
                }

                aethic.GuildName       = "Part of " + questTitle + " Quest";
                aethic.Realm           = eRealm.Hibernia;
                aethic.CurrentRegionID = 200;
                aethic.Size            = 49;
                aethic.Level           = 21;
                aethic.X       = GameLocation.ConvertLocalXToGlobalX(23761, 200);
                aethic.Y       = GameLocation.ConvertLocalYToGlobalY(45658, 200);
                aethic.Z       = 5448;
                aethic.Heading = 320;

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

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

            npcs = WorldMgr.GetObjectsByName <GameNPC>("Freagus", eRealm.Hibernia);
            if (npcs.Length == 0)
            {
                freagus       = new GameStableMaster();
                freagus.Model = 361;
                freagus.Name  = "Freagus";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + freagus.Name + ", creating ...");
                }

                freagus.GuildName       = "Stable Master";
                freagus.Realm           = eRealm.Hibernia;
                freagus.CurrentRegionID = 200;
                freagus.Size            = 48;
                freagus.Level           = 30;
                freagus.X                   = 341008;
                freagus.Y                   = 469180;
                freagus.Z                   = 5200;
                freagus.Heading             = 1934;
                freagus.EquipmentTemplateID = "3800664";

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

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

            npcs = WorldMgr.GetObjectsByName <GameNPC>("Rumdor", eRealm.Hibernia);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Rumdor, creating ...");
                }

                rumdor                     = new GameStableMaster();
                rumdor.Model               = 361;
                rumdor.Name                = "Rumdor";
                rumdor.GuildName           = "Stable Master";
                rumdor.Realm               = eRealm.Hibernia;
                rumdor.CurrentRegionID     = 200;
                rumdor.Size                = 53;
                rumdor.Level               = 33;
                rumdor.X                   = 347175;
                rumdor.Y                   = 491836;
                rumdor.Z                   = 5226;
                rumdor.Heading             = 1262;
                rumdor.EquipmentTemplateID = "3800664";

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

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

            npcs = WorldMgr.GetObjectsByName <GameStableMaster>("Truichon", eRealm.Hibernia);
            if (npcs.Length == 0)
            {
                truichon       = new GameStableMaster();
                truichon.Model = 361;
                truichon.Name  = "Truichon";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + truichon.Name + ", creating ...");
                }

                truichon.GuildName       = "Stable Master";
                truichon.Realm           = eRealm.Hibernia;
                truichon.CurrentRegionID = 1;
                truichon.Size            = 50;
                truichon.Level           = 33;
                truichon.X       = 343464;
                truichon.Y       = 526708;
                truichon.Z       = 5448;
                truichon.Heading = 68;

                // truichon.EquipmentTemplateID = "5448";

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

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

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

            ticketToArdee = GameServer.Database.FindObjectByKey <ItemTemplate>("hs_tirnambeo_ardee");
            if (ticketToArdee == null)
            {
                ticketToArdee = CreateTicketTo("Ardee", "hs_tirnambeo_ardee");
            }

            recruitsDiary = GameServer.Database.FindObjectByKey <ItemTemplate>("recruits_diary");
            if (recruitsDiary == null)
            {
                recruitsDiary      = new ItemTemplate();
                recruitsDiary.Name = "Recruits Diary";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + recruitsDiary.Name + " , creating it ...");
                }

                recruitsDiary.Weight      = 3;
                recruitsDiary.Model       = 500;
                recruitsDiary.Object_Type = (int)eObjectType.GenericItem;
                recruitsDiary.Id_nb       = "recruits_diary";
                recruitsDiary.IsPickable  = true;
                recruitsDiary.IsDropable  = false;

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

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

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

                sackOfSupplies.Object_Type = (int)eObjectType.GenericItem;

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

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

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

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

                crateOfVegetables.Object_Type = (int)eObjectType.GenericItem;

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

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

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

                recruitsCloak       = new ItemTemplate();
                recruitsCloak.Name  = "Recruit's Cloak (Hib)";
                recruitsCloak.Level = 3;

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

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

                recruitsCloak.Bonus = 1; // default bonus

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

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

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

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

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

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

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

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

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

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

            /* 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();

            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>("Abohas", eRealm.Midgard);
            if (npcs.Length == 0)
            {
                abohas       = new GameNPC();
                abohas.Model = 215;
                abohas.Name  = "Abohas";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find" + abohas.Name + " , creating her ...");
                }

                abohas.GuildName       = "Part of " + questTitle + " Quest";
                abohas.Realm           = eRealm.Midgard;
                abohas.CurrentRegionID = 100;
                abohas.Size            = 49;
                abohas.Level           = 21;
                abohas.X       = GameLocation.ConvertLocalXToGlobalX(52274, 100);
                abohas.Y       = GameLocation.ConvertLocalYToGlobalY(29985, 100);
                abohas.Z       = 4960;
                abohas.Heading = 123;

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

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

            npcs = WorldMgr.GetObjectsByName <GameNPC>("Harlfug", eRealm.Midgard);
            if (npcs.Length == 0)
            {
                harlfug       = new GameStableMaster();
                harlfug.Model = 215;
                harlfug.Name  = "Harlfug";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + harlfug.Name + ", creating her ...");
                }

                harlfug.GuildName       = "Stable Master";
                harlfug.Realm           = eRealm.Midgard;
                harlfug.CurrentRegionID = 100;
                harlfug.Size            = 52;
                harlfug.Level           = 41;
                harlfug.X                   = 773458;
                harlfug.Y                   = 754240;
                harlfug.Z                   = 4600;
                harlfug.Heading             = 2707;
                harlfug.EquipmentTemplateID = "5100798";

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

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

            npcs = WorldMgr.GetObjectsByName <GameNPC>("Gularg", eRealm.Midgard);
            if (npcs.Length == 0)
            {
                gularg       = new GameStableMaster();
                gularg.Model = 212;
                gularg.Name  = "Gularg";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + gularg.Name + ", creating her ...");
                }

                gularg.GuildName       = "Stable Master";
                gularg.Realm           = eRealm.Midgard;
                gularg.CurrentRegionID = 100;
                gularg.Size            = 50;
                gularg.Level           = 41;
                gularg.X                   = 803766;
                gularg.Y                   = 721959;
                gularg.Z                   = 4686;
                gularg.Heading             = 3925;
                gularg.EquipmentTemplateID = "5100798";

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

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

            npcs = WorldMgr.GetObjectsByName <GameNPC>("Yolafson", eRealm.Midgard);
            if (npcs.Length == 0)
            {
                yolafson       = new GameStableMaster();
                yolafson.Model = 214;
                yolafson.Name  = "Yolafson";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + yolafson.Name + ", creating her ...");
                }

                yolafson.GuildName       = "Stable Master";
                yolafson.Realm           = eRealm.Midgard;
                yolafson.CurrentRegionID = 100;
                yolafson.Size            = 51;
                yolafson.Level           = 41;
                yolafson.X                   = 805721;
                yolafson.Y                   = 700414;
                yolafson.Z                   = 4960;
                yolafson.Heading             = 1206;
                yolafson.EquipmentTemplateID = "5100798";

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

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

            ticketToHaggerfel = CreateTicketTo("Haggerfel", "hs_src_haggerfel");
            ticketToVasudheim = CreateTicketTo("Vasudheim", "hs_src_vasudheim");

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

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

                sackOfSupplies.Object_Type = (int)eObjectType.GenericItem;

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

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

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

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

                crateOfVegetables.Object_Type = (int)eObjectType.GenericItem;

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

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

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

                recruitsCloak.Level = 3;

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

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

                recruitsCloak.Bonus = 1;        // default bonus

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

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

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

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

            /* 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.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

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

            GameEventMgr.AddHandler(harlfug, GameLivingEvent.Interact, new DOLEventHandler(TalkToHarlfug));
            GameEventMgr.AddHandler(harlfug, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToHarlfug));

            GameEventMgr.AddHandler(abohas, GameLivingEvent.Interact, new DOLEventHandler(TalkToAbohas));
            GameEventMgr.AddHandler(abohas, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToAbohas));

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

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

            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>("Sir Prescott", 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)
            {
                SirPrescott       = new GameNPC();
                SirPrescott.Model = 28;
                SirPrescott.Name  = "Sir Prescott";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + SirPrescott.Name + ", creating him ...");
                }

                // SirPrescott.GuildName = "Part of " + questTitle + " Quest";
                SirPrescott.Realm           = eRealm.Albion;
                SirPrescott.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 39);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 40);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 36);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 37);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 38);
                SirPrescott.Inventory = template.CloseTemplate();
                SirPrescott.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                SirPrescott.Size    = 50;
                SirPrescott.Level   = 50;
                SirPrescott.X       = 559862;
                SirPrescott.Y       = 513092;
                SirPrescott.Z       = 2408;
                SirPrescott.Heading = 2480;

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

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

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

            GameEventMgr.AddHandler(SirPrescott, GameLivingEvent.Interact, new DOLEventHandler(TalkToSirPrescott));
            GameEventMgr.AddHandler(SirPrescott, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToSirPrescott));

            SirPrescott.AddQuestToGive(typeof(AfterTheAccident));

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

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

            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>("Palune", eRealm.Albion);
            if (npcs.Length == 0)
            {
                palune       = new GameNPC();
                palune.Model = 81;
                palune.Name  = "Palune";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + palune.Name + ", creating him ...");
                }

                palune.GuildName       = "Enchanter";
                palune.Realm           = eRealm.Albion;
                palune.CurrentRegionID = 1;
                palune.Size            = 52;
                palune.Level           = 27;
                palune.X       = 573735;
                palune.Y       = 530508;
                palune.Z       = 2957;
                palune.Heading = 3083;

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

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

            npcs = WorldMgr.GetObjectsByName <GameNPC>("Guard Cynon", eRealm.Albion);
            if (npcs.Length == 0)
            {
                guardCynon       = new GameNPC();
                guardCynon.Model = 28;
                guardCynon.Name  = "Guard Cynon";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + guardCynon.Name + ", creating him ...");
                }

                guardCynon.GuildName       = "Part of " + questTitle + " Quest";
                guardCynon.Realm           = eRealm.Albion;
                guardCynon.CurrentRegionID = 1;
                guardCynon.Size            = 51;
                guardCynon.Level           = 25;
                guardCynon.X            = 577920;
                guardCynon.Y            = 557362;
                guardCynon.Z            = 2159;
                guardCynon.Heading      = 3982;
                guardCynon.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)
                {
                    guardCynon.SaveIntoDatabase();
                }

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

            enchantedHalberd = GameServer.Database.FindObjectByKey <ItemTemplate>("enchanted_halberd");
            if (enchantedHalberd == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Elder Wood, creating it ...");
                }

                enchantedHalberd             = new ItemTemplate();
                enchantedHalberd.Object_Type = 0;
                enchantedHalberd.Id_nb       = "enchanted_halberd";
                enchantedHalberd.Name        = "Enchanted Halberd";
                enchantedHalberd.Level       = 1;
                enchantedHalberd.Model       = 67;
                enchantedHalberd.IsDropable  = false;
                enchantedHalberd.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(enchantedHalberd);
            }

            /* 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(palune, GameLivingEvent.Interact, new DOLEventHandler(TalkToPalune));
            GameEventMgr.AddHandler(palune, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToPalune));

            GameEventMgr.AddHandler(guardCynon, GameLivingEvent.Interact, new DOLEventHandler(TalkToGuardCynon));
            GameEventMgr.AddHandler(guardCynon, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToGuardCynon));

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

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

            GameNPC[] npcs;

            npcs = WorldMgr.GetObjectsByName <GameNPC>(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.ABearyBadProblem.NPCKreimhilde"), (eRealm)2);
            if (npcs.Length == 0)
            {
                VikingKreimhilde       = new DOL.GS.GameNPC();
                VikingKreimhilde.Model = 218;
                VikingKreimhilde.Name  = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.ABearyBadProblem.NPCKreimhilde");
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + VikingKreimhilde.Name + ", creating ...");
                }

                VikingKreimhilde.GuildName       = "Part of " + questTitle + " Quest";
                VikingKreimhilde.Realm           = eRealm.Midgard;
                VikingKreimhilde.CurrentRegionID = 100;
                VikingKreimhilde.Size            = 51;
                VikingKreimhilde.Level           = 50;
                VikingKreimhilde.MaxSpeedBase    = 191;
                VikingKreimhilde.Faction         = FactionMgr.GetFactionByID(0);
                VikingKreimhilde.X               = 803999;
                VikingKreimhilde.Y               = 726551;
                VikingKreimhilde.Z               = 4752;
                VikingKreimhilde.Heading         = 2116;
                VikingKreimhilde.RespawnInterval = -1;
                VikingKreimhilde.BodyType        = 0;

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

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

            silverringofhealth = GameServer.Database.FindObjectByKey <ItemTemplate>("silverringofhealth");
            if (silverringofhealth == null)
            {
                silverringofhealth      = new ItemTemplate();
                silverringofhealth.Name = "Silver Ring of Health";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + silverringofhealth.Name + ", creating it ...");
                }

                silverringofhealth.Level            = 5;
                silverringofhealth.Weight           = 5;
                silverringofhealth.Model            = 103;
                silverringofhealth.Object_Type      = 0;
                silverringofhealth.Item_Type        = 35;
                silverringofhealth.Id_nb            = "silverringofhealth";
                silverringofhealth.Hand             = 0;
                silverringofhealth.Price            = 0;
                silverringofhealth.IsPickable       = true;
                silverringofhealth.IsDropable       = true;
                silverringofhealth.IsTradable       = false;
                silverringofhealth.CanDropAsLoot    = false;
                silverringofhealth.Color            = 0;
                silverringofhealth.Bonus            = 5; // default bonus
                silverringofhealth.Bonus1           = 12;
                silverringofhealth.Bonus1Type       = (int)10;
                silverringofhealth.Bonus2           = 0;
                silverringofhealth.Bonus2Type       = (int)0;
                silverringofhealth.Bonus3           = 0;
                silverringofhealth.Bonus3Type       = (int)0;
                silverringofhealth.Bonus4           = 0;
                silverringofhealth.Bonus4Type       = (int)0;
                silverringofhealth.Bonus5           = 0;
                silverringofhealth.Bonus5Type       = (int)0;
                silverringofhealth.Bonus6           = 0;
                silverringofhealth.Bonus6Type       = (int)0;
                silverringofhealth.Bonus7           = 0;
                silverringofhealth.Bonus7Type       = (int)0;
                silverringofhealth.Bonus8           = 0;
                silverringofhealth.Bonus8Type       = (int)0;
                silverringofhealth.Bonus9           = 0;
                silverringofhealth.Bonus9Type       = (int)0;
                silverringofhealth.Bonus10          = 0;
                silverringofhealth.Bonus10Type      = (int)0;
                silverringofhealth.ExtraBonus       = 0;
                silverringofhealth.ExtraBonusType   = (int)0;
                silverringofhealth.Effect           = 0;
                silverringofhealth.Emblem           = 0;
                silverringofhealth.Charges          = 0;
                silverringofhealth.MaxCharges       = 0;
                silverringofhealth.SpellID          = 0;
                silverringofhealth.ProcSpellID      = 0;
                silverringofhealth.Type_Damage      = 0;
                silverringofhealth.Realm            = 0;
                silverringofhealth.MaxCount         = 1;
                silverringofhealth.PackSize         = 1;
                silverringofhealth.Extension        = 0;
                silverringofhealth.Quality          = 100;
                silverringofhealth.Condition        = 100;
                silverringofhealth.MaxCondition     = 100;
                silverringofhealth.Durability       = 100;
                silverringofhealth.MaxDurability    = 100;
                silverringofhealth.PoisonCharges    = 0;
                silverringofhealth.PoisonMaxCharges = 0;
                silverringofhealth.PoisonSpellID    = 0;
                silverringofhealth.ProcSpellID1     = 0;
                silverringofhealth.SpellID1         = 0;
                silverringofhealth.MaxCharges1      = 0;
                silverringofhealth.Charges1         = 0;

                GameServer.Database.AddObject(silverringofhealth);
            }

            blackmaulercubpelt = GameServer.Database.FindObjectByKey <ItemTemplate>("blackmaulercubpelt");
            if (blackmaulercubpelt == null)
            {
                blackmaulercubpelt      = new ItemTemplate();
                blackmaulercubpelt.Name = "Black Mauler Cub Pelt";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + blackmaulercubpelt.Name + ", creating it ...");
                }

                blackmaulercubpelt.Level            = 1;
                blackmaulercubpelt.Weight           = 5;
                blackmaulercubpelt.Model            = 100;
                blackmaulercubpelt.Object_Type      = 0;
                blackmaulercubpelt.Item_Type        = 40;
                blackmaulercubpelt.Id_nb            = "blackmaulercubpelt";
                blackmaulercubpelt.Hand             = 0;
                blackmaulercubpelt.Price            = 0;
                blackmaulercubpelt.IsPickable       = true;
                blackmaulercubpelt.IsDropable       = true;
                blackmaulercubpelt.IsTradable       = true;
                blackmaulercubpelt.CanDropAsLoot    = false;
                blackmaulercubpelt.Color            = 0;
                blackmaulercubpelt.Bonus            = 35; // default bonus
                blackmaulercubpelt.Bonus1           = 0;
                blackmaulercubpelt.Bonus1Type       = (int)0;
                blackmaulercubpelt.Bonus2           = 0;
                blackmaulercubpelt.Bonus2Type       = (int)0;
                blackmaulercubpelt.Bonus3           = 0;
                blackmaulercubpelt.Bonus3Type       = (int)0;
                blackmaulercubpelt.Bonus4           = 0;
                blackmaulercubpelt.Bonus4Type       = (int)0;
                blackmaulercubpelt.Bonus5           = 0;
                blackmaulercubpelt.Bonus5Type       = (int)0;
                blackmaulercubpelt.Bonus6           = 0;
                blackmaulercubpelt.Bonus6Type       = (int)0;
                blackmaulercubpelt.Bonus7           = 0;
                blackmaulercubpelt.Bonus7Type       = (int)0;
                blackmaulercubpelt.Bonus8           = 0;
                blackmaulercubpelt.Bonus8Type       = (int)0;
                blackmaulercubpelt.Bonus9           = 0;
                blackmaulercubpelt.Bonus9Type       = (int)0;
                blackmaulercubpelt.Bonus10          = 0;
                blackmaulercubpelt.Bonus10Type      = (int)0;
                blackmaulercubpelt.ExtraBonus       = 0;
                blackmaulercubpelt.ExtraBonusType   = (int)0;
                blackmaulercubpelt.Effect           = 0;
                blackmaulercubpelt.Emblem           = 0;
                blackmaulercubpelt.Charges          = 0;
                blackmaulercubpelt.MaxCharges       = 0;
                blackmaulercubpelt.SpellID          = 0;
                blackmaulercubpelt.ProcSpellID      = 0;
                blackmaulercubpelt.Type_Damage      = 0;
                blackmaulercubpelt.Realm            = 0;
                blackmaulercubpelt.MaxCount         = 1;
                blackmaulercubpelt.PackSize         = 1;
                blackmaulercubpelt.Extension        = 0;
                blackmaulercubpelt.Quality          = 99;
                blackmaulercubpelt.Condition        = 100;
                blackmaulercubpelt.MaxCondition     = 100;
                blackmaulercubpelt.Durability       = 100;
                blackmaulercubpelt.MaxDurability    = 100;
                blackmaulercubpelt.PoisonCharges    = 0;
                blackmaulercubpelt.PoisonMaxCharges = 0;
                blackmaulercubpelt.PoisonSpellID    = 0;
                blackmaulercubpelt.ProcSpellID1     = 0;
                blackmaulercubpelt.SpellID1         = 0;
                blackmaulercubpelt.MaxCharges1      = 0;
                blackmaulercubpelt.Charges1         = 0;

                GameServer.Database.AddObject(blackmaulercubpelt);
            }

            QuestBuilder   builder = QuestMgr.GetBuilder(typeof(Abearybadproblem));
            QuestBehaviour a;

            a = builder.CreateBehaviour(VikingKreimhilde, -1);
            a.AddTrigger(eTriggerType.Interact, null, VikingKreimhilde);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.Abearybadproblem), VikingKreimhilde);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.Abearybadproblem), null, (eComparator)5);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.ABearyBadProblem.Talk1"), VikingKreimhilde);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.ABearyBadProblem.Talk2"), VikingKreimhilde);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.ABearyBadProblem.Talk3"), VikingKreimhilde);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.ABearyBadProblem.Talk4"), VikingKreimhilde);
            a.AddAction(eActionType.OfferQuest, typeof(DOL.GS.Quests.Midgard.Abearybadproblem), LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.ABearyBadProblem.OfferQuest"));
            AddBehaviour(a);
            a = builder.CreateBehaviour(VikingKreimhilde, -1);
            a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(DOL.GS.Quests.Midgard.Abearybadproblem));
            a.AddAction(eActionType.GiveQuest, typeof(DOL.GS.Quests.Midgard.Abearybadproblem), VikingKreimhilde);
            a.AddAction(eActionType.SetQuestStep, typeof(DOL.GS.Quests.Midgard.Abearybadproblem), 1);
            AddBehaviour(a);
            a = builder.CreateBehaviour(VikingKreimhilde, -1);
            a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(DOL.GS.Quests.Midgard.Abearybadproblem));
            AddBehaviour(a);
            a = builder.CreateBehaviour(VikingKreimhilde, -1);
            a.AddTrigger(eTriggerType.EnemyKilled, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.ABearyBadProblem.EnemyKilled"), null);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Abearybadproblem), 1, (eComparator)3);
            a.AddAction(eActionType.GiveItem, blackmaulercubpelt, null);
            a.AddAction(eActionType.SetQuestStep, typeof(DOL.GS.Quests.Midgard.Abearybadproblem), 2);
            AddBehaviour(a);
            a = builder.CreateBehaviour(VikingKreimhilde, -1);
            a.AddTrigger(eTriggerType.Interact, null, VikingKreimhilde);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Abearybadproblem), 2, (eComparator)3);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.ABearyBadProblem.GoodJob"), VikingKreimhilde);
            a.AddAction(eActionType.GiveXP, 22, null);
            a.AddAction(eActionType.GiveGold, 23, null);
            a.AddAction(eActionType.TakeItem, blackmaulercubpelt, null);
            a.AddAction(eActionType.GiveItem, silverringofhealth, VikingKreimhilde);
            a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.Abearybadproblem), null);
            AddBehaviour(a);

            // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End
            VikingKreimhilde.AddQuestToGive(typeof(Abearybadproblem));
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Exemplo 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 ...");
            }

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

            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Roben , creating it ...");
                }

                Roben                 = new GameNPC();
                Roben.Model           = 36;
                Roben.Name            = "Roben Fraomar";
                Roben.GuildName       = string.Empty;
                Roben.Realm           = eRealm.Albion;
                Roben.CurrentRegionID = 1;
                Roben.Size            = 52;
                Roben.Level           = 50;
                Roben.X               = 408557;
                Roben.Y               = 651675;
                Roben.Z               = 5200;
                Roben.Heading         = 3049;
                Roben.AddToWorld();

                if (SAVE_INTO_DATABASE)
                {
                    Roben.SaveIntoDatabase();
                }
            }
            else
            {
                Roben = npcs[0];
            }

            // end npc
            npcs = WorldMgr.GetObjectsByName <GameNPC>("Sister Blythe", eRealm.None);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Blythe , creating it ...");
                }

                Blythe                 = new GameNPC();
                Blythe.Model           = 67;
                Blythe.Name            = "Sister Blythe";
                Blythe.GuildName       = string.Empty;
                Blythe.Realm           = eRealm.None;
                Blythe.CurrentRegionID = 1;
                Blythe.Size            = 50;
                Blythe.Level           = 69;
                Blythe.X               = 322231;
                Blythe.Y               = 671546;
                Blythe.Z               = 2762;
                Blythe.Heading         = 1683;
                Blythe.AddToWorld();

                if (SAVE_INTO_DATABASE)
                {
                    Blythe.SaveIntoDatabase();
                }
            }
            else
            {
                Blythe = npcs[0];
            }

            // end npc

            statue_of_arawn = GameServer.Database.FindObjectByKey <ItemTemplate>("statue_of_arawn");
            if (statue_of_arawn == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Statue of Arawn, creating it ...");
                }

                statue_of_arawn             = new ItemTemplate();
                statue_of_arawn.Id_nb       = "statue_of_arawn";
                statue_of_arawn.Name        = "Statue of Arawn";
                statue_of_arawn.Level       = 8;
                statue_of_arawn.Item_Type   = 29;
                statue_of_arawn.Model       = 593;
                statue_of_arawn.IsDropable  = false;
                statue_of_arawn.IsPickable  = false;
                statue_of_arawn.DPS_AF      = 0;
                statue_of_arawn.SPD_ABS     = 0;
                statue_of_arawn.Object_Type = 41;
                statue_of_arawn.Hand        = 0;
                statue_of_arawn.Type_Damage = 0;
                statue_of_arawn.Quality     = 100;
                statue_of_arawn.Weight      = 12;
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(statue_of_arawn);
                }
            }

// end item
            ItemTemplate i = null;

            ClericEpicBoots = GameServer.Database.FindObjectByKey <ItemTemplate>("ClericEpicBoots");
            if (ClericEpicBoots == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Clerics Epic Boots , creating it ...");
                }

                i               = new ItemTemplate();
                i.Id_nb         = "ClericEpicBoots";
                i.Name          = "Boots of Defiant Soul";
                i.Level         = 50;
                i.Item_Type     = 23;
                i.Model         = 717;
                i.IsDropable    = true;
                i.IsPickable    = true;
                i.DPS_AF        = 100;
                i.SPD_ABS       = 27;
                i.Object_Type   = 35;
                i.Quality       = 100;
                i.Weight        = 22;
                i.Bonus         = 35;
                i.MaxCondition  = 50000;
                i.MaxDurability = 50000;
                i.Condition     = 50000;
                i.Durability    = 50000;

                i.Bonus1     = 13;
                i.Bonus1Type = (int)eStat.CON;

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

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

                i.Bonus4     = 8;
                i.Bonus4Type = (int)eResist.Spirit;

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

                ClericEpicBoots = i;
            }

// end item
            // of the Defiant Soul  Coif
            ClericEpicHelm = GameServer.Database.FindObjectByKey <ItemTemplate>("ClericEpicHelm");
            if (ClericEpicHelm == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Clerics Epic Helm , creating it ...");
                }

                i               = new ItemTemplate();
                i.Id_nb         = "ClericEpicHelm";
                i.Name          = "Coif of Defiant Soul";
                i.Level         = 50;
                i.Item_Type     = 21;
                i.Model         = 1290; // NEED TO WORK ON..
                i.IsDropable    = true;
                i.IsPickable    = true;
                i.DPS_AF        = 100;
                i.SPD_ABS       = 27;
                i.Object_Type   = 35;
                i.Quality       = 100;
                i.Weight        = 22;
                i.Bonus         = 35;
                i.MaxCondition  = 50000;
                i.MaxDurability = 50000;
                i.Condition     = 50000;
                i.Durability    = 50000;

                i.Bonus1     = 4;
                i.Bonus1Type = (int)eProperty.Focus_Enchantments;

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

                i.Bonus3     = 19;
                i.Bonus3Type = (int)eStat.PIE;

                i.Bonus4     = 8;
                i.Bonus4Type = (int)eResist.Energy;

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

                ClericEpicHelm = i;
            }

// end item
            // of the Defiant Soul  Gloves
            ClericEpicGloves = GameServer.Database.FindObjectByKey <ItemTemplate>("ClericEpicGloves");
            if (ClericEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Clerics Epic Gloves , creating it ...");
                }

                i               = new ItemTemplate();
                i.Id_nb         = "ClericEpicGloves";
                i.Name          = "Gauntlets of Defiant Soul";
                i.Level         = 50;
                i.Item_Type     = 22;
                i.Model         = 716;
                i.IsDropable    = true;
                i.IsPickable    = true;
                i.DPS_AF        = 100;
                i.SPD_ABS       = 27;
                i.Object_Type   = 35;
                i.Quality       = 100;
                i.Weight        = 22;
                i.Bonus         = 35;
                i.MaxCondition  = 50000;
                i.MaxDurability = 50000;
                i.Condition     = 50000;
                i.Durability    = 50000;

                i.Bonus1     = 4;
                i.Bonus1Type = (int)eProperty.Skill_Smiting;

                i.Bonus2     = 22;
                i.Bonus2Type = (int)eStat.PIE;

                i.Bonus3     = 8;
                i.Bonus3Type = (int)eResist.Crush;

                i.Bonus4     = 8;
                i.Bonus4Type = (int)eResist.Matter;

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

                ClericEpicGloves = i;
            }

            // of the Defiant Soul  Hauberk
            ClericEpicVest = GameServer.Database.FindObjectByKey <ItemTemplate>("ClericEpicVest");
            if (ClericEpicVest == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Clerics Epic Vest , creating it ...");
                }

                i               = new ItemTemplate();
                i.Id_nb         = "ClericEpicVest";
                i.Name          = "Habergeon of Defiant Soul";
                i.Level         = 50;
                i.Item_Type     = 25;
                i.Model         = 713;
                i.IsDropable    = true;
                i.IsPickable    = true;
                i.DPS_AF        = 100;
                i.SPD_ABS       = 27;
                i.Object_Type   = 35;
                i.Quality       = 100;
                i.Weight        = 22;
                i.Bonus         = 35;
                i.MaxCondition  = 50000;
                i.MaxDurability = 50000;
                i.Condition     = 50000;
                i.Durability    = 50000;

                i.Bonus1     = 4;
                i.Bonus1Type = (int)eResist.Crush;

                i.Bonus2     = 4;
                i.Bonus2Type = (int)eResist.Spirit;

                i.Bonus3     = 12;
                i.Bonus3Type = (int)eProperty.PowerRegenerationRate;

                i.Bonus4     = 27;
                i.Bonus4Type = (int)eProperty.MaxHealth;

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

                ClericEpicVest = i;
            }

            // of the Defiant Soul  Legs
            ClericEpicLegs = GameServer.Database.FindObjectByKey <ItemTemplate>("ClericEpicLegs");
            if (ClericEpicLegs == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Clerics Epic Legs , creating it ...");
                }

                i               = new ItemTemplate();
                i.Id_nb         = "ClericEpicLegs";
                i.Name          = "Chaussess of Defiant Soul";
                i.Level         = 50;
                i.Item_Type     = 27;
                i.Model         = 714;
                i.IsDropable    = true;
                i.IsPickable    = true;
                i.DPS_AF        = 100;
                i.SPD_ABS       = 27;
                i.Object_Type   = 35;
                i.Quality       = 100;
                i.Weight        = 22;
                i.Bonus         = 35;
                i.MaxCondition  = 50000;
                i.MaxDurability = 50000;
                i.Condition     = 50000;
                i.Durability    = 50000;

                i.Bonus1     = 4;
                i.Bonus1Type = (int)eProperty.Skill_Rejuvenation;

                i.Bonus2     = 22;
                i.Bonus2Type = (int)eStat.CON;

                i.Bonus3     = 8;
                i.Bonus3Type = (int)eResist.Slash;

                i.Bonus4     = 8;
                i.Bonus4Type = (int)eResist.Cold;

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

                ClericEpicLegs = i;
            }

            // of the Defiant Soul  Sleeves
            ClericEpicArms = GameServer.Database.FindObjectByKey <ItemTemplate>("ClericEpicArms");
            if (ClericEpicArms == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Cleric Epic Arms , creating it ...");
                }

                i               = new ItemTemplate();
                i.Id_nb         = "ClericEpicArms";
                i.Name          = "Sleeves of Defiant Soul";
                i.Level         = 50;
                i.Item_Type     = 28;
                i.Model         = 715;
                i.IsDropable    = true;
                i.IsPickable    = true;
                i.DPS_AF        = 100;
                i.SPD_ABS       = 27;
                i.Object_Type   = 35;
                i.Quality       = 100;
                i.Weight        = 22;
                i.Bonus         = 35;
                i.MaxCondition  = 50000;
                i.MaxDurability = 50000;
                i.Condition     = 50000;
                i.Durability    = 50000;

                i.Bonus1     = 16;
                i.Bonus1Type = (int)eStat.STR;

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

                i.Bonus3     = 8;
                i.Bonus3Type = (int)eResist.Thrust;

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

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

                ClericEpicArms = i;
            }

            PaladinEpicBoots = GameServer.Database.FindObjectByKey <ItemTemplate>("PaladinEpicBoots");
            if (PaladinEpicBoots == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Paladin Epic Boots , creating it ...");
                }

                i               = new ItemTemplate();
                i.Id_nb         = "PaladinEpicBoots";
                i.Name          = "Sabaton of the Iron Will";
                i.Level         = 50;
                i.Item_Type     = 23;
                i.Model         = 697;
                i.IsDropable    = true;
                i.IsPickable    = true;
                i.DPS_AF        = 100;
                i.SPD_ABS       = 34;
                i.Object_Type   = 36;
                i.Quality       = 100;
                i.Weight        = 22;
                i.Bonus         = 35;
                i.MaxCondition  = 50000;
                i.MaxDurability = 50000;
                i.Condition     = 50000;
                i.Durability    = 50000;

                i.Bonus1     = 18;
                i.Bonus1Type = (int)eStat.STR;

                i.Bonus2     = 19;
                i.Bonus2Type = (int)eStat.QUI;

                i.Bonus3     = 6;
                i.Bonus3Type = (int)eResist.Slash;

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

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

                PaladinEpicBoots = i;
            }

// end item
            // of the Iron Will Coif
            PaladinEpicHelm = GameServer.Database.FindObjectByKey <ItemTemplate>("PaladinEpicHelm");
            if (PaladinEpicHelm == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Paladin Epic Helm , creating it ...");
                }

                i               = new ItemTemplate();
                i.Id_nb         = "PaladinEpicHelm";
                i.Name          = "Hounskull of the Iron Will";
                i.Level         = 50;
                i.Item_Type     = 21;
                i.Model         = 1290; // NEED TO WORK ON..
                i.IsDropable    = true;
                i.IsPickable    = true;
                i.DPS_AF        = 100;
                i.SPD_ABS       = 34;
                i.Object_Type   = 36;
                i.Quality       = 100;
                i.Weight        = 22;
                i.Bonus         = 35;
                i.MaxCondition  = 50000;
                i.MaxDurability = 50000;
                i.Condition     = 50000;
                i.Durability    = 50000;

                i.Bonus1     = 18;
                i.Bonus1Type = (int)eStat.CON;

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

                i.Bonus3     = 6;
                i.Bonus3Type = (int)eResist.Crush;

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

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

                PaladinEpicHelm = i;
            }

// end item
            // of the Iron Will Gloves
            PaladinEpicGloves = GameServer.Database.FindObjectByKey <ItemTemplate>("PaladinEpicGloves");
            if (PaladinEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Paladin Epic Gloves , creating it ...");
                }

                i               = new ItemTemplate();
                i.Id_nb         = "PaladinEpicGloves";
                i.Name          = "Gauntlets of the Iron Will";
                i.Level         = 50;
                i.Item_Type     = 22;
                i.Model         = 696;
                i.IsDropable    = true;
                i.IsPickable    = true;
                i.DPS_AF        = 100;
                i.SPD_ABS       = 34;
                i.Object_Type   = 36;
                i.Quality       = 100;
                i.Weight        = 22;
                i.Bonus         = 35;
                i.MaxCondition  = 50000;
                i.MaxDurability = 50000;
                i.Condition     = 50000;
                i.Durability    = 50000;

                i.Bonus1     = 19;
                i.Bonus1Type = (int)eStat.STR;

                i.Bonus2     = 18;
                i.Bonus2Type = (int)eStat.QUI;

                i.Bonus3     = 6;
                i.Bonus3Type = (int)eResist.Crush;

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

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

                PaladinEpicGloves = i;
            }

            // of the Iron Will Hauberk
            PaladinEpicVest = GameServer.Database.FindObjectByKey <ItemTemplate>("PaladinEpicVest");
            if (PaladinEpicVest == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Paladin Epic Vest , creating it ...");
                }

                i               = new ItemTemplate();
                i.Id_nb         = "PaladinEpicVest";
                i.Name          = "Curiass of the Iron Will";
                i.Level         = 50;
                i.Item_Type     = 25;
                i.Model         = 693;
                i.IsDropable    = true;
                i.IsPickable    = true;
                i.DPS_AF        = 100;
                i.SPD_ABS       = 34;
                i.Object_Type   = 36;
                i.Quality       = 100;
                i.Weight        = 22;
                i.Bonus         = 35;
                i.MaxCondition  = 50000;
                i.MaxDurability = 50000;
                i.Condition     = 50000;
                i.Durability    = 50000;

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

                i.Bonus2     = 6;
                i.Bonus2Type = (int)eResist.Body;

                i.Bonus3     = 6;
                i.Bonus3Type = (int)eResist.Spirit;

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

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

                PaladinEpicVest = i;
            }

            // of the Iron Will Legs
            PaladinEpicLegs = GameServer.Database.FindObjectByKey <ItemTemplate>("PaladinEpicLegs");
            if (PaladinEpicLegs == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Paladin Epic Legs , creating it ...");
                }

                i               = new ItemTemplate();
                i.Id_nb         = "PaladinEpicLegs";
                i.Name          = "Greaves of the Iron Will";
                i.Level         = 50;
                i.Item_Type     = 27;
                i.Model         = 694;
                i.IsDropable    = true;
                i.IsPickable    = true;
                i.DPS_AF        = 100;
                i.SPD_ABS       = 34;
                i.Object_Type   = 36;
                i.Quality       = 100;
                i.Weight        = 22;
                i.Bonus         = 35;
                i.MaxCondition  = 50000;
                i.MaxDurability = 50000;
                i.Condition     = 50000;
                i.Durability    = 50000;

                i.Bonus1     = 22;
                i.Bonus1Type = (int)eStat.CON;

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

                i.Bonus3     = 6;
                i.Bonus3Type = (int)eResist.Crush;

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

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

                PaladinEpicLegs = i;
            }

            // of the Iron Will Sleeves
            PaladinEpicArms = GameServer.Database.FindObjectByKey <ItemTemplate>("PaladinEpicArms");
            if (PaladinEpicArms == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Paladin Epic Arms , creating it ...");
                }

                i               = new ItemTemplate();
                i.Id_nb         = "PaladinEpicArms";
                i.Name          = "Spaulders of the Iron Will";
                i.Level         = 50;
                i.Item_Type     = 28;
                i.Model         = 695;
                i.IsDropable    = true;
                i.IsPickable    = true;
                i.DPS_AF        = 100;
                i.SPD_ABS       = 34;
                i.Object_Type   = 36;
                i.Quality       = 100;
                i.Weight        = 22;
                i.Bonus         = 35;
                i.MaxCondition  = 50000;
                i.MaxDurability = 50000;
                i.Condition     = 50000;
                i.Durability    = 50000;

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

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

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

                i.Bonus4     = 6;
                i.Bonus4Type = (int)eResist.Spirit;

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

                PaladinEpicArms = i;
            }

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

            GameEventMgr.AddHandler(Roben, GameObjectEvent.Interact, new DOLEventHandler(TalkToRoben));
            GameEventMgr.AddHandler(Roben, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToRoben));

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

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

            /* 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 :)
             */

            masterFrederick = GetMasterFrederick();

            generalLocations[0] = new GameLocation(generalNames[0], 1, 568589, 501801, 2134, 23);
            generalLocations[1] = new GameLocation(generalNames[1], 1, 572320, 499246, 2472, 14);
            generalLocations[2] = new GameLocation(generalNames[2], 1, 571900, 510559, 2210, 170);

            GameNPC[] npcs = null;
            for (int i = 0; i < general.Length; i++)
            {
                npcs = WorldMgr.GetObjectsByName <GameNPC>(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 her ...");
                    }

                    general[i] = new GameNPC();

                    general[i].Model = 603;

                    general[i].Name    = generalNames[i];
                    general[i].X       = generalLocations[i].X;
                    general[i].Y       = generalLocations[i].Y;
                    general[i].Z       = generalLocations[i].Z;
                    general[i].Heading = generalLocations[i].Heading;

                    general[i].GuildName       = "Part of " + questTitle + " Quest";
                    general[i].Realm           = eRealm.None;
                    general[i].CurrentRegionID = generalLocations[i].RegionID;

                    general[i].Size     = 49;
                    general[i].Level    = 2;
                    general[i].Race     = 2007;
                    general[i].BodyType = 8;

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

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

                    general[i].AddToWorld();
                }
            }

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

                fairyGeneralWings.Weight = 2;
                fairyGeneralWings.Model  = 551;

                fairyGeneralWings.Object_Type = (int)eObjectType.GenericItem;

                fairyGeneralWings.Id_nb      = "fairy_general_wings";
                fairyGeneralWings.IsPickable = true;
                fairyGeneralWings.IsDropable = false;

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

            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
                GameServer.Database.AddObject(dustyOldMap);
            }

            // item db check
            recruitsArms = GameServer.Database.FindObjectByKey <ItemTemplate>("recruits_studded_arms");
            if (recruitsArms == null)
            {
                recruitsArms      = new ItemTemplate();
                recruitsArms.Name = "Recruit's Studded Arms";
                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";
                recruitsArms.Price       = Money.GetMoney(0, 0, 0, 4, 0);
                recruitsArms.IsPickable  = true;
                recruitsArms.IsDropable  = true;
                recruitsArms.Color       = 9; // red leather

                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
                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
                GameServer.Database.AddObject(recruitsSleeves);
            }

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

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

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

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

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

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Exemplo n.º 28
0
        public void OnCommand(GameClient client, string[] args)
        {
            try
            {
                if (args.Length == 2 && args[1].ToLower() == "refresh")
                {
                    client.Player.LeaveHouse();
                    client.Player.RefreshWorld();
                    return;
                }

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

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

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

                if (args.Length == 3 && args[1] == "to")
                {
                    GameClient clientc = null;
                    if (args[2].StartsWith("#"))
                    {
                        try
                        {
                            int sessionID = Convert.ToInt32(args[2].Substring(1));
                            clientc = WorldMgr.GetClientFromID(sessionID);
                        }
                        catch
                        {
                        }
                    }
                    else
                    {
                        clientc = WorldMgr.GetClientByPlayerName(args[2], false, true);
                    }

                    if (clientc == null)
                    {
                        GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>(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;
                }

                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.GetObjectsByName <GameNPC>(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;
                }

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

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

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

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

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

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

                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);
                }

                else
                {
                    DisplaySyntax(client);
                    return;
                }
            }

            catch (Exception ex)
            {
                DisplayMessage(client, ex.Message);
            }
        }
Exemplo n.º 29
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }

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

            GameNPC[] npcs;

            npcs = WorldMgr.GetObjectsByName <GameNPC>("Aegan", (eRealm)2);
            if (npcs.Length == 0)
            {
                Aegan       = new DOL.GS.GameNPC();
                Aegan.Model = 232;
                Aegan.Name  = "Aegan";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + Aegan.Name + ", creating ...");
                }

                Aegan.GuildName       = "Part of " + questTitle + " Quest";
                Aegan.Realm           = eRealm.Midgard;
                Aegan.CurrentRegionID = 100;
                Aegan.Size            = 51;
                Aegan.Level           = 41;
                Aegan.MaxSpeedBase    = 191;
                Aegan.Faction         = FactionMgr.GetFactionByID(0);
                Aegan.X               = 805398;
                Aegan.Y               = 725829;
                Aegan.Z               = 4700;
                Aegan.Heading         = 3595;
                Aegan.RespawnInterval = -1;
                Aegan.BodyType        = 0;

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

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

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

            clawofblackmauler = GameServer.Database.FindObjectByKey <ItemTemplate>("clawofblackmauler");
            if (clawofblackmauler == null)
            {
                clawofblackmauler      = new ItemTemplate();
                clawofblackmauler.Name = "Claw of Black Mauler";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + clawofblackmauler.Name + ", creating it ...");
                }

                clawofblackmauler.Level            = 50;
                clawofblackmauler.Weight           = 5;
                clawofblackmauler.Model            = 1;
                clawofblackmauler.Object_Type      = 0;
                clawofblackmauler.Item_Type        = 40;
                clawofblackmauler.Id_nb            = "clawofblackmauler";
                clawofblackmauler.Hand             = 0;
                clawofblackmauler.Price            = 0;
                clawofblackmauler.IsPickable       = true;
                clawofblackmauler.IsDropable       = true;
                clawofblackmauler.IsTradable       = true;
                clawofblackmauler.CanDropAsLoot    = false;
                clawofblackmauler.Color            = 0;
                clawofblackmauler.Bonus            = 35; // default bonus
                clawofblackmauler.Bonus1           = 0;
                clawofblackmauler.Bonus1Type       = (int)0;
                clawofblackmauler.Bonus2           = 0;
                clawofblackmauler.Bonus2Type       = (int)0;
                clawofblackmauler.Bonus3           = 0;
                clawofblackmauler.Bonus3Type       = (int)0;
                clawofblackmauler.Bonus4           = 0;
                clawofblackmauler.Bonus4Type       = (int)0;
                clawofblackmauler.Bonus5           = 0;
                clawofblackmauler.Bonus5Type       = (int)0;
                clawofblackmauler.Bonus6           = 0;
                clawofblackmauler.Bonus6Type       = (int)0;
                clawofblackmauler.Bonus7           = 0;
                clawofblackmauler.Bonus7Type       = (int)0;
                clawofblackmauler.Bonus8           = 0;
                clawofblackmauler.Bonus8Type       = (int)0;
                clawofblackmauler.Bonus9           = 0;
                clawofblackmauler.Bonus9Type       = (int)0;
                clawofblackmauler.Bonus10          = 0;
                clawofblackmauler.Bonus10Type      = (int)0;
                clawofblackmauler.ExtraBonus       = 0;
                clawofblackmauler.ExtraBonusType   = (int)0;
                clawofblackmauler.Effect           = 0;
                clawofblackmauler.Emblem           = 0;
                clawofblackmauler.Charges          = 0;
                clawofblackmauler.MaxCharges       = 0;
                clawofblackmauler.SpellID          = 0;
                clawofblackmauler.ProcSpellID      = 0;
                clawofblackmauler.Type_Damage      = 0;
                clawofblackmauler.Realm            = 0;
                clawofblackmauler.MaxCount         = 1;
                clawofblackmauler.PackSize         = 1;
                clawofblackmauler.Extension        = 0;
                clawofblackmauler.Quality          = 99;
                clawofblackmauler.Condition        = 100;
                clawofblackmauler.MaxCondition     = 100;
                clawofblackmauler.Durability       = 100;
                clawofblackmauler.MaxDurability    = 100;
                clawofblackmauler.PoisonCharges    = 0;
                clawofblackmauler.PoisonMaxCharges = 0;
                clawofblackmauler.PoisonSpellID    = 0;
                clawofblackmauler.ProcSpellID1     = 0;
                clawofblackmauler.SpellID1         = 0;
                clawofblackmauler.MaxCharges1      = 0;
                clawofblackmauler.Charges1         = 0;

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

            QuestBuilder   builder = QuestMgr.GetBuilder(typeof(Learnthehunt));
            QuestBehaviour a;

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

            // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End
            Aegan.AddQuestToGive(typeof(Learnthehunt));
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Exemplo 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 ...");
            }

            GameNPC[] npcs;

            npcs = WorldMgr.GetObjectsByName <GameNPC>("Torold Sterkkriger", (eRealm)2);
            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(151).IsDisabled)
                {
                    ToroldSterkkriger       = new DOL.GS.GameNPC();
                    ToroldSterkkriger.Model = 522;
                    ToroldSterkkriger.Name  = "Torold Sterkkriger";
                    if (log.IsWarnEnabled)
                    {
                        log.Warn("Could not find " + ToroldSterkkriger.Name + ", creating ...");
                    }

                    ToroldSterkkriger.GuildName       = "Part of " + questTitle + " Quest";
                    ToroldSterkkriger.Realm           = eRealm.Midgard;
                    ToroldSterkkriger.CurrentRegionID = 151;
                    ToroldSterkkriger.Size            = 50;
                    ToroldSterkkriger.Level           = 55;
                    ToroldSterkkriger.MaxSpeedBase    = 191;
                    ToroldSterkkriger.Faction         = FactionMgr.GetFactionByID(0);
                    ToroldSterkkriger.X               = 287623;
                    ToroldSterkkriger.Y               = 355226;
                    ToroldSterkkriger.Z               = 3488;
                    ToroldSterkkriger.Heading         = 3788;
                    ToroldSterkkriger.RespawnInterval = -1;
                    ToroldSterkkriger.BodyType        = 0;

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

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

            npcs = WorldMgr.GetObjectsByName <GameNPC>("Jorund Bruttstein", (eRealm)2);
            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(151).IsDisabled)
                {
                    JorundBruttstein       = new DOL.GS.GameNPC();
                    JorundBruttstein.Model = 513;
                    JorundBruttstein.Name  = "Jorund Bruttstein";
                    if (log.IsWarnEnabled)
                    {
                        log.Warn("Could not find " + JorundBruttstein.Name + ", creating ...");
                    }

                    JorundBruttstein.GuildName       = "Part of " + questTitle + " Quest";
                    JorundBruttstein.Realm           = eRealm.Midgard;
                    JorundBruttstein.CurrentRegionID = 151;
                    JorundBruttstein.Size            = 52;
                    JorundBruttstein.Level           = 50;
                    JorundBruttstein.MaxSpeedBase    = 191;
                    JorundBruttstein.Faction         = FactionMgr.GetFactionByID(0);
                    JorundBruttstein.X               = 287884;
                    JorundBruttstein.Y               = 356307;
                    JorundBruttstein.Z               = 3488;
                    JorundBruttstein.Heading         = 3163;
                    JorundBruttstein.RespawnInterval = -1;
                    JorundBruttstein.BodyType        = 0;

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

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

            marinefungusroot = GameServer.Database.FindObjectByKey <ItemTemplate>("marinefungusroot");
            if (marinefungusroot == null)
            {
                marinefungusroot      = new ItemTemplate();
                marinefungusroot.Name = "Marine Fungus Root";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + marinefungusroot.Name + ", creating it ...");
                }

                marinefungusroot.Level            = 50;
                marinefungusroot.Weight           = 5;
                marinefungusroot.Model            = 546;
                marinefungusroot.Object_Type      = 0;
                marinefungusroot.Item_Type        = 40;
                marinefungusroot.Id_nb            = "marinefungusroot";
                marinefungusroot.Hand             = 0;
                marinefungusroot.Price            = 0;
                marinefungusroot.IsPickable       = true;
                marinefungusroot.IsDropable       = true;
                marinefungusroot.IsTradable       = true;
                marinefungusroot.CanDropAsLoot    = false;
                marinefungusroot.Color            = 0;
                marinefungusroot.Bonus            = 35; // default bonus
                marinefungusroot.Bonus1           = 0;
                marinefungusroot.Bonus1Type       = (int)0;
                marinefungusroot.Bonus2           = 0;
                marinefungusroot.Bonus2Type       = (int)0;
                marinefungusroot.Bonus3           = 0;
                marinefungusroot.Bonus3Type       = (int)0;
                marinefungusroot.Bonus4           = 0;
                marinefungusroot.Bonus4Type       = (int)0;
                marinefungusroot.Bonus5           = 0;
                marinefungusroot.Bonus5Type       = (int)0;
                marinefungusroot.Bonus6           = 0;
                marinefungusroot.Bonus6Type       = (int)0;
                marinefungusroot.Bonus7           = 0;
                marinefungusroot.Bonus7Type       = (int)0;
                marinefungusroot.Bonus8           = 0;
                marinefungusroot.Bonus8Type       = (int)0;
                marinefungusroot.Bonus9           = 0;
                marinefungusroot.Bonus9Type       = (int)0;
                marinefungusroot.Bonus10          = 0;
                marinefungusroot.Bonus10Type      = (int)0;
                marinefungusroot.ExtraBonus       = 0;
                marinefungusroot.ExtraBonusType   = (int)0;
                marinefungusroot.Effect           = 0;
                marinefungusroot.Emblem           = 0;
                marinefungusroot.Charges          = 0;
                marinefungusroot.MaxCharges       = 0;
                marinefungusroot.SpellID          = 0;
                marinefungusroot.ProcSpellID      = 0;
                marinefungusroot.Type_Damage      = 0;
                marinefungusroot.Realm            = 0;
                marinefungusroot.MaxCount         = 1;
                marinefungusroot.PackSize         = 1;
                marinefungusroot.Extension        = 0;
                marinefungusroot.Quality          = 99;
                marinefungusroot.Condition        = 50000;
                marinefungusroot.MaxCondition     = 50000;
                marinefungusroot.Durability       = 50000;
                marinefungusroot.MaxDurability    = 50000;
                marinefungusroot.PoisonCharges    = 0;
                marinefungusroot.PoisonMaxCharges = 0;
                marinefungusroot.PoisonSpellID    = 0;
                marinefungusroot.ProcSpellID1     = 0;
                marinefungusroot.SpellID1         = 0;
                marinefungusroot.MaxCharges1      = 0;
                marinefungusroot.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(marinefungusroot);
                }
            }

            QuestBuilder   builder = QuestMgr.GetBuilder(typeof(trialofstrength));
            QuestBehaviour a;

            a = builder.CreateBehaviour(ToroldSterkkriger, -1);
            a.AddTrigger(eTriggerType.Interact, null, ToroldSterkkriger);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(trialofstrength), ToroldSterkkriger);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.trialofstrength), null, (eComparator)5);
            a.AddRequirement(eRequirementType.Class, 35, false);
            a.AddAction(eActionType.Talk, "Hail. I am Torold, and I shall be your trainer in this wild land. King Goran Stonefist and his brother Stonelock have charged me with training all young Vikings to prepare them to join the ranks of King Goran's army to aid in the exploration of Aegir. Aegir is a wild, untamed place, and it's made even more dangerous for a your Viking like you by the presence of [Morvaltar].", ToroldSterkkriger);
            AddBehaviour(a);
            a = builder.CreateBehaviour(ToroldSterkkriger, -1);
            a.AddTrigger(eTriggerType.Interact, null, ToroldSterkkriger);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.trialofstrength), ToroldSterkkriger);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.trialofstrength), null, (eComparator)5);
            a.AddRequirement(eRequirementType.Class, 38, false);
            a.AddAction(eActionType.Talk, "Hail. I am Torold, and I shall be your trainer in this wild land. King Goran Stonefist and his brother Stonelock have charged me with training all young Rogue to prepare them to join the ranks of King Goran's army to aid in the exploration of Aegir. Aegir is a wild, untamed place, and it's made even more dangerous for a your Rogue like you by the presence of [Morvaltar].", ToroldSterkkriger);
            AddBehaviour(a);
            a = builder.CreateBehaviour(ToroldSterkkriger, -1);
            a.AddTrigger(eTriggerType.Whisper, "Morvaltar", ToroldSterkkriger);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.trialofstrength), ToroldSterkkriger);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.trialofstrength), null, (eComparator)5);
            a.AddAction(eActionType.Talk, "As you may know, the Morvaltar are your wild cousins. We of Midgard do not fear Valkyn like you, for as a group you have more than proven your loyalty to King Goran. Many Valkyn have also proven that they are strong, intelligent, and brave. These are [the qualities] that all Vikings must possess before they can choose where their destiny lies.", ToroldSterkkriger);
            AddBehaviour(a);
            a = builder.CreateBehaviour(ToroldSterkkriger, -1);
            a.AddTrigger(eTriggerType.Whisper, "the qualities", ToroldSterkkriger);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.trialofstrength), ToroldSterkkriger);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.trialofstrength), null, (eComparator)5);
            a.AddRequirement(eRequirementType.Class, 35, false);
            a.AddAction(eActionType.Talk, "Now, young one, prepare yourself. You have three trials to face before I can allow you to make your destiny. These trials are designed to separate the true Vikings from the everyday Valkyn. So, prepare yourself now, for you trial is waiting for you. It is a test to [prove your strength]. Only the strongest will survive in this land.", ToroldSterkkriger);
            AddBehaviour(a);
            a = builder.CreateBehaviour(ToroldSterkkriger, -1);
            a.AddTrigger(eTriggerType.Whisper, "the qualities", ToroldSterkkriger);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.trialofstrength), ToroldSterkkriger);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.trialofstrength), null, (eComparator)5);
            a.AddRequirement(eRequirementType.Class, 38, false);
            a.AddAction(eActionType.Talk, "Now, young one, prepare yourself. You have three trials to face before I can allow you to make your destiny. These trials are designed to separate the true Rogues from the everyday Valkyn. So, prepare yourself now, for you trial is waiting for you. It is a test to [prove your strength]. Only the strongest will survive in this land.", ToroldSterkkriger);
            AddBehaviour(a);
            a = builder.CreateBehaviour(ToroldSterkkriger, -1);
            a.AddTrigger(eTriggerType.Whisper, "prove your strength", ToroldSterkkriger);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.trialofstrength), ToroldSterkkriger);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.trialofstrength), null, (eComparator)5);
            a.AddAction(eActionType.OfferQuest, typeof(trialofstrength), "Will you prove you have the strength to survive in the land of Aegir?");
            AddBehaviour(a);
            a = builder.CreateBehaviour(ToroldSterkkriger, -1);
            a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(DOL.GS.Quests.Midgard.trialofstrength));
            a.AddAction(eActionType.Talk, "No problem. See you", ToroldSterkkriger);
            AddBehaviour(a);
            a = builder.CreateBehaviour(ToroldSterkkriger, -1);
            a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(DOL.GS.Quests.Midgard.trialofstrength));
            a.AddAction(eActionType.GiveQuest, typeof(DOL.GS.Quests.Midgard.trialofstrength), ToroldSterkkriger);
            a.AddAction(eActionType.Talk, "Seek out Jorund Bruttstein in Aegirhamn. Tell him your name when he asks.", ToroldSterkkriger);
            AddBehaviour(a);
            a = builder.CreateBehaviour(JorundBruttstein, -1);
            a.AddTrigger(eTriggerType.Interact, null, JorundBruttstein);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 1, (eComparator)3);
            a.AddRequirement(eRequirementType.Class, 35, false);
            a.AddAction(eActionType.Talk, "Lo, I see a young Viking before me. What is your name? Speak up!", JorundBruttstein);
            a.AddAction(eActionType.Talk, "You are here to prove that you have the strength in you to endure in this land. The trial is simple in nature, but unless you are strong, may prove difficult to execute. You must venture out and face [one of the creatures] that roam this land.", JorundBruttstein);
            a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(JorundBruttstein, -1);
            a.AddTrigger(eTriggerType.Interact, null, JorundBruttstein);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 1, (eComparator)3);
            a.AddRequirement(eRequirementType.Class, 38, false);
            a.AddAction(eActionType.Talk, "Lo, I see a young Rogue before me. What is your name? Speak up!", JorundBruttstein);
            a.AddAction(eActionType.Talk, "You are here to prove that you have the strength in you to endure in this land. The trial is simple in nature, but unless you are strong, may prove difficult to execute. You must venture out and face [one of the creatures] that roam this land.", JorundBruttstein);
            a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(JorundBruttstein, -1);
            a.AddTrigger(eTriggerType.Whisper, "one of the creatures", JorundBruttstein);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 2, (eComparator)3);
            a.AddAction(eActionType.Talk, "You must seek out a marine fungus. They may be found in the waters south and southwest of here. Find one and defeat it. Once you have, obtain proof that you have accomplished this test. Return to me here.", JorundBruttstein);
            AddBehaviour(a);
            a = builder.CreateBehaviour(ToroldSterkkriger, -1);
            a.AddTrigger(eTriggerType.EnemyKilled, "marine fungus", null);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 2, (eComparator)3);
            a.AddAction(eActionType.GiveItem, marinefungusroot, null);
            a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(JorundBruttstein, -1);
            a.AddTrigger(eTriggerType.Interact, null, JorundBruttstein);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 3, (eComparator)3);
            a.AddAction(eActionType.Talk, "So, you managed to survive, but anyone can run away. Show me the proof you defeated the marine fungus.", JorundBruttstein);
            a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(JorundBruttstein, -1);
            a.AddTrigger(eTriggerType.GiveItem, JorundBruttstein, marinefungusroot);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 4, (eComparator)3);
            a.AddRequirement(eRequirementType.Class, 35, false);
            a.AddAction(eActionType.Talk, "Well done. I do not like to be so rough with young Vikings, but I must be. I do not want to see anyone die because I failed to do my job. But you have proven that you have the potential for great strength. I shall let your trainer know of your success.", JorundBruttstein);
            a.AddAction(eActionType.GiveXP, 20, null);
            a.AddAction(eActionType.GiveGold, 230, null);
            a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.trialofstrength), null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(JorundBruttstein, -1);
            a.AddTrigger(eTriggerType.GiveItem, JorundBruttstein, marinefungusroot);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 4, (eComparator)3);
            a.AddRequirement(eRequirementType.Class, 38, false);
            a.AddAction(eActionType.Talk, "\"Well done. I do not like to be so rough with young Rogues, but I must be. I do not want to see anyone die because I failed to do my job. But you have proven that you have the potential for great strength. I shall let your trainer know of your success.", JorundBruttstein);
            a.AddAction(eActionType.GiveXP, 20, null);
            a.AddAction(eActionType.GiveGold, 230, null);
            a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.trialofstrength), null);
            AddBehaviour(a);

            // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End
            if (ToroldSterkkriger != null)
            {
                ToroldSterkkriger.AddQuestToGive(typeof(trialofstrength));
            }

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