Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Commit

Permalink
Merge branch 'trust' into canary
Browse files Browse the repository at this point in the history
# Conflicts:
#	scripts/commands/addalltrusts.lua
#	scripts/globals/abilities/double-up.lua
#	scripts/globals/effects/confrontation.lua
#	scripts/globals/spells/cure_vi.lua
#	scripts/globals/spells/recall-jugner.lua
#	scripts/globals/spells/tractor.lua
#	scripts/globals/spells/warp_ii.lua
#	scripts/zones/Chateau_dOraguille/npcs/Curilla.lua
#	scripts/zones/Chateau_dOraguille/npcs/_6h0.lua
#	scripts/zones/Metalworks/npcs/Ayame.lua
#	scripts/zones/Metalworks/npcs/Lucius.lua
#	scripts/zones/Metalworks/npcs/Naji.lua
#	scripts/zones/Northern_San_dOria/npcs/Excenmille.lua
#	scripts/zones/Windurst_Woods/npcs/Nanaa_Mihgo.lua
#	sql/npc_list.sql
  • Loading branch information
zach2good committed Aug 29, 2020
2 parents fec2e6d + 1edc824 commit 45a5e4b
Show file tree
Hide file tree
Showing 36 changed files with 1,066 additions and 370 deletions.
16 changes: 16 additions & 0 deletions scripts/globals/gambits.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ ai.condition =
SC_AVAILABLE = 11,
NOT_SC_AVAILABLE = 12,
MB_AVAILABLE = 13,
READYING_WS = 14,
READYING_MS = 15,
READYING_JA = 16,
CASTING_MA = 17,
RANDOM = 18,
}
ai.c = ai.condition

Expand All @@ -48,6 +53,7 @@ ai.reaction =
JA = 3,
WS = 4,
MS = 5,
MSG = 6,
}
ai.r = ai.reaction

Expand All @@ -59,5 +65,15 @@ ai.select =
SPECIFIC = 2,
RANDOM = 3,
MB_ELEMENT = 4,
SPECIAL_AYAME = 5,
}
ai.s = ai.select

-- TP Move Trigger
ai.tp =
{
ASAP = 0,
RANDOM = 1,
OPENER = 2,
CLOSER = 3,
}
26 changes: 26 additions & 0 deletions scripts/globals/mobskills/king_cobra_clamp.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---------------------------------------------------
-- King Cobra Clamp
-- Damage varies with TP.
-- Type: Magical
-- Utsusemi/Blink absorb: Ignores shadows
-- Skillchain Properties: Fragmentation-IconFragmentation
---------------------------------------------------
require("scripts/globals/settings")
require("scripts/globals/status")
require("scripts/globals/monstertpmoves")
---------------------------------------------------

function onMobSkillCheck(target, mob, skill)
return 0
end

function onMobWeaponSkill(target, mob, skill)
local numhits = 1
local accmod = 1
local dmgmod = 3.0
local info = MobPhysicalMove(mob, target, skill, numhits, accmod, dmgmod, TP_NO_EFFECT)
local dmg = MobFinalAdjustments(info.dmg, mob, skill, target, tpz.attackType.PHYSICAL, tpz.damageType.SLASHING, info.hitslanded)

target:takeDamage(dmg, mob, tpz.attackType.MAGICAL, tpz.damageType.SLASHING)
return dmg
end
2 changes: 1 addition & 1 deletion scripts/globals/spells/cure_vi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function onSpellCast(caster, target, spell)
if isValidHealTarget(caster, target) then
basecure = getBaseCure(power, divisor, constant, basepower)
final = getCureFinal(caster, spell, basecure, minCure, false)
if (caster:hasStatusEffect(tpz.effect.AFFLATUS_SOLACE) and target:hasStatusEffect(tpz.effect.STONESKIN) == false) then
if caster:hasStatusEffect(tpz.effect.AFFLATUS_SOLACE) and target:hasStatusEffect(tpz.effect.STONESKIN) == false then
local solaceStoneskin = 0
local equippedBody = caster:getEquipID(tpz.slot.BODY)
if (equippedBody == 11186) then
Expand Down
2 changes: 1 addition & 1 deletion scripts/globals/spells/recall-pashh.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ end
function onSpellCast(caster, target, spell)
if target:getObjType() == tpz.objType.PC then
if target:hasKeyItem(tpz.ki.PASHHOW_GATE_CRYSTAL) then
target:addStatusEffectEx(tpz.effect.TELEPORT,0,tpz.teleport.id.PASHH,0,4.7)
target:addStatusEffectEx(tpz.effect.TELEPORT, 0, tpz.teleport.id.PASHH, 0, 4.7)
spell:setMsg(tpz.msg.basic.MAGIC_TELEPORT)
else
spell:setMsg(tpz.msg.basic.NONE)
Expand Down
2 changes: 1 addition & 1 deletion scripts/globals/spells/trust/ajido-marujido.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-----------------------------------------
-- Trust: Ajido-Marujido
-----------------------------------------
require("scripts/globals/magic")
require("scripts/globals/gambits")
require("scripts/globals/magic")
require("scripts/globals/status")
require("scripts/globals/trust")
-----------------------------------------
Expand Down
41 changes: 34 additions & 7 deletions scripts/globals/spells/trust/ayame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,43 @@ function onMobSpawn(mob)
})

mob:addSimpleGambit(ai.t.SELF, ai.c.NOT_STATUS, tpz.effect.HASSO,
ai.r.JA, ai.s.SPECIFIC, tpz.ja.HASSO)
ai.r.JA, ai.s.SPECIFIC, tpz.ja.HASSO)

mob:addSimpleGambit(ai.t.SELF, ai.c.HAS_TOP_ENMITY, 0,
ai.r.JA, ai.s.SPECIFIC, tpz.ja.THIRD_EYE)

mob:addSimpleGambit(ai.t.SELF, ai.c.TP_LT, 1000,
ai.r.JA, ai.s.SPECIFIC, tpz.ja.MEDITATE)
ai.r.JA, ai.s.SPECIFIC, tpz.ja.THIRD_EYE)

mob:addFullGambit({
['predicates'] =
{
{
['target'] = ai.t.SELF, ['condition'] = ai.c.TP_LT, ['argument'] = 1000,
},
{
['target'] = ai.t.MASTER, ['condition'] = ai.c.TP_GTE, ['argument'] = 1000,
},
},
['actions'] =
{
{
['reaction'] = ai.r.JA, ['select'] = ai.s.SPECIFIC, ['argument'] = tpz.ja.MEDITATE,
},
},
})

mob:addSimpleGambit(ai.t.SELF, ai.c.TP_GTE, 1000,
ai.r.WS, ai.s.SPECIFIC, tpz.ws.TACHI_ENPI)
mob:setTPSkills({
['skills'] = {
{ ai.r.WS, tpz.ws.TACHI_ENPI, 0 },
{ ai.r.WS, tpz.ws.TACHI_HOBAKU, 0 },
{ ai.r.WS, tpz.ws.TACHI_GOTEN, 0 },
{ ai.r.WS, tpz.ws.TACHI_KAGERO, 0 },
{ ai.r.WS, tpz.ws.TACHI_JINPU, 0 },
{ ai.r.WS, tpz.ws.TACHI_YUKIKAZE, 0 },
{ ai.r.WS, tpz.ws.TACHI_GEKKO, 60 },
{ ai.r.WS, tpz.ws.TACHI_KASHA, 60 },
},
['mode'] = ai.tp.CLOSER,
['skill_select'] = ai.s.HIGHEST,
})
end

function onMobDespawn(mob)
Expand Down
11 changes: 9 additions & 2 deletions scripts/globals/spells/trust/curilla.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,15 @@ function onMobSpawn(mob)
mob:addSimpleGambit(ai.t.PARTY, ai.c.HPP_LT, 75,
ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.CURE)

mob:addSimpleGambit(ai.t.SELF, ai.c.TP_GTE, 1000,
ai.r.WS, ai.s.SPECIFIC, tpz.ws.RED_LOTUS_BLADE)
mob:setTPSkills({
['skills'] = {
{ ai.r.WS, tpz.ws.RED_LOTUS_BLADE, 0 },
{ ai.r.WS, tpz.ws.SERAPH_BLADE, 0 },
{ ai.r.WS, tpz.ws.SWIFT_BLADE, 60 },
},
['mode'] = ai.tp.ASAP,
['skill_select'] = ai.s.RANDOM,
})
end

function onMobDespawn(mob)
Expand Down
11 changes: 9 additions & 2 deletions scripts/globals/spells/trust/excenmille.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,15 @@ function onMobSpawn(mob)
mob:addSimpleGambit(ai.t.PARTY, ai.c.HPP_LT, 75,
ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.CURE)

mob:addSimpleGambit(ai.t.SELF, ai.c.TP_GTE, 1000,
ai.r.WS, ai.s.SPECIFIC, tpz.ws.DOUBLE_THRUST)
mob:setTPSkills({
['skills'] = {
{ ai.r.WS, tpz.ws.DOUBLE_THRUST, 0 },
{ ai.r.WS, tpz.ws.LEG_SWEEP, 0 },
{ ai.r.WS, tpz.ws.PENTA_THRUST, 30 },
},
['mode'] = ai.tp.ASAP,
['skill_select'] = ai.s.RANDOM,
})

mob:addMod(tpz.mod.STORETP, 25)
end
Expand Down
11 changes: 9 additions & 2 deletions scripts/globals/spells/trust/iron_eater.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,15 @@ function onMobSpawn(mob)
mob:addSimpleGambit(ai.t.MASTER, ai.c.HPP_LT, 50,
ai.r.JA, ai.s.SPECIFIC, tpz.ja.PROVOKE)

mob:addSimpleGambit(ai.t.SELF, ai.c.TP_GTE, 1000,
ai.r.WS, ai.s.SPECIFIC, tpz.ws.SHIELD_BREAK)
mob:setTPSkills({
['skills'] = {
{ ai.r.WS, tpz.ws.SHIELD_BREAK, 0 },
{ ai.r.WS, tpz.ws.ARMOR_BREAK, 0 },
{ ai.r.WS, tpz.ws.STEEL_CYCLONE, 60 },
},
['mode'] = ai.tp.ASAP,
['skill_select'] = ai.s.RANDOM,
})
end

function onMobDespawn(mob)
Expand Down
9 changes: 8 additions & 1 deletion scripts/globals/spells/trust/kupipi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,14 @@ function onMobSpawn(mob)

mob:addSimpleGambit(ai.t.TARGET, ai.c.NOT_STATUS, tpz.effect.FLASH, ai.r.MA, ai.s.SPECIFIC, tpz.magic.spell.FLASH, 60)

mob:addSimpleGambit(ai.t.SELF, ai.c.TP_GTE, 1000, ai.r.WS, ai.s.SPECIFIC, tpz.ws.STARLIGHT)
mob:setTPSkills({
['skills'] = {
{ ai.r.WS, tpz.ws.STARLIGHT, 0 },
{ ai.r.WS, tpz.ws.MOONLIGHT, 0 },
},
['mode'] = ai.tp.ASAP,
['skill_select'] = ai.s.RANDOM,
})
end

function onMobDespawn(mob)
Expand Down
11 changes: 9 additions & 2 deletions scripts/globals/spells/trust/naji.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,15 @@ function onMobSpawn(mob)
mob:addSimpleGambit(ai.t.SELF, ai.c.NOT_HAS_TOP_ENMITY, 0,
ai.r.JA, ai.s.SPECIFIC, tpz.ja.PROVOKE)

mob:addSimpleGambit(ai.t.SELF, ai.c.TP_GTE, 1000,
ai.r.WS, ai.s.SPECIFIC, tpz.ws.BURNING_BLADE)
mob:setTPSkills({
['skills'] = {
{ ai.r.WS, tpz.ws.BURNING_BLADE, 0 },
{ ai.r.WS, tpz.ws.RED_LOTUS_BLADE, 0 },
{ ai.r.WS, tpz.ws.VORPAL_BLADE, 60 },
},
['mode'] = ai.tp.ASAP,
['skill_select'] = ai.s.RANDOM,
})
end

function onMobDespawn(mob)
Expand Down
15 changes: 13 additions & 2 deletions scripts/globals/spells/trust/nanaa_mihgo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,26 @@ function onSpellCast(caster, target, spell)
end

function onMobSpawn(mob)
-- TODO: Table me
local KING_COBRA_CLAMP = 3189

tpz.trust.teamworkMessage(mob, {
[tpz.magic.spell.ROMAA_MIHGO] = tpz.trust.message_offset.TEAMWORK_1,
})

mob:addSimpleGambit(ai.t.TARGET, ai.c.ALWAYS, 0,
ai.r.JA, ai.s.SPECIFIC, tpz.ja.DESPOIL)

mob:addSimpleGambit(ai.t.SELF, ai.c.TP_GTE, 1000,
ai.r.WS, ai.s.SPECIFIC, tpz.ws.WASP_STING)
mob:setTPSkills({
['skills'] = {
{ ai.r.WS, tpz.ws.WASP_STING, 0 },
{ ai.r.WS, tpz.ws.DANCING_EDGE, 0 },

{ ai.r.MS, KING_COBRA_CLAMP, 0 },
},
['mode'] = ai.tp.OPENER,
['skill_select'] = ai.s.HIGHEST,
})
end

function onMobDespawn(mob)
Expand Down
28 changes: 23 additions & 5 deletions scripts/globals/spells/trust/shantotto.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,42 @@ function onMobSpawn(mob)
[tpz.magic.spell.AJIDO_MARUJIDO] = tpz.trust.message_offset.TEAMWORK_1,
[tpz.magic.spell.STAR_SIBYL] = tpz.trust.message_offset.TEAMWORK_2,
[tpz.magic.spell.KORU_MORU] = tpz.trust.message_offset.TEAMWORK_3,
[tpz.magic.spell.KING_OF_HEARTS] = tpz.trust.message_offset.TEAMWORK_4,
[tpz.magic.spell.KING_OF_HEARTS] = tpz.trust.message_offset.TEAMWORK_4
})

mob:addSimpleGambit(ai.t.TARGET, ai.c.MB_AVAILABLE, 0,
ai.r.MA, ai.s.MB_ELEMENT, tpz.magic.spellFamily.NONE)
mob:addSimpleGambit(ai.t.TARGET, ai.c.MB_AVAILABLE, 0, ai.r.MA, ai.s.MB_ELEMENT, tpz.magic.spellFamily.NONE)

mob:addSimpleGambit(ai.t.TARGET, ai.c.NOT_SC_AVAILABLE, 0,
ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.NONE, 30)
mob:addSimpleGambit(ai.t.TARGET, ai.c.NOT_SC_AVAILABLE, 0, ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.NONE, 30)

mob:addFullGambit({
['predicates'] =
{
{
['target'] = ai.t.TARGET, ['condition'] = ai.c.MB_AVAILABLE, ['argument'] = 0,
}
},
['actions'] =
{
{
['reaction'] = ai.r.MA, ['select'] = ai.s.HIGHEST, ['argument'] = tpz.magic.spellFamily.NONE,
},
{
['reaction'] = ai.r.MSG, ['select'] = ai.s.SPECIFIC, ['argument'] = tpz.trust.message_offset.SPECIAL_MOVE_1, -- Ohohoho!
},
},
})

local power = mob:getMainLvl() / 5
mob:addMod(tpz.mod.MATT, power)
mob:addMod(tpz.mod.MACC, power)
mob:addMod(tpz.mod.HASTE_MAGIC, 10)
mob:SetAutoAttackEnabled(false)
end

function onMobDespawn(mob)
tpz.trust.message(mob, tpz.trust.message_offset.DESPAWN)
end

function onMobDeath(mob)
tpz.trust.message(mob, tpz.trust.message_offset.DEATH)
end
25 changes: 24 additions & 1 deletion scripts/globals/spells/trust/shantotto_ii.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,36 @@
-----------------------------------------
-- Trust: Shantotto II
-----------------------------------------
require("scripts/globals/gambits")
require("scripts/globals/magic")
require("scripts/globals/trust")
-----------------------------------------

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell, 896)
return tpz.trust.canCast(caster, spell, tpz.magic.spell.SHANTOTTO)
end

function onSpellCast(caster, target, spell)
return tpz.trust.spawn(caster, spell)
end

function onMobSpawn(mob)
tpz.trust.message(mob, tpz.trust.message_offset.SPAWN)

mob:addSimpleGambit(ai.t.TARGET, ai.c.MB_AVAILABLE, 0, ai.r.MA, ai.s.MB_ELEMENT, tpz.magic.spellFamily.NONE)
mob:addSimpleGambit(ai.t.TARGET, ai.c.NOT_SC_AVAILABLE, 0, ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.NONE, 30)

local power = mob:getMainLvl()
mob:addMod(tpz.mod.MATT, power)
mob:addMod(tpz.mod.MACC, power)
mob:addMod(tpz.mod.HASTE_MAGIC, 20)
mob:SetAutoAttackEnabled(false)
end

function onMobDespawn(mob)
tpz.trust.message(mob, tpz.trust.message_offset.DESPAWN)
end

function onMobDeath(mob)
tpz.trust.message(mob, tpz.trust.message_offset.DEATH)
end
17 changes: 15 additions & 2 deletions scripts/globals/spells/trust/trion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,21 @@ function onMobSpawn(mob)
mob:addSimpleGambit(ai.t.PARTY, ai.c.HPP_LT, 75,
ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.CURE)

mob:addSimpleGambit(ai.t.SELF, ai.c.TP_GTE, 1000,
ai.r.WS, ai.s.SPECIFIC, tpz.ws.RED_LOTUS_BLADE)
-- TODO: Table me
local ROYAL_BASH = 3193
local ROYAL_SAVIOUR = 3194
mob:setTPSkills({
['skills'] = {
{ ai.r.MS, ROYAL_BASH, 0 },
{ ai.r.MS, ROYAL_SAVIOUR, 0 },

{ ai.r.WS, tpz.ws.RED_LOTUS_BLADE, 0 },
{ ai.r.WS, tpz.ws.FLAT_BLADE, 0 },
{ ai.r.WS, tpz.ws.SAVAGE_BLADE, 60 },
},
['mode'] = ai.tp.ASAP,
['skill_select'] = ai.s.RANDOM,
})
end

function onMobDespawn(mob)
Expand Down
12 changes: 10 additions & 2 deletions scripts/globals/spells/trust/volker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,16 @@ function onMobSpawn(mob)
mob:addSimpleGambit(ai.t.MASTER, ai.c.HPP_LT, 50,
ai.r.JA, ai.s.SPECIFIC, tpz.ja.PROVOKE)

mob:addSimpleGambit(ai.t.SELF, ai.c.TP_GTE, 1000,
ai.r.WS, ai.s.SPECIFIC, tpz.ws.RED_LOTUS_BLADE)
mob:setTPSkills({
['skills'] = {
{ ai.r.WS, tpz.ws.RED_LOTUS_BLADE, 0 },
{ ai.r.WS, tpz.ws.SPIRIT_WITHIN, 0 },
{ ai.r.WS, tpz.ws.VORPAL_BLADE, 60 },
{ ai.r.WS, tpz.ws.SAVAGE_BLADE, 60 },
},
['mode'] = ai.tp.ASAP,
['skill_select'] = ai.s.RANDOM,
})
end

function onMobDespawn(mob)
Expand Down
Loading

0 comments on commit 45a5e4b

Please sign in to comment.