From 5d7eef00fd5763ca05bfbc787ba68927bd463789 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sat, 25 May 2024 19:05:38 -0500 Subject: [PATCH 01/28] Special Moves This is the 12 AOS abilites that are in the book on the paperdoll. --- data/js/combat/blockequip.js | 20 + data/js/combat/special_moves.js | 644 +++++++++++++++++++++++++++++++ data/js/jse_fileassociations.scp | 2 + data/js/server/global.js | 12 + source/Changelog.txt | 5 + source/cChar.cpp | 38 ++ 6 files changed, 721 insertions(+) create mode 100644 data/js/combat/blockequip.js create mode 100644 data/js/combat/special_moves.js diff --git a/data/js/combat/blockequip.js b/data/js/combat/blockequip.js new file mode 100644 index 000000000..6241b6ea5 --- /dev/null +++ b/data/js/combat/blockequip.js @@ -0,0 +1,20 @@ +function onEquipAttempt( pEquipper, iEquipped ) +{ + var blockEquip = pEquipper.GetTempTag( "BlockEquip" ); + if( blockEquip == true ) + { + iEquipped.SetTempTag( "charSer", pEquipper.serial.toString() ); + iEquipped.StartTimer( 10 ,1, true ); + return false; + } + + return true; +} + +function onTimer( timerObj, timerID ) +{ + var mChar = CalcCharFromSer(parseInt( timerObj.GetTempTag( "charSer" ))) + timerObj.container = mChar.pack; + timerObj.Refresh(); + timerObj.SetTempTag( "charSer", null ); +} \ No newline at end of file diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js new file mode 100644 index 000000000..a14499824 --- /dev/null +++ b/data/js/combat/special_moves.js @@ -0,0 +1,644 @@ +function onSpecialMove(pUser, abilityID) +{ + /*switch (abilityID) + { + case 0x01: // Armor Ignore + HandleArmorIgnore(pUser, abilityID); + break; + case 0x05:// Disarm + HandleDisarm(pUser, abilityID); + break; + case 0x06:// Dismount + HandleDismount(pUser, abilityID); + break; + case 0x0C:// ShadowStrike + HandleShadowStrike(pUser, abilityID); + break; + case 0x0B:// Paralyzing Blow + HandleParalyzingBlow(pUser, abilityID); + break; + default: + break; + }*/ + + pUser.TextMessage("I'm activating ability #" + abilityID); + pUser.SetTempTag("abilityID", abilityID); + //pUser.StartTimer(5000, abilityID, true); + return true; + + //The rest of the AOS Abilites before any other expansions + //Mortal Strike + //Infectious Strike + //Double Strike + //Bleed Attack + //Whirlwind Attack +} + +// Define the checkSkillRequirement function outside RequiredSkill +function checkSkillRequirement(pUser, requiredSkillLevel, requiredSkill, skillMessage) +{ + if (pUser.skills[requiredSkill] < requiredSkillLevel) + { + pUser.SysMessage("You need " + skillMessage + " weapon skill to perform that attack"); + return false; + } + return true; +} + +// Define the RequiredSkill function +function RequiredSkill(pUser, abilityID) +{ + // Define weapon types and their skill requirements and if primary or secondary ability + var weaponTypes = { + "0x0DF0": { primary: 0, secondary: 11, reqSkill: 41, skillMsg: "mace fighting" }, + "0x0DF1": { primary: 0, secondary: 11, reqSkill: 41, skillMsg: "mace fighting" }, // Black Staves // WhirlwindAttack, ParalyzingBlow + + "0x0DF2": { primary: 6, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, + "0x0DF3": { primary: 6, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, + "0x0DF4": { primary: 6, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, + "0x0DF5": { primary: 6, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, // wands // Dismount, Disarm + + "0x0E81": { primary: 0, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, + "0x0E82": { primary: 0, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, // Shepherd's Crooks // CrushingBlow, Disarm + + "0x0e85": { primary: 0, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0e86": { primary: 0, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, // pickaxe // DoubleStrike, Disarm + + "0x0E87": { primary: 0, secondary: 6, reqSkill: 41, skillMsg: "mace fighting" }, + "0x0E88": { primary: 0, secondary: 6, reqSkill: 41, skillMsg: "mace fighting" }, // Pitchforks // BleedAttack, Dismount + + "0x0E89": { primary: 0, secondary: 0, reqSkill: 41, skillMsg: "mace fighting" }, + "0x0E8A": { primary: 0, secondary: 0, reqSkill: 41, skillMsg: "mace fighting" }, // Quarter Staves // DoubleStrike, ConcussionBlow + + "0x0EC2": { primary: 0, secondary: 0, reqSkill: 41, skillMsg: "mace fighting" }, + "0x0EC3": { primary: 0, secondary: 0, reqSkill: 41, skillMsg: "mace fighting" }, // Cleavers // BleedAttack, InfectiousStrike + + "0x0EC4": { primary: 0, secondary: 0, reqSkill: 41, skillMsg: "mace fighting" }, + "0x0EC5": { primary: 0, secondary: 0, reqSkill: 41, skillMsg: "mace fighting" }, // Skinning Knives // ShadowStrike, BleedAttack + + "0x0F43": { primary: 1, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0F44": { primary: 1, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, // hatchets // ArmorIgnore, Disarm + + "0x0F45": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0F46": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Executioner Axes // BleedAttack, MortalStrike + + "0x0F47": { primary: 1, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0F48": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Battle Axes // BleedAttack, ConcussionBlow + + "0x0F49": { primary: 0, secondary: 6, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0F4A": { primary: 0, secondary: 6, reqSkill: 40, skillMsg: "Swordsmanship" }, // Axes // CrushingBlow, Dismount + + "0x0F4B": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0F4C": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Double Axe // DoubleStrike, WhirlwindAttack + + "0x0F4D": { primary: 11, secondary: 6, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0F4E": { primary: 11, secondary: 6, reqSkill: 40, skillMsg: "Swordsmanship" }, // Bardiches // ParalyzingBlow, Dismount + + "0x0F4F": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0F50": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Crossbows // ConcussionBlow, MortalStrike + + "0x0F51": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0F52": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Daggers // InfectiousStrike, ShadowStrike + + "0x0F5C": { primary: 0, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, + "0x0F5D": { primary: 0, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, // Maces // ConcussionBlow, Disarm + + "0x0F5E": { primary: 0, secondary: 1, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0F5F": { primary: 0, secondary: 1, reqSkill: 40, skillMsg: "Swordsmanship" }, // Broadswords // CrushingBlow, ArmorIgnore + + "0x13B7": { primary: 1, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x13B8": { primary: 1, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0F60": { primary: 1, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0F61": { primary: 1, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Longswords // ArmorIgnore, ConcussionBlow + + "0x0F62": { primary: 1, secondary: 11, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0F63": { primary: 1, secondary: 11, reqSkill: 40, skillMsg: "Swordsmanship" }, // Spears // ArmorIgnore, ParalyzingBlow + + "0x0FB4": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x0FB5": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Sledge hammers // CrushingBlow, ShadowStrike + + "0x13AF": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x13B0": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // War Axes // ArmorIgnore, BleedAttack + + "0x13B1": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x13B2": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Bows // ParalyzingBlow, MortalStrike + + "0x13B3": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x13B4": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Clubs // ShadowStrike, Dismount + + "0x13B5": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x13B6": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Scimitars // DoubleStrike, ParalyzingBlow + + "0x13B9": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x13BA": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Viking Swords // ParalyzingBlow, CrushingBlow + + "0x13FC": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x13FD": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Heavy Crossbows // MovingShot, Dismount + + "0x13E3": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x13E4": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Smith's Hammers // CrushingBlow, ShadowStrike + + "0x13F6": { primary: 0, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x13F7": { primary: 0, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, // Butcher Knives // InfectiousStrike,Disarm + + "0x13F8": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x13F9": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Gnarled Staves // ConcussionBlow,ForceOfNature + + "0x13FA": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x13FB": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Large Battle Axes // WhirlwindAttack,BleedAttack + + "0x13FE": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x13FF": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Katana // DoubleStrike,ArmorIgnore + + "0x1400": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x1401": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Kryss // ArmorIgnore,InfectiousStrike + + "0x1402": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x1403": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Short Spears // ShadowStrike,MortalStrike + + "0x1404": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x1405": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // War Forks // BleedAttack,Disarm + + "0x1406": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x1407": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // War Maces // CrushingBlow,MortalStrike + + "0x1438": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x1439": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // War Hammers // WhirlwindAttack,CrushingBlow + + "0x143A": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x143B": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Mauls // DoubleStrike,ConcussionBlow + + "0x143C": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x143D": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Hammer Picks // ArmorIgnore,MortalStrike + + "0x143E": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x143F": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Halberds // WhirlwindAttack,ConcussionBlow + + "0x1440": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x1441": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Cutlasses // BleedAttack,ShadowStrike + + "0x1442": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, + "0x1443": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" } // Two Handed Axes // DoubleStrike,ShadowStrike + }; + + // Get items in user's hands + var itemRHand = pUser.FindItemLayer(0x01); + var itemLHand = pUser.FindItemLayer(0x02); + + // Check if either hand has an item + if (itemRHand != null) { + // Check item in the right hand + if (weaponTypes[itemRHand.sectionID]) + { + var weapon = weaponTypes[itemRHand.sectionID]; + + if (abilityID == weapon.primary) + { + return checkSkillRequirement(pUser, 700, weapon.reqSkill, weapon.skillMsg); + } + else if (abilityID == weapon.secondary) + { + return checkSkillRequirement(pUser, 900, weapon.reqSkill, weapon.skillMsg); + } + } + } + else if (itemLHand != null) + { + // Check item in the left hand + if (weaponTypes[itemLHand.sectionID]) + { + var weapon = weaponTypes[itemLHand.sectionID]; + if (abilityID == weapon.primary) + { + return checkSkillRequirement(pUser, 700, weapon.reqSkill, weapon.skillMsg); + } + else if (abilityID == weapon.secondary) + { + return checkSkillRequirement(pUser, 900, weapon.reqSkill, weapon.skillMsg); + } + } + } + else //checking if both hands null if so, it is a wrestling skill + { + if (abilityID == 5) + { + return checkSkillRequirement(pUser, 700, 43, "Wrestling"); + } + else if (abilityID == 11) + { + return checkSkillRequirement(pUser, 900, 43, "Wrestling"); + } + } + + return true; +} + +function CheckMana(pUser, abilityID, requiredMana) +{ + var NextUse = pUser.GetTempTag("doubleMana"); + var iTime = GetCurrentClock(); + if (pUser.mana <= requiredMana) + { + pUser.TextMessage("You need " + requiredMana + " mana to perform that attack"); + DeactivateSpecialMove(pUser.socket, abilityID); + return false; + } + else + { + pUser.SetTempTag("doubleMana", iTime.toString()); + var Delay = 3000; + if ((iTime - NextUse) < Delay) + { + pUser.mana -= requiredMana * 2; + return true; + } + else + { + pUser.mana -= requiredMana; + return true; + } + } +} + +function HandleArmorIgnore(pUser, abilityID) +{ + pUser.SetTempTag("ArmorIgnore", true); + pUser.SetTempTag("abilityID", abilityID); +} + +function HandleDismount(pUser, abilityID) +{ + pUser.SetTempTag("Dismount", true); + pUser.SetTempTag("abilityID", abilityID); +} + +function HandleShadowStrike(pUser, abilityID) +{ + pUser.SetTempTag("ShadowStrike", true); + pUser.SetTempTag("abilityID", abilityID); +} + +function HandleParalyzingBlow(pUser, abilityID) +{ + pUser.SetTempTag("ParalyzingBlow", true); + pUser.SetTempTag("abilityID", abilityID); +} + +function HandleDisarm(pUser, abilityID) +{ + pUser.SetTempTag("Disarm", true); +} + +function onCombatDamageCalc( pAttacker, pDefender, fightSkill, hitLoc ) +{ + var abilityID = pAttacker.GetTempTag("abilityID"); + var baseDamage = pAttacker.attack; + + if( baseDamage == -1 ) // No damage if weapon breaks + return 0; + + var damage = ApplyDamageBonuses( 1, pAttacker, pDefender, fightSkill, hitLoc, baseDamage ); + + if( damage < 1 ) + return 0; + + // Check if attacker has armor ignore enabled + if (abilityID == 1) // armorignore + { + // Armor Ignore ignores defense modifiers, but deals only 90% of potential damage + damage *= 0.9; + + if(fightSkill == 31) // Archery + { + // Cap damage from Armor Strike attack at 30 for archery weapons + if(damage > 30) + damage = 30; + } + else + { + // For all othe rfighting skills, cap damage from Armor Strike at 35 + if(damage > 35) + damage = 35; + } + } + else if (abilityID == 12)// shadowstrike + { + damage *= 1.25; + } + else if (abilityID == 4)// crushingblow + { + damage *= 1.5; + } + else if (abilityID == 3)// ConcussionBlow + { + if (pDefender.maxhp > 0) + { + var hitsPercent = (pDefender.hp / pDefender.maxhp) * 100.0; + + var manaPercent = 0; + + if (pDefender.maxmana > 0) + manaPercent = (pDefender.mana / pDefender.maxmana) * 100.0; + + damage += Math.min(Math.floor(Math.abs(hitsPercent - manaPercent) / 4), 20); + } + } + else + { + // Otherwise, apply normal defense modifiers + damage = ApplyDefenseModifiers( 1, pAttacker, pDefender, fightSkill, hitLoc, damage, true ); + } + + // If damage after defense modifiers is below 0, do a small random amount of damage still + if( damage <= 0 ) + damage = RandomNumber( 0, 4 ); + + // If defender is a player, damage is divided by this modifier from uox.ini + if( !pDefender.npc ) + damage /= GetServerSetting( "NPCDAMAGERATE" ); + + return damage; +} + +function onAttack( pAttacker, pDefender ) +{ + var abilityID = pAttacker.GetTempTag("abilityID"); + + if (abilityID == 1) // armnor ignore + { + var requiredMana = 14; + + // Clear out any current ability the player is doing + if (abilityID != 1) + DeactivateSpecialMove(pAttacker.socket, abilityID); + + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + + pAttacker.TextMessage("Your attack penetrates their armor!"); + pDefender.TextMessage("The blow penetrated your armor!"); + + pDefender.SoundEffect(0x0056, true); + pDefender.StaticEffect(0x3728, 0x09, 0x06); + } + else if (abilityID == 12) // shadowstrike + { + var requiredMana = 20; + + if (pAttacker.skills[47] < 800) // Stealth + { + pAttacker.TextMessage("You lack the required stealth to perform that attack"); + return true; + } + + // Clear out any current ability the player is doing + if (abilityID != 12) + DeactivateSpecialMove(pAttacker.socket, abilityID); + + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + + pAttacker.TextMessage("You strike and hide in the shadows!"); + pDefender.TextMessage("You are dazed by the attack and your attacker vanishes!"); + + pAttacker.StaticEffect(0x376A, 0x09, 0x06); + + pDefender.SoundEffect(0x482, true); + pDefender.StaticEffect(0x37BE, 0x09, 0x06); + + pAttacker.atWar = false; + pDefender.atWar = false; + pAttacker.visible = 1; + } + else if (abilityID == 6) // Dismount + { + var requiredMana = 16; + + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + + // Check to see if player is mount or flying. + if (pAttacker.isonhorse) { + pAttacker.TextMessage("You cannot perform that attack while mounted or flying!"); + DeactivateSpecialMove(pAttacker.socket, abilityID); + return true; + } + + // Clear out any current ability the player is doing + if (abilityID != 6) + DeactivateSpecialMove(pAttacker.socket, abilityID); + + // Only Can work on players or npcs that is mounted + if (!pDefender.isonhorse) { + pAttacker.TextMessage("This attack only works on mounted or flying targets"); + return true; + } + + //Lesser Hiryu have an 80% chance of missing this attack needs added + + //This is the Dismount Information sent to Attacker and Defender + pDefender.SoundEffect(0x140, true); + pDefender.StaticEffect(0x3728, 0x09, 0x06); + pAttacker.TextMessage("The force of your attack has dislodged them from their mount!"); + pDefender.Dismount(); + pDefender.TextMessage("You have been knocked off of your mount by " + pAttacker.name + "!"); + pAttacker.SetTempTag("Dismount", false); + ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + } + else if (abilityID == 11) // ParalyzingBlow + { + var requiredMana = 30; + + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + + // Clear out any current ability the player is doing + if (abilityID != 11) + DeactivateSpecialMove(pAttacker.socket, abilityID); + + pAttacker.SoundEffect(0x204, true); + pDefender.StaticEffect(0x376A, 0x09, 0x32); + var IsImmune = pDefender.GetTempTag("IsImmune") + + if (IsImmune != null && IsImmune == true) { + pAttacker.TextMessage("Your target resists paralysis."); + pDefender.TextMessage("You resist paralysis."); + return true; + } + + var seconds = 3000; // We want this applied to players even if they are "offline" (aka disconnected but not vanished from view yet) + if (pDefender.npc) { + seconds = 6000; + } + else if (pDefender.socket) { + pDefender.TextMessage("The attack has temporarily paralyzed you!", false, 0x3b2, 0, pDefender.serial);// The attack has temporarily paralyzed you! + } + + pDefender.SetTempTag("IsImmune", true); + pDefender.StartTimer(seconds + 8000, 9000, true); + pDefender.StartTimer(seconds, 8000, true); + pDefender.frozen = true; + + if (pAttacker.socket) { + pAttacker.TextMessage(GetDictionaryEntry(17702, pAttacker.socket.language), false, 0x3b2, 0, pAttacker.serial);// You deliver a paralyzing blow! + } + ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + } + else if (abilityID == 5) // Disarm + { + //check skills + if (!RequiredSkill(pAttacker, abilityID)) + return true; + + var itemRHand = pDefender.FindItemLayer(0x01); + var itemLHand = pDefender.FindItemLayer(0x02); + var requiredMana = 20; + + if (pDefender.pack == null || itemLHand != null && itemLHand.movable >= 2 || itemRHand != null && itemRHand.movable >= 2) { + pAttacker.SysMessage("You cannot disarm your opponent."); + return false; + } + + if (itemLHand != null && itemLHand.type == 9 || itemRHand != null && itemRHand.type == 9) { + pAttacker.SysMessage("Your target is already unarmed!"); + return false; + } + + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + + // Clear out any current ability the player is doing + if (abilityID != 5) + DeactivateSpecialMove(pAttacker, abilityID); + + pAttacker.SoundEffect(0x3B9, true); + pDefender.StaticEffect(0x37BE, 0x09, 0x32); + + pAttacker.SysMessage("You disarm their weapon!"); + pDefender.SysMessage("Your weapon has been disarmed!"); + + if (itemLHand != null) + { + itemLHand.container = pDefender.pack; + } + + if (itemRHand != null) + { + itemRHand.container = pDefender.pack; + } + + pDefender.AddScriptTrigger(7002);//block equip for 5 seconds script added + pDefender.SetTempTag("BlockEquip", true); + pDefender.StartTimer(5000, 9100, true); + + TriggerEvent(50104, "AddBuff", pDefender, 0x3ea, 1075637, 0, 5, " "); + + ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + } + else if (abilityID == 4) // crushingblow + { + var requiredMana = 20; + + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + + // Clear out any current ability the player is doing + if (abilityID != 4) + DeactivateSpecialMove(pAttacker, abilityID); + + pAttacker.SysMessage("You have delivered a crushing blow!"); + pDefender.SysMessage("You take extra damage from the crushing attack!"); + + pAttacker.SoundEffect(0x1E1, true); + } + else if (abilityID == 3) // ConcussionBlow + { + var requiredMana = 20; + + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + + // Clear out any current ability the player is doing + if (abilityID != 3) + DeactivateSpecialMove(pAttacker, abilityID); + + pAttacker.SysMessage("You have delivered a concussion!"); + pDefender.SysMessage("You feel disoriented!"); + + pAttacker.SoundEffect(0x213, true); + pDefender.StaticEffect(0x377A, 0x09, 0x32); + } +} + +function ClearSpecialMove(pUser, abilityID) +{ + var socket = pUser.socket; + pUser.SetTempTag("abilityID", null); + pUser.SetTempTag("doubleMana", null); + + var toSend = new Packet; + toSend.ReserveSize(7) + toSend.WriteByte(0, 0xbf); // Packet + toSend.WriteShort(1, 0x07); // Length + toSend.WriteShort(3, 0x21); // SubCmd + toSend.WriteByte(5, abilityID); // Ability ID + toSend.WriteByte(6, 0); // On/off + socket.Send(toSend); + toSend.Free(); +} + +function DeactivateSpecialMove(pUser, abilityID ) +{ + var socket = pUser.socket; + var toSend = new Packet; + + toSend.ReserveSize( 7 ) + toSend.WriteByte( 0, 0xbf ); // Packet + toSend.WriteShort( 1, 0x07 ); // Length + toSend.WriteShort( 3, 0x21 ); // SubCmd + toSend.WriteByte( 5, abilityID ); // Ability ID + toSend.WriteByte( 6, 0 ); // On/off + socket.Send( toSend ); + toSend.Free(); +} + +function onTimer( timerObj, timerID ) +{ + var socket = timerObj.socket; + var abilityID = timerObj.GetTempTag("abilityID"); + if (timerObj == null || timerObj.dead) + { + timerObj.frozen = false; + timerObj.SetTempTag("IsImmune", false); + timerObj.RemoveScriptTrigger(7002); + timerObj.SetTempTag("BlockEquip", false); + ClearSpecialMove(timerObj, abilityID); + return; + } + else if (timerID == 8000) + { + timerObj.frozen = false; + } + else if (timerID == 9000) + { + timerObj.SetTempTag("IsImmune", false); + } + else if (timerID == 9100) + { + timerObj.RemoveScriptTrigger(7002); + timerObj.SetTempTag("BlockEquip", false); + socket.SysMessage("Your confusion has passed, you may now arm a weapon!"); + } + else if (timerObj.socket) + { + //Toggle ability off after 5 second timer has elapsed + DeactivateSpecialMove(timerObj, timerID); + } +} \ No newline at end of file diff --git a/data/js/jse_fileassociations.scp b/data/js/jse_fileassociations.scp index 2cbb8e3d5..802cd528c 100644 --- a/data/js/jse_fileassociations.scp +++ b/data/js/jse_fileassociations.scp @@ -329,6 +329,8 @@ // Combat Scripts [7000-7499] //------------------------------------------- 7000=combat/peacemake_effect.js +7001=combat/special_moves.js +7002=combat/blockequip.js //------------------------------------------- // Misc Player Scripts [8000-8499] diff --git a/data/js/server/global.js b/data/js/server/global.js index aada1f443..582a9d268 100644 --- a/data/js/server/global.js +++ b/data/js/server/global.js @@ -36,6 +36,12 @@ function onLogin( socket, pChar ) // Check if "Young" player still meets requirement for being considered young TriggerEvent( 8001, "CheckYoungStatus", socket, pChar, true ); } + + //Attach the special moves Book + if( !pChar.npc && !pChar.HasScriptTrigger( 7001 )) + { + pChar.AddScriptTrigger( 7001 ); + } } function onLogout( pSock, pChar ) @@ -71,6 +77,12 @@ function onCreatePlayer( pChar ) TriggerEvent( 8001, "GiveYoungPlayerItems", pChar.socket, pChar ); } + + //Attach the special moves Book + if( !pChar.npc && !pChar.HasScriptTrigger( 7001 )) + { + pChar.AddScriptTrigger( 7001 ); + } } // Generic global-script function to look up data in /shared/jsWorldData/ folder diff --git a/source/Changelog.txt b/source/Changelog.txt index 1d779c15f..addbacc9c 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,3 +1,8 @@ +25/05/2024 - Dragon Slayer + Added special_moves.js There is 12 special aos moves you can find on uoguide.com + Added blockequip.js This script is used to block reqeuiping weapons. + Thanks to Xuri for making unequipattemp work for chars and not just items + 27/04/2024 - Dragon Slayer/Xuri Fixed an issue where non-corpse containers - including treasure chests in dungeons - would decay and leave all their contents on the ground. Converted LOOTDECAYSWITHCORPSE ini setting to two new settings, one for player corpses, one for NPC corpses: diff --git a/source/cChar.cpp b/source/cChar.cpp index 7aa03f6fa..f8dc40bc1 100644 --- a/source/cChar.cpp +++ b/source/cChar.cpp @@ -2883,6 +2883,7 @@ CItem *CChar::GetItemAtLayer( ItemLayers Layer ) //| Purpose - Wears the item toWear and adjusts the stats if any are //| required to change. Returns true if successfully equipped //o------------------------------------------------------------------------------------------------o +void Bounce( CSocket *bouncer, CItem *bouncing, UI08 mode = 5 ); bool CChar::WearItem( CItem *toWear ) { // Run event prior to equipping item, allowing script to prevent equip @@ -2900,6 +2901,27 @@ bool CChar::WearItem( CItem *toWear ) } } + scriptTriggers.clear(); + scriptTriggers.shrink_to_fit(); + scriptTriggers = this->GetScriptTriggers(); + for( auto i : scriptTriggers ) + { + cScript *tScript = JSMapping->GetScript( i ); + if( tScript != nullptr ) + { + // If script returns false, prevent item from being equipped + if( tScript->OnEquipAttempt( this, toWear ) == 0 ) + { + CSocket *mSock = this->GetSocket(); + if( mSock != nullptr ) + { + Bounce( mSock, toWear ); + } + return false; + } + } + } + bool rValue = true; ItemLayers tLayer = toWear->GetLayer(); if( tLayer != IL_NONE ) // Layer == 0 is a special case, for things like trade windows and such @@ -2972,6 +2994,22 @@ bool CChar::TakeOffItem( ItemLayers Layer ) } } + scriptTriggers.clear(); + scriptTriggers.shrink_to_fit(); + scriptTriggers = this->GetScriptTriggers(); + for( auto i : scriptTriggers ) + { + cScript *tScript = JSMapping->GetScript( i ); + if( tScript != nullptr ) + { + // If script returns false, prevent item from being equipped + if( tScript->OnUnequipAttempt( this, itemLayers[Layer] ) == 0 ) + { + return false; + } + } + } + if( Layer == IL_PACKITEM ) // It's our pack! { SetPackItem( nullptr ); From 46b237cfa9b907fa8d6b1aa92b64b5252ccd03cc Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Mon, 27 May 2024 15:42:10 -0500 Subject: [PATCH 02/28] update Special Moves --- data/js/combat/special_moves.js | 277 +++++++++++++------------------- 1 file changed, 114 insertions(+), 163 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index a14499824..6383a0d07 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -1,29 +1,10 @@ function onSpecialMove(pUser, abilityID) { - /*switch (abilityID) - { - case 0x01: // Armor Ignore - HandleArmorIgnore(pUser, abilityID); - break; - case 0x05:// Disarm - HandleDisarm(pUser, abilityID); - break; - case 0x06:// Dismount - HandleDismount(pUser, abilityID); - break; - case 0x0C:// ShadowStrike - HandleShadowStrike(pUser, abilityID); - break; - case 0x0B:// Paralyzing Blow - HandleParalyzingBlow(pUser, abilityID); - break; - default: - break; - }*/ - - pUser.TextMessage("I'm activating ability #" + abilityID); + // Check Skills + if (!RequiredSkill(pUser, abilityID)) + return true; + pUser.SetTempTag("abilityID", abilityID); - //pUser.StartTimer(5000, abilityID, true); return true; //The rest of the AOS Abilites before any other expansions @@ -35,11 +16,12 @@ function onSpecialMove(pUser, abilityID) } // Define the checkSkillRequirement function outside RequiredSkill -function checkSkillRequirement(pUser, requiredSkillLevel, requiredSkill, skillMessage) +function checkSkillRequirement(pUser, requiredSkillLevel, requiredSkill, skillMessage, abilityID) { if (pUser.skills[requiredSkill] < requiredSkillLevel) { pUser.SysMessage("You need " + skillMessage + " weapon skill to perform that attack"); + DeactivateSpecialMove(pUser, abilityID) return false; } return true; @@ -50,135 +32,135 @@ function RequiredSkill(pUser, abilityID) { // Define weapon types and their skill requirements and if primary or secondary ability var weaponTypes = { - "0x0DF0": { primary: 0, secondary: 11, reqSkill: 41, skillMsg: "mace fighting" }, - "0x0DF1": { primary: 0, secondary: 11, reqSkill: 41, skillMsg: "mace fighting" }, // Black Staves // WhirlwindAttack, ParalyzingBlow + "0x0DF0": { primary: 0, secondary: 11, reqSkill: 41 }, + "0x0DF1": { primary: 0, secondary: 11, reqSkill: 41 }, // Black Staves // WhirlwindAttack, ParalyzingBlow - "0x0DF2": { primary: 6, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, - "0x0DF3": { primary: 6, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, - "0x0DF4": { primary: 6, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, - "0x0DF5": { primary: 6, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, // wands // Dismount, Disarm + "0x0DF2": { primary: 6, secondary: 5, reqSkill: 41 }, + "0x0DF3": { primary: 6, secondary: 5, reqSkill: 41 }, + "0x0DF4": { primary: 6, secondary: 5, reqSkill: 41 }, + "0x0DF5": { primary: 6, secondary: 5, reqSkill: 41 }, // wands // Dismount, Disarm - "0x0E81": { primary: 0, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, - "0x0E82": { primary: 0, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, // Shepherd's Crooks // CrushingBlow, Disarm + "0x0E81": { primary: 0, secondary: 5, reqSkill: 41 }, + "0x0E82": { primary: 0, secondary: 5, reqSkill: 41 }, // Shepherd's Crooks // CrushingBlow, Disarm - "0x0e85": { primary: 0, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0e86": { primary: 0, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, // pickaxe // DoubleStrike, Disarm + "0x0e85": { primary: 0, secondary: 5, reqSkill: 40 }, + "0x0e86": { primary: 0, secondary: 5, reqSkill: 40 }, // pickaxe // DoubleStrike, Disarm - "0x0E87": { primary: 0, secondary: 6, reqSkill: 41, skillMsg: "mace fighting" }, - "0x0E88": { primary: 0, secondary: 6, reqSkill: 41, skillMsg: "mace fighting" }, // Pitchforks // BleedAttack, Dismount + "0x0E87": { primary: 0, secondary: 6, reqSkill: 41 }, + "0x0E88": { primary: 0, secondary: 6, reqSkill: 41 }, // Pitchforks // BleedAttack, Dismount - "0x0E89": { primary: 0, secondary: 0, reqSkill: 41, skillMsg: "mace fighting" }, - "0x0E8A": { primary: 0, secondary: 0, reqSkill: 41, skillMsg: "mace fighting" }, // Quarter Staves // DoubleStrike, ConcussionBlow + "0x0E89": { primary: 0, secondary: 0, reqSkill: 41 }, + "0x0E8A": { primary: 0, secondary: 0, reqSkill: 41 }, // Quarter Staves // DoubleStrike, ConcussionBlow - "0x0EC2": { primary: 0, secondary: 0, reqSkill: 41, skillMsg: "mace fighting" }, - "0x0EC3": { primary: 0, secondary: 0, reqSkill: 41, skillMsg: "mace fighting" }, // Cleavers // BleedAttack, InfectiousStrike + "0x0EC2": { primary: 0, secondary: 0, reqSkill: 41 }, + "0x0EC3": { primary: 0, secondary: 0, reqSkill: 41 }, // Cleavers // BleedAttack, InfectiousStrike - "0x0EC4": { primary: 0, secondary: 0, reqSkill: 41, skillMsg: "mace fighting" }, - "0x0EC5": { primary: 0, secondary: 0, reqSkill: 41, skillMsg: "mace fighting" }, // Skinning Knives // ShadowStrike, BleedAttack + "0x0EC4": { primary: 0, secondary: 0, reqSkill: 41 }, + "0x0EC5": { primary: 0, secondary: 0, reqSkill: 41 }, // Skinning Knives // ShadowStrike, BleedAttack - "0x0F43": { primary: 1, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0F44": { primary: 1, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, // hatchets // ArmorIgnore, Disarm + "0x0F43": { primary: 1, secondary: 5, reqSkill: 40 }, + "0x0F44": { primary: 1, secondary: 5, reqSkill: 40 }, // hatchets // ArmorIgnore, Disarm - "0x0F45": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0F46": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Executioner Axes // BleedAttack, MortalStrike + "0x0F45": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x0F46": { primary: 0, secondary: 0, reqSkill: 40 }, // Executioner Axes // BleedAttack, MortalStrike - "0x0F47": { primary: 1, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0F48": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Battle Axes // BleedAttack, ConcussionBlow + "0x0F47": { primary: 1, secondary: 5, reqSkill: 40 }, + "0x0F48": { primary: 0, secondary: 0, reqSkill: 40 }, // Battle Axes // BleedAttack, ConcussionBlow - "0x0F49": { primary: 0, secondary: 6, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0F4A": { primary: 0, secondary: 6, reqSkill: 40, skillMsg: "Swordsmanship" }, // Axes // CrushingBlow, Dismount + "0x0F49": { primary: 0, secondary: 6, reqSkill: 40 }, + "0x0F4A": { primary: 0, secondary: 6, reqSkill: 40 }, // Axes // CrushingBlow, Dismount - "0x0F4B": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0F4C": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Double Axe // DoubleStrike, WhirlwindAttack + "0x0F4B": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x0F4C": { primary: 0, secondary: 0, reqSkill: 40 }, // Double Axe // DoubleStrike, WhirlwindAttack - "0x0F4D": { primary: 11, secondary: 6, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0F4E": { primary: 11, secondary: 6, reqSkill: 40, skillMsg: "Swordsmanship" }, // Bardiches // ParalyzingBlow, Dismount + "0x0F4D": { primary: 11, secondary: 6, reqSkill: 40 }, + "0x0F4E": { primary: 11, secondary: 6, reqSkill: 40 }, // Bardiches // ParalyzingBlow, Dismount - "0x0F4F": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0F50": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Crossbows // ConcussionBlow, MortalStrike + "0x0F4F": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x0F50": { primary: 0, secondary: 0, reqSkill: 40 }, // Crossbows // ConcussionBlow, MortalStrike - "0x0F51": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0F52": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Daggers // InfectiousStrike, ShadowStrike + "0x0F51": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x0F52": { primary: 0, secondary: 0, reqSkill: 40 }, // Daggers // InfectiousStrike, ShadowStrike - "0x0F5C": { primary: 0, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, - "0x0F5D": { primary: 0, secondary: 5, reqSkill: 41, skillMsg: "mace fighting" }, // Maces // ConcussionBlow, Disarm + "0x0F5C": { primary: 0, secondary: 5, reqSkill: 41 }, + "0x0F5D": { primary: 0, secondary: 5, reqSkill: 41 }, // Maces // ConcussionBlow, Disarm - "0x0F5E": { primary: 0, secondary: 1, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0F5F": { primary: 0, secondary: 1, reqSkill: 40, skillMsg: "Swordsmanship" }, // Broadswords // CrushingBlow, ArmorIgnore + "0x0F5E": { primary: 0, secondary: 1, reqSkill: 40 }, + "0x0F5F": { primary: 0, secondary: 1, reqSkill: 40 }, // Broadswords // CrushingBlow, ArmorIgnore - "0x13B7": { primary: 1, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x13B8": { primary: 1, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0F60": { primary: 1, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0F61": { primary: 1, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Longswords // ArmorIgnore, ConcussionBlow + "0x13B7": { primary: 1, secondary: 0, reqSkill: 40 }, + "0x13B8": { primary: 1, secondary: 0, reqSkill: 40 }, + "0x0F60": { primary: 1, secondary: 0, reqSkill: 40 }, + "0x0F61": { primary: 1, secondary: 0, reqSkill: 40 }, // Longswords // ArmorIgnore, ConcussionBlow - "0x0F62": { primary: 1, secondary: 11, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0F63": { primary: 1, secondary: 11, reqSkill: 40, skillMsg: "Swordsmanship" }, // Spears // ArmorIgnore, ParalyzingBlow + "0x0F62": { primary: 1, secondary: 11, reqSkill: 40 }, + "0x0F63": { primary: 1, secondary: 11, reqSkill: 40 }, // Spears // ArmorIgnore, ParalyzingBlow - "0x0FB4": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x0FB5": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Sledge hammers // CrushingBlow, ShadowStrike + "0x0FB4": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x0FB5": { primary: 0, secondary: 0, reqSkill: 40 }, // Sledge hammers // CrushingBlow, ShadowStrike - "0x13AF": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x13B0": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // War Axes // ArmorIgnore, BleedAttack + "0x13AF": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x13B0": { primary: 0, secondary: 0, reqSkill: 40 }, // War Axes // ArmorIgnore, BleedAttack - "0x13B1": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x13B2": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Bows // ParalyzingBlow, MortalStrike + "0x13B1": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x13B2": { primary: 0, secondary: 0, reqSkill: 40 }, // Bows // ParalyzingBlow, MortalStrike - "0x13B3": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x13B4": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Clubs // ShadowStrike, Dismount + "0x13B3": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x13B4": { primary: 0, secondary: 0, reqSkill: 40 }, // Clubs // ShadowStrike, Dismount - "0x13B5": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x13B6": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Scimitars // DoubleStrike, ParalyzingBlow + "0x13B5": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x13B6": { primary: 0, secondary: 0, reqSkill: 40 }, // Scimitars // DoubleStrike, ParalyzingBlow - "0x13B9": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x13BA": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Viking Swords // ParalyzingBlow, CrushingBlow + "0x13B9": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x13BA": { primary: 0, secondary: 0, reqSkill: 40 }, // Viking Swords // ParalyzingBlow, CrushingBlow - "0x13FC": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x13FD": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Heavy Crossbows // MovingShot, Dismount + "0x13FC": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x13FD": { primary: 0, secondary: 0, reqSkill: 40 }, // Heavy Crossbows // MovingShot, Dismount - "0x13E3": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x13E4": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Smith's Hammers // CrushingBlow, ShadowStrike + "0x13E3": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x13E4": { primary: 0, secondary: 0, reqSkill: 40 }, // Smith's Hammers // CrushingBlow, ShadowStrike - "0x13F6": { primary: 0, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x13F7": { primary: 0, secondary: 5, reqSkill: 40, skillMsg: "Swordsmanship" }, // Butcher Knives // InfectiousStrike,Disarm + "0x13F6": { primary: 0, secondary: 5, reqSkill: 40 }, + "0x13F7": { primary: 0, secondary: 5, reqSkill: 40 }, // Butcher Knives // InfectiousStrike,Disarm - "0x13F8": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x13F9": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Gnarled Staves // ConcussionBlow,ForceOfNature + "0x13F8": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x13F9": { primary: 0, secondary: 0, reqSkill: 40 }, // Gnarled Staves // ConcussionBlow,ForceOfNature - "0x13FA": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x13FB": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Large Battle Axes // WhirlwindAttack,BleedAttack + "0x13FA": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x13FB": { primary: 0, secondary: 0, reqSkill: 40 }, // Large Battle Axes // WhirlwindAttack,BleedAttack - "0x13FE": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x13FF": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Katana // DoubleStrike,ArmorIgnore + "0x13FE": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x13FF": { primary: 0, secondary: 0, reqSkill: 40 }, // Katana // DoubleStrike,ArmorIgnore - "0x1400": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x1401": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Kryss // ArmorIgnore,InfectiousStrike + "0x1400": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x1401": { primary: 0, secondary: 0, reqSkill: 40 }, // Kryss // ArmorIgnore,InfectiousStrike - "0x1402": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x1403": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Short Spears // ShadowStrike,MortalStrike + "0x1402": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x1403": { primary: 0, secondary: 0, reqSkill: 40 }, // Short Spears // ShadowStrike,MortalStrike - "0x1404": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x1405": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // War Forks // BleedAttack,Disarm + "0x1404": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x1405": { primary: 0, secondary: 0, reqSkill: 40 }, // War Forks // BleedAttack,Disarm - "0x1406": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x1407": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // War Maces // CrushingBlow,MortalStrike + "0x1406": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x1407": { primary: 0, secondary: 0, reqSkill: 40 }, // War Maces // CrushingBlow,MortalStrike - "0x1438": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x1439": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // War Hammers // WhirlwindAttack,CrushingBlow + "0x1438": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x1439": { primary: 0, secondary: 0, reqSkill: 40 }, // War Hammers // WhirlwindAttack,CrushingBlow - "0x143A": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x143B": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Mauls // DoubleStrike,ConcussionBlow + "0x143A": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x143B": { primary: 0, secondary: 0, reqSkill: 40 }, // Mauls // DoubleStrike,ConcussionBlow - "0x143C": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x143D": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Hammer Picks // ArmorIgnore,MortalStrike + "0x143C": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x143D": { primary: 0, secondary: 0, reqSkill: 40 }, // Hammer Picks // ArmorIgnore,MortalStrike - "0x143E": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x143F": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Halberds // WhirlwindAttack,ConcussionBlow + "0x143E": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x143F": { primary: 0, secondary: 0, reqSkill: 40 }, // Halberds // WhirlwindAttack,ConcussionBlow - "0x1440": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x1441": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, // Cutlasses // BleedAttack,ShadowStrike + "0x1440": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x1441": { primary: 0, secondary: 0, reqSkill: 40 }, // Cutlasses // BleedAttack,ShadowStrike - "0x1442": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" }, - "0x1443": { primary: 0, secondary: 0, reqSkill: 40, skillMsg: "Swordsmanship" } // Two Handed Axes // DoubleStrike,ShadowStrike + "0x1442": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x1443": { primary: 0, secondary: 0, reqSkill: 40 } // Two Handed Axes // DoubleStrike,ShadowStrike }; // Get items in user's hands @@ -186,7 +168,8 @@ function RequiredSkill(pUser, abilityID) var itemLHand = pUser.FindItemLayer(0x02); // Check if either hand has an item - if (itemRHand != null) { + if (itemRHand != null) + { // Check item in the right hand if (weaponTypes[itemRHand.sectionID]) { @@ -194,11 +177,11 @@ function RequiredSkill(pUser, abilityID) if (abilityID == weapon.primary) { - return checkSkillRequirement(pUser, 700, weapon.reqSkill, weapon.skillMsg); + return checkSkillRequirement(pUser, 700, weapon.reqSkill, "70", abilityID); } else if (abilityID == weapon.secondary) { - return checkSkillRequirement(pUser, 900, weapon.reqSkill, weapon.skillMsg); + return checkSkillRequirement(pUser, 900, weapon.reqSkill, "90", abilityID); } } } @@ -210,11 +193,11 @@ function RequiredSkill(pUser, abilityID) var weapon = weaponTypes[itemLHand.sectionID]; if (abilityID == weapon.primary) { - return checkSkillRequirement(pUser, 700, weapon.reqSkill, weapon.skillMsg); + return checkSkillRequirement(pUser, 700, weapon.reqSkill, "70", abilityID); } else if (abilityID == weapon.secondary) { - return checkSkillRequirement(pUser, 900, weapon.reqSkill, weapon.skillMsg); + return checkSkillRequirement(pUser, 900, weapon.reqSkill, "90", abilityID); } } } @@ -222,11 +205,11 @@ function RequiredSkill(pUser, abilityID) { if (abilityID == 5) { - return checkSkillRequirement(pUser, 700, 43, "Wrestling"); + return checkSkillRequirement(pUser, 700, 43, "70"); } else if (abilityID == 11) { - return checkSkillRequirement(pUser, 900, 43, "Wrestling"); + return checkSkillRequirement(pUser, 900, 43, "90"); } } @@ -260,35 +243,6 @@ function CheckMana(pUser, abilityID, requiredMana) } } -function HandleArmorIgnore(pUser, abilityID) -{ - pUser.SetTempTag("ArmorIgnore", true); - pUser.SetTempTag("abilityID", abilityID); -} - -function HandleDismount(pUser, abilityID) -{ - pUser.SetTempTag("Dismount", true); - pUser.SetTempTag("abilityID", abilityID); -} - -function HandleShadowStrike(pUser, abilityID) -{ - pUser.SetTempTag("ShadowStrike", true); - pUser.SetTempTag("abilityID", abilityID); -} - -function HandleParalyzingBlow(pUser, abilityID) -{ - pUser.SetTempTag("ParalyzingBlow", true); - pUser.SetTempTag("abilityID", abilityID); -} - -function HandleDisarm(pUser, abilityID) -{ - pUser.SetTempTag("Disarm", true); -} - function onCombatDamageCalc( pAttacker, pDefender, fightSkill, hitLoc ) { var abilityID = pAttacker.GetTempTag("abilityID"); @@ -464,17 +418,20 @@ function onAttack( pAttacker, pDefender ) pDefender.StaticEffect(0x376A, 0x09, 0x32); var IsImmune = pDefender.GetTempTag("IsImmune") - if (IsImmune != null && IsImmune == true) { + if (IsImmune != null && IsImmune == true) + { pAttacker.TextMessage("Your target resists paralysis."); pDefender.TextMessage("You resist paralysis."); return true; } var seconds = 3000; // We want this applied to players even if they are "offline" (aka disconnected but not vanished from view yet) - if (pDefender.npc) { + if (pDefender.npc) + { seconds = 6000; } - else if (pDefender.socket) { + else if (pDefender.socket) + { pDefender.TextMessage("The attack has temporarily paralyzed you!", false, 0x3b2, 0, pDefender.serial);// The attack has temporarily paralyzed you! } @@ -483,27 +440,26 @@ function onAttack( pAttacker, pDefender ) pDefender.StartTimer(seconds, 8000, true); pDefender.frozen = true; - if (pAttacker.socket) { + if (pAttacker.socket) + { pAttacker.TextMessage(GetDictionaryEntry(17702, pAttacker.socket.language), false, 0x3b2, 0, pAttacker.serial);// You deliver a paralyzing blow! } ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success } else if (abilityID == 5) // Disarm { - //check skills - if (!RequiredSkill(pAttacker, abilityID)) - return true; - var itemRHand = pDefender.FindItemLayer(0x01); var itemLHand = pDefender.FindItemLayer(0x02); var requiredMana = 20; - if (pDefender.pack == null || itemLHand != null && itemLHand.movable >= 2 || itemRHand != null && itemRHand.movable >= 2) { + if (pDefender.pack == null || itemLHand != null && itemLHand.movable >= 2 || itemRHand != null && itemRHand.movable >= 2) + { pAttacker.SysMessage("You cannot disarm your opponent."); return false; } - if (itemLHand != null && itemLHand.type == 9 || itemRHand != null && itemRHand.type == 9) { + if (itemLHand != null && itemLHand.type == 9 || itemRHand != null && itemRHand.type == 9) + { pAttacker.SysMessage("Your target is already unarmed!"); return false; } @@ -636,9 +592,4 @@ function onTimer( timerObj, timerID ) timerObj.SetTempTag("BlockEquip", false); socket.SysMessage("Your confusion has passed, you may now arm a weapon!"); } - else if (timerObj.socket) - { - //Toggle ability off after 5 second timer has elapsed - DeactivateSpecialMove(timerObj, timerID); - } } \ No newline at end of file From a6437b935d7e1b0d05a061fcb8f1f0a96df8b7fe Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Mon, 27 May 2024 16:07:16 -0500 Subject: [PATCH 03/28] Updates --- data/js/combat/special_moves.js | 156 ++++++++++++++++---------------- 1 file changed, 79 insertions(+), 77 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index 6383a0d07..9629e198a 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -12,7 +12,7 @@ function onSpecialMove(pUser, abilityID) //Infectious Strike //Double Strike //Bleed Attack - //Whirlwind Attack + //Whirlwind Attack } // Define the checkSkillRequirement function outside RequiredSkill @@ -28,7 +28,7 @@ function checkSkillRequirement(pUser, requiredSkillLevel, requiredSkill, skillMe } // Define the RequiredSkill function -function RequiredSkill(pUser, abilityID) +function RequiredSkill( pUser, abilityID ) { // Define weapon types and their skill requirements and if primary or secondary ability var weaponTypes = { @@ -40,8 +40,8 @@ function RequiredSkill(pUser, abilityID) "0x0DF4": { primary: 6, secondary: 5, reqSkill: 41 }, "0x0DF5": { primary: 6, secondary: 5, reqSkill: 41 }, // wands // Dismount, Disarm - "0x0E81": { primary: 0, secondary: 5, reqSkill: 41 }, - "0x0E82": { primary: 0, secondary: 5, reqSkill: 41 }, // Shepherd's Crooks // CrushingBlow, Disarm + "0x0E81": { primary: 4, secondary: 5, reqSkill: 41 }, + "0x0E82": { primary: 4, secondary: 5, reqSkill: 41 }, // Shepherd's Crooks // CrushingBlow, Disarm "0x0e85": { primary: 0, secondary: 5, reqSkill: 40 }, "0x0e86": { primary: 0, secondary: 5, reqSkill: 40 }, // pickaxe // DoubleStrike, Disarm @@ -49,14 +49,14 @@ function RequiredSkill(pUser, abilityID) "0x0E87": { primary: 0, secondary: 6, reqSkill: 41 }, "0x0E88": { primary: 0, secondary: 6, reqSkill: 41 }, // Pitchforks // BleedAttack, Dismount - "0x0E89": { primary: 0, secondary: 0, reqSkill: 41 }, - "0x0E8A": { primary: 0, secondary: 0, reqSkill: 41 }, // Quarter Staves // DoubleStrike, ConcussionBlow + "0x0E89": { primary: 0, secondary: 3, reqSkill: 41 }, + "0x0E8A": { primary: 0, secondary: 3, reqSkill: 41 }, // Quarter Staves // DoubleStrike, ConcussionBlow "0x0EC2": { primary: 0, secondary: 0, reqSkill: 41 }, "0x0EC3": { primary: 0, secondary: 0, reqSkill: 41 }, // Cleavers // BleedAttack, InfectiousStrike - "0x0EC4": { primary: 0, secondary: 0, reqSkill: 41 }, - "0x0EC5": { primary: 0, secondary: 0, reqSkill: 41 }, // Skinning Knives // ShadowStrike, BleedAttack + "0x0EC4": { primary: 12, secondary: 0, reqSkill: 41 }, + "0x0EC5": { primary: 12, secondary: 0, reqSkill: 41 }, // Skinning Knives // ShadowStrike, BleedAttack "0x0F43": { primary: 1, secondary: 5, reqSkill: 40 }, "0x0F44": { primary: 1, secondary: 5, reqSkill: 40 }, // hatchets // ArmorIgnore, Disarm @@ -64,11 +64,11 @@ function RequiredSkill(pUser, abilityID) "0x0F45": { primary: 0, secondary: 0, reqSkill: 40 }, "0x0F46": { primary: 0, secondary: 0, reqSkill: 40 }, // Executioner Axes // BleedAttack, MortalStrike - "0x0F47": { primary: 1, secondary: 5, reqSkill: 40 }, - "0x0F48": { primary: 0, secondary: 0, reqSkill: 40 }, // Battle Axes // BleedAttack, ConcussionBlow + "0x0F47": { primary: 0, secondary: 3, reqSkill: 40 }, + "0x0F48": { primary: 0, secondary: 3, reqSkill: 40 }, // Battle Axes // BleedAttack, ConcussionBlow - "0x0F49": { primary: 0, secondary: 6, reqSkill: 40 }, - "0x0F4A": { primary: 0, secondary: 6, reqSkill: 40 }, // Axes // CrushingBlow, Dismount + "0x0F49": { primary: 4, secondary: 6, reqSkill: 40 }, + "0x0F4A": { primary: 4, secondary: 6, reqSkill: 40 }, // Axes // CrushingBlow, Dismount "0x0F4B": { primary: 0, secondary: 0, reqSkill: 40 }, "0x0F4C": { primary: 0, secondary: 0, reqSkill: 40 }, // Double Axe // DoubleStrike, WhirlwindAttack @@ -76,91 +76,91 @@ function RequiredSkill(pUser, abilityID) "0x0F4D": { primary: 11, secondary: 6, reqSkill: 40 }, "0x0F4E": { primary: 11, secondary: 6, reqSkill: 40 }, // Bardiches // ParalyzingBlow, Dismount - "0x0F4F": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x0F50": { primary: 0, secondary: 0, reqSkill: 40 }, // Crossbows // ConcussionBlow, MortalStrike + "0x0F4F": { primary: 3, secondary: 0, reqSkill: 40 }, + "0x0F50": { primary: 3, secondary: 0, reqSkill: 40 }, // Crossbows // ConcussionBlow, MortalStrike - "0x0F51": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x0F52": { primary: 0, secondary: 0, reqSkill: 40 }, // Daggers // InfectiousStrike, ShadowStrike + "0x0F51": { primary: 0, secondary: 12, reqSkill: 40 }, + "0x0F52": { primary: 0, secondary: 12, reqSkill: 40 }, // Daggers // InfectiousStrike, ShadowStrike - "0x0F5C": { primary: 0, secondary: 5, reqSkill: 41 }, - "0x0F5D": { primary: 0, secondary: 5, reqSkill: 41 }, // Maces // ConcussionBlow, Disarm + "0x0F5C": { primary: 3, secondary: 5, reqSkill: 41 }, + "0x0F5D": { primary: 3, secondary: 5, reqSkill: 41 }, // Maces // ConcussionBlow, Disarm - "0x0F5E": { primary: 0, secondary: 1, reqSkill: 40 }, - "0x0F5F": { primary: 0, secondary: 1, reqSkill: 40 }, // Broadswords // CrushingBlow, ArmorIgnore + "0x0F5E": { primary: 4, secondary: 1, reqSkill: 40 }, + "0x0F5F": { primary: 4, secondary: 1, reqSkill: 40 }, // Broadswords // CrushingBlow, ArmorIgnore - "0x13B7": { primary: 1, secondary: 0, reqSkill: 40 }, - "0x13B8": { primary: 1, secondary: 0, reqSkill: 40 }, - "0x0F60": { primary: 1, secondary: 0, reqSkill: 40 }, - "0x0F61": { primary: 1, secondary: 0, reqSkill: 40 }, // Longswords // ArmorIgnore, ConcussionBlow + "0x13B7": { primary: 1, secondary: 3, reqSkill: 40 }, + "0x13B8": { primary: 1, secondary: 3, reqSkill: 40 }, + "0x0F60": { primary: 1, secondary: 3, reqSkill: 40 }, + "0x0F61": { primary: 1, secondary: 3, reqSkill: 40 }, // Longswords // ArmorIgnore, ConcussionBlow "0x0F62": { primary: 1, secondary: 11, reqSkill: 40 }, "0x0F63": { primary: 1, secondary: 11, reqSkill: 40 }, // Spears // ArmorIgnore, ParalyzingBlow - "0x0FB4": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x0FB5": { primary: 0, secondary: 0, reqSkill: 40 }, // Sledge hammers // CrushingBlow, ShadowStrike + "0x0FB4": { primary: 4, secondary: 12, reqSkill: 40 }, + "0x0FB5": { primary: 4, secondary: 12, reqSkill: 40 }, // Sledge hammers // CrushingBlow, ShadowStrike - "0x13AF": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x13B0": { primary: 0, secondary: 0, reqSkill: 40 }, // War Axes // ArmorIgnore, BleedAttack + "0x13AF": { primary: 1, secondary: 0, reqSkill: 40 }, + "0x13B0": { primary: 1, secondary: 0, reqSkill: 40 }, // War Axes // ArmorIgnore, BleedAttack - "0x13B1": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x13B2": { primary: 0, secondary: 0, reqSkill: 40 }, // Bows // ParalyzingBlow, MortalStrike + "0x13B1": { primary: 11, secondary: 0, reqSkill: 40 }, + "0x13B2": { primary: 11, secondary: 0, reqSkill: 40 }, // Bows // ParalyzingBlow, MortalStrike - "0x13B3": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x13B4": { primary: 0, secondary: 0, reqSkill: 40 }, // Clubs // ShadowStrike, Dismount + "0x13B3": { primary: 12, secondary: 6, reqSkill: 40 }, + "0x13B4": { primary: 12, secondary: 6, reqSkill: 40 }, // Clubs // ShadowStrike, Dismount - "0x13B5": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x13B6": { primary: 0, secondary: 0, reqSkill: 40 }, // Scimitars // DoubleStrike, ParalyzingBlow + "0x13B5": { primary: 0, secondary: 11, reqSkill: 40 }, + "0x13B6": { primary: 0, secondary: 1, reqSkill: 40 }, // Scimitars // DoubleStrike, ParalyzingBlow - "0x13B9": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x13BA": { primary: 0, secondary: 0, reqSkill: 40 }, // Viking Swords // ParalyzingBlow, CrushingBlow + "0x13B9": { primary: 11, secondary: 4, reqSkill: 40 }, + "0x13BA": { primary: 11, secondary: 4, reqSkill: 40 }, // Viking Swords // ParalyzingBlow, CrushingBlow - "0x13FC": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x13FD": { primary: 0, secondary: 0, reqSkill: 40 }, // Heavy Crossbows // MovingShot, Dismount + "0x13FC": { primary: 0, secondary: 6, reqSkill: 40 }, + "0x13FD": { primary: 0, secondary: 6, reqSkill: 40 }, // Heavy Crossbows // MovingShot, Dismount - "0x13E3": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x13E4": { primary: 0, secondary: 0, reqSkill: 40 }, // Smith's Hammers // CrushingBlow, ShadowStrike + "0x13E3": { primary: 4, secondary: 12, reqSkill: 40 }, + "0x13E4": { primary: 4, secondary: 12, reqSkill: 40 }, // Smith's Hammers // CrushingBlow, ShadowStrike "0x13F6": { primary: 0, secondary: 5, reqSkill: 40 }, "0x13F7": { primary: 0, secondary: 5, reqSkill: 40 }, // Butcher Knives // InfectiousStrike,Disarm - "0x13F8": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x13F9": { primary: 0, secondary: 0, reqSkill: 40 }, // Gnarled Staves // ConcussionBlow,ForceOfNature + "0x13F8": { primary: 3, secondary: 0, reqSkill: 40 }, + "0x13F9": { primary: 3, secondary: 0, reqSkill: 40 }, // Gnarled Staves // ConcussionBlow,ForceOfNature "0x13FA": { primary: 0, secondary: 0, reqSkill: 40 }, "0x13FB": { primary: 0, secondary: 0, reqSkill: 40 }, // Large Battle Axes // WhirlwindAttack,BleedAttack - "0x13FE": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x13FF": { primary: 0, secondary: 0, reqSkill: 40 }, // Katana // DoubleStrike,ArmorIgnore + "0x13FE": { primary: 0, secondary: 1, reqSkill: 40 }, + "0x13FF": { primary: 0, secondary: 1, reqSkill: 40 }, // Katana // DoubleStrike,ArmorIgnore - "0x1400": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x1401": { primary: 0, secondary: 0, reqSkill: 40 }, // Kryss // ArmorIgnore,InfectiousStrike + "0x1400": { primary: 1, secondary: 0, reqSkill: 40 }, + "0x1401": { primary: 1, secondary: 0, reqSkill: 40 }, // Kryss // ArmorIgnore,InfectiousStrike - "0x1402": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x1403": { primary: 0, secondary: 0, reqSkill: 40 }, // Short Spears // ShadowStrike,MortalStrike + "0x1402": { primary: 12, secondary: 0, reqSkill: 40 }, + "0x1403": { primary: 12, secondary: 0, reqSkill: 40 }, // Short Spears // ShadowStrike,MortalStrike - "0x1404": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x1405": { primary: 0, secondary: 0, reqSkill: 40 }, // War Forks // BleedAttack,Disarm + "0x1404": { primary: 0, secondary: 5, reqSkill: 40 }, + "0x1405": { primary: 0, secondary: 5, reqSkill: 40 }, // War Forks // BleedAttack,Disarm - "0x1406": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x1407": { primary: 0, secondary: 0, reqSkill: 40 }, // War Maces // CrushingBlow,MortalStrike + "0x1406": { primary: 4, secondary: 0, reqSkill: 40 }, + "0x1407": { primary: 4, secondary: 0, reqSkill: 40 }, // War Maces // CrushingBlow,MortalStrike - "0x1438": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x1439": { primary: 0, secondary: 0, reqSkill: 40 }, // War Hammers // WhirlwindAttack,CrushingBlow + "0x1438": { primary: 0, secondary: 4, reqSkill: 40 }, + "0x1439": { primary: 0, secondary: 4, reqSkill: 40 }, // War Hammers // WhirlwindAttack,CrushingBlow - "0x143A": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x143B": { primary: 0, secondary: 0, reqSkill: 40 }, // Mauls // DoubleStrike,ConcussionBlow + "0x143A": { primary: 0, secondary: 3, reqSkill: 40 }, + "0x143B": { primary: 0, secondary: 3, reqSkill: 40 }, // Mauls // DoubleStrike,ConcussionBlow - "0x143C": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x143D": { primary: 0, secondary: 0, reqSkill: 40 }, // Hammer Picks // ArmorIgnore,MortalStrike + "0x143C": { primary: 1, secondary: 0, reqSkill: 40 }, + "0x143D": { primary: 1, secondary: 0, reqSkill: 40 }, // Hammer Picks // ArmorIgnore,MortalStrike - "0x143E": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x143F": { primary: 0, secondary: 0, reqSkill: 40 }, // Halberds // WhirlwindAttack,ConcussionBlow + "0x143E": { primary: 0, secondary: 3, reqSkill: 40 }, + "0x143F": { primary: 0, secondary: 3, reqSkill: 40 }, // Halberds // WhirlwindAttack,ConcussionBlow - "0x1440": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x1441": { primary: 0, secondary: 0, reqSkill: 40 }, // Cutlasses // BleedAttack,ShadowStrike + "0x1440": { primary: 0, secondary: 12, reqSkill: 40 }, + "0x1441": { primary: 0, secondary: 12, reqSkill: 40 }, // Cutlasses // BleedAttack,ShadowStrike - "0x1442": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x1443": { primary: 0, secondary: 0, reqSkill: 40 } // Two Handed Axes // DoubleStrike,ShadowStrike + "0x1442": { primary: 0, secondary: 12, reqSkill: 40 }, + "0x1443": { primary: 0, secondary: 12, reqSkill: 40 } // Two Handed Axes // DoubleStrike,ShadowStrike }; // Get items in user's hands @@ -322,7 +322,7 @@ function onAttack( pAttacker, pDefender ) { var requiredMana = 14; - // Clear out any current ability the player is doing + // Clear out any current ability the player is doing when he switches abilities if (abilityID != 1) DeactivateSpecialMove(pAttacker.socket, abilityID); @@ -346,7 +346,7 @@ function onAttack( pAttacker, pDefender ) return true; } - // Clear out any current ability the player is doing + // Clear out any current ability the player is doing when he switches abilities if (abilityID != 12) DeactivateSpecialMove(pAttacker.socket, abilityID); @@ -375,18 +375,20 @@ function onAttack( pAttacker, pDefender ) return true; // Check to see if player is mount or flying. - if (pAttacker.isonhorse) { + if (pAttacker.isonhorse) + { pAttacker.TextMessage("You cannot perform that attack while mounted or flying!"); DeactivateSpecialMove(pAttacker.socket, abilityID); return true; } - // Clear out any current ability the player is doing + // Clear out any current ability the player is doing when he switches abilities if (abilityID != 6) DeactivateSpecialMove(pAttacker.socket, abilityID); // Only Can work on players or npcs that is mounted - if (!pDefender.isonhorse) { + if (!pDefender.isonhorse) + { pAttacker.TextMessage("This attack only works on mounted or flying targets"); return true; } @@ -410,7 +412,7 @@ function onAttack( pAttacker, pDefender ) if (!CheckMana(pAttacker, abilityID, requiredMana)) return true; - // Clear out any current ability the player is doing + // Clear out any current ability the player is doing when he switches abilities if (abilityID != 11) DeactivateSpecialMove(pAttacker.socket, abilityID); @@ -468,7 +470,7 @@ function onAttack( pAttacker, pDefender ) if (!CheckMana(pAttacker, abilityID, requiredMana)) return true; - // Clear out any current ability the player is doing + // Clear out any current ability the player is doing when he switches abilities if (abilityID != 5) DeactivateSpecialMove(pAttacker, abilityID); @@ -504,7 +506,7 @@ function onAttack( pAttacker, pDefender ) if (!CheckMana(pAttacker, abilityID, requiredMana)) return true; - // Clear out any current ability the player is doing + // Clear out any current ability the player is doing when he switches abilities if (abilityID != 4) DeactivateSpecialMove(pAttacker, abilityID); @@ -521,7 +523,7 @@ function onAttack( pAttacker, pDefender ) if (!CheckMana(pAttacker, abilityID, requiredMana)) return true; - // Clear out any current ability the player is doing + // Clear out any current ability the player is doing when he switches abilities if (abilityID != 3) DeactivateSpecialMove(pAttacker, abilityID); @@ -572,9 +574,9 @@ function onTimer( timerObj, timerID ) if (timerObj == null || timerObj.dead) { timerObj.frozen = false; - timerObj.SetTempTag("IsImmune", false); + timerObj.SetTempTag("IsImmune", null); timerObj.RemoveScriptTrigger(7002); - timerObj.SetTempTag("BlockEquip", false); + timerObj.SetTempTag("BlockEquip", null); ClearSpecialMove(timerObj, abilityID); return; } @@ -584,12 +586,12 @@ function onTimer( timerObj, timerID ) } else if (timerID == 9000) { - timerObj.SetTempTag("IsImmune", false); + timerObj.SetTempTag("IsImmune", null); } else if (timerID == 9100) { timerObj.RemoveScriptTrigger(7002); - timerObj.SetTempTag("BlockEquip", false); + timerObj.SetTempTag("BlockEquip", null); socket.SysMessage("Your confusion has passed, you may now arm a weapon!"); } } \ No newline at end of file From 863c0dc3fc397a0a075a6953dd2af209cf99977a Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Mon, 27 May 2024 17:20:19 -0500 Subject: [PATCH 04/28] Update Skills Cleanup functions --- data/js/combat/special_moves.js | 159 ++++++++++++++++---------------- 1 file changed, 80 insertions(+), 79 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index 9629e198a..a94a93067 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -15,18 +15,18 @@ function onSpecialMove(pUser, abilityID) //Whirlwind Attack } -// Define the checkSkillRequirement function outside RequiredSkill -function checkSkillRequirement(pUser, requiredSkillLevel, requiredSkill, skillMessage, abilityID) +function checkSkillRequirement( pUser, requiredSkillLevel, requiredSkill, skillMessage, abilityID ) { - if (pUser.skills[requiredSkill] < requiredSkillLevel) + if( pUser.skills[requiredSkill] < requiredSkillLevel ) { - pUser.SysMessage("You need " + skillMessage + " weapon skill to perform that attack"); - DeactivateSpecialMove(pUser, abilityID) + pUser.SysMessage( "You need " + skillMessage + " weapon skill to perform that attack" ); + DeactivateSpecialMove( pUser, abilityID ); return false; } return true; } +// archery 31 swordsmansip 40 macefighting 41 fencing 42 wrestling 43 // Define the RequiredSkill function function RequiredSkill( pUser, abilityID ) { @@ -46,17 +46,17 @@ function RequiredSkill( pUser, abilityID ) "0x0e85": { primary: 0, secondary: 5, reqSkill: 40 }, "0x0e86": { primary: 0, secondary: 5, reqSkill: 40 }, // pickaxe // DoubleStrike, Disarm - "0x0E87": { primary: 0, secondary: 6, reqSkill: 41 }, - "0x0E88": { primary: 0, secondary: 6, reqSkill: 41 }, // Pitchforks // BleedAttack, Dismount + "0x0E87": { primary: 0, secondary: 6, reqSkill: 42 }, + "0x0E88": { primary: 0, secondary: 6, reqSkill: 42 }, // Pitchforks // BleedAttack, Dismount "0x0E89": { primary: 0, secondary: 3, reqSkill: 41 }, "0x0E8A": { primary: 0, secondary: 3, reqSkill: 41 }, // Quarter Staves // DoubleStrike, ConcussionBlow - "0x0EC2": { primary: 0, secondary: 0, reqSkill: 41 }, - "0x0EC3": { primary: 0, secondary: 0, reqSkill: 41 }, // Cleavers // BleedAttack, InfectiousStrike + "0x0EC2": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x0EC3": { primary: 0, secondary: 0, reqSkill: 40 }, // Cleavers // BleedAttack, InfectiousStrike - "0x0EC4": { primary: 12, secondary: 0, reqSkill: 41 }, - "0x0EC5": { primary: 12, secondary: 0, reqSkill: 41 }, // Skinning Knives // ShadowStrike, BleedAttack + "0x0EC4": { primary: 12, secondary: 0, reqSkill: 40 }, + "0x0EC5": { primary: 12, secondary: 0, reqSkill: 40 }, // Skinning Knives // ShadowStrike, BleedAttack "0x0F43": { primary: 1, secondary: 5, reqSkill: 40 }, "0x0F44": { primary: 1, secondary: 5, reqSkill: 40 }, // hatchets // ArmorIgnore, Disarm @@ -76,8 +76,8 @@ function RequiredSkill( pUser, abilityID ) "0x0F4D": { primary: 11, secondary: 6, reqSkill: 40 }, "0x0F4E": { primary: 11, secondary: 6, reqSkill: 40 }, // Bardiches // ParalyzingBlow, Dismount - "0x0F4F": { primary: 3, secondary: 0, reqSkill: 40 }, - "0x0F50": { primary: 3, secondary: 0, reqSkill: 40 }, // Crossbows // ConcussionBlow, MortalStrike + "0x0F4F": { primary: 3, secondary: 0, reqSkill: 31 }, + "0x0F50": { primary: 3, secondary: 0, reqSkill: 31 }, // Crossbows // ConcussionBlow, MortalStrike "0x0F51": { primary: 0, secondary: 12, reqSkill: 40 }, "0x0F52": { primary: 0, secondary: 12, reqSkill: 40 }, // Daggers // InfectiousStrike, ShadowStrike @@ -93,20 +93,20 @@ function RequiredSkill( pUser, abilityID ) "0x0F60": { primary: 1, secondary: 3, reqSkill: 40 }, "0x0F61": { primary: 1, secondary: 3, reqSkill: 40 }, // Longswords // ArmorIgnore, ConcussionBlow - "0x0F62": { primary: 1, secondary: 11, reqSkill: 40 }, - "0x0F63": { primary: 1, secondary: 11, reqSkill: 40 }, // Spears // ArmorIgnore, ParalyzingBlow + "0x0F62": { primary: 1, secondary: 11, reqSkill: 42 }, + "0x0F63": { primary: 1, secondary: 11, reqSkill: 42 }, // Spears // ArmorIgnore, ParalyzingBlow - "0x0FB4": { primary: 4, secondary: 12, reqSkill: 40 }, - "0x0FB5": { primary: 4, secondary: 12, reqSkill: 40 }, // Sledge hammers // CrushingBlow, ShadowStrike + "0x0FB4": { primary: 4, secondary: 12, reqSkill: 41 }, + "0x0FB5": { primary: 4, secondary: 12, reqSkill: 41 }, // Sledge hammers // CrushingBlow, ShadowStrike "0x13AF": { primary: 1, secondary: 0, reqSkill: 40 }, "0x13B0": { primary: 1, secondary: 0, reqSkill: 40 }, // War Axes // ArmorIgnore, BleedAttack - "0x13B1": { primary: 11, secondary: 0, reqSkill: 40 }, - "0x13B2": { primary: 11, secondary: 0, reqSkill: 40 }, // Bows // ParalyzingBlow, MortalStrike + "0x13B1": { primary: 11, secondary: 0, reqSkill: 31 }, + "0x13B2": { primary: 11, secondary: 0, reqSkill: 31 }, // Bows // ParalyzingBlow, MortalStrike - "0x13B3": { primary: 12, secondary: 6, reqSkill: 40 }, - "0x13B4": { primary: 12, secondary: 6, reqSkill: 40 }, // Clubs // ShadowStrike, Dismount + "0x13B3": { primary: 12, secondary: 6, reqSkill: 41 }, + "0x13B4": { primary: 12, secondary: 6, reqSkill: 41 }, // Clubs // ShadowStrike, Dismount "0x13B5": { primary: 0, secondary: 11, reqSkill: 40 }, "0x13B6": { primary: 0, secondary: 1, reqSkill: 40 }, // Scimitars // DoubleStrike, ParalyzingBlow @@ -114,17 +114,17 @@ function RequiredSkill( pUser, abilityID ) "0x13B9": { primary: 11, secondary: 4, reqSkill: 40 }, "0x13BA": { primary: 11, secondary: 4, reqSkill: 40 }, // Viking Swords // ParalyzingBlow, CrushingBlow - "0x13FC": { primary: 0, secondary: 6, reqSkill: 40 }, - "0x13FD": { primary: 0, secondary: 6, reqSkill: 40 }, // Heavy Crossbows // MovingShot, Dismount + "0x13FC": { primary: 0, secondary: 6, reqSkill: 31 }, + "0x13FD": { primary: 0, secondary: 6, reqSkill: 31 }, // Heavy Crossbows // MovingShot, Dismount - "0x13E3": { primary: 4, secondary: 12, reqSkill: 40 }, - "0x13E4": { primary: 4, secondary: 12, reqSkill: 40 }, // Smith's Hammers // CrushingBlow, ShadowStrike + "0x13E3": { primary: 4, secondary: 12, reqSkill: 41 }, + "0x13E4": { primary: 4, secondary: 12, reqSkill: 41 }, // Smith's Hammers // CrushingBlow, ShadowStrike "0x13F6": { primary: 0, secondary: 5, reqSkill: 40 }, "0x13F7": { primary: 0, secondary: 5, reqSkill: 40 }, // Butcher Knives // InfectiousStrike,Disarm - "0x13F8": { primary: 3, secondary: 0, reqSkill: 40 }, - "0x13F9": { primary: 3, secondary: 0, reqSkill: 40 }, // Gnarled Staves // ConcussionBlow,ForceOfNature + "0x13F8": { primary: 3, secondary: 0, reqSkill: 41 }, + "0x13F9": { primary: 3, secondary: 0, reqSkill: 41 }, // Gnarled Staves // ConcussionBlow,ForceOfNature "0x13FA": { primary: 0, secondary: 0, reqSkill: 40 }, "0x13FB": { primary: 0, secondary: 0, reqSkill: 40 }, // Large Battle Axes // WhirlwindAttack,BleedAttack @@ -132,26 +132,26 @@ function RequiredSkill( pUser, abilityID ) "0x13FE": { primary: 0, secondary: 1, reqSkill: 40 }, "0x13FF": { primary: 0, secondary: 1, reqSkill: 40 }, // Katana // DoubleStrike,ArmorIgnore - "0x1400": { primary: 1, secondary: 0, reqSkill: 40 }, - "0x1401": { primary: 1, secondary: 0, reqSkill: 40 }, // Kryss // ArmorIgnore,InfectiousStrike + "0x1400": { primary: 1, secondary: 0, reqSkill: 42 }, + "0x1401": { primary: 1, secondary: 0, reqSkill: 42 }, // Kryss // ArmorIgnore,InfectiousStrike - "0x1402": { primary: 12, secondary: 0, reqSkill: 40 }, - "0x1403": { primary: 12, secondary: 0, reqSkill: 40 }, // Short Spears // ShadowStrike,MortalStrike + "0x1402": { primary: 12, secondary: 0, reqSkill: 42 }, + "0x1403": { primary: 12, secondary: 0, reqSkill: 42 }, // Short Spears // ShadowStrike,MortalStrike - "0x1404": { primary: 0, secondary: 5, reqSkill: 40 }, - "0x1405": { primary: 0, secondary: 5, reqSkill: 40 }, // War Forks // BleedAttack,Disarm + "0x1404": { primary: 0, secondary: 5, reqSkill: 42 }, + "0x1405": { primary: 0, secondary: 5, reqSkill: 42 }, // War Forks // BleedAttack,Disarm - "0x1406": { primary: 4, secondary: 0, reqSkill: 40 }, - "0x1407": { primary: 4, secondary: 0, reqSkill: 40 }, // War Maces // CrushingBlow,MortalStrike + "0x1406": { primary: 4, secondary: 0, reqSkill: 41 }, + "0x1407": { primary: 4, secondary: 0, reqSkill: 41 }, // War Maces // CrushingBlow,MortalStrike - "0x1438": { primary: 0, secondary: 4, reqSkill: 40 }, - "0x1439": { primary: 0, secondary: 4, reqSkill: 40 }, // War Hammers // WhirlwindAttack,CrushingBlow + "0x1438": { primary: 0, secondary: 4, reqSkill: 41 }, + "0x1439": { primary: 0, secondary: 4, reqSkill: 41 }, // War Hammers // WhirlwindAttack,CrushingBlow - "0x143A": { primary: 0, secondary: 3, reqSkill: 40 }, - "0x143B": { primary: 0, secondary: 3, reqSkill: 40 }, // Mauls // DoubleStrike,ConcussionBlow + "0x143A": { primary: 0, secondary: 3, reqSkill: 41 }, + "0x143B": { primary: 0, secondary: 3, reqSkill: 41 }, // Mauls // DoubleStrike,ConcussionBlow - "0x143C": { primary: 1, secondary: 0, reqSkill: 40 }, - "0x143D": { primary: 1, secondary: 0, reqSkill: 40 }, // Hammer Picks // ArmorIgnore,MortalStrike + "0x143C": { primary: 1, secondary: 0, reqSkill: 41 }, + "0x143D": { primary: 1, secondary: 0, reqSkill: 41 }, // Hammer Picks // ArmorIgnore,MortalStrike "0x143E": { primary: 0, secondary: 3, reqSkill: 40 }, "0x143F": { primary: 0, secondary: 3, reqSkill: 40 }, // Halberds // WhirlwindAttack,ConcussionBlow @@ -164,73 +164,74 @@ function RequiredSkill( pUser, abilityID ) }; // Get items in user's hands - var itemRHand = pUser.FindItemLayer(0x01); - var itemLHand = pUser.FindItemLayer(0x02); + var itemRHand = pUser.FindItemLayer( 0x01 ); + var itemLHand = pUser.FindItemLayer( 0x02 ); // Check if either hand has an item - if (itemRHand != null) + if( itemRHand != null ) { // Check item in the right hand - if (weaponTypes[itemRHand.sectionID]) + if( weaponTypes[itemRHand.sectionID] ) { var weapon = weaponTypes[itemRHand.sectionID]; - if (abilityID == weapon.primary) + if( abilityID == weapon.primary ) { - return checkSkillRequirement(pUser, 700, weapon.reqSkill, "70", abilityID); + return checkSkillRequirement( pUser, 700, weapon.reqSkill, "70", abilityID ); } - else if (abilityID == weapon.secondary) + else if( abilityID == weapon.secondary ) { - return checkSkillRequirement(pUser, 900, weapon.reqSkill, "90", abilityID); + return checkSkillRequirement( pUser, 900, weapon.reqSkill, "90", abilityID ); } } } - else if (itemLHand != null) + else if( itemLHand != null ) { // Check item in the left hand - if (weaponTypes[itemLHand.sectionID]) + if( weaponTypes[itemLHand.sectionID] ) { var weapon = weaponTypes[itemLHand.sectionID]; - if (abilityID == weapon.primary) + + if ( abilityID == weapon.primary ) { - return checkSkillRequirement(pUser, 700, weapon.reqSkill, "70", abilityID); + return checkSkillRequirement( pUser, 700, weapon.reqSkill, "70", abilityID ); } - else if (abilityID == weapon.secondary) + else if( abilityID == weapon.secondary ) { - return checkSkillRequirement(pUser, 900, weapon.reqSkill, "90", abilityID); + return checkSkillRequirement( pUser, 900, weapon.reqSkill, "90", abilityID ); } } } - else //checking if both hands null if so, it is a wrestling skill + else// checking if both hands null if so, it is a wrestling skill { - if (abilityID == 5) + if( abilityID == 5 ) { - return checkSkillRequirement(pUser, 700, 43, "70"); + return checkSkillRequirement( pUser, 700, 43, "70" ); } - else if (abilityID == 11) + else if( abilityID == 11 ) { - return checkSkillRequirement(pUser, 900, 43, "90"); + return checkSkillRequirement( pUser, 900, 43, "90" ); } } return true; } -function CheckMana(pUser, abilityID, requiredMana) +function CheckMana( pUser, abilityID, requiredMana ) { - var NextUse = pUser.GetTempTag("doubleMana"); + var NextUse = pUser.GetTempTag( "doubleMana" ); var iTime = GetCurrentClock(); - if (pUser.mana <= requiredMana) + if( pUser.mana <= requiredMana ) { - pUser.TextMessage("You need " + requiredMana + " mana to perform that attack"); - DeactivateSpecialMove(pUser.socket, abilityID); + pUser.TextMessage( "You need " + requiredMana + " mana to perform that attack" ); + DeactivateSpecialMove( pUser.socket, abilityID ); return false; } else { - pUser.SetTempTag("doubleMana", iTime.toString()); - var Delay = 3000; - if ((iTime - NextUse) < Delay) + pUser.SetTempTag( "doubleMana", iTime.toString() ); + var Delay = 3000;// If abilitie is performed with 3 seconds of last abilitie it will then cost double mana + if(( iTime - NextUse ) < Delay ) { pUser.mana -= requiredMana * 2; return true; @@ -257,42 +258,42 @@ function onCombatDamageCalc( pAttacker, pDefender, fightSkill, hitLoc ) return 0; // Check if attacker has armor ignore enabled - if (abilityID == 1) // armorignore + if( abilityID == 1 ) // armorignore { // Armor Ignore ignores defense modifiers, but deals only 90% of potential damage damage *= 0.9; - if(fightSkill == 31) // Archery + if( fightSkill == 31 ) // Archery { // Cap damage from Armor Strike attack at 30 for archery weapons - if(damage > 30) + if( damage > 30 ) damage = 30; } else { // For all othe rfighting skills, cap damage from Armor Strike at 35 - if(damage > 35) + if( damage > 35 ) damage = 35; } } - else if (abilityID == 12)// shadowstrike + else if( abilityID == 12 )// shadowstrike { damage *= 1.25; } - else if (abilityID == 4)// crushingblow + else if( abilityID == 4 )// crushingblow { damage *= 1.5; } - else if (abilityID == 3)// ConcussionBlow + else if( abilityID == 3 )// ConcussionBlow { if (pDefender.maxhp > 0) { - var hitsPercent = (pDefender.hp / pDefender.maxhp) * 100.0; + var hitsPercent = ( pDefender.hp / pDefender.maxhp ) * 100.0; var manaPercent = 0; - if (pDefender.maxmana > 0) - manaPercent = (pDefender.mana / pDefender.maxmana) * 100.0; + if( pDefender.maxmana > 0 ) + manaPercent = ( pDefender.mana / pDefender.maxmana ) * 100.0; damage += Math.min(Math.floor(Math.abs(hitsPercent - manaPercent) / 4), 20); } @@ -316,7 +317,7 @@ function onCombatDamageCalc( pAttacker, pDefender, fightSkill, hitLoc ) function onAttack( pAttacker, pDefender ) { - var abilityID = pAttacker.GetTempTag("abilityID"); + var abilityID = pAttacker.GetTempTag( "abilityID" ); if (abilityID == 1) // armnor ignore { From 6d5228097154d7cc1338239d9b88d733bd7560c3 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Mon, 27 May 2024 20:13:51 -0500 Subject: [PATCH 05/28] added couple more moves Bleed Attack and Mortal Strike, --- data/js/combat/special_moves.js | 134 +++++++++++++++++++++++++------- data/js/item/potion.js | 2 +- data/js/skill/healing.js | 26 +++++++ 3 files changed, 131 insertions(+), 31 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index a94a93067..8b90c7133 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -8,10 +8,8 @@ function onSpecialMove(pUser, abilityID) return true; //The rest of the AOS Abilites before any other expansions - //Mortal Strike //Infectious Strike //Double Strike - //Bleed Attack //Whirlwind Attack } @@ -46,26 +44,26 @@ function RequiredSkill( pUser, abilityID ) "0x0e85": { primary: 0, secondary: 5, reqSkill: 40 }, "0x0e86": { primary: 0, secondary: 5, reqSkill: 40 }, // pickaxe // DoubleStrike, Disarm - "0x0E87": { primary: 0, secondary: 6, reqSkill: 42 }, - "0x0E88": { primary: 0, secondary: 6, reqSkill: 42 }, // Pitchforks // BleedAttack, Dismount + "0x0E87": { primary: 2, secondary: 6, reqSkill: 42 }, + "0x0E88": { primary: 2, secondary: 6, reqSkill: 42 }, // Pitchforks // BleedAttack, Dismount "0x0E89": { primary: 0, secondary: 3, reqSkill: 41 }, "0x0E8A": { primary: 0, secondary: 3, reqSkill: 41 }, // Quarter Staves // DoubleStrike, ConcussionBlow - "0x0EC2": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x0EC3": { primary: 0, secondary: 0, reqSkill: 40 }, // Cleavers // BleedAttack, InfectiousStrike + "0x0EC2": { primary: 2, secondary: 0, reqSkill: 40 }, + "0x0EC3": { primary: 2, secondary: 0, reqSkill: 40 }, // Cleavers // BleedAttack, InfectiousStrike - "0x0EC4": { primary: 12, secondary: 0, reqSkill: 40 }, - "0x0EC5": { primary: 12, secondary: 0, reqSkill: 40 }, // Skinning Knives // ShadowStrike, BleedAttack + "0x0EC4": { primary: 12, secondary: 2, reqSkill: 40 }, + "0x0EC5": { primary: 12, secondary: 2, reqSkill: 40 }, // Skinning Knives // ShadowStrike, BleedAttack "0x0F43": { primary: 1, secondary: 5, reqSkill: 40 }, "0x0F44": { primary: 1, secondary: 5, reqSkill: 40 }, // hatchets // ArmorIgnore, Disarm - "0x0F45": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x0F46": { primary: 0, secondary: 0, reqSkill: 40 }, // Executioner Axes // BleedAttack, MortalStrike + "0x0F45": { primary: 2, secondary: 9, reqSkill: 40 }, + "0x0F46": { primary: 2, secondary: 9, reqSkill: 40 }, // Executioner Axes // BleedAttack, MortalStrike - "0x0F47": { primary: 0, secondary: 3, reqSkill: 40 }, - "0x0F48": { primary: 0, secondary: 3, reqSkill: 40 }, // Battle Axes // BleedAttack, ConcussionBlow + "0x0F47": { primary: 2, secondary: 3, reqSkill: 40 }, + "0x0F48": { primary: 2, secondary: 3, reqSkill: 40 }, // Battle Axes // BleedAttack, ConcussionBlow "0x0F49": { primary: 4, secondary: 6, reqSkill: 40 }, "0x0F4A": { primary: 4, secondary: 6, reqSkill: 40 }, // Axes // CrushingBlow, Dismount @@ -76,8 +74,8 @@ function RequiredSkill( pUser, abilityID ) "0x0F4D": { primary: 11, secondary: 6, reqSkill: 40 }, "0x0F4E": { primary: 11, secondary: 6, reqSkill: 40 }, // Bardiches // ParalyzingBlow, Dismount - "0x0F4F": { primary: 3, secondary: 0, reqSkill: 31 }, - "0x0F50": { primary: 3, secondary: 0, reqSkill: 31 }, // Crossbows // ConcussionBlow, MortalStrike + "0x0F4F": { primary: 3, secondary: 9, reqSkill: 31 }, + "0x0F50": { primary: 3, secondary: 9, reqSkill: 31 }, // Crossbows // ConcussionBlow, MortalStrike "0x0F51": { primary: 0, secondary: 12, reqSkill: 40 }, "0x0F52": { primary: 0, secondary: 12, reqSkill: 40 }, // Daggers // InfectiousStrike, ShadowStrike @@ -99,11 +97,11 @@ function RequiredSkill( pUser, abilityID ) "0x0FB4": { primary: 4, secondary: 12, reqSkill: 41 }, "0x0FB5": { primary: 4, secondary: 12, reqSkill: 41 }, // Sledge hammers // CrushingBlow, ShadowStrike - "0x13AF": { primary: 1, secondary: 0, reqSkill: 40 }, - "0x13B0": { primary: 1, secondary: 0, reqSkill: 40 }, // War Axes // ArmorIgnore, BleedAttack + "0x13AF": { primary: 1, secondary: 2, reqSkill: 40 }, + "0x13B0": { primary: 1, secondary: 2, reqSkill: 40 }, // War Axes // ArmorIgnore, BleedAttack - "0x13B1": { primary: 11, secondary: 0, reqSkill: 31 }, - "0x13B2": { primary: 11, secondary: 0, reqSkill: 31 }, // Bows // ParalyzingBlow, MortalStrike + "0x13B1": { primary: 11, secondary: 9, reqSkill: 31 }, + "0x13B2": { primary: 11, secondary: 9, reqSkill: 31 }, // Bows // ParalyzingBlow, MortalStrike "0x13B3": { primary: 12, secondary: 6, reqSkill: 41 }, "0x13B4": { primary: 12, secondary: 6, reqSkill: 41 }, // Clubs // ShadowStrike, Dismount @@ -126,8 +124,8 @@ function RequiredSkill( pUser, abilityID ) "0x13F8": { primary: 3, secondary: 0, reqSkill: 41 }, "0x13F9": { primary: 3, secondary: 0, reqSkill: 41 }, // Gnarled Staves // ConcussionBlow,ForceOfNature - "0x13FA": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x13FB": { primary: 0, secondary: 0, reqSkill: 40 }, // Large Battle Axes // WhirlwindAttack,BleedAttack + "0x13FA": { primary: 0, secondary: 2, reqSkill: 40 }, + "0x13FB": { primary: 0, secondary: 2, reqSkill: 40 }, // Large Battle Axes // WhirlwindAttack,BleedAttack "0x13FE": { primary: 0, secondary: 1, reqSkill: 40 }, "0x13FF": { primary: 0, secondary: 1, reqSkill: 40 }, // Katana // DoubleStrike,ArmorIgnore @@ -135,14 +133,14 @@ function RequiredSkill( pUser, abilityID ) "0x1400": { primary: 1, secondary: 0, reqSkill: 42 }, "0x1401": { primary: 1, secondary: 0, reqSkill: 42 }, // Kryss // ArmorIgnore,InfectiousStrike - "0x1402": { primary: 12, secondary: 0, reqSkill: 42 }, - "0x1403": { primary: 12, secondary: 0, reqSkill: 42 }, // Short Spears // ShadowStrike,MortalStrike + "0x1402": { primary: 12, secondary: 9, reqSkill: 42 }, + "0x1403": { primary: 12, secondary: 9, reqSkill: 42 }, // Short Spears // ShadowStrike,MortalStrike - "0x1404": { primary: 0, secondary: 5, reqSkill: 42 }, - "0x1405": { primary: 0, secondary: 5, reqSkill: 42 }, // War Forks // BleedAttack,Disarm + "0x1404": { primary: 2, secondary: 5, reqSkill: 42 }, + "0x1405": { primary: 2, secondary: 5, reqSkill: 42 }, // War Forks // BleedAttack,Disarm - "0x1406": { primary: 4, secondary: 0, reqSkill: 41 }, - "0x1407": { primary: 4, secondary: 0, reqSkill: 41 }, // War Maces // CrushingBlow,MortalStrike + "0x1406": { primary: 4, secondary: 9, reqSkill: 41 }, + "0x1407": { primary: 4, secondary: 9, reqSkill: 41 }, // War Maces // CrushingBlow,MortalStrike "0x1438": { primary: 0, secondary: 4, reqSkill: 41 }, "0x1439": { primary: 0, secondary: 4, reqSkill: 41 }, // War Hammers // WhirlwindAttack,CrushingBlow @@ -150,14 +148,14 @@ function RequiredSkill( pUser, abilityID ) "0x143A": { primary: 0, secondary: 3, reqSkill: 41 }, "0x143B": { primary: 0, secondary: 3, reqSkill: 41 }, // Mauls // DoubleStrike,ConcussionBlow - "0x143C": { primary: 1, secondary: 0, reqSkill: 41 }, - "0x143D": { primary: 1, secondary: 0, reqSkill: 41 }, // Hammer Picks // ArmorIgnore,MortalStrike + "0x143C": { primary: 1, secondary: 9, reqSkill: 41 }, + "0x143D": { primary: 1, secondary: 9, reqSkill: 41 }, // Hammer Picks // ArmorIgnore,MortalStrike "0x143E": { primary: 0, secondary: 3, reqSkill: 40 }, "0x143F": { primary: 0, secondary: 3, reqSkill: 40 }, // Halberds // WhirlwindAttack,ConcussionBlow - "0x1440": { primary: 0, secondary: 12, reqSkill: 40 }, - "0x1441": { primary: 0, secondary: 12, reqSkill: 40 }, // Cutlasses // BleedAttack,ShadowStrike + "0x1440": { primary: 2, secondary: 12, reqSkill: 40 }, + "0x1441": { primary: 2, secondary: 12, reqSkill: 40 }, // Cutlasses // BleedAttack,ShadowStrike "0x1442": { primary: 0, secondary: 12, reqSkill: 40 }, "0x1443": { primary: 0, secondary: 12, reqSkill: 40 } // Two Handed Axes // DoubleStrike,ShadowStrike @@ -534,6 +532,63 @@ function onAttack( pAttacker, pDefender ) pAttacker.SoundEffect(0x213, true); pDefender.StaticEffect(0x377A, 0x09, 0x32); } + else if (abilityID == 9) // Mortal Strike + {// turn healthbar yellow on defender need spacket sent for this. + var requiredMana = 30; + + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + + // Clear out any current ability the player is doing when he switches abilities + if (abilityID != 9) + DeactivateSpecialMove(pAttacker, abilityID); + + pAttacker.SysMessage("You deliver a mortal wound!"); + pDefender.SysMessage("You have been mortally wounded!"); + + pAttacker.SoundEffect(0x1E1, true); + pDefender.StaticEffect(0x37B9, 0x09, 0x32); + + pDefender.SetTempTag("blockHeal", true); + + var seconds = 6000; // We want this applied to players even if they are "offline" (aka disconnected but not vanished from view yet) + if (pDefender.npc) + { + seconds = 12000; + } + pDefender.StartTimer(seconds, 9200, true); + + if( pDefender.socket ) + TriggerEvent( 50104, "AddBuff", pDefender, 1027, 1075810, 1075811, 6, " " ); + + ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + } + + else if (abilityID == 2) // bleedattack + { + var requiredMana = 30; + + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + + // Clear out any current ability the player is doing when he switches abilities + if (abilityID != 2) + DeactivateSpecialMove(pAttacker, abilityID); + + pAttacker.SysMessage("Your target is bleeding!"); + pDefender.SysMessage("You are bleeding!"); + + pDefender.TextMessage("You are bleeding profusely", false, 0x21); + pDefender.TextMessage(pDefender.name + " is bleeding profusely", true, 0x21, 1); + + pDefender.StartTimer(10, 9300, true); + pDefender.SetTempTag("doBleed", true); + + pAttacker.SoundEffect(0x133, true); + pDefender.StaticEffect(0x377A, 0x09, 0x32); + } } function ClearSpecialMove(pUser, abilityID) @@ -572,12 +627,16 @@ function onTimer( timerObj, timerID ) { var socket = timerObj.socket; var abilityID = timerObj.GetTempTag("abilityID"); + var damage = 31; + if (timerObj == null || timerObj.dead) { timerObj.frozen = false; timerObj.SetTempTag("IsImmune", null); timerObj.RemoveScriptTrigger(7002); timerObj.SetTempTag("BlockEquip", null); + timerObj.SetTempTag("blockHeal", null); + timerObj.SetTempTag("doBleed", null); ClearSpecialMove(timerObj, abilityID); return; } @@ -595,4 +654,19 @@ function onTimer( timerObj, timerID ) timerObj.SetTempTag("BlockEquip", null); socket.SysMessage("Your confusion has passed, you may now arm a weapon!"); } + else if (timerID == 9200) + { + timerObj.SetTempTag("blockHeal", null); + socket.SysMessage("You are no longer mortally wounded."); + } + else if (timerID == 9300) + { + timerObj.SetTempTag("doBleed", null); + socket.SysMessage("The bleeding wounds have healed, you are no longer bleeding!"); + } + if (timerObj.GetTempTag("doBleed") == true) + { + damage -= 3; + timerObj.hp -= damage; + } } \ No newline at end of file diff --git a/data/js/item/potion.js b/data/js/item/potion.js index d92697cfb..c84c16900 100644 --- a/data/js/item/potion.js +++ b/data/js/item/potion.js @@ -161,7 +161,7 @@ function onUseChecked( pUser, iUsed ) case 4: // Heal Potion if( pUser.health < pUser.maxhp ) { - if( pUser.poison > 0 ) + if( pUser.poison > 0 || pUser.GetTempTag( "blockHeal" ) == true ) { pUser.SysMessage( GetDictionaryEntry( 9058, socket.language )); // You can not heal yourself in your current state. return; diff --git a/data/js/skill/healing.js b/data/js/skill/healing.js index 6523eb4a7..eb7cf9703 100644 --- a/data/js/skill/healing.js +++ b/data/js/skill/healing.js @@ -232,6 +232,32 @@ function onCallback1( socket, ourObj ) } else // Heal { + + if( ourObj.GetTempTag( "blockHeal" ) == true ) + { + if( ourObj != mChar && ourObj.socket ) + { + socket.SysMessage( "You cannot heal that target in their current state." ); + } + else + { + socket.SysMessage( GetDictionaryEntry( 9058, socket.language ));// You can not heal yourself in your current state. + } + } + else if( ourObj.GetTempTag( "doBleed" ) == true ) + { + if( ourObj != mChar && ourObj.socket ) + { + socket.SysMessage( "You bind the wound and stop the bleeding" ); + } + else + { + socket.SysMessage( "The bleeding wounds have healed, you are no longer bleeding!" ); + } + ourObj.KillJSTimer( 9300, 7001 ); + ourObj.SetTempTag( "doBleed", null ); + } + // Consume some bandages if( bItem.amount > 1 ) { From 0b8edf8a6316640dc61554d0961bb293698a61ec Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Tue, 28 May 2024 20:16:15 -0500 Subject: [PATCH 06/28] Added Infectious Strike --- data/js/combat/special_moves.js | 135 +++++++++++++++++++++++--------- 1 file changed, 99 insertions(+), 36 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index 8b90c7133..81e413026 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -8,7 +8,6 @@ function onSpecialMove(pUser, abilityID) return true; //The rest of the AOS Abilites before any other expansions - //Infectious Strike //Double Strike //Whirlwind Attack } @@ -50,8 +49,8 @@ function RequiredSkill( pUser, abilityID ) "0x0E89": { primary: 0, secondary: 3, reqSkill: 41 }, "0x0E8A": { primary: 0, secondary: 3, reqSkill: 41 }, // Quarter Staves // DoubleStrike, ConcussionBlow - "0x0EC2": { primary: 2, secondary: 0, reqSkill: 40 }, - "0x0EC3": { primary: 2, secondary: 0, reqSkill: 40 }, // Cleavers // BleedAttack, InfectiousStrike + "0x0EC2": { primary: 2, secondary: 8, reqSkill: 40 }, + "0x0EC3": { primary: 2, secondary: 8, reqSkill: 40 }, // Cleavers // BleedAttack, InfectiousStrike "0x0EC4": { primary: 12, secondary: 2, reqSkill: 40 }, "0x0EC5": { primary: 12, secondary: 2, reqSkill: 40 }, // Skinning Knives // ShadowStrike, BleedAttack @@ -77,8 +76,8 @@ function RequiredSkill( pUser, abilityID ) "0x0F4F": { primary: 3, secondary: 9, reqSkill: 31 }, "0x0F50": { primary: 3, secondary: 9, reqSkill: 31 }, // Crossbows // ConcussionBlow, MortalStrike - "0x0F51": { primary: 0, secondary: 12, reqSkill: 40 }, - "0x0F52": { primary: 0, secondary: 12, reqSkill: 40 }, // Daggers // InfectiousStrike, ShadowStrike + "0x0F51": { primary: 8, secondary: 12, reqSkill: 40 }, + "0x0F52": { primary: 8, secondary: 12, reqSkill: 40 }, // Daggers // InfectiousStrike, ShadowStrike "0x0F5C": { primary: 3, secondary: 5, reqSkill: 41 }, "0x0F5D": { primary: 3, secondary: 5, reqSkill: 41 }, // Maces // ConcussionBlow, Disarm @@ -118,8 +117,8 @@ function RequiredSkill( pUser, abilityID ) "0x13E3": { primary: 4, secondary: 12, reqSkill: 41 }, "0x13E4": { primary: 4, secondary: 12, reqSkill: 41 }, // Smith's Hammers // CrushingBlow, ShadowStrike - "0x13F6": { primary: 0, secondary: 5, reqSkill: 40 }, - "0x13F7": { primary: 0, secondary: 5, reqSkill: 40 }, // Butcher Knives // InfectiousStrike,Disarm + "0x13F6": { primary: 8, secondary: 5, reqSkill: 40 }, + "0x13F7": { primary: 8, secondary: 5, reqSkill: 40 }, // Butcher Knives // InfectiousStrike,Disarm "0x13F8": { primary: 3, secondary: 0, reqSkill: 41 }, "0x13F9": { primary: 3, secondary: 0, reqSkill: 41 }, // Gnarled Staves // ConcussionBlow,ForceOfNature @@ -130,8 +129,8 @@ function RequiredSkill( pUser, abilityID ) "0x13FE": { primary: 0, secondary: 1, reqSkill: 40 }, "0x13FF": { primary: 0, secondary: 1, reqSkill: 40 }, // Katana // DoubleStrike,ArmorIgnore - "0x1400": { primary: 1, secondary: 0, reqSkill: 42 }, - "0x1401": { primary: 1, secondary: 0, reqSkill: 42 }, // Kryss // ArmorIgnore,InfectiousStrike + "0x1400": { primary: 1, secondary: 8, reqSkill: 42 }, + "0x1401": { primary: 1, secondary: 8, reqSkill: 42 }, // Kryss // ArmorIgnore,InfectiousStrike "0x1402": { primary: 12, secondary: 9, reqSkill: 42 }, "0x1403": { primary: 12, secondary: 9, reqSkill: 42 }, // Short Spears // ShadowStrike,MortalStrike @@ -369,6 +368,10 @@ function onAttack( pAttacker, pDefender ) { var requiredMana = 16; + // Clear out any current ability the player is doing when he switches abilities + if (abilityID != 6) + DeactivateSpecialMove(pAttacker.socket, abilityID); + //checking mana if (!CheckMana(pAttacker, abilityID, requiredMana)) return true; @@ -381,10 +384,6 @@ function onAttack( pAttacker, pDefender ) return true; } - // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 6) - DeactivateSpecialMove(pAttacker.socket, abilityID); - // Only Can work on players or npcs that is mounted if (!pDefender.isonhorse) { @@ -407,14 +406,15 @@ function onAttack( pAttacker, pDefender ) { var requiredMana = 30; - //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) - return true; // Clear out any current ability the player is doing when he switches abilities if (abilityID != 11) DeactivateSpecialMove(pAttacker.socket, abilityID); + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + pAttacker.SoundEffect(0x204, true); pDefender.StaticEffect(0x376A, 0x09, 0x32); var IsImmune = pDefender.GetTempTag("IsImmune") @@ -465,14 +465,14 @@ function onAttack( pAttacker, pDefender ) return false; } - //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) - return true; - // Clear out any current ability the player is doing when he switches abilities if (abilityID != 5) DeactivateSpecialMove(pAttacker, abilityID); + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + pAttacker.SoundEffect(0x3B9, true); pDefender.StaticEffect(0x37BE, 0x09, 0x32); @@ -501,14 +501,14 @@ function onAttack( pAttacker, pDefender ) { var requiredMana = 20; - //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) - return true; - // Clear out any current ability the player is doing when he switches abilities if (abilityID != 4) DeactivateSpecialMove(pAttacker, abilityID); + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + pAttacker.SysMessage("You have delivered a crushing blow!"); pDefender.SysMessage("You take extra damage from the crushing attack!"); @@ -518,14 +518,14 @@ function onAttack( pAttacker, pDefender ) { var requiredMana = 20; - //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) - return true; - // Clear out any current ability the player is doing when he switches abilities if (abilityID != 3) DeactivateSpecialMove(pAttacker, abilityID); + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + pAttacker.SysMessage("You have delivered a concussion!"); pDefender.SysMessage("You feel disoriented!"); @@ -536,14 +536,14 @@ function onAttack( pAttacker, pDefender ) {// turn healthbar yellow on defender need spacket sent for this. var requiredMana = 30; - //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) - return true; - // Clear out any current ability the player is doing when he switches abilities if (abilityID != 9) DeactivateSpecialMove(pAttacker, abilityID); + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + pAttacker.SysMessage("You deliver a mortal wound!"); pDefender.SysMessage("You have been mortally wounded!"); @@ -569,14 +569,14 @@ function onAttack( pAttacker, pDefender ) { var requiredMana = 30; - //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) - return true; - // Clear out any current ability the player is doing when he switches abilities if (abilityID != 2) DeactivateSpecialMove(pAttacker, abilityID); + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + pAttacker.SysMessage("Your target is bleeding!"); pDefender.SysMessage("You are bleeding!"); @@ -589,6 +589,68 @@ function onAttack( pAttacker, pDefender ) pAttacker.SoundEffect(0x133, true); pDefender.StaticEffect(0x377A, 0x09, 0x32); } + else if (abilityID == 8) // Infectious Strike + { + var requiredMana = 20; + var itemRHand = pAttacker.FindItemLayer(0x01); + var itemLHand = pAttacker.FindItemLayer(0x02); + + // Clear out any current ability the player is doing when he switches abilities + if (abilityID != 8) + DeactivateSpecialMove(pAttacker, abilityID); + + //checking mana + if (!CheckMana(pAttacker, abilityID, requiredMana)) + return true; + + if (itemLHand != null && itemLHand.poison <= 0 || itemRHand != null && itemRHand.poison <= 0) + { + pDefender.SysMessage("Your weapon must have a dose of poison to perform an infectious strike!"); + return; + } + + var level = 0; + var chance = Math.random(); + if (pAttacker.skills[30] >= 0 && pAttacker.skills[30] <= 199) + { + level = 1; + } + else if (pAttacker.skills[30] >= 200 && pAttacker.skills[30] <= 399) + { + level = 2; + } + else if (pAttacker.skills[30] >= 400 && pAttacker.skills[30] <= 599) + { + level = 3; + } + else if (pAttacker.skills[30] >= 600 && pAttacker.skills[30] <= 1000) + { + level = 4; + } + + // Adjust the poison level based on chance + if (chance < 0.2) + { + level--; // Decrease the level by 1 + if (level < 0) + { + level = 1; // Ensure the level doesn't go below 0 and is always set to least 1 + } + } + else if (chance > 0.8) + { + level++; // Increase the level by 1 + pAttacker.SysMessage("Your precise strike has increased the level of the poison by 1"); + pDefender.SysMessage("The poison seems extra effective!"); + } + + pAttacker.TextMessage("You have poisoned your target : " + pDefender.name); + pDefender.TextMessage(pAttacker.name +" : poisoned you!"); + pDefender.poison = level; + + pAttacker.SoundEffect(0xDD, true); + pDefender.StaticEffect(0x3728, 0x09, 0x32); + } } function ClearSpecialMove(pUser, abilityID) @@ -668,5 +730,6 @@ function onTimer( timerObj, timerID ) { damage -= 3; timerObj.hp -= damage; + timerObj.StaticEffect(0x122A, 0, 15); // blood effect } } \ No newline at end of file From 680ecc1d30c7147e0e6d6d21b1819ec5d1839a99 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Wed, 29 May 2024 17:46:05 -0500 Subject: [PATCH 07/28] fixes Fixed timers to use scriptid Fixed Bleed timer added buff to bleed. --- data/js/combat/special_moves.js | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index 81e413026..6b0b2e6b3 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -406,7 +406,6 @@ function onAttack( pAttacker, pDefender ) { var requiredMana = 30; - // Clear out any current ability the player is doing when he switches abilities if (abilityID != 11) DeactivateSpecialMove(pAttacker.socket, abilityID); @@ -437,8 +436,8 @@ function onAttack( pAttacker, pDefender ) } pDefender.SetTempTag("IsImmune", true); - pDefender.StartTimer(seconds + 8000, 9000, true); - pDefender.StartTimer(seconds, 8000, true); + pDefender.StartTimer(seconds + 8000, 9000, 7001); + pDefender.StartTimer(seconds, 8000, 7001); pDefender.frozen = true; if (pAttacker.socket) @@ -491,7 +490,7 @@ function onAttack( pAttacker, pDefender ) pDefender.AddScriptTrigger(7002);//block equip for 5 seconds script added pDefender.SetTempTag("BlockEquip", true); - pDefender.StartTimer(5000, 9100, true); + pDefender.StartTimer(5000, 9100, 7001); TriggerEvent(50104, "AddBuff", pDefender, 0x3ea, 1075637, 0, 5, " "); @@ -583,11 +582,17 @@ function onAttack( pAttacker, pDefender ) pDefender.TextMessage("You are bleeding profusely", false, 0x21); pDefender.TextMessage(pDefender.name + " is bleeding profusely", true, 0x21, 1); - pDefender.StartTimer(10, 9300, true); + pDefender.StartTimer(10000, 9300, 7001); + pDefender.StartTimer(2000, 9400, 7001); pDefender.SetTempTag("doBleed", true); + if (pDefender.socket) + TriggerEvent(50104, "AddBuff", pDefender, 1039, 1075829, 1075830, 10, " 1, 10 ,2"); + pAttacker.SoundEffect(0x133, true); pDefender.StaticEffect(0x377A, 0x09, 0x32); + + ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success } else if (abilityID == 8) // Infectious Strike { @@ -698,6 +703,7 @@ function onTimer( timerObj, timerID ) timerObj.RemoveScriptTrigger(7002); timerObj.SetTempTag("BlockEquip", null); timerObj.SetTempTag("blockHeal", null); + timerObj.KillJSTimer(9400, 7001); timerObj.SetTempTag("doBleed", null); ClearSpecialMove(timerObj, abilityID); return; @@ -724,12 +730,14 @@ function onTimer( timerObj, timerID ) else if (timerID == 9300) { timerObj.SetTempTag("doBleed", null); + timerObj.KillJSTimer(9400, 7001); socket.SysMessage("The bleeding wounds have healed, you are no longer bleeding!"); } - if (timerObj.GetTempTag("doBleed") == true) + else if (timerID == 9400) { - damage -= 3; - timerObj.hp -= damage; - timerObj.StaticEffect(0x122A, 0, 15); // blood effect + var damage = RandomNumber(1, 10); + timerObj.health -= damage; + //timerObj.StaticEffect(0x122A, 0, 15); // blood effect got to figure how to add it to ground. + timerObj.StartTimer(2000, 9400, 7001);//restart timer every 2 seconds until it shuts off } } \ No newline at end of file From 707558681ceaf97f0ec4e8ce04491313a0f2dea5 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Wed, 29 May 2024 22:47:50 -0500 Subject: [PATCH 08/28] Update special_moves.js --- data/js/combat/special_moves.js | 390 ++++++++++++++++---------------- 1 file changed, 196 insertions(+), 194 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index 6b0b2e6b3..4a8f5c865 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -1,10 +1,14 @@ -function onSpecialMove(pUser, abilityID) +function onSpecialMove( pUser, abilityID ) { // Check Skills - if (!RequiredSkill(pUser, abilityID)) + if( !RequiredSkill( pUser, abilityID )) return true; - pUser.SetTempTag("abilityID", abilityID); + // Check Mana + if( !CheckMana( pUser, abilityID )) + return true; + + pUser.SetTempTag( "abilityID", abilityID ); return true; //The rest of the AOS Abilites before any other expansions @@ -214,14 +218,31 @@ function RequiredSkill( pUser, abilityID ) return true; } -function CheckMana( pUser, abilityID, requiredMana ) +function CheckMana( pUser, abilityID ) { + var abilitieMana = { + 1: { manaAmount: 14 }, + 2: { manaAmount: 30 }, + 3: { manaAmount: 20 }, + 4: { manaAmount: 20 }, + 5: { manaAmount: 20 }, + 6: { manaAmount: 16 }, + 7: { manaAmount: 20 }, + 8: { manaAmount: 20 }, + 9: { manaAmount: 30 }, + 10: { manaAmount: 30 }, + 11: { manaAmount: 30 }, + 12: { manaAmount: 20 } + }; + var NextUse = pUser.GetTempTag( "doubleMana" ); var iTime = GetCurrentClock(); + var requiredMana = abilitieMana[abilityID].manaAmount; + if( pUser.mana <= requiredMana ) { - pUser.TextMessage( "You need " + requiredMana + " mana to perform that attack" ); - DeactivateSpecialMove( pUser.socket, abilityID ); + pUser.SysMessage( "You need " + requiredMana + " mana to perform that attack" ); + DeactivateSpecialMove( pUser, abilityID ); return false; } else @@ -314,18 +335,21 @@ function onCombatDamageCalc( pAttacker, pDefender, fightSkill, hitLoc ) function onAttack( pAttacker, pDefender ) { - var abilityID = pAttacker.GetTempTag( "abilityID" ); + var abilityID = pAttacker.GetTempTag("abilityID"); + + onAbility(pAttacker, pDefender, abilityID); +} +function onAbility(pAttacker, pDefender, abilityID) +{ if (abilityID == 1) // armnor ignore { - var requiredMana = 14; - // Clear out any current ability the player is doing when he switches abilities if (abilityID != 1) DeactivateSpecialMove(pAttacker.socket, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) + if (!CheckMana(pAttacker, abilityID)) return true; pAttacker.TextMessage("Your attack penetrates their armor!"); @@ -333,134 +357,86 @@ function onAttack( pAttacker, pDefender ) pDefender.SoundEffect(0x0056, true); pDefender.StaticEffect(0x3728, 0x09, 0x06); + + ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success } - else if (abilityID == 12) // shadowstrike + else if (abilityID == 2) // bleedattack { - var requiredMana = 20; - - if (pAttacker.skills[47] < 800) // Stealth - { - pAttacker.TextMessage("You lack the required stealth to perform that attack"); - return true; - } - // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 12) - DeactivateSpecialMove(pAttacker.socket, abilityID); + if (abilityID != 2) + DeactivateSpecialMove(pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) + if (!CheckMana(pAttacker, abilityID)) return true; - pAttacker.TextMessage("You strike and hide in the shadows!"); - pDefender.TextMessage("You are dazed by the attack and your attacker vanishes!"); + pAttacker.SysMessage("Your target is bleeding!"); + pDefender.SysMessage("You are bleeding!"); - pAttacker.StaticEffect(0x376A, 0x09, 0x06); + pDefender.TextMessage("You are bleeding profusely", false, 0x21); + pDefender.TextMessage(pDefender.name + " is bleeding profusely", true, 0x21, 1); - pDefender.SoundEffect(0x482, true); - pDefender.StaticEffect(0x37BE, 0x09, 0x06); + pDefender.StartTimer(10000, 9300, 7001); + pDefender.StartTimer(2000, 9400, 7001); + pDefender.SetTempTag("doBleed", true); - pAttacker.atWar = false; - pDefender.atWar = false; - pAttacker.visible = 1; + if (pDefender.socket) + TriggerEvent(50104, "AddBuff", pDefender, 1039, 1075829, 1075830, 10, " 1, 10 ,2"); + + pAttacker.SoundEffect(0x133, true); + pDefender.StaticEffect(0x377A, 0x09, 0x32); + + ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success } - else if (abilityID == 6) // Dismount + else if (abilityID == 3) // ConcussionBlow { - var requiredMana = 16; // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 6) - DeactivateSpecialMove(pAttacker.socket, abilityID); + if (abilityID != 3) + DeactivateSpecialMove(pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) - return true; - - // Check to see if player is mount or flying. - if (pAttacker.isonhorse) - { - pAttacker.TextMessage("You cannot perform that attack while mounted or flying!"); - DeactivateSpecialMove(pAttacker.socket, abilityID); + if (!CheckMana(pAttacker, abilityID)) return true; - } - // Only Can work on players or npcs that is mounted - if (!pDefender.isonhorse) - { - pAttacker.TextMessage("This attack only works on mounted or flying targets"); - return true; - } + pAttacker.SysMessage("You have delivered a concussion!"); + pDefender.SysMessage("You feel disoriented!"); - //Lesser Hiryu have an 80% chance of missing this attack needs added + pAttacker.SoundEffect(0x213, true); + pDefender.StaticEffect(0x377A, 0x09, 0x32); - //This is the Dismount Information sent to Attacker and Defender - pDefender.SoundEffect(0x140, true); - pDefender.StaticEffect(0x3728, 0x09, 0x06); - pAttacker.TextMessage("The force of your attack has dislodged them from their mount!"); - pDefender.Dismount(); - pDefender.TextMessage("You have been knocked off of your mount by " + pAttacker.name + "!"); - pAttacker.SetTempTag("Dismount", false); ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success } - else if (abilityID == 11) // ParalyzingBlow + else if (abilityID == 4) // crushingblow { - var requiredMana = 30; // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 11) - DeactivateSpecialMove(pAttacker.socket, abilityID); + if (abilityID != 4) + DeactivateSpecialMove(pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) - return true; - - pAttacker.SoundEffect(0x204, true); - pDefender.StaticEffect(0x376A, 0x09, 0x32); - var IsImmune = pDefender.GetTempTag("IsImmune") - - if (IsImmune != null && IsImmune == true) - { - pAttacker.TextMessage("Your target resists paralysis."); - pDefender.TextMessage("You resist paralysis."); + if (!CheckMana(pAttacker, abilityID)) return true; - } - - var seconds = 3000; // We want this applied to players even if they are "offline" (aka disconnected but not vanished from view yet) - if (pDefender.npc) - { - seconds = 6000; - } - else if (pDefender.socket) - { - pDefender.TextMessage("The attack has temporarily paralyzed you!", false, 0x3b2, 0, pDefender.serial);// The attack has temporarily paralyzed you! - } - pDefender.SetTempTag("IsImmune", true); - pDefender.StartTimer(seconds + 8000, 9000, 7001); - pDefender.StartTimer(seconds, 8000, 7001); - pDefender.frozen = true; + pAttacker.SysMessage("You have delivered a crushing blow!"); + pDefender.SysMessage("You take extra damage from the crushing attack!"); - if (pAttacker.socket) - { - pAttacker.TextMessage(GetDictionaryEntry(17702, pAttacker.socket.language), false, 0x3b2, 0, pAttacker.serial);// You deliver a paralyzing blow! - } - ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + pAttacker.SoundEffect(0x1E1, true); } else if (abilityID == 5) // Disarm { var itemRHand = pDefender.FindItemLayer(0x01); var itemLHand = pDefender.FindItemLayer(0x02); - var requiredMana = 20; - if (pDefender.pack == null || itemLHand != null && itemLHand.movable >= 2 || itemRHand != null && itemRHand.movable >= 2) - { + if (pDefender.pack == null || itemLHand != null && itemLHand.movable >= 2 || itemRHand != null && itemRHand.movable >= 2) { pAttacker.SysMessage("You cannot disarm your opponent."); + DeactivateSpecialMove(pAttacker.socket, abilityID); return false; } - if (itemLHand != null && itemLHand.type == 9 || itemRHand != null && itemRHand.type == 9) - { + if (itemLHand != null && itemLHand.type == 9 || itemRHand != null && itemRHand.type == 9) { pAttacker.SysMessage("Your target is already unarmed!"); + DeactivateSpecialMove(pAttacker.socket, abilityID); return false; } @@ -469,7 +445,7 @@ function onAttack( pAttacker, pDefender ) DeactivateSpecialMove(pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) + if (!CheckMana(pAttacker, abilityID)) return true; pAttacker.SoundEffect(0x3B9, true); @@ -478,13 +454,11 @@ function onAttack( pAttacker, pDefender ) pAttacker.SysMessage("You disarm their weapon!"); pDefender.SysMessage("Your weapon has been disarmed!"); - if (itemLHand != null) - { + if (itemLHand != null) { itemLHand.container = pDefender.pack; } - if (itemRHand != null) - { + if (itemRHand != null) { itemRHand.container = pDefender.pack; } @@ -496,51 +470,103 @@ function onAttack( pAttacker, pDefender ) ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success } - else if (abilityID == 4) // crushingblow + else if (abilityID == 6) // Dismount { - var requiredMana = 20; - // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 4) - DeactivateSpecialMove(pAttacker, abilityID); + if (abilityID != 6) + DeactivateSpecialMove(pAttacker.socket, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) + if (!CheckMana(pAttacker, abilityID)) return true; - pAttacker.SysMessage("You have delivered a crushing blow!"); - pDefender.SysMessage("You take extra damage from the crushing attack!"); + // Check to see if player is mount or flying. + if (pAttacker.isonhorse) { + pAttacker.TextMessage("You cannot perform that attack while mounted or flying!"); + DeactivateSpecialMove(pAttacker.socket, abilityID); + return true; + } - pAttacker.SoundEffect(0x1E1, true); + // Only Can work on players or npcs that is mounted + if (!pDefender.isonhorse) { + pAttacker.TextMessage("This attack only works on mounted or flying targets"); + return true; + } + + //Lesser Hiryu have an 80% chance of missing this attack needs added + + //This is the Dismount Information sent to Attacker and Defender + pDefender.SoundEffect(0x140, true); + pDefender.StaticEffect(0x3728, 0x09, 0x06); + pAttacker.TextMessage("The force of your attack has dislodged them from their mount!"); + pDefender.Dismount(); + pDefender.TextMessage("You have been knocked off of your mount by " + pAttacker.name + "!"); + pAttacker.SetTempTag("Dismount", false); + ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success } - else if (abilityID == 3) // ConcussionBlow + else if (abilityID == 8) // Infectious Strike { - var requiredMana = 20; + var itemRHand = pAttacker.FindItemLayer(0x01); + var itemLHand = pAttacker.FindItemLayer(0x02); // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 3) + if (abilityID != 8) DeactivateSpecialMove(pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) + if (!CheckMana(pAttacker, abilityID)) return true; - pAttacker.SysMessage("You have delivered a concussion!"); - pDefender.SysMessage("You feel disoriented!"); + if (itemLHand != null && itemLHand.poison <= 0 || itemRHand != null && itemRHand.poison <= 0) { + pDefender.SysMessage("Your weapon must have a dose of poison to perform an infectious strike!"); + return; + } - pAttacker.SoundEffect(0x213, true); - pDefender.StaticEffect(0x377A, 0x09, 0x32); + var level = 0; + var chance = Math.random(); + if (pAttacker.skills[30] >= 0 && pAttacker.skills[30] <= 199) { + level = 1; + } + else if (pAttacker.skills[30] >= 200 && pAttacker.skills[30] <= 399) { + level = 2; + } + else if (pAttacker.skills[30] >= 400 && pAttacker.skills[30] <= 599) { + level = 3; + } + else if (pAttacker.skills[30] >= 600 && pAttacker.skills[30] <= 1000) { + level = 4; + } + + // Adjust the poison level based on chance + if (chance < 0.2) { + level--; // Decrease the level by 1 + if (level < 0) { + level = 1; // Ensure the level doesn't go below 0 and is always set to least 1 + } + } + else if (chance > 0.8) { + level++; // Increase the level by 1 + pAttacker.SysMessage("Your precise strike has increased the level of the poison by 1"); + pDefender.SysMessage("The poison seems extra effective!"); + } + + pAttacker.TextMessage("You have poisoned your target : " + pDefender.name); + pDefender.TextMessage(pAttacker.name + " : poisoned you!"); + pDefender.poison = level; + + pAttacker.SoundEffect(0xDD, true); + pDefender.StaticEffect(0x3728, 0x09, 0x32); + ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success } else if (abilityID == 9) // Mortal Strike {// turn healthbar yellow on defender need spacket sent for this. - var requiredMana = 30; // Clear out any current ability the player is doing when he switches abilities if (abilityID != 9) DeactivateSpecialMove(pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) + if (!CheckMana(pAttacker, abilityID)) return true; pAttacker.SysMessage("You deliver a mortal wound!"); @@ -552,109 +578,84 @@ function onAttack( pAttacker, pDefender ) pDefender.SetTempTag("blockHeal", true); var seconds = 6000; // We want this applied to players even if they are "offline" (aka disconnected but not vanished from view yet) - if (pDefender.npc) - { + if (pDefender.npc) { seconds = 12000; } pDefender.StartTimer(seconds, 9200, true); - if( pDefender.socket ) - TriggerEvent( 50104, "AddBuff", pDefender, 1027, 1075810, 1075811, 6, " " ); + if (pDefender.socket) + TriggerEvent(50104, "AddBuff", pDefender, 1027, 1075810, 1075811, 6, " "); ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success } - - else if (abilityID == 2) // bleedattack + else if (abilityID == 11) // ParalyzingBlow { - var requiredMana = 30; - // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 2) - DeactivateSpecialMove(pAttacker, abilityID); + if (abilityID != 11) + DeactivateSpecialMove(pAttacker.socket, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) + if (!CheckMana(pAttacker, abilityID)) return true; - pAttacker.SysMessage("Your target is bleeding!"); - pDefender.SysMessage("You are bleeding!"); - - pDefender.TextMessage("You are bleeding profusely", false, 0x21); - pDefender.TextMessage(pDefender.name + " is bleeding profusely", true, 0x21, 1); + pAttacker.SoundEffect(0x204, true); + pDefender.StaticEffect(0x376A, 0x09, 0x32); + var IsImmune = pDefender.GetTempTag("IsImmune") - pDefender.StartTimer(10000, 9300, 7001); - pDefender.StartTimer(2000, 9400, 7001); - pDefender.SetTempTag("doBleed", true); + if (IsImmune != null && IsImmune == true) { + pAttacker.TextMessage("Your target resists paralysis."); + pDefender.TextMessage("You resist paralysis."); + return true; + } - if (pDefender.socket) - TriggerEvent(50104, "AddBuff", pDefender, 1039, 1075829, 1075830, 10, " 1, 10 ,2"); + var seconds = 3000; // We want this applied to players even if they are "offline" (aka disconnected but not vanished from view yet) + if (pDefender.npc) { + seconds = 6000; + } + else if (pDefender.socket) { + pDefender.TextMessage("The attack has temporarily paralyzed you!", false, 0x3b2, 0, pDefender.serial);// The attack has temporarily paralyzed you! + } - pAttacker.SoundEffect(0x133, true); - pDefender.StaticEffect(0x377A, 0x09, 0x32); + pDefender.SetTempTag("IsImmune", true); + pDefender.StartTimer(seconds + 8000, 9000, 7001); + pDefender.StartTimer(seconds, 8000, 7001); + pDefender.frozen = true; + if (pAttacker.socket) { + pAttacker.TextMessage(GetDictionaryEntry(17702, pAttacker.socket.language), false, 0x3b2, 0, pAttacker.serial);// You deliver a paralyzing blow! + } ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success } - else if (abilityID == 8) // Infectious Strike + else if (abilityID == 12) // shadowstrike { - var requiredMana = 20; - var itemRHand = pAttacker.FindItemLayer(0x01); - var itemLHand = pAttacker.FindItemLayer(0x02); + if (pAttacker.skills[47] < 800) // Stealth + { + pAttacker.TextMessage("You lack the required stealth to perform that attack"); + DeactivateSpecialMove(pAttacker.socket, abilityID); + return true; + } // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 8) - DeactivateSpecialMove(pAttacker, abilityID); + if (abilityID != 12) + DeactivateSpecialMove(pAttacker.socket, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID, requiredMana)) + if (!CheckMana(pAttacker, abilityID)) return true; - if (itemLHand != null && itemLHand.poison <= 0 || itemRHand != null && itemRHand.poison <= 0) - { - pDefender.SysMessage("Your weapon must have a dose of poison to perform an infectious strike!"); - return; - } + pAttacker.TextMessage("You strike and hide in the shadows!"); + pDefender.TextMessage("You are dazed by the attack and your attacker vanishes!"); - var level = 0; - var chance = Math.random(); - if (pAttacker.skills[30] >= 0 && pAttacker.skills[30] <= 199) - { - level = 1; - } - else if (pAttacker.skills[30] >= 200 && pAttacker.skills[30] <= 399) - { - level = 2; - } - else if (pAttacker.skills[30] >= 400 && pAttacker.skills[30] <= 599) - { - level = 3; - } - else if (pAttacker.skills[30] >= 600 && pAttacker.skills[30] <= 1000) - { - level = 4; - } + pAttacker.StaticEffect(0x376A, 0x09, 0x06); - // Adjust the poison level based on chance - if (chance < 0.2) - { - level--; // Decrease the level by 1 - if (level < 0) - { - level = 1; // Ensure the level doesn't go below 0 and is always set to least 1 - } - } - else if (chance > 0.8) - { - level++; // Increase the level by 1 - pAttacker.SysMessage("Your precise strike has increased the level of the poison by 1"); - pDefender.SysMessage("The poison seems extra effective!"); - } + pDefender.SoundEffect(0x482, true); + pDefender.StaticEffect(0x37BE, 0x09, 0x06); - pAttacker.TextMessage("You have poisoned your target : " + pDefender.name); - pDefender.TextMessage(pAttacker.name +" : poisoned you!"); - pDefender.poison = level; + pAttacker.atWar = false; + pDefender.atWar = false; + pAttacker.visible = 1; - pAttacker.SoundEffect(0xDD, true); - pDefender.StaticEffect(0x3728, 0x09, 0x32); + ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success } } @@ -679,6 +680,7 @@ function DeactivateSpecialMove(pUser, abilityID ) { var socket = pUser.socket; var toSend = new Packet; + pUser.SetTempTag("abilityID", null); toSend.ReserveSize( 7 ) toSend.WriteByte( 0, 0xbf ); // Packet From bfb92c9ea0748f0fd54ceedb51bfffebdeab64d5 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Wed, 29 May 2024 23:00:18 -0500 Subject: [PATCH 09/28] Update special_moves.js --- data/js/combat/special_moves.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index 4a8f5c865..a21519bbc 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -376,8 +376,7 @@ function onAbility(pAttacker, pDefender, abilityID) pDefender.TextMessage("You are bleeding profusely", false, 0x21); pDefender.TextMessage(pDefender.name + " is bleeding profusely", true, 0x21, 1); - pDefender.StartTimer(10000, 9300, 7001); - pDefender.StartTimer(2000, 9400, 7001); + pDefender.StartTimer(2000, 9300, 7001); // Start 2 second timer for blood and damage last total 10 seconds pDefender.SetTempTag("doBleed", true); if (pDefender.socket) @@ -729,17 +728,18 @@ function onTimer( timerObj, timerID ) timerObj.SetTempTag("blockHeal", null); socket.SysMessage("You are no longer mortally wounded."); } - else if (timerID == 9300) + + if (timerID >= 9300 && timerID < 9310) + { + var damage = RandomNumber(1, 10); + //timerObj.StaticEffect(0x122A, 0, 15); // blood effect got to figure how to add it to ground. + timerObj.health -= damage; + timerObj.StartTimer(2000, 9300 + 1, 7001);//restart timer every 2 seconds until it shuts off + } + else if (timerID == 9310) { timerObj.SetTempTag("doBleed", null); timerObj.KillJSTimer(9400, 7001); socket.SysMessage("The bleeding wounds have healed, you are no longer bleeding!"); } - else if (timerID == 9400) - { - var damage = RandomNumber(1, 10); - timerObj.health -= damage; - //timerObj.StaticEffect(0x122A, 0, 15); // blood effect got to figure how to add it to ground. - timerObj.StartTimer(2000, 9400, 7001);//restart timer every 2 seconds until it shuts off - } } \ No newline at end of file From e3ff890f4e148614425221805f2a08f717fefd13 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Thu, 30 May 2024 21:32:33 -0500 Subject: [PATCH 10/28] Cleanup and Changes Lots of changes --- data/js/combat/special_moves.js | 295 +++++++++++--------- data/js/jse_fileassociations.scp | 1 + data/js/server/network/0xbf_special_move.js | 34 +++ 3 files changed, 203 insertions(+), 127 deletions(-) create mode 100644 data/js/server/network/0xbf_special_move.js diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index a21519bbc..03cfc4496 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -8,7 +8,8 @@ function onSpecialMove( pUser, abilityID ) if( !CheckMana( pUser, abilityID )) return true; - pUser.SetTempTag( "abilityID", abilityID ); + if( abilityID >= 1 ) + pUser.SetTempTag( "abilityID", abilityID ); return true; //The rest of the AOS Abilites before any other expansions @@ -21,7 +22,7 @@ function checkSkillRequirement( pUser, requiredSkillLevel, requiredSkill, skillM if( pUser.skills[requiredSkill] < requiredSkillLevel ) { pUser.SysMessage( "You need " + skillMessage + " weapon skill to perform that attack" ); - DeactivateSpecialMove( pUser, abilityID ); + TriggerEvent(2205, "DeactivateSpecialMove", pUser, abilityID); return false; } return true; @@ -218,9 +219,10 @@ function RequiredSkill( pUser, abilityID ) return true; } -function CheckMana( pUser, abilityID ) +function getAbilityManaTable() { - var abilitieMana = { + return { + 0: { manaAmount: 0 }, 1: { manaAmount: 14 }, 2: { manaAmount: 30 }, 3: { manaAmount: 20 }, @@ -234,37 +236,65 @@ function CheckMana( pUser, abilityID ) 11: { manaAmount: 30 }, 12: { manaAmount: 20 } }; +} +function CheckMana( pUser, abilityID ) +{ + var abilitieMana = getAbilityManaTable(); var NextUse = pUser.GetTempTag( "doubleMana" ); var iTime = GetCurrentClock(); + var Delay = 3000; // If ability is performed within 3 seconds of the last ability, it will then cost double mana var requiredMana = abilitieMana[abilityID].manaAmount; - if( pUser.mana <= requiredMana ) - { + if( NextUse == null ) + { + NextUse = 0; + } + + var isDoubleMana = ( iTime - NextUse ) < Delay; + if( isDoubleMana ) + { + requiredMana *= 2; + } + + if( pUser.mana < requiredMana ) + { pUser.SysMessage( "You need " + requiredMana + " mana to perform that attack" ); - DeactivateSpecialMove( pUser, abilityID ); - return false; - } - else + TriggerEvent(2205, "DeactivateSpecialMove", pUser, abilityID); + return false; + } + else { - pUser.SetTempTag( "doubleMana", iTime.toString() ); - var Delay = 3000;// If abilitie is performed with 3 seconds of last abilitie it will then cost double mana - if(( iTime - NextUse ) < Delay ) - { - pUser.mana -= requiredMana * 2; - return true; - } - else - { - pUser.mana -= requiredMana; - return true; - } + return true; + } +} + +function DeductMana( pUser, abilityID ) +{ + var abilitieMana = getAbilityManaTable(); + var NextUse = pUser.GetTempTag( "doubleMana" ); + var iTime = GetCurrentClock(); + var Delay = 3000; // If ability is performed within 3 seconds of the last ability, it will then cost double mana + var requiredMana = abilitieMana[abilityID].manaAmount; + + if( NextUse == null ) + { + NextUse = 0; + } + + var isDoubleMana = ( iTime - NextUse ) < Delay; + if( isDoubleMana ) + { + requiredMana *= 2; } + + pUser.mana -= requiredMana; + pUser.SetTempTag( "doubleMana", iTime.toString() ); } function onCombatDamageCalc( pAttacker, pDefender, fightSkill, hitLoc ) { - var abilityID = pAttacker.GetTempTag("abilityID"); + var abilityID = pAttacker.GetTempTag( "abilityID" ); var baseDamage = pAttacker.attack; if( baseDamage == -1 ) // No damage if weapon breaks @@ -333,24 +363,33 @@ function onCombatDamageCalc( pAttacker, pDefender, fightSkill, hitLoc ) return damage; } +function onCombatHit( pAttacker, pDefender ) +{ + var abilityID = pAttacker.GetTempTag( "abilityID" ); + + onAbility( pAttacker, pDefender, abilityID ); +} + function onAttack( pAttacker, pDefender ) { - var abilityID = pAttacker.GetTempTag("abilityID"); + var abilityID = pAttacker.GetTempTag( "abilityID" ); - onAbility(pAttacker, pDefender, abilityID); + onAbility( pAttacker, pDefender, abilityID ); } -function onAbility(pAttacker, pDefender, abilityID) +function onAbility( pAttacker, pDefender, abilityID ) { if (abilityID == 1) // armnor ignore { // Clear out any current ability the player is doing when he switches abilities if (abilityID != 1) - DeactivateSpecialMove(pAttacker.socket, abilityID); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID)) - return true; + if (CheckMana(pAttacker, abilityID)) + { + DeductMana(pAttacker, abilityID); + } pAttacker.TextMessage("Your attack penetrates their armor!"); pDefender.TextMessage("The blow penetrated your armor!"); @@ -358,17 +397,19 @@ function onAbility(pAttacker, pDefender, abilityID) pDefender.SoundEffect(0x0056, true); pDefender.StaticEffect(0x3728, 0x09, 0x06); - ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success } else if (abilityID == 2) // bleedattack { // Clear out any current ability the player is doing when he switches abilities if (abilityID != 2) - DeactivateSpecialMove(pAttacker, abilityID); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID)) - return true; + if (CheckMana(pAttacker, abilityID)) + { + DeductMana(pAttacker, abilityID); + } pAttacker.SysMessage("Your target is bleeding!"); pDefender.SysMessage("You are bleeding!"); @@ -376,8 +417,8 @@ function onAbility(pAttacker, pDefender, abilityID) pDefender.TextMessage("You are bleeding profusely", false, 0x21); pDefender.TextMessage(pDefender.name + " is bleeding profusely", true, 0x21, 1); - pDefender.StartTimer(2000, 9300, 7001); // Start 2 second timer for blood and damage last total 10 seconds - pDefender.SetTempTag("doBleed", true); + pDefender.StartTimer( 2000, 9300, 7001 ); // Start 2 second timer for blood and damage last total 10 seconds + pDefender.SetTempTag( "doBleed", true ); if (pDefender.socket) TriggerEvent(50104, "AddBuff", pDefender, 1039, 1075829, 1075830, 10, " 1, 10 ,2"); @@ -385,18 +426,20 @@ function onAbility(pAttacker, pDefender, abilityID) pAttacker.SoundEffect(0x133, true); pDefender.StaticEffect(0x377A, 0x09, 0x32); - ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success } else if (abilityID == 3) // ConcussionBlow { // Clear out any current ability the player is doing when he switches abilities if (abilityID != 3) - DeactivateSpecialMove(pAttacker, abilityID); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID)) - return true; + if (CheckMana(pAttacker, abilityID)) + { + DeductMana(pAttacker, abilityID); + } pAttacker.SysMessage("You have delivered a concussion!"); pDefender.SysMessage("You feel disoriented!"); @@ -404,23 +447,26 @@ function onAbility(pAttacker, pDefender, abilityID) pAttacker.SoundEffect(0x213, true); pDefender.StaticEffect(0x377A, 0x09, 0x32); - ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success } else if (abilityID == 4) // crushingblow { // Clear out any current ability the player is doing when he switches abilities if (abilityID != 4) - DeactivateSpecialMove(pAttacker, abilityID); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID)) - return true; + if (CheckMana(pAttacker, abilityID)) + { + DeductMana(pAttacker, abilityID); + } pAttacker.SysMessage("You have delivered a crushing blow!"); pDefender.SysMessage("You take extra damage from the crushing attack!"); pAttacker.SoundEffect(0x1E1, true); + TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success } else if (abilityID == 5) // Disarm { @@ -429,23 +475,25 @@ function onAbility(pAttacker, pDefender, abilityID) if (pDefender.pack == null || itemLHand != null && itemLHand.movable >= 2 || itemRHand != null && itemRHand.movable >= 2) { pAttacker.SysMessage("You cannot disarm your opponent."); - DeactivateSpecialMove(pAttacker.socket, abilityID); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); return false; } if (itemLHand != null && itemLHand.type == 9 || itemRHand != null && itemRHand.type == 9) { pAttacker.SysMessage("Your target is already unarmed!"); - DeactivateSpecialMove(pAttacker.socket, abilityID); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); return false; } // Clear out any current ability the player is doing when he switches abilities if (abilityID != 5) - DeactivateSpecialMove(pAttacker, abilityID); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID)) - return true; + if (CheckMana(pAttacker, abilityID)) + { + DeductMana(pAttacker, abilityID); + } pAttacker.SoundEffect(0x3B9, true); pDefender.StaticEffect(0x37BE, 0x09, 0x32); @@ -467,31 +515,36 @@ function onAbility(pAttacker, pDefender, abilityID) TriggerEvent(50104, "AddBuff", pDefender, 0x3ea, 1075637, 0, 5, " "); - ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success } else if (abilityID == 6) // Dismount { - // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 6) - DeactivateSpecialMove(pAttacker.socket, abilityID); - - //checking mana - if (!CheckMana(pAttacker, abilityID)) - return true; - // Check to see if player is mount or flying. - if (pAttacker.isonhorse) { + if (pAttacker.isonhorse) + { pAttacker.TextMessage("You cannot perform that attack while mounted or flying!"); - DeactivateSpecialMove(pAttacker.socket, abilityID); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); return true; } // Only Can work on players or npcs that is mounted - if (!pDefender.isonhorse) { + if (!pDefender.isonhorse) + { pAttacker.TextMessage("This attack only works on mounted or flying targets"); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); return true; } + // Clear out any current ability the player is doing when he switches abilities + if (abilityID != 6) + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + + //checking mana + if (CheckMana(pAttacker, abilityID)) + { + DeductMana(pAttacker, abilityID); + } + //Lesser Hiryu have an 80% chance of missing this attack needs added //This is the Dismount Information sent to Attacker and Defender @@ -501,49 +554,60 @@ function onAbility(pAttacker, pDefender, abilityID) pDefender.Dismount(); pDefender.TextMessage("You have been knocked off of your mount by " + pAttacker.name + "!"); pAttacker.SetTempTag("Dismount", false); - ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success } else if (abilityID == 8) // Infectious Strike { var itemRHand = pAttacker.FindItemLayer(0x01); var itemLHand = pAttacker.FindItemLayer(0x02); + if (itemLHand != null && itemLHand.poison <= 0 || itemRHand != null && itemRHand.poison <= 0) + { + pDefender.SysMessage("Your weapon must have a dose of poison to perform an infectious strike!"); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + return; + } + // Clear out any current ability the player is doing when he switches abilities if (abilityID != 8) - DeactivateSpecialMove(pAttacker, abilityID); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID)) - return true; - - if (itemLHand != null && itemLHand.poison <= 0 || itemRHand != null && itemRHand.poison <= 0) { - pDefender.SysMessage("Your weapon must have a dose of poison to perform an infectious strike!"); - return; + if (CheckMana(pAttacker, abilityID)) + { + DeductMana(pAttacker, abilityID); } var level = 0; var chance = Math.random(); - if (pAttacker.skills[30] >= 0 && pAttacker.skills[30] <= 199) { + if (pAttacker.skills[30] >= 0 && pAttacker.skills[30] <= 199) + { level = 1; } - else if (pAttacker.skills[30] >= 200 && pAttacker.skills[30] <= 399) { + else if (pAttacker.skills[30] >= 200 && pAttacker.skills[30] <= 399) + { level = 2; } - else if (pAttacker.skills[30] >= 400 && pAttacker.skills[30] <= 599) { + else if (pAttacker.skills[30] >= 400 && pAttacker.skills[30] <= 599) + { level = 3; } - else if (pAttacker.skills[30] >= 600 && pAttacker.skills[30] <= 1000) { + else if (pAttacker.skills[30] >= 600 && pAttacker.skills[30] <= 1000) + { level = 4; } // Adjust the poison level based on chance - if (chance < 0.2) { + if (chance < 0.2) + { level--; // Decrease the level by 1 - if (level < 0) { + if (level < 0) + { level = 1; // Ensure the level doesn't go below 0 and is always set to least 1 } } - else if (chance > 0.8) { + else if (chance > 0.8) + { level++; // Increase the level by 1 pAttacker.SysMessage("Your precise strike has increased the level of the poison by 1"); pDefender.SysMessage("The poison seems extra effective!"); @@ -555,18 +619,20 @@ function onAbility(pAttacker, pDefender, abilityID) pAttacker.SoundEffect(0xDD, true); pDefender.StaticEffect(0x3728, 0x09, 0x32); - ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success } else if (abilityID == 9) // Mortal Strike {// turn healthbar yellow on defender need spacket sent for this. // Clear out any current ability the player is doing when he switches abilities if (abilityID != 9) - DeactivateSpecialMove(pAttacker, abilityID); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID)) - return true; + if (CheckMana(pAttacker, abilityID)) + { + DeductMana(pAttacker, abilityID); + } pAttacker.SysMessage("You deliver a mortal wound!"); pDefender.SysMessage("You have been mortally wounded!"); @@ -585,33 +651,38 @@ function onAbility(pAttacker, pDefender, abilityID) if (pDefender.socket) TriggerEvent(50104, "AddBuff", pDefender, 1027, 1075810, 1075811, 6, " "); - ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success } else if (abilityID == 11) // ParalyzingBlow { // Clear out any current ability the player is doing when he switches abilities if (abilityID != 11) - DeactivateSpecialMove(pAttacker.socket, abilityID); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID)) - return true; + if (CheckMana(pAttacker, abilityID)) + { + DeductMana(pAttacker, abilityID); + } pAttacker.SoundEffect(0x204, true); pDefender.StaticEffect(0x376A, 0x09, 0x32); var IsImmune = pDefender.GetTempTag("IsImmune") - if (IsImmune != null && IsImmune == true) { + if (IsImmune != null && IsImmune == true) + { pAttacker.TextMessage("Your target resists paralysis."); pDefender.TextMessage("You resist paralysis."); return true; } var seconds = 3000; // We want this applied to players even if they are "offline" (aka disconnected but not vanished from view yet) - if (pDefender.npc) { + if (pDefender.npc) + { seconds = 6000; } - else if (pDefender.socket) { + else if (pDefender.socket) + { pDefender.TextMessage("The attack has temporarily paralyzed you!", false, 0x3b2, 0, pDefender.serial);// The attack has temporarily paralyzed you! } @@ -620,27 +691,30 @@ function onAbility(pAttacker, pDefender, abilityID) pDefender.StartTimer(seconds, 8000, 7001); pDefender.frozen = true; - if (pAttacker.socket) { + if (pAttacker.socket) + { pAttacker.TextMessage(GetDictionaryEntry(17702, pAttacker.socket.language), false, 0x3b2, 0, pAttacker.serial);// You deliver a paralyzing blow! } - ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success } else if (abilityID == 12) // shadowstrike { if (pAttacker.skills[47] < 800) // Stealth { pAttacker.TextMessage("You lack the required stealth to perform that attack"); - DeactivateSpecialMove(pAttacker.socket, abilityID); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); return true; } // Clear out any current ability the player is doing when he switches abilities if (abilityID != 12) - DeactivateSpecialMove(pAttacker.socket, abilityID); + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); //checking mana - if (!CheckMana(pAttacker, abilityID)) - return true; + if (CheckMana(pAttacker, abilityID)) + { + DeductMana(pAttacker, abilityID); + } pAttacker.TextMessage("You strike and hide in the shadows!"); pDefender.TextMessage("You are dazed by the attack and your attacker vanishes!"); @@ -654,43 +728,10 @@ function onAbility(pAttacker, pDefender, abilityID) pDefender.atWar = false; pAttacker.visible = 1; - ClearSpecialMove(pAttacker, abilityID);// Clear the Ability after success + TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID); } } -function ClearSpecialMove(pUser, abilityID) -{ - var socket = pUser.socket; - pUser.SetTempTag("abilityID", null); - pUser.SetTempTag("doubleMana", null); - - var toSend = new Packet; - toSend.ReserveSize(7) - toSend.WriteByte(0, 0xbf); // Packet - toSend.WriteShort(1, 0x07); // Length - toSend.WriteShort(3, 0x21); // SubCmd - toSend.WriteByte(5, abilityID); // Ability ID - toSend.WriteByte(6, 0); // On/off - socket.Send(toSend); - toSend.Free(); -} - -function DeactivateSpecialMove(pUser, abilityID ) -{ - var socket = pUser.socket; - var toSend = new Packet; - pUser.SetTempTag("abilityID", null); - - toSend.ReserveSize( 7 ) - toSend.WriteByte( 0, 0xbf ); // Packet - toSend.WriteShort( 1, 0x07 ); // Length - toSend.WriteShort( 3, 0x21 ); // SubCmd - toSend.WriteByte( 5, abilityID ); // Ability ID - toSend.WriteByte( 6, 0 ); // On/off - socket.Send( toSend ); - toSend.Free(); -} - function onTimer( timerObj, timerID ) { var socket = timerObj.socket; @@ -706,7 +747,7 @@ function onTimer( timerObj, timerID ) timerObj.SetTempTag("blockHeal", null); timerObj.KillJSTimer(9400, 7001); timerObj.SetTempTag("doBleed", null); - ClearSpecialMove(timerObj, abilityID); + TriggerEvent(2205, "ClearSpecialMove", timerObj, abilityID); return; } else if (timerID == 8000) diff --git a/data/js/jse_fileassociations.scp b/data/js/jse_fileassociations.scp index 802cd528c..66e6cf568 100644 --- a/data/js/jse_fileassociations.scp +++ b/data/js/jse_fileassociations.scp @@ -98,6 +98,7 @@ 2201=server/misc/hint_tooltip.js 2202=server/misc/warning_trigger.js 2203=server/misc/charges_left_tooltip.js +2205=server/network/0xbf_special_move.js // Server Data [2500-2749] 2500=server/data/weapontypes.js diff --git a/data/js/server/network/0xbf_special_move.js b/data/js/server/network/0xbf_special_move.js new file mode 100644 index 000000000..1fc8dae05 --- /dev/null +++ b/data/js/server/network/0xbf_special_move.js @@ -0,0 +1,34 @@ +function ClearSpecialMove( pUser, abilityID ) +{ + var socket = pUser.socket; + var toSend = new Packet; + + toSend.ReserveSize( 7 ) + toSend.WriteByte( 0, 0xbf ); // Packet + toSend.WriteShort( 1, 0x07 ); // Length + toSend.WriteShort( 3, 0x21 ); // SubCmd + toSend.WriteByte( 5, abilityID ); // Ability ID + toSend.WriteByte( 6, 0 ); // On/off + socket.Send( toSend ); + toSend.Free(); + + pUser.SetTempTag( "abilityID", null ); + pUser.SetTempTag( "doubleMana", null ); +} + +function DeactivateSpecialMove( pUser, abilityID ) +{ + var socket = pUser.socket; + var toSend = new Packet; + + toSend.ReserveSize( 7 ) + toSend.WriteByte( 0, 0xbf ); // Packet + toSend.WriteShort( 1, 0x07 ); // Length + toSend.WriteShort( 3, 0x21 ); // SubCmd + toSend.WriteByte( 5, abilityID ); // Ability ID + toSend.WriteByte( 6, 0); // On/off + socket.Send( toSend ); + toSend.Free(); + + pUser.SetTempTag( "abilityID", null ); +} From affabd2442bcf594f2b083f2360c08512a82d5a0 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Thu, 30 May 2024 21:38:08 -0500 Subject: [PATCH 11/28] New Event Added OnCombatHit --- source/Changelog.txt | 2 ++ source/cScript.cpp | 29 +++++++++++++++++++++++++++++ source/cScript.h | 1 + source/combat.cpp | 9 +++++++++ 4 files changed, 41 insertions(+) diff --git a/source/Changelog.txt b/source/Changelog.txt index addbacc9c..64d3fd4a8 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -2,6 +2,8 @@ Added special_moves.js There is 12 special aos moves you can find on uoguide.com Added blockequip.js This script is used to block reqeuiping weapons. Thanks to Xuri for making unequipattemp work for chars and not just items + Added OnCombatHit + -Triggers for character with event attached when someone has taken damage 27/04/2024 - Dragon Slayer/Xuri Fixed an issue where non-corpse containers - including treasure chests in dungeons - would decay and leave all their contents on the ground. diff --git a/source/cScript.cpp b/source/cScript.cpp index 88ef1a0e6..fb0ae479f 100644 --- a/source/cScript.cpp +++ b/source/cScript.cpp @@ -3802,6 +3802,35 @@ SI08 cScript::OnAICombatTarget( CChar *attacker, CChar *target ) return TryParseJSVal( rval ); } +//o------------------------------------------------------------------------------------------------o +//| Function - cScript::onCombatHit() +//o------------------------------------------------------------------------------------------------o +//| Purpose - Triggers for character with event attached when someone has taken damage +//| Will also trigger the onDefense event for the character being hit +//o------------------------------------------------------------------------------------------------o +bool cScript::onCombatHit( CChar *attacker, CChar *defender ) +{ + if( !ValidateObject( attacker ) || !ValidateObject( defender )) + return false; + + if( !ExistAndVerify( seOnCombatHit, "onCombatHit" )) + return false; + + jsval rval, params[2]; + JSObject *attObj = JSEngine->AcquireObject( IUE_CHAR, attacker, runTime ); + JSObject *defObj = JSEngine->AcquireObject( IUE_CHAR, defender, runTime ); + + params[0] = OBJECT_TO_JSVAL( attObj ); + params[1] = OBJECT_TO_JSVAL( defObj ); + JSBool retVal = JS_CallFunctionName( targContext, targObject, "onCombatHit", 2, params, &rval ); + if( retVal == JS_FALSE ) + { + SetEventExists( seOnCombatHit, false ); + } + + return ( retVal == JS_TRUE ); +} + //o------------------------------------------------------------------------------------------------o //| Function - cScript::OnCombatStart() //| Date - 23rd January, 2006 diff --git a/source/cScript.h b/source/cScript.h index f98e13c70..10330e719 100644 --- a/source/cScript.h +++ b/source/cScript.h @@ -279,6 +279,7 @@ class cScript SI08 OnSkillGump( CChar *mChar ); SI08 OnUseBandageMacro( CSocket *mSock, CChar *targChar, CItem *bandageItem ); SI08 OnAICombatTarget( CChar *attacker, CChar *target ); + bool onCombatHit( CChar *attacker, CChar *defender ); SI08 OnCombatStart( CChar *attacker, CChar *defender ); SI08 OnCombatEnd( CChar *attacker, CChar *defender ); diff --git a/source/combat.cpp b/source/combat.cpp index 8817d7b3d..f6bcebe15 100644 --- a/source/combat.cpp +++ b/source/combat.cpp @@ -2994,6 +2994,15 @@ bool CHandleCombat::HandleCombat( CSocket *mSock, CChar& mChar, CChar *ourTarg ) // Show hit messages, if enabled DoHitMessage( &mChar, ourTarg, hitLoc, ourDamage ); + for( auto scriptTrig : scriptTriggers ) + { + cScript *toExecute = JSMapping->GetScript( scriptTrig ); + if( toExecute != nullptr ) + { + toExecute->onCombatHit( &mChar, ourTarg ); + } + } + // Interrupt Spellcasting if( !ourTarg->IsNpc() && targSock != nullptr ) { From 0b5963437d48a3accb544247c550fe4903b860c7 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 9 Jun 2024 22:52:23 -0500 Subject: [PATCH 12/28] cleanup and dictionary files cleanup and dictionary files added --- data/dictionaries/dictionary.ENG | 37 +++ data/dictionaries/dictionary.ZRO | 37 +++ data/js/combat/blockequip.js | 2 +- data/js/combat/special_moves.js | 540 ++++++++++++++++--------------- 4 files changed, 350 insertions(+), 266 deletions(-) diff --git a/data/dictionaries/dictionary.ENG b/data/dictionaries/dictionary.ENG index c3dc18d54..28be828cd 100644 --- a/data/dictionaries/dictionary.ENG +++ b/data/dictionaries/dictionary.ENG @@ -5312,5 +5312,42 @@ 19100=You've successfully converted the metal. 19101=You can only convert five hundred ingots at a time. 19102=The item must be in your backpack to be exchanged. +// [19201-19300] Special Moves +19201=You need %i weapon skill to perform that attack +19202=You need %i mana to perform that attack +19203=Your attack penetrates their armor! +19204=The blow penetrated your armor! +19205=Your target is bleeding! +19206=You are bleeding! +19207=You are bleeding profusely +19208=%i is bleeding profusely +19209=You have delivered a concussion! +19210=You feel disoriented! +19211=You have delivered a crushing blow! +19212=You take extra damage from the crushing attack! +19213=You cannot disarm your opponent. +19214=Your target is already unarmed! +19215=You disarm their weapon! +19216=Your weapon has been disarmed! +19217=You cannot perform that attack while mounted or flying! +19218=This attack only works on mounted or flying targets +19219=The force of your attack has dislodged them from their mount! +19220=You have been knocked off of your mount by %i ! +19221=Your weapon must have a dose of poison to perform an infectious strike! +19222=Your precise strike has increased the level of the poison by 1 +19223=The poison seems extra effective! +19224=You have poisoned your target : %i +19225=%i : poisoned you! +19226=You deliver a mortal wound! +19227=You have been mortally wounded! +19228=Your target resists paralysis. +19229=You resist paralysis. +19230=The attack has temporarily paralyzed you! +19231=You lack the required stealth to perform that attack +19232=You strike and hide in the shadows! +19233=You are dazed by the attack and your attacker vanishes! +19234=Your confusion has passed, you may now arm a weapon! +19235=You are no longer mortally wounded. +19236=The bleeding wounds have healed, you are no longer bleeding! } EOF diff --git a/data/dictionaries/dictionary.ZRO b/data/dictionaries/dictionary.ZRO index 5792f2860..a8ea12a6f 100644 --- a/data/dictionaries/dictionary.ZRO +++ b/data/dictionaries/dictionary.ZRO @@ -5306,5 +5306,42 @@ 19100=You've successfully converted the metal. 19101=You can only convert five hundred ingots at a time. 19102=The item must be in your backpack to be exchanged. +// [19201-19300] Special Moves +19201=You need %i weapon skill to perform that attack +19202=You need %i mana to perform that attack +19203=Your attack penetrates their armor! +19204=The blow penetrated your armor! +19205=Your target is bleeding! +19206=You are bleeding! +19207=You are bleeding profusely +19208=%i is bleeding profusely +19209=You have delivered a concussion! +19210=You feel disoriented! +19211=You have delivered a crushing blow! +19212=You take extra damage from the crushing attack! +19213=You cannot disarm your opponent. +19214=Your target is already unarmed! +19215=You disarm their weapon! +19216=Your weapon has been disarmed! +19217=You cannot perform that attack while mounted or flying! +19218=This attack only works on mounted or flying targets +19219=The force of your attack has dislodged them from their mount! +19220=You have been knocked off of your mount by %i ! +19221=Your weapon must have a dose of poison to perform an infectious strike! +19222=Your precise strike has increased the level of the poison by 1 +19223=The poison seems extra effective! +19224=You have poisoned your target : %i +19225=%i : poisoned you! +19226=You deliver a mortal wound! +19227=You have been mortally wounded! +19228=Your target resists paralysis. +19229=You resist paralysis. +19230=The attack has temporarily paralyzed you! +19231=You lack the required stealth to perform that attack +19232=You strike and hide in the shadows! +19233=You are dazed by the attack and your attacker vanishes! +19234=Your confusion has passed, you may now arm a weapon! +19235=You are no longer mortally wounded. +19236=The bleeding wounds have healed, you are no longer bleeding! } EOF diff --git a/data/js/combat/blockequip.js b/data/js/combat/blockequip.js index 6241b6ea5..48c82f700 100644 --- a/data/js/combat/blockequip.js +++ b/data/js/combat/blockequip.js @@ -1,6 +1,6 @@ function onEquipAttempt( pEquipper, iEquipped ) { - var blockEquip = pEquipper.GetTempTag( "BlockEquip" ); + var blockEquip = pEquipper.GetTempTag( "blockEquip" ); if( blockEquip == true ) { iEquipped.SetTempTag( "charSer", pEquipper.serial.toString() ); diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index 03cfc4496..4159916cf 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -1,11 +1,11 @@ function onSpecialMove( pUser, abilityID ) { // Check Skills - if( !RequiredSkill( pUser, abilityID )) + if( !checkRequiredSkill( pUser, abilityID )) return true; // Check Mana - if( !CheckMana( pUser, abilityID )) + if( !CheckMana( pUser, abilityID )) return true; if( abilityID >= 1 ) @@ -19,10 +19,12 @@ function onSpecialMove( pUser, abilityID ) function checkSkillRequirement( pUser, requiredSkillLevel, requiredSkill, skillMessage, abilityID ) { + var pSock = pUser.socket; if( pUser.skills[requiredSkill] < requiredSkillLevel ) { - pUser.SysMessage( "You need " + skillMessage + " weapon skill to perform that attack" ); - TriggerEvent(2205, "DeactivateSpecialMove", pUser, abilityID); + pSock.SysMessage( GetDictionaryEntry( 19201, pSock.language), skillMessage); // You need %i weapon skill to perform that attack + + TriggerEvent( 2205, "DeactivateSpecialMove", pUser, abilityID ); return false; } return true; @@ -30,109 +32,109 @@ function checkSkillRequirement( pUser, requiredSkillLevel, requiredSkill, skillM // archery 31 swordsmansip 40 macefighting 41 fencing 42 wrestling 43 // Define the RequiredSkill function -function RequiredSkill( pUser, abilityID ) +function checkRequiredSkill( pUser, abilityID ) { // Define weapon types and their skill requirements and if primary or secondary ability var weaponTypes = { - "0x0DF0": { primary: 0, secondary: 11, reqSkill: 41 }, - "0x0DF1": { primary: 0, secondary: 11, reqSkill: 41 }, // Black Staves // WhirlwindAttack, ParalyzingBlow + "0x0df0": { primary: 0, secondary: 11, reqSkill: 41 }, + "0x0df1": { primary: 0, secondary: 11, reqSkill: 41 }, // Black Staves // WhirlwindAttack, ParalyzingBlow - "0x0DF2": { primary: 6, secondary: 5, reqSkill: 41 }, - "0x0DF3": { primary: 6, secondary: 5, reqSkill: 41 }, - "0x0DF4": { primary: 6, secondary: 5, reqSkill: 41 }, - "0x0DF5": { primary: 6, secondary: 5, reqSkill: 41 }, // wands // Dismount, Disarm + "0x0df2": { primary: 6, secondary: 5, reqSkill: 41 }, + "0x0df3": { primary: 6, secondary: 5, reqSkill: 41 }, + "0x0df4": { primary: 6, secondary: 5, reqSkill: 41 }, + "0x0df5": { primary: 6, secondary: 5, reqSkill: 41 }, // wands // Dismount, Disarm - "0x0E81": { primary: 4, secondary: 5, reqSkill: 41 }, - "0x0E82": { primary: 4, secondary: 5, reqSkill: 41 }, // Shepherd's Crooks // CrushingBlow, Disarm + "0x0e81": { primary: 4, secondary: 5, reqSkill: 41 }, + "0x0e82": { primary: 4, secondary: 5, reqSkill: 41 }, // Shepherd's Crooks // CrushingBlow, Disarm "0x0e85": { primary: 0, secondary: 5, reqSkill: 40 }, "0x0e86": { primary: 0, secondary: 5, reqSkill: 40 }, // pickaxe // DoubleStrike, Disarm - "0x0E87": { primary: 2, secondary: 6, reqSkill: 42 }, - "0x0E88": { primary: 2, secondary: 6, reqSkill: 42 }, // Pitchforks // BleedAttack, Dismount + "0x0e87": { primary: 2, secondary: 6, reqSkill: 42 }, + "0x0e88": { primary: 2, secondary: 6, reqSkill: 42 }, // Pitchforks // BleedAttack, Dismount - "0x0E89": { primary: 0, secondary: 3, reqSkill: 41 }, - "0x0E8A": { primary: 0, secondary: 3, reqSkill: 41 }, // Quarter Staves // DoubleStrike, ConcussionBlow + "0x0e89": { primary: 0, secondary: 3, reqSkill: 41 }, + "0x0e8a": { primary: 0, secondary: 3, reqSkill: 41 }, // Quarter Staves // DoubleStrike, ConcussionBlow - "0x0EC2": { primary: 2, secondary: 8, reqSkill: 40 }, - "0x0EC3": { primary: 2, secondary: 8, reqSkill: 40 }, // Cleavers // BleedAttack, InfectiousStrike + "0x0ec2": { primary: 2, secondary: 8, reqSkill: 40 }, + "0x0ec3": { primary: 2, secondary: 8, reqSkill: 40 }, // Cleavers // BleedAttack, InfectiousStrike - "0x0EC4": { primary: 12, secondary: 2, reqSkill: 40 }, - "0x0EC5": { primary: 12, secondary: 2, reqSkill: 40 }, // Skinning Knives // ShadowStrike, BleedAttack + "0x0ec4": { primary: 12, secondary: 2, reqSkill: 40 }, + "0x0ec5": { primary: 12, secondary: 2, reqSkill: 40 }, // Skinning Knives // ShadowStrike, BleedAttack - "0x0F43": { primary: 1, secondary: 5, reqSkill: 40 }, - "0x0F44": { primary: 1, secondary: 5, reqSkill: 40 }, // hatchets // ArmorIgnore, Disarm + "0x0f43": { primary: 1, secondary: 5, reqSkill: 40 }, + "0x0f44": { primary: 1, secondary: 5, reqSkill: 40 }, // hatchets // ArmorIgnore, Disarm - "0x0F45": { primary: 2, secondary: 9, reqSkill: 40 }, - "0x0F46": { primary: 2, secondary: 9, reqSkill: 40 }, // Executioner Axes // BleedAttack, MortalStrike + "0x0f45": { primary: 2, secondary: 9, reqSkill: 40 }, + "0x0f46": { primary: 2, secondary: 9, reqSkill: 40 }, // Executioner Axes // BleedAttack, MortalStrike - "0x0F47": { primary: 2, secondary: 3, reqSkill: 40 }, - "0x0F48": { primary: 2, secondary: 3, reqSkill: 40 }, // Battle Axes // BleedAttack, ConcussionBlow + "0x0f47": { primary: 2, secondary: 3, reqSkill: 40 }, + "0x0f48": { primary: 2, secondary: 3, reqSkill: 40 }, // Battle Axes // BleedAttack, ConcussionBlow - "0x0F49": { primary: 4, secondary: 6, reqSkill: 40 }, - "0x0F4A": { primary: 4, secondary: 6, reqSkill: 40 }, // Axes // CrushingBlow, Dismount + "0x0f49": { primary: 4, secondary: 6, reqSkill: 40 }, + "0x0f4a": { primary: 4, secondary: 6, reqSkill: 40 }, // Axes // CrushingBlow, Dismount - "0x0F4B": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x0F4C": { primary: 0, secondary: 0, reqSkill: 40 }, // Double Axe // DoubleStrike, WhirlwindAttack + "0x0f4b": { primary: 0, secondary: 0, reqSkill: 40 }, + "0x0f4c": { primary: 0, secondary: 0, reqSkill: 40 }, // Double Axe // DoubleStrike, WhirlwindAttack - "0x0F4D": { primary: 11, secondary: 6, reqSkill: 40 }, - "0x0F4E": { primary: 11, secondary: 6, reqSkill: 40 }, // Bardiches // ParalyzingBlow, Dismount + "0x0f4e": { primary: 11, secondary: 6, reqSkill: 40 }, + "0x0f4e": { primary: 11, secondary: 6, reqSkill: 40 }, // Bardiches // ParalyzingBlow, Dismount - "0x0F4F": { primary: 3, secondary: 9, reqSkill: 31 }, - "0x0F50": { primary: 3, secondary: 9, reqSkill: 31 }, // Crossbows // ConcussionBlow, MortalStrike + "0x0f4f": { primary: 3, secondary: 9, reqSkill: 31 }, + "0x0f50": { primary: 3, secondary: 9, reqSkill: 31 }, // Crossbows // ConcussionBlow, MortalStrike - "0x0F51": { primary: 8, secondary: 12, reqSkill: 40 }, - "0x0F52": { primary: 8, secondary: 12, reqSkill: 40 }, // Daggers // InfectiousStrike, ShadowStrike + "0x0f51": { primary: 8, secondary: 12, reqSkill: 40 }, + "0x0f52": { primary: 8, secondary: 12, reqSkill: 40 }, // Daggers // InfectiousStrike, ShadowStrike - "0x0F5C": { primary: 3, secondary: 5, reqSkill: 41 }, - "0x0F5D": { primary: 3, secondary: 5, reqSkill: 41 }, // Maces // ConcussionBlow, Disarm + "0x0f5c": { primary: 3, secondary: 5, reqSkill: 41 }, + "0x0f5d": { primary: 3, secondary: 5, reqSkill: 41 }, // Maces // ConcussionBlow, Disarm - "0x0F5E": { primary: 4, secondary: 1, reqSkill: 40 }, - "0x0F5F": { primary: 4, secondary: 1, reqSkill: 40 }, // Broadswords // CrushingBlow, ArmorIgnore + "0x0f5e": { primary: 4, secondary: 1, reqSkill: 40 }, + "0x0f5f": { primary: 4, secondary: 1, reqSkill: 40 }, // Broadswords // CrushingBlow, ArmorIgnore - "0x13B7": { primary: 1, secondary: 3, reqSkill: 40 }, - "0x13B8": { primary: 1, secondary: 3, reqSkill: 40 }, - "0x0F60": { primary: 1, secondary: 3, reqSkill: 40 }, - "0x0F61": { primary: 1, secondary: 3, reqSkill: 40 }, // Longswords // ArmorIgnore, ConcussionBlow + "0x13b7": { primary: 1, secondary: 3, reqSkill: 40 }, + "0x13b8": { primary: 1, secondary: 3, reqSkill: 40 }, + "0x0f60": { primary: 1, secondary: 3, reqSkill: 40 }, + "0x0f61": { primary: 1, secondary: 3, reqSkill: 40 }, // Longswords // ArmorIgnore, ConcussionBlow - "0x0F62": { primary: 1, secondary: 11, reqSkill: 42 }, - "0x0F63": { primary: 1, secondary: 11, reqSkill: 42 }, // Spears // ArmorIgnore, ParalyzingBlow + "0x0f62": { primary: 1, secondary: 11, reqSkill: 42 }, + "0x0f63": { primary: 1, secondary: 11, reqSkill: 42 }, // Spears // ArmorIgnore, ParalyzingBlow - "0x0FB4": { primary: 4, secondary: 12, reqSkill: 41 }, - "0x0FB5": { primary: 4, secondary: 12, reqSkill: 41 }, // Sledge hammers // CrushingBlow, ShadowStrike + "0x0fb4": { primary: 4, secondary: 12, reqSkill: 41 }, + "0x0fb5": { primary: 4, secondary: 12, reqSkill: 41 }, // Sledge hammers // CrushingBlow, ShadowStrike - "0x13AF": { primary: 1, secondary: 2, reqSkill: 40 }, - "0x13B0": { primary: 1, secondary: 2, reqSkill: 40 }, // War Axes // ArmorIgnore, BleedAttack + "0x13af": { primary: 1, secondary: 2, reqSkill: 40 }, + "0x13b0": { primary: 1, secondary: 2, reqSkill: 40 }, // War Axes // ArmorIgnore, BleedAttack - "0x13B1": { primary: 11, secondary: 9, reqSkill: 31 }, - "0x13B2": { primary: 11, secondary: 9, reqSkill: 31 }, // Bows // ParalyzingBlow, MortalStrike + "0x13b1": { primary: 11, secondary: 9, reqSkill: 31 }, + "0x13b2": { primary: 11, secondary: 9, reqSkill: 31 }, // Bows // ParalyzingBlow, MortalStrike - "0x13B3": { primary: 12, secondary: 6, reqSkill: 41 }, - "0x13B4": { primary: 12, secondary: 6, reqSkill: 41 }, // Clubs // ShadowStrike, Dismount + "0x13b3": { primary: 12, secondary: 6, reqSkill: 41 }, + "0x13b4": { primary: 12, secondary: 6, reqSkill: 41 }, // Clubs // ShadowStrike, Dismount - "0x13B5": { primary: 0, secondary: 11, reqSkill: 40 }, - "0x13B6": { primary: 0, secondary: 1, reqSkill: 40 }, // Scimitars // DoubleStrike, ParalyzingBlow + "0x13b5": { primary: 0, secondary: 11, reqSkill: 40 }, + "0x13b6": { primary: 0, secondary: 1, reqSkill: 40 }, // Scimitars // DoubleStrike, ParalyzingBlow - "0x13B9": { primary: 11, secondary: 4, reqSkill: 40 }, - "0x13BA": { primary: 11, secondary: 4, reqSkill: 40 }, // Viking Swords // ParalyzingBlow, CrushingBlow + "0x13b9": { primary: 11, secondary: 4, reqSkill: 40 }, + "0x13ba": { primary: 11, secondary: 4, reqSkill: 40 }, // Viking Swords // ParalyzingBlow, CrushingBlow - "0x13FC": { primary: 0, secondary: 6, reqSkill: 31 }, - "0x13FD": { primary: 0, secondary: 6, reqSkill: 31 }, // Heavy Crossbows // MovingShot, Dismount + "0x13fc": { primary: 0, secondary: 6, reqSkill: 31 }, + "0x13fd": { primary: 0, secondary: 6, reqSkill: 31 }, // Heavy Crossbows // MovingShot, Dismount - "0x13E3": { primary: 4, secondary: 12, reqSkill: 41 }, - "0x13E4": { primary: 4, secondary: 12, reqSkill: 41 }, // Smith's Hammers // CrushingBlow, ShadowStrike + "0x13e3": { primary: 4, secondary: 12, reqSkill: 41 }, + "0x13e4": { primary: 4, secondary: 12, reqSkill: 41 }, // Smith's Hammers // CrushingBlow, ShadowStrike - "0x13F6": { primary: 8, secondary: 5, reqSkill: 40 }, - "0x13F7": { primary: 8, secondary: 5, reqSkill: 40 }, // Butcher Knives // InfectiousStrike,Disarm + "0x13f6": { primary: 8, secondary: 5, reqSkill: 40 }, + "0x13f7": { primary: 8, secondary: 5, reqSkill: 40 }, // Butcher Knives // InfectiousStrike,Disarm - "0x13F8": { primary: 3, secondary: 0, reqSkill: 41 }, - "0x13F9": { primary: 3, secondary: 0, reqSkill: 41 }, // Gnarled Staves // ConcussionBlow,ForceOfNature + "0x13f8": { primary: 3, secondary: 0, reqSkill: 41 }, + "0x13f9": { primary: 3, secondary: 0, reqSkill: 41 }, // Gnarled Staves // ConcussionBlow,ForceOfNature - "0x13FA": { primary: 0, secondary: 2, reqSkill: 40 }, - "0x13FB": { primary: 0, secondary: 2, reqSkill: 40 }, // Large Battle Axes // WhirlwindAttack,BleedAttack + "0x13fa": { primary: 0, secondary: 2, reqSkill: 40 }, + "0x13fb": { primary: 0, secondary: 2, reqSkill: 40 }, // Large Battle Axes // WhirlwindAttack,BleedAttack - "0x13FE": { primary: 0, secondary: 1, reqSkill: 40 }, - "0x13FF": { primary: 0, secondary: 1, reqSkill: 40 }, // Katana // DoubleStrike,ArmorIgnore + "0x13fe": { primary: 0, secondary: 1, reqSkill: 40 }, + "0x13ff": { primary: 0, secondary: 1, reqSkill: 40 }, // Katana // DoubleStrike,ArmorIgnore "0x1400": { primary: 1, secondary: 8, reqSkill: 42 }, "0x1401": { primary: 1, secondary: 8, reqSkill: 42 }, // Kryss // ArmorIgnore,InfectiousStrike @@ -149,14 +151,14 @@ function RequiredSkill( pUser, abilityID ) "0x1438": { primary: 0, secondary: 4, reqSkill: 41 }, "0x1439": { primary: 0, secondary: 4, reqSkill: 41 }, // War Hammers // WhirlwindAttack,CrushingBlow - "0x143A": { primary: 0, secondary: 3, reqSkill: 41 }, - "0x143B": { primary: 0, secondary: 3, reqSkill: 41 }, // Mauls // DoubleStrike,ConcussionBlow + "0x143a": { primary: 0, secondary: 3, reqSkill: 41 }, + "0x143b": { primary: 0, secondary: 3, reqSkill: 41 }, // Mauls // DoubleStrike,ConcussionBlow - "0x143C": { primary: 1, secondary: 9, reqSkill: 41 }, - "0x143D": { primary: 1, secondary: 9, reqSkill: 41 }, // Hammer Picks // ArmorIgnore,MortalStrike + "0x143c": { primary: 1, secondary: 9, reqSkill: 41 }, + "0x143d": { primary: 1, secondary: 9, reqSkill: 41 }, // Hammer Picks // ArmorIgnore,MortalStrike - "0x143E": { primary: 0, secondary: 3, reqSkill: 40 }, - "0x143F": { primary: 0, secondary: 3, reqSkill: 40 }, // Halberds // WhirlwindAttack,ConcussionBlow + "0x143e": { primary: 0, secondary: 3, reqSkill: 40 }, + "0x143f": { primary: 0, secondary: 3, reqSkill: 40 }, // Halberds // WhirlwindAttack,ConcussionBlow "0x1440": { primary: 2, secondary: 12, reqSkill: 40 }, "0x1441": { primary: 2, secondary: 12, reqSkill: 40 }, // Cutlasses // BleedAttack,ShadowStrike @@ -194,7 +196,7 @@ function RequiredSkill( pUser, abilityID ) { var weapon = weaponTypes[itemLHand.sectionID]; - if ( abilityID == weapon.primary ) + if( abilityID == weapon.primary ) { return checkSkillRequirement( pUser, 700, weapon.reqSkill, "70", abilityID ); } @@ -240,6 +242,7 @@ function getAbilityManaTable() function CheckMana( pUser, abilityID ) { + var pSock = pUser.socket; var abilitieMana = getAbilityManaTable(); var NextUse = pUser.GetTempTag( "doubleMana" ); var iTime = GetCurrentClock(); @@ -259,8 +262,8 @@ function CheckMana( pUser, abilityID ) if( pUser.mana < requiredMana ) { - pUser.SysMessage( "You need " + requiredMana + " mana to perform that attack" ); - TriggerEvent(2205, "DeactivateSpecialMove", pUser, abilityID); + pSock.SysMessage( GetDictionaryEntry( 19202, pSock.language), requiredMana); // You need %i mana to perform that attack + TriggerEvent( 2205, "DeactivateSpecialMove", pUser, abilityID ); return false; } else @@ -269,7 +272,7 @@ function CheckMana( pUser, abilityID ) } } -function DeductMana( pUser, abilityID ) +function DeductMana( pUser, abilityID ) { var abilitieMana = getAbilityManaTable(); var NextUse = pUser.GetTempTag( "doubleMana" ); @@ -334,7 +337,7 @@ function onCombatDamageCalc( pAttacker, pDefender, fightSkill, hitLoc ) } else if( abilityID == 3 )// ConcussionBlow { - if (pDefender.maxhp > 0) + if( pDefender.maxhp > 0) { var hitsPercent = ( pDefender.hp / pDefender.maxhp ) * 100.0; @@ -379,408 +382,415 @@ function onAttack( pAttacker, pDefender ) function onAbility( pAttacker, pDefender, abilityID ) { - if (abilityID == 1) // armnor ignore + var pSockAttacker = pAttacker.socket; + var pSockDefender = pDefender.socket; + + if( abilityID == 1 ) // armnor ignore { // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 1) - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + if( abilityID != 1 ) + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana - if (CheckMana(pAttacker, abilityID)) + if( CheckMana( pAttacker, abilityID )) { - DeductMana(pAttacker, abilityID); + DeductMana( pAttacker, abilityID ); } - pAttacker.TextMessage("Your attack penetrates their armor!"); - pDefender.TextMessage("The blow penetrated your armor!"); + pSockAttacker.SysMessage( GetDictionaryEntry( 19203, pSockAttacker.language ));// Your attack penetrates their armor! + pSockDefender.SysMessage( GetDictionaryEntry( 19204, pSockDefender.language ));// The blow penetrated your armor! - pDefender.SoundEffect(0x0056, true); - pDefender.StaticEffect(0x3728, 0x09, 0x06); + pDefender.SoundEffect( 0x0056, true ); + pDefender.StaticEffect( 0x3728, 0x09, 0x06 ); - TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success + TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } - else if (abilityID == 2) // bleedattack + else if( abilityID == 2 ) // bleedattack { // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 2) - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + if( abilityID != 2 ) + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana - if (CheckMana(pAttacker, abilityID)) + if( CheckMana( pAttacker, abilityID )) { - DeductMana(pAttacker, abilityID); + DeductMana( pAttacker, abilityID ); } - pAttacker.SysMessage("Your target is bleeding!"); - pDefender.SysMessage("You are bleeding!"); + pSockAttacker.SysMessage( GetDictionaryEntry( 19205, pSockAttacker.language ));// Your target is bleeding! + pSockDefender.SysMessage( GetDictionaryEntry( 19206, pSockDefender.language ));// You are bleeding! - pDefender.TextMessage("You are bleeding profusely", false, 0x21); - pDefender.TextMessage(pDefender.name + " is bleeding profusely", true, 0x21, 1); + pSockDefender.TextMessage( GetDictionaryEntry( 19207, pSockDefender.language), false, 0x21 );// You are bleeding profusely + pSockDefender.TextMessage( pDefender.name, GetDictionaryEntry( 19208, pSockDefender.language), true, 0x21, 1 );// %i is bleeding profusely pDefender.StartTimer( 2000, 9300, 7001 ); // Start 2 second timer for blood and damage last total 10 seconds pDefender.SetTempTag( "doBleed", true ); - if (pDefender.socket) - TriggerEvent(50104, "AddBuff", pDefender, 1039, 1075829, 1075830, 10, " 1, 10 ,2"); + if( pDefender.socket) + TriggerEvent(50104, "AddBuff", pDefender, 1039, 1075829, 1075830, 10, " 1, 10 ,2" ); - pAttacker.SoundEffect(0x133, true); - pDefender.StaticEffect(0x377A, 0x09, 0x32); + pAttacker.SoundEffect( 0x133, true ); + pDefender.StaticEffect( 0x377A, 0x09, 0x32 ); - TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success + TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } - else if (abilityID == 3) // ConcussionBlow + else if( abilityID == 3 ) // ConcussionBlow { - // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 3) - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + if( abilityID != 3 ) + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana - if (CheckMana(pAttacker, abilityID)) + if( CheckMana( pAttacker, abilityID )) { - DeductMana(pAttacker, abilityID); + DeductMana( pAttacker, abilityID ); } - pAttacker.SysMessage("You have delivered a concussion!"); - pDefender.SysMessage("You feel disoriented!"); + pSockAttacker.SysMessage( GetDictionaryEntry( 19209, pSockAttacker.language ));// You have delivered a concussion! + pSockDefender.SysMessage( GetDictionaryEntry( 19210, pSockDefender.language ));// You feel disoriented! - pAttacker.SoundEffect(0x213, true); - pDefender.StaticEffect(0x377A, 0x09, 0x32); + pAttacker.SoundEffect( 0x213, true ); + pDefender.StaticEffect( 0x377A, 0x09, 0x32 ); - TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success + TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } - else if (abilityID == 4) // crushingblow + else if( abilityID == 4 ) // crushingblow { // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 4) - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + if( abilityID != 4 ) + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana - if (CheckMana(pAttacker, abilityID)) + if( CheckMana( pAttacker, abilityID )) { - DeductMana(pAttacker, abilityID); + DeductMana( pAttacker, abilityID ); } - pAttacker.SysMessage("You have delivered a crushing blow!"); - pDefender.SysMessage("You take extra damage from the crushing attack!"); + pSockAttacker.SysMessage( GetDictionaryEntry( 19211, pSockAttacker.language ));// You have delivered a crushing blow! + pSockDefender.SysMessage( GetDictionaryEntry( 19212, pSockDefender.language ));// You take extra damage from the crushing attack! - pAttacker.SoundEffect(0x1E1, true); - TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success + pAttacker.SoundEffect( 0x1E1, true ); + TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } - else if (abilityID == 5) // Disarm + else if( abilityID == 5 ) // Disarm { - var itemRHand = pDefender.FindItemLayer(0x01); - var itemLHand = pDefender.FindItemLayer(0x02); + var itemRHand = pDefender.FindItemLayer( 0x01 ); + var itemLHand = pDefender.FindItemLayer( 0x02 ); - if (pDefender.pack == null || itemLHand != null && itemLHand.movable >= 2 || itemRHand != null && itemRHand.movable >= 2) { - pAttacker.SysMessage("You cannot disarm your opponent."); - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + if( pDefender.pack == null || itemLHand != null && itemLHand.movable >= 2 || itemRHand != null && itemRHand.movable >= 2 ) + { + pSockAttacker.SysMessage( GetDictionaryEntry( 19213, pSockAttacker.language ));// You cannot disarm your opponent. + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); return false; } - if (itemLHand != null && itemLHand.type == 9 || itemRHand != null && itemRHand.type == 9) { - pAttacker.SysMessage("Your target is already unarmed!"); - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + if( itemLHand != null && itemLHand.type == 9 || itemRHand != null && itemRHand.type == 9 ) + { + pSockAttacker.SysMessage( GetDictionaryEntry( 19214, pSockAttacker.language ));// Your target is already unarmed! + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); return false; } // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 5) - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + if( abilityID != 5 ) + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana - if (CheckMana(pAttacker, abilityID)) + if( CheckMana( pAttacker, abilityID )) { - DeductMana(pAttacker, abilityID); + DeductMana( pAttacker, abilityID ); } - pAttacker.SoundEffect(0x3B9, true); - pDefender.StaticEffect(0x37BE, 0x09, 0x32); + pAttacker.SoundEffect( 0x3B9, true ); + pDefender.StaticEffect( 0x37BE, 0x09, 0x32 ); - pAttacker.SysMessage("You disarm their weapon!"); - pDefender.SysMessage("Your weapon has been disarmed!"); + pSockAttacker.SysMessage( GetDictionaryEntry( 19215, pSockAttacker.language ));// You disarm their weapon! + pSockDefender.SysMessage( GetDictionaryEntry( 19216, pSockDefender.language ));// Your weapon has been disarmed! - if (itemLHand != null) { + if( itemLHand != null ) + { itemLHand.container = pDefender.pack; } - if (itemRHand != null) { + if( itemRHand != null ) + { itemRHand.container = pDefender.pack; } pDefender.AddScriptTrigger(7002);//block equip for 5 seconds script added - pDefender.SetTempTag("BlockEquip", true); - pDefender.StartTimer(5000, 9100, 7001); + pDefender.SetTempTag( "blockEquip", true ); + pDefender.StartTimer( 5000, 9100, 7001 ); - TriggerEvent(50104, "AddBuff", pDefender, 0x3ea, 1075637, 0, 5, " "); + TriggerEvent(50104, "AddBuff", pDefender, 0x3ea, 1075637, 0, 5, " " ); - TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success + TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } - else if (abilityID == 6) // Dismount + else if( abilityID == 6 ) // Dismount { // Check to see if player is mount or flying. - if (pAttacker.isonhorse) + if( pAttacker.isonhorse || pAttacker.isflying ) { - pAttacker.TextMessage("You cannot perform that attack while mounted or flying!"); - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + pSockAttacker.SysMessage( GetDictionaryEntry( 19217, pSockAttacker.language ));// You cannot perform that attack while mounted or flying! + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); return true; } // Only Can work on players or npcs that is mounted - if (!pDefender.isonhorse) + if( !pDefender.isonhorse || !pDefender.isflying ) { - pAttacker.TextMessage("This attack only works on mounted or flying targets"); - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + pSockAttacker.SysMessage( GetDictionaryEntry( 19218, pSockAttacker.language ));// This attack only works on mounted or flying targets + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); return true; } // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 6) - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + if( abilityID != 6 ) + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana - if (CheckMana(pAttacker, abilityID)) + if( CheckMana( pAttacker, abilityID )) { - DeductMana(pAttacker, abilityID); + DeductMana( pAttacker, abilityID ); } //Lesser Hiryu have an 80% chance of missing this attack needs added //This is the Dismount Information sent to Attacker and Defender - pDefender.SoundEffect(0x140, true); - pDefender.StaticEffect(0x3728, 0x09, 0x06); - pAttacker.TextMessage("The force of your attack has dislodged them from their mount!"); + pDefender.SoundEffect( 0x140, true ); + pDefender.StaticEffect( 0x3728, 0x09, 0x06 ); + pSockAttacker.SysMessage( GetDictionaryEntry( 19219, pSockAttacker.language ));// The force of your attack has dislodged them from their mount! pDefender.Dismount(); - pDefender.TextMessage("You have been knocked off of your mount by " + pAttacker.name + "!"); - pAttacker.SetTempTag("Dismount", false); - TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success + pSockDefender.SysMessage( GetDictionaryEntry( 19220, pSockDefender.language ), pAttacker.name );// You have been knocked off of your mount by %i ! + + TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } - else if (abilityID == 8) // Infectious Strike + else if( abilityID == 8 ) // Infectious Strike { var itemRHand = pAttacker.FindItemLayer(0x01); var itemLHand = pAttacker.FindItemLayer(0x02); - if (itemLHand != null && itemLHand.poison <= 0 || itemRHand != null && itemRHand.poison <= 0) + if( itemLHand != null && itemLHand.poison <= 0 || itemRHand != null && itemRHand.poison <= 0 ) { - pDefender.SysMessage("Your weapon must have a dose of poison to perform an infectious strike!"); - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + pSockAttacker.SysMessage( GetDictionaryEntry( 19221, pSockAttacker.language ));// Your weapon must have a dose of poison to perform an infectious strike! + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); return; } // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 8) - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + if( abilityID != 8 ) + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana - if (CheckMana(pAttacker, abilityID)) + if( CheckMana( pAttacker, abilityID )) { - DeductMana(pAttacker, abilityID); + DeductMana( pAttacker, abilityID ); } var level = 0; var chance = Math.random(); - if (pAttacker.skills[30] >= 0 && pAttacker.skills[30] <= 199) + if( pAttacker.skills[30] >= 0 && pAttacker.skills[30] <= 199 ) { level = 1; } - else if (pAttacker.skills[30] >= 200 && pAttacker.skills[30] <= 399) + else if( pAttacker.skills[30] >= 200 && pAttacker.skills[30] <= 399 ) { level = 2; } - else if (pAttacker.skills[30] >= 400 && pAttacker.skills[30] <= 599) + else if( pAttacker.skills[30] >= 400 && pAttacker.skills[30] <= 599 ) { level = 3; } - else if (pAttacker.skills[30] >= 600 && pAttacker.skills[30] <= 1000) + else if( pAttacker.skills[30] >= 600 && pAttacker.skills[30] <= 1000 ) { level = 4; } // Adjust the poison level based on chance - if (chance < 0.2) + if( chance < 0.2 ) { level--; // Decrease the level by 1 - if (level < 0) + if( level < 0 ) { level = 1; // Ensure the level doesn't go below 0 and is always set to least 1 } } - else if (chance > 0.8) + else if( chance > 0.8 ) { level++; // Increase the level by 1 - pAttacker.SysMessage("Your precise strike has increased the level of the poison by 1"); - pDefender.SysMessage("The poison seems extra effective!"); + pSockAttacker.SysMessage( GetDictionaryEntry( 19222, pSockAttacker.language ));// Your precise strike has increased the level of the poison by 1 + pSockDefender.SysMessage( GetDictionaryEntry( 19223, pSockDefender.language ));// The poison seems extra effective! } - pAttacker.TextMessage("You have poisoned your target : " + pDefender.name); - pDefender.TextMessage(pAttacker.name + " : poisoned you!"); + pSockAttacker.SysMessage( GetDictionaryEntry( 19224, pSockAttacker.language), pDefender.name);// You have poisoned your target : + pSockDefender.SysMessage( pAttacker.name, GetDictionaryEntry( 19225, pSockDefender.language ));// %i : poisoned you! pDefender.poison = level; - pAttacker.SoundEffect(0xDD, true); - pDefender.StaticEffect(0x3728, 0x09, 0x32); - TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success + pAttacker.SoundEffect( 0xDD, true ); + pDefender.StaticEffect( 0x3728, 0x09, 0x32 ); + TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } - else if (abilityID == 9) // Mortal Strike - {// turn healthbar yellow on defender need spacket sent for this. + else if( abilityID == 9 ) // Mortal Strike + { // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 9) - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + if( abilityID != 9 ) + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana - if (CheckMana(pAttacker, abilityID)) + if( CheckMana( pAttacker, abilityID )) { - DeductMana(pAttacker, abilityID); + DeductMana( pAttacker, abilityID ); } - pAttacker.SysMessage("You deliver a mortal wound!"); - pDefender.SysMessage("You have been mortally wounded!"); + pSockAttacker.SysMessage( GetDictionaryEntry( 19226, pSockAttacker.language ));// You deliver a mortal wound! + pSockDefender.SysMessage( GetDictionaryEntry( 19227, pSockDefender.language ));// You have been mortally wounded! - pAttacker.SoundEffect(0x1E1, true); - pDefender.StaticEffect(0x37B9, 0x09, 0x32); + pAttacker.SoundEffect( 0x1E1, true ); + pDefender.StaticEffect( 0x37B9, 0x09, 0x32 ); - pDefender.SetTempTag("blockHeal", true); + pDefender.SetTempTag( "blockHeal", true ); var seconds = 6000; // We want this applied to players even if they are "offline" (aka disconnected but not vanished from view yet) - if (pDefender.npc) { + if( pDefender.npc ) + { seconds = 12000; } - pDefender.StartTimer(seconds, 9200, true); + pDefender.StartTimer(seconds, 9200, true ); - if (pDefender.socket) - TriggerEvent(50104, "AddBuff", pDefender, 1027, 1075810, 1075811, 6, " "); + if( pDefender.socket ) + TriggerEvent( 50104, "AddBuff", pDefender, 1027, 1075810, 1075811, 6, " " ); - TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success + TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } - else if (abilityID == 11) // ParalyzingBlow + else if( abilityID == 11 ) // ParalyzingBlow { // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 11) - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + if( abilityID != 11 ) + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana - if (CheckMana(pAttacker, abilityID)) + if( CheckMana( pAttacker, abilityID )) { - DeductMana(pAttacker, abilityID); + DeductMana( pAttacker, abilityID ); } - pAttacker.SoundEffect(0x204, true); - pDefender.StaticEffect(0x376A, 0x09, 0x32); - var IsImmune = pDefender.GetTempTag("IsImmune") + pAttacker.SoundEffect( 0x204, true ); + pDefender.StaticEffect( 0x376A, 0x09, 0x32 ); + var isImmune = pDefender.GetTempTag( "isImmune" ) - if (IsImmune != null && IsImmune == true) + if( isImmune != null && isImmune == true ) { - pAttacker.TextMessage("Your target resists paralysis."); - pDefender.TextMessage("You resist paralysis."); + pSockAttacker.SysMessage( GetDictionaryEntry( 19228, pSockAttacker.language ));// Your target resists paralysis. + pSockDefender.SysMessage( GetDictionaryEntry( 19229, pSockDefender.language ));// You resist paralysis. return true; } var seconds = 3000; // We want this applied to players even if they are "offline" (aka disconnected but not vanished from view yet) - if (pDefender.npc) + if( pDefender.npc ) { seconds = 6000; } - else if (pDefender.socket) + else if( pDefender.socket ) { - pDefender.TextMessage("The attack has temporarily paralyzed you!", false, 0x3b2, 0, pDefender.serial);// The attack has temporarily paralyzed you! + pSockDefender.TextMessage( GetDictionaryEntry( 19230, pSockDefender.language ), false, 0x3b2, 0, pDefender.serial );// The attack has temporarily paralyzed you! } - pDefender.SetTempTag("IsImmune", true); - pDefender.StartTimer(seconds + 8000, 9000, 7001); - pDefender.StartTimer(seconds, 8000, 7001); + pDefender.SetTempTag( "isImmune", true ); + pDefender.StartTimer( seconds + 8000, 9000, 7001 ); + pDefender.StartTimer( seconds, 8000, 7001 ); pDefender.frozen = true; - if (pAttacker.socket) + if( pAttacker.socket ) { - pAttacker.TextMessage(GetDictionaryEntry(17702, pAttacker.socket.language), false, 0x3b2, 0, pAttacker.serial);// You deliver a paralyzing blow! + pSockAttacker.SysMessage( GetDictionaryEntry( 17702, pAttacker.socket.language), false, 0x3b2, 0, pAttacker.serial );// You deliver a paralyzing blow! } - TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID);// Clear the Ability after success + TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } - else if (abilityID == 12) // shadowstrike + else if( abilityID == 12 ) // shadowstrike { - if (pAttacker.skills[47] < 800) // Stealth + if( pAttacker.skills[47] < 800 ) // Stealth { - pAttacker.TextMessage("You lack the required stealth to perform that attack"); - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + pSockAttacker.SysMessage( GetDictionaryEntry( 19231, pSockAttacker.language ));// "You lack the required stealth to perform that attack + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); return true; } // Clear out any current ability the player is doing when he switches abilities - if (abilityID != 12) - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + if( abilityID != 12 ) + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana - if (CheckMana(pAttacker, abilityID)) + if( CheckMana( pAttacker, abilityID )) { - DeductMana(pAttacker, abilityID); + DeductMana( pAttacker, abilityID ); } - pAttacker.TextMessage("You strike and hide in the shadows!"); - pDefender.TextMessage("You are dazed by the attack and your attacker vanishes!"); + pSockAttacker.SysMessage( GetDictionaryEntry( 19232, pSockAttacker.language ));// You strike and hide in the shadows! + pSockDefender.SysMessage( GetDictionaryEntry( 19233, pSockDefender.language ));// You are dazed by the attack and your attacker vanishes! - pAttacker.StaticEffect(0x376A, 0x09, 0x06); + pAttacker.StaticEffect( 0x376A, 0x09, 0x06 ); - pDefender.SoundEffect(0x482, true); - pDefender.StaticEffect(0x37BE, 0x09, 0x06); + pDefender.SoundEffect( 0x482, true ); + pDefender.StaticEffect( 0x37BE, 0x09, 0x06 ); pAttacker.atWar = false; pDefender.atWar = false; pAttacker.visible = 1; - TriggerEvent(2205, "ClearSpecialMove", pAttacker, abilityID); + TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID ); } } function onTimer( timerObj, timerID ) { var socket = timerObj.socket; - var abilityID = timerObj.GetTempTag("abilityID"); + var abilityID = timerObj.GetTempTag( "abilityID" ); var damage = 31; - if (timerObj == null || timerObj.dead) + if( timerObj == null || timerObj.dead) { timerObj.frozen = false; - timerObj.SetTempTag("IsImmune", null); - timerObj.RemoveScriptTrigger(7002); - timerObj.SetTempTag("BlockEquip", null); - timerObj.SetTempTag("blockHeal", null); - timerObj.KillJSTimer(9400, 7001); - timerObj.SetTempTag("doBleed", null); - TriggerEvent(2205, "ClearSpecialMove", timerObj, abilityID); + timerObj.SetTempTag( "isImmune", null ); + timerObj.RemoveScriptTrigger( 7002 ); + timerObj.SetTempTag( "blockEquip", null ); + timerObj.SetTempTag( "blockHeal", null ); + timerObj.KillJSTimer( 9400, 7001 ); + timerObj.SetTempTag( "doBleed", null ); + TriggerEvent( 2205, "ClearSpecialMove", timerObj, abilityID ); return; } - else if (timerID == 8000) + else if( timerID == 8000 ) { timerObj.frozen = false; } - else if (timerID == 9000) + else if( timerID == 9000 ) { - timerObj.SetTempTag("IsImmune", null); + timerObj.SetTempTag( "isImmune", null ); } - else if (timerID == 9100) + else if( timerID == 9100 ) { - timerObj.RemoveScriptTrigger(7002); - timerObj.SetTempTag("BlockEquip", null); - socket.SysMessage("Your confusion has passed, you may now arm a weapon!"); + timerObj.RemoveScriptTrigger( 7002 ); + timerObj.SetTempTag( "blockEquip", null ); + socket.SysMessage( GetDictionaryEntry( 19234, socket.language ));// Your confusion has passed, you may now arm a weapon! } - else if (timerID == 9200) + else if( timerID == 9200 ) { - timerObj.SetTempTag("blockHeal", null); - socket.SysMessage("You are no longer mortally wounded."); + timerObj.SetTempTag("blockHeal", null ); + socket.SysMessage( GetDictionaryEntry( 19235, socket.language ));// You are no longer mortally wounded. } - if (timerID >= 9300 && timerID < 9310) + if( timerID >= 9300 && timerID < 9310 ) { - var damage = RandomNumber(1, 10); - //timerObj.StaticEffect(0x122A, 0, 15); // blood effect got to figure how to add it to ground. + var damage = RandomNumber( 1, 10 ); + //timerObj.StaticEffect( 0x122A, 0, 15); // blood effect got to figure how to add it to ground. timerObj.health -= damage; - timerObj.StartTimer(2000, 9300 + 1, 7001);//restart timer every 2 seconds until it shuts off + timerObj.StartTimer( 2000, 9300 + 1, 7001 );//restart timer every 2 seconds until it shuts off } - else if (timerID == 9310) + else if( timerID == 9310 ) { - timerObj.SetTempTag("doBleed", null); - timerObj.KillJSTimer(9400, 7001); - socket.SysMessage("The bleeding wounds have healed, you are no longer bleeding!"); + timerObj.SetTempTag( "doBleed", null ); + timerObj.KillJSTimer( 9400, 7001 ); + socket.SysMessage( GetDictionaryEntry( 19236, socket.language ));// The bleeding wounds have healed, you are no longer bleeding! } } \ No newline at end of file From 0baa814f14d283029853b2735470e9a130832eb1 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Mon, 10 Jun 2024 16:17:00 -0500 Subject: [PATCH 13/28] Updated rest of Dictionarys --- data/dictionaries/dictionary.CSY | 37 ++++++++++++++++++++++++++++++++ data/dictionaries/dictionary.FRE | 37 ++++++++++++++++++++++++++++++++ data/dictionaries/dictionary.GER | 37 ++++++++++++++++++++++++++++++++ data/dictionaries/dictionary.ITA | 37 ++++++++++++++++++++++++++++++++ data/dictionaries/dictionary.POL | 37 ++++++++++++++++++++++++++++++++ data/dictionaries/dictionary.PTG | 37 ++++++++++++++++++++++++++++++++ data/dictionaries/dictionary.SPA | 37 ++++++++++++++++++++++++++++++++ 7 files changed, 259 insertions(+) diff --git a/data/dictionaries/dictionary.CSY b/data/dictionaries/dictionary.CSY index d19756c34..9b6d32295 100644 --- a/data/dictionaries/dictionary.CSY +++ b/data/dictionaries/dictionary.CSY @@ -5311,5 +5311,42 @@ 19100=Úspěšně jste převedli kov. 19101=Najednou můžete převést pouze pět set ingotů. 19102=Pro výměnu musí být položka ve vašem batohu. +// [19201-19300] Speciální pohyby +19201=K provedení tohoto útoku potřebujete %i zbraň +19202=K provedení tohoto útoku potřebujete %i many +19203=Váš útok proniká jejich pancířem! +19204=Úder pronikl do vašeho brnění! +19205=Váš cíl krvácí! +19206=Ty krvácíš! +19207=Hodně krvácíte +19208=%i silně krvácí +19209=Máte otřes mozku! +19210=Cítíte se dezorientovaný! +19211=Zasadil jsi zdrcující ránu! +19212=Zdrcujícím útokem dostáváte další poškození! +19213=Nemůžete odzbrojit svého protivníka. +19214=Váš cíl již není ozbrojen! +19215=Odzbrojte svou zbraň! +19216=Vaše zbraň byla odzbrojena! +19217=Nemůžete provést tento útok během jízdy nebo letu! +19218=Tento útok funguje pouze na namontované nebo létající cíle +19219=Síla vašeho útoku je vytlačila z jejich koně! +19220=Byli jste sraženi z vašeho koně %i! +19221=Vaše zbraň musí mít dávku jedu, aby mohla provést infekční útok! +19222=Váš přesný zásah zvýšil úroveň jedu o 1 +19223=Jed se zdá být extra účinný! +19224=Otrávili jste svůj cíl: %i +19225=%i : otrávil tě! +19226=Zasadil jsi smrtelnou ránu! +19227=Byl jsi smrtelně zraněn! +19228=Váš cíl odolává paralýze. +19229=Odporujete paralýze. +19230=Útok vás dočasně paralyzoval! +19231=Chybí vám požadované utajení k provedení tohoto útoku +19232=Úder a schováš se ve stínu! +19233=Jste omráčeni útokem a váš útočník zmizí! +19234=Váš zmatek pominul, nyní můžete vyzbrojit zbraň! +19235=Už nejsi smrtelně zraněný. +19236=Krvácející rány se zahojily, už nekrvácíte! } EOF diff --git a/data/dictionaries/dictionary.FRE b/data/dictionaries/dictionary.FRE index 9465437b6..d61ada06d 100644 --- a/data/dictionaries/dictionary.FRE +++ b/data/dictionaries/dictionary.FRE @@ -5467,5 +5467,42 @@ 19100=Vous avez réussi à convertir le métal. 19101=Vous ne pouvez convertir que cinq cents lingots à la fois. 19102=L'article doit être dans votre sac à dos pour être échangé. +// [19201-19300] Coups spéciaux +19201=Vous avez besoin de %i compétence d'arme pour effectuer cette attaque +19202=Vous avez besoin de %i mana pour effectuer cette attaque +19203=Votre attaque pénètre leur armure ! +19204=Le coup a pénétré votre armure ! +19205=Votre cible saigne ! +19206=Vous saignez ! +19207=Vous saignez abondamment +19208=%i saigne abondamment +19209=Vous avez provoqué une commotion cérébrale ! +19210=Vous vous sentez désorienté ! +19211=Vous avez porté un coup fatal ! +19212=Vous subissez des dégâts supplémentaires grâce à l'attaque écrasante ! +19213=Vous ne pouvez pas désarmer votre adversaire. +19214=Votre cible n'est déjà pas armée ! +19215=Vous désarmez votre arme ! +19216=Votre arme a été désarmée ! +19217=Vous ne pouvez pas effectuer cette attaque en étant monté ou en vol ! +19218=Cette attaque ne fonctionne que sur des cibles montées ou volantes +19219=La force de votre attaque les a déloges de leur monture ! +19220=Vous avez été renversé de votre monture par %i ! +19221=Votre arme doit contenir une dose de poison pour effectuer une frappe contagieuse ! +19222=Votre frappe précise a augmenté le niveau du poison de 1 +19223=Le poison semble très efficace ! +19224=Vous avez empoisonné votre cible : %i +19225=%i : vous a empoisonné ! +19226=Vous infligez une blessure mortelle ! +19227=Vous avez été mortellement blessé ! +19228=Votre cible résiste à la paralysie. +19229=Vous résistez à la paralysie. +19230=L'attaque vous a temporairement paralysé ! +19231=Vous n'avez pas la furtivité requise pour effectuer cette attaque +19232=Vous frappez et vous cachez dans l'ombre ! +19233=Vous êtes étourdi par l'attaque et votre attaquant disparaît ! +19234=Votre confusion est passée, vous pouvez maintenant armer une arme ! +19235=Vous n'êtes plus mortellement blessé. +19236=Les plaies saignantes ont guéri, vous ne saignez plus ! } EOF diff --git a/data/dictionaries/dictionary.GER b/data/dictionaries/dictionary.GER index 2376f9a36..e0cc39df1 100644 --- a/data/dictionaries/dictionary.GER +++ b/data/dictionaries/dictionary.GER @@ -5311,5 +5311,42 @@ 19100=Sie haben das Metall erfolgreich umgewandelt. 19101=Sie können jeweils nur fünfhundert Barren umwandeln. 19102=Der Artikel muss sich zum Umtausch in Ihrem Rucksack befinden. +// [19201-19300] Spezialbewegungen +19201=Sie benötigen %i Waffenfähigkeit, um diesen Angriff auszuführen +19202=Du brauchst %i Mana, um diesen Angriff auszuführen +19203=Dein Angriff durchdringt ihre Rüstung! +19204=Der Schlag hat deine Rüstung durchdrungen! +19205=Dein Ziel blutet! +19206=Du blutest! +19207=Sie bluten stark +19208=%i blutet stark +19209=Sie haben sich eine Gehirnerschütterung zugezogen! +19210=Sie fühlen sich desorientiert! +19211=Du hast einen vernichtenden Schlag versetzt! +19212=Du erleidest zusätzlichen Schaden durch den vernichtenden Angriff! +19213=Sie können Ihren Gegner nicht entwaffnen. +19214=Ihr Ziel ist bereits unbewaffnet! +19215=Du entwaffnest ihre Waffe! +19216=Deine Waffe wurde entschärft! +19217=Sie können diesen Angriff nicht ausführen, während Sie reiten oder fliegen! +19218=Dieser Angriff funktioniert nur bei berittenen oder fliegenden Zielen +19219=Die Wucht deines Angriffs hat sie von ihrem Reittier gestoßen! +19220=Du wurdest von %i von deinem Reittier gestoßen! +19221=Ihre Waffe muss über eine Giftdosis verfügen, um einen ansteckenden Schlag auszuführen! +19222=Dein präziser Schlag hat die Giftstufe um 1 erhöht +19223=Das Gift scheint besonders wirksam zu sein! +19224=Sie haben Ihr Ziel vergiftet: %i +19225=%i: hat dich vergiftet! +19226=Du fügst eine tödliche Wunde zu! +19227=Du wurdest tödlich verwundet! +19228=Ihr Ziel widersteht einer Lähmung. +19229=Sie widerstehen einer Lähmung. +19230=Der Angriff hat Sie vorübergehend gelähmt! +19231=Ihnen fehlt die erforderliche Tarnung, um diesen Angriff auszuführen +19232=Du schlägst zu und versteckst dich im Schatten! +19233=Sie sind durch den Angriff benommen und Ihr Angreifer verschwindet! +19234=Ihre Verwirrung ist vorüber, Sie können jetzt eine Waffe bewaffnen! +19235=Sie sind nicht mehr tödlich verwundet. +19236=Die blutenden Wunden sind verheilt, Sie bluten nicht mehr! } EOF diff --git a/data/dictionaries/dictionary.ITA b/data/dictionaries/dictionary.ITA index 882528064..2a20d9062 100644 --- a/data/dictionaries/dictionary.ITA +++ b/data/dictionaries/dictionary.ITA @@ -5311,5 +5311,42 @@ 19100=Hai convertito con successo il metallo. 19101=Puoi convertire solo cinquecento lingotti alla volta. 19102=L'articolo deve essere nel tuo zaino per essere scambiato. +// [19201-19300] Mosse speciali +19201=Hai bisogno di %i abilità con l'arma per eseguire quell'attacco +19202=Hai bisogno di %i mana per eseguire quell'attacco +19203=Il tuo attacco penetra la loro armatura! +19204=Il colpo ha penetrato la tua armatura! +19205=Il tuo bersaglio sta sanguinando! +19206=Stai sanguinando! +19207=Stai sanguinando copiosamente +19208=%i sta sanguinando copiosamente +19209=Hai provocato una commozione cerebrale! +19210=Ti senti disorientato! +19211=Hai sferrato un colpo devastante! +19212=Subisci danni extra dall'attacco devastante! +19213=Non puoi disarmare il tuo avversario. +19214=Il tuo bersaglio è già disarmato! +19215=Disarma la loro arma! +19216=La tua arma è stata disarmata! +19217=Non puoi eseguire quell'attacco mentre sei a cavallo o mentre voli! +19218=Questo attacco funziona solo su bersagli montati o volanti +19219=La forza del tuo attacco li ha spostati dalla loro cavalcatura! +19220=Sei stato buttato giù dalla tua cavalcatura da %i! +19221=La tua arma deve avere una dose di veleno per eseguire un colpo infettivo! +19222=Il tuo colpo preciso ha aumentato il livello del veleno di 1 +19223=Il veleno sembra estremamente efficace! +19224=Hai avvelenato il tuo bersaglio: %i +19225=%i: ti ha avvelenato! +19226=Hai procurato una ferita mortale! +19227=Sei stato ferito a morte! +19228=Il tuo bersaglio resiste alla paralisi. +19229=Resisti alla paralisi. +19230=L'attacco ti ha temporaneamente paralizzato! +19231=Non hai la furtività necessaria per eseguire quell'attacco +19232=Colpisci e ti nascondi nell'ombra! +19233=Sei stordito dall'attacco e il tuo aggressore svanisce! +19234=La tua confusione è passata, ora puoi armare un'arma! +19235=Non sei più ferito a morte. +19236=Le ferite sanguinanti sono guarite, non stai più sanguinando! } EOF diff --git a/data/dictionaries/dictionary.POL b/data/dictionaries/dictionary.POL index 144ca3bbf..0ca11cd4a 100644 --- a/data/dictionaries/dictionary.POL +++ b/data/dictionaries/dictionary.POL @@ -5311,5 +5311,42 @@ 19100=Udało Ci się przekonwertować metal. 19101=Możesz wymieniać tylko pięćset sztabek na raz. 19102=Przedmiot musi znajdować się w Twoim plecaku, aby można go było wymienić. +// [19201-19300] Ruchy specjalne +19201=Potrzebujesz %i umiejętności posługiwania się bronią, aby wykonać ten atak +19202=Potrzebujesz %i many, aby wykonać ten atak +19203=Twój atak przebija ich zbroję! +19204=Cios przebił twoją zbroję! +19205=Twój cel krwawi! +19206=Krwawisz! +19207=Obficie krwawisz +19208=%i obficie krwawi +19209=Doznałeś wstrząsu mózgu! +19210=Czujesz się zdezorientowany! +19211=Zadałeś miażdżący cios! +19212=Otrzymujesz dodatkowe obrażenia od miażdżącego ataku! +19213=Nie możesz rozbroić przeciwnika. +19214=Twój cel jest już nieuzbrojony! +19215=Rozbrajasz ich broń! +19216=Twoja broń została rozbrojona! +19217=Nie możesz wykonać tego ataku na koniu lub w locie! +19218=Ten atak działa tylko na cele konne lub latające +19219=Siła twojego ataku zrzuciła ich z wierzchowca! +19220=Zostałeś strącony z wierzchowca przez %i! +19221=Twoja broń musi zawierać dawkę trucizny, aby wykonać zaraźliwy atak! +19222=Twoje precyzyjne uderzenie zwiększyło poziom trucizny o 1 +19223=Trucizna wydaje się wyjątkowo skuteczna! +19224=Otrułeś swój cel: %i +19225=%i: otrułem cię! +19226=Zadajesz śmiertelną ranę! +19227=Zostałeś śmiertelnie ranny! +19228=Twój cel jest odporny na paraliż. +19229=Jesteś odporny na paraliż. +19230=Atak chwilowo cię sparaliżował! +19231=Brakuje Ci wymaganej umiejętności ukrywania się, aby wykonać ten atak +19232=Uderzasz i chowasz się w cieniu! +19233=Jesteś oszołomiony atakiem i twój napastnik znika! +19234=Twoje zamieszanie minęło, możesz teraz uzbroić broń! +19235=Nie jesteś już śmiertelnie ranny. +19236=Krwawiące rany się zagoiły, już nie krwawisz! } EOF diff --git a/data/dictionaries/dictionary.PTG b/data/dictionaries/dictionary.PTG index 416dcad46..8ab1e9c06 100644 --- a/data/dictionaries/dictionary.PTG +++ b/data/dictionaries/dictionary.PTG @@ -5311,5 +5311,42 @@ 19100=Você converteu o metal com sucesso. 19101=Você só pode converter quinhentos lingotes por vez. 19102=O item deve estar em sua mochila para ser trocado. +// [19201-19300] Movimentos Especiais +19201=Você precisa de %i habilidade com arma para realizar esse ataque +19202=Você precisa de %i mana para realizar esse ataque +19203=Seu ataque penetra na armadura deles! +19204=O golpe penetrou em sua armadura! +19205=Seu alvo está sangrando! +19206=Você está sangrando! +19207=Você está sangrando muito +19208=%i está sangrando profusamente +19209=Você causou uma concussão! +19210=Você se sente desorientado! +19211=Você desferiu um golpe esmagador! +19212=Você sofre dano extra com o ataque esmagador! +19213=Você não pode desarmar seu oponente. +19214=Seu alvo já está desarmado! +19215=Você desarma a arma deles! +19216=Sua arma foi desarmada! +19217=Você não pode realizar esse ataque enquanto estiver montado ou voando! +19218=Este ataque só funciona em alvos montados ou voadores +19219=A força do seu ataque os desalojou da montaria! +19220=Você foi derrubado da montaria por %i! +19221=Sua arma deve ter uma dose de veneno para realizar um ataque infeccioso! +19222=Seu ataque preciso aumentou o nível do veneno em 1 +19223=O veneno parece extremamente eficaz! +19224=Você envenenou seu alvo: %i +19225=%i: envenenou você! +19226=Você causou um ferimento mortal! +19227=Você foi mortalmente ferido! +19228=Seu alvo resiste à paralisia. +19229=Você resiste à paralisia. +19230=O ataque paralisou você temporariamente! +19231=Você não tem a furtividade necessária para realizar esse ataque +19232=Você ataca e se esconde nas sombras! +19233=Você fica atordoado com o ataque e seu atacante desaparece! +19234=Sua confusão passou, agora você pode armar uma arma! +19235=Você não está mais mortalmente ferido. +19236=As feridas sangrentas sararam, você não está mais sangrando! } EOF diff --git a/data/dictionaries/dictionary.SPA b/data/dictionaries/dictionary.SPA index aa5807812..11346b8d4 100644 --- a/data/dictionaries/dictionary.SPA +++ b/data/dictionaries/dictionary.SPA @@ -5311,5 +5311,42 @@ 19100=Has convertido exitosamente el metal. 19101=Sólo puedes convertir quinientos lingotes a la vez. 19102=El artículo debe estar en tu mochila para ser intercambiado. +// [19201-19300] Movimientos especiales +19201=Necesitas %i habilidad con arma para realizar ese ataque +19202=Necesitas %i mana para realizar ese ataque +19203=¡Tu ataque penetra su armadura! +19204=¡El golpe atravesó tu armadura! +19205=¡Tu objetivo está sangrando! +19206=¡Estás sangrando! +19207=Estas sangrando profusamente +19208=%i está sangrando profusamente +19209=¡Has causado una conmoción cerebral! +19210=¡Te sientes desorientado! +19211=¡Has asestado un golpe aplastante! +19212=¡Recibes daño extra por el ataque aplastante! +19213=No puedes desarmar a tu oponente. +19214=¡Tu objetivo ya está desarmado! +19215=¡Desarmas su arma! +19216=¡Tu arma ha sido desarmada! +19217=¡No puedes realizar ese ataque mientras estás montado o volando! +19218=Este ataque sólo funciona en objetivos montados o voladores +19219=¡La fuerza de tu ataque los ha desalojado de su montura! +19220=¡%i te ha derribado de tu montura! +19221=¡Tu arma debe tener una dosis de veneno para realizar un ataque infeccioso! +19222=Tu golpe preciso ha aumentado el nivel del veneno en 1 +19223=¡El veneno parece extra efectivo! +19224=Has envenenado a tu objetivo: %i +19225=%i: ¡te envenenó! +19226=¡Has causado una herida mortal! +19227=¡Has sido herido de muerte! +19228=Tu objetivo resiste la parálisis. +19229=Resistes la parálisis. +19230=¡El ataque te ha paralizado temporalmente! +19231=Te falta el sigilo necesario para realizar ese ataque +19232=¡Atacas y te escondes en las sombras! +19233=¡Estás aturdido por el ataque y tu atacante desaparece! +19234=¡Tu confusión ha pasado, ahora puedes armar un arma! +19235=Ya no estás herido de muerte. +19236=Las heridas sangrantes han sanado, ¡ya no sangras! } EOF From 3283ed5e2c007d5c3bbfc16f584bb38fe9fe6d96 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Wed, 12 Jun 2024 00:46:05 -0500 Subject: [PATCH 14/28] Added restrictedAbilities Added restrictedAbilitiesfor adding unsupported abilities --- data/js/combat/special_moves.js | 110 +++++++++++++++++++++++--------- 1 file changed, 81 insertions(+), 29 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index 4159916cf..fc888d4c0 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -1,5 +1,16 @@ function onSpecialMove( pUser, abilityID ) { + // Define the array of restricted ability IDs + var restrictedAbilities = [7, 10, 13, 14, 15, 16, 17,18,19,20,21,22,23,24,25,29]; + + // Check if the abilityID is in the array of restricted abilities + if( restrictedAbilities.indexOf( abilityID ) != -1 ) + { + pUser.SysMessage( "This ability is not yet available." ); + TriggerEvent( 2205, "DeactivateSpecialMove", pUser, abilityID ); + return false; + } + // Check Skills if( !checkRequiredSkill( pUser, abilityID )) return true; @@ -10,11 +21,8 @@ function onSpecialMove( pUser, abilityID ) if( abilityID >= 1 ) pUser.SetTempTag( "abilityID", abilityID ); - return true; - //The rest of the AOS Abilites before any other expansions - //Double Strike - //Whirlwind Attack + return true; } function checkSkillRequirement( pUser, requiredSkillLevel, requiredSkill, skillMessage, abilityID ) @@ -36,8 +44,8 @@ function checkRequiredSkill( pUser, abilityID ) { // Define weapon types and their skill requirements and if primary or secondary ability var weaponTypes = { - "0x0df0": { primary: 0, secondary: 11, reqSkill: 41 }, - "0x0df1": { primary: 0, secondary: 11, reqSkill: 41 }, // Black Staves // WhirlwindAttack, ParalyzingBlow + "0x0df0": { primary: 13, secondary: 11, reqSkill: 41 }, + "0x0df1": { primary: 13, secondary: 11, reqSkill: 41 }, // Black Staves // WhirlwindAttack, ParalyzingBlow "0x0df2": { primary: 6, secondary: 5, reqSkill: 41 }, "0x0df3": { primary: 6, secondary: 5, reqSkill: 41 }, @@ -47,14 +55,14 @@ function checkRequiredSkill( pUser, abilityID ) "0x0e81": { primary: 4, secondary: 5, reqSkill: 41 }, "0x0e82": { primary: 4, secondary: 5, reqSkill: 41 }, // Shepherd's Crooks // CrushingBlow, Disarm - "0x0e85": { primary: 0, secondary: 5, reqSkill: 40 }, - "0x0e86": { primary: 0, secondary: 5, reqSkill: 40 }, // pickaxe // DoubleStrike, Disarm + "0x0e85": { primary: 7, secondary: 5, reqSkill: 40 }, + "0x0e86": { primary: 7, secondary: 5, reqSkill: 40 }, // pickaxe // DoubleStrike, Disarm "0x0e87": { primary: 2, secondary: 6, reqSkill: 42 }, "0x0e88": { primary: 2, secondary: 6, reqSkill: 42 }, // Pitchforks // BleedAttack, Dismount - "0x0e89": { primary: 0, secondary: 3, reqSkill: 41 }, - "0x0e8a": { primary: 0, secondary: 3, reqSkill: 41 }, // Quarter Staves // DoubleStrike, ConcussionBlow + "0x0e89": { primary: 7, secondary: 3, reqSkill: 41 }, + "0x0e8a": { primary: 7, secondary: 3, reqSkill: 41 }, // Quarter Staves // DoubleStrike, ConcussionBlow "0x0ec2": { primary: 2, secondary: 8, reqSkill: 40 }, "0x0ec3": { primary: 2, secondary: 8, reqSkill: 40 }, // Cleavers // BleedAttack, InfectiousStrike @@ -74,8 +82,8 @@ function checkRequiredSkill( pUser, abilityID ) "0x0f49": { primary: 4, secondary: 6, reqSkill: 40 }, "0x0f4a": { primary: 4, secondary: 6, reqSkill: 40 }, // Axes // CrushingBlow, Dismount - "0x0f4b": { primary: 0, secondary: 0, reqSkill: 40 }, - "0x0f4c": { primary: 0, secondary: 0, reqSkill: 40 }, // Double Axe // DoubleStrike, WhirlwindAttack + "0x0f4b": { primary: 7, secondary: 13, reqSkill: 40 }, + "0x0f4c": { primary: 7, secondary: 13, reqSkill: 40 }, // Double Axe // DoubleStrike, WhirlwindAttack "0x0f4e": { primary: 11, secondary: 6, reqSkill: 40 }, "0x0f4e": { primary: 11, secondary: 6, reqSkill: 40 }, // Bardiches // ParalyzingBlow, Dismount @@ -112,14 +120,14 @@ function checkRequiredSkill( pUser, abilityID ) "0x13b3": { primary: 12, secondary: 6, reqSkill: 41 }, "0x13b4": { primary: 12, secondary: 6, reqSkill: 41 }, // Clubs // ShadowStrike, Dismount - "0x13b5": { primary: 0, secondary: 11, reqSkill: 40 }, - "0x13b6": { primary: 0, secondary: 1, reqSkill: 40 }, // Scimitars // DoubleStrike, ParalyzingBlow + "0x13b5": { primary: 7, secondary: 11, reqSkill: 40 }, + "0x13b6": { primary: 7, secondary: 11, reqSkill: 40 }, // Scimitars // DoubleStrike, ParalyzingBlow "0x13b9": { primary: 11, secondary: 4, reqSkill: 40 }, "0x13ba": { primary: 11, secondary: 4, reqSkill: 40 }, // Viking Swords // ParalyzingBlow, CrushingBlow - "0x13fc": { primary: 0, secondary: 6, reqSkill: 31 }, - "0x13fd": { primary: 0, secondary: 6, reqSkill: 31 }, // Heavy Crossbows // MovingShot, Dismount + "0x13fc": { primary: 10, secondary: 6, reqSkill: 31 }, + "0x13fd": { primary: 10, secondary: 6, reqSkill: 31 }, // Heavy Crossbows // MovingShot, Dismount "0x13e3": { primary: 4, secondary: 12, reqSkill: 41 }, "0x13e4": { primary: 4, secondary: 12, reqSkill: 41 }, // Smith's Hammers // CrushingBlow, ShadowStrike @@ -130,11 +138,11 @@ function checkRequiredSkill( pUser, abilityID ) "0x13f8": { primary: 3, secondary: 0, reqSkill: 41 }, "0x13f9": { primary: 3, secondary: 0, reqSkill: 41 }, // Gnarled Staves // ConcussionBlow,ForceOfNature - "0x13fa": { primary: 0, secondary: 2, reqSkill: 40 }, - "0x13fb": { primary: 0, secondary: 2, reqSkill: 40 }, // Large Battle Axes // WhirlwindAttack,BleedAttack + "0x13fa": { primary: 13, secondary: 2, reqSkill: 40 }, + "0x13fb": { primary: 13, secondary: 2, reqSkill: 40 }, // Large Battle Axes // WhirlwindAttack,BleedAttack - "0x13fe": { primary: 0, secondary: 1, reqSkill: 40 }, - "0x13ff": { primary: 0, secondary: 1, reqSkill: 40 }, // Katana // DoubleStrike,ArmorIgnore + "0x13fe": { primary: 7, secondary: 1, reqSkill: 40 }, + "0x13ff": { primary: 7, secondary: 1, reqSkill: 40 }, // Katana // DoubleStrike,ArmorIgnore "0x1400": { primary: 1, secondary: 8, reqSkill: 42 }, "0x1401": { primary: 1, secondary: 8, reqSkill: 42 }, // Kryss // ArmorIgnore,InfectiousStrike @@ -148,23 +156,23 @@ function checkRequiredSkill( pUser, abilityID ) "0x1406": { primary: 4, secondary: 9, reqSkill: 41 }, "0x1407": { primary: 4, secondary: 9, reqSkill: 41 }, // War Maces // CrushingBlow,MortalStrike - "0x1438": { primary: 0, secondary: 4, reqSkill: 41 }, - "0x1439": { primary: 0, secondary: 4, reqSkill: 41 }, // War Hammers // WhirlwindAttack,CrushingBlow + "0x1438": { primary: 13, secondary: 4, reqSkill: 41 }, + "0x1439": { primary: 13, secondary: 4, reqSkill: 41 }, // War Hammers // WhirlwindAttack,CrushingBlow - "0x143a": { primary: 0, secondary: 3, reqSkill: 41 }, - "0x143b": { primary: 0, secondary: 3, reqSkill: 41 }, // Mauls // DoubleStrike,ConcussionBlow + "0x143a": { primary: 7, secondary: 3, reqSkill: 41 }, + "0x143b": { primary: 7, secondary: 3, reqSkill: 41 }, // Mauls // DoubleStrike,ConcussionBlow "0x143c": { primary: 1, secondary: 9, reqSkill: 41 }, "0x143d": { primary: 1, secondary: 9, reqSkill: 41 }, // Hammer Picks // ArmorIgnore,MortalStrike - "0x143e": { primary: 0, secondary: 3, reqSkill: 40 }, - "0x143f": { primary: 0, secondary: 3, reqSkill: 40 }, // Halberds // WhirlwindAttack,ConcussionBlow + "0x143e": { primary: 13, secondary: 3, reqSkill: 40 }, + "0x143f": { primary: 13, secondary: 3, reqSkill: 40 }, // Halberds // WhirlwindAttack,ConcussionBlow "0x1440": { primary: 2, secondary: 12, reqSkill: 40 }, "0x1441": { primary: 2, secondary: 12, reqSkill: 40 }, // Cutlasses // BleedAttack,ShadowStrike - "0x1442": { primary: 0, secondary: 12, reqSkill: 40 }, - "0x1443": { primary: 0, secondary: 12, reqSkill: 40 } // Two Handed Axes // DoubleStrike,ShadowStrike + "0x1442": { primary: 7, secondary: 12, reqSkill: 40 }, + "0x1443": { primary: 7, secondary: 12, reqSkill: 40 } // Two Handed Axes // DoubleStrike,ShadowStrike }; // Get items in user's hands @@ -236,7 +244,9 @@ function getAbilityManaTable() 9: { manaAmount: 30 }, 10: { manaAmount: 30 }, 11: { manaAmount: 30 }, - 12: { manaAmount: 20 } + 12: { manaAmount: 20 }, + 13: { manaAmount: 20 }, + 14: { manaAmount: 100 } }; } @@ -565,6 +575,20 @@ function onAbility( pAttacker, pDefender, abilityID ) TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } + else if( abilityID == 7 ) // Double Strike + { + // Clear out any current ability the player is doing when he switches abilities + if( abilityID != 7 ) + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + + //checking mana + if( CheckMana( pAttacker, abilityID )) + { + DeductMana( pAttacker, abilityID ); + } + + TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + } else if( abilityID == 8 ) // Infectious Strike { var itemRHand = pAttacker.FindItemLayer(0x01); @@ -663,6 +687,20 @@ function onAbility( pAttacker, pDefender, abilityID ) TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } + else if( abilityID == 10 ) // Moving Shot + { + // Clear out any current ability the player is doing when he switches abilities + if( abilityID != 10 ) + TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + + //checking mana + if( CheckMana( pAttacker, abilityID )) + { + DeductMana( pAttacker, abilityID ); + } + + TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + } else if( abilityID == 11 ) // ParalyzingBlow { // Clear out any current ability the player is doing when he switches abilities @@ -740,6 +778,20 @@ function onAbility( pAttacker, pDefender, abilityID ) TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID ); } + else if( abilityID == 13 ) // Whirlwind Attack + { + // Clear out any current ability the player is doing when he switches abilities + if( abilityID != 13 ) + TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + + //checking mana + if( CheckMana(pAttacker, abilityID )) + { + DeductMana( pAttacker, abilityID ); + } + + TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + } } function onTimer( timerObj, timerID ) From 77d00be485578cbded5608b291615fa7c1957849 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Wed, 12 Jun 2024 20:05:38 -0500 Subject: [PATCH 15/28] Added socket checks Added Socket Checks so if its a npc it does not error out on sysmessage --- data/js/combat/special_moves.js | 49 +++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index fc888d4c0..bd87d3806 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -408,7 +408,8 @@ function onAbility( pAttacker, pDefender, abilityID ) } pSockAttacker.SysMessage( GetDictionaryEntry( 19203, pSockAttacker.language ));// Your attack penetrates their armor! - pSockDefender.SysMessage( GetDictionaryEntry( 19204, pSockDefender.language ));// The blow penetrated your armor! + if( pSockDefender != null ) + pSockDefender.SysMessage( GetDictionaryEntry( 19204, pSockDefender.language ));// The blow penetrated your armor! pDefender.SoundEffect( 0x0056, true ); pDefender.StaticEffect( 0x3728, 0x09, 0x06 ); @@ -428,10 +429,13 @@ function onAbility( pAttacker, pDefender, abilityID ) } pSockAttacker.SysMessage( GetDictionaryEntry( 19205, pSockAttacker.language ));// Your target is bleeding! - pSockDefender.SysMessage( GetDictionaryEntry( 19206, pSockDefender.language ));// You are bleeding! + if( pSockDefender != null ) + { + pSockDefender.SysMessage(GetDictionaryEntry(19206, pSockDefender.language));// You are bleeding! - pSockDefender.TextMessage( GetDictionaryEntry( 19207, pSockDefender.language), false, 0x21 );// You are bleeding profusely - pSockDefender.TextMessage( pDefender.name, GetDictionaryEntry( 19208, pSockDefender.language), true, 0x21, 1 );// %i is bleeding profusely + pSockDefender.TextMessage(GetDictionaryEntry(19207, pSockDefender.language), false, 0x21);// You are bleeding profusely + pSockDefender.TextMessage(pDefender.name, GetDictionaryEntry(19208, pSockDefender.language), true, 0x21, 1);// %i is bleeding profusely + } pDefender.StartTimer( 2000, 9300, 7001 ); // Start 2 second timer for blood and damage last total 10 seconds pDefender.SetTempTag( "doBleed", true ); @@ -457,7 +461,9 @@ function onAbility( pAttacker, pDefender, abilityID ) } pSockAttacker.SysMessage( GetDictionaryEntry( 19209, pSockAttacker.language ));// You have delivered a concussion! - pSockDefender.SysMessage( GetDictionaryEntry( 19210, pSockDefender.language ));// You feel disoriented! + + if( pSockDefender != null ) + pSockDefender.SysMessage( GetDictionaryEntry( 19210, pSockDefender.language ));// You feel disoriented! pAttacker.SoundEffect( 0x213, true ); pDefender.StaticEffect( 0x377A, 0x09, 0x32 ); @@ -478,7 +484,8 @@ function onAbility( pAttacker, pDefender, abilityID ) } pSockAttacker.SysMessage( GetDictionaryEntry( 19211, pSockAttacker.language ));// You have delivered a crushing blow! - pSockDefender.SysMessage( GetDictionaryEntry( 19212, pSockDefender.language ));// You take extra damage from the crushing attack! + if( pSockDefender != null ) + pSockDefender.SysMessage( GetDictionaryEntry( 19212, pSockDefender.language ));// You take extra damage from the crushing attack! pAttacker.SoundEffect( 0x1E1, true ); TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success @@ -516,7 +523,8 @@ function onAbility( pAttacker, pDefender, abilityID ) pDefender.StaticEffect( 0x37BE, 0x09, 0x32 ); pSockAttacker.SysMessage( GetDictionaryEntry( 19215, pSockAttacker.language ));// You disarm their weapon! - pSockDefender.SysMessage( GetDictionaryEntry( 19216, pSockDefender.language ));// Your weapon has been disarmed! + if( pSockDefender != null ) + pSockDefender.SysMessage( GetDictionaryEntry( 19216, pSockDefender.language ));// Your weapon has been disarmed! if( itemLHand != null ) { @@ -571,7 +579,9 @@ function onAbility( pAttacker, pDefender, abilityID ) pDefender.StaticEffect( 0x3728, 0x09, 0x06 ); pSockAttacker.SysMessage( GetDictionaryEntry( 19219, pSockAttacker.language ));// The force of your attack has dislodged them from their mount! pDefender.Dismount(); - pSockDefender.SysMessage( GetDictionaryEntry( 19220, pSockDefender.language ), pAttacker.name );// You have been knocked off of your mount by %i ! + + if( pSockDefender != null ) + pSockDefender.SysMessage( GetDictionaryEntry( 19220, pSockDefender.language ), pAttacker.name );// You have been knocked off of your mount by %i ! TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } @@ -643,11 +653,14 @@ function onAbility( pAttacker, pDefender, abilityID ) { level++; // Increase the level by 1 pSockAttacker.SysMessage( GetDictionaryEntry( 19222, pSockAttacker.language ));// Your precise strike has increased the level of the poison by 1 - pSockDefender.SysMessage( GetDictionaryEntry( 19223, pSockDefender.language ));// The poison seems extra effective! + if( pSockDefender != null ) + pSockDefender.SysMessage( GetDictionaryEntry( 19223, pSockDefender.language ));// The poison seems extra effective! } pSockAttacker.SysMessage( GetDictionaryEntry( 19224, pSockAttacker.language), pDefender.name);// You have poisoned your target : - pSockDefender.SysMessage( pAttacker.name, GetDictionaryEntry( 19225, pSockDefender.language ));// %i : poisoned you! + if( pSockDefender != null ) + pSockDefender.SysMessage( pAttacker.name, GetDictionaryEntry( 19225, pSockDefender.language ));// %i : poisoned you! + pDefender.poison = level; pAttacker.SoundEffect( 0xDD, true ); @@ -668,7 +681,9 @@ function onAbility( pAttacker, pDefender, abilityID ) } pSockAttacker.SysMessage( GetDictionaryEntry( 19226, pSockAttacker.language ));// You deliver a mortal wound! - pSockDefender.SysMessage( GetDictionaryEntry( 19227, pSockDefender.language ));// You have been mortally wounded! + + if( pSockDefender != null ) + pSockDefender.SysMessage( GetDictionaryEntry( 19227, pSockDefender.language ));// You have been mortally wounded! pAttacker.SoundEffect( 0x1E1, true ); pDefender.StaticEffect( 0x37B9, 0x09, 0x32 ); @@ -720,7 +735,8 @@ function onAbility( pAttacker, pDefender, abilityID ) if( isImmune != null && isImmune == true ) { pSockAttacker.SysMessage( GetDictionaryEntry( 19228, pSockAttacker.language ));// Your target resists paralysis. - pSockDefender.SysMessage( GetDictionaryEntry( 19229, pSockDefender.language ));// You resist paralysis. + if( pSockDefender != null ) + pSockDefender.SysMessage( GetDictionaryEntry( 19229, pSockDefender.language ));// You resist paralysis. return true; } @@ -765,7 +781,8 @@ function onAbility( pAttacker, pDefender, abilityID ) } pSockAttacker.SysMessage( GetDictionaryEntry( 19232, pSockAttacker.language ));// You strike and hide in the shadows! - pSockDefender.SysMessage( GetDictionaryEntry( 19233, pSockDefender.language ));// You are dazed by the attack and your attacker vanishes! + if( pSockDefender != null ) + pSockDefender.SysMessage( GetDictionaryEntry( 19233, pSockDefender.language ));// You are dazed by the attack and your attacker vanishes! pAttacker.StaticEffect( 0x376A, 0x09, 0x06 ); @@ -824,7 +841,8 @@ function onTimer( timerObj, timerID ) { timerObj.RemoveScriptTrigger( 7002 ); timerObj.SetTempTag( "blockEquip", null ); - socket.SysMessage( GetDictionaryEntry( 19234, socket.language ));// Your confusion has passed, you may now arm a weapon! + if( socket != null ) + socket.SysMessage( GetDictionaryEntry( 19234, socket.language ));// Your confusion has passed, you may now arm a weapon! } else if( timerID == 9200 ) { @@ -843,6 +861,7 @@ function onTimer( timerObj, timerID ) { timerObj.SetTempTag( "doBleed", null ); timerObj.KillJSTimer( 9400, 7001 ); - socket.SysMessage( GetDictionaryEntry( 19236, socket.language ));// The bleeding wounds have healed, you are no longer bleeding! + if( socket != null ) + socket.SysMessage( GetDictionaryEntry( 19236, socket.language ));// The bleeding wounds have healed, you are no longer bleeding! } } \ No newline at end of file From d6a1d282919b0a3ac9d373d36db697b098479efb Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Wed, 12 Jun 2024 21:48:18 -0500 Subject: [PATCH 16/28] Cleanup Mana Table Added Description for all the mana and added SE and ML Mana --- data/js/combat/special_moves.js | 47 ++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index bd87d3806..5f2d006a8 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -230,23 +230,38 @@ function checkRequiredSkill( pUser, abilityID ) } function getAbilityManaTable() -{ +{// Mana is Based off 2003 AOS and 2005 ML return { - 0: { manaAmount: 0 }, - 1: { manaAmount: 14 }, - 2: { manaAmount: 30 }, - 3: { manaAmount: 20 }, - 4: { manaAmount: 20 }, - 5: { manaAmount: 20 }, - 6: { manaAmount: 16 }, - 7: { manaAmount: 20 }, - 8: { manaAmount: 20 }, - 9: { manaAmount: 30 }, - 10: { manaAmount: 30 }, - 11: { manaAmount: 30 }, - 12: { manaAmount: 20 }, - 13: { manaAmount: 20 }, - 14: { manaAmount: 100 } + 0: { manaAmount: 0 }, // Cancel Ability Attempt + 1: { manaAmount: 30 }, // Armor Ignore // Start AOS abiltiies + 2: { manaAmount: 30 }, // Bleed Attack + 3: { manaAmount: 30 }, // Concusion Blow + 4: { manaAmount: 30 }, // Crushing Blow + 5: { manaAmount: 20 }, // Disarm + 6: { manaAmount: 20 }, // Dismount + 7: { manaAmount: 30 }, // Double Strike + 8: { manaAmount: 20 }, // Infecting + 9: { manaAmount: 30 }, // Mortal Strike + 10: { manaAmount: 20 }, // Moving Shot + 11: { manaAmount: 35 }, // Paralyzing Blow + 12: { manaAmount: 25 }, // Shadow Strike + 13: { manaAmount: 25 }, // Whirlwind Attack // End AOS abilities + 14: { manaAmount: 30 }, // Riding Swipe // Start SE abiltiies + 15: { manaAmount: 30 }, // Frenzied Whirlwind + 16: { manaAmount: 30 }, // Block + 17: { manaAmount: 30 }, // Defense Mastery + 18: { manaAmount: 30 }, // Nerve Strike + 19: { manaAmount: 30 }, // Talon Strike + 20: { manaAmount: 30 }, // Feint + 21: { manaAmount: 30 }, // Dual Wield + 22: { manaAmount: 30 }, // Double shot + 23: { manaAmount: 30 }, // Armor Peirce // End SE abilities + 24: { manaAmount: 25 }, // Bladeweave // Start ML abilities + 25: { manaAmount: 15 }, // Force Arrow + 26: { manaAmount: 15 }, // Lightning Arrow + 27: { manaAmount: 25 }, // Psychic Attack + 28: { manaAmount: 35 }, // Serpent Arrow + 29: { manaAmount: 35 } // Force of Nature // End ML abilities }; } From 6dbb01f1241e93a2770f9abca25cd4cca4ced1c6 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sat, 22 Jun 2024 17:03:16 -0500 Subject: [PATCH 17/28] Update special_moves.js --- data/js/combat/special_moves.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index 5f2d006a8..1742e5993 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -385,8 +385,8 @@ function onCombatDamageCalc( pAttacker, pDefender, fightSkill, hitLoc ) damage = RandomNumber( 0, 4 ); // If defender is a player, damage is divided by this modifier from uox.ini - if( !pDefender.npc ) - damage /= GetServerSetting( "NPCDAMAGERATE" ); + if( pAttacker.npc && !pDefender.npc ) + damage /= GetServerSetting( "NPCDAMAGERATE" ); return damage; } From 5621389ef6ca3b8d0793218415ec8a01ad364c18 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 15 Dec 2024 09:29:57 -0600 Subject: [PATCH 18/28] Adding Ressurrect Penalty Script that controls any type penalty you want on the char after resurrecting. --- data/js/jse_fileassociations.scp | 1 + data/js/player/death/resurrectpenalty.js | 127 +++++++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100644 data/js/player/death/resurrectpenalty.js diff --git a/data/js/jse_fileassociations.scp b/data/js/jse_fileassociations.scp index 2cbb8e3d5..9ba410a8f 100644 --- a/data/js/jse_fileassociations.scp +++ b/data/js/jse_fileassociations.scp @@ -335,6 +335,7 @@ //------------------------------------------- 8000=player/death/return_stolen_items.js 8001=player/young_player.js +8002=player/death/resurrectpenalty.js // House Scripts [15000-15500] 15000=server/house/house.js diff --git a/data/js/player/death/resurrectpenalty.js b/data/js/player/death/resurrectpenalty.js new file mode 100644 index 000000000..600957f73 --- /dev/null +++ b/data/js/player/death/resurrectpenalty.js @@ -0,0 +1,127 @@ +function ResurrectFamePenalty( pUser ) +{ + if( pUser.fame > 0 ) + { + // Calculate 10% of the fame + var amount = Math.floor( pUser.fame / 10 ); + pUser.fame -= amount; + } +} + +function ResurrectKarmaPenalty( pUser ) +{ + if( pUser.karma > 0 ) + { + // Calculate 10% of the karma + var amount = Math.floor( pUser.karma / 10 ); + pUser.karma -= amount; + } +} + +function ResurrectMurderPenalty( pUser ) +{ + // Ensure the pUser has committed at least 5 short-term murders + if( pUser.murdercount >= 5 ) + { + // Calculate the loss percentage + var loss = ( 100.0 - ( 4.0 + ( pUser.murdercount / 5.0 ))) / 100.0; + + // Clamp the loss percentage between 85% and 95% + if( loss < 0.85 ) + { + loss = 0.85; // Minimum 15% reduction + } + else if( loss > 0.95 ) + { + loss = 0.95; // Maximum 5% reduction + } + + // Apply penalties to strength, intelligence, and dexterity + if( pUser.strength * loss > 10 ) + { + pUser.strength = RandomNumber( 10, pUser.strength * loss ); + } + if( pUser.intelligence * loss > 10 ) + { + pUser.intelligence = RandomNumber( 10, pUser.intelligence * loss ); + } + if( pUser.dexterity * loss > 10 ) + { + pUser.dexterity = RandomNumber( 10, pUser.dexterity * loss ); + } + } +} + +function ResurrectSkillPenalty( pUser ) +{ + // Define the reduction range (89% to 91%) + var reductionMin = 89; + var reductionMax = 91; + + var originalSkills = []; // Array to store original skill values + + // Apply a 10% reduction to all 64 skills + for( var skillID = 0; skillID < 64; skillID++ ) + { + var baseSkill = pUser.Skills[ skillID ]; // Get skill value + var reducedSkill = RandomNumber( + (baseSkill * reductionMin) / 100, + (baseSkill * reductionMax) / 100 + ); + originalSkills.push( baseSkill ); // Store original skill value + pUser.Skills[ skillID ] = reducedSkill; // Apply the reduced skill value + } + + pUser.SetTag( "originalSkills", originalSkills.join( "," )); + + // Start the recovery timer + pUser.StartTimer( 15000, 0, false ); // 15 seconds interval, calls back to the current script + pUser.SetTag( "recoveryCount", 0 ); // Track recovery intervals +} + +// Recovery handler triggered by StartTimer +function onTimer( timerObj, timerID ) +{ + if( timerID == 0 ) + { + var recoveryCount = timerObj.GetTag( "recoveryCount" ); + var maxRecoveryCount = 100; // 100 intervals = 25 minutes + + // Parse the original skills from the tag + var originalSkills = timerObj.GetTag( "originalSkills" ).split( "," ); + + // Iterate through all skills and gradually restore + for( var skillID = 0; skillID < 64; skillID++ ) + { + var reducedSkill = timerObj.Skills[skillID]; + var originalSkill = parseInt( originalSkills[skillID] ); + + if( reducedSkill < originalSkill ) + { + // Randomize recovery by adding between 0.1% and 0.11% of the original value + var recoveryStep = RandomNumber( + (originalSkill * 0.1) / 100, + (originalSkill * 0.11) / 100 + ); + timerObj.Skills[ skillID ] = Math.min( originalSkill, reducedSkill + recoveryStep ); + } + } + + recoveryCount++; + timerObj.SetTag( "recoveryCount", recoveryCount ); + + // If recovery is not complete, restart the timer + if( recoveryCount < maxRecoveryCount ) + { + timerObj.StartTimer( 15000, 0, false ); // 15 seconds interval + } + else + { + // Recovery complete + timerObj.SetTag( "recoveryCount", null ); + timerObj.SetTag( "originalSkills", null ); + } + } +} + +function _restorecontext_() {} \ No newline at end of file From 062463abf49f9e924589a9c11efb3bce1596948b Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sat, 4 Jan 2025 03:42:27 -0600 Subject: [PATCH 19/28] Fixed Event Fixed Oncombathit --- source/cScript.cpp | 60 ++++++++++++++++++++++++---------------------- source/cScript.h | 3 ++- 2 files changed, 33 insertions(+), 30 deletions(-) diff --git a/source/cScript.cpp b/source/cScript.cpp index fb0ae479f..be5c134ff 100644 --- a/source/cScript.cpp +++ b/source/cScript.cpp @@ -3802,35 +3802,6 @@ SI08 cScript::OnAICombatTarget( CChar *attacker, CChar *target ) return TryParseJSVal( rval ); } -//o------------------------------------------------------------------------------------------------o -//| Function - cScript::onCombatHit() -//o------------------------------------------------------------------------------------------------o -//| Purpose - Triggers for character with event attached when someone has taken damage -//| Will also trigger the onDefense event for the character being hit -//o------------------------------------------------------------------------------------------------o -bool cScript::onCombatHit( CChar *attacker, CChar *defender ) -{ - if( !ValidateObject( attacker ) || !ValidateObject( defender )) - return false; - - if( !ExistAndVerify( seOnCombatHit, "onCombatHit" )) - return false; - - jsval rval, params[2]; - JSObject *attObj = JSEngine->AcquireObject( IUE_CHAR, attacker, runTime ); - JSObject *defObj = JSEngine->AcquireObject( IUE_CHAR, defender, runTime ); - - params[0] = OBJECT_TO_JSVAL( attObj ); - params[1] = OBJECT_TO_JSVAL( defObj ); - JSBool retVal = JS_CallFunctionName( targContext, targObject, "onCombatHit", 2, params, &rval ); - if( retVal == JS_FALSE ) - { - SetEventExists( seOnCombatHit, false ); - } - - return ( retVal == JS_TRUE ); -} - //o------------------------------------------------------------------------------------------------o //| Function - cScript::OnCombatStart() //| Date - 23rd January, 2006 @@ -3900,6 +3871,37 @@ SI08 cScript::OnCombatEnd( CChar *currChar, CChar *targChar ) return TryParseJSVal( rval ); } +//o------------------------------------------------------------------------------------------------o +//| Function - cScript::OnCombatHit() +//o------------------------------------------------------------------------------------------------o +//| Purpose - Triggers for character with event attached when someone has taken damage. +//| +//o------------------------------------------------------------------------------------------------o +SI08 cScript::OnCombatHit( CChar *attacker, CChar *defender ) +{ + const SI08 RV_NOFUNC = -1; + if( !ValidateObject( attacker ) || !ValidateObject( defender )) + return RV_NOFUNC; + + if( !ExistAndVerify( seOnCombatHit, "onCombatHit" )) + return RV_NOFUNC; + + jsval rval, params[2]; + JSObject *attObj = JSEngine->AcquireObject( IUE_CHAR, attacker, runTime ); + JSObject *defObj = JSEngine->AcquireObject( IUE_CHAR, defender, runTime ); + + params[0] = OBJECT_TO_JSVAL( attObj ); + params[1] = OBJECT_TO_JSVAL( defObj ); + JSBool retVal = JS_CallFunctionName( targContext, targObject, "onCombatHit", 2, params, &rval ); + if( retVal == JS_FALSE ) + { + SetEventExists( seOnCombatHit, false ); + return RV_NOFUNC; + } + + return TryParseJSVal( rval ); +} + //o------------------------------------------------------------------------------------------------o //| Function - cScript::OnDeathBlow() //| Date - 8th February, 2006 diff --git a/source/cScript.h b/source/cScript.h index 10330e719..0909bb721 100644 --- a/source/cScript.h +++ b/source/cScript.h @@ -96,6 +96,7 @@ enum ScriptEvent seOnCombatStart, // ** allows overriding what happens when combat is initiated seOnAICombatTarget, // ** allows overriding target selection taking place for regular AI behaviours seOnCombatEnd, // ** allows overriding what happens when combat ends + seOnCombatHit, // ** allows overriding what happens when combat hits seOnDeathBlow, seOnCombatDamageCalc, seOnDamage, @@ -279,7 +280,7 @@ class cScript SI08 OnSkillGump( CChar *mChar ); SI08 OnUseBandageMacro( CSocket *mSock, CChar *targChar, CItem *bandageItem ); SI08 OnAICombatTarget( CChar *attacker, CChar *target ); - bool onCombatHit( CChar *attacker, CChar *defender ); + SI08 OnCombatHit( CChar *attacker, CChar *defender ); SI08 OnCombatStart( CChar *attacker, CChar *defender ); SI08 OnCombatEnd( CChar *attacker, CChar *defender ); From e56f4391dc8cde19b000ab314fc05ca371a340d2 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sat, 4 Jan 2025 03:48:50 -0600 Subject: [PATCH 20/28] Update combat.cpp --- source/combat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/combat.cpp b/source/combat.cpp index f6bcebe15..bba282006 100644 --- a/source/combat.cpp +++ b/source/combat.cpp @@ -2999,7 +2999,7 @@ bool CHandleCombat::HandleCombat( CSocket *mSock, CChar& mChar, CChar *ourTarg ) cScript *toExecute = JSMapping->GetScript( scriptTrig ); if( toExecute != nullptr ) { - toExecute->onCombatHit( &mChar, ourTarg ); + toExecute->OnCombatHit( &mChar, ourTarg ); } } From a5a48bcfaa37d1f9c90cf7269c6bd30222593688 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Wed, 22 Jan 2025 15:04:14 -0600 Subject: [PATCH 21/28] Update Changelog.txt --- source/Changelog.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/Changelog.txt b/source/Changelog.txt index b0801d426..d88c459ec 100644 --- a/source/Changelog.txt +++ b/source/Changelog.txt @@ -1,3 +1,6 @@ +15/12/2024 - Dragon Slayer + Added Ressurrect Penalty Script that controls any type penalty you want on the char after resurrecting. + 13/05/2024 - Dragon Slayer Added New Shield Type 107 so shield ID's no longer have to be in hard code for shields to work properly From f8d35ab0c2a1690d3865bb6c4a1111b8c4469c2e Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sat, 25 Jan 2025 10:06:59 -0600 Subject: [PATCH 22/28] tab update --- data/js/combat/special_moves.js | 70 ++++++++++++++++----------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index 1742e5993..a141907f3 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -22,7 +22,7 @@ function onSpecialMove( pUser, abilityID ) if( abilityID >= 1 ) pUser.SetTempTag( "abilityID", abilityID ); - return true; + return true; } function checkSkillRequirement( pUser, requiredSkillLevel, requiredSkill, skillMessage, abilityID ) @@ -323,35 +323,35 @@ function DeductMana( pUser, abilityID ) function onCombatDamageCalc( pAttacker, pDefender, fightSkill, hitLoc ) { var abilityID = pAttacker.GetTempTag( "abilityID" ); - var baseDamage = pAttacker.attack; + var baseDamage = pAttacker.attack; - if( baseDamage == -1 ) // No damage if weapon breaks - return 0; + if( baseDamage == -1 ) // No damage if weapon breaks + return 0; - var damage = ApplyDamageBonuses( 1, pAttacker, pDefender, fightSkill, hitLoc, baseDamage ); + var damage = ApplyDamageBonuses( 1, pAttacker, pDefender, fightSkill, hitLoc, baseDamage ); - if( damage < 1 ) - return 0; + if( damage < 1 ) + return 0; - // Check if attacker has armor ignore enabled + // Check if attacker has armor ignore enabled if( abilityID == 1 ) // armorignore - { - // Armor Ignore ignores defense modifiers, but deals only 90% of potential damage - damage *= 0.9; - - if( fightSkill == 31 ) // Archery - { - // Cap damage from Armor Strike attack at 30 for archery weapons - if( damage > 30 ) - damage = 30; - } - else - { - // For all othe rfighting skills, cap damage from Armor Strike at 35 - if( damage > 35 ) - damage = 35; - } - } + { + // Armor Ignore ignores defense modifiers, but deals only 90% of potential damage + damage *= 0.9; + + if( fightSkill == 31 ) // Archery + { + // Cap damage from Armor Strike attack at 30 for archery weapons + if( damage > 30 ) + damage = 30; + } + else + { + // For all othe rfighting skills, cap damage from Armor Strike at 35 + if( damage > 35 ) + damage = 35; + } + } else if( abilityID == 12 )// shadowstrike { damage *= 1.25; @@ -366,7 +366,7 @@ function onCombatDamageCalc( pAttacker, pDefender, fightSkill, hitLoc ) { var hitsPercent = ( pDefender.hp / pDefender.maxhp ) * 100.0; - var manaPercent = 0; + var manaPercent = 0; if( pDefender.maxmana > 0 ) manaPercent = ( pDefender.mana / pDefender.maxmana ) * 100.0; @@ -374,21 +374,21 @@ function onCombatDamageCalc( pAttacker, pDefender, fightSkill, hitLoc ) damage += Math.min(Math.floor(Math.abs(hitsPercent - manaPercent) / 4), 20); } } - else + else { - // Otherwise, apply normal defense modifiers - damage = ApplyDefenseModifiers( 1, pAttacker, pDefender, fightSkill, hitLoc, damage, true ); - } + // Otherwise, apply normal defense modifiers + damage = ApplyDefenseModifiers( 1, pAttacker, pDefender, fightSkill, hitLoc, damage, true ); + } - // If damage after defense modifiers is below 0, do a small random amount of damage still - if( damage <= 0 ) - damage = RandomNumber( 0, 4 ); + // If damage after defense modifiers is below 0, do a small random amount of damage still + if( damage <= 0 ) + damage = RandomNumber( 0, 4 ); - // If defender is a player, damage is divided by this modifier from uox.ini + // If defender is a player, damage is divided by this modifier from uox.ini if( pAttacker.npc && !pDefender.npc ) damage /= GetServerSetting( "NPCDAMAGERATE" ); - return damage; + return damage; } function onCombatHit( pAttacker, pDefender ) From a0e6ed0b4d707b075688c26bea5fa8022cb46cb2 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sat, 25 Jan 2025 23:26:40 -0600 Subject: [PATCH 23/28] Update global.js --- data/js/server/global.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/data/js/server/global.js b/data/js/server/global.js index aab7de6a4..3e6df7fac 100644 --- a/data/js/server/global.js +++ b/data/js/server/global.js @@ -2,6 +2,8 @@ // Supported Events trigger for every character/item, use with care function onLogin( socket, pChar ) { + const coreShardEra = EraStringToNum( GetServerSetting( "CoreShardEra" )); + // Display Admin Welcome Gump for characters on admin account, until a choice has been made if( pChar.accountNum == 0 ) { @@ -37,12 +39,11 @@ function onLogin( socket, pChar ) TriggerEvent( 8001, "CheckYoungStatus", socket, pChar, true ); } - //Attach the special moves Book - if( !pChar.npc && !pChar.HasScriptTrigger( 7001 )) + if( coreShardEra >= EraStringToNum( "aos" ) && ( !pChar.npc && !pChar.HasScriptTrigger( 7001 ))) { pChar.AddScriptTrigger( 7001 ); - } + } // Re-adds Buff for disguise kit if player still has time left. var currentTime = GetCurrentClock(); From 44f895ca199b38ccd4a475585ca5ee3f79c88bc6 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sat, 25 Jan 2025 23:33:51 -0600 Subject: [PATCH 24/28] Update commit out the mana check for se and up there not even included yet. restrictedAbilities so if they are double clicked in the bookl they will get a msg this move isnt active on server --- data/js/combat/special_moves.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index a141907f3..798a931d7 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -1,7 +1,7 @@ function onSpecialMove( pUser, abilityID ) { // Define the array of restricted ability IDs - var restrictedAbilities = [7, 10, 13, 14, 15, 16, 17,18,19,20,21,22,23,24,25,29]; + var restrictedAbilities = [14, 15, 16, 17,18,19,20,21,22,23,24,25,29]; // Check if the abilityID is in the array of restricted abilities if( restrictedAbilities.indexOf( abilityID ) != -1 ) @@ -245,7 +245,8 @@ function getAbilityManaTable() 10: { manaAmount: 20 }, // Moving Shot 11: { manaAmount: 35 }, // Paralyzing Blow 12: { manaAmount: 25 }, // Shadow Strike - 13: { manaAmount: 25 }, // Whirlwind Attack // End AOS abilities + 13: { manaAmount: 25 } // Whirlwind Attack // End AOS abilities + /* 14-29 are not available 14: { manaAmount: 30 }, // Riding Swipe // Start SE abiltiies 15: { manaAmount: 30 }, // Frenzied Whirlwind 16: { manaAmount: 30 }, // Block @@ -261,7 +262,7 @@ function getAbilityManaTable() 26: { manaAmount: 15 }, // Lightning Arrow 27: { manaAmount: 25 }, // Psychic Attack 28: { manaAmount: 35 }, // Serpent Arrow - 29: { manaAmount: 35 } // Force of Nature // End ML abilities + 29: { manaAmount: 35 } // Force of Nature // End ML abilities*/ }; } From a0cee722464368211ed32af7bce4410d39e92a25 Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 26 Jan 2025 10:46:02 -0600 Subject: [PATCH 25/28] Update global.js --- data/js/server/global.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/data/js/server/global.js b/data/js/server/global.js index 3e6df7fac..4a16b9e8e 100644 --- a/data/js/server/global.js +++ b/data/js/server/global.js @@ -39,8 +39,7 @@ function onLogin( socket, pChar ) TriggerEvent( 8001, "CheckYoungStatus", socket, pChar, true ); } - //Attach the special moves Book - if( coreShardEra >= EraStringToNum( "aos" ) && ( !pChar.npc && !pChar.HasScriptTrigger( 7001 ))) + if( coreShardEra >= EraStringToNum( "aos" ) && ( !pChar.npc && !pChar.HasScriptTrigger( 7001 )))// Attach the special moves Book { pChar.AddScriptTrigger( 7001 ); } From 93b8fb5f9dc15fe3f1fd6f26a1be83aa1e9f613b Mon Sep 17 00:00:00 2001 From: Geir Ove Alnes Date: Mon, 27 Jan 2025 00:47:25 +0800 Subject: [PATCH 26/28] Update resurrectpenalty.js --- data/js/player/death/resurrectpenalty.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/data/js/player/death/resurrectpenalty.js b/data/js/player/death/resurrectpenalty.js index 600957f73..33301b094 100644 --- a/data/js/player/death/resurrectpenalty.js +++ b/data/js/player/death/resurrectpenalty.js @@ -8,6 +8,8 @@ function ResurrectFamePenalty( pUser ) } } +// Penalty to karma is disabled by default, but can be enabled +// via a TriggerEvent call in js/item/shrines.js (onGumpPress) function ResurrectKarmaPenalty( pUser ) { if( pUser.karma > 0 ) @@ -49,9 +51,14 @@ function ResurrectMurderPenalty( pUser ) { pUser.dexterity = RandomNumber( 10, pUser.dexterity * loss ); } + + // ResurrectSkillPenalty( pUser ); } } +// Penalty to skills is disabled by default, but can be enabled +// by uncommenting call in ResurrectMurderPenalty (for murderers) or +// for all players via a TriggerEvent call in js/item/shrines.js (onGumpPress) function ResurrectSkillPenalty( pUser ) { // Define the reduction range (89% to 91%) @@ -79,7 +86,7 @@ function ResurrectSkillPenalty( pUser ) pUser.SetTag( "recoveryCount", 0 ); // Track recovery intervals } -// Recovery handler triggered by StartTimer +// Skill Recovery handler triggered by StartTimer function onTimer( timerObj, timerID ) { if( timerID == 0 ) @@ -124,4 +131,4 @@ function onTimer( timerObj, timerID ) } } -function _restorecontext_() {} \ No newline at end of file +function _restorecontext_() {} From 1b5d0e5a2eeb26dc21d6867585d2dd2a512a98ef Mon Sep 17 00:00:00 2001 From: Dragon Slayer <85514184+DragonSlayer62@users.noreply.github.com> Date: Sun, 26 Jan 2025 11:07:47 -0600 Subject: [PATCH 27/28] Update global.js --- data/js/server/global.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data/js/server/global.js b/data/js/server/global.js index 4a16b9e8e..aebb80ae4 100644 --- a/data/js/server/global.js +++ b/data/js/server/global.js @@ -77,6 +77,8 @@ function onLogout( pSock, pChar ) function onCreatePlayer( pChar ) { + const coreShardEra = EraStringToNum( GetServerSetting( "CoreShardEra" )); + // If player character is created on a Young account, give them Young-specific items if( pChar.account.isYoung ) { @@ -90,7 +92,7 @@ function onCreatePlayer( pChar ) } //Attach the special moves Book - if( !pChar.npc && !pChar.HasScriptTrigger( 7001 )) + if( coreShardEra >= EraStringToNum( "aos" ) && ( !pChar.npc && !pChar.HasScriptTrigger( 7001 ))) { pChar.AddScriptTrigger( 7001 ); } From f809b4cd68003b58d34a89cd2995301cb1012be6 Mon Sep 17 00:00:00 2001 From: Geir Ove Alnes Date: Mon, 27 Jan 2025 02:36:47 +0800 Subject: [PATCH 28/28] Update special_moves.js script ID 2205 was already in use by something else, so changed it to 2206 in special_moves.js and in jse_fileassociations.scp --- data/js/combat/special_moves.js | 74 ++++++++++++++++----------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/data/js/combat/special_moves.js b/data/js/combat/special_moves.js index 798a931d7..49dd46e2b 100644 --- a/data/js/combat/special_moves.js +++ b/data/js/combat/special_moves.js @@ -7,7 +7,7 @@ function onSpecialMove( pUser, abilityID ) if( restrictedAbilities.indexOf( abilityID ) != -1 ) { pUser.SysMessage( "This ability is not yet available." ); - TriggerEvent( 2205, "DeactivateSpecialMove", pUser, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pUser, abilityID ); return false; } @@ -32,7 +32,7 @@ function checkSkillRequirement( pUser, requiredSkillLevel, requiredSkill, skillM { pSock.SysMessage( GetDictionaryEntry( 19201, pSock.language), skillMessage); // You need %i weapon skill to perform that attack - TriggerEvent( 2205, "DeactivateSpecialMove", pUser, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pUser, abilityID ); return false; } return true; @@ -289,7 +289,7 @@ function CheckMana( pUser, abilityID ) if( pUser.mana < requiredMana ) { pSock.SysMessage( GetDictionaryEntry( 19202, pSock.language), requiredMana); // You need %i mana to perform that attack - TriggerEvent( 2205, "DeactivateSpecialMove", pUser, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pUser, abilityID ); return false; } else @@ -415,7 +415,7 @@ function onAbility( pAttacker, pDefender, abilityID ) { // Clear out any current ability the player is doing when he switches abilities if( abilityID != 1 ) - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana if( CheckMana( pAttacker, abilityID )) @@ -430,13 +430,13 @@ function onAbility( pAttacker, pDefender, abilityID ) pDefender.SoundEffect( 0x0056, true ); pDefender.StaticEffect( 0x3728, 0x09, 0x06 ); - TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + TriggerEvent( 2206, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } else if( abilityID == 2 ) // bleedattack { // Clear out any current ability the player is doing when he switches abilities if( abilityID != 2 ) - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana if( CheckMana( pAttacker, abilityID )) @@ -462,13 +462,13 @@ function onAbility( pAttacker, pDefender, abilityID ) pAttacker.SoundEffect( 0x133, true ); pDefender.StaticEffect( 0x377A, 0x09, 0x32 ); - TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + TriggerEvent( 2206, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } else if( abilityID == 3 ) // ConcussionBlow { // Clear out any current ability the player is doing when he switches abilities if( abilityID != 3 ) - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana if( CheckMana( pAttacker, abilityID )) @@ -484,14 +484,14 @@ function onAbility( pAttacker, pDefender, abilityID ) pAttacker.SoundEffect( 0x213, true ); pDefender.StaticEffect( 0x377A, 0x09, 0x32 ); - TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + TriggerEvent( 2206, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } else if( abilityID == 4 ) // crushingblow { // Clear out any current ability the player is doing when he switches abilities if( abilityID != 4 ) - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana if( CheckMana( pAttacker, abilityID )) @@ -504,7 +504,7 @@ function onAbility( pAttacker, pDefender, abilityID ) pSockDefender.SysMessage( GetDictionaryEntry( 19212, pSockDefender.language ));// You take extra damage from the crushing attack! pAttacker.SoundEffect( 0x1E1, true ); - TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + TriggerEvent( 2206, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } else if( abilityID == 5 ) // Disarm { @@ -514,20 +514,20 @@ function onAbility( pAttacker, pDefender, abilityID ) if( pDefender.pack == null || itemLHand != null && itemLHand.movable >= 2 || itemRHand != null && itemRHand.movable >= 2 ) { pSockAttacker.SysMessage( GetDictionaryEntry( 19213, pSockAttacker.language ));// You cannot disarm your opponent. - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); return false; } if( itemLHand != null && itemLHand.type == 9 || itemRHand != null && itemRHand.type == 9 ) { pSockAttacker.SysMessage( GetDictionaryEntry( 19214, pSockAttacker.language ));// Your target is already unarmed! - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); return false; } // Clear out any current ability the player is doing when he switches abilities if( abilityID != 5 ) - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana if( CheckMana( pAttacker, abilityID )) @@ -558,7 +558,7 @@ function onAbility( pAttacker, pDefender, abilityID ) TriggerEvent(50104, "AddBuff", pDefender, 0x3ea, 1075637, 0, 5, " " ); - TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + TriggerEvent( 2206, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } else if( abilityID == 6 ) // Dismount { @@ -566,7 +566,7 @@ function onAbility( pAttacker, pDefender, abilityID ) if( pAttacker.isonhorse || pAttacker.isflying ) { pSockAttacker.SysMessage( GetDictionaryEntry( 19217, pSockAttacker.language ));// You cannot perform that attack while mounted or flying! - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); return true; } @@ -574,13 +574,13 @@ function onAbility( pAttacker, pDefender, abilityID ) if( !pDefender.isonhorse || !pDefender.isflying ) { pSockAttacker.SysMessage( GetDictionaryEntry( 19218, pSockAttacker.language ));// This attack only works on mounted or flying targets - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); return true; } // Clear out any current ability the player is doing when he switches abilities if( abilityID != 6 ) - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana if( CheckMana( pAttacker, abilityID )) @@ -599,13 +599,13 @@ function onAbility( pAttacker, pDefender, abilityID ) if( pSockDefender != null ) pSockDefender.SysMessage( GetDictionaryEntry( 19220, pSockDefender.language ), pAttacker.name );// You have been knocked off of your mount by %i ! - TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + TriggerEvent( 2206, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } else if( abilityID == 7 ) // Double Strike { // Clear out any current ability the player is doing when he switches abilities if( abilityID != 7 ) - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana if( CheckMana( pAttacker, abilityID )) @@ -613,7 +613,7 @@ function onAbility( pAttacker, pDefender, abilityID ) DeductMana( pAttacker, abilityID ); } - TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + TriggerEvent( 2206, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } else if( abilityID == 8 ) // Infectious Strike { @@ -623,13 +623,13 @@ function onAbility( pAttacker, pDefender, abilityID ) if( itemLHand != null && itemLHand.poison <= 0 || itemRHand != null && itemRHand.poison <= 0 ) { pSockAttacker.SysMessage( GetDictionaryEntry( 19221, pSockAttacker.language ));// Your weapon must have a dose of poison to perform an infectious strike! - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); return; } // Clear out any current ability the player is doing when he switches abilities if( abilityID != 8 ) - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana if( CheckMana( pAttacker, abilityID )) @@ -681,14 +681,14 @@ function onAbility( pAttacker, pDefender, abilityID ) pAttacker.SoundEffect( 0xDD, true ); pDefender.StaticEffect( 0x3728, 0x09, 0x32 ); - TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + TriggerEvent( 2206, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } else if( abilityID == 9 ) // Mortal Strike { // Clear out any current ability the player is doing when he switches abilities if( abilityID != 9 ) - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana if( CheckMana( pAttacker, abilityID )) @@ -716,13 +716,13 @@ function onAbility( pAttacker, pDefender, abilityID ) if( pDefender.socket ) TriggerEvent( 50104, "AddBuff", pDefender, 1027, 1075810, 1075811, 6, " " ); - TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + TriggerEvent( 2206, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } else if( abilityID == 10 ) // Moving Shot { // Clear out any current ability the player is doing when he switches abilities if( abilityID != 10 ) - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana if( CheckMana( pAttacker, abilityID )) @@ -730,13 +730,13 @@ function onAbility( pAttacker, pDefender, abilityID ) DeductMana( pAttacker, abilityID ); } - TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + TriggerEvent( 2206, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } else if( abilityID == 11 ) // ParalyzingBlow { // Clear out any current ability the player is doing when he switches abilities if( abilityID != 11 ) - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana if( CheckMana( pAttacker, abilityID )) @@ -775,20 +775,20 @@ function onAbility( pAttacker, pDefender, abilityID ) { pSockAttacker.SysMessage( GetDictionaryEntry( 17702, pAttacker.socket.language), false, 0x3b2, 0, pAttacker.serial );// You deliver a paralyzing blow! } - TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + TriggerEvent( 2206, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } else if( abilityID == 12 ) // shadowstrike { if( pAttacker.skills[47] < 800 ) // Stealth { pSockAttacker.SysMessage( GetDictionaryEntry( 19231, pSockAttacker.language ));// "You lack the required stealth to perform that attack - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); return true; } // Clear out any current ability the player is doing when he switches abilities if( abilityID != 12 ) - TriggerEvent( 2205, "DeactivateSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "DeactivateSpecialMove", pAttacker, abilityID ); //checking mana if( CheckMana( pAttacker, abilityID )) @@ -809,13 +809,13 @@ function onAbility( pAttacker, pDefender, abilityID ) pDefender.atWar = false; pAttacker.visible = 1; - TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID ); + TriggerEvent( 2206, "ClearSpecialMove", pAttacker, abilityID ); } else if( abilityID == 13 ) // Whirlwind Attack { // Clear out any current ability the player is doing when he switches abilities if( abilityID != 13 ) - TriggerEvent(2205, "DeactivateSpecialMove", pAttacker, abilityID); + TriggerEvent(2206, "DeactivateSpecialMove", pAttacker, abilityID); //checking mana if( CheckMana(pAttacker, abilityID )) @@ -823,7 +823,7 @@ function onAbility( pAttacker, pDefender, abilityID ) DeductMana( pAttacker, abilityID ); } - TriggerEvent( 2205, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success + TriggerEvent( 2206, "ClearSpecialMove", pAttacker, abilityID );// Clear the Ability after success } } @@ -842,7 +842,7 @@ function onTimer( timerObj, timerID ) timerObj.SetTempTag( "blockHeal", null ); timerObj.KillJSTimer( 9400, 7001 ); timerObj.SetTempTag( "doBleed", null ); - TriggerEvent( 2205, "ClearSpecialMove", timerObj, abilityID ); + TriggerEvent( 2206, "ClearSpecialMove", timerObj, abilityID ); return; } else if( timerID == 8000 ) @@ -880,4 +880,4 @@ function onTimer( timerObj, timerID ) if( socket != null ) socket.SysMessage( GetDictionaryEntry( 19236, socket.language ));// The bleeding wounds have healed, you are no longer bleeding! } -} \ No newline at end of file +}