private void SetupSeats() { VehicleSeatEntry[] seats = this.m_entry.VehicleEntry.Seats; this._seats = new VehicleSeat[seats.Length]; for (int i = 0; i < seats.Length; i++) { VehicleSeatEntry entry = seats[i]; if (entry != null) { this._seats[i] = new VehicleSeat(this, entry, (byte)i); if (this._seats[i].Entry.PassengerNPCId != 0u) { this.HasUnitAttachment = true; this._seats[i].CharacterCanEnterOrExit = false; int seat = i; base.AddMessage(delegate() { NPCEntry ent = NPCMgr.GetEntry(entry.PassengerNPCId); if (ent == null) { return; } NPC npc = ent.SpawnAt(this, false); npc.Brain.EnterDefaultState(); this._seats[seat].Enter(npc); }); } } } }
private void SpawnMob(int x, int y, NPCEntry entry, IWorldLocation dest) { Vector3 pos = new Vector3(dest.Position.X + (float)x, dest.Position.Y + (float)y); WorldLocation worldLocation = new WorldLocation(dest.Map, pos, 1U); entry.SpawnAt((IWorldLocation)worldLocation, false).Brain.State = BrainState.GmMove; }
public override NPC Summon(SpellCast cast, ref Vector3 targetLoc, NPCEntry entry) { NPC npc = entry.SpawnAt(cast.Map, targetLoc, false); npc.RemainingDecayDelayMillis = cast.Spell.GetDuration(cast.CasterReference); npc.Creator = cast.CasterReference.EntityId; return(npc); }
private void SpawnMob(int x, int y, NPCEntry entry, IWorldLocation dest) { var pos = new Vector3(dest.Position.X + x, dest.Position.Y + y); var wl = new WorldLocation(dest.Map, pos); var newNpc = entry.SpawnAt(wl); newNpc.Brain.State = BrainState.GmMove; }
public void SpawnNpcsForCurrentWave(int stepNumber) // 0 - Начало волны, 1 - Спустя некоторое время { int npcsCount = stepNumber == 0 ? npcsCount1 : npcsCount2; for (int i = 0; i < npcsCount; ++i) { NPCEntry entry = npcTemplate[0]; int offsetX = -15 + random.Next(31); int offsetY = -15 + random.Next(31); var pos = new Vector3(offsetX + mapCenterX + _map.Offset, offsetY + mapCenterY + _map.Offset, 0); var wl = new WorldLocation(_map, pos); entry.IsAgressive = true; //float healh = ((getAverageLevel() / 50) > 1 ? getAverageLevel() / 50 : entry.MaxHealth) * (Difficulty == 0 ? 2 : Difficulty == 1 ? 4 : Difficulty == 2 ? 6 : 1); //entry.SetHealth((entry.MaxHealth * (Difficulty == 0 ? 2 : Difficulty == 1 ? 4 : Difficulty == 2 ? 6 : 1))); var newNpc = entry.SpawnAt(wl); newNpc.IsAsda2GuildWave = true; _map.CallDelayed(100, () => newNpc.Movement.MoveTo(pos)); npcTemplate.Remove(entry); currentWaveNpcs.Add(newNpc); } }