Пример #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 ...");
            }

            #region defineNPCs

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

            #endregion

            #region defineItems

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

            #endregion

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

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

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

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Пример #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 ...");
            }

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

            #region defineNPCs

            addrir = GetAddrir();

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

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

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

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

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

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

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

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

            #endregion

            #region defineItems

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

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

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

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

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

                sackOfSupplies.Object_Type = (int)eObjectType.GenericItem;

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

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

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

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

                crateOfVegetables.Object_Type = (int)eObjectType.GenericItem;

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

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

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

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

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

                recruitsCloak.Bonus = 1;                 // default bonus

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

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

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

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

            #endregion

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

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

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

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

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

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Пример #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 ...");
            }


            #region defineNPCS

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

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

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

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

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

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

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

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

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

            LadyGrynoch.AddQuestToGive(typeof(ToReachTheBreach));

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Пример #4
0
 /// <summary>
 /// Registers the needed EventHandler for this Trigger
 /// </summary>
 /// <remarks>
 /// This method will be called multiple times, so use AddHandlerUnique to make
 /// sure only one handler is actually registered
 /// </remarks>
 public override void Register()
 {
     GameEventMgr.AddHandler(I, AreaEvent.PlayerEnter, NotifyHandler);
 }
Пример #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 ...");
            }

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

            #region defineNPCs

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


            #endregion

            #region defineItems



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


            #endregion

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

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

            GameEventMgr.AddHandler(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");
            }
        }
Пример #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 :)
             */

            #region defineNPCs

            masterFrederick = GetMasterFrederick();

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

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

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

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

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

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

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

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

            #endregion

            #region defineItems

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


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

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

                sackOfSupplies.Object_Type = (int)eObjectType.GenericItem;

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

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

                GameServer.Database.AddObject(sackOfSupplies);
            }

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

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

                crateOfVegetables.Object_Type = (int)eObjectType.GenericItem;

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

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

                GameServer.Database.AddObject(crateOfVegetables);
            }

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

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

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

                recruitsCloak.Bonus = 1;                 // default bonus

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

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

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

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

                GameServer.Database.AddObject(recruitsCloak);
            }

            #endregion

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

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

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

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

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

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

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Пример #7
0
 public static void OnScriptLoaded(DOLEvent e, object sender, EventArgs args)
 {
     Utility.DEBUG_LOG("Level up to level 50 script loaded");
     GameEventMgr.AddHandler(DatabaseEvent.CharacterCreated, OnCharacterCreate);
 }
Пример #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 :)
             */

            #region defineNPCs

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Atheleys Sy'Lian", 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)
            {
                atheleys       = new GameNPC();
                atheleys.Model = 87;
                atheleys.Name  = "Atheleys Sy'Lian";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + atheleys.Name + ", creating him ...");
                }
                atheleys.Realm           = eRealm.Albion;
                atheleys.CurrentRegionID = 1;
                atheleys.Size            = 50;
                atheleys.Level           = 30;
                atheleys.X       = 574375;
                atheleys.Y       = 530243;
                atheleys.Z       = 2906;
                atheleys.Heading = 1922;

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


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

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


            if (npcs.Length == 0)
            {
                //TODO insert proper attributes
                mostram       = new GameNPC();
                mostram.Model = 18;
                mostram.Name  = "Mostram";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Mostram, creating him ...");
                }
                mostram.GuildName       = "";
                mostram.Realm           = eRealm.None;
                mostram.CurrentRegionID = 1;
                mostram.Size            = 52;
                mostram.Level           = 9;
                mostram.X       = 574338;
                mostram.Y       = 536865;
                mostram.Z       = 2361;
                mostram.Heading = 57;

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


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


            #endregion

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

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

            GameEventMgr.AddHandler(atheleys, GameLivingEvent.Interact, new DOLEventHandler(TalkToAtheleys));
            GameEventMgr.AddHandler(atheleys, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToAtheleys));

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

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Пример #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 ...");
            }

            /* 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");
            }
        }
Пример #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");
            }
        }
Пример #11
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            }

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

            #region defineNPCs

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

            /* Whops, if the npcs array length is 0 then no Sir Quait exists in
             * this users Mob Database, so we simply create one ;-)
             * else we take the existing one. And if more than one exist, we take
             * the first ...
             */
            if (npcs.Length == 0)
            {
                argusBowman       = new GameNPC();
                argusBowman.Model = 40;
                argusBowman.Name  = "Argus Bowman";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + argusBowman.Name + ", creating him ...");
                }
                argusBowman.GuildName       = "Weapon Merchant";
                argusBowman.Realm           = eRealm.Albion;
                argusBowman.CurrentRegionID = 1;
                argusBowman.Size            = 50;
                argusBowman.Level           = 18;
                argusBowman.X       = 530594;
                argusBowman.Y       = 480120;
                argusBowman.Z       = 2251;
                argusBowman.Heading = 1627;

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


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


            #endregion

            #region defineItems



            magicalWood = GameServer.Database.FindObjectByKey <ItemTemplate>("ludlow_magical_wood");
            if (magicalWood == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Ludlow Magical Wood, creating it ...");
                }
                magicalWood             = new ItemTemplate();
                magicalWood.Object_Type = 0;
                magicalWood.Id_nb       = "ludlow_magical_wood";
                magicalWood.Name        = "Ludlow Magical Wood";
                magicalWood.Level       = 1;
                magicalWood.Model       = 520;
                magicalWood.IsDropable  = false;
                magicalWood.IsPickable  = false;
                magicalWood.Weight      = 5;
                GameServer.Database.AddObject(magicalWood);
            }

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

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

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

                dullBlackGem.Bonus = 5; // default bonus

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

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

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

            #endregion

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

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

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

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Пример #12
0
 protected override void AddHandlers()
 {
     GameEventMgr.AddHandler(m_pet, GameNPCEvent.ArriveAtTarget, BomberArriveAtTarget);
 }
Пример #13
0
 public override void OnEffectRestored(GameSpellEffect effect, int[] vars)
 {
     GameEventMgr.AddHandler(effect.Owner, GameLivingEvent.AttackedByEnemy, new DOLEventHandler(OnAttack));
 }
 /// <summary>
 /// Registers the needed EventHandler for this Trigger
 /// </summary>
 /// <remarks>
 /// This method will be called multiple times, so use AddHandlerUnique to make
 /// sure only one handler is actually registered
 /// </remarks>
 public override void Register()
 {
     //GameEventMgr.AddHandler(I, GameLivingEvent.WhisperReceive, NotifyHandler);
     GameEventMgr.AddHandler(I, GameObjectEvent.Interact, NotifyHandler);
 }
Пример #15
0
 /// <summary>
 /// Called when effect is to be started
 /// </summary>
 /// <param name="living"></param>
 public override void Start(GameLiving living)
 {
     base.Start(living);
     GameEventMgr.AddHandler(m_owner, GameLivingEvent.AttackFinished, new DOLEventHandler(AttackFinished));
 }
Пример #16
0
 public static void OnServerStart(DOLEvent e, object sender, EventArgs arguments)
 {
     GameEventMgr.AddHandler(GamePlayerEvent.GameEntered, new DOLEventHandler(PlayerEntered));
 }
 public static void OnScriptLoaded(DOLEvent e, object sender, EventArgs args)
 {
     InitStarterEquipment();
     GameEventMgr.AddHandler(DatabaseEvent.CharacterCreated, new DOLEventHandler(OnCharacterCreation));
 }
Пример #18
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            }

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

            #region defineNPCs

            dalikor = GetDalikor();

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

            #endregion

            #region defineItems

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

            #endregion

            /* Now we add some hooks to the npc we found.
             * Actually, we want to know when a player interacts with him.
             * So, we hook the right-click (interact) and the whisper method
             * of npc and set the callback method to the "TalkToXXX"
             * method. This means, the "TalkToXXX" method is called whenever
             * a player right clicks on him or when he whispers to him.
             */
            //We want to be notified whenever a player enters the world
            GameEventMgr.AddHandler(GamePlayerEvent.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");
            }
        }
Пример #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.GetNPCsByName("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");
            }
        }
Пример #20
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }

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

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

            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");
            }
        }
Пример #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 certain Realm. If we find a the players,
             * this means we don't have to create a new one.
             *
             * NOTE: You can do anything you want in this method, you don't have
             * to search for NPC's ... you could create a custom item, place it
             * on the ground and if a player picks it up, he will get the quest!
             * Just examples, do anything you like and feel comfortable with :)
             */

            #region defineNPCs

            masterFrederick = GetMasterFrederick();

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

            #endregion

            #region defineItems

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

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

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


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

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

            #endregion

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

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

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

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

            GameEventMgr.AddHandler(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");
            }
        }
 protected override void AddHandlers()
 {
     GameEventMgr.AddHandler(m_pet, GameLivingEvent.AttackFinished, EventHandler);
 }
Пример #23
0
 public static void OnScriptLoaded(DOLEvent e, object sender, EventArgs args)
 {
     Utility.DEBUG_LOG("Teleport to battle ground script loaded");
     GameEventMgr.AddHandler(GamePlayerEvent.GameEntered, OnGameEntered);
 }
Пример #24
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            }

            #region defineNPCs

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

            if (npcs.Length > 0)
            {
                foreach (GameNPC npc in npcs)
                {
                    if (npc.CurrentRegionID == 1 && npc.X == 408557 && npc.Y == 651675)
                    {
                        Roben = npc;
                        break;
                    }
                }
            }

            if (Roben == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Roben , creating it ...");
                }
                Roben                 = new GameNPC();
                Roben.Model           = 36;
                Roben.Name            = "Roben Fraomar";
                Roben.GuildName       = "";
                Roben.Realm           = eRealm.Albion;
                Roben.CurrentRegionID = 1;
                Roben.Size            = 52;
                Roben.Level           = 50;
                Roben.X               = 408557;
                Roben.Y               = 651675;
                Roben.Z               = 5200;
                Roben.Heading         = 3049;
                Roben.AddToWorld();

                if (SAVE_INTO_DATABASE)
                {
                    Roben.SaveIntoDatabase();
                }
            }
            // end npc

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

            if (npcs.Length > 0)
            {
                foreach (GameNPC npc in npcs)
                {
                    if (npc.CurrentRegionID == 1 && npc.X == 322231 && npc.Y == 671546)
                    {
                        Blythe = npc;
                        break;
                    }
                }
            }

            if (Blythe == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Blythe , creating it ...");
                }
                Blythe                 = new GameNPC();
                Blythe.Model           = 67;
                Blythe.Name            = "Sister Blythe";
                Blythe.GuildName       = "";
                Blythe.Realm           = eRealm.None;
                Blythe.CurrentRegionID = 1;
                Blythe.Size            = 50;
                Blythe.Level           = 69;
                Blythe.X               = 322231;
                Blythe.Y               = 671546;
                Blythe.Z               = 2762;
                Blythe.Heading         = 1683;
                Blythe.AddToWorld();

                if (SAVE_INTO_DATABASE)
                {
                    Blythe.SaveIntoDatabase();
                }
            }
            // end npc

            #endregion

            #region defineItems

            statue_of_arawn = GameServer.Database.FindObjectByKey <ItemTemplate>("statue_of_arawn");
            if (statue_of_arawn == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Statue of Arawn, creating it ...");
                }
                statue_of_arawn             = new ItemTemplate();
                statue_of_arawn.Id_nb       = "statue_of_arawn";
                statue_of_arawn.Name        = "Statue of Arawn";
                statue_of_arawn.Level       = 8;
                statue_of_arawn.Item_Type   = 29;
                statue_of_arawn.Model       = 593;
                statue_of_arawn.IsDropable  = false;
                statue_of_arawn.IsPickable  = false;
                statue_of_arawn.DPS_AF      = 0;
                statue_of_arawn.SPD_ABS     = 0;
                statue_of_arawn.Object_Type = 41;
                statue_of_arawn.Hand        = 0;
                statue_of_arawn.Type_Damage = 0;
                statue_of_arawn.Quality     = 100;
                statue_of_arawn.Weight      = 12;
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(statue_of_arawn);
                }
            }
// end item
            ItemTemplate i = null;
            ClericEpicBoots = GameServer.Database.FindObjectByKey <ItemTemplate>("ClericEpicBoots");
            if (ClericEpicBoots == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Clerics Epic Boots , creating it ...");
                }
                i               = new ItemTemplate();
                i.Id_nb         = "ClericEpicBoots";
                i.Name          = "Boots of Defiant Soul";
                i.Level         = 50;
                i.Item_Type     = 23;
                i.Model         = 717;
                i.IsDropable    = true;
                i.IsPickable    = true;
                i.DPS_AF        = 100;
                i.SPD_ABS       = 27;
                i.Object_Type   = 35;
                i.Quality       = 100;
                i.Weight        = 22;
                i.Bonus         = 35;
                i.MaxCondition  = 50000;
                i.MaxDurability = 50000;
                i.Condition     = 50000;
                i.Durability    = 50000;

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

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

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

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

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

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

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

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

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

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

                ClericEpicHelm = i;
            }
//end item
            //of the Defiant Soul  Gloves
            ClericEpicGloves = GameServer.Database.FindObjectByKey <ItemTemplate>("ClericEpicGloves");
            if (ClericEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Clerics Epic Gloves , creating it ...");
                }
                i               = new ItemTemplate();
                i.Id_nb         = "ClericEpicGloves";
                i.Name          = "Gauntlets of Defiant Soul";
                i.Level         = 50;
                i.Item_Type     = 22;
                i.Model         = 716;
                i.IsDropable    = true;
                i.IsPickable    = true;
                i.DPS_AF        = 100;
                i.SPD_ABS       = 27;
                i.Object_Type   = 35;
                i.Quality       = 100;
                i.Weight        = 22;
                i.Bonus         = 35;
                i.MaxCondition  = 50000;
                i.MaxDurability = 50000;
                i.Condition     = 50000;
                i.Durability    = 50000;

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

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

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

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

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

                ClericEpicGloves = i;
            }
            //of the Defiant Soul  Hauberk
            ClericEpicVest = GameServer.Database.FindObjectByKey <ItemTemplate>("ClericEpicVest");
            if (ClericEpicVest == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Clerics Epic Vest , creating it ...");
                }
                i               = new ItemTemplate();
                i.Id_nb         = "ClericEpicVest";
                i.Name          = "Habergeon of Defiant Soul";
                i.Level         = 50;
                i.Item_Type     = 25;
                i.Model         = 713;
                i.IsDropable    = true;
                i.IsPickable    = true;
                i.DPS_AF        = 100;
                i.SPD_ABS       = 27;
                i.Object_Type   = 35;
                i.Quality       = 100;
                i.Weight        = 22;
                i.Bonus         = 35;
                i.MaxCondition  = 50000;
                i.MaxDurability = 50000;
                i.Condition     = 50000;
                i.Durability    = 50000;

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

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

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

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

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(i);
                }
                ClericEpicVest = i;
            }
            //of the Defiant Soul  Legs
            ClericEpicLegs = GameServer.Database.FindObjectByKey <ItemTemplate>("ClericEpicLegs");
            if (ClericEpicLegs == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Clerics Epic Legs , creating it ...");
                }
                i               = new ItemTemplate();
                i.Id_nb         = "ClericEpicLegs";
                i.Name          = "Chaussess of Defiant Soul";
                i.Level         = 50;
                i.Item_Type     = 27;
                i.Model         = 714;
                i.IsDropable    = true;
                i.IsPickable    = true;
                i.DPS_AF        = 100;
                i.SPD_ABS       = 27;
                i.Object_Type   = 35;
                i.Quality       = 100;
                i.Weight        = 22;
                i.Bonus         = 35;
                i.MaxCondition  = 50000;
                i.MaxDurability = 50000;
                i.Condition     = 50000;
                i.Durability    = 50000;

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

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

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

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

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

                ClericEpicLegs = i;
            }
            //of the Defiant Soul  Sleeves
            ClericEpicArms = GameServer.Database.FindObjectByKey <ItemTemplate>("ClericEpicArms");
            if (ClericEpicArms == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Cleric Epic Arms , creating it ...");
                }
                i               = new ItemTemplate();
                i.Id_nb         = "ClericEpicArms";
                i.Name          = "Sleeves of Defiant Soul";
                i.Level         = 50;
                i.Item_Type     = 28;
                i.Model         = 715;
                i.IsDropable    = true;
                i.IsPickable    = true;
                i.DPS_AF        = 100;
                i.SPD_ABS       = 27;
                i.Object_Type   = 35;
                i.Quality       = 100;
                i.Weight        = 22;
                i.Bonus         = 35;
                i.MaxCondition  = 50000;
                i.MaxDurability = 50000;
                i.Condition     = 50000;
                i.Durability    = 50000;

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

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

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

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

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

                ClericEpicArms = i;
            }

            PaladinEpicBoots = GameServer.Database.FindObjectByKey <ItemTemplate>("PaladinEpicBoots");
            if (PaladinEpicBoots == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Paladin Epic Boots , creating it ...");
                }
                i               = new ItemTemplate();
                i.Id_nb         = "PaladinEpicBoots";
                i.Name          = "Sabaton of the Iron Will";
                i.Level         = 50;
                i.Item_Type     = 23;
                i.Model         = 697;
                i.IsDropable    = true;
                i.IsPickable    = true;
                i.DPS_AF        = 100;
                i.SPD_ABS       = 34;
                i.Object_Type   = 36;
                i.Quality       = 100;
                i.Weight        = 22;
                i.Bonus         = 35;
                i.MaxCondition  = 50000;
                i.MaxDurability = 50000;
                i.Condition     = 50000;
                i.Durability    = 50000;

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

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

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

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

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

                PaladinEpicBoots = i;
            }
//end item
            //of the Iron Will Coif
            PaladinEpicHelm = GameServer.Database.FindObjectByKey <ItemTemplate>("PaladinEpicHelm");
            if (PaladinEpicHelm == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Paladin Epic Helm , creating it ...");
                }
                i               = new ItemTemplate();
                i.Id_nb         = "PaladinEpicHelm";
                i.Name          = "Hounskull of the Iron Will";
                i.Level         = 50;
                i.Item_Type     = 21;
                i.Model         = 1290;         //NEED TO WORK ON..
                i.IsDropable    = true;
                i.IsPickable    = true;
                i.DPS_AF        = 100;
                i.SPD_ABS       = 34;
                i.Object_Type   = 36;
                i.Quality       = 100;
                i.Weight        = 22;
                i.Bonus         = 35;
                i.MaxCondition  = 50000;
                i.MaxDurability = 50000;
                i.Condition     = 50000;
                i.Durability    = 50000;

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

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

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

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

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

                PaladinEpicHelm = i;
            }
//end item
            //of the Iron Will Gloves
            PaladinEpicGloves = GameServer.Database.FindObjectByKey <ItemTemplate>("PaladinEpicGloves");
            if (PaladinEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Paladin Epic Gloves , creating it ...");
                }
                i               = new ItemTemplate();
                i.Id_nb         = "PaladinEpicGloves";
                i.Name          = "Gauntlets of the Iron Will";
                i.Level         = 50;
                i.Item_Type     = 22;
                i.Model         = 696;
                i.IsDropable    = true;
                i.IsPickable    = true;
                i.DPS_AF        = 100;
                i.SPD_ABS       = 34;
                i.Object_Type   = 36;
                i.Quality       = 100;
                i.Weight        = 22;
                i.Bonus         = 35;
                i.MaxCondition  = 50000;
                i.MaxDurability = 50000;
                i.Condition     = 50000;
                i.Durability    = 50000;

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

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

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

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

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

                PaladinEpicGloves = i;
            }
            //of the Iron Will Hauberk
            PaladinEpicVest = GameServer.Database.FindObjectByKey <ItemTemplate>("PaladinEpicVest");
            if (PaladinEpicVest == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Paladin Epic Vest , creating it ...");
                }
                i               = new ItemTemplate();
                i.Id_nb         = "PaladinEpicVest";
                i.Name          = "Curiass of the Iron Will";
                i.Level         = 50;
                i.Item_Type     = 25;
                i.Model         = 693;
                i.IsDropable    = true;
                i.IsPickable    = true;
                i.DPS_AF        = 100;
                i.SPD_ABS       = 34;
                i.Object_Type   = 36;
                i.Quality       = 100;
                i.Weight        = 22;
                i.Bonus         = 35;
                i.MaxCondition  = 50000;
                i.MaxDurability = 50000;
                i.Condition     = 50000;
                i.Durability    = 50000;

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

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

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

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

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

                PaladinEpicVest = i;
            }
            //of the Iron Will Legs
            PaladinEpicLegs = GameServer.Database.FindObjectByKey <ItemTemplate>("PaladinEpicLegs");
            if (PaladinEpicLegs == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Paladin Epic Legs , creating it ...");
                }
                i               = new ItemTemplate();
                i.Id_nb         = "PaladinEpicLegs";
                i.Name          = "Greaves of the Iron Will";
                i.Level         = 50;
                i.Item_Type     = 27;
                i.Model         = 694;
                i.IsDropable    = true;
                i.IsPickable    = true;
                i.DPS_AF        = 100;
                i.SPD_ABS       = 34;
                i.Object_Type   = 36;
                i.Quality       = 100;
                i.Weight        = 22;
                i.Bonus         = 35;
                i.MaxCondition  = 50000;
                i.MaxDurability = 50000;
                i.Condition     = 50000;
                i.Durability    = 50000;

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

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

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

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

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

                PaladinEpicLegs = i;
            }
            //of the Iron Will Sleeves
            PaladinEpicArms = GameServer.Database.FindObjectByKey <ItemTemplate>("PaladinEpicArms");
            if (PaladinEpicArms == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Paladin Epic Arms , creating it ...");
                }
                i               = new ItemTemplate();
                i.Id_nb         = "PaladinEpicArms";
                i.Name          = "Spaulders of the Iron Will";
                i.Level         = 50;
                i.Item_Type     = 28;
                i.Model         = 695;
                i.IsDropable    = true;
                i.IsPickable    = true;
                i.DPS_AF        = 100;
                i.SPD_ABS       = 34;
                i.Object_Type   = 36;
                i.Quality       = 100;
                i.Weight        = 22;
                i.Bonus         = 35;
                i.MaxCondition  = 50000;
                i.MaxDurability = 50000;
                i.Condition     = 50000;
                i.Durability    = 50000;

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

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

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

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

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

                PaladinEpicArms = i;
            }

            #endregion

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

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

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

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Пример #25
0
 public override void OnEffectRestored(GameSpellEffect effect, int[] vars)
 {
     GameEventMgr.AddHandler(effect.Owner, EventType, new DOLEventHandler(EventHandler));
 }
Пример #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 ...");
            }

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

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Elvar Ironhand", eRealm.Albion);

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

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 12);
                elvarIronhand.Inventory = template.CloseTemplate();
                elvarIronhand.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                elvarIronhand.Size    = 54;
                elvarIronhand.Level   = 17;
                elvarIronhand.X       = 561351;
                elvarIronhand.Y       = 510292;
                elvarIronhand.Z       = 2400;
                elvarIronhand.Heading = 3982;

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

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

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

            #endregion

            #region defineItems

            // item db check
            wellPreservedBones = GameServer.Database.FindObjectByKey <ItemTemplate>("well_preserved_bone");
            if (wellPreservedBones == null)
            {
                wellPreservedBones      = new ItemTemplate();
                wellPreservedBones.Name = "Well-Preserved Bone";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + wellPreservedBones.Name + ", creating it ...");
                }

                wellPreservedBones.Level  = 0;
                wellPreservedBones.Weight = 1;
                wellPreservedBones.Model  = 497;

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

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


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

                GameServer.Database.AddObject(wellPreservedBones);
            }

            // item db check
            twoWellPreservedBones = GameServer.Database.FindObjectByKey <ItemTemplate>("two_well_preserved_bones");
            if (twoWellPreservedBones == null)
            {
                twoWellPreservedBones      = new ItemTemplate();
                twoWellPreservedBones.Name = "Two Well-Preserved Bones";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + twoWellPreservedBones.Name + ", creating it ...");
                }

                twoWellPreservedBones.Level  = 0;
                twoWellPreservedBones.Weight = 1;
                twoWellPreservedBones.Model  = 497;

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

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


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

                GameServer.Database.AddObject(twoWellPreservedBones);
            }

            #endregion


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

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

            GameEventMgr.AddHandler(elvarIronhand, GameLivingEvent.Interact, new DOLEventHandler(TalkToElvarIronhand));
            GameEventMgr.AddHandler(elvarIronhand, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToElvarIronhand));

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

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Пример #27
0
 public override bool AddToWorld()
 {
     new RegionTimer(this, new RegionTimerCallback(PulseTimer), 1000);
     GameEventMgr.AddHandler(m_caster, GamePlayerEvent.RemoveFromWorld, new DOLEventHandler(PlayerLeftWorld));
     return(base.AddToWorld());
 }
 public override void OnEffectRestored(GameSpellEffect effect, int[] vars)
 {
     effect.Owner.TempProperties.setProperty(ABLATIVE_HP, (int)vars[1]);
     GameEventMgr.AddHandler(effect.Owner, GameLivingEvent.AttackedByEnemy, new DOLEventHandler(OnAttack));
 }
Пример #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 = 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");
            }
        }
Пример #30
0
 public override void OnEffectStart(GameSpellEffect effect)
 {
     base.OnEffectStart(effect);
     GameEventMgr.AddHandler(Caster, GamePlayerEvent.AttackedByEnemy, new DOLEventHandler(OnAttack));
     Caster.Endurance -= endurance;
 }