So let me explain, i'm working on mob called Tabor he can be found in Spraggon Den. He spawn a Ghost of Tabor when he dies(and it work in my script) but i got problem with a check.
When his ghost is up, he should not respawn unless that ghost will be killed by a players.
Any ideas how i can improve my code?
Here is a fragment of my code:
- Code: Select all
public override void Die(GameObject killer) { GamePlayer player = killer as GamePlayer; if (killer is GamePlayer) { GameNPC mob = new GameNPC(); mob.X = player.X; mob.Y = player.Y; mob.Z = player.Z + 10; mob.CurrentRegion = player.CurrentRegion; mob.Heading = player.Heading; mob.Name = "Ghost of Tabor"; mob.GuildName = "Spirit of Tabor"; //mob.Flags = 4; mob.Level = 36; mob.Realm = 0; mob.Model = 127; mob.Strength = 400; mob.Constitution = 200; mob.Quickness = 80; mob.Dexterity = 80; mob.RoamingRange = 0; mob.MaxSpeedBase = 200; mob.Size = 120; mob.RespawnInterval = -1; mob.MaxDistance = 2000; mob.TetherRange = 1500; mob.SetOwnBrain(new GhostTaborBrain()); mob.AddToWorld(); } //The mob is killed by the killer base.Die(killer); bool canBossRespawn = false; foreach (GameNPC npc in GetNPCsInRadius((WorldMgr.VISIBILITY_DISTANCE))) { if (npc.Name == "Ghost of Tabor") { canBossRespawn = false; break; } else { canBossRespawn = true; } } }