本文整理汇总了C#中Map.GetActorBySNO方法的典型用法代码示例。如果您正苦于以下问题:C# Map.GetActorBySNO方法的具体用法?C# Map.GetActorBySNO怎么用?C# Map.GetActorBySNO使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Map
的用法示例。
在下文中一共展示了Map.GetActorBySNO方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HoudiniVsZombies
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;
}
示例2: Execute
List<uint> monstersAlive = new List<uint> { }; //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);
});
}
示例3: setActorOperable
//Not Operable Rumford (To disable giving u the same quest while ur in the event)
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;
}
示例4: Execute
List<Vector3D> ActorsVector3D = new List<Vector3D> { }; //We fill this with the vectors of the actors
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
//Start the conversation between RumFord & Guard.
StartConversation(world, 198199);
//After Conversations ends!.
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 !");
//}
}
示例5: Execute
List<uint> monstersAliveBonus = new List<uint> { }; //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)
{
// ok set a boss health bar for the bitch :;p
actorWQM.Attributes[Net.GS.Message.GameAttribute.Using_Bossbar] = true;
// actorWQM.Attributes[Net.GS.Message.GameAttribute.InBossEncounter] = true; // there also an attribute about QuestMonster
// DOES NOT WORK it hsould be champion affixes or shit of this kind ...
//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:
{
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);
}
//.........这里部分代码省略.........