Skip to content

Commit 4734390

Browse files
committed
[lua, sql] Bastok 9-2 Behavior Adjustments
1 parent d615dfc commit 4734390

15 files changed

Lines changed: 165 additions & 54 deletions

File tree

scripts/actions/mobskills/abyssal_strike.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ mobskillObject.onMobWeaponSkill = function(target, mob, skill)
1919
local info = xi.mobskills.mobPhysicalMove(mob, target, skill, numhits, accmod, ftp, xi.mobskills.physicalTpBonus.NO_EFFECT, 0, 0, 0)
2020
local dmg = xi.mobskills.mobFinalAdjustments(info.dmg, mob, skill, target, xi.attackType.PHYSICAL, xi.damageType.BLUNT, info.hitslanded)
2121

22-
xi.mobskills.mobPhysicalStatusEffectMove(mob, target, skill, xi.effect.STUN, 1, 0, 4)
22+
xi.mobskills.mobPhysicalStatusEffectMove(mob, target, skill, xi.effect.STUN, 1, 0, 15)
2323
target:takeDamage(dmg, mob, xi.attackType.PHYSICAL, xi.damageType.BLUNT)
2424

2525
return dmg
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
-----------------------------------
2+
-- Shockwave
3+
-- Delivers an area of effect attack. Sleeps enemies.
4+
-- TODO: Verify sleep duration scaling with TP.
5+
-----------------------------------
6+
---@type TMobSkill
7+
local mobskillObject = {}
8+
9+
mobskillObject.onMobSkillCheck = function(target, mob, skill)
10+
return 0
11+
end
12+
13+
mobskillObject.onMobWeaponSkill = function(target, mob, skill)
14+
local numhits = 1
15+
local accmod = 1
16+
local ftp = 2
17+
local info = xi.mobskills.mobPhysicalMove(mob, target, skill, numhits, accmod, ftp, xi.mobskills.physicalTpBonus.NO_EFFECT)
18+
local dmg = xi.mobskills.mobFinalAdjustments(info.dmg, mob, skill, target, xi.attackType.PHYSICAL, xi.damageType.SLASHING, info.hitslanded)
19+
20+
target:takeDamage(dmg, mob, xi.attackType.PHYSICAL, xi.damageType.SLASHING)
21+
22+
xi.mobskills.mobStatusEffectMove(mob, target, xi.effect.SLEEP_I, 1, 0, 60)
23+
24+
return dmg
25+
end
26+
27+
return mobskillObject

scripts/actions/mobskills/zeid_summon_shadows.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ mobskillObject.onMobWeaponSkill = function(target, mob, skill)
2525

2626
shadowOne:spawn()
2727
shadowTwo:spawn()
28-
shadowOne:setPos(xPos, yPos, zPos)
29-
shadowTwo:setPos(xPos, yPos, zPos)
28+
shadowOne:setPos(xPos + math.random(-2, 2), yPos, zPos + math.random(-2, 2))
29+
shadowTwo:setPos(xPos + math.random(-2, 2), yPos, zPos + math.random(-2, 2))
3030
shadowOne:updateEnmity(target)
3131
shadowTwo:updateEnmity(target)
3232
end

scripts/battlefields/Throne_Room/where_two_paths_converge.lua

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,19 @@ function content:onEventFinishBattlefield(player, csid, option, npc)
3535

3636
local volkerCoords =
3737
{
38-
[1] = { -450, -167, -239, 125 },
39-
[2] = { -769.949 , -407, -478.991, 125 },
40-
[3] = { -1089.787, -647, -718.976, 125 },
38+
[1] = { -451.155, -167, -240.004, 125 },
39+
[2] = { -770.805, -407, -480.077, 125 },
40+
[3] = { -1090.97, -647, -720.077, 125 },
4141
}
4242

43-
local zeid2 = SpawnMob(zeidId + 1)
43+
-- Bail out if anyone else got here first
44+
local zeid2Id = zeidId + 1
45+
local zeid2Mob = GetMobByID(zeid2Id)
46+
if zeid2Mob and zeid2Mob:isSpawned() then
47+
return
48+
end
49+
50+
local zeid2 = SpawnMob(zeid2Id)
4451

4552
-- Set Phase 2 Zeid's HP to be same HPP as previous phase.
4653
local zeid1 = GetMobByID(zeidId)

scripts/enum/mob_skills.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ xi.mobSkill =
162162
TRION_FLAT_BLADE = 969, -- Trion Flat Blade
163163
TRION_SAVAGE_BLADE = 970, -- Trion Savage Blade
164164

165+
VOLKER_RED_LOTUS_BLADE = 973, -- Volker Red Lotus Blade
166+
VOLKER_SPIRITS_WITHIN = 974, -- Volker Spirits Within
167+
VOLKER_VORPAL_BLADE = 975, -- Volker Vorpal Blade
168+
165169
AJIDO_WARP_OUT = 977, -- Windurst 9-2 Ajido teleport
166170
AJIDO_WARP_IN = 978, -- Windurst 9-2 Ajido teleport
167171

scripts/mixins/helper_npc.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ g_mixins.helper_npc = function(helperMob)
115115
if not shouldEngage then
116116
for _, targetMobId in ipairs(targetMobs) do
117117
local targetMob = GetMobByID(targetMobId)
118-
if targetMob and targetMob:isEngaged() then
118+
if targetMob and targetMob:isSpawned() and targetMob:isEngaged() then
119119
shouldEngage = true
120120
break
121121
end

scripts/zones/Throne_Room/IDs.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ zones[xi.zone.THRONE_ROOM] =
1919
TIME_IN_THE_BATTLEFIELD_IS_UP = 7232, -- Your time in the battlefield is up! Now exiting...
2020
PARTY_MEMBERS_ARE_ENGAGED = 7247, -- The battlefield where your party members are engaged in combat is locked. Access is denied.
2121
NO_BATTLEFIELD_ENTRY = 7249, -- The door is sealed shut with an evil curse.
22+
UNABLE_TO_PROTECT = 7288, -- You were unable to protect Captain Volker. Now leaving the battlefield.
2223
TESTIMONY_IS_TORN = 7290, -- Your <item> is torn...
2324
TESTIMONY_WEARS = 7291, -- Your <item> [/rips into shreds!/is on the verge of tearing apart.../is showing signs of wear...] (# [use remains/uses remain].)
2425
MEMBERS_OF_YOUR_PARTY = 7538, -- Currently, <number> members of your party (including yourself) have clearance to enter the battlefield.

scripts/zones/Throne_Room/mobs/Shadow_of_Rage.lua

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,48 @@
33
-- Mob: Shadow of Rage
44
-- Bastok mission 9-2 BCNM Fight (Phase 2)
55
-----------------------------------
6+
local ID = zones[xi.zone.THRONE_ROOM]
7+
-----------------------------------
68
---@type TMobEntity
79
local entity = {}
810

911
entity.onMobInitialize = function(mob)
1012
mob:addImmunity(xi.immunity.PETRIFY)
1113
mob:addImmunity(xi.immunity.LIGHT_SLEEP)
1214
mob:addImmunity(xi.immunity.DARK_SLEEP)
15+
16+
-- 50% chance to immediately TP move again (but only once per chain)
17+
mob:addListener('WEAPONSKILL_STATE_EXIT', 'SHADOW_TP_CHAIN', function(mobEntity, skillID)
18+
local justChained = mobEntity:getLocalVar('justChained')
19+
20+
-- Only allow chaining if this wasn't already a chained TP move
21+
if justChained == 0 and math.random(1, 100) <= 50 then
22+
mobEntity:setTP(3000)
23+
mobEntity:setLocalVar('justChained', 1) -- Mark this as a chained TP
24+
else
25+
-- Reset the chained flag for next potential chain
26+
mobEntity:setLocalVar('justChained', 0)
27+
end
28+
end)
29+
end
30+
31+
entity.onMobDeath = function(mob, player, optParams)
32+
if optParams.isKiller or optParams.noKiller then
33+
local battlefieldArea = mob:getBattlefield():getArea()
34+
local areaOffset = (battlefieldArea - 1) * 4
35+
local zeid2Id = ID.mob.ZEID_BCNM_OFFSET + areaOffset + 1
36+
local zeid2 = GetMobByID(zeid2Id)
37+
38+
-- Set clone respawn if it's not already set
39+
if zeid2 and zeid2:isAlive() then
40+
local currentRespawnTime = zeid2:getLocalVar('petRespawnTime')
41+
local currentTime = GetSystemTime()
42+
43+
if currentRespawnTime == 0 or currentTime >= currentRespawnTime then
44+
zeid2:setLocalVar('petRespawnTime', currentTime + 60)
45+
end
46+
end
47+
end
1348
end
1449

1550
return entity

scripts/zones/Throne_Room/mobs/Volker.lua

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,53 @@
44
-- Ally during Bastok Mission 9-2
55
-----------------------------------
66
local ID = zones[xi.zone.THRONE_ROOM]
7+
mixins = { require('scripts/mixins/helper_npc') }
78
-----------------------------------
89
---@type TMobEntity
910
local entity = {}
1011

12+
-- Helper NPC configuration
13+
local helperConfig =
14+
{
15+
engageWaitTime = 90, -- 1.5 minutes
16+
isAggroable = false,
17+
targetMobs = function(mob)
18+
local battlefieldArea = mob:getBattlefield():getArea()
19+
local areaOffset = (battlefieldArea - 1) * 4
20+
return
21+
{
22+
ID.mob.ZEID_BCNM_OFFSET + areaOffset + 1, -- Zeid
23+
ID.mob.ZEID_BCNM_OFFSET + areaOffset + 2, -- Shadow_of_Rage
24+
ID.mob.ZEID_BCNM_OFFSET + areaOffset + 3, -- Shadow_of_Rage
25+
}
26+
end,
27+
}
28+
1129
entity.onMobSpawn = function(volker)
30+
xi.mix.helperNpc.config(volker, helperConfig)
31+
1232
volker:addListener('WEAPONSKILL_STATE_ENTER', 'WS_START_MSG', function(mob, skillID)
1333
-- Red Lotus Blade
14-
if skillID == 973 then
34+
if skillID == xi.mobSkill.VOLKER_RED_LOTUS_BLADE then
1535
mob:showText(mob, ID.text.NO_HIDE_AWAY)
16-
-- Spirits Within
17-
elseif skillID == 974 then
36+
-- Spirits Within
37+
elseif skillID == xi.mobSkill.VOLKER_SPIRITS_WITHIN then
1838
mob:showText(mob, ID.text.YOUR_ANSWER)
19-
-- Vorpal Blade
20-
elseif skillID == 975 then
39+
-- Vorpal Blade
40+
elseif skillID == xi.mobSkill.VOLKER_VORPAL_BLADE then
2141
mob:showText(mob, ID.text.CANT_UNDERSTAND)
2242
end
2343
end)
2444
end
2545

26-
entity.onMobRoam = function(mob)
27-
local wait = mob:getLocalVar('wait')
28-
local ready = mob:getLocalVar('ready')
29-
if ready == 0 and wait > 40 then
30-
local baseID = ID.mob.ZEID_BCNM_OFFSET + (mob:getBattlefield():getArea() - 1) * 4
31-
mob:setLocalVar('ready', bit.band(baseID, 0xFFF))
32-
mob:setLocalVar('wait', 0)
33-
elseif ready > 0 then
34-
local mobObj = GetMobByID(ready + bit.lshift(mob:getZoneID(), 12) + 0x1000000)
35-
if mobObj then
36-
mob:addEnmity(mobObj, 0, 1)
46+
entity.onMobDeath = function(mob, player, optParams)
47+
if optParams.isKiller or optParams.noKiller then
48+
mob:getBattlefield():lose()
49+
local players = mob:getBattlefield():getPlayers()
50+
for _, playerObj in pairs(players) do
51+
playerObj:messageSpecial(ID.text.UNABLE_TO_PROTECT)
3752
end
38-
else
39-
mob:setLocalVar('wait', wait + 3)
4053
end
4154
end
4255

43-
entity.onMobDeath = function(mob, player, optParams)
44-
mob:getBattlefield():lose()
45-
end
46-
4756
return entity

scripts/zones/Throne_Room/mobs/Zeid.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ entity.onMobInitialize = function(mob)
1010
mob:addImmunity(xi.immunity.PETRIFY)
1111
mob:addImmunity(xi.immunity.LIGHT_SLEEP)
1212
mob:addImmunity(xi.immunity.DARK_SLEEP)
13+
mob:addMod(xi.mod.REGAIN, 200)
1314
end
1415

1516
return entity

0 commit comments

Comments
 (0)