|
4 | 4 | -- Ally during Bastok Mission 9-2 |
5 | 5 | ----------------------------------- |
6 | 6 | local ID = zones[xi.zone.THRONE_ROOM] |
| 7 | +mixins = { require('scripts/mixins/helper_npc') } |
7 | 8 | ----------------------------------- |
8 | 9 | ---@type TMobEntity |
9 | 10 | local entity = {} |
10 | 11 |
|
| 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 | + |
11 | 29 | entity.onMobSpawn = function(volker) |
| 30 | + xi.mix.helperNpc.config(volker, helperConfig) |
| 31 | + |
12 | 32 | volker:addListener('WEAPONSKILL_STATE_ENTER', 'WS_START_MSG', function(mob, skillID) |
13 | 33 | -- Red Lotus Blade |
14 | | - if skillID == 973 then |
| 34 | + if skillID == xi.mobSkill.VOLKER_RED_LOTUS_BLADE then |
15 | 35 | 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 |
18 | 38 | 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 |
21 | 41 | mob:showText(mob, ID.text.CANT_UNDERSTAND) |
22 | 42 | end |
23 | 43 | end) |
24 | 44 | end |
25 | 45 |
|
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) |
37 | 52 | end |
38 | | - else |
39 | | - mob:setLocalVar('wait', wait + 3) |
40 | 53 | end |
41 | 54 | end |
42 | 55 |
|
43 | | -entity.onMobDeath = function(mob, player, optParams) |
44 | | - mob:getBattlefield():lose() |
45 | | -end |
46 | | - |
47 | 56 | return entity |
0 commit comments