public override void Execute(Map.World world) { Logger.Debug(" Death Of King Event "); //Берём участников сцены var LeoricGhost = world.GetActorBySNO(5365); var GhostKnights = world.GetActorsBySNO(4182); var LachdananGhost = world.GetActorBySNO(4183); var SwordPlace = world.GetActorBySNO(163449); //Вычесляем взгляд для участников float LeoricFacingAngle = Actors.Movement.MovementHelpers.GetFacingAngle(LeoricGhost, LachdananGhost); float LachdananFacingAngle = Actors.Movement.MovementHelpers.GetFacingAngle(LachdananGhost, LeoricGhost); LeoricGhost.SetFacingRotation(LeoricFacingAngle); LachdananGhost.SetFacingRotation(LachdananFacingAngle); //4 секунды до убийства //Убийство + запуск нового диалога foreach (var GKnight in GhostKnights) { float KnightFacing = Actors.Movement.MovementHelpers.GetFacingAngle(GKnight, world.GetActorBySNO(220219)); GKnight.SetFacingRotation(KnightFacing); } LachdananGhost.Move(SwordPlace.Position, LachdananFacingAngle); TickTimer Timeout = new SecondsTickTimer(world.Game, 4f); var ListenerKingSkeletons = System.Threading.Tasks.Task <bool> .Factory.StartNew(() => WaitToSpawn(Timeout)); ListenerKingSkeletons.ContinueWith(delegate { StartConversation(world, 139825); }); }
}; // Используем для отслеживания убийства public override void Execute(Map.World world) { var boss = world.GetActorBySNO(CapitanDaltynAID); var minions = world.GetActorsBySNO(RiseZombieAID); if (boss == null) { Logger.Debug("Не найдено: Капитан Далтин - {0}", CapitanDaltynAID); Vector3D CapitanDaltyn = new Vector3D(51.12595f, 100.2664f, 0.1000305f); Vector3D[] Zombie = new Vector3D[4]; Zombie[0] = new Vector3D(50.00065f, 125.4087f, 0.1000305f); Zombie[1] = new Vector3D(54.88688f, 62.24541f, 0.1000305f); Zombie[2] = new Vector3D(86.45869f, 77.09571f, 0.1000305f); Zombie[3] = new Vector3D(102.117f, 97.59058f, 0.1000305f); world.SpawnMonster(CapitanDaltynAID, CapitanDaltyn); foreach (Vector3D point in Zombie) { world.SpawnMonster(RiseZombieAID, point); } boss = world.GetActorBySNO(CapitanDaltynAID); CapitanDaltynKiller.Add(boss.DynamicID); minions = world.GetActorsBySNO(RiseZombieAID); foreach (var minion in minions) { CapitanDaltynKiller.Add(minion.DynamicID); } } else { CapitanDaltynKiller.Add(boss.DynamicID); } // Пытаемся привязать статус босса! boss = world.GetActorBySNO(CapitanDaltynAID); boss.Attributes[Net.GS.Message.GameAttribute.Using_Bossbar] = true; boss.Attributes[Net.GS.Message.GameAttribute.InBossEncounter] = true; // DOES NOT WORK it should be champion affixes or shit of this kind ... // Увеличиваем здоровье босса! boss.Attributes[GameAttribute.Hitpoints_Max] = 200f; boss.Attributes[GameAttribute.Hitpoints_Cur] = 200f; boss.Attributes[GameAttribute.Movement_Scalar_Reduction_Percent] -= 10f; boss.Attributes[GameAttribute.Quest_Monster] = true; //Запуск отслеживания убийства var ListenerDaltyn = Task <bool> .Factory.StartNew(() => OnKillListener(CapitanDaltynKiller, world)); //Ждём пока убьют ListenerDaltyn.ContinueWith(delegate { world.Game.Quests.Advance(72095); }); }
public override void Execute(Map.World world) { if (HadConversation) { HadConversation = false; world.Game.Quests.Advance(72095); Logger.Debug(" Quests.Advance(72095) "); Logger.Debug(" Dialog with Cain "); } var CainBrains = world.GetActorBySNO(102386); Vector3D CainPath = new Vector3D(76.99389f, 155.145f, 0.0997252f); var facingAngle = Actors.Movement.MovementHelpers.GetFacingAngle(CainBrains, CainPath); CainBrains.Move(CainPath, facingAngle); //BookShelf - 5723 var BookShelf = world.GetActorBySNO(5723); world.BroadcastIfRevealed(new PlayAnimationMessage { ActorID = BookShelf.DynamicID, Field1 = 5, Field2 = 0, tAnim = new Net.GS.Message.Fields.PlayAnimationMessageSpec[] { new Net.GS.Message.Fields.PlayAnimationMessageSpec() { Duration = 100, AnimationSNO = BookShelf.AnimationSet.TagMapAnimDefault[AnimationSetKeys.Opening], PermutationIndex = 0, Speed = 1 } } }, BookShelf); world.BroadcastIfRevealed(new SetIdleAnimationMessage { ActorID = BookShelf.DynamicID, AnimationSNO = AnimationSetKeys.Open.ID }, BookShelf); foreach (var player in world.Players) { var dbQuestProgress = DBSessions.AccountSession.Get <DBProgressToon>(player.Value.Toon.PersistentID); dbQuestProgress.ActiveQuest = 72095; dbQuestProgress.StepOfQuest = 14; DBSessions.AccountSession.SaveOrUpdate(dbQuestProgress); DBSessions.AccountSession.Flush(); Logger.Debug(" Progress Saved "); } ; }
public override void Execute(Map.World world) { #region Открываем ворота var Gate = world.GetActorBySNO(108466); var NoGate = new Door(world, 108466, world.GetActorBySNO(108466).Tags); NoGate.Field2 = 16; NoGate.RotationAxis = world.GetActorBySNO(108466).RotationAxis; NoGate.RotationW = world.GetActorBySNO(108466).RotationW; NoGate.Attributes[GameAttribute.Gizmo_Has_Been_Operated] = true; NoGate.Attributes[GameAttribute.Gizmo_State] = 1; NoGate.Attributes[GameAttribute.Untargetable] = true; NoGate.Attributes.BroadcastChangedIfRevealed(); NoGate.EnterWorld(world.GetActorBySNO(108466).Position); Gate.Destroy(); #endregion world.BroadcastIfRevealed(new PlayAnimationMessage { ActorID = NoGate.DynamicID, Field1 = 5, Field2 = 0, tAnim = new Net.GS.Message.Fields.PlayAnimationMessageSpec[] { new Net.GS.Message.Fields.PlayAnimationMessageSpec() { Duration = 50, AnimationSNO = NoGate.AnimationSet.TagMapAnimDefault[Core.GS.Common.Types.TagMap.AnimationSetKeys.Opening], PermutationIndex = 0, Speed = 1 } } }, NoGate); world.BroadcastIfRevealed(new SetIdleAnimationMessage { ActorID = NoGate.DynamicID, AnimationSNO = Core.GS.Common.Types.TagMap.AnimationSetKeys.Open.ID }, NoGate); foreach (var plr in world.Players.Values) { if (plr.PlayerIndex == 0) { plr.ActiveHireling.Brain.Activate(); } } world.Game.Quests.NotifyQuest(72095, QuestStepObjectiveType.EventReceived, -1); }
public override void Execute(Map.World world) { Logger.Debug(" Conversation done "); // starting second conv var wrongNPC = world.GetActorBySNO(180900); world.SpawnMonster(117365, wrongNPC.Position); var RightNPC = world.GetActorBySNO(117365); world.Leave(wrongNPC); // Idle - 141437 // 141674-141541-141795-141675 world.BroadcastIfRevealed(new Mooege.Net.GS.Message.Definitions.Animation.PlayAnimationMessage { ActorID = RightNPC.DynamicID, Field1 = 5, Field2 = 0, tAnim = new Net.GS.Message.Fields.PlayAnimationMessageSpec[] { new Net.GS.Message.Fields.PlayAnimationMessageSpec() { Duration = 100, AnimationSNO = 141674, PermutationIndex = 0, Speed = 1f } } }, RightNPC); world.BroadcastIfRevealed(new Mooege.Net.GS.Message.Definitions.Animation.PlayAnimationMessage { ActorID = RightNPC.DynamicID, Field1 = 5, Field2 = 0, tAnim = new Net.GS.Message.Fields.PlayAnimationMessageSpec[] { new Net.GS.Message.Fields.PlayAnimationMessageSpec() { Duration = 150, AnimationSNO = 141541, PermutationIndex = 0, Speed = 1f } } }, RightNPC); StartConversation(world, 181912); }
public override void Execute(Map.World world) { Logger.Debug(" Разговор с Леей закончен "); if (HadConversation) { world.Game.Quests.NotifyQuest(72095, QuestStepObjectiveType.PossessItem, -1); } //world.Game.Quests.Advance(72095); foreach (var player in world.Players) { var dbQuestProgress = DBSessions.AccountSession.Get <DBProgressToon>(player.Value.Toon.PersistentID); dbQuestProgress.ActiveQuest = 72095; dbQuestProgress.StepOfQuest = 9; DBSessions.AccountSession.SaveOrUpdate(dbQuestProgress); DBSessions.AccountSession.Flush(); } ; var Leah_Cellar = world.GetActorBySNO(203030); (Leah_Cellar as Actors.InteractiveNPC).Conversations.Clear(); Leah_Cellar.Attributes[Net.GS.Message.GameAttribute.Conversation_Icon, 0] = 0; Leah_Cellar.Position = new Vector3D(149.8516f, 60.33301f, 9000f); Leah_Cellar.Attributes.BroadcastChangedIfRevealed(); }
public override void Execute(Map.World world) { if (HadConversation) { HadConversation = false; var CainBrains = world.GetActorsBySNO(102386); Vector3D CainPath = new Vector3D(76.99389f, 155.145f, 0.0997252f); var FindDynamicCain = world.GetActorByDynamicId(2297); foreach (var AnyCain in CainBrains) { var facingAngle = Actors.Movement.MovementHelpers.GetFacingAngle(AnyCain, CainPath); AnyCain.Move(CainPath, facingAngle); } world.Game.Quests.Advance(72095); Logger.Debug(" Quests.Advance(72095) "); Logger.Debug(" Dialog with Cain "); } foreach (var player in world.Players.Values) { player.Toon.ActiveQuest = 72095; player.Toon.StepOfQuest = 14; player.Toon.StepIDofQuest = 19; player.Toon.WayPointStatus = 7; Logger.Debug(" Progress Saved "); player.UpdateHeroState(); } ; var BookShelf = world.GetActorBySNO(5723); world.BroadcastIfRevealed(new PlayAnimationMessage { ActorID = BookShelf.DynamicID, Field1 = 5, Field2 = 0, tAnim = new Net.GS.Message.Fields.PlayAnimationMessageSpec[] { new Net.GS.Message.Fields.PlayAnimationMessageSpec() { Duration = 100, AnimationSNO = BookShelf.AnimationSet.TagMapAnimDefault[AnimationSetKeys.Opening], PermutationIndex = 0, Speed = 1 } } }, BookShelf); world.BroadcastIfRevealed(new SetIdleAnimationMessage { ActorID = BookShelf.DynamicID, AnimationSNO = AnimationSetKeys.Open.ID }, BookShelf); //*/ }
public override void Execute(Map.World world) { if (HadConversation) { HadConversation = false; world.Game.Quests.Advance(72095); world.Game.Quests.Notify(QuestStepObjectiveType.CompleteQuest, 72095); } foreach (var player in world.Players) { var dbQuestProgress = DBSessions.AccountSession.Get <DBProgressToon>(player.Value.Toon.PersistentID); dbQuestProgress.LastQuest = 72095; dbQuestProgress.ActiveQuest = 72221; dbQuestProgress.StepOfQuest = 1; DBSessions.AccountSession.SaveOrUpdate(dbQuestProgress); DBSessions.AccountSession.Flush(); player.Value.InGameClient.SendMessage(new Mooege.Net.GS.Message.Definitions.Quest.QuestMeterMessage() { snoQuest = 72095, Field1 = 2, Field2 = 10.0f }); } ; Logger.Debug(" Второй квест окончен. "); // starting third quest world.Game.Quests.Advance(72221); var BlacksmithVendor = world.GetActorBySNO(56947); Vector3D position = new Vector3D(BlacksmithVendor.Position); //world.SpawnMonster(65036, position);// NonVendor - 65036 var BlacksmithQuest = world.GetActorBySNO(65036); BlacksmithQuest.RotationAxis = BlacksmithVendor.RotationAxis; BlacksmithQuest.RotationW = BlacksmithVendor.RotationW; world.Leave(BlacksmithVendor); var TELEGAS = world.GetActorsBySNO(112131); Vector3D LastTelega = new Vector3D(); foreach (var TELEGA in TELEGAS) { TELEGA.Destroy(); LastTelega = TELEGA.Position; } }
public static bool setActorOperable(Map.World world, System.Int32 snoId, bool status) { var actor = world.GetActorBySNO(snoId); foreach (var player in world.Players) { actor.Attributes[Net.GS.Message.GameAttribute.Gizmo_Has_Been_Operated] = status; } return(true); }
public static bool setActorOperable(Map.World world, Int32 snoId, bool status) { var actor = world.GetActorBySNO(snoId); foreach (var player in world.Players) { actor.Attributes[Net.GS.Message.GameAttribute.NPC_Is_Operatable] = status; } return(true); }
public override void Execute(Map.World world) { if (HadConversation) { HadConversation = false; Logger.Debug(" Quests.Advance(72221) "); world.Game.Quests.Advance(72221); } foreach (var player in world.Players.Values) { player.Toon.MaximumQuest = 72061; player.Toon.ActiveQuest = 72061; player.Toon.StepOfQuest = 0; Logger.Debug(" Progress Saved "); } ; Logger.Debug(" Третий квест окончен. "); Logger.Debug("ПОЛУЧЕНИЕ НАГРАДЫ!"); foreach (var player in world.Game.Players.Values) { D3.Quests.QuestReward.Builder Reward = new D3.Quests.QuestReward.Builder(); Reward.SnoQuest = 72221; Reward.GoldGranted = 195; Reward.XpGranted = 900; player.Toon.StoneOfPortal = true; player.EnableStoneOfRecall(); D3.Quests.QuestStepComplete.Builder StepCompleted = new D3.Quests.QuestStepComplete.Builder(); StepCompleted.Reward = Reward.Build(); StepCompleted.SetIsQuestComplete(true); player.InGameClient.SendMessage(new Net.GS.Message.Definitions.Quest.QuestStepCompleteMessage() { QuestStepComplete = StepCompleted.Build() }); player.Inventory.AddGoldAmount(Reward.GoldGranted); player.UpdateExp(Reward.XpGranted); } bool questConversation = true; var Cain = world.GetActorBySNO(3533); Cain.Attributes[Net.GS.Message.GameAttribute.MinimapActive] = true; (Cain as Actors.InteractiveNPC).Conversations.Clear(); (Cain as Actors.InteractiveNPC).Conversations.Add(new Actors.Interactions.ConversationInteraction(80681)); Cain.Attributes[Net.GS.Message.GameAttribute.Conversation_Icon, 0] = questConversation ? 1 : 0; Cain.Attributes.BroadcastChangedIfRevealed(); }
public override void Execute(Map.World world) { Logger.Debug(" Conversation done "); if (HadConversation) { world.Game.Quests.Advance(72061); world.Game.Quests.Advance(72061); HadConversation = false; } var RightNPC = world.GetActorBySNO(117365); // Idle - 141437 // 141674-141541-141795-141675 world.BroadcastIfRevealed(new Mooege.Net.GS.Message.Definitions.Animation.PlayAnimationMessage { ActorID = RightNPC.DynamicID, Field1 = 5, Field2 = 0, tAnim = new Net.GS.Message.Fields.PlayAnimationMessageSpec[] { new Net.GS.Message.Fields.PlayAnimationMessageSpec() { Duration = 160, AnimationSNO = 141795, PermutationIndex = 0, Speed = 1f } } }, RightNPC); world.BroadcastIfRevealed(new Mooege.Net.GS.Message.Definitions.Animation.SetIdleAnimationMessage { ActorID = RightNPC.DynamicID, AnimationSNO = 141675, }, RightNPC); foreach (var player in world.Players) { var dbQuestProgress = DBSessions.AccountSession.Get <DBProgressToon>(player.Value.Toon.PersistentID); dbQuestProgress.ActiveQuest = 72061; dbQuestProgress.StepOfQuest = 18; DBSessions.AccountSession.SaveOrUpdate(dbQuestProgress); DBSessions.AccountSession.Flush(); } ; //117371 - Разговор с Каином и Тираэлем //117779 - Пытый квест. }
public override void Execute(Map.World world) { Logger.Debug(" Death Of King Event Path 2"); //Берём участников сцены var LeoricGhost = world.GetActorBySNO(5365); var GhostKnights = world.GetActorsBySNO(4182); var LachdananGhost = world.GetActorBySNO(4183); var SwordPlace = world.GetActorBySNO(163449); TickTimer Timeout = new SecondsTickTimer(world.Game, 23f); var ListenerKingSkeletons = System.Threading.Tasks.Task <bool> .Factory.StartNew(() => WaitToSpawn(Timeout)); ListenerKingSkeletons.ContinueWith(delegate { LeoricGhost.Destroy(); LachdananGhost.Destroy(); foreach (var GK in GhostKnights) { GK.Destroy(); } }); }
public override void Execute(Map.World world) { if (HadConversation) { HadConversation = false; Logger.Debug(" Quests.Advance(72221) "); } foreach (var player in world.Players.Values) { player.Toon.ActiveQuest = 72221; player.Toon.StepOfQuest = 2; Logger.Debug(" Progress Saved "); } ; var TELEGAS = world.GetActorsBySNO(112131); Vector3D LastTelega = new Vector3D(); foreach (var TELEGA in TELEGAS) { TELEGA.Destroy(); LastTelega = TELEGA.Position; } world.Game.Quests.NotifyQuest(72221, QuestStepObjectiveType.HadConversation, 198292); var BlacksmithQuest = world.GetActorBySNO(65036); (BlacksmithQuest as Core.GS.Actors.InteractiveNPC).Conversations.Clear(); (BlacksmithQuest as Core.GS.Actors.InteractiveNPC).Attributes[Net.GS.Message.GameAttribute.Conversation_Icon, 0] = 0; (BlacksmithQuest as Core.GS.Actors.InteractiveNPC).Attributes.BroadcastChangedIfRevealed(); BlacksmithQuest.WalkSpeed = 0.33f; BlacksmithQuest.RunSpeed = 0.33f; Vector3D FirstPoint = new Vector3D(2905.856f, 2584.807f, 0.5997877f); Vector3D SecondPoint = new Vector3D(2790.396f, 2611.313f, 0.5997864f); var FirstfacingAngle = Actors.Movement.MovementHelpers.GetFacingAngle(BlacksmithQuest, FirstPoint); var SecondfacingAngle = Actors.Movement.MovementHelpers.GetFacingAngle(BlacksmithQuest, SecondPoint); BlacksmithQuest.Move(FirstPoint, FirstfacingAngle); Ticker.TickTimer Timeout = new Ticker.SecondsTickTimer(world.Game, 3f); var ListenerKingSkeletons = System.Threading.Tasks.Task <bool> .Factory.StartNew(() => WaitToSpawn(Timeout)); ListenerKingSkeletons.ContinueWith(delegate { BlacksmithQuest.Move(SecondPoint, SecondfacingAngle); }); }
private bool HoudiniVsZombies(Map.World world, Int32 snoId) { var actorSourcePosition = world.GetActorBySNO(snoId); var around = actorSourcePosition.GetActorsInRange(10f); foreach (var player in world.Players) { foreach (var actors in around) { ActorsVector3D.Add(new Vector3D(actors.Position.X, actors.Position.Y, actors.Position.Z)); actors.Destroy(); } } return(true); }
public override void Execute(Map.World world) { if (HadConversation) { HadConversation = false; } foreach (var player in world.Players.Values) { player.Toon.ActiveQuest = 72221; player.Toon.StepOfQuest = 1; player.Toon.StepIDofQuest = -1; } var BlacksmithQuest = world.GetActorBySNO(65036); (BlacksmithQuest as Core.GS.Actors.InteractiveNPC).Conversations.Clear(); (BlacksmithQuest as Actors.InteractiveNPC).Conversations.Add(new Actors.Interactions.ConversationInteraction(198292)); }
private bool HoudiniVsZombies(Map.World world, Int32 snoId) { var actorSourcePosition = world.GetActorBySNO(snoId); var around = actorSourcePosition.GetActorsInRange(10f); foreach (var actors in around) { try { ActorsVector3D.Add(new Vector3D(actors.Position.X, actors.Position.Y, actors.Position.Z)); actors.Destroy(); } catch { Logger.Debug("ѕропущено удаление акторов дл¤ персонажа"); } } return(true); }
public override void Execute(Map.World world) { if (HadConversation) { HadConversation = false; Logger.Debug(" Quests.Advance(72221) "); //198312 - had Conv //156381 - Chancellor Eamon } foreach (var player in world.Players) { var dbQuestProgress = DBSessions.AccountSession.Get <DBProgressToon>(player.Value.Toon.PersistentID); dbQuestProgress.ActiveQuest = 72221; dbQuestProgress.StepOfQuest = 2; DBSessions.AccountSession.SaveOrUpdate(dbQuestProgress); DBSessions.AccountSession.Flush(); Logger.Debug(" Progress Saved "); } ; // Нахер тележку!) //3026,339 2779,678 24,04532 // 112131 - Телега var TELEGAS = world.GetActorsBySNO(112131); Vector3D LastTelega = new Vector3D(); foreach (var TELEGA in TELEGAS) { TELEGA.Destroy(); LastTelega = TELEGA.Position; } var BlacksmithQuest = world.GetActorBySNO(65036); Vector3D FirstPoint = new Vector3D(3026.339f, 2779.678f, 24.0453f); var FirstfacingAngle = Actors.Movement.MovementHelpers.GetFacingAngle(BlacksmithQuest, FirstPoint); //BlacksmithQuest.Move(FirstPoint,FirstfacingAngle); //world.SpawnMonster(112131, LastTelega); StartConversation(world, 198307); }
}; //We use this for the killeventlistener. public override void Execute(Map.World world) { //The spawning positions for each monster in its wave. Basically, you add here the "number" of mobs, accoring to each vector LaunchWave() will spawn every mob in its position. //Vector3D[] WretchedMotherSpawn = { new Vector3D(2766.513f, 2913.982f, 24.04533f) }; //Somehow shes already spawned when the Inn event finishes.. so we search for the ID and add it to the kill event listener. var actor = world.GetActorBySNO(219725); monstersAlive.Add(actor.DynamicID); //Run Kill Event Listener var ListenerFirstWaveTask = Task <bool> .Factory.StartNew(() => OnKillListener(monstersAlive, world)); //Wait for wtretchedmother to be killed. ListenerFirstWaveTask.ContinueWith(delegate //Once killed: { world.Game.Quests.Advance(87700); Logger.Debug("Event finished"); StartConversation(world, 156223); }); }
public override void Execute(Map.World world) { if (HadConversation) { HadConversation = false; world.Game.Quests.NotifyQuest(72221, QuestStepObjectiveType.EventReceived, -1); Logger.Debug(" Quests.NotifyQuest(72221) "); } foreach (var player in world.Players.Values) { player.Toon.ActiveQuest = 72221; player.Toon.StepIDofQuest = 35; player.Toon.StepOfQuest = 5; Logger.Debug(" Progress Saved "); } ; var BlacksmithQuest = world.GetActorBySNO(65036); (BlacksmithQuest as Core.GS.Actors.InteractiveNPC).Conversations.Clear(); (BlacksmithQuest as Core.GS.Actors.InteractiveNPC).Attributes[Net.GS.Message.GameAttribute.Conversation_Icon, 0] = 0; (BlacksmithQuest as Core.GS.Actors.InteractiveNPC).Attributes.BroadcastChangedIfRevealed(); }
}; //We use this for the killeventlistener. public override void Execute(Map.World world) { //The spawning positions for each monster in its wave. Basically, you add here the "number" of mobs, accoring to each vector LaunchWave() will spawn every mob in its position. //Vector3D[] WretchedMotherSpawn = { new Vector3D(2766.513f, 2913.982f, 24.04533f) }; //Somehow shes already spawned when the Inn event finishes.. so we search for the ID and add it to the kill event listener. var actor = world.GetActorBySNO(wretchedMotherAID); if (actor == null) { Logger.Debug("Could not find the Wretched Mother ACTOR ID {0}", wretchedMotherAID); Vector3D FirstMother = new Vector3D(2766.513f, 2913.982f, 24.04533f); world.SpawnMonster(wretchedMotherAID, FirstMother); actor = world.GetActorBySNO(wretchedMotherAID); monstersAlive1.Add(actor.DynamicID); } else { monstersAlive1.Add(actor.DynamicID); } //Убираем телегу var FactorToShoot = world.GetActorBySNO(81699); try { world.Leave(FactorToShoot); } catch { } //FactorToShoot.Destroy(); //Запуск отслеживания убийства var ListenerWretchedMother = Task <bool> .Factory.StartNew(() => OnKillListener(monstersAlive1, world)); //Ждём пока убьют ListenerWretchedMother.ContinueWith(delegate { // WMQ + 3 WM (group) // portal + rumford (group) // WMQ + 3 WM (group) // force next quest step world.Game.Quests.Advance(87700); Logger.Debug("Event finished"); // launch dialog StartConversation(world, 156223); // position of the wretched mother Vector3D[] WretchedMotherPosSpawn = new Vector3D[3]; // too hard 3 elems.. WretchedMotherPosSpawn[0] = new Vector3D(2427.788f, 2852.193f, 27.1f); WretchedMotherPosSpawn[1] = new Vector3D(2356.931f, 2528.715f, 27.1f); WretchedMotherPosSpawn[2] = new Vector3D(2119.563f, 2489.693f, 27.1f); // spawn 3 wretched mother Logger.Debug(" spawn 1 Wretched Mother "); world.SpawnMonster(wretchedMotherAID, WretchedMotherPosSpawn[0]); Logger.Debug(" spawn 1 Wretched Mother "); world.SpawnMonster(wretchedMotherAID, WretchedMotherPosSpawn[1]); Logger.Debug(" spawn 1 Wretched Mother "); world.SpawnMonster(wretchedMotherAID, WretchedMotherPosSpawn[2]); // ugly hack to get all actors with the same snoID..no idea if it is lmegit or if game will crash and summon diablo on my pc... var actorsWM = world.GetActorsBySNO(wretchedMotherAID); // this is the List of wretched mother ACTOR ID var actorWQM = world.GetActorBySNO(wretchedMotherQueenAID); // this is the wretched queen mother ACTOR ID Logger.Debug(" world contains {0} WM ", actorsWM.Count); if (actorsWM.Count > 0) { monstersAliveBonus.Add(actorsWM.ElementAt(0).DynamicID); monstersAliveBonus.Add(actorsWM.ElementAt(0).DynamicID); monstersAliveBonus.Add(actorsWM.ElementAt(0).DynamicID); // run killbonus event listener var ListenerWQTask = Task <bool> .Factory.StartNew(() => OnKillBonusListener(monstersAliveBonus, world, bonusTaskID)); //Wait for wretched queen mother to be killed. ListenerWQTask.ContinueWith(delegate //Once killed: { Logger.Debug("Bonus Event Completed "); }); } else { Logger.Debug("Could not get/spawn the Wretched Mother ACTOR ID {0}", wretchedMotherAID); } if (actorWQM != null) { // Пытаемся привязать статус босса! actorWQM.Attributes[Net.GS.Message.GameAttribute.Using_Bossbar] = true; actorWQM.Attributes[Net.GS.Message.GameAttribute.InBossEncounter] = true; //actorWQM.Attributes[Net.GS.Message.GameAttribute.Si] // DOES NOT WORK it should be champion affixes or shit of this kind ... // Увеличиваем здоровье босса! //actorWQM.Q actorWQM.Attributes[GameAttribute.Hitpoints_Max] = 150f; actorWQM.Attributes[GameAttribute.Hitpoints_Cur] = 150f; //Запуск отслеживания убийства королевы var ListenerWQMTask = Task <bool> .Factory.StartNew(() => OnWMQKillListener(actorWQM.DynamicID, world)); //Wait for wretched queen mother to be killed. ListenerWQMTask.ContinueWith(delegate //Once killed: { Logger.Debug(" Wretch Queen Event done !!"); // WretchedQueenIsDead // portal shit var portalActorId = world.GetActorBySNO(portalAID); var ListenerUsePortalTask = Task <bool> .Factory.StartNew(() => OnUseTeleporterListener(portalActorId.DynamicID, world)); //Wait for portal to be used . ListenerUsePortalTask.ContinueWith(delegate //Once killed: { Logger.Debug(" Waypoint_OldTristram Objective done "); // Waypoint_OldTristram }); //conversation with rumford... delegated to another class... since we have a nice conversation system :p }); } else { Logger.Debug("Could not find the Wretched Mother QUEEN ACTOR ID {0}", wretchedMotherQueenAID); } }); }
public override void Execute(Map.World world) { if (HadConversation) { HadConversation = false; Logger.Debug(" Quests.Advance(72221) "); //world.Game.Quests.NotifyQuest(72221, QuestStepObjectiveType.PossessItem, -1); world.Game.Quests.Advance(72221); } foreach (var player in world.Players.Values) { player.Toon.MaximumQuest = 72061; player.Toon.ActiveQuest = 72061; player.Toon.StepOfQuest = 0; Logger.Debug(" Progress Saved "); } ; foreach (var plr in world.Game.Players.Values) { var inventory = plr.Inventory; var dbArtisans = DBSessions.AccountSession.Get <DBArtisansOfToon>(plr.Toon.PersistentID); plr.InGameClient.SendMessage(plr.GetBlacksmithData(dbArtisans)); var Blacksmith = world.GetActorBySNO(56947); Blacksmith.Attributes[Net.GS.Message.GameAttribute.MinimapActive] = true; (Blacksmith as Core.GS.Actors.InteractiveNPC).Conversations.Clear(); Blacksmith.Attributes[Net.GS.Message.GameAttribute.Conversation_Icon, 0] = 0; Blacksmith.Attributes.BroadcastChangedIfRevealed(); foreach (var itm in inventory.GetBackPackItems()) { if (itm.ActorSNO.Id == 92168) { inventory.DestroyInventoryItem(itm); inventory.RefreshInventoryToClient(); var RepairedCrown = Items.ItemGenerator.Cook(plr, "SkeletonKingCrown"); inventory.PickUp(RepairedCrown); } } DBSessions.AccountSession.SaveOrUpdate(dbArtisans); DBSessions.AccountSession.Flush(); } Logger.Debug(" Третий квест окончен. "); Logger.Debug("ПОЛУЧЕНИЕ НАГРАДЫ!"); foreach (var player in world.Game.Players.Values) { D3.Quests.QuestReward.Builder Reward = new D3.Quests.QuestReward.Builder(); //StoneOfRecallSkellet.Set var Hand = D3.GameBalance.Handle.CreateBuilder() .SetGameBalanceType((int)GBHandleType.Gizmo) .SetGbid(-2007738575) // .SetGbid(1612257705) ; var RareName = D3.Items.RareItemName.CreateBuilder() .SetSnoAffixStringList(213647) .SetAffixStringListIndex(213668) .SetItemNameIsPrefix(true) .SetItemStringListIndex(213647) ; var StoneOfRecallScript = D3.Items.Generator.CreateBuilder() .SetSeed((uint)RandomHelper.Next()) .SetGbHandle(Hand) .SetDurability(1) .SetMaxDurability(1) .SetStackSize(1) .SetFlags(0x1) // .SetItemQualityLevel(6) // .SetMaxDurability(30) // .SetDurability(30) // .SetRareItemName(RareName) ; Reward.SnoQuest = 72221; Reward.GoldGranted = 195; Reward.XpGranted = 900; Reward.ItemGranted = StoneOfRecallScript.Build(); //190617 player.Toon.StoneOfPortal = true; player.EnableStoneOfRecall(); D3.Quests.QuestStepComplete.Builder StepCompleted = new D3.Quests.QuestStepComplete.Builder(); StepCompleted.Reward = Reward.Build(); StepCompleted.SetIsQuestComplete(true); player.InGameClient.SendMessage(new Net.GS.Message.Definitions.Quest.QuestStepCompleteMessage() { QuestStepComplete = StepCompleted.Build() }); player.Inventory.AddGoldAmount(Reward.GoldGranted); player.UpdateExp(Reward.XpGranted); } bool questConversation = true; var Cain = world.GetActorBySNO(3533); Cain.Attributes[Net.GS.Message.GameAttribute.MinimapActive] = true; (Cain as Actors.InteractiveNPC).Conversations.Clear(); (Cain as Actors.InteractiveNPC).Conversations.Add(new Actors.Interactions.ConversationInteraction(80681)); Cain.Attributes[Net.GS.Message.GameAttribute.Conversation_Icon, 0] = questConversation ? 1 : 0; Cain.Attributes.BroadcastChangedIfRevealed(); //StartConversation(world, 196043); }
}; //We use this for the killeventlistener. public override void Execute(Map.World world) { //The spawning positions for each monster in its wave. Basically, you add here the "number" of mobs, accoring to each vector LaunchWave() will spawn every mob in its position. //Vector3D[] WretchedMotherSpawn = { new Vector3D(2766.513f, 2913.982f, 24.04533f) }; //Somehow shes already spawned when the Inn event finishes.. so we search for the ID and add it to the kill event listener. var actor = world.GetActorBySNO(wretchedMotherAID); if (actor == null) { Logger.Debug("Could not find the Wretched Mother ACTOR ID {0}", wretchedMotherAID); } else { monstersAlive1.Add(actor.DynamicID); //Run Kill Event Listener var ListenerWretchedMother = Task <bool> .Factory.StartNew(() => OnKillListener(monstersAlive1, world)); //Wait for wtretchedmother to be killed. ListenerWretchedMother.ContinueWith(delegate //Once killed: { // WMQ + 3 WM (group) // portal + rumford (group) // WMQ + 3 WM (group) // force next quest step world.Game.Quests.Advance(87700); Logger.Debug("Event finished"); // launch dialog StartConversation(world, 156223); // position of the wretched mother Vector3D[] WretchedMotherPosSpawn = new Vector3D[3]; // too hard 3 elems.. WretchedMotherPosSpawn[0] = new Vector3D(2427.788f, 2852.193f, 27.1f); WretchedMotherPosSpawn[1] = new Vector3D(2356.931f, 2528.715f, 27.1f); WretchedMotherPosSpawn[2] = new Vector3D(2119.563f, 2489.693f, 27.1f); // spawn 3 wretched mother Logger.Debug(" spawn 1 Wretched Mother "); world.SpawnMonster(wretchedMotherAID, WretchedMotherPosSpawn[0]); Logger.Debug(" spawn 1 Wretched Mother "); world.SpawnMonster(wretchedMotherAID, WretchedMotherPosSpawn[1]); Logger.Debug(" spawn 1 Wretched Mother "); world.SpawnMonster(wretchedMotherAID, WretchedMotherPosSpawn[2]); // ugly hack to get all actors with the same snoID..no idea if it is lmegit or if game will crash and summon diablo on my pc... var actorsWM = world.GetActorsBySNO(wretchedMotherQueenAID); // this is the List of wretched mother ACTOR ID var actorWQM = world.GetActorBySNO(wretchedMotherQueenAID); // this is the wretched queen mother ACTOR ID Logger.Debug(" world contains {0} WM ", actorsWM.Count); if (actorsWM.Count > 0) { monstersAliveBonus.Add(actorsWM.ElementAt(0).DynamicID); monstersAliveBonus.Add(actorsWM.ElementAt(0).DynamicID); monstersAliveBonus.Add(actorsWM.ElementAt(0).DynamicID); // run killbonus event listener var ListenerWQTask = Task <bool> .Factory.StartNew(() => OnKillBonusListener(monstersAliveBonus, world, bonusTaskID)); //Wait for wretched queen mother to be killed. ListenerWQTask.ContinueWith(delegate //Once killed: { Logger.Debug("Bonus Event Completed "); }); } else { Logger.Debug("Could not get/spawn the Wretched Mother ACTOR ID {0}", wretchedMotherAID); } if (actorWQM != null) { //Run Kill Event Listener var ListenerWQMTask = Task <bool> .Factory.StartNew(() => OnWMQKillListener(actorWQM.DynamicID, world)); //Wait for wretched queen mother to be killed. ListenerWQMTask.ContinueWith(delegate //Once killed: { //world.Game.Quests.Advance(87700); Logger.Debug("Event finished"); // portal + rumford (group) // portal shit var portalActorId = world.GetActorBySNO(portalAID); var ListenerUsePortalTask = Task <bool> .Factory.StartNew(() => OnUseActorListener(portalActorId.DynamicID, world)); //Wait for portal to be used . ListenerUsePortalTask.ContinueWith(delegate //Once killed: { Logger.Debug(" Portal used :p"); }); //conversation with rumford... }); } else { Logger.Debug("Could not find the Wretched Mother QUEEN ACTOR ID {0}", wretchedMotherQueenAID); } }); } }
}; //We fill this with the vectors of the actors //bool started = false; public override void Execute(Map.World world) { setActorOperable(world, 3739, false); StartConversation(world, 198199); var wave1Actors = world.GetActorsInGroup("GizmoGroup1"); monstersId.Clear(); ActorsVector3D.Clear(); foreach (var actor in wave1Actors) { if (actor.ActorSNO.Id == 76857) { monstersId.Add(6632); } else { monstersId.Add(6644); } ActorsVector3D.Add(new Vector3D(actor.Position.X, actor.Position.Y, actor.Position.Z)); } var zombieWave1 = Task <bool> .Factory.StartNew(() => LaunchWave(ActorsVector3D, world, monstersId)); zombieWave1.Wait(); var ListenerZombie1 = Task <bool> .Factory.StartNew(() => OnKillListener(monstersAlive, world)); ListenerZombie1.ContinueWith(delegate { StartConversation(world, 80088); var wave2Actors = world.GetActorsInGroup("GizmoGroup2"); monstersId.Clear(); ActorsVector3D.Clear(); foreach (var actor in wave2Actors) { if (actor.ActorSNO.Id == 76857) { monstersId.Add(6632); } else { monstersId.Add(6644); } ActorsVector3D.Add(new Vector3D(actor.Position.X, actor.Position.Y, actor.Position.Z)); } var zombieWave2 = Task <bool> .Factory.StartNew(() => LaunchWave(ActorsVector3D, world, monstersId)); zombieWave2.Wait(); var ListenerZombie2 = Task <bool> .Factory.StartNew(() => OnKillListener(monstersAlive, world)); ListenerZombie2.ContinueWith(delegate { StartConversation(world, 151102); world.Game.Quests.NotifyQuest(87700, QuestStepObjectiveType.KillGroup, -1); foreach (var plr in world.Players.Values) { plr.Toon.ActiveQuest = 87700; plr.Toon.StepOfQuest = 2; plr.Toon.StepIDofQuest = 42; } ; #region Открываем ворота var OldGate = world.GetActorBySNO(90419); var NoDownGate = new Door(world, 90419, world.GetActorBySNO(90419).Tags); NoDownGate.Field2 = 16; NoDownGate.RotationAxis = world.GetActorBySNO(90419).RotationAxis; NoDownGate.RotationW = world.GetActorBySNO(90419).RotationW; NoDownGate.Attributes[GameAttribute.Gizmo_Has_Been_Operated] = true; NoDownGate.Attributes[GameAttribute.Gizmo_State] = 1; NoDownGate.Attributes[GameAttribute.Untargetable] = true; NoDownGate.Attributes.BroadcastChangedIfRevealed(); NoDownGate.EnterWorld(world.GetActorBySNO(90419).Position); OldGate.Destroy(); world.BroadcastIfRevealed(new PlayAnimationMessage { ActorID = NoDownGate.DynamicID, Field1 = 5, Field2 = 0, tAnim = new Net.GS.Message.Fields.PlayAnimationMessageSpec[] { new Net.GS.Message.Fields.PlayAnimationMessageSpec() { Duration = 100, AnimationSNO = NoDownGate.AnimationSet.TagMapAnimDefault[AnimationSetKeys.Opening], PermutationIndex = 0, Speed = 0.5f } } }, NoDownGate); world.BroadcastIfRevealed(new SetIdleAnimationMessage { ActorID = NoDownGate.DynamicID, AnimationSNO = Core.GS.Common.Types.TagMap.AnimationSetKeys.Open.ID, }, NoDownGate); NoDownGate.Field2 = 16; NoDownGate.Attributes[Net.GS.Message.GameAttribute.Operatable] = false; #endregion #region Убираем ненужню Лею var actorToShoot = world.GetActorByDynamicId(72); if (actorToShoot != null) { world.Leave(actorToShoot); } else { Logger.Debug("No actor to shoot yet"); } #endregion setActorOperable(world, 3739, true); }); }); var rumfordActor = world.GetActorBySNO(3739); Logger.Debug(" Rumford has type {0}", rumfordActor.GetType()); }
}; // Используем для отслеживания убийства public override void Execute(Map.World world) { var boss = world.GetActorBySNO(CapitanDaltynAID); var minions = world.GetActorsBySNO(RiseZombieAID); if (boss == null) { Logger.Debug("Не найдено: Капитан Далтин - {0}", CapitanDaltynAID); Vector3D CapitanDaltyn = new Vector3D(51.12595f, 100.2664f, 0.1000305f); Vector3D[] Zombies = new Vector3D[4]; Zombies[0] = new Vector3D(50.00065f, 125.4087f, 0.1000305f); Zombies[1] = new Vector3D(54.88688f, 62.24541f, 0.1000305f); Zombies[2] = new Vector3D(86.45869f, 77.09571f, 0.1000305f); Zombies[3] = new Vector3D(102.117f, 97.59058f, 0.1000305f); var Daltyn = world.SpawnMonsterWithGet(CapitanDaltynAID, CapitanDaltyn); //[011523] [Anim] zombie_male_skinny_spawn world.BroadcastIfRevealed(new PlayAnimationMessage { ActorID = Daltyn.DynamicID, Field1 = 5, Field2 = 0, tAnim = new Net.GS.Message.Fields.PlayAnimationMessageSpec[] { new Net.GS.Message.Fields.PlayAnimationMessageSpec() { Duration = 20, AnimationSNO = 11523, PermutationIndex = 0, Speed = 0.9f } } }, Daltyn); (Daltyn as Actors.Monster).Brain.DeActivate(); foreach (Vector3D point in Zombies) { var Zombie = world.SpawnMonsterWithGet(RiseZombieAID, point); CapitanDaltynKiller.Add(Zombie.DynamicID); Zombie.Attributes[GameAttribute.Quest_Monster] = true; (Zombie as Actors.Monster).Brain.DeActivate(); world.BroadcastIfRevealed(new PlayAnimationMessage { ActorID = Zombie.DynamicID, Field1 = 5, Field2 = 0, tAnim = new Net.GS.Message.Fields.PlayAnimationMessageSpec[] { new Net.GS.Message.Fields.PlayAnimationMessageSpec() { Duration = 160, AnimationSNO = 11523, PermutationIndex = 0, Speed = 1f } } }, Zombie); } boss = world.GetActorBySNO(CapitanDaltynAID); CapitanDaltynKiller.Add(boss.DynamicID); minions = world.GetActorsBySNO(RiseZombieAID); boss.RunSpeed = 0.33f; boss.WalkSpeed = 0.33f; Ticker.TickTimer Timeout = new Ticker.SecondsTickTimer(world.Game, 3.5f); var Boom = System.Threading.Tasks.Task <bool> .Factory.StartNew(() => WaitToSpawn(Timeout)); Boom.ContinueWith(delegate { (Daltyn as Actors.Monster).Brain.Activate(); foreach (var minion in minions) { (minion as Actors.Monster).Brain.Activate(); } }); } else { CapitanDaltynKiller.Add(boss.DynamicID); } // Пытаемся привязать статус босса! boss = world.GetActorBySNO(CapitanDaltynAID); boss.Attributes[Net.GS.Message.GameAttribute.Using_Bossbar] = true; boss.Attributes[Net.GS.Message.GameAttribute.InBossEncounter] = true; // DOES NOT WORK it should be champion affixes or shit of this kind ... // Увеличиваем здоровье босса! boss.Attributes[GameAttribute.Hitpoints_Max] = 200f; boss.Attributes[GameAttribute.Hitpoints_Cur] = 200f; boss.Attributes[GameAttribute.Movement_Scalar_Reduction_Percent] -= 10f; boss.Attributes[GameAttribute.Quest_Monster] = true; //Запуск отслеживания убийства var ListenerDaltyn = Task <bool> .Factory.StartNew(() => OnKillListener(CapitanDaltynKiller, world)); //Ждём пока убьют ListenerDaltyn.ContinueWith(delegate { //{[Actor] [Type: Monster] SNOId:203030 DynamicId: 3634 Position: x:149,8516 y:60,33301 z:3,051758E-05 Name: Leah_AdriaCellar} var Leah_Cellar = world.GetActorBySNO(203030); Leah_Cellar.Position = new Vector3D(149.8516f, 60.33301f, 3.051758E-05f); Leah_Cellar.Attributes[Net.GS.Message.GameAttribute.MinimapActive] = true; (Leah_Cellar as Actors.InteractiveNPC).Conversations.Clear(); (Leah_Cellar as Actors.InteractiveNPC).Conversations.Add(new Actors.Interactions.ConversationInteraction(198588)); Leah_Cellar.Attributes[Net.GS.Message.GameAttribute.Conversation_Icon, 0] = 1; Leah_Cellar.Attributes.BroadcastChangedIfRevealed(); foreach (var player in world.Players) { try { if (player.Value.PlayerIndex == 0) { world.Game.Quests.Advance(72095); } if (player.Value.ActiveHireling != null) { player.Value.ActiveHireling = null; player.Value.ActiveHirelingProxy = null; } } catch { } } }); }
private bool OnListenerToEnter(Players.Player player, Map.World world) { int sceneID = player.CurrentScene.SceneSNO.Id; while (true) { sceneID = player.CurrentScene.SceneSNO.Id; if (sceneID == 90196) { bool ActivePortal = true; foreach (var playerN in world.Players) { var dbQuestProgress = DBSessions.AccountSession.Get <DBProgressToon>(playerN.Value.Toon.PersistentID); if (dbQuestProgress.StepOfQuest == 1) { ActivePortal = false; } dbQuestProgress.ActiveQuest = 72095; dbQuestProgress.StepOfQuest = 3; DBSessions.AccountSession.SaveOrUpdate(dbQuestProgress); DBSessions.AccountSession.Flush(); } if (ActivePortal == true) { StartConversation(world, 166678); } else { world.Game.Quests.Advance(72095); StartConversation(world, 166678); } try { var Gate = world.GetActorBySNO(108466); world.BroadcastIfRevealed(new PlayAnimationMessage { ActorID = Gate.DynamicID, Field1 = 5, Field2 = 0, tAnim = new Net.GS.Message.Fields.PlayAnimationMessageSpec[] { new Net.GS.Message.Fields.PlayAnimationMessageSpec() { Duration = 100, AnimationSNO = Gate.AnimationSet.TagMapAnimDefault[Common.Types.TagMap.AnimationSetKeys.Opening], PermutationIndex = 0, Speed = 1 } } }, Gate); world.BroadcastIfRevealed(new SetIdleAnimationMessage { ActorID = Gate.DynamicID, AnimationSNO = Common.Types.TagMap.AnimationSetKeys.Open.ID }, Gate); if (player.ActiveHireling != null) { var HirelingToLeave = player.ActiveHireling; world.Leave(HirelingToLeave); Vector3D OutDoor = new Vector3D(1896.382f, 2782.988f, 32.85f); Vector3D NearDoor = new Vector3D(1935.697f, 2792.971f, 40.23627f); var Leah_Back = world.GetActorByDynamicId(83); Leah_Back.EnterWorld(OutDoor); } } catch { } break; } } return(true); }
public override void Execute(Map.World world) { var actor = world.GetActorBySNO(wretchedMotherAID); if (actor == null) { Logger.Debug("Could not find the Wretched Mother ACTOR ID {0}", wretchedMotherAID); Vector3D FirstMother = new Vector3D(2766.513f, 2913.982f, 24.04533f); world.SpawnMonster(wretchedMotherAID, FirstMother); actor = world.GetActorBySNO(wretchedMotherAID); monstersAlive1.Add(actor.DynamicID); } else { monstersAlive1.Add(actor.DynamicID); } //Убираем телегу var FactorToShoot = world.GetActorBySNO(81699); try { world.BroadcastIfRevealed(new PlayAnimationMessage { ActorID = FactorToShoot.DynamicID, Field1 = 11, Field2 = 0, tAnim = new Net.GS.Message.Fields.PlayAnimationMessageSpec[] { new Net.GS.Message.Fields.PlayAnimationMessageSpec() { Duration = 10, AnimationSNO = 81701, PermutationIndex = 0, Speed = 1 } } }, FactorToShoot); FactorToShoot.Attributes[GameAttribute.Deleted_On_Server] = true; FactorToShoot.Attributes[GameAttribute.Could_Have_Ragdolled] = true; FactorToShoot.Attributes.BroadcastChangedIfRevealed(); FactorToShoot.Destroy(); } catch { } //Запуск отслеживания убийства var ListenerWretchedMother = Task <bool> .Factory.StartNew(() => OnKillListener(monstersAlive1, world)); //Ждём пока убьют ListenerWretchedMother.ContinueWith(delegate { world.Game.Quests.NotifyQuest(87700, QuestStepObjectiveType.EventReceived, -1); world.Game.Quests.NotifyQuest(87700, QuestStepObjectiveType.KillMonster, 108444); Logger.Debug("Event finished"); StartConversation(world, 156223); // position of the wretched mother Vector3D[] WretchedMotherPosSpawn = new Vector3D[3]; // too hard 3 elems.. WretchedMotherPosSpawn[0] = new Vector3D(2427.788f, 2852.193f, 27.1f); WretchedMotherPosSpawn[1] = new Vector3D(2356.931f, 2528.715f, 27.1f); WretchedMotherPosSpawn[2] = new Vector3D(2119.563f, 2489.693f, 27.1f); // spawn 3 wretched mother Logger.Debug(" spawn 1 Wretched Mother "); world.SpawnMonster(wretchedMotherAID, WretchedMotherPosSpawn[0]); Logger.Debug(" spawn 1 Wretched Mother "); world.SpawnMonster(wretchedMotherAID, WretchedMotherPosSpawn[1]); Logger.Debug(" spawn 1 Wretched Mother "); world.SpawnMonster(wretchedMotherAID, WretchedMotherPosSpawn[2]); // ugly hack to get all actors with the same snoID..no idea if it is lmegit or if game will crash and summon diablo on my pc... var actorsWM = world.GetActorsBySNO(wretchedMotherAID); // this is the List of wretched mother ACTOR ID var actorWQM = world.GetActorBySNO(wretchedMotherQueenAID); // this is the wretched queen mother ACTOR ID if (actorWQM == null) { actorWQM = world.SpawnMonsterWithGet(wretchedMotherQueenAID, new Vector3D(2032.949f, 2771.926f, 40.15685f)); } Logger.Debug(" world contains {0} WM ", actorsWM.Count); if (actorsWM.Count > 0) { monstersAliveBonus.Add(actorsWM.ElementAt(0).DynamicID); monstersAliveBonus.Add(actorsWM.ElementAt(0).DynamicID); monstersAliveBonus.Add(actorsWM.ElementAt(0).DynamicID); // run killbonus event listener var ListenerWQTask = Task <bool> .Factory.StartNew(() => OnKillBonusListener(monstersAliveBonus, world, bonusTaskID)); //Wait for wretched queen mother to be killed. ListenerWQTask.ContinueWith(delegate //Once killed: { Logger.Debug("Bonus Event Completed "); }); } else { Logger.Debug("Could not get/spawn the Wretched Mother ACTOR ID {0}", wretchedMotherAID); } if (actorWQM != null) { // Пытаемся привязать статус босса! actorWQM.Attributes[Net.GS.Message.GameAttribute.Using_Bossbar] = true; actorWQM.Attributes[Net.GS.Message.GameAttribute.InBossEncounter] = true; // Увеличиваем здоровье босса! //actorWQM.Q actorWQM.Attributes[GameAttribute.Hitpoints_Max] = 150f; actorWQM.Attributes[GameAttribute.Hitpoints_Cur] = 150f; //Запуск отслеживания убийства королевы var ListenerWQMTask = Task <bool> .Factory.StartNew(() => OnWMQKillListener(actorWQM.DynamicID, world)); //Wait for wretched queen mother to be killed. ListenerWQMTask.ContinueWith(delegate { Logger.Debug(" Wretch Queen Event done !!"); // portal shit var portalActorId = world.GetActorBySNO(portalAID); portalActorId.Attributes[Net.GS.Message.GameAttribute.Gizmo_Has_Been_Operated] = false; var ListenerUsePortalTask = Task <bool> .Factory.StartNew(() => OnUseTeleporterListener(portalActorId.DynamicID, world)); //Wait for portal to be used . ListenerUsePortalTask.ContinueWith(delegate //Once killed: { Logger.Debug(" Waypoint_OldTristram Objective done "); // Waypoint_OldTristram }); }); } else { Logger.Debug("Could not find the Wretched Mother QUEEN ACTOR ID {0}", wretchedMotherQueenAID); } }); }
public override void Execute(Map.World world) { // Проверка на ненужную Лию if (world.HasActor(72)) { world.GetActorByDynamicId(72).Destroy(); } //Берем нужную Лию =) var LeahBrains = world.GetActorByDynamicId(83); //Берем путевую точку Нового Тристрама var NewTristramPortal = world.GetActorBySNO(223757); if (HadConversation) { HadConversation = false; Logger.Debug(" RESCUE CAIN QUEST STARTED "); world.Game.Quests.NotifyQuest(72095, QuestStepObjectiveType.EventReceived, -1); } #region Создаем Лею как подругу. Hireling LeahFriend = new LeahParty(world, LeahBrains.ActorSNO.Id, LeahBrains.Tags); //LeahFriend.Brain = new HirelingBrain(LeahFriend); foreach (var player in world.Players) { if (player.Value.PlayerIndex == 0) { LeahFriend.GBHandle.Type = 4; LeahFriend.GBHandle.GBID = 717705071; LeahFriend.Attributes[GameAttribute.Pet_Creator] = player.Value.PlayerIndex; LeahFriend.Attributes[GameAttribute.Pet_Type] = 0x8; LeahFriend.Attributes[GameAttribute.Hitpoints_Max] = 100f; LeahFriend.Attributes[GameAttribute.Hitpoints_Cur] = 80f; LeahFriend.Attributes[GameAttribute.Attacks_Per_Second] = 1.6f; LeahFriend.Attributes[GameAttribute.Pet_Owner] = player.Value.PlayerIndex; LeahFriend.Attributes[GameAttribute.Untargetable] = false; LeahFriend.Position = RandomDirection(player.Value.Position, 3f, 8f); LeahFriend.RotationW = LeahBrains.RotationW; LeahFriend.RotationAxis = LeahBrains.RotationAxis; LeahFriend.EnterWorld(RandomDirection(player.Value.Position, 3f, 8f)); LeahFriend.Attributes[GameAttribute.Level]++; player.Value.ActiveHireling = LeahFriend; LeahFriend.Brain.Activate(); MasterPlayer = player.Value; } player.Value.Toon.ActiveQuest = 72095; player.Value.Toon.StepOfQuest = 1; player.Value.Toon.StepIDofQuest = 7; } #endregion // Убираем Лею NPC try { world.Leave(LeahBrains); } catch { } NewTristramPortal.Attributes[Net.GS.Message.GameAttribute.Gizmo_Has_Been_Operated] = false; var ListenerUsePortalTask = Task <bool> .Factory.StartNew(() => OnUseTeleporterListener(NewTristramPortal.DynamicID, world)); ListenerUsePortalTask.ContinueWith(delegate //Ждём использования телепорта: { Logger.Debug(" Waypoint_NewTristram Objective done "); // Waypoint_NewTristram }); var ListenerEnterToOldTristram = Task <bool> .Factory.StartNew(() => OnListenerToEnter(MasterPlayer, world)); ListenerEnterToOldTristram.ContinueWith(delegate //Once killed: { Logger.Debug("Enter to Road Objective done "); var ListenerEnterToAdriaEnter = Task <bool> .Factory.StartNew(() => OnListenerToAndriaEnter(MasterPlayer, world)); ListenerEnterToAdriaEnter.ContinueWith(delegate //Once killed: { Logger.Debug("Enter to Adria Objective done "); }); }); }
}; //We fill this with the vectors of the actors //bool started = false; public override void Execute(Map.World world) { ////Disable RumFord so he doesn't offer the quest. Somehow, hes supposed to mark it as readed and not offer it while theres no other quest available but he does, ////so you can trigger the event multiple times while the event is already running, therefor, we disable his interaction till the event is done.-Wesko setActorOperable(world, 3739, false); // no need for it now the update conversation list is laucnhed once the conversation is marked as read :p StartConversation(world, 198199); var wave1Actors = world.GetActorsInGroup("GizmoGroup1"); monstersId.Clear(); ActorsVector3D.Clear(); foreach (var actor in wave1Actors) { if (actor.ActorSNO.Id == 76857) { monstersId.Add(6632); } else { monstersId.Add(6644); } ActorsVector3D.Add(new Vector3D(actor.Position.X, actor.Position.Y, actor.Position.Z)); } var zombieWave1 = Task <bool> .Factory.StartNew(() => LaunchWave(ActorsVector3D, world, monstersId)); zombieWave1.Wait(); var ListenerZombie1 = Task <bool> .Factory.StartNew(() => OnKillListener(monstersAlive, world)); ListenerZombie1.ContinueWith(delegate //Once killed: { //Wave three: Skinnies + RumFord conversation #2 "They Keep Comming!". StartConversation(world, 80088); var wave2Actors = world.GetActorsInGroup("GizmoGroup2"); monstersId.Clear(); ActorsVector3D.Clear(); foreach (var actor in wave2Actors) { if (actor.ActorSNO.Id == 76857) { monstersId.Add(6632); } else { monstersId.Add(6644); } ActorsVector3D.Add(new Vector3D(actor.Position.X, actor.Position.Y, actor.Position.Z)); } var zombieWave2 = Task <bool> .Factory.StartNew(() => LaunchWave(ActorsVector3D, world, monstersId)); zombieWave2.Wait(); var ListenerZombie2 = Task <bool> .Factory.StartNew(() => OnKillListener(monstersAlive, world)); ListenerZombie2.ContinueWith(delegate //Once killed: { StartConversation(world, 151102); world.Game.Quests.Advance(87700); Logger.Debug("Event finished"); // wyjebanie leah var actorToShoot = world.GetActorByDynamicId(72); if (actorToShoot != null) { Logger.Debug("trying to shoot actor SNO {0}, world contains {1} such actors ", actorToShoot.ActorSNO, world.GetActorsBySNO(3739).Count); world.Leave(actorToShoot); } else { Logger.Debug("No actor to shoot yet"); } setActorOperable(world, 3739, true); }); }); // check rumford state :p var rumfordActor = world.GetActorBySNO(3739); // display real type for rumford actor Logger.Debug(" Rumford has type {0}", rumfordActor.GetType()); //var rumfordBrain = (rumfordActor as Living).Brain; //try //{ // Logger.Debug(" Rumford as a brain {0}, activating now ! ", (rumfordActor as CaptainRumford).Brain); // (rumfordActor as CaptainRumford).Brain.Activate(); //} //catch (System.NullReferenceException e) //{ // Logger.Debug(" brain in rumford has a lots of problems !"); //} }
public override void Execute(Map.World world) { if (HadConversation) { HadConversation = false; } foreach (var player in world.Players.Values) { player.Toon.MaximumQuest = 72221; player.Toon.ActiveQuest = 72221; player.Toon.StepOfQuest = -1; } ; Logger.Debug(" Второй квест окончен. "); bool questConversation = true; var Cain = world.GetActorBySNO(3533); Cain.Attributes[Net.GS.Message.GameAttribute.MinimapActive] = true; (Cain as InteractiveNPC).Conversations.Clear(); (Cain as InteractiveNPC).Conversations.Add(new Actors.Interactions.ConversationInteraction(198691)); Cain.Attributes[Net.GS.Message.GameAttribute.Conversation_Icon, 0] = questConversation ? 1 : 0; Cain.Attributes.BroadcastChangedIfRevealed(); try { var BlacksmithVendor = world.GetActorBySNO(56947); Vector3D position = new Vector3D(BlacksmithVendor.Position); var BlacksmithQuest = world.GetActorBySNO(65036); BlacksmithQuest.RotationAxis = BlacksmithVendor.RotationAxis; BlacksmithQuest.RotationW = BlacksmithVendor.RotationW; var TELEGAS = world.GetActorsBySNO(112131); Vector3D LastTelega = new Vector3D(); foreach (var TELEGA in TELEGAS) { LastTelega = TELEGA.Position; TELEGA.Destroy(); } } catch { Logger.Warn("Не критичная ошибка скрипта."); } Players.Player Master = null; Logger.Debug("ПОЛУЧЕНИЕ НАГРАДЫ!"); foreach (var player in world.Game.Players.Values) { if (player.PlayerIndex == 0) { Master = player; } D3.Quests.QuestReward.Builder Reward = new D3.Quests.QuestReward.Builder(); Reward.SnoQuest = 72095; Reward.XpGranted = 3300; D3.Quests.QuestStepComplete.Builder StepCompleted = new D3.Quests.QuestStepComplete.Builder(); StepCompleted.Reward = Reward.Build(); StepCompleted.SetIsQuestComplete(true); player.InGameClient.SendMessage(new Net.GS.Message.Definitions.Quest.QuestStepCompleteMessage() { QuestStepComplete = StepCompleted.Build() }); player.UpdateExp(Reward.XpGranted); } }