public bool EnemyKilled(Enemy enemy, int exp, bool killer) { if (enemy == questEntity) { BroadcastSync(new Notification() { ObjectId = Id, Color = new ARGB(0xFF00FF00), Message = "{\"key\":\"server.quest_complete\"}" }, p => this.DistSqr(p) < RadiusSqr); } if (exp != 0) { if (Rank > 0) { exp = (int)(exp + (exp * 0.25)); } if (exp < ExperienceGoal) { Experience += exp; } else { exp -= (exp - ExperienceGoal) - 1; Experience += exp; } } FameCounter.Killed(enemy, killer); return(CheckLevelUp()); }
public bool EnemyKilled(Enemy enemy, int exp, bool killer) { var expm = wServer.logic.BehaviorDb.EXPmultipler; if (enemy == Quest) { Owner.BroadcastPacket(new NotificationPacket { ObjectId = Id, Color = new ARGB(0xFF00FF00), Text = "{\"key\":\"blank\",\"tokens\":{\"data\":\"World Quest Complete!\"}}", }, null); } if (exp > 0) { if (XpBoosted) { Experience += exp * 2 * expm; } else if (Client.Account.Rank == 1) { Experience += (exp + exp / 2) * expm; } else { Experience += exp * expm; } UpdateCount++; foreach (var i in Owner.PlayersCollision.HitTest(X, Y, 15).Where(i => i != this).OfType <Player>()) { try { i.Experience += i.XpBoosted ? exp * 2 * expm : exp * expm; i.UpdateCount++; i.CheckLevelUp(); if (Random.Next(1, 100000) <= 50) { Client.GiftCodeReceived("LevelUp"); } } catch// (Exception ex) { i.Experience += 0; i.UpdateCount++; //log.Error(ex); } } } FameCounter.Killed(enemy, killer); return(CheckLevelUp()); }
public bool EnemyKilled(Enemy enemy, int exp, bool killer) { if (enemy == questEntity) { BroadcastSync(new Notification() { ObjectId = Id, Color = new ARGB(0xFF00FF00), Message = "Quest Complete!" }, p => this.DistSqr(p) < RadiusSqr); } if (exp != 0) { Experience += exp; } FameCounter.Killed(enemy, killer); return(CheckLevelUp()); }
public bool EnemyKilled(Enemy enemy, int exp, bool killer) { if (enemy == Quest) { Owner.BroadcastPacket(new NotificationPacket { ObjectId = Id, Color = new ARGB(0xFF00FF00), Text = "{\"key\":\"blank\",\"tokens\":{\"data\":\"Quest Complete!\"}}", }, null); } if (exp > 0) { if (Donator || XpBoosted) { Experience += exp * 2; } else { Experience += exp; } UpdateCount++; foreach (var i in Owner.PlayersCollision.HitTest(X, Y, 16).Where(i => i != this).OfType <Player>()) { try { i.Experience += i.XpBoosted ? exp * 2 : exp; i.UpdateCount++; i.CheckLevelUp(); if (Random.Next(1, 100000) <= 50) { Client.GiftCodeReceived("LevelUp"); } } catch (Exception ex) { log.Error(ex); } } } FameCounter.Killed(enemy, killer); return(CheckLevelUp()); }
public bool EnemyKilled(Enemy enemy, int exp, bool killer) { if (enemy == questEntity) { BroadcastSync(new NotificationPacket() { ObjectId = Id, Color = new ARGB(0xFF00FF00), Text = "Quest Complete!" }, p => this.Dist(p) < 25); } if (exp != 0) { Experience += exp; UpdateCount++; } FameCounter.Killed(enemy, killer); return(CheckLevelUp()); }
public bool EnemyKilled(Enemy enemy, int exp, bool killer) { if (enemy == questEntity) { UpdateAccountXP(Client.Player, "Killed a Quest Enemy!", 25); BroadcastSync(new Notification() { ObjectId = Id, Color = new ARGB(0xFF00FF00), Message = "{\"key\":\"server.quest_complete\"}" }, p => this.DistSqr(p) < RadiusSqr); } if (exp != 0) { Experience += exp; } FameCounter.Killed(enemy, killer); return(CheckLevelUp()); }
public bool EnemyKilled(Enemy enemy, int exp, bool killer) { if (Level > 15 && enemy.Name == "XP Gift All") { return(false); } exp *= 2; if (enemy == Quest) { Owner.BroadcastPacket(new NotificationPacket { ObjectId = Id, Color = new ARGB(0xFF00FF00), Text = "{\"key\":\"blank\",\"tokens\":{\"data\":\"Quest Complete!\"}}" }, null); } if (exp > 0) { Experience += XpBoosted ? exp * 2 : exp; UpdateCount++; foreach (var i in Owner.PlayersCollision.HitTest(X, Y, 16).Where(i => i != this).OfType <Player>()) { try { i.Experience += i.XpBoosted ? exp * 2 : exp; i.UpdateCount++; i.CheckLevelUp(); } catch (Exception ex) { Console.WriteLine(ex); } } } FameCounter.Killed(enemy, killer); return(CheckLevelUp()); }
public bool EnemyKilled(Enemy enemy, int exp, bool killer) { if (enemy == Quest) { Owner.BroadcastMessage(new NOTIFICATION { ObjectId = Id, Color = new ARGB(0xFF00FF00), Text = "{\"key\":\"blank\",\"tokens\":{\"data\":\"Quest Complete!\"}}", }, null); } if (exp > 0) { if (XpBoosted) { Experience += (int)(exp * 2 * Settings.WOTMG_RATE); } else { Experience += (int)(exp * Settings.WOTMG_RATE); } UpdateCount++; foreach (var i in Owner.PlayersCollision.HitTest(X, Y, 16).Where(i => i != this).OfType <Player>()) { try { i.Experience += (int)((i.XpBoosted ? exp * 2 : exp) * Settings.WOTMG_RATE); i.UpdateCount++; i.CheckLevelUp(); } catch (Exception) { } } } FameCounter.Killed(enemy, killer); return(CheckLevelUp()); }
public bool EnemyKilled(Enemy enemy, int exp, bool killer) { var acc = Client.Account; var rnd = new Random(); var time = new RealmTime(); if (enemy == Quest) { BroadcastSync(new Notification { ObjectId = Id, Color = new ARGB(0xFF00FF00), Message = "{\"key\":\"server.quest_complete\"}" }, p => this.DistSqr(p) < RadiusSqr); } if (rnd.NextDouble() <= 0.0001) { Client.Manager.Database.UpdateAlertToken(acc, 1); AlertToken++; this.ForceUpdate(AlertToken); SendHelp("A challenge awaits you... Go to the Nexus to handle your alert!"); } if (enemy.ObjectDesc.Lootdrop) { if (rnd.NextDouble() <= 0.05) { Client.Manager.Database.UpdateGoldLootbox(acc, 1); GoldLootbox++; this.ForceUpdate(GoldLootbox); SendHelp("You have obtained a Gold Lootbox drop! Go to the Nexus to open it!"); } else if (rnd.NextDouble() <= 0.1) { Client.Manager.Database.UpdateSilverLootbox(acc, 1); SilverLoootbox++; this.ForceUpdate(SilverLoootbox); SendHelp("You have obtained a Silver Lootbox drop! Go to the Nexus to open it!"); } else if (rnd.NextDouble() <= 0.15) { Client.Manager.Database.UpdateBronzeLootbox(acc, 1); BronzeLootbox++; this.ForceUpdate(BronzeLootbox); SendHelp("You have obtained a Bronze Lootbox drop! Go to the Nexus to open it!"); } } if (enemy.ObjectDesc.Elitedrop && rnd.NextDouble() <= 0.6) { Client.Manager.Database.UpdateEliteLootbox(acc, 1); EliteLootbox++; this.ForceUpdate(EliteLootbox); SendHelp("You have obtained an Elite Lootbox drop! Go to the Nexus to open it!"); } if (enemy.ObjectDesc.ResetSS) { foreach (var player in Owner.Players.Values) { player.SupportScore = 0; } } if (enemy.ObjectDesc.UElitedrop) { Client.Manager.Database.UpdateEliteLootbox(acc, 1); EliteLootbox++; this.ForceUpdate(EliteLootbox); SendHelp("You have obtained an Elite Lootbox drop! Go to the Nexus to open it!"); } if (exp != 0) { foreach (var i in Owner.PlayersCollision.HitTest(X, Y, 16).Where(e => e is Player)) { Experience += exp; } } if (!HasConditionEffect(ConditionEffects.Exhausted)) { SurgeActivation(time); } FameCounter.Killed(enemy, killer); return(CheckLevelUp()); }