public void POPSLAVE(byte iLevel,string stName,ushort iModel) { MOB1 = new WhriaMob(); Random r = new Random(); MOB1.X = X + r.Next(-100,100); MOB1.Y = Y + r.Next(-100, 100); MOB1.Z = Z + r.Next(-100, 100); MOB1.CurrentRegion = CurrentRegion; MOB1.Heading = 3340; MOB1.Level = iLevel; MOB1.Realm = 0; if (stName == "") MOB1.Name = "Slave"; else MOB1.Name = stName; MOB1.Model = iModel; MOB1.Size = 50; MOB1.CurrentSpeed = 0; MOB1.MaxSpeedBase = 300; if (MOB1.Name.Contains("fast")) MOB1.MaxSpeedBase = 500; // MOB1.SetControlledBrain((IControlledBrain)(this.Brain)); MOB1.GuildName = ""; MOB1.RespawnInterval = -1; popbrain = new WhriaMobBrain(); popbrain.isSlave = true; popbrain.AggroLevel = 100; popbrain.AggroRange = 3500; MOB1.SetOwnBrain(popbrain); MOB1.AddToWorld(); }
public override bool AddToWorld() { if (base.AddToWorld()) { string stQuery = "(`Mob_Name` = '" + GameServer.Database.Escape(this.Name) + "')"; stQuery = stQuery + " OR (`Mob_Name` = 'level" + Math.Truncate((double)(this.Level / 10)) + "0')"; stQuery = stQuery + " OR (`Mob_Name` = '" + GameServer.Database.Escape(this.GuildName) + "')"; string stBodyType; switch (this.BodyType) { case 1: stBodyType = "Animal"; break; case 2: stBodyType = "Demon"; break; case 3: stBodyType = "Dragon"; break; case 4: stBodyType = "Elemental"; break; case 5: stBodyType = "Giant"; break; case 6: stBodyType = "Humanoid"; break; case 7: stBodyType = "Insect"; break; case 8: stBodyType = "Magical"; break; case 9: stBodyType = "Reptile"; break; case 10: stBodyType = "Plant"; break; case 11: stBodyType = "Undead"; break; default: stBodyType = ""; break; } if (stBodyType!="") stQuery = stQuery + " OR (`Mob_Name` LIKE '" + stBodyType + "')"; stQuery = stQuery + " OR (`Mob_Name` LIKE '" + GameServer.Database.Escape(this.CurrentRegion.Name) + "')"; MobSkills = GameServer.Database.SelectObjects<DBMobSkill>(stQuery); MobStyles = GameServer.Database.SelectObjects<DBMobStyle>(stQuery); if ((this.Brain is WhriaMobBrain) == false) { if (this.Brain is StandardMobBrain) { m_ownBrain = new WhriaMobBrain { AggroLevel = ((StandardMobBrain)Brain).AggroLevel, AggroRange = ((StandardMobBrain)Brain).AggroRange }; SetOwnBrain(m_ownBrain); } else { SetOwnBrain(new WhriaMobBrain()); } } return true; } return false; }