Exemplo n.º 1
0
 private static void OnPlayerLeft(DOLEvent e,object sender,EventArgs arguments)
 {
     if(!(sender is GamePlayer)) return;
     GamePlayer player = sender as GamePlayer;
     lock(player.Inventory)
     {
         var items = player.Inventory.GetItemRange(eInventorySlot.FirstBackpack, eInventorySlot.LastBackpack);
         foreach(InventoryItem invItem in items)
         {
             if(invItem.Id_nb.Equals("Artef_Javelin"))
             {
                 player.Inventory.RemoveItem(invItem);
             }
         }
     }
     GameEventMgr.RemoveHandler(sender, GamePlayerEvent.Quit, OnPlayerLeft);
 }
Exemplo n.º 2
0
        private static void OnPlayerReleased(DOLEvent e, object sender, EventArgs arguments)
        {
            if (!(sender is GamePlayer))
                return;

            GamePlayer player = sender as GamePlayer;

			lock (player.Inventory)
			{
                var items = player.Inventory.GetItemRange(eInventorySlot.MinEquipable, eInventorySlot.LastBackpack);
				foreach (InventoryItem invItem in items)
				{
                    if (player.CurrentRegion.IsNightTime)
                    {
                        return;
                    }

                    if (invItem.Id_nb.Equals("Moon_Mace"))
                        player.Inventory.RemoveItem(invItem);

                    if (invItem.Id_nb.Equals("Moon_MaceM"))
                        player.Inventory.RemoveItem(invItem);

                    if (invItem.Id_nb.Equals("Moon_MaceH"))
                        player.Inventory.RemoveItem(invItem);

                    if (invItem.Id_nb.Equals("Moon_Staff"))
                        player.Inventory.RemoveItem(invItem);
                    
                    player.Out.SendMessage("The Power of Belt of Moon, has left you!",eChatType.CT_System, eChatLoc.CL_SystemWindow);
                }
			}
            GameEventMgr.RemoveHandler(sender, GamePlayerEvent.Released, OnPlayerReleased);
		}
 public static void OnScriptCompiled(DOLEvent e, object sender, EventArgs args)
 {
     log.Info("\tTeleporter initialized: true");
 }
Exemplo n.º 4
0
 protected static void TalkToVorgar(DOLEvent e, object sender, EventArgs args)
 {
 }
Exemplo n.º 5
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            }

            /* 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("Stor Gothi Annark", eRealm.Midgard);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Stor Gothi Annark, creating ...");
                }
                annark                 = new GameNPC();
                annark.Model           = 215;
                annark.Name            = "Stor Gothi Annark";
                annark.GuildName       = "Part of " + questTitle + " Quest";
                annark.Realm           = eRealm.Midgard;
                annark.CurrentRegionID = 100;
                annark.Size            = 51;
                annark.Level           = 66;
                annark.X               = 765357;
                annark.Y               = 668790;
                annark.Z               = 5759;
                annark.Heading         = 7711;

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

                annark.EquipmentTemplateID = "5100090";

                //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)
                {
                    annark.SaveIntoDatabase();
                }
                annark.AddToWorld();
            }
            else
            {
                annark = npcs[0];
            }

            npcs = WorldMgr.GetNPCsByName(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.NPCScryerIdora"), eRealm.Midgard);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Scryer Idora, creating ...");
                }
                idora                 = new GameNPC();
                idora.Model           = 227;
                idora.Name            = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.NPCScryerIdora");
                idora.GuildName       = "Part of " + questTitle + " Quest";
                idora.Realm           = eRealm.Midgard;
                idora.CurrentRegionID = 234;
                idora.Size            = 52;
                idora.Level           = 50;
                idora.X               = 558081;
                idora.Y               = 573988;
                idora.Z               = 8640;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 81);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 82);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 84);
                template.AddNPCEquipment(eInventorySlot.Cloak, 91);
                template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 3);
                idora.Inventory = template.CloseTemplate();
                idora.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

//				idora.AddNPCEquipment(Slot.TORSO, 81, 0, 0, 0);
//				idora.AddNPCEquipment(Slot.LEGS, 82, 0, 0, 0);
//				idora.AddNPCEquipment(Slot.FEET, 84, 0, 0, 0);
//				idora.AddNPCEquipment(Slot.CLOAK, 91, 0, 0, 0);
//				idora.AddNPCEquipment(Slot.RIGHTHAND, 3, 0, 0, 0);

                idora.Heading             = 1558;
                idora.MaxSpeedBase        = 200;
                idora.EquipmentTemplateID = "200292";

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

            Point2D point = idora.GetPointFromHeading(idora.Heading, 30);
            locationIdora = new GameLocation(idora.CurrentZone.Description, idora.CurrentRegionID, point.X, point.Y, idora.Z);

            ticketToSvasudFaste = CreateTicketTo("Svasud Faste", "hs_mularn_svasudfaste");
            ticketToMularn      = CreateTicketTo("Mularn", "hs_svasudfaste_mularn");

            npcs = (GameNPC[])WorldMgr.GetObjectsByName(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.NPCGriffinHandlerNjiedi"), eRealm.Midgard, typeof(GameStableMaster));
            if (npcs.Length == 0)
            {
                njiedi       = new GameStableMaster();
                njiedi.Model = 158;
                njiedi.Name  = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.NPCGriffinHandlerNjiedi");

                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + njiedi.Name + ", creating ...");
                }
                njiedi.GuildName       = "Stable Master";
                njiedi.Realm           = eRealm.Midgard;
                njiedi.CurrentRegionID = 100;
                njiedi.Size            = 51;
                njiedi.Level           = 50;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 81, 10);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 82, 10);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 84, 10);
                template.AddNPCEquipment(eInventorySlot.Cloak, 57, 32);
                njiedi.Inventory = template.CloseTemplate();

//				njiedi.AddNPCEquipment(Slot.TORSO, 81, 10, 0, 0);
//				njiedi.AddNPCEquipment(Slot.LEGS, 82, 10, 0, 0);
//				njiedi.AddNPCEquipment(Slot.FEET, 84, 10, 0, 0);
//				njiedi.AddNPCEquipment(Slot.CLOAK, 57, 32, 0, 0);

                njiedi.X       = GameLocation.ConvertLocalXToGlobalX(55561, 100);
                njiedi.Y       = GameLocation.ConvertLocalYToGlobalY(58225, 100);
                njiedi.Z       = 5005;
                njiedi.Heading = 126;

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

            njiedi.TradeItems = new MerchantTradeItems(null);
            if (!njiedi.TradeItems.AddTradeItem(1, eMerchantWindowSlot.FirstEmptyInPage, ticketToSvasudFaste))
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("ticketToSvasudFaste not added");
                }
            }

            foreach (GameNPC npc in njiedi.GetNPCsInRadius(400))
            {
                if (npc.Name == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.NPCGryphon"))
                {
                    griffin = npc;
                    break;
                }
            }
            if (griffin == null)
            {
                griffin       = new GameNPC();
                griffin.Model = 1236;                 // //819;
                griffin.Name  = "tamed gryphon";

                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + griffin.Name + ", creating ...");
                }
                griffin.GuildName       = "Part of " + questTitle + " Quest";
                griffin.Realm           = eRealm.Midgard;
                griffin.CurrentRegionID = njiedi.CurrentRegionID;
                griffin.Size            = 50;
                griffin.Level           = 50;
                griffin.X = njiedi.X + 80;
                griffin.Y = njiedi.Y + 100;
                griffin.Z = njiedi.Z;

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

                griffin.Heading      = 93;
                griffin.MaxSpeedBase = 400;
                //dragonfly.EquipmentTemplateID = 200276;

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

                if (SAVE_INTO_DATABASE)
                {
                    griffin.SaveIntoDatabase();
                }
                griffin.AddToWorld();
            }

            npcs = (GameNPC[])WorldMgr.GetObjectsByName("Vorgar", eRealm.Midgard, typeof(GameStableMaster));
            if (npcs.Length == 0)
            {
                vorgar       = new GameStableMaster();
                vorgar.Model = 52;
                vorgar.Name  = "Vorgar";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + vorgar.Name + ", creating ...");
                }
                vorgar.GuildName       = "Stable Master";
                vorgar.Realm           = eRealm.Midgard;
                vorgar.CurrentRegionID = 100;
                vorgar.Size            = 51;
                vorgar.Level           = 50;
                vorgar.X            = GameLocation.ConvertLocalXToGlobalX(10660, 100);
                vorgar.Y            = GameLocation.ConvertLocalYToGlobalY(3437, 100);
                vorgar.Z            = 5717;
                vorgar.Heading      = 327;
                vorgar.MaxSpeedBase = 200;

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

                //ulliam.EquipmentTemplateID = 200276;

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

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

            Point2D vorgarloc = vorgar.GetPointFromHeading(vorgar.Heading, 30);
            locationVorgar = new GameLocation(vorgar.CurrentZone.Description, vorgar.CurrentRegionID, vorgarloc.X, vorgarloc.Y, vorgar.Z);

            #endregion

            #region DefineItems

            // item db check
            noteForNjiedi = GameServer.Database.FindObjectByKey <ItemTemplate>("njiedi_note");
            if (noteForNjiedi == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Njiedi's Note, creating it ...");
                }
                noteForNjiedi      = new ItemTemplate();
                noteForNjiedi.Name = "Njiedi's Note";

                noteForNjiedi.Weight = 3;
                noteForNjiedi.Model  = 498;

                noteForNjiedi.Object_Type = (int)eObjectType.GenericItem;

                noteForNjiedi.Id_nb      = "njiedi_note";
                noteForNjiedi.IsPickable = true;
                noteForNjiedi.IsDropable = false;

                GameServer.Database.AddObject(noteForNjiedi);
            }

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

                askefruerPlans.Weight = 3;
                askefruerPlans.Model  = 498;

                askefruerPlans.Object_Type = (int)eObjectType.GenericItem;

                askefruerPlans.Id_nb      = "askefruer_plans";
                askefruerPlans.IsPickable = true;
                askefruerPlans.IsDropable = false;

                GameServer.Database.AddObject(askefruerPlans);
            }

            translatedPlans = GameServer.Database.FindObjectByKey <ItemTemplate>("translated_askefruer_plans");
            if (translatedPlans == null)
            {
                translatedPlans      = new ItemTemplate();
                translatedPlans.Name = "Translated Askefruer Plans";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + translatedPlans.Name + ", creating it ...");
                }

                translatedPlans.Weight = 3;
                translatedPlans.Model  = 498;

                translatedPlans.Object_Type = (int)eObjectType.GenericItem;

                translatedPlans.Id_nb      = "translated_askefruer_plans";
                translatedPlans.IsPickable = true;
                translatedPlans.IsDropable = false;

                GameServer.Database.AddObject(translatedPlans);
            }

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

                recruitsLegs.Weight = 42;
                recruitsLegs.Model  = 82;                // Studded Legs

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

                recruitsLegs.Object_Type = (int)eObjectType.Studded;
                recruitsLegs.Item_Type   = (int)eEquipmentItems.LEGS;
                recruitsLegs.Id_nb       = "recruits_studded_legs_mid";
                recruitsLegs.Price       = Money.GetMoney(0, 0, 0, 10, 0);
                recruitsLegs.IsPickable  = true;
                recruitsLegs.IsDropable  = true;
                recruitsLegs.Color       = 14;          // blue leather

                recruitsLegs.Bonus = 5;                 // default bonus

                recruitsLegs.Bonus1     = 12;
                recruitsLegs.Bonus1Type = (int)eProperty.MaxHealth;                  // hit

                recruitsLegs.Bonus2     = 2;
                recruitsLegs.Bonus2Type = (int)eResist.Slash;

                recruitsLegs.Bonus3     = 1;
                recruitsLegs.Bonus3Type = (int)eResist.Cold;

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

                GameServer.Database.AddObject(recruitsLegs);
            }

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

                recruitsPants.Weight = 14;
                recruitsPants.Model  = 152;               // cloth Legs

                recruitsPants.DPS_AF  = 5;                // Armour
                recruitsPants.SPD_ABS = 0;                // Absorption

                recruitsPants.Object_Type = (int)eObjectType.Cloth;
                recruitsPants.Item_Type   = (int)eEquipmentItems.LEGS;
                recruitsPants.Id_nb       = "recruits_quilted_pants";
                recruitsPants.Price       = Money.GetMoney(0, 0, 0, 10, 0);
                recruitsPants.IsPickable  = true;
                recruitsPants.IsDropable  = true;
                recruitsPants.Color       = 36;

                recruitsPants.Bonus = 5;                 // default bonus

                recruitsPants.Bonus1     = 12;
                recruitsPants.Bonus1Type = (int)eProperty.MaxHealth;                  // hit

                recruitsPants.Bonus2     = 2;
                recruitsPants.Bonus2Type = (int)eResist.Slash;

                recruitsPants.Bonus3     = 1;
                recruitsPants.Bonus3Type = (int)eResist.Cold;

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

                GameServer.Database.AddObject(recruitsPants);
            }

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

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

            GameEventMgr.AddHandler(annark, GameObjectEvent.Interact, new DOLEventHandler(TalkToAnnark));

            GameEventMgr.AddHandler(njiedi, GameObjectEvent.Interact, new DOLEventHandler(TalkToNjiedi));

            GameEventMgr.AddHandler(idora, GameObjectEvent.Interact, new DOLEventHandler(TalkToIdora));
            GameEventMgr.AddHandler(idora, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToIdora));

            GameEventMgr.AddHandler(vorgar, GameObjectEvent.Interact, new DOLEventHandler(TalkToVorgar));
            GameEventMgr.AddHandler(vorgar, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToVorgar));

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

            if (log.IsInfoEnabled)
            {
                if (log.IsInfoEnabled)
                {
                    log.Info("Quest \"" + questTitle + "\" initialized");
                }
            }
        }
Exemplo n.º 6
0
        /* This is the method we declared as callback for the hooks we set to
         * NPC. It will be called whenever a player right clicks on NPC
         * or when he whispers something to him.
         */

        protected static void TalkToElvarIronhand(DOLEvent e, object sender, EventArgs args)
        {
            // We get the player from the event arguments and check if he qualifies
            GamePlayer player = ((SourceEventArgs)args).Source as GamePlayer;

            if (player == null)
            {
                return;
            }

            if (elvarIronhand.CanGiveQuest(typeof(BuildingABetterBow), player) <= 0)
            {
                return;
            }

            // We also check if the player is already doing the quest
            BuildingABetterBow quest = player.IsDoingQuest(typeof(BuildingABetterBow)) as BuildingABetterBow;

            elvarIronhand.TurnTo(player);

            // Did the player rightclick on NPC?
            if (e == GameObjectEvent.Interact)
            {
                if (quest == null)
                {
                    // Player is not doing the quest...
                    elvarIronhand.SayTo(player, "Hello, adventurer. Are you here in response to the notice I posted in the [tavern]?");
                    return;
                }
                else
                {
                    if (quest.Step == 4)
                    {
                        elvarIronhand.SayTo(player, "You're back! I hope you were able to retrieve those bones without much trouble. I'm already drawing up the plans for the new bow.  May I have the bones?");
                    }

                    return;
                }
            }

            // The player whispered to NPC (clicked on the text inside the [])
            else if (e == GameLivingEvent.WhisperReceive)
            {
                WhisperReceiveEventArgs wArgs = (WhisperReceiveEventArgs)args;
                if (quest == null)
                {
                    // Do some small talk :)
                    switch (wArgs.Text)
                    {
                    case "tavern":
                        elvarIronhand.SayTo(player, "I was hoping to get someone to help me with a little side project. You see, in my spare time, I collect texts on weaponsmithing and I recently came across one about weapons used in less civilized [lands].");
                        break;

                    case "lands":
                        elvarIronhand.SayTo(player, "It seems that some nomadic tribes have perfected the art of reinforcing their bows with thin pieces of bone or horn.  The text claims that bows constructed this way shoot farther and hit harder than the ones used by our [scouts].");
                        break;

                    // If the player offered his help, we send the quest dialog now!
                    case "scouts":
                        elvarIronhand.SayTo(player, "I think combining this technique with our longbows could help give our forces the edge in the war against Midgard and Hibernia. Will you help me gather some of the materials to build a prototype?");
                        player.Out.SendQuestSubscribeCommand(elvarIronhand, QuestMgr.GetIDForQuestType(typeof(BuildingABetterBow)), "Will you help Elvar gather the \nmaterials for his prototype bow? \n[Levels 3-6]");
                        break;
                    }
                }
                else
                {
                    switch (wArgs.Text)
                    {
                    case "first":
                        if (quest.Step == 1)
                        {
                            elvarIronhand.SayTo(player, "If you travel southeast from Cotswold, toward Prydwen keep, you should find some skeletons near the bend in the river.  Return to me when you've gathered two well-preserved bones from them.");
                            quest.Step = 2;
                        }

                        break;

                    case "technique":
                        if (quest.Step == 5)
                        {
                            elvarIronhand.SayTo(player, "Thank you for your help, " + player.CharacterClass.Name + ". Here's a bit of copper for your time. Keep your eyes open for a good source of horn in case the bone prototype doesn't work out.");
                            quest.FinishQuest();
                        }

                        break;

                    case "abort":
                        player.Out.SendCustomDialog("Do you really want to abort this quest, \nall items gained during quest will be lost?", new CustomDialogResponse(CheckPlayerAbortQuest));
                        break;
                    }
                }
            }
        }
Exemplo n.º 7
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }

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

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

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

                Masrim                 = new GameNPC();
                Masrim.Model           = 177;
                Masrim.Name            = "Masrim";
                Masrim.GuildName       = string.Empty;
                Masrim.Realm           = eRealm.Midgard;
                Masrim.CurrentRegionID = 100;
                Masrim.Size            = 52;
                Masrim.Level           = 40;
                Masrim.X               = 749099;
                Masrim.Y               = 813104;
                Masrim.Z               = 4437;
                Masrim.Heading         = 2605;
                Masrim.AddToWorld();
                if (SAVE_INTO_DATABASE)
                {
                    Masrim.SaveIntoDatabase();
                }
            }
            else
            {
                Masrim = npcs[0];
            }

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

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

                Oona                 = new GameNPC();
                Oona.Model           = 356;
                Oona.Name            = "Oona";
                Oona.GuildName       = string.Empty;
                Oona.Realm           = eRealm.None;
                Oona.CurrentRegionID = 100;
                Oona.Size            = 50;
                Oona.Level           = 65;
                Oona.X               = 607233;
                Oona.Y               = 786850;
                Oona.Z               = 4384;
                Oona.Heading         = 3891;
                Oona.Flags          ^= GameNPC.eFlags.GHOST;
                Oona.AddToWorld();
                if (SAVE_INTO_DATABASE)
                {
                    Oona.SaveIntoDatabase();
                }
            }
            else
            {
                Oona = npcs[0];
            }

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

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

                MorlinCaan                 = new GameNPC();
                MorlinCaan.Model           = 235;
                MorlinCaan.Name            = "Morlin Caan";
                MorlinCaan.GuildName       = "Smith";
                MorlinCaan.Realm           = eRealm.Midgard;
                MorlinCaan.CurrentRegionID = 101;
                MorlinCaan.Size            = 50;
                MorlinCaan.Level           = 54;
                MorlinCaan.X               = 33400;
                MorlinCaan.Y               = 33620;
                MorlinCaan.Z               = 8023;
                MorlinCaan.Heading         = 523;
                MorlinCaan.AddToWorld();
                if (SAVE_INTO_DATABASE)
                {
                    MorlinCaan.SaveIntoDatabase();
                }
            }
            else
            {
                MorlinCaan = npcs[0];
            }

            // end npc

            oona_head = GameServer.Database.FindObjectByKey <ItemTemplate>("oona_head");
            if (oona_head == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Oona's Head , creating it ...");
                }

                oona_head             = new ItemTemplate();
                oona_head.Id_nb       = "oona_head";
                oona_head.Name        = "Oona's Head";
                oona_head.Level       = 8;
                oona_head.Item_Type   = 29;
                oona_head.Model       = 503;
                oona_head.IsDropable  = false;
                oona_head.IsPickable  = false;
                oona_head.DPS_AF      = 0;
                oona_head.SPD_ABS     = 0;
                oona_head.Object_Type = 41;
                oona_head.Hand        = 0;
                oona_head.Type_Damage = 0;
                oona_head.Quality     = 100;
                oona_head.Weight      = 12;
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(oona_head);
                }
            }

            sealed_pouch = GameServer.Database.FindObjectByKey <ItemTemplate>("sealed_pouch");
            if (sealed_pouch == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Sealed Pouch , creating it ...");
                }

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

// end item
            HunterEpicBoots = GameServer.Database.FindObjectByKey <ItemTemplate>("HunterEpicBoots");
            if (HunterEpicBoots == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Hunters Epic Boots , creating it ...");
                }

                HunterEpicBoots               = new ItemTemplate();
                HunterEpicBoots.Id_nb         = "HunterEpicBoots";
                HunterEpicBoots.Name          = "Call of the Hunt Boots";
                HunterEpicBoots.Level         = 50;
                HunterEpicBoots.Item_Type     = 23;
                HunterEpicBoots.Model         = 760;
                HunterEpicBoots.IsDropable    = true;
                HunterEpicBoots.IsPickable    = true;
                HunterEpicBoots.DPS_AF        = 100;
                HunterEpicBoots.SPD_ABS       = 19;
                HunterEpicBoots.Object_Type   = 34;
                HunterEpicBoots.Quality       = 100;
                HunterEpicBoots.Weight        = 22;
                HunterEpicBoots.Bonus         = 35;
                HunterEpicBoots.MaxCondition  = 50000;
                HunterEpicBoots.MaxDurability = 50000;
                HunterEpicBoots.Condition     = 50000;
                HunterEpicBoots.Durability    = 50000;

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

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

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

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

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

                HunterEpicHelm               = new ItemTemplate();
                HunterEpicHelm.Id_nb         = "HunterEpicHelm";
                HunterEpicHelm.Name          = "Call of the Hunt Coif";
                HunterEpicHelm.Level         = 50;
                HunterEpicHelm.Item_Type     = 21;
                HunterEpicHelm.Model         = 829; // NEED TO WORK ON..
                HunterEpicHelm.IsDropable    = true;
                HunterEpicHelm.IsPickable    = true;
                HunterEpicHelm.DPS_AF        = 100;
                HunterEpicHelm.SPD_ABS       = 19;
                HunterEpicHelm.Object_Type   = 34;
                HunterEpicHelm.Quality       = 100;
                HunterEpicHelm.Weight        = 22;
                HunterEpicHelm.Bonus         = 35;
                HunterEpicHelm.MaxCondition  = 50000;
                HunterEpicHelm.MaxDurability = 50000;
                HunterEpicHelm.Condition     = 50000;
                HunterEpicHelm.Durability    = 50000;

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

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

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

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

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

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

                HunterEpicGloves               = new ItemTemplate();
                HunterEpicGloves.Id_nb         = "HunterEpicGloves";
                HunterEpicGloves.Name          = "Call of the Hunt Gloves ";
                HunterEpicGloves.Level         = 50;
                HunterEpicGloves.Item_Type     = 22;
                HunterEpicGloves.Model         = 759;
                HunterEpicGloves.IsDropable    = true;
                HunterEpicGloves.IsPickable    = true;
                HunterEpicGloves.DPS_AF        = 100;
                HunterEpicGloves.SPD_ABS       = 19;
                HunterEpicGloves.Object_Type   = 34;
                HunterEpicGloves.Quality       = 100;
                HunterEpicGloves.Weight        = 22;
                HunterEpicGloves.Bonus         = 35;
                HunterEpicGloves.MaxCondition  = 50000;
                HunterEpicGloves.MaxDurability = 50000;
                HunterEpicGloves.Condition     = 50000;
                HunterEpicGloves.Durability    = 50000;

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

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

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

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

            // Call of the Hunt Hauberk
            HunterEpicVest = GameServer.Database.FindObjectByKey <ItemTemplate>("HunterEpicVest");
            if (HunterEpicVest == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Hunters Epic Vest , creating it ...");
                }

                HunterEpicVest               = new ItemTemplate();
                HunterEpicVest.Id_nb         = "HunterEpicVest";
                HunterEpicVest.Name          = "Call of the Hunt Jerkin";
                HunterEpicVest.Level         = 50;
                HunterEpicVest.Item_Type     = 25;
                HunterEpicVest.Model         = 756;
                HunterEpicVest.IsDropable    = true;
                HunterEpicVest.IsPickable    = true;
                HunterEpicVest.DPS_AF        = 100;
                HunterEpicVest.SPD_ABS       = 19;
                HunterEpicVest.Object_Type   = 34;
                HunterEpicVest.Quality       = 100;
                HunterEpicVest.Weight        = 22;
                HunterEpicVest.Bonus         = 35;
                HunterEpicVest.MaxCondition  = 50000;
                HunterEpicVest.MaxDurability = 50000;
                HunterEpicVest.Condition     = 50000;
                HunterEpicVest.Durability    = 50000;

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

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

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

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

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

            // Call of the Hunt Legs
            HunterEpicLegs = GameServer.Database.FindObjectByKey <ItemTemplate>("HunterEpicLegs");
            if (HunterEpicLegs == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Hunters Epic Legs , creating it ...");
                }

                HunterEpicLegs               = new ItemTemplate();
                HunterEpicLegs.Id_nb         = "HunterEpicLegs";
                HunterEpicLegs.Name          = "Call of the Hunt Legs";
                HunterEpicLegs.Level         = 50;
                HunterEpicLegs.Item_Type     = 27;
                HunterEpicLegs.Model         = 757;
                HunterEpicLegs.IsDropable    = true;
                HunterEpicLegs.IsPickable    = true;
                HunterEpicLegs.DPS_AF        = 100;
                HunterEpicLegs.SPD_ABS       = 19;
                HunterEpicLegs.Object_Type   = 34;
                HunterEpicLegs.Quality       = 100;
                HunterEpicLegs.Weight        = 22;
                HunterEpicLegs.Bonus         = 35;
                HunterEpicLegs.MaxCondition  = 50000;
                HunterEpicLegs.MaxDurability = 50000;
                HunterEpicLegs.Condition     = 50000;
                HunterEpicLegs.Durability    = 50000;

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

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

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

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

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

            // Call of the Hunt Sleeves
            HunterEpicArms = GameServer.Database.FindObjectByKey <ItemTemplate>("HunterEpicArms");
            if (HunterEpicArms == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Hunter Epic Arms , creating it ...");
                }

                HunterEpicArms               = new ItemTemplate();
                HunterEpicArms.Id_nb         = "HunterEpicArms";
                HunterEpicArms.Name          = "Call of the Hunt Sleeves";
                HunterEpicArms.Level         = 50;
                HunterEpicArms.Item_Type     = 28;
                HunterEpicArms.Model         = 758;
                HunterEpicArms.IsDropable    = true;
                HunterEpicArms.IsPickable    = true;
                HunterEpicArms.DPS_AF        = 100;
                HunterEpicArms.SPD_ABS       = 19;
                HunterEpicArms.Object_Type   = 34;
                HunterEpicArms.Quality       = 100;
                HunterEpicArms.Weight        = 22;
                HunterEpicArms.Bonus         = 35;
                HunterEpicArms.MaxCondition  = 50000;
                HunterEpicArms.MaxDurability = 50000;
                HunterEpicArms.Condition     = 50000;
                HunterEpicArms.Durability    = 50000;

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

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

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

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

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

            // Shadow Shrouded Boots
            ShadowbladeEpicBoots = GameServer.Database.FindObjectByKey <ItemTemplate>("ShadowbladeEpicBoots");
            if (ShadowbladeEpicBoots == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Shadowblade Epic Boots , creating it ...");
                }

                ShadowbladeEpicBoots               = new ItemTemplate();
                ShadowbladeEpicBoots.Id_nb         = "ShadowbladeEpicBoots";
                ShadowbladeEpicBoots.Name          = "Shadow Shrouded Boots";
                ShadowbladeEpicBoots.Level         = 50;
                ShadowbladeEpicBoots.Item_Type     = 23;
                ShadowbladeEpicBoots.Model         = 765;
                ShadowbladeEpicBoots.IsDropable    = true;
                ShadowbladeEpicBoots.IsPickable    = true;
                ShadowbladeEpicBoots.DPS_AF        = 100;
                ShadowbladeEpicBoots.SPD_ABS       = 10;
                ShadowbladeEpicBoots.Object_Type   = 33;
                ShadowbladeEpicBoots.Quality       = 100;
                ShadowbladeEpicBoots.Weight        = 22;
                ShadowbladeEpicBoots.Bonus         = 35;
                ShadowbladeEpicBoots.MaxCondition  = 50000;
                ShadowbladeEpicBoots.MaxDurability = 50000;
                ShadowbladeEpicBoots.Condition     = 50000;
                ShadowbladeEpicBoots.Durability    = 50000;

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

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

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

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

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

            // Shadow Shrouded Coif
            ShadowbladeEpicHelm = GameServer.Database.FindObjectByKey <ItemTemplate>("ShadowbladeEpicHelm");
            if (ShadowbladeEpicHelm == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Shadowblade Epic Helm , creating it ...");
                }

                ShadowbladeEpicHelm               = new ItemTemplate();
                ShadowbladeEpicHelm.Id_nb         = "ShadowbladeEpicHelm";
                ShadowbladeEpicHelm.Name          = "Shadow Shrouded Coif";
                ShadowbladeEpicHelm.Level         = 50;
                ShadowbladeEpicHelm.Item_Type     = 21;
                ShadowbladeEpicHelm.Model         = 335; // NEED TO WORK ON..
                ShadowbladeEpicHelm.IsDropable    = true;
                ShadowbladeEpicHelm.IsPickable    = true;
                ShadowbladeEpicHelm.DPS_AF        = 100;
                ShadowbladeEpicHelm.SPD_ABS       = 10;
                ShadowbladeEpicHelm.Object_Type   = 33;
                ShadowbladeEpicHelm.Quality       = 100;
                ShadowbladeEpicHelm.Weight        = 22;
                ShadowbladeEpicHelm.Bonus         = 35;
                ShadowbladeEpicHelm.MaxCondition  = 50000;
                ShadowbladeEpicHelm.MaxDurability = 50000;
                ShadowbladeEpicHelm.Condition     = 50000;
                ShadowbladeEpicHelm.Durability    = 50000;

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

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

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

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

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

            // Shadow Shrouded Gloves
            ShadowbladeEpicGloves = GameServer.Database.FindObjectByKey <ItemTemplate>("ShadowbladeEpicGloves");
            if (ShadowbladeEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Shadowblade Epic Gloves , creating it ...");
                }

                ShadowbladeEpicGloves               = new ItemTemplate();
                ShadowbladeEpicGloves.Id_nb         = "ShadowbladeEpicGloves";
                ShadowbladeEpicGloves.Name          = "Shadow Shrouded Gloves";
                ShadowbladeEpicGloves.Level         = 50;
                ShadowbladeEpicGloves.Item_Type     = 22;
                ShadowbladeEpicGloves.Model         = 764;
                ShadowbladeEpicGloves.IsDropable    = true;
                ShadowbladeEpicGloves.IsPickable    = true;
                ShadowbladeEpicGloves.DPS_AF        = 100;
                ShadowbladeEpicGloves.SPD_ABS       = 10;
                ShadowbladeEpicGloves.Object_Type   = 33;
                ShadowbladeEpicGloves.Quality       = 100;
                ShadowbladeEpicGloves.Weight        = 22;
                ShadowbladeEpicGloves.Bonus         = 35;
                ShadowbladeEpicGloves.MaxCondition  = 50000;
                ShadowbladeEpicGloves.MaxDurability = 50000;
                ShadowbladeEpicGloves.Condition     = 50000;
                ShadowbladeEpicGloves.Durability    = 50000;

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

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

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

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

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

            // Shadow Shrouded Hauberk
            ShadowbladeEpicVest = GameServer.Database.FindObjectByKey <ItemTemplate>("ShadowbladeEpicVest");
            if (ShadowbladeEpicVest == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Shadowblade Epic Vest , creating it ...");
                }

                ShadowbladeEpicVest               = new ItemTemplate();
                ShadowbladeEpicVest.Id_nb         = "ShadowbladeEpicVest";
                ShadowbladeEpicVest.Name          = "Shadow Shrouded Jerkin";
                ShadowbladeEpicVest.Level         = 50;
                ShadowbladeEpicVest.Item_Type     = 25;
                ShadowbladeEpicVest.Model         = 761;
                ShadowbladeEpicVest.IsDropable    = true;
                ShadowbladeEpicVest.IsPickable    = true;
                ShadowbladeEpicVest.DPS_AF        = 100;
                ShadowbladeEpicVest.SPD_ABS       = 10;
                ShadowbladeEpicVest.Object_Type   = 33;
                ShadowbladeEpicVest.Quality       = 100;
                ShadowbladeEpicVest.Weight        = 22;
                ShadowbladeEpicVest.Bonus         = 35;
                ShadowbladeEpicVest.MaxCondition  = 50000;
                ShadowbladeEpicVest.MaxDurability = 50000;
                ShadowbladeEpicVest.Condition     = 50000;
                ShadowbladeEpicVest.Durability    = 50000;

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

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

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

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

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

            // Shadow Shrouded Legs
            ShadowbladeEpicLegs = GameServer.Database.FindObjectByKey <ItemTemplate>("ShadowbladeEpicLegs");
            if (ShadowbladeEpicLegs == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Shadowblade Epic Legs , creating it ...");
                }

                ShadowbladeEpicLegs               = new ItemTemplate();
                ShadowbladeEpicLegs.Id_nb         = "ShadowbladeEpicLegs";
                ShadowbladeEpicLegs.Name          = "Shadow Shrouded Legs";
                ShadowbladeEpicLegs.Level         = 50;
                ShadowbladeEpicLegs.Item_Type     = 27;
                ShadowbladeEpicLegs.Model         = 762;
                ShadowbladeEpicLegs.IsDropable    = true;
                ShadowbladeEpicLegs.IsPickable    = true;
                ShadowbladeEpicLegs.DPS_AF        = 100;
                ShadowbladeEpicLegs.SPD_ABS       = 10;
                ShadowbladeEpicLegs.Object_Type   = 33;
                ShadowbladeEpicLegs.Quality       = 100;
                ShadowbladeEpicLegs.Weight        = 22;
                ShadowbladeEpicLegs.Bonus         = 35;
                ShadowbladeEpicLegs.MaxCondition  = 50000;
                ShadowbladeEpicLegs.MaxDurability = 50000;
                ShadowbladeEpicLegs.Condition     = 50000;
                ShadowbladeEpicLegs.Durability    = 50000;

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

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

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

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

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

            // Shadow Shrouded Sleeves
            ShadowbladeEpicArms = GameServer.Database.FindObjectByKey <ItemTemplate>("ShadowbladeEpicArms");
            if (ShadowbladeEpicArms == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Shadowblade Epic Arms , creating it ...");
                }

                ShadowbladeEpicArms               = new ItemTemplate();
                ShadowbladeEpicArms.Id_nb         = "ShadowbladeEpicArms";
                ShadowbladeEpicArms.Name          = "Shadow Shrouded Sleeves";
                ShadowbladeEpicArms.Level         = 50;
                ShadowbladeEpicArms.Item_Type     = 28;
                ShadowbladeEpicArms.Model         = 763;
                ShadowbladeEpicArms.IsDropable    = true;
                ShadowbladeEpicArms.IsPickable    = true;
                ShadowbladeEpicArms.DPS_AF        = 100;
                ShadowbladeEpicArms.SPD_ABS       = 10;
                ShadowbladeEpicArms.Object_Type   = 33;
                ShadowbladeEpicArms.Quality       = 100;
                ShadowbladeEpicArms.Weight        = 22;
                ShadowbladeEpicArms.Bonus         = 35;
                ShadowbladeEpicArms.MaxCondition  = 50000;
                ShadowbladeEpicArms.MaxDurability = 50000;
                ShadowbladeEpicArms.Condition     = 50000;
                ShadowbladeEpicArms.Durability    = 50000;

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

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

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

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

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

// Shadowblade Epic Sleeves End
// Item Descriptions End

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

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

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

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

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Exemplo n.º 8
0
 /// <summary>
 /// The event handler of given event type
 /// </summary>
 protected abstract void EventHandler(DOLEvent e, object sender, EventArgs arguments);
Exemplo n.º 9
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            }

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

            #endregion

            #region defineItems

            // item db check
            emptyMagicBox = GameServer.Database.FindObjectByKey <ItemTemplate>("empty_wodden_magic_box");
            if (emptyMagicBox == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Empty Wodden Magic Box, creating it ...");
                }
                emptyMagicBox      = new ItemTemplate();
                emptyMagicBox.Name = "Empty Wodden Magic Box";

                emptyMagicBox.Weight = 5;
                emptyMagicBox.Model  = 602;

                emptyMagicBox.Object_Type = (int)eObjectType.GenericItem;
                emptyMagicBox.Id_nb       = "empty_wodden_magic_box";

                emptyMagicBox.IsPickable = true;
                emptyMagicBox.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(emptyMagicBox);
                }
            }

            // item db check
            fullMagicBox = GameServer.Database.FindObjectByKey <ItemTemplate>("full_wodden_magic_box");
            if (fullMagicBox == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Full Wodden Magic Box, creating it ...");
                }
                fullMagicBox      = new ItemTemplate();
                fullMagicBox.Name = "Full Wodden Magic Box";

                fullMagicBox.Weight = 3;
                fullMagicBox.Model  = 602;

                fullMagicBox.Object_Type = (int)eObjectType.GenericItem;

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

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

                recruitsShortSword.Weight = 18;
                recruitsShortSword.Model  = 3;                // studded Boots

                recruitsShortSword.DPS_AF  = 24;              // Armour
                recruitsShortSword.SPD_ABS = 30;              // Absorption

                recruitsShortSword.Type_Damage = (int)eDamageType.Slash;
                recruitsShortSword.Object_Type = (int)eObjectType.Blades;
                recruitsShortSword.Item_Type   = (int)eEquipmentItems.LEFT_HAND;
                recruitsShortSword.Id_nb       = "recruits_short_sword_hib";
                recruitsShortSword.Price       = Money.GetMoney(0, 0, 0, 2, 0);
                recruitsShortSword.IsPickable  = true;
                recruitsShortSword.IsDropable  = true;
                recruitsShortSword.Color       = 46;          // green metal

                recruitsShortSword.Bonus = 1;                 // default bonus

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

                recruitsShortSword.Bonus2     = 1;
                recruitsShortSword.Bonus2Type = (int)eStat.QUI;

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

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

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

                recruitsStaff.Weight = 45;
                recruitsStaff.Model  = 442;

                recruitsStaff.DPS_AF  = 24;
                recruitsStaff.SPD_ABS = 45;

                recruitsStaff.Type_Damage = (int)eDamageType.Slash;
                recruitsStaff.Object_Type = (int)eObjectType.Staff;
                recruitsStaff.Item_Type   = (int)eEquipmentItems.LEFT_HAND;
                recruitsStaff.Id_nb       = "recruits_staff";
                recruitsStaff.Price       = Money.GetMoney(0, 0, 0, 2, 0);
                recruitsStaff.IsPickable  = true;
                recruitsStaff.IsDropable  = true;
                recruitsStaff.Color       = 45;          // blue metal

                recruitsStaff.Bonus = 1;                 // default bonus

                recruitsStaff.Bonus1     = 3;
                recruitsStaff.Bonus1Type = (int)eStat.INT;

                recruitsStaff.Bonus2     = 1;
                recruitsStaff.Bonus2Type = (int)eResist.Crush;

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

            #endregion

            sluaghArea = WorldMgr.GetRegion(sluaghLocation.RegionID).AddArea(new Area.Circle("Sluagh contamined Area", sluaghLocation.Position, 1500));
            sluaghArea.RegisterPlayerEnter(new DOLEventHandler(PlayerEnterSluaghArea));

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

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

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

            GameEventMgr.AddHandler(addrir, GameLivingEvent.Interact, new DOLEventHandler(TalkToAddrir));
            GameEventMgr.AddHandler(addrir, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToAddrir));

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

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

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

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

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

                // k109: My preference, no guildname for quest NPCs.  Uncomment if you like that...
                // Rheda.GuildName = "Part of " + questTitle + " Quest";
                Rheda.Realm           = eRealm.Albion;
                Rheda.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);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 53);
                Rheda.Inventory = template.CloseTemplate();
                Rheda.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                Rheda.Size    = 52;
                Rheda.Level   = 25;
                Rheda.X       = 559712;
                Rheda.Y       = 513513;
                Rheda.Z       = 2428;
                Rheda.Heading = 3822;

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

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

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

            GameEventMgr.AddHandler(Rheda, GameLivingEvent.Interact, new DOLEventHandler(TalkToRheda));
            GameEventMgr.AddHandler(Rheda, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToRheda));

            Rheda.AddQuestToGive(typeof(RecruitingNothingButTrouble));

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Exemplo n.º 11
0
        private void OnAttack(DOLEvent e, object sender, EventArgs arguments)
        {
            if (!(sender is GameLiving))
            {
                return;
            }

            if (!(arguments is AttackFinishedEventArgs args))
            {
                return;
            }

            if (args.AttackData == null)
            {
                return;
            }

            int extra = 0;

            if (args.AttackData.StyleDamage > 0)
            {
                extra = args.AttackData.StyleDamage;
                args.AttackData.Damage      += args.AttackData.StyleDamage;
                args.AttackData.StyleDamage *= 2;
            }

            if (!(sender is GamePlayer player))
            {
                return;
            }

            if (player.Group == null)
            {
                return;
            }

            if (extra > 0)
            {
                player.Out.SendMessage($"Your Fury enables you to strike {args.AttackData.Target.Name} for {extra} additional points of damage", eChatType.CT_Spell, eChatLoc.CL_SystemWindow);
            }

            Hashtable  injuredTargets    = new Hashtable();
            GamePlayer mostInjuredLiving = null;

            foreach (GamePlayer p in player.Group.GetPlayersInTheGroup())
            {
                if (p == player)
                {
                    continue;
                }

                mostInjuredLiving = p;
                break;
            }

            if (mostInjuredLiving == null)
            {
                return;
            }

            double mostInjuredPercent = mostInjuredLiving.Health / (float)mostInjuredLiving.MaxHealth;
            int    groupHealCap       = args.AttackData.Damage;
            int    targetHealCap      = args.AttackData.Damage;

            if (player.Group.MemberCount > 2)
            {
                groupHealCap  *= player.Group.MemberCount;
                targetHealCap *= 2;
                foreach (GamePlayer p in player.Group.GetPlayersInTheGroup())
                {
                    if (!p.IsAlive)
                    {
                        continue;
                    }

                    if (p == player)
                    {
                        continue;
                    }

                    if (p.IsWithinRadius(player, 2000))
                    {
                        double playerHealthPercent = p.Health / (double)p.MaxHealth;
                        if (playerHealthPercent < 1)
                        {
                            injuredTargets.Add(p, playerHealthPercent);
                            if (playerHealthPercent < mostInjuredPercent)
                            {
                                mostInjuredLiving  = p;
                                mostInjuredPercent = playerHealthPercent;
                            }
                        }
                    }
                }
            }
            else
            {
                if (mostInjuredPercent < 1)
                {
                    injuredTargets.Add(mostInjuredLiving, mostInjuredPercent);
                }
            }

            if (mostInjuredPercent >= 1)
            {
                player.Out.SendMessage("Your group is fully healed!", eChatType.CT_Spell, eChatLoc.CL_SystemWindow);
                return;
            }

            double    bestHealPercent = targetHealCap / (double)mostInjuredLiving.MaxHealth;
            double    totalHealed     = 0;
            Hashtable healAmount      = new Hashtable();

            IDictionaryEnumerator iter = injuredTargets.GetEnumerator();

            // calculate heal for all targets
            while (iter.MoveNext())
            {
                GameLiving healTarget          = iter.Key as GameLiving;
                double     targetHealthPercent = (double)iter.Value;

                // targets hp percent after heal is same as mostInjuredLiving
                double targetHealPercent = bestHealPercent + mostInjuredPercent - targetHealthPercent;
                if (healTarget != null)
                {
                    int targetHeal = (int)(healTarget.MaxHealth * targetHealPercent);

                    // DOLConsole.WriteLine("SpreadHeal: targetHealPercent=" + targetHealPercent + "; uncapped targetHeal=" + targetHeal + "; bestHealPercent=" + bestHealPercent + "; mostInjuredPercent=" + mostInjuredPercent + "; targetHealthPercent=" + targetHealthPercent);
                    if (targetHeal > 0)
                    {
                        totalHealed += targetHeal;
                        healAmount.Add(healTarget, targetHeal);
                    }
                }
            }

            iter = healAmount.GetEnumerator();

            // reduce healed hp according to targetHealCap and heal targets
            while (iter.MoveNext())
            {
                GameLiving healTarget = iter.Key as GameLiving;
                if (healTarget != null && !healTarget.IsAlive)
                {
                    continue;
                }

                double uncappedHeal = (int)iter.Value;
                int    reducedHeal  = (int)Math.Min(targetHealCap, uncappedHeal * (groupHealCap / totalHealed));

                // heal target
                if (healTarget != null)
                {
                    int baseheal = healTarget.MaxHealth - healTarget.Health;
                    if (reducedHeal < baseheal)
                    {
                        baseheal = reducedHeal;
                    }

                    healTarget.ChangeHealth(player, GameLiving.eHealthChangeType.Spell, baseheal);
                    player.Out.SendMessage($"You heal {healTarget.Name} for {baseheal}!", eChatType.CT_Spell, eChatLoc.CL_SystemWindow);
                    if (healTarget is GamePlayer gamePlayer)
                    {
                        gamePlayer.Out.SendMessage($"{player.Name} heals you for {baseheal}!", eChatType.CT_Spell, eChatLoc.CL_SystemWindow);
                    }
                }
            }
        }
 /// <summary>
 /// Owner attacked event
 /// </summary>
 /// <param name="e"></param>
 /// <param name="sender"></param>
 /// <param name="arguments"></param>
 protected override void OnOwnerAttacked(DOLEvent e, object sender, EventArgs arguments)
 {
 }
Exemplo n.º 13
0
    public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
    {
        if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }

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

        GameNPC[] npcs;

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

                SirQuait.GuildName = "Part of " + questTitle + " Quest";
            SirQuait.Realm = eRealm.Albion;
            SirQuait.CurrentRegionID = 1;
            SirQuait.Size = 50;
            SirQuait.Level = 10;
            SirQuait.MaxSpeedBase = 100;
            SirQuait.Faction = FactionMgr.GetFactionByID(0);
            SirQuait.X = 531971;
            SirQuait.Y = 478955;
            SirQuait.Z = 0;
            SirQuait.Heading = 3570;
            SirQuait.RespawnInterval = 0;
            SirQuait.BodyType = 0;

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

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

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

        npcs = WorldMgr.GetObjectsByName<GameNPC>("Evil Thief of the Shadowclan", (eRealm)0);
        if (npcs.Length == 0)
        {
            EvilThiefoftheShadowclan = new DOL.GS.GameNPC();
                EvilThiefoftheShadowclan.Model = 55;
            EvilThiefoftheShadowclan.Name = "Evil Thief of the Shadowclan";
            if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + EvilThiefoftheShadowclan.Name + ", creating ...");
                }

                EvilThiefoftheShadowclan.GuildName = "Part of " + questTitle + " Quest";
            EvilThiefoftheShadowclan.Realm = eRealm.None;
            EvilThiefoftheShadowclan.CurrentRegionID = 1;
            EvilThiefoftheShadowclan.Size = 50;
            EvilThiefoftheShadowclan.Level = 1;
            EvilThiefoftheShadowclan.MaxSpeedBase = 100;
            EvilThiefoftheShadowclan.Faction = FactionMgr.GetFactionByID(0);
            EvilThiefoftheShadowclan.X = 532571;
            EvilThiefoftheShadowclan.Y = 479055;
            EvilThiefoftheShadowclan.Z = 2200;
            EvilThiefoftheShadowclan.Heading = 3570;
            EvilThiefoftheShadowclan.RespawnInterval = 0;
            EvilThiefoftheShadowclan.BodyType = 0;

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

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

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

        SirQuaitsSword = GameServer.Database.FindObjectByKey<ItemTemplate>("SirQuaitsSword");
        if (SirQuaitsSword == null)
        {
            SirQuaitsSword = new ItemTemplate();
            SirQuaitsSword.Name = "Sir Quait's Sword";
            if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + SirQuaitsSword.Name + ", creating it ...");
                }

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

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

        QuestBuilder builder = QuestMgr.GetBuilder(typeof(HelpSirQuait));
                QuestBehaviour a;
                a = builder.CreateBehaviour(SirQuait,-1);
                    a.AddTrigger(eTriggerType.Interact,null,SirQuait);
                a.AddRequirement(eRequirementType.QuestPending,typeof(HelpSirQuait),null, (eComparator)5);
                a.AddRequirement(eRequirementType.QuestGivable, typeof(HelpSirQuait), SirQuait);
                a.AddAction(eActionType.Talk, "Hello adventurer, an [evil thief] has stolen my [sword], can [you help me] get it back?", SirQuait);
                AddBehaviour(a);
                a = builder.CreateBehaviour(SirQuait,-1);
                    a.AddTrigger(eTriggerType.Whisper,"sword",SirQuait);
                a.AddRequirement(eRequirementType.QuestPending,typeof(HelpSirQuait),null, (eComparator)5);
                a.AddAction(eActionType.Talk,"I really need it and if [you help me], I will give you a little reward!",SirQuait);
                AddBehaviour(a);
                a = builder.CreateBehaviour(SirQuait,-1);
                    a.AddTrigger(eTriggerType.Whisper,"sword",SirQuait);
                a.AddRequirement(eRequirementType.QuestPending,typeof(HelpSirQuait),null);
                a.AddAction(eActionType.Talk,"I really need it I am so glad you are helping me!",SirQuait);
                AddBehaviour(a);
                a = builder.CreateBehaviour(SirQuait,-1);
                    a.AddTrigger(eTriggerType.Whisper,"evil thief",SirQuait);
                a.AddRequirement(eRequirementType.QuestPending,typeof(HelpSirQuait),null, (eComparator)5);
                a.AddAction(eActionType.Talk,"This evil thief of the shadowclan bastard, he stole it! Kill him and get my [sword] back to me!",SirQuait);
                AddBehaviour(a);
                a = builder.CreateBehaviour(SirQuait,-1);
                    a.AddTrigger(eTriggerType.Whisper,"you help me",SirQuait);
                a.AddRequirement(eRequirementType.QuestPending,typeof(HelpSirQuait),null, (eComparator)5);
                a.AddAction(eActionType.OfferQuest,typeof(HelpSirQuait),"Do you want to help Sir Quait?");
                AddBehaviour(a);
                a = builder.CreateBehaviour(SirQuait,-1);
                    a.AddTrigger(eTriggerType.Whisper,"find",SirQuait);
                a.AddRequirement(eRequirementType.QuestPending,typeof(HelpSirQuait),null);
                a.AddAction(eActionType.Talk,"Really!? Please give it to me!",SirQuait);
                AddBehaviour(a);
                a = builder.CreateBehaviour(SirQuait,-1);
                    a.AddTrigger(eTriggerType.Interact,null,SirQuait);
                a.AddRequirement(eRequirementType.QuestPending,typeof(HelpSirQuait),null);
                a.AddAction(eActionType.Talk,"Did you [find] my [sword]?",SirQuait);
                AddBehaviour(a);
                a = builder.CreateBehaviour(SirQuait,-1);
                    a.AddTrigger(eTriggerType.DeclineQuest,null,typeof(HelpSirQuait));
                a.AddRequirement(eRequirementType.QuestGivable,typeof(HelpSirQuait),SirQuait);
                a.AddAction(eActionType.Talk,"Oh well, if you change your mind, please come back!",SirQuait);
                AddBehaviour(a);
                a = builder.CreateBehaviour(SirQuait,-1);
                    a.AddTrigger(eTriggerType.AcceptQuest,null,typeof(HelpSirQuait));
                a.AddRequirement(eRequirementType.QuestGivable,typeof(HelpSirQuait),SirQuait);
                a.AddAction(eActionType.Talk,"Thank you! Please bring the [sword] back to me!",SirQuait);
                a.AddAction(eActionType.GiveQuest,typeof(HelpSirQuait),SirQuait);
                AddBehaviour(a);
                a = builder.CreateBehaviour(EvilThiefoftheShadowclan,-1);
                    a.AddTrigger(eTriggerType.EnemyKilled,null,EvilThiefoftheShadowclan);
                a.AddRequirement(eRequirementType.QuestStep,typeof(HelpSirQuait),1, (eComparator)3);
                a.AddAction(eActionType.Message,"You defeated the evil thief and quickly pick up Sir Quait's sword!", (eTextType)1);
                a.AddAction(eActionType.GiveItem,SirQuaitsSword,null);
                AddBehaviour(a);
                a = builder.CreateBehaviour(SirQuait,-1);
                    a.AddTrigger(eTriggerType.GiveItem,SirQuait,SirQuaitsSword);
                a.AddRequirement(eRequirementType.QuestStep,typeof(HelpSirQuait),1, (eComparator)3);
                a.AddAction(eActionType.Message,"Sir Quait thanks you for bringing back his holy sword!", (eTextType)1);
                a.AddAction(eActionType.TakeItem,SirQuaitsSword,null);
                a.AddAction(eActionType.FinishQuest,typeof(HelpSirQuait),null);
                AddBehaviour(a);

        // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End
            SirQuait.AddQuestToGive(typeof(HelpSirQuait));
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Exemplo n.º 14
0
        /* This is the method we declared as callback for the hooks we set to
         * NPC. It will be called whenever a player right clicks on NPC
         * or when he whispers something to him.
         */

        protected static void TalkToMasterFrederick(DOLEvent e, object sender, EventArgs args)
        {
            // We get the player from the event arguments and check if he qualifies
            GamePlayer player = ((SourceEventArgs)args).Source as GamePlayer;

            if (player == null)
            {
                return;
            }

            if (masterFrederick.CanGiveQuest(typeof(Nuisances), player) <= 0)
            {
                return;
            }

            // We also check if the player is already doing the quest
            Nuisances quest = player.IsDoingQuest(typeof(Nuisances)) as Nuisances;

            masterFrederick.TurnTo(player);

            // Did the player rightclick on NPC?
            if (e == GameObjectEvent.Interact)
            {
                if (quest == null)
                {
                    // Player is not doing the quest...
                    masterFrederick.SayTo(player, "My young recruit, I fear we have a growing problem on our hands. For the past several nights, citizens in Cotswold have been complaining of a constant ringing noise. It has started to keep them up at [night].");
                    return;
                }
                else
                {
                    if (quest.Step == 2)
                    {
                        masterFrederick.SayTo(player, "Vinde, you've returned, and none the worse for wear. Tell me, what did you find?");
                    }
                    else if (quest.Step == 3)
                    {
                        masterFrederick.SayTo(player, "Ire fairies! They're the worst! Well, now we know who has been causing these problems. Vinde, you've done good work here today. It is time for a reward for your [efforts].");
                    }

                    return;
                }
            }

            // The player whispered to NPC (clicked on the text inside the [])
            else if (e == GameLivingEvent.WhisperReceive)
            {
                WhisperReceiveEventArgs wArgs = (WhisperReceiveEventArgs)args;
                if (quest == null)
                {
                    // Do some small talk :)
                    switch (wArgs.Text)
                    {
                    case "night":
                        masterFrederick.SayTo(player, "It has even begun to affect the wildlife in this area. The guards can not commit any troops to finding out the cause of this ringing sound, so the responsibility falls to you Vinde. Will you help [Cotswold]?");
                        break;

                    // If the player offered his "help", we send the quest dialog now!
                    case "Cotswold":
                        player.Out.SendQuestSubscribeCommand(masterFrederick, QuestMgr.GetIDForQuestType(typeof(Nuisances)), "Will you help out Cotswold and discover who or what is making this noise?");
                        break;
                    }
                }
                else
                {
                    switch (wArgs.Text)
                    {
                    case "efforts":
                        masterFrederick.SayTo(player, "A Fighter is nothing unless he has a good weapon by his or her side. For you, a new sword is in order. Use it well Vinde. For now, I must think about what to do with these Ire Fairies, and figure out why they are here.");
                        if (quest.Step == 3)
                        {
                            quest.FinishQuest();
                            masterFrederick.SayTo(player, "Don't go far, I have need of your services again Vinde.");
                        }

                        break;

                    case "abort":
                        player.Out.SendCustomDialog("Do you really want to abort this quest, \nall items gained during quest will be lost?", new CustomDialogResponse(CheckPlayerAbortQuest));
                        break;
                    }
                }
            }
        }
Exemplo n.º 15
0
 public override void Notify(DOLEvent e, object sender, EventArgs args)
 {
     // TODO.
 }
Exemplo n.º 16
0
        protected void EventHandler(DOLEvent e, object sender, EventArgs arguments)
        {
            AttackFinishedEventArgs atkArgs = arguments as AttackFinishedEventArgs;
            if (atkArgs == null) return;
            if (atkArgs.AttackData.AttackResult != GameLiving.eAttackResult.HitUnstyled
                && atkArgs.AttackData.AttackResult != GameLiving.eAttackResult.HitStyle) return;
            if (atkArgs.AttackData.Target == null) return;
            GameLiving target = atkArgs.AttackData.Target;
            if (target == null) return;
            if (target.ObjectState != GameObject.eObjectState.Active) return;
            if (target.IsAlive == false) return;
            GameLiving attacker = sender as GameLiving;
            if (attacker == null) return;
            if (attacker.ObjectState != GameObject.eObjectState.Active) return;
            if (attacker.IsAlive == false) return;
            if (atkArgs.AttackData.IsOffHand) return; // only react to main hand
            if (atkArgs.AttackData.Weapon == null) return; // no weapon attack

            DTdetrimentalEffect dt = target.EffectList.GetOfType<DTdetrimentalEffect>();
            if (dt == null)
            {
                new DTdetrimentalEffect().Start(target);
                // Log.Debug("Effect Started from dirty tricks handler on " + target.Name);
            }
        }
Exemplo n.º 17
0
        private static void OnPlayerReleased(DOLEvent e, object sender, EventArgs arguments)
        {
            if (!(sender is GamePlayer))
                return;

            GamePlayer player = sender as GamePlayer;

            lock (player.Inventory)
            {
                var items = player.Inventory.GetItemRange(eInventorySlot.MinEquipable, eInventorySlot.LastBackpack);
                foreach (InventoryItem invItem in items)
                {
                    if (player.CurrentRegion.IsNightTime)
                    {

                        if (invItem.Id_nb.Equals("Sun_Crush"))
                            player.Inventory.RemoveItem(invItem);

                        if (invItem.Id_nb.Equals("Sun_Slash"))
                            player.Inventory.RemoveItem(invItem);

                        if (invItem.Id_nb.Equals("Sun_Thrust"))
                            player.Inventory.RemoveItem(invItem);

                        if (invItem.Id_nb.Equals("Sun_Flex"))
                            player.Inventory.RemoveItem(invItem);

                        if (invItem.Id_nb.Equals("Sun_TwoHanded"))
                            player.Inventory.RemoveItem(invItem);

                        if (invItem.Id_nb.Equals("Sun_Polearm"))
                            player.Inventory.RemoveItem(invItem);

                        if (invItem.Id_nb.Equals("Sun_Bow"))
                            player.Inventory.RemoveItem(invItem);

                        if (invItem.Id_nb.Equals("Sun_Staff"))
                            player.Inventory.RemoveItem(invItem);

                        if (invItem.Id_nb.Equals("Sun_MFist"))
                            player.Inventory.RemoveItem(invItem);

                        if (invItem.Id_nb.Equals("Sun_MStaff"))
                            player.Inventory.RemoveItem(invItem);

                        if (invItem.Id_nb.Equals("Sun_Axe"))
                            player.Inventory.RemoveItem(invItem);

                        if (invItem.Id_nb.Equals("Sun_LeftAxe"))
                            player.Inventory.RemoveItem(invItem);

                        if (invItem.Id_nb.Equals("Sun_Claw"))
                            player.Inventory.RemoveItem(invItem);

                        if (invItem.Id_nb.Equals("Sun_2HCrush"))
                            player.Inventory.RemoveItem(invItem);

                        if (invItem.Id_nb.Equals("Sun_2HAxe"))
                            player.Inventory.RemoveItem(invItem);

                        if (invItem.Id_nb.Equals("Sun_MStaff"))
                            player.Inventory.RemoveItem(invItem);

                        if (invItem.Id_nb.Equals("Sun_FlexScythe"))
                            player.Inventory.RemoveItem(invItem);

                        if (invItem.Id_nb.Equals("Sun_Spear"))
                            player.Inventory.RemoveItem(invItem);

                        player.Out.SendMessage("The Power of Belt of Sun, has left you!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
                    }
                }
            }
            GameEventMgr.RemoveHandler(sender, GamePlayerEvent.Released, OnPlayerReleased);
        }
Exemplo n.º 18
0
        /* This is the method we declared as callback for the hooks we set to
         * NPC. It will be called whenever a player right clicks on NPC
         * or when he whispers something to him.
         */

        protected static void TalkToAddrir(DOLEvent e, object sender, EventArgs args)
        {
            //We get the player from the event arguments and check if he qualifies
            GamePlayer player = ((SourceEventArgs)args).Source as GamePlayer;

            if (player == null)
            {
                return;
            }

            if (addrir.CanGiveQuest(typeof(Nuisances), player) <= 0)
            {
                return;
            }

            //We also check if the player is already doing the quest
            Nuisances quest = player.IsDoingQuest(typeof(Nuisances)) as Nuisances;

            addrir.TurnTo(player);
            //Did the player rightclick on NPC?
            if (e == GameObjectEvent.Interact)
            {
                if (quest == null)
                {
                    //Player is not doing the quest...
                    addrir.SayTo(player, "Ah, my friend. I'm afraid there is a [new problem] that we must deal with.");
                    return;
                }
                else
                {
                    switch (quest.Step)
                    {
                    case 1:
                        addrir.SayTo(player, "Excellent recruit! Now here, take this magical box. I have a feeling there is something out there, and I would like for you to catch it, as proof to Fagan that something needs to be done. When you find the spot that is the noisiest, USE the box and capture whatever it is. Good luck Lirone. Return to me as quickly as you can.");
                        break;

                    case 3:
                        addrir.SayTo(player, "Sluagh...These beasts are evil, evil creatures. I can't begin to imagine why they are here. I will have to bring this to Fagan's attention immediately. Thank you Lirone, for showing this to me. Please take this as a show of my appreciation for your bravery and dedication to not only Mag Mell, but to Hibernia. I shall go present this to Fagan straight away. Be safe until my return Lirone.");
                        quest.FinishQuest();
                        break;
                    }
                    return;
                }
            }
            // The player whispered to NPC (clicked on the text inside the [])
            else if (e == GameLivingEvent.WhisperReceive)
            {
                WhisperReceiveEventArgs wArgs = (WhisperReceiveEventArgs)args;
                if (quest == null)
                {
                    //Do some small talk :)
                    switch (wArgs.Text)
                    {
                    case "new problem":
                        addrir.SayTo(player, "Aye Lirone. There is this hideously loud noise that is coming from somewhere to the North of Mag Mell. It is driving the citizens mad! Fagan has offered a reward to the first person who can [quell] the noise.");
                        break;

                    case "quell":
                        addrir.SayTo(player, "Will you do this for us recruit? Will you find out the cause of this noise and [stop] it?");
                        break;

                    //If the player offered his "help", we send the quest dialog now!
                    case "stop":
                        player.Out.SendQuestSubscribeCommand(addrir, QuestMgr.GetIDForQuestType(typeof(Nuisances)), "Will you help out Mag Mell and discover who or what is making this noise?");
                        break;
                    }
                }
                else
                {
                    switch (wArgs.Text)
                    {
                    case "abort":
                        player.Out.SendCustomDialog("Do you really want to abort this quest, \nall items gained during quest will be lost?", new CustomDialogResponse(CheckPlayerAbortQuest));
                        break;
                    }
                }
            }
        }
Exemplo n.º 19
0
 /// <summary>
 /// This method needs to be implemented in each quest.
 /// It is the core of the quest. The global event hook of the GamePlayer.
 /// This method will be called whenever a GamePlayer with this quest
 /// fires ANY event!
 /// </summary>
 /// <param name="e">The event type</param>
 /// <param name="sender">The sender of the event</param>
 /// <param name="args">The event arguments</param>
 public virtual void Notify(DOLEvent e, object sender, EventArgs args)
 {
 }
        private void OnRemove(DOLEvent e, object sender, EventArgs args)
        {
            //((GamePlayer)Owner).Out.SendMessage("Sputins Legacy grants you a damage immunity!", eChatType.CT_Spell, eChatLoc.CL_SystemWindow);

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

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

            /* First thing we do in here is to search for the NPCs inside
             * the world who comes from the 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>("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];
            }

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

            /* 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");
            }
        }
Exemplo n.º 22
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            }

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

            #region defineNPCS

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

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

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

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

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

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

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

            #endregion

            #region defineItems

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

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

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


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

                GameServer.Database.AddObject(woodenBucket);
            }

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

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

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


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

                GameServer.Database.AddObject(fullWoodenBucket);
            }

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

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

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

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

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


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

                GameServer.Database.AddObject(reedBracer);
            }

            #endregion


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

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

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

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

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

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

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

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

            if (Step == 1 && e == GamePlayerEvent.GiveItem)
            {
                GiveItemEventArgs gArgs = (GiveItemEventArgs)args;
                if (gArgs.Target.Name == njiedi.Name && gArgs.Item.Id_nb == noteForNjiedi.Id_nb)
                {
                    RemoveItem(njiedi, player, noteForNjiedi);

                    njiedi.TurnTo(m_questPlayer);
                    njiedi.SayTo(m_questPlayer, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.Notify.Text1"));
                    m_questPlayer.Out.SendEmoteAnimation(dalikor, eEmote.Ponder);

                    Step = 2;
                    return;
                }
            }
            else if ((Step == 3 || Step == 2) && e == GamePlayerEvent.GiveItem)
            {
                GiveItemEventArgs gArgs = (GiveItemEventArgs)args;
                if (gArgs.Target.Name == idora.Name && gArgs.Item.Id_nb == askefruerPlans.Id_nb)
                {
                    RemoveItem(idora, player, askefruerPlans);

                    idora.TurnTo(m_questPlayer);
                    idora.SayTo(m_questPlayer, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.Notify.Text2"));
                    m_questPlayer.Out.SendEmoteAnimation(idora, eEmote.Ponder);
                    SendEmoteMessage(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.Notify.Text3"));

                    new RegionTimer(gArgs.Target, new RegionTimerCallback(AliceTranslation), 30000);

                    Step = 4;
                    return;
                }
            }
            else if (Step == 5 && e == GamePlayerEvent.GiveItem)
            {
                GiveItemEventArgs gArgs = (GiveItemEventArgs)args;
                if (gArgs.Target.Name == dalikor.Name && gArgs.Item.Id_nb == translatedPlans.Id_nb)
                {
                    RemoveItem(dalikor, player, translatedPlans);

                    dalikor.TurnTo(m_questPlayer);
                    dalikor.SayTo(m_questPlayer, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.Notify.Text4"));
                    m_questPlayer.Out.SendEmoteAnimation(dalikor, eEmote.Ponder);
                    SendEmoteMessage(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.Notify.Text5"));

                    Step = 6;
                    return;
                }
            }
        }
Exemplo n.º 24
0
        /* This is the method we declared as callback for the hooks we set to
         * NPC. It will be called whenever a player right clicks on NPC
         * or when he whispers something to him.
         */

        protected static void TalkToGodelevaDowden(DOLEvent e, object sender, EventArgs args)
        {
            //We get the player from the event arguments and check if he qualifies
            GamePlayer player = ((SourceEventArgs)args).Source as GamePlayer;

            if (player == null)
            {
                return;
            }

            if (godelevaDowden.CanGiveQuest(typeof(GodelevasNeed), player) <= 0)
            {
                return;
            }

            //We also check if the player is already doing the quest
            GodelevasNeed quest = player.IsDoingQuest(typeof(GodelevasNeed)) as GodelevasNeed;

            godelevaDowden.TurnTo(player);
            //Did the player rightclick on NPC?
            if (e == GameObjectEvent.Interact)
            {
                if (quest == null)
                {
                    //Player is not doing the quest...
                    godelevaDowden.SayTo(player, "Hello there friend.  I can't say I've seen you around here.  Of course, I'm usually so busy, I don't get a chance to chat with the locals like I used to.  Say, you're not [looking] for something to do, are you?");
                    return;
                }
                else
                {
                    if (quest.Step == 2)
                    {
                        godelevaDowden.SayTo(player, "Do you have the full bucket for me, " + player.Name + "?");
                    }
                    return;
                }
            }
            // The player whispered to NPC (clicked on the text inside the [])
            else if (e == GameLivingEvent.WhisperReceive)
            {
                WhisperReceiveEventArgs wArgs = (WhisperReceiveEventArgs)args;
                if (quest == null)
                {
                    //Do some small talk :)
                    switch (wArgs.Text)
                    {
                    case "looking":
                        godelevaDowden.SayTo(player, "Oh yes! I have met someone who is very interesting. I think about him all the time when we are apart, which is often. His name is Elvar Tambor, and he is a weapons merchant in Prydwen Keep. We [met] about six months ago.");
                        break;

                    case "met":
                        godelevaDowden.SayTo(player, "Great, because I have something that I need done. I need to get some fresh water to clean my floors with, but I simply don't have time to run to the water to get some. Will you [fetch] some for me?");
                        break;

                    //If the player offered his help, we send the quest dialog now!
                    case "fetch":
                        player.Out.SendQuestSubscribeCommand(godelevaDowden, QuestMgr.GetIDForQuestType(typeof(GodelevasNeed)), "Will you take the bucket down to the river and retrieve some water for Godeleva? [Level " + player.Level + "]");
                        break;
                    }
                }
                else
                {
                    switch (wArgs.Text)
                    {
                    case "abort":
                        player.Out.SendCustomDialog("Do you really want to abort this quest, \nall items gained during quest will be lost?", new CustomDialogResponse(CheckPlayerAbortQuest));
                        break;
                    }
                }
            }
        }
Exemplo n.º 25
0
        /* This is the method we declared as callback for the hooks we set to
         * NPC. It will be called whenever a player right clicks on NPC
         * or when he whispers something to him.
         */

        protected static void TalkToDalikor(DOLEvent e, object sender, EventArgs args)
        {
            //We get the player from the event arguments and check if he qualifies
            GamePlayer player = ((SourceEventArgs)args).Source as GamePlayer;

            if (player == null)
            {
                return;
            }

            if (dalikor.CanGiveQuest(typeof(Frontiers), player) <= 0)
            {
                return;
            }

            //We also check if the player is already doing the quest
            Frontiers quest = player.IsDoingQuest(typeof(Frontiers)) as Frontiers;

            //Did the player rightclick on NPC?
            dalikor.TurnTo(player);
            if (e == GameObjectEvent.Interact)
            {
                if (quest == null)
                {
                    //Player is not doing the quest...
                    dalikor.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.Talk1"));
                    return;
                }
                else
                {
                    switch (quest.Step)
                    {
                    case 1:
                        dalikor.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.Talk2", player.Name));
                        break;

                    case 5:
                        dalikor.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.Talk3", player.Name));
                        break;

                    case 6:
                        dalikor.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.Talk4"));
                        break;
                    }
                    return;
                }
            }
            // The player whispered to NPC (clicked on the text inside the [])
            else if (e == GameLivingEvent.WhisperReceive)
            {
                WhisperReceiveEventArgs wArgs = (WhisperReceiveEventArgs)args;
                if (quest == null)
                {
                    //Do some small talk :)
                    //If the player offered his "help", we send the quest dialog now!
                    if (wArgs.Text == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.Whisper1"))
                    {
                        dalikor.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.Talk5"));
                    }
                    else if (wArgs.Text == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.Whisper2"))
                    {
                        dalikor.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.Talk6"));
                    }
                    else if (wArgs.Text == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.Whisper3"))
                    {
                        player.Out.SendQuestSubscribeCommand(dalikor, QuestMgr.GetIDForQuestType(typeof(Frontiers)), LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.OfferQuest"));
                    }
                }
                else
                {
                    if (wArgs.Text == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.Whisper4"))
                    {
                        dalikor.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.Talk7", player.Name));
                        if (quest.Step == 6)
                        {
                            quest.FinishQuest();
                        }
                    }
                    else if (wArgs.Text == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.Whisper5"))
                    {
                        player.Out.SendCustomDialog(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToDalikor.AbortQuest"), new CustomDialogResponse(CheckPlayerAbortQuest));
                    }
                }
            }
        }
Exemplo n.º 26
0
 public override void Notify(DOLEvent e, object sender, EventArgs args)
 {
     // Need to do anything here?
 }
Exemplo n.º 27
0
        protected static void TalkToIdora(DOLEvent e, object sender, EventArgs args)
        {
            //We get the player from the event arguments and check if he qualifies
            GamePlayer player = ((SourceEventArgs)args).Source as GamePlayer;

            if (player == null)
            {
                return;
            }

            if (dalikor.CanGiveQuest(typeof(Frontiers), player) <= 0)
            {
                return;
            }

            //We also check if the player is already doing the quest
            Frontiers quest = player.IsDoingQuest(typeof(Frontiers)) as Frontiers;

            idora.TurnTo(player);
            //Did the player rightclick on NPC?
            if (e == GameObjectEvent.Interact)
            {
                if (quest != null)
                {
                    //Player is not doing the quest...
                    if (quest.Step == 3 || quest.Step == 2)
                    {
                        idora.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToIdora.Talk1", player.CharacterClass.Name));
                    }
                    else if (quest.Step == 4)
                    {
                        if (quest.idoraDone)
                        {
                            idora.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToIdora.Talk2"));
                        }
                        else
                        {
                            idora.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToIdora.Talk3"));
                        }
                    }
                    return;
                }
            }
            // The player whispered to NPC (clicked on the text inside the [])
            else if (e == GameLivingEvent.WhisperReceive)
            {
                WhisperReceiveEventArgs wArgs = (WhisperReceiveEventArgs)args;
                if (quest != null)
                {
                    //Do some small talk :)
                    if (wArgs.Text == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToIdora.Whisper1"))
                    {
                        idora.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToIdora.Talk4"));
                        idora.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.TalkToIdora.Talk5"));
                        if (quest.Step == 4)
                        {
                            GiveItem(idora, player, translatedPlans);
                            GiveItem(idora, player, ticketToMularn);
                            quest.Step = 5;
                            quest.TeleportTo(player, idora, locationVorgar, 50);
                        }
                    }
                }
            }
        }
Exemplo n.º 28
0
        protected static void TalkToNyra(DOLEvent e, object sender, EventArgs args)
        {
            //We get the player from the event arguments and check if he qualifies
            GamePlayer player = ((SourceEventArgs)args).Source as GamePlayer;

            if (player == null)
            {
                return;
            }

            if (Nyra.CanGiveQuest(typeof(NyrasPackage), player) <= 0)
            {
                return;
            }

            //We also check if the player is already doing the quest
            NyrasPackage quest = player.IsDoingQuest(typeof(NyrasPackage)) as NyrasPackage;

            Nyra.TurnTo(player);
            //Did the player rightclick on Sir Quait?
            if (e == GameObjectEvent.Interact)
            {
                //We check if the player is already doing the quest
                if (quest != null)
                {
                    //If the player is already doing the quest, we ask if he found the fur!
                    if (player.Inventory.GetFirstItemByID(SmallBoxforTaran.Id_nb, eInventorySlot.FirstBackpack, eInventorySlot.LastBackpack) != null)
                    {
                        Nyra.SayTo(player, "Welcome back friend! I take it you didn't have any problems finding him? Did he have anything to say?");
                    }
                    else if (player.Inventory.GetFirstItemByID(LettertoNyra.Id_nb, eInventorySlot.FirstBackpack, eInventorySlot.LastBackpack) != null)
                    {
                        Nyra.SayTo(player, "Welcome back friend! I take it you didn't have any problems finding him? Did he have anything to say?");
                    }
                    else if (quest.Step == 4)
                    {
                        Nyra.SayTo(player, "Excellent! I was hoping he would like it. It was a small box of oranges. I know he loves them, and my parents have a small orange tree grove. Well, I think it's time I gave you [something].");
                    }
                    return;
                }
                else
                {
                    Nyra.SayTo(player, "Hi there! You seem new to Mag Mell. I guess it's lucky that you ran into me! I have something I need done, and you look like the person to do this [errand] for me!");
                    return;
                }
            }
            // The player whispered to Sir Quait (clicked on the text inside the [])
            else if (e == GameLivingEvent.WhisperReceive)
            {
                WhisperReceiveEventArgs wArgs = (WhisperReceiveEventArgs)args;

                //We also check if the player is already doing the quest
                if (quest == null)
                {
                    switch (wArgs.Text)
                    {
                    case "errand":
                        Nyra.SayTo(player, "Oh yes. See, I have something that needs to be delivered to Taran the Smith over by Tir na Nog. Do you think you'd be [able] to do that for me?");
                        break;

                    case "able":
                        player.Out.SendQuestSubscribeCommand(Nyra, QuestMgr.GetIDForQuestType(typeof(NyrasPackage)), "Will you deliver Nyra's package to Taran the smith? [Level 1]");
                        break;
                    }
                }
                else
                {
                    switch (wArgs.Text)
                    {
                    case "abort":
                        player.Out.SendCustomDialog("Do you really want to abort this quest, \nall items gained during quest will be lost?", new CustomDialogResponse(CheckPlayerAbortQuest));
                        break;

                    case "something":
                        Nyra.SayTo(player, "Here you are. This is a ring I used a very long time ago, but I have no need for it now. I think it will suit you better. Thank you again my friend. Good journeys to you.");
                        quest.FinishQuest();
                        break;
                    }
                }
            }
        }
Exemplo n.º 29
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            }

            /* 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("Brother Maynard", 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)
            {
                brotherMaynard       = new GameHealer();
                brotherMaynard.Model = 34;
                brotherMaynard.Name  = "Brother Maynard";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + brotherMaynard.Name + ", creating him ...");
                }
                brotherMaynard.GuildName       = "Healer";
                brotherMaynard.Realm           = eRealm.Albion;
                brotherMaynard.CurrentRegionID = 1;
                brotherMaynard.Size            = 52;
                brotherMaynard.Level           = 27;
                brotherMaynard.X       = 574190;
                brotherMaynard.Y       = 530721;
                brotherMaynard.Z       = 2896;
                brotherMaynard.Heading = 1251;

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


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



            #endregion

            #region defineItems



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



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

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

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

            #region defineNPCs
            GameNPC[] npcsNyra;
            GameNPC[] npcsTaran;

            npcsNyra = WorldMgr.GetNPCsByName("Nyra", (eRealm)3);
            if (npcsNyra.Length == 0)
            {
                Nyra       = new DOL.GS.GameNPC();
                Nyra.Model = 377;
                Nyra.Name  = "Nyra";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + Nyra.Name + ", creating ...");
                }
                //Nyra.GuildName = "Part of " + questTitle + " Quest";
                Nyra.Realm           = eRealm.Hibernia;
                Nyra.CurrentRegionID = 200;
                Nyra.Size            = 50;
                Nyra.Level           = 10;
                Nyra.MaxSpeedBase    = 200;
                Nyra.Faction         = FactionMgr.GetFactionByID(0);
                Nyra.X               = 347415;
                Nyra.Y               = 492588;
                Nyra.Z               = 5199;
                Nyra.Heading         = 523;
                Nyra.RespawnInterval = 0;
                Nyra.BodyType        = 0;


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

                Nyra.AddToWorld();
            }
            else
            {
                Nyra = npcsNyra[0];
            }

            npcsTaran = WorldMgr.GetNPCsByName("Taran", (eRealm)3);
            if (npcsTaran.Length == 0)
            {
                Taran       = new DOL.GS.GameNPC();
                Taran.Model = 350;
                Taran.Name  = "Taran";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + Taran.Name + ", creating ...");
                }
                Taran.GuildName       = "Smith";
                Taran.Realm           = eRealm.Hibernia;
                Taran.CurrentRegionID = 200;
                Taran.Size            = 50;
                Taran.Level           = 35;
                Taran.MaxSpeedBase    = 200;
                Taran.Faction         = FactionMgr.GetFactionByID(0);
                Taran.X               = 336639;
                Taran.Y               = 484496;
                Taran.Z               = 5200;
                Taran.Heading         = 297;
                Taran.RespawnInterval = 0;
                Taran.BodyType        = 0;


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

                Taran.AddToWorld();
            }
            else
            {
                Taran = npcsTaran[0];
            }


            #endregion

            #region defineItems

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

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

                GameServer.Database.AddObject(LettertoNyra);
            }

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

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

                GameServer.Database.AddObject(SmallBoxforTaran);
            }

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

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

                GameServer.Database.AddObject(SilverRingofHealth);
            }

            #endregion


            // Custom Scriptloaded Code Begin
            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            GameEventMgr.AddHandler(Nyra, GameLivingEvent.Interact, new DOLEventHandler(TalkToNyra));
            GameEventMgr.AddHandler(Nyra, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToNyra));

            GameEventMgr.AddHandler(Taran, GameLivingEvent.Interact, new DOLEventHandler(TalkToTaran));
            GameEventMgr.AddHandler(Taran, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToTaran));

            // Custom Scriptloaded Code End

            Nyra.AddQuestToGive(typeof(NyrasPackage));
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Exemplo n.º 31
0
 public static void OnScriptUnloaded(DOLEvent e, object sender, EventArgs args)
 {
     GameEventMgr.RemoveHandler(DatabaseEvent.CharacterCreated, new DOLEventHandler(OnCharacterCreation));
 }
Exemplo n.º 32
0
        /// <summary>
        /// On Character Creation set up equipment from StarterEquipment Table.
        /// </summary>
        /// <param name="e"></param>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        public static void OnCharacterCreation(DOLEvent e, object sender, EventArgs args)
        {
            if (!ENABLE_FREE_STARTER_EQUIPMENT)
            {
                return;
            }

            // Check Args
            var chArgs = args as CharacterEventArgs;

            if (chArgs == null)
            {
                return;
            }

            DOLCharacters ch = chArgs.Character;

            try
            {
                var usedSlots = new Dictionary <eInventorySlot, bool>();

                if (m_cachedClassEquipment.ContainsKey((eCharacterClass)ch.Class))
                {
                    // sort for filling righ hand first...
                    foreach (var item in m_cachedClassEquipment.Where(k => k.Key == 0 || k.Key == (eCharacterClass)ch.Class).SelectMany(kv => kv.Value).OrderBy(it => it.Item_Type))
                    {
                        // create Inventory item and set to owner.
                        InventoryItem inventoryItem = GameInventoryItem.Create <ItemTemplate>(item);
                        inventoryItem.OwnerID = ch.ObjectId;
                        inventoryItem.Realm   = ch.Realm;

                        bool itemChoosen = false;

                        // if equipable item, find equippable slot
                        foreach (eInventorySlot currentSlot in GameLivingInventory.EQUIP_SLOTS)
                        {
                            if ((eInventorySlot)inventoryItem.Item_Type == currentSlot)
                            {
                                eInventorySlot chosenSlot;

                                // try to set Left Hand in Right Hand slot if not already used.
                                if (currentSlot == eInventorySlot.LeftHandWeapon && (eObjectType)inventoryItem.Object_Type != eObjectType.Shield && !usedSlots.ContainsKey(eInventorySlot.RightHandWeapon))
                                {
                                    chosenSlot = eInventorySlot.RightHandWeapon;
                                }
                                else
                                {
                                    chosenSlot = currentSlot;
                                }

                                // Slot is occupied, add this to backpack.
                                if (usedSlots.ContainsKey(chosenSlot))
                                {
                                    if (log.IsWarnEnabled)
                                    {
                                        log.WarnFormat("Cannot add Starter Equipment item {0} to class {1} an item is already assigned to this slot! (Added to Backpack...)", item.Id_nb, ch.Class);
                                    }
                                    break;
                                }

                                inventoryItem.SlotPosition = (int)chosenSlot;
                                usedSlots[chosenSlot]      = true;
                                if (ch.ActiveWeaponSlot == 0)
                                {
                                    switch (inventoryItem.SlotPosition)
                                    {
                                    case Slot.RIGHTHAND:
                                        ch.ActiveWeaponSlot = (byte)GamePlayer.eActiveWeaponSlot.Standard;
                                        break;

                                    case Slot.TWOHAND:
                                        ch.ActiveWeaponSlot = (byte)GamePlayer.eActiveWeaponSlot.TwoHanded;
                                        break;

                                    case Slot.RANGED:
                                        ch.ActiveWeaponSlot = (byte)GamePlayer.eActiveWeaponSlot.Distance;
                                        break;
                                    }
                                }

                                itemChoosen = true;
                                break;
                            }
                        }

                        if (!itemChoosen)
                        {
                            //otherwise stick the item in the backpack
                            for (int i = (int)eInventorySlot.FirstBackpack; i < (int)eInventorySlot.LastBackpack; i++)
                            {
                                if (!usedSlots.ContainsKey((eInventorySlot)i))
                                {
                                    inventoryItem.SlotPosition   = i;
                                    usedSlots[(eInventorySlot)i] = true;
                                    break;
                                }
                            }
                        }

                        GameServer.Database.AddObject(inventoryItem);
                    }
                }
            }
            catch (Exception err)
            {
                if (log.IsErrorEnabled)
                {
                    log.ErrorFormat("Error while adding Startup Equipment to {0} - Exception: {1}", ch.Name, err);
                }
            }
        }
Exemplo n.º 33
0
        private static void OnPlayerLeft(DOLEvent e, object sender, EventArgs arguments)
        {
            if (!(sender is GamePlayer))
                return;

            GamePlayer player = sender as GamePlayer;
            lock (player.Inventory)
            {
                var items = player.Inventory.GetItemRange(eInventorySlot.MinEquipable, eInventorySlot.LastBackpack);
                foreach (InventoryItem invItem in items)
                {
                    if (invItem.Id_nb.Equals("Golden_Trident_of_Flame"))
                        player.Inventory.RemoveItem(invItem);

                    if (invItem.Id_nb.Equals("Golden_Trident_of_FlameM"))
                        player.Inventory.RemoveItem(invItem);

                    if (invItem.Id_nb.Equals("Golden_Trident_of_FlameH"))
                        player.Inventory.RemoveItem(invItem);

                }
            }
            GameEventMgr.RemoveHandler(sender, GamePlayerEvent.Quit, OnPlayerLeft);
        }
Exemplo n.º 34
0
 public static void OnScriptLoaded(DOLEvent e, object sender, EventArgs args)
 {
     InitStarterEquipment();
     GameEventMgr.AddHandler(DatabaseEvent.CharacterCreated, new DOLEventHandler(OnCharacterCreation));
 }
Exemplo n.º 35
0
        private static void OnPlayerLeft(DOLEvent e, object sender, EventArgs arguments)
        {
            if (!(sender is GamePlayer))
                return;

            GamePlayer player = sender as GamePlayer;
            lock (player.Inventory)
            {
                var items = player.Inventory.GetItemRange(eInventorySlot.MinEquipable, eInventorySlot.LastBackpack);
                foreach (InventoryItem invItem in items)
                {

                    if (invItem.Id_nb.Equals("Sun_Crush"))
                        player.Inventory.RemoveItem(invItem);

                    if (invItem.Id_nb.Equals("Sun_Slash"))
                        player.Inventory.RemoveItem(invItem);

                    if (invItem.Id_nb.Equals("Sun_Thrust"))
                        player.Inventory.RemoveItem(invItem);

                    if (invItem.Id_nb.Equals("Sun_Flex"))
                        player.Inventory.RemoveItem(invItem);

                    if (invItem.Id_nb.Equals("Sun_TwoHanded"))
                        player.Inventory.RemoveItem(invItem);

                    if (invItem.Id_nb.Equals("Sun_Polearm"))
                        player.Inventory.RemoveItem(invItem);

                    if (invItem.Id_nb.Equals("Sun_Bow"))
                        player.Inventory.RemoveItem(invItem);

                    if (invItem.Id_nb.Equals("Sun_Staff"))
                        player.Inventory.RemoveItem(invItem);

                    if (invItem.Id_nb.Equals("Sun_MFist"))
                        player.Inventory.RemoveItem(invItem);

                    if (invItem.Id_nb.Equals("Sun_MStaff"))
                        player.Inventory.RemoveItem(invItem);

                    if (invItem.Id_nb.Equals("Sun_Axe"))
                        player.Inventory.RemoveItem(invItem);

                    if (invItem.Id_nb.Equals("Sun_LeftAxe"))
                        player.Inventory.RemoveItem(invItem);

                    if (invItem.Id_nb.Equals("Sun_Claw"))
                        player.Inventory.RemoveItem(invItem);

                    if (invItem.Id_nb.Equals("Sun_2HCrush"))
                        player.Inventory.RemoveItem(invItem);

                    if (invItem.Id_nb.Equals("Sun_2HAxe"))
                        player.Inventory.RemoveItem(invItem);

                    if (invItem.Id_nb.Equals("Sun_MStaff"))
                        player.Inventory.RemoveItem(invItem);

                    if (invItem.Id_nb.Equals("Sun_FlexScythe"))
                        player.Inventory.RemoveItem(invItem);

                    if (invItem.Id_nb.Equals("Sun_Spear"))
                        player.Inventory.RemoveItem(invItem);

                }
            }
            GameEventMgr.RemoveHandler(sender, GamePlayerEvent.Quit, OnPlayerLeft);
        }
Exemplo n.º 36
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            }

            #region defineNPCs
            GameNPC[] npcs;

            npcs = WorldMgr.GetNPCsByName("Gridash", (eRealm)2);
            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(100).IsDisabled)
                {
                    Gridash       = new DOL.GS.GameNPC();
                    Gridash.Model = 137;
                    Gridash.Name  = "Gridash";
                    if (log.IsWarnEnabled)
                    {
                        log.Warn("Could not find " + Gridash.Name + ", creating ...");
                    }
                    Gridash.GuildName       = "Part of " + questTitle + " Quest";
                    Gridash.Realm           = eRealm.Midgard;
                    Gridash.CurrentRegionID = 100;
                    Gridash.Size            = 51;
                    Gridash.Level           = 21;
                    Gridash.MaxSpeedBase    = 191;
                    Gridash.Faction         = FactionMgr.GetFactionByID(0);
                    Gridash.X               = 772795;
                    Gridash.Y               = 753335;
                    Gridash.Z               = 4600;
                    Gridash.Heading         = 3356;
                    Gridash.RespawnInterval = -1;
                    Gridash.BodyType        = 0;


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

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


            #endregion

            #region defineItems

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

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(bronze_short_sword);
                }
            }
            sveawolftooth = GameServer.Database.FindObjectByKey <ItemTemplate>("sveawolftooth");
            if (sveawolftooth == null)
            {
                sveawolftooth      = new ItemTemplate();
                sveawolftooth.Name = "Sveawolf Tooth";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + sveawolftooth.Name + ", creating it ...");
                }
                sveawolftooth.Level            = 50;
                sveawolftooth.Weight           = 5;
                sveawolftooth.Model            = 106;
                sveawolftooth.Object_Type      = 0;
                sveawolftooth.Item_Type        = 40;
                sveawolftooth.Id_nb            = "sveawolftooth";
                sveawolftooth.Hand             = 0;
                sveawolftooth.Price            = 0;
                sveawolftooth.IsPickable       = true;
                sveawolftooth.IsDropable       = true;
                sveawolftooth.IsTradable       = true;
                sveawolftooth.CanDropAsLoot    = false;
                sveawolftooth.Color            = 0;
                sveawolftooth.Bonus            = 35;      // default bonus
                sveawolftooth.Bonus1           = 0;
                sveawolftooth.Bonus1Type       = (int)0;
                sveawolftooth.Bonus2           = 0;
                sveawolftooth.Bonus2Type       = (int)0;
                sveawolftooth.Bonus3           = 0;
                sveawolftooth.Bonus3Type       = (int)0;
                sveawolftooth.Bonus4           = 0;
                sveawolftooth.Bonus4Type       = (int)0;
                sveawolftooth.Bonus5           = 0;
                sveawolftooth.Bonus5Type       = (int)0;
                sveawolftooth.Bonus6           = 0;
                sveawolftooth.Bonus6Type       = (int)0;
                sveawolftooth.Bonus7           = 0;
                sveawolftooth.Bonus7Type       = (int)0;
                sveawolftooth.Bonus8           = 0;
                sveawolftooth.Bonus8Type       = (int)0;
                sveawolftooth.Bonus9           = 0;
                sveawolftooth.Bonus9Type       = (int)0;
                sveawolftooth.Bonus10          = 0;
                sveawolftooth.Bonus10Type      = (int)0;
                sveawolftooth.ExtraBonus       = 0;
                sveawolftooth.ExtraBonusType   = (int)0;
                sveawolftooth.Effect           = 0;
                sveawolftooth.Emblem           = 0;
                sveawolftooth.Charges          = 0;
                sveawolftooth.MaxCharges       = 0;
                sveawolftooth.SpellID          = 0;
                sveawolftooth.ProcSpellID      = 0;
                sveawolftooth.Type_Damage      = 0;
                sveawolftooth.Realm            = 0;
                sveawolftooth.MaxCount         = 1;
                sveawolftooth.PackSize         = 1;
                sveawolftooth.Extension        = 0;
                sveawolftooth.Quality          = 99;
                sveawolftooth.Condition        = 50000;
                sveawolftooth.MaxCondition     = 50000;
                sveawolftooth.Durability       = 50000;
                sveawolftooth.MaxDurability    = 50000;
                sveawolftooth.PoisonCharges    = 0;
                sveawolftooth.PoisonMaxCharges = 0;
                sveawolftooth.PoisonSpellID    = 0;
                sveawolftooth.ProcSpellID1     = 0;
                sveawolftooth.SpellID1         = 0;
                sveawolftooth.MaxCharges1      = 0;
                sveawolftooth.Charges1         = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(sveawolftooth);
                }
            }
            sveabone_hilt_sword = GameServer.Database.FindObjectByKey <ItemTemplate>("sveabone_hilt_sword");
            if (sveabone_hilt_sword == null)
            {
                sveabone_hilt_sword      = new ItemTemplate();
                sveabone_hilt_sword.Name = "Sveabone Hilt Sword";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + sveabone_hilt_sword.Name + ", creating it ...");
                }
                sveabone_hilt_sword.Level            = 1;
                sveabone_hilt_sword.Weight           = 18;
                sveabone_hilt_sword.Model            = 311;
                sveabone_hilt_sword.Object_Type      = 11;
                sveabone_hilt_sword.Item_Type        = 10;
                sveabone_hilt_sword.Id_nb            = "sveabone_hilt_sword";
                sveabone_hilt_sword.Hand             = 0;
                sveabone_hilt_sword.Price            = 0;
                sveabone_hilt_sword.IsPickable       = true;
                sveabone_hilt_sword.IsDropable       = true;
                sveabone_hilt_sword.IsTradable       = false;
                sveabone_hilt_sword.CanDropAsLoot    = false;
                sveabone_hilt_sword.Color            = 0;
                sveabone_hilt_sword.Bonus            = 0;      // default bonus
                sveabone_hilt_sword.Bonus1           = 1;
                sveabone_hilt_sword.Bonus1Type       = (int)52;
                sveabone_hilt_sword.Bonus2           = 0;
                sveabone_hilt_sword.Bonus2Type       = (int)0;
                sveabone_hilt_sword.Bonus3           = 0;
                sveabone_hilt_sword.Bonus3Type       = (int)0;
                sveabone_hilt_sword.Bonus4           = 0;
                sveabone_hilt_sword.Bonus4Type       = (int)0;
                sveabone_hilt_sword.Bonus5           = 0;
                sveabone_hilt_sword.Bonus5Type       = (int)0;
                sveabone_hilt_sword.Bonus6           = 0;
                sveabone_hilt_sword.Bonus6Type       = (int)0;
                sveabone_hilt_sword.Bonus7           = 0;
                sveabone_hilt_sword.Bonus7Type       = (int)0;
                sveabone_hilt_sword.Bonus8           = 0;
                sveabone_hilt_sword.Bonus8Type       = (int)0;
                sveabone_hilt_sword.Bonus9           = 0;
                sveabone_hilt_sword.Bonus9Type       = (int)0;
                sveabone_hilt_sword.Bonus10          = 0;
                sveabone_hilt_sword.Bonus10Type      = (int)0;
                sveabone_hilt_sword.ExtraBonus       = 0;
                sveabone_hilt_sword.ExtraBonusType   = (int)0;
                sveabone_hilt_sword.Effect           = 0;
                sveabone_hilt_sword.Emblem           = 0;
                sveabone_hilt_sword.Charges          = 0;
                sveabone_hilt_sword.MaxCharges       = 0;
                sveabone_hilt_sword.SpellID          = 0;
                sveabone_hilt_sword.ProcSpellID      = 0;
                sveabone_hilt_sword.Type_Damage      = 2;
                sveabone_hilt_sword.Realm            = 0;
                sveabone_hilt_sword.MaxCount         = 1;
                sveabone_hilt_sword.PackSize         = 1;
                sveabone_hilt_sword.Extension        = 0;
                sveabone_hilt_sword.Quality          = 99;
                sveabone_hilt_sword.Condition        = 100;
                sveabone_hilt_sword.MaxCondition     = 100;
                sveabone_hilt_sword.Durability       = 100;
                sveabone_hilt_sword.MaxDurability    = 100;
                sveabone_hilt_sword.PoisonCharges    = 0;
                sveabone_hilt_sword.PoisonMaxCharges = 0;
                sveabone_hilt_sword.PoisonSpellID    = 0;
                sveabone_hilt_sword.ProcSpellID1     = 0;
                sveabone_hilt_sword.SpellID1         = 0;
                sveabone_hilt_sword.MaxCharges1      = 0;
                sveabone_hilt_sword.Charges1         = 0;

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


            #endregion

            #region defineAreas

            #endregion

            #region defineQuestParts

            QuestBuilder   builder = QuestMgr.getBuilder(typeof(sveabonehiltsword));
            QuestBehaviour a;
            a = builder.CreateBehaviour(Gridash, -1);
            a.AddTrigger(eTriggerType.Interact, null, Gridash);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), Gridash);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), null, (eComparator)5);
            a.AddAction(eActionType.Talk, "Hail young one! I have noticed that you do not carry one of my fine [bone hilt swords].", Gridash);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Gridash, -1);
            a.AddTrigger(eTriggerType.Whisper, "bone hilt swords", Gridash);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), Gridash);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), null, (eComparator)5);
            a.AddAction(eActionType.Talk, "Aye! They are some of my finest works! I don't suppose you [would care for one] eh?", Gridash);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Gridash, -1);
            a.AddTrigger(eTriggerType.Whisper, "would care for one", Gridash);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), Gridash);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), null, (eComparator)5);
            a.AddAction(eActionType.OfferQuest, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), "Will you do what is asked so that Gridash can make a Sveabone hilt sword?");
            AddBehaviour(a);
            a = builder.CreateBehaviour(Gridash, -1);
            a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword));
            a.AddAction(eActionType.Talk, "No problem. See you", Gridash);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Gridash, -1);
            a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword));
            a.AddAction(eActionType.Talk, "Oh great then! Run along and buy me a bronze short sword. I should be ready once you return.", Gridash);
            a.AddAction(eActionType.GiveQuest, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), Gridash);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Gridash, -1);
            a.AddTrigger(eTriggerType.GiveItem, Gridash, bronze_short_sword);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), null);
            a.AddAction(eActionType.Talk, "Good work! I cannot seem to find anymore sveawolf teeth to fashion your weapon. Find one and return it to me.", Gridash);
            a.AddAction(eActionType.TakeItem, bronze_short_sword, null);
            a.AddAction(eActionType.IncQuestStep, typeof(sveabonehiltsword), null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Gridash, -1);
            a.AddTrigger(eTriggerType.EnemyKilled, "young sveawof", null);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), 2, (eComparator)3);
            a.AddAction(eActionType.GiveItem, sveawolftooth, null);
            a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Gridash, -1);
            a.AddTrigger(eTriggerType.GiveItem, Gridash, sveawolftooth);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), 3, (eComparator)3);
            a.AddAction(eActionType.Talk, "Here is your completed work. I hope it serves you well!", Gridash);
            a.AddAction(eActionType.TakeItem, sveawolftooth, null);
            a.AddAction(eActionType.GiveItem, sveabone_hilt_sword, Gridash);
            a.AddAction(eActionType.GiveXP, 20, null);
            a.AddAction(eActionType.GiveGold, 450, null);
            a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), null);
            AddBehaviour(a);

            #endregion

            // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End
            if (Gridash != null)
            {
                Gridash.AddQuestToGive(typeof(sveabonehiltsword));
            }
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }