public CollisionManager(ReadManager rm, CombatManager com, Game1 g) { this.rm = rm; this.g = g; this.com = com; mRace = MonsterRace.None; }
public Monster(MonsterInGroupLightInformations informations, EntityLook look) { Look = look; m_monster = ObjectDataManager.Instance.Get <Protocol.Data.Monster>(informations.creatureGenericId); m_monsterGrade = m_monster.grades[informations.grade - 1]; m_race = ObjectDataManager.Instance.Get <MonsterRace>(m_monster.race); m_superRace = ObjectDataManager.Instance.Get <MonsterSuperRace>(m_race.superRaceId); }
private string RenderRace(MonsterRace race) { if (!string.IsNullOrWhiteSpace(race.Tags)) { return($"{race.MonsterType} ({race.Tags})"); } return(race.MonsterType.ToString()); }
public void Update(GameTime gameTime) { foreach (Hero h in rm.heroes) { foreach (Tile t in rm.tileList) // Collision checking between hero and tiles. { t.Update(gameTime); if (h.hitbox.Intersects(t.hitbox)) { if (g.IntersectPixel(h.hitbox, h.textureData, t.hitbox, t.textureData)) { h.hasJumped = false; h.velocity.Y = 0f; break; } else { h.hasJumped = true; } } else { h.hasJumped = true; } } foreach (Monster m in rm.monsters) { if (h.hitbox.Intersects(m.hitbox)) { if (g.IntersectPixel(h.hitbox, h.textureData, m.hitbox, m.textureData)) { if (!com.cmRepeat) { rm.monstersInCombat.Add(m); h.positionBeforeCombat = h.position; if (rm.monstersInCombat.Contains(rm.green)) { mRace = MonsterRace.Goblin; } else if (rm.monstersInCombat.Contains(rm.devil)) { mRace = MonsterRace.Devil; } h.position = h.savedCombatPos; foreach (Monster n in rm.monstersInCombat) { m.position = m.savedCombatPos; } com.cmRepeat = true; } g.state = GameState.Combat; } } } } }
public Monster(int snoID, int monsterCategory, int race, int type, int powerType, int resists) : base(snoID, (int)ActorCategory.Monster, (int)TeamType.Hostile) { MonsterCategory = (MonsterCategory)monsterCategory; MonsterRace = (MonsterRace)race; MonsterType = (MonsterType)type; PowerType = (MonsterPowerType)powerType; Resists = (Resistance)resists; }
private MonsterRace ParseMonsterType(string rawType) { var race = new MonsterRace(); foreach (MonsterType monsterRace in Enum.GetValues(typeof(MonsterType))) { if (rawType.Contains(monsterRace.ToString().ToLower())) { race.MonsterType = monsterRace; } } var regex = new Regex(@"\(([A-Za-z]*)\)"); race.Tags = regex.Match(rawType).Value.Trim('(').Trim(')'); return(race); }
/// <summary> /// Constructor loads the raw file contents into the data structure. /// </summary> public MonsterDB(List<string[]> p_monsters) { Races = new List<MonsterRace>(); for (int m = 1; m < p_monsters.Count; m++) { string[] raceEntries = p_monsters[m]; MonsterRace createRace = new MonsterRace(); createRace.Race = System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(raceEntries[0]); createRace.Book = raceEntries[1]; createRace.Levels = new List<MonsterRace.LevelProfile>(); createRace.AddLevelProfiles(raceEntries[2]); switch (raceEntries[3].Trim()) { case "n": createRace.Origin = "Natural"; break; case "a": createRace.Origin = "Aberrant"; break; case "e": createRace.Origin = "Elemental"; break; case "f": createRace.Origin = "Fey"; break; case "i": createRace.Origin = "Immortal"; break; case "s": createRace.Origin = "Shadow"; break; default: createRace.Origin = "ERROR"; break; } switch (raceEntries[4].Trim()) { case "h": createRace.Type = "Humanoid"; break; case "b": createRace.Type = "Beast"; break; case "m": createRace.Type = "M. Beast"; break; case "a": createRace.Type = "Animate"; break; default: createRace.Type = "ERROR"; break; } createRace.Keywords = (string.IsNullOrEmpty(raceEntries[5]) == true ? null : raceEntries[5]); createRace.Allied = (string.IsNullOrEmpty(raceEntries[6]) == true ? null : raceEntries[6]); createRace.Social = System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(raceEntries[7]); createRace.Habitat = raceEntries[8]; // needs improvement Races.Add(createRace); } }
public static Monster CreateMonster(MonsterRace race, string name = "") { switch (race) { case MonsterRace.Goblin: return(new Goblin(name)); case MonsterRace.Ghost: if (name == "") { return(new AnonymousStranger()); } return(new SlientGhost(name)); } Debug.LogError("MonsterFactory.CreateMonster Error : No corresponding monster with parameters race = " + race.ToString() + ", name = " + name); return(null); }
public L2RaceManager() { monsterRace = MonsterRace.getInstance(); }
/// <summary> /// Constructor used by ReferenceActorMeta collection initializer records. /// This imports a previously exported set of data. /// </summary> public ActorMeta(int actorSNO, int monsterSNO, string internalName, int actorType, double radius, int monsterType, int monsterRace, int monsterSize, int gizmoType, bool isSummoner, bool isHostile, bool isNPC, int physMeshSNO, int apperanceSNO, int animSetSNO, bool isMerchant, bool isBarracade, bool gizmoIsTownPortal, bool gizmoIsPortal, bool gizmoIsDisabledByScript, bool gizmoIsDestructible, int gizmoGrantsNoXp, int gizmoDefaultCharges, int gizmoDefaultState, int gizmoDropNoLoot, bool gizmoIsOperatable, bool gizmoIsBarracade, int petType, bool isSummoned, bool isSalvageShortcut, int hirelingType, bool isHelper, bool isDefaultHidden, bool isQuestGiver, bool isGizmo, bool isUnit, bool isMonster) { ActorSNO = actorSNO; MonsterSNO = monsterSNO; InternalName = internalName; ActorType = (ActorType)actorType; Radius = radius; MonsterType = (MonsterType)monsterType; MonsterRace = (MonsterRace)monsterRace; MonsterSize = (MonsterSize)monsterSize; GizmoType = (GizmoType)gizmoType; IsSummoner = isSummoner; IsHostile = isHostile; IsNPC = isNPC; PhysMeshSNO = physMeshSNO; ApperanceSNO = apperanceSNO; AnimSetSNO = animSetSNO; IsMerchant = isMerchant; IsBarracade = isBarracade; GizmoIsTownPortal = gizmoIsTownPortal; GizmoIsPortal = gizmoIsPortal; GizmoIsDisabledByScript = gizmoIsDisabledByScript; GizmoIsDestructible = gizmoIsDestructible; GizmoGrantsNoXp = gizmoGrantsNoXp; GizmoDefaultCharges = gizmoDefaultCharges; GizmoDefaultState = gizmoDefaultState; GizmoDropNoLoot = gizmoDropNoLoot; GizmoIsOperatable = gizmoIsOperatable; GizmoIsBarracade = gizmoIsBarracade; PetType = petType; IsSummoned = isSummoned; IsSalvageShortcut = isSalvageShortcut; HirelingType = (HirelingType) hirelingType; IsHelper = isHelper; IsDefaultHidden = isDefaultHidden; IsQuestGiver = isQuestGiver; IsGizmo = isGizmo; IsUnit = isUnit; IsMonster = isMonster; _isPartial = false; _isValid = true; }
public Monster(int snoID, int monsterCategory, int race, int type, int powerType, int resists) : base(snoID, (int)ActorCategory.Monster, (int)TeamType.Hostile) { MonsterCategory = (MonsterCategory)monsterCategory; MonsterRace = (MonsterRace)race; MonsterType = (MonsterType)type; PowerType = (MonsterPowerType)powerType; Resists = (Resistance)resists; }
public void Update(GameTime gameTime) { foreach (Hero h in rm.heroes) { if (h.yourTurn) { doThisOnce1 = true; foreach (Monster m in rm.monstersInCombat) { if (m.IsAlive) { if (pClass == PlayerClass.Warrior) { rm.warrior.UpdateCombat(gameTime); } else if (pClass == PlayerClass.Mage) { rm.mage.UpdateCombat(gameTime); } } } } } foreach (Hero h in rm.heroes) { if (!h.yourTurn) { foreach (Monster m in rm.monstersInCombat) { if (m.IsAlive) { if (mRace == MonsterRace.Goblin) { rm.green.UpdateCombat(gameTime); } else if (mRace == MonsterRace.Devil) { rm.devil.UpdateCombat(gameTime); } } } } } foreach (Monster m in rm.monstersInCombat) { if (KeymouseReader.KeyPressed(Keys.R)) { m.IsAlive = false; } if (m.Health <= 0) { m.IsAlive = false; } if (!m.IsAlive && rm.monstersInCombat.Count != 0) { foreach (Hero h in rm.heroes) { h.position = h.positionBeforeCombat; } //rm.monstersInCombat.RemoveAll(P => m.IsAlive = false); ResetCombat(); mRace = MonsterRace.None; } } }
public void Start() { Console.Title = "L2dotNET Gameserver"; CLogger.form(); Cfg.init("all"); CharTemplateTable.Instance.Initialize(); NetworkBlock.getInstance(); GameTime.getInstance(); IdFactory.Instance.Initialize(); L2World.Instance.Initialize(); // MapRegionTable.getInstance(); ZoneTable.getInstance(); NpcTable.getInstance(); NpcData.getInstance(); // SpawnTable.getInstance(); StaticObjTable.getInstance().read(); StructureTable.getInstance().read(); // TSkillTable.getInstance(); ItemTable.getInstance(); ItemHandler.getInstance(); MultiSell.getInstance(); Capsule.getInstance(); RecipeTable.getInstance(); MonsterRace.getInstance(); AIManager.getInstance(); BlowFishKeygen.genKey(); CLogger.info("generated 20 blowfish keys"); AdminAccess.Instance.Initialize();; QuestManager.getInstance(); AnnouncementManager.Instance.Initialize(); AllianceTable.getInstance(); ClanTable.getInstance(); CLogger.info("NpcServer: "); StaticObjTable.getInstance().Spawn(); MonsterRace.getInstance().Spawn(); // SpawnTable.getInstance().Spawn(); StructureTable.getInstance().init(); HtmCache.getInstance(); AuthThread.getInstance(); // GeoData.getInstance(); CLogger.extra_info("listening game clients on port " + Cfg.SERVER_PORT); _listener = new TcpListener(Cfg.SERVER_PORT); _listener.Start(); TcpClient clientSocket = default(TcpClient); while (true) { clientSocket = _listener.AcceptTcpClient(); accept(clientSocket); } }
public L2RaceManager() { monsterRace = MonsterRace.Instance; }
protected internal override void use(L2Player admin, string alias) { // double dis = Calcs.calculateDistance(admin, admin._currentTarget, true); // admin.sendMessage("dis "+dis); // foreach (L2SkillCoolTime ct in admin._reuse.Values) // { // ct.forcedStop(); // } // admin._reuse.Clear(); // admin.updateReuse(); string s = alias.Split(' ')[1]; if (s == "1") { admin.AbnormalBitMaskEvent = int.Parse(alias.Split(' ')[2]); admin.updateAbnormalEventEffect(); } else if (s == "2") { int listid = int.Parse(alias.Split(' ')[2]); MultiSell.getInstance().showList(admin, null, listid); } else if (s == "4") { FortressOfTheDead d = new FortressOfTheDead(); d.start(); } else if (s == "5") { if (np == null) { int[] x = new int[] { -81166, -80913, -81952, -82554 }; int[] y = new int[] { 245118, 246031, 246551, 245619 }; np = new ZoneNPoly(x, y, -3727, -3727); } int count = int.Parse(alias.Split(' ')[2]); for (int i = 0; i < count; i++) { int[] rloc = this.rndXYZ(); // NpcTable.getInstance().spawnNpc("lector", rloc[0], rloc[1], rloc[3], new Random().Next(65000)); } } else if (s == "6") { L2Citizen npc = (L2Citizen)admin.CurrentTarget; if (npc.Template.DropData == null) { admin.sendMessage("no drops at this npc"); } else { npc.Template.DropData.showInfo(admin); } } else if (s == "7") { L2Citizen npc = (L2Citizen)admin.CurrentTarget; if (npc.Template.DropData == null) { admin.sendMessage("no drops at this npc"); } else { npc.Template.roll_drops(npc, admin); } } else if (s == "8") { L2Citizen npc = (L2Citizen)admin.CurrentTarget; if (npc.Template.DropData == null) { admin.sendMessage("no drops at this npc"); } else { npc.doDie(admin, false); npc.Template.roll_drops(npc, admin); } } else if (s == "9") { admin.destx = admin.X + 200; admin.desty = admin.Y + 200; admin.destz = admin.Z; admin.sendPacket(new CharMoveToLocation(admin)); } else if (s == "10") { InstanceManager.getInstance().create(1, admin); } else if (s == "11") { admin.Boat.destx = -121385; admin.Boat.desty = 261660; admin.Boat.destz = -3610; admin.Boat.OnRoute = true; admin.Boat.broadcastPacket(new VehicleStarted(admin.Boat.ObjID, 1)); admin.Boat.broadcastPacket(new VehicleDeparture(admin.Boat, 400, 1800)); } else if (s == "12") { L2Boat boat = new L2Boat(); boat.X = -96622; boat.Y = 261660; boat.Z = -3610; L2World.Instance.RealiseEntry(boat, null, true); boat.onSpawn(); } else if (s == "13") { MonsterRace.getInstance().startRace(); } else if (s == "17") { admin.Mount(NpcTable.getInstance().getNpcTemplate(13146)); } else if (s == "18") { int count = int.Parse(alias.Split(' ')[2]); TransformManager.getInstance().transformTo(count, admin, 30); } else if (s == "19") { admin.sstt = int.Parse(alias.Split(' ')[2]); admin.broadcastUserInfo(); } else if (s == "20") { int sx = int.Parse(alias.Split(' ')[2]); admin.broadcastPacket(new MagicSkillUse(admin, admin, sx, 1, 0)); } else if (s == "21") { int sx = int.Parse(alias.Split(' ')[2]); admin.broadcastPacket(new MagicSkillUse(admin, admin, 261, 1, 1000, sx)); adm = admin; if (t == null) { t = new System.Timers.Timer(); t.Elapsed += new System.Timers.ElapsedEventHandler(t_Elapsed); } t.Interval = 900; t.Enabled = true; } else if (s == "22") { adm = admin; L2Warrior war = (L2Warrior)NpcTable.getInstance().spawnNpc(21003, 14107, 182287, -3586, 32500); war.destx = 13107; war.desty = 182287; war.destz = -3586; admin.sendPacket(new CharMoveToLocation(war)); war.dtstart = DateTime.Now; admin.ChangeTarget(war); if (t == null) { t = new System.Timers.Timer(); t.Elapsed += new System.Timers.ElapsedEventHandler(t_Elapsed); } t.Interval = 2000 * 12; t.Enabled = true; } // admin._privateStoreType = byte.Parse(alias.Split(' ')[1]); // admin.broadcastUserInfo(); // int val = int.Parse(alias.Split(' ')[1]); // StatusUpdate su = new StatusUpdate(admin); // su.add(val, 5000); // admin.sendPacket(su); }
public override void run() { L2Player player = getClient().CurrentPlayer; if (player._p_block_act == 1) { player.sendActionFailed(); return; } L2Citizen npc; if (_alias.Equals("teleport_request")) { npc = getNpc(); if (npc == null) { player.sendActionFailed(); return; } npc.onTeleportRequest(player); } else if (_alias.StartsWith("menu_select?")) { npc = getNpc(); _alias = _alias.Replace(" ", ""); string x1 = _alias.Split('?')[1]; string[] x2 = x1.Split('&'); int ask = int.Parse(x2[0].Substring(4)); int reply; try { reply = int.Parse(x2[1].Substring(6)); } catch { reply = 0; } npc.onDialog(player, ask, reply); } else if (_alias.Equals("talk_select")) { npc = getNpc(); QuestManager.getInstance().talkSelection(player, npc); } else if (_alias.StartsWith("quest_accept?")) { npc = getNpc(); _alias = _alias.Replace(" ", ""); string x1 = _alias.Split('?')[1]; int qid = int.Parse(x1.Split('=')[1]); QuestManager.getInstance().questAccept(player, npc, qid); } else if (_alias.StartsWith("quest_continue?")) { npc = getNpc(); _alias = _alias.Replace(" ", ""); string x1 = _alias.Split('?')[1]; int qid = int.Parse(x1.Split('=')[1]); QuestManager.getInstance().quest_continue(player, npc, qid); } else if (_alias.StartsWith("quest_tryaccept?")) { npc = getNpc(); _alias = _alias.Replace(" ", ""); string x1 = _alias.Split('?')[1]; int qid = int.Parse(x1.Split('=')[1]); QuestManager.getInstance().quest_tryaccept(player, npc, qid); } else if (_alias.Equals("deposit")) { npc = getNpc(); npc.showPrivateWarehouse(player); } else if (_alias.Equals("withdraw")) { npc = getNpc(); npc.showPrivateWarehouseBack(player); } else if (_alias.Equals("deposit_pledge")) { npc = getNpc(); npc.showClanWarehouse(player); } else if (_alias.Equals("withdraw_pledge")) { npc = getNpc(); npc.showClanWarehouseBack(player); } else if (_alias.Equals("learn_skill")) { npc = getNpc(); npc.showSkillLearn(player, false); } else if (_alias.StartsWith("create_pledge?")) { npc = getNpc(); //bypass -h create_pledge?pledge_name= $pledge_name string x1 = _alias.Split('?')[1]; string name = x1.Split('=')[1]; name = name.Substring(1); grandmaster_total.createClan(player, name, npc); } else if (_alias.StartsWith("teleport_next?")) { npc = getNpc(); string x1 = _alias.Split('?')[1]; string[] x2 = x1.Split('&'); int ask = int.Parse(x2[0].Substring(4)); int reply = int.Parse(x2[1].Substring(6)); npc.UseTeleporter(player, ask, reply); } else if (_alias.StartsWith("petitionlink?")) { PetitionManager.getInstance().petitionlink(player, _alias.Split('?')[1]); } else if (_alias.StartsWith("_mr")) { npc = getNpc(); MonsterRace.getInstance().OnBypass(player, npc, _alias); } else { CLogger.warning("Unknown bypass '" + _alias + "'"); } }