public override void Notify(DOLEvent e, object sender, EventArgs args) { GamePlayer player = sender as GamePlayer; if (player == null || player.IsDoingQuest(typeof(IreFairyIre)) == null) { return; } if (Step == 3 && e == GameLivingEvent.EnemyKilled) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if (gArgs.Target == fairyDragonflyHandler) { SendSystemMessage("You slay the creature and pluck a whip from the Ire Fairy trainer's hands."); GiveItem(gArgs.Target, player, dragonflyWhip); Step = 4; return; } } if (Step == 5 && e == GamePlayerEvent.GiveItem) { GiveItemEventArgs gArgs = (GiveItemEventArgs)args; if (gArgs.Target.Name == colm.Name && gArgs.Item.Id_nb == dragonflyWhip.Id_nb) { colm.SayTo(player, "A whip?! This is outrageous! I see they were just trying to torture him. These Ire Fairies are truly malicious creatures. I hope you wipe them out one day Vinde. Here, take this as a sign of my [appreciation] for the return of the little one."); RemoveItem(colm, player, dragonflyWhip); Step = 6; return; } } }
public override void Notify(DOLEvent e, object sender, EventArgs args) { GamePlayer player = sender as GamePlayer; if (player == null) { return; } if (player.IsDoingQuest(typeof(AMessageToTheManes)) == null) { return; } if (Step == 2 && e == GameLivingEvent.EnemyKilled) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if ((gArgs.Target.Name.IndexOf("Manes Demon") >= 0) || (gArgs.Target.Name.IndexOf("manes demon") >= 0)) { if (manesKilled == 0) { SendSystemMessage("You've killed the first Manes demon."); manesKilled++; return; } else if (manesKilled == 1) { player.Out.SendDialogBox(eDialogCode.SimpleWarning, 0x00, 0x00, 0x00, 0x00, eDialogType.Ok, true, "You've killed two Manes demons! \nYour journal has been updated."); Step = 3; manesKilled++; return; } } } }
public override void Notify(DOLEvent e, object sender, EventArgs args) { GamePlayer player = sender as GamePlayer; if (player == null) { return; } if (player.IsDoingQuest(typeof(BreakingTheBandits)) == null) { return; } if (Step == 2 && e == GameLivingEvent.EnemyKilled) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if ((gArgs.Target.Name.IndexOf("Mostram") >= 0) || (gArgs.Target.Name.IndexOf("mostram") >= 0)) { Step = 3; player.Out.SendDialogBox(eDialogCode.SimpleWarning, 0x00, 0x00, 0x00, 0x00, eDialogType.Ok, true, "You killed Mostram! Your journal has been updated."); return; } } }
/// <summary> /// Handles quest events. /// </summary> /// <param name="e"></param> /// <param name="sender"></param> /// <param name="args"></param> public override void Notify(DOLEvent e, object sender, EventArgs args) { base.Notify(e, sender, args); GamePlayer player = sender as GamePlayer; if (player == null) { return; } if (player.IsDoingQuest(typeof(MagicalBacklash)) == null) { return; } if (Step == 1 && e == GameLivingEvent.EnemyKilled) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if (gArgs.Target.Name.IndexOf(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Hib.MagicalBacklash.Notify.Text1")) >= 0) { if (!OrchardNipperKilled.IsAchieved) { OrchardNipperKilled.Advance(); return; } } } }
/// <summary> /// This method checks if a player is qualified for this quest /// </summary> /// <returns>true if qualified, false if not</returns> public override void Notify(DOLEvent e, object sender, EventArgs args) { GamePlayer player = sender as GamePlayer; if (player == null) { return; } if (Step == 1 && e == GameLivingEvent.EnemyKilled) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if (gArgs.Target.Name.IndexOf("minor changeling") >= 0) { SendSystemMessage("You've killed the " + gArgs.Target.Name); Step = 2; return; } } if (Step == 2 && e == GameLivingEvent.EnemyKilled) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if (gArgs.Target.Name.IndexOf("minor changeling") >= 0) { SendSystemMessage("You've killed the " + gArgs.Target.Name); Step = 3; return; } } }
/// <summary> /// Handles quest events. /// </summary> /// <param name="e"></param> /// <param name="sender"></param> /// <param name="args"></param> public override void Notify(DOLEvent e, object sender, EventArgs args) { base.Notify(e, sender, args); GamePlayer player = sender as GamePlayer; if (player == null) { return; } if (player.IsDoingQuest(typeof(AfterTheAccident)) == null) { return; } if (Step == 1 && e == GameLivingEvent.EnemyKilled) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if (gArgs.Target.Name.IndexOf(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Alb.AfterTheAccident.Notify.Text1")) >= 0) { if (!punySkeletonGoal.IsAchieved) { punySkeletonGoal.Advance(); return; } } } }
public override void Notify(DOLEvent e, object sender, EventArgs args) { GamePlayer player = sender as GamePlayer; if (player == null || player.IsDoingQuest(typeof(StolenEggs)) == null) { return; } if (Step == 3 && e == GameLivingEvent.EnemyKilled) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if (gArgs.Target == askefruerTrainer) { SendSystemMessage(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.StolenEggs.Notify.Text1", askefruerTrainer.GetName(0, true))); SendSystemMessage(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.StolenEggs.Notify.Text2")); GiveItem(gArgs.Target, player, trainerWhip); Step = 4; return; } } if (Step == 5 && e == GamePlayerEvent.GiveItem) { GiveItemEventArgs gArgs = (GiveItemEventArgs)args; if (gArgs.Target.Name == njiedi.Name && gArgs.Item.Id_nb == trainerWhip.Id_nb) { njiedi.SayTo(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.StolenEggs.Notify.Text3", player.Name)); RemoveItem(njiedi, player, trainerWhip); Step = 6; return; } } }
/// <summary> /// Handles quest events. /// </summary> /// <param name="e"></param> /// <param name="sender"></param> /// <param name="args"></param> public override void Notify(DOLEvent e, object sender, EventArgs args) { base.Notify(e, sender, args); GamePlayer player = sender as GamePlayer; if (player == null) { return; } if (player.IsDoingQuest(typeof(DredgeUpAPledge)) == null) { return; } if (Step == 1 && e == GameLivingEvent.EnemyKilled) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if (gArgs.Target.Name.IndexOf(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Alb.DredgeUpAPledge.Notify")) >= 0) { if (!banditPledgesKilled.IsAchieved) { banditPledgesKilled.Advance(); return; } } } }
public override void Notify(DOLEvent e, object sender, EventArgs args) { GamePlayer player = sender as GamePlayer; if (player == null || player.IsDoingQuest(typeof(HuntForArachneida)) == null) { return; } if (Step == 1 && e == GameLivingEvent.EnemyKilled) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if (gArgs.Target.Name == "bloated spider") { if (Util.Chance(50)) { SendSystemMessage("You were able to slay a bloated spider, but her fang was broken during combat.!"); } else { SendSystemMessage("You were able to slay a bloated spider, and take her fang!"); GiveItem(gArgs.Target, player, bloatedFang); Step = 2; } return; } } if (Step == 2 && e == GameLivingEvent.EnemyKilled) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if (gArgs.Target.Name == arachneida.Name) { SendSystemMessage("You strike down Arachneida, now use the fang to retrieve her chitin!"); Step = 3; return; } } else if (Step >= 4 && e == GamePlayerEvent.GiveItem) { GiveItemEventArgs gArgs = (GiveItemEventArgs)args; if (gArgs.Target.Name == kealan.Name && (gArgs.Item.Id_nb == bloatedFang.Id_nb || gArgs.Item.Id_nb == spiderChitin.Id_nb)) { kealan.TurnTo(m_questPlayer); if (Step == 4) { kealan.SayTo(player, "Very well now hand me over the rest and you will revieve your reward..."); RemoveItem(kealan, player, gArgs.Item.Template); Step = 5; } else if (Step == 5) { RemoveItem(kealan, player, gArgs.Item.Template); FinishQuest(); } return; } } }
public override void Notify(DOLEvent e, object sender, EventArgs args) { GamePlayer player = sender as GamePlayer; if (player == null || player.IsDoingQuest(typeof(BuildingABetterBow)) == null) { return; } if (e == GameLivingEvent.EnemyKilled) { if (Step == 2) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if (gArgs.Target.Name == "skeleton") { if (Util.Chance(50)) { player.Out.SendDialogBox(eDialogCode.SimpleWarning, 0x00, 0x00, 0x00, 0x00, eDialogType.Ok, true, "You select a well-preserved bone from the \nremains and place it in your pack. \nYour journal has been updated."); GiveItem(gArgs.Target, player, wellPreservedBones); Step = 3; } return; } } else if (Step == 3) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if (gArgs.Target.Name == "skeleton") { if (Util.Chance(50)) { player.Out.SendDialogBox(eDialogCode.SimpleWarning, 0x00, 0x00, 0x00, 0x00, eDialogType.Ok, true, "You select a well-preserved bone from the \nremains and place it in your pack. \nYour journal has been updated."); ReplaceItem(player, wellPreservedBones, twoWellPreservedBones); Step = 4; } return; } } } else if (e == GamePlayerEvent.GiveItem) { if (Step == 4) { GiveItemEventArgs gArgs = (GiveItemEventArgs)args; if (gArgs.Target.Name == elvarIronhand.Name && gArgs.Item.Id_nb == twoWellPreservedBones.Id_nb) { RemoveItem(elvarIronhand, QuestPlayer, twoWellPreservedBones); elvarIronhand.TurnTo(QuestPlayer); elvarIronhand.SayTo(QuestPlayer, "Hmm...These look a bit more brittle than I was expecting. I suspect I may end up using horn for the final prototype, after all. No matter, I'm sure I'll end up making several bows before I start demonstrating the new [technique]."); Step = 5; } } } }
public override void Notify(DOLEvent e, object sender, EventArgs args) { if (e != GameLivingEvent.EnemyKilled) { return; } EnemyKilledEventArgs eargs = args as EnemyKilledEventArgs; //we don't want mission masters to be considered realm guards because they are insta respawn //in addition do not count realm 0 guards if (eargs.Target is Keeps.MissionMaster || eargs.Target.Realm == eRealm.None) { return; } if (m_targetType.IsInstanceOfType(eargs.Target) == false) { return; } //we dont allow events triggered by non group leaders if (MissionType == eMissionType.Group && sender is GamePlayer) { GamePlayer player = sender as GamePlayer; if (player.Group == null) { return; } if (player.Group.Leader != player) { return; } } //we don't want group events to trigger personal mission updates if (MissionType == eMissionType.Personal && sender is GamePlayer) { GamePlayer player = sender as GamePlayer; if (player.Group != null) { return; } } m_current++; UpdateMission(); if (m_current == m_total) { FinishMission(); } }
public override void Notify(DOLEvent e, object sender, EventArgs args) { GamePlayer player = sender as GamePlayer; if (player == null || player.IsDoingQuest(typeof(ClericMulgrut)) == null) { return; } if (e == GameLivingEvent.EnemyKilled) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if (Step == 1) { if (gArgs.Target.Name == "puny skeleton") { if (Util.Chance(25)) { if (mulgrutMaggot == null) { mulgrutMaggot = new GameNPC(); mulgrutMaggot.Model = 467; mulgrutMaggot.Name = "Mulgrut Maggot"; mulgrutMaggot.Realm = eRealm.None; mulgrutMaggot.CurrentRegionID = 1; mulgrutMaggot.Size = 60; mulgrutMaggot.Level = 5; mulgrutMaggot.X = 565941; mulgrutMaggot.Y = 528121; mulgrutMaggot.Z = 2152; mulgrutMaggot.Heading = 2278; StandardMobBrain brain = new StandardMobBrain(); // set a brain witch find a lot mob friend to attack the player mulgrutMaggot.SetOwnBrain(brain); mulgrutMaggot.RespawnInterval = 0; // don't respawn when killed mulgrutMaggot.AddToWorld(); } } } else if (gArgs.Target.Name == "Mulgrut Maggot") { GiveItem(gArgs.Target, player, beltOfAnimation); if (mulgrutMaggot != null) { mulgrutMaggot = null; } FinishQuest(); } } } }
public override void Notify(DOLEvent e, object sender, EventArgs args) { GamePlayer player = sender as GamePlayer; if (player == null || player.IsDoingQuest(typeof(HuntForSlith)) == null) { return; } if (e == GameLivingEvent.EnemyKilled) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if (Step == 1) { if (gArgs.Target.Name == "slith broodling") { if (Util.Chance(25)) { if (slith == null) { slith = new GameNPC(); slith.Model = 31; slith.Name = "Slith"; slith.Realm = eRealm.None; slith.CurrentRegionID = 1; slith.Size = 50; slith.Level = 7; slith.X = 524840; slith.Y = 490529; slith.Z = 2545; slith.Heading = 2082; StandardMobBrain brain = new StandardMobBrain(); // set a brain witch find a lot mob friend to attack the player slith.SetOwnBrain(brain); slith.RespawnInterval = 0; // don't respawn when killed slith.AddToWorld(); } } } else if (gArgs.Target.Name == "Slith") { GiveItem(gArgs.Target, player, slithsTail); if (slith != null) { slith = null; } FinishQuest(); } } } }
/// <summary> /// Checks the trigger, this method is called whenever a event associated with this questparts quest /// or a manualy associated eventhandler is notified. /// </summary> /// <param name="e"></param> /// <param name="sender"></param> /// <param name="args"></param> /// <returns></returns> public override bool Check(DOLEvent e, object sender, EventArgs args) { bool result = false; if (e == GameLivingEvent.EnemyKilled && sender == I) { GamePlayer player = BehaviourUtils.GuessGamePlayerFromNotify(e, sender, args); EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; result = gArgs.Target == player; } return(result); }
public override void Notify(DOLEvent e, object sender, EventArgs args) { GamePlayer player = sender as GamePlayer; if (player == null) { return; } if (player.IsDoingQuest(typeof(BoarStew)) == null) { return; } if (e == GameLivingEvent.EnemyKilled) { if (Step == 1) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if ((gArgs.Target.Name == "Huge Boar") || (gArgs.Target.Name == "huge boar")) { if (Util.Chance(50)) { player.Out.SendDialogBox(eDialogCode.SimpleWarning, 0x00, 0x00, 0x00, 0x00, eDialogType.Ok, true, "You receive the Huge Boar Carcass from the huge boar! \nYour journal has been updated."); boarCarcass.Name = gArgs.Target.GetName(1, true) + " carcass "; GiveItem(player, boarCarcass); Step = 2; } return; } } } else if (e == GamePlayerEvent.GiveItem) { GiveItemEventArgs gArgs = (GiveItemEventArgs)args; switch (Step) { case 2: if (gArgs.Target.Name == masterGerol.Name && gArgs.Item.Id_nb == boarCarcass.Id_nb) { RemoveItem(masterGerol, player, boarCarcass); masterGerol.SayTo(player, "Wow, this has got to be the largest boar I have seen yet! Here, have some coins for payment of your task, as well as the knowledge you are helping out the health of Albion."); FinishQuest(); } return; } } }
public override void Notify(DOLEvent e, object sender, EventArgs args) { GamePlayer player = sender as GamePlayer; if (player == null || player.IsDoingQuest(typeof(RevengeTheOtherWhiteMeat)) == null) { return; } if (e == GameLivingEvent.EnemyKilled) { if (Step == 2) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if (gArgs.Target.Name == "Wilbur") { player.Out.SendDialogBox(eDialogCode.SimpleWarning, 0x00, 0x00, 0x00, 0x00, eDialogType.Ok, true, "You've succeeded in killing Wilbur. In the \ndistance you hear the angry voice of \na pig herder. Make your escape!"); Step = 3; player.GainExperience(GameLiving.eXPSource.Quest, player.ExperienceForNextLevel / 25, true); GameNPC pigHerderWyatt = new GameNPC(); pigHerderWyatt.Model = 39; pigHerderWyatt.Name = "Pig Herder Wyatt"; pigHerderWyatt.Realm = eRealm.Albion; pigHerderWyatt.CurrentRegionID = 1; GameNpcInventoryTemplate template = new GameNpcInventoryTemplate(); template.AddNPCEquipment(eInventorySlot.FeetArmor, 143); template.AddNPCEquipment(eInventorySlot.TorsoArmor, 1005); pigHerderWyatt.Inventory = template.CloseTemplate(); pigHerderWyatt.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard); pigHerderWyatt.Size = 54; pigHerderWyatt.Level = 33; pigHerderWyatt.X = wilburSpawnLocation.X - 1000; pigHerderWyatt.Y = wilburSpawnLocation.Y + 1500; pigHerderWyatt.Z = wilburSpawnLocation.Z; pigHerderWyatt.Heading = 2548; pigHerderWyatt.AddToWorld(); GameEventMgr.AddHandler(pigHerderWyatt, GameNPCEvent.ArriveAtTarget, new DOLEventHandler(OnCloseToDeadWilbur)); pigHerderWyatt.WalkTo(gArgs.Target.X - 90, gArgs.Target.Y + 90, gArgs.Target.Z, 200); return; } } } }
public void OnEnemyKilledMethod_AppropriatelyFiresEnemyKilledEvent() { _enemy.OnEnemyKilled(new EnemyKilledEventArgs(_fighter)); var logs = _logger.Logs; Assert.AreEqual(1, logs.Count); Assert.AreEqual(EventType.EnemyKilled, logs[0].Type); Assert.AreEqual(_enemy, logs[0].Sender); EnemyKilledEventArgs e = logs[0].E as EnemyKilledEventArgs; Assert.NotNull(e); Assert.AreEqual(_fighter, e.Enemy); }
/// <summary> /// When an enemy is killed, delete it and replace it with its corpse. /// This saves processing it for collisions etc. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnEnemyKilled(object sender, EnemyKilledEventArgs e) { Enemy enemy = e.enemy; killList.Add(enemy); Decal corpse = enemy.CorpseAppearance; corpse = corpse.Clone() as Decal;//New instance of the corpse decal corpse.Effect = enemy.DirectionalEffect; var offset = enemy.Appearance.Size - corpse.Size; corpse.SetPosition(enemy.Position + offset); corpses.Add(corpse); }
public override void Notify(DOLEvent e, object sender, EventArgs args) { GamePlayer player = sender as GamePlayer; if (player == null || player.IsDoingQuest(typeof(Collection)) == null) { return; } if (Step >= 2 && Step <= 4 && e == GameLivingEvent.EnemyKilled) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if (gArgs.Target.Name == generalNames[Step - 2]) { SendSystemMessage("You slay the creature and take it's wing."); GiveItem(gArgs.Target, player, askefruerWings); SendSystemMessage(player, generalNames[Step - 2] + " yells at you, \"A curse on you land-bound monster! I curse you for killing me!\""); Step++; return; } } if (Step >= 6 && Step <= 8 && e == GamePlayerEvent.GiveItem) { GiveItemEventArgs gArgs = (GiveItemEventArgs)args; if (gArgs.Target.Name == dalikor.Name && gArgs.Item.Id_nb == askefruerWings.Id_nb) { if (Step == 6) { dalikor.SayTo(player, "This is a truly magnificent wing. It's sad, really, that it belonged to such an evil creature. Ah well. Please Eeinken, hand me the other wings."); } else if (Step == 7) { dalikor.SayTo(player, "Good job recruit. Now please, hand me the last wing."); } else if (Step == 8) { dalikor.SayTo(player, "Yes, the final wing. It appears as though you have finished the task at hand. I do not condone the needless killing of other beings, but I feel as though these Fallen Askefruer leave us little choice. But for your efforts, I have a [reward] for you."); } RemoveItem(dalikor, player, askefruerWings); Step++; return; } } }
public override void Notify(DOLEvent e, object sender, EventArgs args) { GamePlayer player = sender as GamePlayer; if (player == null || player.IsDoingQuest(typeof(Collection)) == null) { return; } if (Step >= 2 && Step <= 4 && e == GameLivingEvent.EnemyKilled) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if (gArgs.Target.Name == generalNames[Step - 2]) { SendSystemMessage("You slay the creature and take it's wing."); GiveItem(gArgs.Target, player, fairyGeneralWings); SendSystemMessage(player, generalNames[Step - 2] + " yells at you, \"A curse on you land-bound monster! I curse you for killing me!\""); Step++; return; } } if (Step >= 6 && Step <= 8 && e == GamePlayerEvent.GiveItem) { GiveItemEventArgs gArgs = (GiveItemEventArgs)args; if (gArgs.Target.Name == masterFrederick.Name && gArgs.Item.Id_nb == fairyGeneralWings.Id_nb) { if (Step == 6) { masterFrederick.SayTo(player, "Excellent. Please, hand me the second one now."); } else if (Step == 7) { masterFrederick.SayTo(player, "Yes, now please, hand me the third one."); } else if (Step == 8) { masterFrederick.SayTo(player, "Ah, the third wing. Yes, excellent job Vinde. Now, for your [reward]"); } RemoveItem(masterFrederick, player, fairyGeneralWings); Step++; return; } } }
public override void Notify(DOLEvent e, object sender, EventArgs args) { GamePlayer player = sender as GamePlayer; if (player == null || player.IsDoingQuest(typeof(Rogue_50)) == null) { return; } if (Step == 1 && e == GameLivingEvent.EnemyKilled) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if (gArgs.Target.Name == Oona.Name) { m_questPlayer.Out.SendMessage("You collect Oona's Head", eChatType.CT_System, eChatLoc.CL_SystemWindow); GiveItem(m_questPlayer, oona_head); Step = 2; return; } } if (Step == 2 && e == GamePlayerEvent.GiveItem) { GiveItemEventArgs gArgs = (GiveItemEventArgs)args; if (gArgs.Target.Name == Masrim.Name && gArgs.Item.Id_nb == oona_head.Id_nb) { RemoveItem(Masrim, player, oona_head); Masrim.SayTo(player, "Take this sealed pouch to Morlin Caan in Jordheim for your reward!"); GiveItem(player, sealed_pouch); Step = 3; return; } } if (Step == 3 && e == GamePlayerEvent.GiveItem) { GiveItemEventArgs gArgs = (GiveItemEventArgs)args; if (gArgs.Target.Name == MorlinCaan.Name && gArgs.Item.Id_nb == sealed_pouch.Id_nb) { MorlinCaan.SayTo(player, "You have earned this Epic Armour!"); FinishQuest(); return; } } }
public void AttackMethod_AppropriatelyRaisesEvents_WhenEnemyDies() { _fighter = (TestHumanFighter)TestFighterFactory.GetFighter(TestFighterType.TestHuman, 1, "Ted"); _logger.SubscribeAll(_fighter); _fighter.SetStrength(_enemy.MaxHealth + 1); _fighter.Attack(_enemy); var logs = _logger.Logs; Assert.AreEqual(4, logs.Count); //first event, damage taken Assert.AreEqual(EventType.DamageTaken, logs[0].Type); Assert.AreEqual(_enemy, logs[0].Sender); PhysicalDamageTakenEventArgs e1 = logs[0].E as PhysicalDamageTakenEventArgs; Assert.NotNull(e1); Assert.AreEqual(_fighter.Strength, e1.Damage); //second event, killed - fired by enemy Assert.AreEqual(EventType.Killed, logs[1].Type); Assert.AreEqual(_enemy, logs[1].Sender); KilledEventArgs e2 = logs[1].E as KilledEventArgs; Assert.That(e2, Is.Not.Null); //third event, damageDealt to enemy Assert.AreEqual(EventType.AttackSuccessful, logs[2].Type); Assert.AreEqual(_fighter, logs[2].Sender); AttackSuccessfulEventArgs e3 = logs[2].E as AttackSuccessfulEventArgs; Assert.NotNull(e3); Assert.AreEqual(_enemy.MaxHealth, e3.DamageDealt); //fourth event, killed enemy Assert.AreEqual(EventType.EnemyKilled, logs[3].Type); Assert.AreEqual(_fighter, logs[3].Sender); EnemyKilledEventArgs e4 = logs[3].E as EnemyKilledEventArgs; Assert.NotNull(e4); Assert.AreEqual(_enemy, e4.Enemy); }
public override void Notify(DOLEvent e, object sender, EventArgs args) { base.Notify(e, sender, args); GamePlayer player = sender as GamePlayer; if (player == null) { return; } AbstractQuest quest = player.IsDoingQuest(typeof(BonesToBlades)); if (quest == null) { return; } if (Step > 0 && e == GameLivingEvent.EnemyKilled) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; for (int i = 0; i < mobTypes.Length; i++) { if (gArgs.Target.Name.IndexOf(mobTypes[i]) >= 0) { InventoryItemRequirement requirement = new InventoryItemRequirement(null, armBone, 2, eComparator.Less); if (requirement.Check(e, player, args)) { GiveItemAction action = new GiveItemAction(null, armBone, null); action.Perform(e, sender, args); } if (!requirement.Check(e, player, args)) { if (quest.Step == 1) { quest.Step = 2; } } return; } } } }
public override void Notify(DOLEvent e, object sender, EventArgs args) { GamePlayer player = sender as GamePlayer; if (player == null || player.IsDoingQuest(typeof(Seer_50)) == null) { return; } if (Step == 1 && e == GameLivingEvent.EnemyKilled) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if (gArgs.Target.Name == Loken.Name) { m_questPlayer.Out.SendMessage("You get a ball of flame", eChatType.CT_System, eChatLoc.CL_SystemWindow); GiveItem(m_questPlayer, ball_of_flame); Step = 2; return; } } if (Step == 2 && e == GamePlayerEvent.GiveItem) { GiveItemEventArgs gArgs = (GiveItemEventArgs)args; if (gArgs.Target.Name == Inaksha.Name && gArgs.Item.Id_nb == ball_of_flame.Id_nb) { RemoveItem(Inaksha, player, ball_of_flame); Inaksha.SayTo(player, "So it seems Logan's [dead]"); Step = 3; return; } } if (Step == 4 && e == GamePlayerEvent.GiveItem) { GiveItemEventArgs gArgs = (GiveItemEventArgs)args; if (gArgs.Target.Name == Miri.Name && gArgs.Item.Id_nb == sealed_pouch.Id_nb) { Miri.SayTo(player, "You have earned this Epic Armour!"); FinishQuest(); return; } } }
public override void Notify(DOLEvent e, object sender, EventArgs args) { GamePlayer player = sender as GamePlayer; if (player == null) { return; } if (player.IsDoingQuest(typeof(MarlinsSalesPitch)) == null) { return; } if (Step == 1 && e == GameLivingEvent.EnemyKilled) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if ((gArgs.Target.Name.IndexOf("Tomb Raider Digger") >= 0) || (gArgs.Target.Name.IndexOf("Tomb Raider Scout") >= 0) || (gArgs.Target.Name.IndexOf("tomb raider digger") >= 0) || (gArgs.Target.Name.IndexOf("tomb raider scout") >= 0)) { if (Util.Chance(20)) { SendSystemMessage("The tomb raider staggers away before falling over, lifeless."); player.Out.SendDialogBox(eDialogCode.SimpleWarning, 0x00, 0x00, 0x00, 0x00, eDialogType.Ok, true, "The tomb raider scout drops a beautifully crafted drum as he falls to the ground. Your journal has been updated."); GiveItem(player, drum); Step = 2; } return; } } else if (Step == 2 && e == GamePlayerEvent.GiveItem) { GiveItemEventArgs gArgs = (GiveItemEventArgs)args; if (gArgs.Target.Name == marlinThuler.Name && gArgs.Item.Id_nb == drum.Id_nb) { RemoveItem(marlinThuler, player, drum); marlinThuler.SayTo(player, "Hallelujah! You found my drum, thank you! I will never be able to fully repay you, but perhaps these coins will at least start to show my appreciation for your service."); FinishQuest(); return; } } }
/// <summary> /// Checks the trigger, this method is called whenever a event associated with this questparts quest /// or a manualy associated eventhandler is notified. /// </summary> /// <param name="e"></param> /// <param name="sender"></param> /// <param name="args"></param> /// <returns></returns> public override bool Check(DOLEvent e, object sender, EventArgs args) { bool result = false; GamePlayer player = BehaviourUtils.GuessGamePlayerFromNotify(e, sender, args); if (e == GameLivingEvent.EnemyKilled && sender == player) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if (K != null) { result = gArgs.Target.Name == K; } else { result = gArgs.Target == I; } } return(result); }
public override void Notify(DOLEvent e, object sender, EventArgs args) { GamePlayer player = sender as GamePlayer; if (player == null || player.IsDoingQuest(typeof(ShakenSquire)) == null) { return; } if (e == GameLivingEvent.EnemyKilled) { if (Step == 2) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if (gArgs.Target.Name == "small spider" && gArgs.Target.CurrentRegionID == smallSpider.CurrentRegionID && gArgs.Target.X == smallSpider.X && gArgs.Target.Y == smallSpider.Y) { Step = 3; return; } } } }
/// <summary> /// Handles quest events. /// </summary> /// <param name="e"></param> /// <param name="sender"></param> /// <param name="args"></param> public override void Notify(DOLEvent e, object sender, EventArgs args) { base.Notify(e, sender, args); GamePlayer player = sender as GamePlayer; if (player == null) { return; } if (player.IsDoingQuest(typeof(CemmethsOrders)) == null) { return; } if (Step == 1 && e == GameLivingEvent.EnemyKilled) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if (gArgs.Target.Name.IndexOf(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Alb.CemmethsOrders.Notify.Text1")) >= 0) { if (!SkeletonsKilled.IsAchieved) { SkeletonsKilled.Advance(); return; } } if (gArgs.Target.Name.IndexOf(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Alb.CemmethsOrders.Notify.Text2")) >= 0) { if (!DecayingGhoulsKilled.IsAchieved) { DecayingGhoulsKilled.Advance(); return; } } } }
public override void Notify(DOLEvent e, object sender, EventArgs args) { GamePlayer player = sender as GamePlayer; if (player == null || player.IsDoingQuest(typeof(Church_50)) == null) { return; } if (Step == 1 && e == GameLivingEvent.EnemyKilled) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if (gArgs != null && gArgs.Target != null && Blythe != null) { if (gArgs.Target.Name == Blythe.Name) { QuestPlayer.Out.SendMessage("As you search the dead body of sister Blythe, you find a sacred " + statue_of_arawn.Name + ", bring it to " + Roben.Name + " has proof of your success.", eChatType.CT_System, eChatLoc.CL_SystemWindow); GiveItem(QuestPlayer, statue_of_arawn); Step = 2; return; } } } if (Step == 2 && e == GamePlayerEvent.GiveItem) { GiveItemEventArgs gArgs = (GiveItemEventArgs)args; if (gArgs.Target.Name == Roben.Name && gArgs.Item.Id_nb == statue_of_arawn.Id_nb) { Roben.SayTo(player, "You have earned this Epic Armor, wear it with honor!"); FinishQuest(); return; } } }
public override void Notify(DOLEvent e, object sender, EventArgs args) { GamePlayer player = sender as GamePlayer; if (player == null) { return; } if (player.IsDoingQuest(typeof(ArgussArrows)) == null) { return; } if (Step == 1 && e == GameLivingEvent.EnemyKilled) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if (gArgs.Target.Name.IndexOf("young cutpurse") >= 0) { if (Util.Chance(50)) { player.Out.SendDialogBox(eDialogCode.SimpleWarning, 0x00, 0x00, 0x00, 0x00, eDialogType.Ok, true, "You receive a Bunch of Ludlow Magical Wood from the young cutpurse! \nYour journal has been updated."); GiveItem(player, magicalWood); Step = 2; } return; } } else if (Step == 2 && e == GameLivingEvent.EnemyKilled) { EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args; if (gArgs.Target.Name.IndexOf("young cutpurse") >= 0) { if (Util.Chance(50)) { player.Out.SendDialogBox(eDialogCode.SimpleWarning, 0x00, 0x00, 0x00, 0x00, eDialogType.Ok, true, "You receive a Bunch of Ludlow Magical Wood from the young cutpurse! \nYour journal has been updated."); GiveItem(player, magicalWood); Step = 3; } return; } } else if (Step == 3 && e == GamePlayerEvent.GiveItem) { GiveItemEventArgs gArgs = (GiveItemEventArgs)args; if (gArgs.Target.Name == argusBowman.Name && gArgs.Item.Id_nb == magicalWood.Id_nb) { RemoveItem(argusBowman, player, magicalWood); argusBowman.SayTo(player, "Excellent! Did you get anymore wood?"); Step = 4; return; } } else if (Step == 4 && e == GamePlayerEvent.GiveItem) { GiveItemEventArgs gArgs = (GiveItemEventArgs)args; if (gArgs.Target.Name == argusBowman.Name && gArgs.Item.Id_nb == magicalWood.Id_nb) { RemoveItem(argusBowman, player, magicalWood); argusBowman.SayTo(player, "Excellent! This will do nicely. Now wait, I have a [reward] for you somewhere around here."); Step = 5; return; } } }