//spell 154 butchery public static async void butchery(Players player, float attack_time) { functions.turn_to_enemy(player, 0.1f, 0, 0, 3); string check_cond_id = player.get_symb_for_IDs(); float addCrit = player.is_invisible ? 3f : 2f; player.is_reset_any_button = true; for (float i = attack_time; i > 0; i -= 0.201f) { if (!player.is_casting_stopped_by_spells()) { functions.turn_to_enemy(player, 0.1f, 0, 0, 2.3f); player.set_condition(CondType.co, 154, check_cond_id, i); player.animation_id = 15; spells.make_splash_melee_damage(player, 154, 0, 1f, starter.standart_crit_koeff + addCrit, 0, 0, 0); } else { player.inform_of_cancel_casting(154, check_cond_id); break; } await Task.Delay(200); player.ActionForConditionByChekingIndex(ref i, attack_time, 154); } player.reset_animation_for_one(); player.remove_condition_in_player(check_cond_id); player.is_reset_any_button = false; }
//spell 107 make slower public static async void slow(Players player, float speed_decrease, float how_long) { float koef = 1f - speed_decrease; if (koef < 0) { return; } if (player.is_cond_here_by_type_and_spell(CondType.co, 107)) { return; } player.Speed *= koef; string ID = player.get_symb_for_IDs(); string condID = player.get_symb_for_IDs(); for (float i = how_long; i > 0; i -= 0.25f) { player.set_condition(CondType.co, 107, ID, i); player.make_slow(condID, i); await Task.Delay(250); player.ActionForConditionByChekingIndex(ref i, how_long, 107); } player.Speed /= koef; player.remove_condition_in_player(ID); player.remove_condition_in_player(condID); }
//spell 165 public static async void SmokeBomb(Players player) { float duration = 5f; player.animation_id = 2; player.reset_animation_for_one(); float _x = player.position_x; float _z = player.position_z; SmokeBombEffect(player, duration, _x, _z); string check_cond_strike_id = player.get_symb_for_IDs(); player.set_condition_CS_type(165, check_cond_strike_id, _x, _z); for (float i = duration; i > 0; i++) { //wait 1 second await Task.Delay(1000); player.ActionForConditionByChekingIndex(ref i, 0, 165); } player.remove_condition_in_player(check_cond_strike_id); player.CastEndCS(_x, _z, check_cond_strike_id, 165); }
//spell 210 public static async void RuneOfMagic(Players player) { float casting_time = SpellSystem.GetCastingTimeOfSpell(210); float duration = 10f; if (!spells.StartCastingProcess(player, 210, casting_time, SpellSystem.GetEnergyCostofSpell(210), false, 0, 0, 0).Result) { return; } float _x = player.position_x; float _z = player.position_z; RuneOfMagicEffect(player, duration, _x, _z); string check_cond_strike_id = player.get_symb_for_IDs(); player.set_condition_CS_type(210, check_cond_strike_id, _x, _z); for (float i = duration; i > 0; i++) { //wait 1 second await Task.Delay(1000); player.ActionForConditionByChekingIndex(ref i, 0, 210); } player.remove_condition_in_player(check_cond_strike_id); player.CastEndCS(_x, _z, check_cond_strike_id, 210); }
//spell 173 public static async void Paralysis(Players me, Players aim, float duration) { if (spells.isNegativeMagicCondAllreadyHere(me, aim, 173)) { return; } string enemyCondID = aim.get_symb_for_IDs(); string enemyFearID = aim.get_symb_for_IDs(); aim.animation_id = 0; for (float i = duration; i > 0; i -= starter.TICKf) { aim.animation_id = 0; aim.set_condition(CondType.co, 1003, enemyFearID, i); aim.set_condition(CondType.co, 173, enemyCondID, i); await Task.Delay(starter.TICKi); aim.ActionForConditionByChekingIndex(ref i, duration, 173); } aim.reset_animation_for_one(); aim.remove_condition_in_player(enemyCondID); aim.remove_condition_in_player(enemyFearID); }
//paralyzing hit 172 public static async void ParalyzingHit(Players player, Players enemy) { functions.turn_to_enemy(player, 0, 3, 0, 3); float addCrit = player.is_invisible ? 3f : 2f; spells.make_direct_melee_damage_exact_enemy(player, enemy, 172, 2, 1, starter.standart_crit_koeff + addCrit, 0.1f); float delay = 5f; float duration = 5f; string enemyCondID = enemy.get_symb_for_IDs(); for (float i = delay; i > 0; i -= starter.TICKf * 2) { enemy.set_condition(CondType.co, 172, enemyCondID, i); await Task.Delay(starter.TICKi *2); enemy.ActionForConditionByChekingIndex(ref i, 0, 172); } enemy.remove_condition_in_player(enemyCondID); if (!spells.if_resisted_magic(player, enemy)) { Paralysis(player, enemy, duration); } }
//59 public static async void freezing_slow(Players me, Players aim_player, float time_for_slow) { if (spells.isNegativeMagicCondAllreadyHere(me, aim_player, 59)) { return; } aim_player.Speed *= 0.6f; aim_player.Cast_speed *= 0.8f; string ID_cond = aim_player.get_symb_for_IDs(); string slow_ID_cond = aim_player.get_symb_for_IDs(); for (float i = time_for_slow; i > 0; i -= starter.TICKf * 2) { aim_player.set_condition(CondType.co, 59, ID_cond, i); aim_player.make_slow(slow_ID_cond, i); await Task.Delay(starter.TICKi *2); aim_player.ActionForConditionByChekingIndex(ref i, time_for_slow, 59); } aim_player.Speed /= 0.6f; aim_player.Cast_speed /= 0.8f; aim_player.remove_condition_in_player(ID_cond); }
public static async void HealthBoost(Players player, float time_ticks, float boost_koef, float regen_koef) { if (spells.isPositiveCondAllreadyHere(player, 3)) { return; } player.CurrentHealth = (int)(player.CurrentHealth * boost_koef); player.MaxHealth = (int)(player.MaxHealth * boost_koef); player.Health_regen += regen_koef; string ID = player.get_symb_for_IDs(); for (float i = time_ticks; i > 0; i -= 0.250f) { player.set_condition(CondType.co, 3, ID, i); await Task.Delay(250); player.ActionForConditionByChekingIndex(ref i, time_ticks, 3); } player.remove_condition_in_player(ID); player.CurrentHealth = (int)(player.CurrentHealth / boost_koef); player.MaxHealth = (int)(player.MaxHealth / boost_koef); player.Health_regen /= regen_koef; }
//earth armor 63 public static async void earth_armor(Players player, float how_long) { if (spells.isPositiveCondAllreadyHere(player, 63)) { return; } float base_armor = 500f; float base_speed = 0.7f; float base_cast_speed = 20f; //Players player = functions.GetPlayerData(table_id, me); player.Armor += base_armor; player.Speed *= base_speed; player.Cast_speed -= base_cast_speed; player.animation_id = 2; player.reset_animation_for_one(); string ID_cond = player.get_symb_for_IDs(); for (float i = how_long; i > 0; i -= 0.2f) { player.set_condition(CondType.co, 63, ID_cond, i); await Task.Delay(200); player.ActionForConditionByChekingIndex(ref i, how_long, 63); } player.Armor -= base_armor; player.Speed /= base_speed; player.Cast_speed += base_cast_speed; player.remove_condition_in_player(ID_cond); }
//shield ON public static async void shield_on(Players pl, float shield_on_time) { functions.turn_to_enemy(pl, 0.1f, 20, 15, 20); pl.animation_id = 10; float current_shield_block = pl.Shield_block; pl.start_spell_in_process(); pl.is_reset_movement_not_rotation = true; pl.Shield_block = 100; //pl.speed *= 0.3f; string check_cond_id = pl.get_symb_for_IDs(); for (float i = shield_on_time; i > 0; i -= starter.TICKf * 2) { pl.animation_id = 10; pl.Shield_block = 100; pl.set_condition(CondType.co, 5, check_cond_id, i); pl.ActionForConditionByChekingIndex(ref i, shield_on_time, 5); await Task.Delay(starter.TICKi *2); } pl.remove_condition_in_player(check_cond_id); pl.reset_animation_for_one(); pl.Shield_block = current_shield_block; pl.stop_spell_in_process(); pl.is_reset_movement_not_rotation = false; //pl.speed /= 0.3f; }
//burning 57 public static async void burning(Players me, Players player) { if (spells.isNegativeMagicCondAllreadyHere(me, player, 57)) { return; } string ID_cond = player.get_symb_for_IDs(); for (float i = 10; i > 0; i -= 0.2f) { player.set_condition(CondType.co, 57, ID_cond, i); if (Math.Round(i, 2) == Math.Truncate(i) && Math.Round(i, 2) % 2 != 0) { spells.make_direct_magic_damage_exact_enemy(me, player, 57, 0, 0.2f, starter.standart_crit_koeff); } await Task.Delay(200); player.ActionForConditionByChekingIndex(ref i, 10f, 57); } player.remove_condition_in_player(ID_cond); }
//168 poison antiheal public static async void Apply_Poison_Antiheal(Players attacker, Players aim) { if (spells.isNegativeMagicCondAllreadyHere(attacker, aim, 168)) { string ID = aim.get_id_by_type_and_spell(CondType.co, 168); if (ID == null) { return; } if (aim.conditions[ID].GetCurrentStacks() < 5) { aim.conditions[ID].SetStackbyAddingValue(1); } return; } float duration = 5f; int currentStack = 1; int new_Stacks = 0; string condID = aim.get_symb_for_IDs(); float effectPerStack = 0.04f; aim.TakingHealingFromOthersKoeff *= (1f - effectPerStack); for (float i = duration; i > 0; i -= starter.TICKf * 2) { if (aim.conditions.ContainsKey(condID)) { new_Stacks = aim.conditions[condID].GetCurrentStacks(); } if (new_Stacks > currentStack) { int delta = new_Stacks - currentStack; aim.TakingHealingFromOthersKoeff /= (1f - effectPerStack * currentStack); currentStack += delta; aim.TakingHealingFromOthersKoeff *= (1f - effectPerStack * currentStack); } else { new_Stacks = currentStack; } aim.set_condition(CondType.co, 168, condID, i, currentStack); await Task.Delay(starter.TICKi *2); aim.ActionForConditionByChekingIndex(ref i, duration, 168); } aim.remove_condition_in_player(condID); aim.TakingHealingFromOthersKoeff /= (1f - effectPerStack * currentStack); }
//fire armor 61 public static async void fire_armor(Players player, float how_long) { if (spells.isPositiveCondAllreadyHere(player, 61)) { return; } float base_armor = 300f; player.Armor += base_armor; player.animation_id = 2; player.reset_animation_for_one(); string ID_cond = player.get_symb_for_IDs(); for (float i = how_long; i > 0; i -= 0.2f) { try { foreach (var searched_ID in player.conditions) { if (player.conditions[searched_ID.Key].GetDataForPacketSending().Contains("dt")) { int _spell = player.conditions[searched_ID.Key].GetCurrentSpellNumber(); if ((SpellSystem.GetSpellMainPurpose(_spell) == SpellMainPurpose.making_damage_close || SpellSystem.GetSpellMainPurpose(_spell) == SpellMainPurpose.making_damage_close_after_close_up) && SpellSystem.GetSpellCategory(_spell) == SpellTypeCategory.physical) { foreach (Players pl in starter.SessionsPool[player.Session_ID].LocalPlayersPool.Values) { if (pl.conditions.ContainsKey(searched_ID.Key) && pl.player_id != player.player_id) { if (!pl.is_cond_here_by_type_and_spell(CondType.co, 57)) { burning(player, pl); } } } } } } } catch (Exception ex) { Console.WriteLine(DateTime.Now + ": error in making somebody burning when strike fire armor - spell61" + ex); } player.set_condition(CondType.co, 61, ID_cond, i); await Task.Delay(200); player.ActionForConditionByChekingIndex(ref i, how_long, 61); } player.Armor -= base_armor; player.remove_condition_in_player(ID_cond); }
//spell 203 public static async void answer_attack_shield(Players player, float how_long_shield, float how_long_knock) { if (spells.isPositiveCondAllreadyHere(player, 203)) { return; } string check_cond_id2 = player.get_symb_for_IDs(); player.is_immune_to_magic = true; player.is_immune_to_melee = true; player.animation_id = 2; player.reset_animation_for_one(); Players enemy = null; float damage = 0; for (float i = how_long_shield; i > 0; i -= starter.TICKf * 2) { player.set_condition(CondType.co, 203, check_cond_id2, i); try { foreach (string keys in player.conditions.Keys) { if (player.conditions[keys].AmountOfimmunedDamage > 0) { enemy = player.get_another_player_by_id_in_conds(keys, player.Session_ID); damage = player.conditions[keys].AmountOfimmunedDamage; Console.WriteLine(" - " + player.conditions[keys].AmountOfimmunedDamage); } } } catch (Exception ex) { Console.WriteLine(ex); } if (enemy != null) { spells.direct_impose_damage(player, enemy, 203, damage, 1); spells.fall_down_get_app(enemy, how_long_knock); break; } await Task.Delay(starter.TICKi *2); player.ActionForConditionByChekingIndex(ref i, how_long_shield, 203); } player.is_immune_to_magic = false; player.is_immune_to_melee = false; player.remove_condition_in_player(check_cond_id2); }
//spell 206 void zone public static async void frost_zone(Players player, float how_long, float groth_koeff, float radius, float power_koef) { float distance = SpellSystem.GetDistanceofApplyingSpell(206); functions.turn_to_enemy(player, 0.1f, distance, 0, distance); Players aim = functions.get_one_nearest_enemy_inmelee(player, distance, 0, false); player.animation_id = 2; player.reset_animation_for_one(); float coord_x, coord_z; if (aim == null) { coord_x = player.position_x; coord_z = player.position_z; } else { coord_x = aim.position_x; coord_z = aim.position_z; } string ID_for_cs = player.get_symb_for_IDs(); player.set_condition_CS_type(206, ID_for_cs, coord_x, coord_z); float koef = power_koef; for (float u = how_long; u > 0; u -= 0.2f) { List <Players> aims = functions.get_all_nearest_enemy_inradius(coord_x, coord_z, player, radius); if (aims.Count > 0) { //Console.WriteLine(player.spell_power / (4f * how_long) * koef / player.spell_power); for (int i = 0; i < aims.Count; i++) { if (functions.assess_chance(20)) { elementalist.freezing_slow(player, aims[i], 2f); } spells.make_direct_magic_damage_exact_enemy(player, aims[i], 206, 0, (player.Spell_power / (4f * how_long) * koef / player.Spell_power), 1.5f); } } await Task.Delay(200); koef = koef + groth_koeff; player.ActionForConditionByChekingIndex(ref u, how_long, 206); } player.CastEndCS(coord_x, coord_z, ID_for_cs, 206); }
//spell 108 public static async void breakthrough(Players player) { float distance = SpellSystem.GetDistanceofApplyingSpell(108); string cond_ID = player.get_symb_for_IDs(); player.animation_id = 25; functions.turn_to_enemy(player, 0.1f, distance, 0, distance); player.is_reset_any_button = true; float[] new_pos_rot = new float[] { player.position_x, 0, player.position_z, 0, player.rotation_y, 0 }; List <Players> aims = new List <Players>(); for (float i = 0.7f; i > 0; i -= starter.TICKf) { if (player.is_casting_stopped_by_spells()) { break; } player.set_condition(CondType.co, 108, cond_ID, i); functions.mover(ref new_pos_rot, 0, 12, 1f, player.zone_type); player.position_x = new_pos_rot[0]; player.position_z = new_pos_rot[2]; player.rotation_y = new_pos_rot[4]; List <Players> pre_aims = functions.get_all_nearest_enemy_inradius(player.position_x, player.position_z, player, 0.75f); for (int ii = 0; ii < pre_aims.Count; ii++) { if (!aims.Contains(pre_aims[ii])) { if (!spells.if_resisted_nonmagic(player, pre_aims[ii])) { spells.fall_down_get_app(pre_aims[ii], 0.5f); spells.pooling_ver2(player, pre_aims[ii], 8, 1, 0); } aims.Add(pre_aims[ii]); } } await Task.Delay(starter.TICKi); player.ActionForConditionByChekingIndex(ref i, 0.7f, 108); } player.is_reset_any_button = false; player.remove_condition_in_player(cond_ID); player.reset_animation_for_one(); }
//spell 204 public static async void auto_heal(Players player, float how_long, float heal_amount, int energy_cost) { player.animation_id = 2; player.reset_animation_for_one(); if (spells.isPositiveCondAllreadyHere(player, 204)) { return; } player.is_immune_to_melee = true; float casting_time = SpellSystem.GetCastingTimeOfSpell(204); int spell_id = 204; if (!spells.StartCastingProcess(player, spell_id, casting_time, energy_cost, false, 0, 0, 0).Result) { return; } string check_cond_id2 = player.get_symb_for_IDs(); HashSet <string> ids = new HashSet <string>(); Dictionary <string, string> conds = new Dictionary <string, string>(); int stacks = 0; for (float i = how_long; i > 0; i -= starter.TICKf * 2) { player.set_condition(CondType.co, 204, check_cond_id2, i, stacks); if (player.is_cond_here_by_type(CondType.dt) && !ids.Contains(player.get_id_by_type(CondType.dt))) { ids.Add(player.get_id_by_type(CondType.dt)); spells.healing(player, player, 204, heal_amount, 1, starter.standart_crit_koeff); stacks++; } if (stacks > 5) { break; } await Task.Delay(starter.TICKi *2); player.ActionForConditionByChekingIndex(ref i, how_long, 204); } player.remove_condition_in_player(check_cond_id2); player.is_immune_to_melee = false; }
//spell 205 condition public static async void curse_of_casting(Players me, Players aim_player, float how_long) { if (spells.isNegativeMagicCondAllreadyHere(me, aim_player, 205)) { return; } float energy_level = aim_player.Energy; int stacks = 0; string cond_id = aim_player.get_symb_for_IDs(); HashSet <string> AllreadyUsed = new HashSet <string>(); for (float i = how_long; i > 0; i -= starter.TICKf * 2) { if (aim_player.is_cond_here_by_type(CondType.dg)) { foreach (string _key in aim_player.conditions.Keys) { if (AllreadyUsed.Contains(_key)) { break; } if (aim_player.conditions[_key].GetCurrentConditionType() == CondType.dg && aim_player.conditions[_key].GetDamageOrHealApplied() > 0) { AllreadyUsed.Add(_key); stacks++; spells.make_direct_magic_damage_exact_enemy(me, aim_player, 205, 0, stacks / 5f, 2); break; } } } if (stacks == 5) { break; } aim_player.set_condition(CondType.co, 205, cond_id, i, stacks); await Task.Delay(starter.TICKi *2); aim_player.ActionForConditionByChekingIndex(ref i, how_long, 205); } aim_player.remove_condition_in_player(cond_id); }
//spell 112 public static async void PointOfForce(Players player) { float distance = SpellSystem.GetDistanceofApplyingSpell(112); functions.turn_to_enemy(player, 0.1f, distance, 0, distance); float duration = 10f; player.animation_id = 2; player.reset_animation_for_one(); float _x = player.position_x; float _z = player.position_z; Players enemy = functions.get_one_nearest_enemy_inmelee(player, distance - starter.def_hit_melee_dist, 0, false); if (enemy != null) { _x = enemy.position_x; _z = enemy.position_z; List <Players> all_enemies = functions.get_all_nearest_enemy_inradius(_x, _z, player, 3); if (all_enemies.Count > 0) { for (int i = 0; i < all_enemies.Count; i++) { spells.make_direct_melee_damage_exact_enemy(player, all_enemies[i], 112, 0, 1, starter.standart_crit_koeff, 0); } } } PointOfForceEffect(player, duration, _x, _z); string check_cond_strike_id = player.get_symb_for_IDs(); player.set_condition_CS_type(112, check_cond_strike_id, _x, _z); for (float i = duration; i > 0; i++) { //wait 1 second await Task.Delay(1000); player.ActionForConditionByChekingIndex(ref i, 0, 112); } player.remove_condition_in_player(check_cond_strike_id); player.CastEndCS(_x, _z, check_cond_strike_id, 112); }
//make stun for 110 public async static void MakeStun(Players aim, float duration, int spell_id) { string stun_ID = aim.get_symb_for_IDs(); string cond_ID = aim.get_symb_for_IDs(); for (float i = duration; i > 0; i -= starter.TICKf * 2) { aim.make_stun(stun_ID, i); aim.set_condition(CondType.co, spell_id, cond_ID, i); await Task.Delay(starter.TICKi *2); aim.ActionForConditionByChekingIndex(ref i, duration, spell_id); } aim.remove_condition_in_player(stun_ID); aim.remove_condition_in_player(cond_ID); aim.reset_animation_for_one(); }
//spell 216 public static async void Polymorp(Players player, Players aim, float duration) { int spell_id = 216; if (spells.isNegativeMagicCondAllreadyHere(player, aim, spell_id)) { return; } string id_condition = aim.get_symb_for_IDs(); string id_fear = aim.get_symb_for_IDs(); aim.make_broken_casting(); float deltaH = 10f / aim.Health_regen; float deltaE = 10f / aim.Energy_regen; aim.Health_regen *= deltaH; aim.Energy_regen *= deltaE; for (float i = duration; i > 0; i -= starter.TICKf * 2) { aim.is_reset_any_button = true; aim.set_condition(CondType.co, 216, id_condition, i); aim.make_fear(id_fear, i); if (aim.what_damage_or_heal_received_analysis(CondType.dt) > 0) { break; } await Task.Delay(starter.TICKi *2); aim.ActionForConditionByChekingIndex(ref i, duration, spell_id); } aim.Health_regen /= deltaH; aim.Energy_regen /= deltaE; aim.is_reset_any_button = false; aim.remove_condition_in_player(id_condition); aim.remove_condition_in_player(id_fear); aim.reset_animation_for_one(); }
//freezed any spell public static async void freezed(Players me, Players player, float time) { //Players player = functions.GetPlayerData(table_id, enemy); float chance_to_break_after_hit_received = 20; if (spells.isNegativeMagicCondAllreadyHere(me, player, 58)) { return; } string check_cond_id = player.get_symb_for_IDs(); string conds_id = player.get_symb_for_IDs(); for (float i = time; i > 0; i -= starter.TICKf * 2) { player.set_condition(CondType.co, 58, check_cond_id, i); player.make_immob(conds_id, i); //breaking the ice immovement if (player.what_damage_or_heal_received_analysis(CondType.dt) > 0 && i <= (time - 0.3f)) { if (functions.assess_chance(chance_to_break_after_hit_received)) { player.inform_of_cancel_casting(58, check_cond_id); break; } } if (player.is_immune_to_movement_imparing) { break; } await Task.Delay(starter.TICKi *2); player.ActionForConditionByChekingIndex(ref i, time, 58); } player.remove_condition_in_player(check_cond_id); player.remove_condition_in_player(conds_id); }
//step to the back spell 155 public static async void step(Players player, Players enemy) { string check_cond_strike_id = player.get_symb_for_IDs(); float[] res = new float[] { enemy.position_x, 0, enemy.position_z, 0, enemy.rotation_y, 0 }; functions.mover(ref res, 0, -6, 2, player.zone_type); player.position_x = res[0]; player.position_z = res[2]; player.remove_condition_in_player(check_cond_strike_id); await Task.Delay(100); check_cond_strike_id = player.get_symb_for_IDs(); player.remove_condition_in_player(check_cond_strike_id); bool isSlowed = false; if (!enemy.is_immune_to_movement_imparing) { isSlowed = true; enemy.Speed *= 0.4f; } player.rotation_y = enemy.rotation_y; float new_enemy_angle = enemy.rotation_y; check_cond_strike_id = enemy.get_symb_for_IDs(); for (float i = 2; i > 0; i -= starter.TICKf * 2) { enemy.rotation_y = new_enemy_angle; enemy.set_condition(CondType.co, 155, check_cond_strike_id, i); await Task.Delay(starter.TICKi *2); enemy.ActionForConditionByChekingIndex(ref i, 2, 155); } enemy.remove_condition_in_player(check_cond_strike_id); if (isSlowed) { enemy.Speed /= 0.4f; } }
//spell 8 BLEEDING and SLOW=================== public static async void bleeding_spell8(float time_ticks, Players player, Players enemy, int spell_number, float att_pow_koef) { functions.turn_face_to_face(player, enemy); player.animation_id = 2; player.reset_animation_for_one(); if (spells.isNegativeMeleeCondAllreadyHere(player, enemy, spell_number)) { return; } string id_condition = player.get_symb_for_IDs(); enemy.Speed *= 0.4f; for (float i = time_ticks; i > 0; i -= 0.25f) { enemy.set_condition(CondType.co, spell_number, id_condition, i); if (Math.Round(i, 2) == Math.Truncate(i) && Math.Round(i, 2) % 2 != 0) { float prev_dodge = enemy.Dodge; float prev_shieldbl = enemy.Shield_block; //enemy.armor = 0; enemy.Dodge = 0; enemy.Shield_block = 0; spells.melee_damage(player, enemy, spell_number, att_pow_koef, 2); //enemy.armor = prev_armor; enemy.Dodge = prev_dodge; enemy.Shield_block = prev_shieldbl; } enemy.ActionForConditionByChekingIndex(ref i, time_ticks, spell_number); await Task.Delay(250); } enemy.Speed /= 0.4f; enemy.remove_condition_in_player(id_condition); }
//air armor 62 public static async void air_armor(Players player, float how_long) { if (spells.isPositiveCondAllreadyHere(player, 61)) { return; } float base_armor = 100f; float base_speed = 1.2f; float base_cast_speed = 20f; player.Armor += base_armor; player.Speed *= base_speed; player.Cast_speed += base_cast_speed; player.animation_id = 2; player.reset_animation_for_one(); string ID_cond = player.get_symb_for_IDs(); for (float i = how_long; i > 0; i -= 0.2f) { player.set_condition(CondType.co, 62, ID_cond, i); /* * if (player.is_stop_all_condition_by_checking_index(62)) * { * break; * } */ await Task.Delay(200); player.ActionForConditionByChekingIndex(ref i, how_long, 62); } player.Armor -= base_armor; player.Speed /= base_speed; player.Cast_speed -= base_cast_speed; player.remove_condition_in_player(ID_cond); }
//block prep 104 public static async void block_prep(Players player, float block_time) { //Players player = functions.GetPlayerData(table_id, me); string check_cond_id = player.get_symb_for_IDs(); string check_immob_id = player.get_symb_for_IDs(); player.Shield_block += 50; player.start_spell_in_process(); player.is_reset_movement_not_rotation = true; for (float i = block_time; i > 0; i -= 0.25f) { if (!player.is_casting_stopped_by_spells()) { player.set_condition(CondType.co, 104, check_cond_id, i); player.animation_id = 10; if (player.is_cond_here_by_type(CondType.me_b)) { barbarian_melee_hit(player); } } else { break; } await Task.Delay(250); player.ActionForConditionByChekingIndex(ref i, block_time, 104); } player.Shield_block -= 50; player.reset_animation_for_one(); player.remove_condition_in_player(check_cond_id); player.remove_condition_in_player(check_immob_id); player.stop_spell_in_process(); player.is_reset_movement_not_rotation = false; }
//invizibility 157 and 174 public static async void from_inviz_to_viz(Players player) { player.is_invisible = false; string check_cond_strike_id = player.get_symb_for_IDs(); float cooldown = SpellSystem.GetSpellCoolDownTime(174); player.set_condition(CondType.co, 157, check_cond_strike_id, 0); player.remove_condition_in_player(player.get_id_by_type_and_spell(CondType.co, 153)); player.remove_condition_in_player(check_cond_strike_id); string id_cond_stop_invis = player.get_symb_for_IDs(); for (float i = cooldown; i > 0; i--) { player.set_condition(CondType.co, 174, id_cond_stop_invis, i); await Task.Delay(1000); player.ActionForConditionByChekingIndex(ref i, 0, 174); } player.remove_condition_in_player(id_cond_stop_invis); }
//spell 109 armor crack public static async void armor_crack(Players player, float time_for_armor_crack) { Players enemy = functions.get_one_nearest_enemy_inmelee(player, 0.5f, 0, false); spells.make_direct_melee_damage(player, 109, 11, 1, starter.standart_crit_koeff, 0.2f); await Task.Delay(200); if (enemy != null) { if (spells.isNegativeMeleeCondAllreadyHere(player, enemy, 109)) { return; } string ID_for_cond = enemy.get_symb_for_IDs(); enemy.Armor *= 0.5f; for (float i = time_for_armor_crack; i > 0; i -= 0.25f) { enemy.set_condition(CondType.co, 109, ID_for_cond, i); /* * if (enemy.is_stop_all_condition_by_checking_index(109)) * { * break; * } */ await Task.Delay(250); enemy.ActionForConditionByChekingIndex(ref i, time_for_armor_crack, 109); } enemy.Armor /= 0.5f; enemy.remove_condition_in_player(ID_for_cond); } }
//spell 213 public static async void DrainEnergyEffect(Players player, Players aim, float duration) { int spell_number = 213; const float DELTA_DRAIN = 5f; if (spells.isNegativeMagicCondAllreadyHere(player, aim, spell_number)) { return; } string id_condition = aim.get_symb_for_IDs(); for (float i = duration; i > 0; i -= 0.250f) { aim.set_condition(CondType.co, spell_number, id_condition, i); if (Math.Round(i, 2) == Math.Truncate(i) && Math.Round(i, 2) % 2 != 0) { if (aim.Energy > DELTA_DRAIN) { aim.Energy -= DELTA_DRAIN; spells.make_direct_magic_damage_exact_enemy(player, aim, spell_number, 0, 1, starter.standart_crit_koeff); } else { break; } } await Task.Delay(250); aim.ActionForConditionByChekingIndex(ref i, duration, spell_number); } aim.remove_condition_in_player(id_condition); }
//pistol shot 156 public static async void pistol_shot(Players player) { float shot_distance = SpellSystem.GetDistanceofApplyingSpell(156); float time_for_aiming = 2f; string check_cond_id = player.get_symb_for_IDs(); string check_immob_id = player.get_symb_for_IDs(); string check_cond_strike_id = player.get_symb_for_IDs(); player.start_spell_in_process(); bool isShooted = false; float[] bullet_pos_for_assess = new float[2]; for (float i = time_for_aiming; i > 0; i -= starter.TICKf * 2) { if (!player.is_casting_stopped_by_spells()) { player.make_immob(check_immob_id, i); player.set_condition(CondType.ca, 156, check_cond_id, i); functions.turn_to_enemy(player, 0.1f, shot_distance, -10, shot_distance); if (i > 0.5f) { player.animation_id = 20; //raise gun } else { player.animation_id = 21; //make shot if (!isShooted) { isShooted = true; float pos_x = player.position_x; float pos_z = player.position_z; float rot_y = player.rotation_y; List <Players> candidates = player.GetAllPlayersInList(); for (int c = 0; c < candidates.Count; c++) { if (candidates[c].player_id == player.player_id || candidates[c].team_id == player.team_id) { candidates.Remove(candidates[c]); } } bool isFound = false; for (float d = 0; d < shot_distance; d += 0.2f) { functions.projection(ref bullet_pos_for_assess, pos_x, pos_z, rot_y, d, player.zone_type); for (int c = 0; c < candidates.Count; c++) { if (functions.vector3_distance_unity(bullet_pos_for_assess[0], 0, bullet_pos_for_assess[1], candidates[c].position_x, 0, candidates[c].position_z) < 0.25f) { spells.melee_damage(player, candidates[c], 156, 7, starter.standart_crit_koeff + 0.5f); player.set_condition_CS_type(156, check_cond_strike_id, candidates[c].position_x, candidates[c].position_z); player.remove_condition_in_player(check_cond_strike_id); isFound = true; break; } } if (isFound) { break; } } if (!isFound) { player.set_condition_CS_type(156, check_cond_strike_id, bullet_pos_for_assess[0], bullet_pos_for_assess[1]); player.remove_condition_in_player(check_cond_strike_id); } else { break; } } } } else { player.inform_of_cancel_casting(156, check_cond_id); break; } await Task.Delay(starter.TICKi *2); player.ActionForConditionByChekingIndex(ref i, time_for_aiming, 156); } await Task.Delay(400); player.remove_condition_in_player(check_cond_id); player.remove_condition_in_player(check_immob_id); player.stop_spell_in_process(); player.reset_animation_for_one(); }