Skip to content

Commit

Permalink
Merge pull request #6975 from WinterSolstice8/misc_automaton_stuff
Browse files Browse the repository at this point in the history
Misc automaton stuff
  • Loading branch information
claywar authored Feb 6, 2025
2 parents d6ca287 + 14f5978 commit 1cb9d5f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
6 changes: 3 additions & 3 deletions scripts/enum/mod.lua
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ xi.mod =
CAMOUFLAGE_DURATION = 98, -- Camouflage duration in percents

-- These are NOT item Level skill, they are skill in your status menu. iLvl "skill" happens in item_weapon.sql
AUTO_MELEE_SKILL = 101,
AUTO_RANGED_SKILL = 102,
AUTO_MAGIC_SKILL = 103,
AUTO_MELEE_SKILL = 101, -- Do not apply to items in item_mods_pet.sql, apply only to master (it does not work properly on pet mods)
AUTO_RANGED_SKILL = 102, -- Do not apply to items in item_mods_pet.sql, apply only to master (it does not work properly on pet mods)
AUTO_MAGIC_SKILL = 103, -- Do not apply to items in item_mods_pet.sql, apply only to master (it does not work properly on pet mods)
ARCHERY = 104,
MARKSMAN = 105,
THROW = 106,
Expand Down
4 changes: 3 additions & 1 deletion scripts/globals/automatonweaponskills.lua
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ xi.autows.doAutoPhysicalWeaponskill = function(attacker, target, wsID, tp, prima
calcParams.bonusAcc = 0 + attacker:getMod(xi.mod.WSACC)
calcParams.hitRate = getAutoHitRate(attacker, target, false, calcParams.bonusAcc, calcParams.melee)
calcParams.skillType = attack.weaponType
calcParams.tpUsed = tp

-- Send our wsParams off to calculate our raw WS damage, hits landed, and shadows absorbed
calcParams = xi.weaponskills.calculateRawWSDmg(attacker, target, wsID, tp, action, wsParams, calcParams)
Expand Down Expand Up @@ -295,7 +296,8 @@ xi.autows.doAutoRangedWeaponskill = function(attacker, target, wsID, wsParams, t
bonusWSmods = math.max(attacker:getMainLvl() - target:getMainLvl(), 0),
bonusTP = wsParams.bonusTP or 0,
bonusfTP = flameHolderFTP or 0,
bonusAcc = 0 + attacker:getMod(xi.mod.WSACC)
bonusAcc = 0 + attacker:getMod(xi.mod.WSACC),
tpUsed = tp,
}
calcParams.hitRate = getAutoHitRate(attacker, target, false, calcParams.bonusAcc, calcParams.melee)
calcParams.skillType = attack.weaponType
Expand Down
3 changes: 0 additions & 3 deletions sql/item_mods_pet.sql
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,6 @@ INSERT INTO `item_mods_pet` VALUES (11497,384,500,0); -- All Pets - HASTE_GEAR:
-- Fidelity Mantle
INSERT INTO `item_mods_pet` VALUES (11531,73,3,0); -- All Pets - STORETP: 3

-- Wayang Kulit Mantle
INSERT INTO `item_mods_pet` VALUES (11536,101,2,3); -- Automaton - AUTO_MELEE_SKILL: 2

-- Ferine Mantle
INSERT INTO `item_mods_pet` VALUES (11555,25,10,0); -- All Pets - ACC: 10

Expand Down
6 changes: 3 additions & 3 deletions src/map/modifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ enum class Mod
GKATANA = 89, // Great Katana Skill
CLUB = 90, // Club Skill
STAFF = 91, // Staff Skill
AUTO_MELEE_SKILL = 101, // Automaton Melee Skill
AUTO_RANGED_SKILL = 102, // Automaton Range Skill
AUTO_MAGIC_SKILL = 103, // Automaton Magic Skill
AUTO_MELEE_SKILL = 101, // Automaton Melee Skill -- Do not apply to items in item_mods_pet.sql, apply only to master (it does not work properly on pet mods)
AUTO_RANGED_SKILL = 102, // Automaton Range Skill -- Do not apply to items in item_mods_pet.sql, apply only to master (it does not work properly on pet mods)
AUTO_MAGIC_SKILL = 103, // Automaton Magic Skill -- Do not apply to items in item_mods_pet.sql, apply only to master (it does not work properly on pet mods)
ARCHERY = 104, // Archery Skill
MARKSMAN = 105, // Marksman Skill
THROW = 106, // Throw Skill
Expand Down
7 changes: 5 additions & 2 deletions src/map/utils/puppetutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ namespace puppetutils
{
PChar->automatonInfo.m_automatonName = rset->get<std::string>("name");

if (PChar->automatonInfo.m_automatonName.empty())
{
PChar->automatonInfo.m_automatonName = "Automaton";
}

automaton_equip_t tempEquip;
db::extractFromBlob(rset, "equipped_attachments", tempEquip);

Expand All @@ -62,8 +67,6 @@ namespace puppetutils
tempEquip.Frame < FRAME_HARLEQUIN ||
tempEquip.Frame > FRAME_STORMWAKER)
{
PChar->PPet->name = "Automaton";

PChar->setAutomatonHead(HEAD_HARLEQUIN);
tempEquip.Head = HEAD_HARLEQUIN;
PChar->setAutomatonFrame(FRAME_HARLEQUIN);
Expand Down

0 comments on commit 1cb9d5f

Please sign in to comment.