Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for level sync before allowing BCNM entry #1053

Merged
merged 4 commits into from
Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions scripts/globals/bcnm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -945,11 +945,27 @@ local function getItemById(player, bfid)
return 0
end

local function rejectLevelSyncedParty(player, npc)
for _, member in pairs(player:getAlliance()) do
if member:isLevelSync() then
local zoneId = player:getZoneID()
local ID = zones[zoneId]
-- Your party is unable to participate because certain members' levels are restricted
player:messageText(npc, ID.text.MEMBERS_LEVELS_ARE_RESTRICTED, false)
return true
end
end
return false
end
-----------------------------------
-- onTrade Action
-----------------------------------

xi.bcnm.onTrade = function(player, npc, trade, onUpdate)
if rejectLevelSyncedParty(player, npc) then -- player's party has level sync, abort.
return false
end

-- Validate trade
local itemId

Expand Down Expand Up @@ -1019,6 +1035,11 @@ end
-- onTrigger Action
-----------------------------------
xi.bcnm.onTrigger = function(player, npc)
-- Cannot enter if anyone in party is level/master sync'd
if rejectLevelSyncedParty(player, npc) then
return false
end

-- Player has battlefield status effect. That means a battlefield is open OR the player is inside a battlefield.
if player:hasStatusEffect(xi.effect.BATTLEFIELD) then
-- Player is inside battlefield. Attempting to leave.
Expand Down
17 changes: 9 additions & 8 deletions scripts/zones/Abdhaljs_Isle-Purgonorgo/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ zones[xi.zone.ABDHALJS_ISLE_PURGONORGO] =
{
text =
{
ITEM_CANNOT_BE_OBTAINED = 6384, -- You cannot obtain the <item>. Come back after sorting your inventory.
ITEM_OBTAINED = 6390, -- Obtained: <item>.
GIL_OBTAINED = 6391, -- Obtained <number> gil.
KEYITEM_OBTAINED = 6393, -- Obtained key item: <keyitem>.
CARRIED_OVER_POINTS = 7001, -- You have carried over <number> login point[/s].
LOGIN_CAMPAIGN_UNDERWAY = 7002, -- The [/January/February/March/April/May/June/July/August/September/October/November/December] <number> Login Campaign is currently underway!
LOGIN_NUMBER = 7003, -- In celebration of your most recent login (login no. <number>), we have provided you with <number> points! You currently have a total of <number> points.
FISHING_MESSAGE_OFFSET = 7057, -- You can't fish here.
ITEM_CANNOT_BE_OBTAINED = 6384, -- You cannot obtain the <item>. Come back after sorting your inventory.
ITEM_OBTAINED = 6390, -- Obtained: <item>.
GIL_OBTAINED = 6391, -- Obtained <number> gil.
KEYITEM_OBTAINED = 6393, -- Obtained key item: <keyitem>.
CARRIED_OVER_POINTS = 7001, -- You have carried over <number> login point[/s].
LOGIN_CAMPAIGN_UNDERWAY = 7002, -- The [/January/February/March/April/May/June/July/August/September/October/November/December] <number> Login Campaign is currently underway!
LOGIN_NUMBER = 7003, -- In celebration of your most recent login (login no. <number>), we have provided you with <number> points! You currently have a total of <number> points.
MEMBERS_LEVELS_ARE_RESTRICTED = 7023, -- Your party is unable to participate because certain members' levels are restricted.
FISHING_MESSAGE_OFFSET = 7057, -- You can't fish here.
},
mob =
{
Expand Down
107 changes: 54 additions & 53 deletions scripts/zones/Abyssea-Altepa/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,59 +11,60 @@ zones[xi.zone.ABYSSEA_ALTEPA] =
{
text =
{
ITEM_CANNOT_BE_OBTAINED = 6384, -- You cannot obtain the <item>. Come back after sorting your inventory.
ITEM_OBTAINED = 6390, -- Obtained: <item>.
GIL_OBTAINED = 6391, -- Obtained <number> gil.
KEYITEM_OBTAINED = 6393, -- Obtained key item: <keyitem>.
CRUOR_TOTAL = 6988, -- Obtained <number> cruor. (Total: <number>)
CARRIED_OVER_POINTS = 7001, -- You have carried over <number> login point[/s].
LOGIN_CAMPAIGN_UNDERWAY = 7002, -- The [/January/February/March/April/May/June/July/August/September/October/November/December] <number> Login Campaign is currently underway!
LOGIN_NUMBER = 7003, -- In celebration of your most recent login (login no. <number>), we have provided you with <number> points! You currently have a total of <number> points.
LIGHTS_MESSAGE_1 = 7322, -- Visitant Light Intensity Pearlescent: <number> / Ebon: <number> Golden: <number> / Silvery: <number>
LIGHTS_MESSAGE_2 = 7323, -- Azure: <number> / Ruby: <number> / Amber: <number>
STAGGERED = 7324, -- <name>'s attack staggers the fiend!
YELLOW_STAGGER = 7325, -- The fiend is unable to cast magic.
BLUE_STAGGER = 7326, -- The fiend is unable to use special attacks.
RED_STAGGER = 7327, -- The fiend is frozen in its tracks.
YELLOW_WEAKNESS = 7328, -- The fiend appears vulnerable to [/fire/ice/wind/earth/lightning/water/light/darkness] elemental magic!
BLUE_WEAKNESS = 7329, -- The fiend appears vulnerable to [/hand-to-hand/dagger/sword/great sword/axe/great axe/scythe/polearm/katana/great katana/club/staff/archery/marksmanship] weapon skills!
RED_WEAKNESS = 7330, -- The fiend appears vulnerable to [/fire/ice/wind/earth/lightning/water/light/darkness] elemental weapon skills!
ABYSSEA_TIME_OFFSET = 7331, -- Your visitant status will wear off in <number> [second/minute].
RETURNING_TO_SEARING_IN = 7340, -- Returning to the Searing Ward in <number> [second/seconds].
NO_VISITANT_WARD = 7341, -- You do not have visitant status. Returning to the Searing Ward in <number> [second/seconds].
RETURNING_TO_WARD = 7343, -- Returning to the Searing Ward now.
NO_VISITANT_STATUS = 7400, -- You do not have visitant status. Please proceed to the nearest Conflux Surveyor to have it granted.
MONSTER_CONCEALED_CHEST = 7483, -- The monster was concealing a treasure chest!
OBTAINS_TEMP_ITEM = 7493, -- <name> obtains the temporary item: <item>!
OBTAINS_ITEM = 7494, -- <name> obtains the item: <item>!
OBTAINS_KEYITEM = 7495, -- <name> obtains the key item: <item>!
ADD_SPOILS_TO_TREASURE = 7496, -- <name> transferred the contents of the pyxis to the cache of lottable spoils.
TEMP_ITEM_DISAPPEARED = 7499, -- That temporary item had already disappeared.
KEYITEM_DISAPPEARED = 7500, -- That key item had already disappeared.
ITEM_DISAPPEARED = 7501, -- That item had already disappeared.
CHEST_DESPAWNED = 7502, -- The treasure chest had already disappeared.
CRUOR_OBTAINED = 7503, -- <name> obtained <number> cruor.
OBTAINS_SEVERAL_TEMPS = 7504, -- <name> obtains several temporary items!
BODY_EMITS_OFFSET = 7505, -- <name>'s body emits [a faint/a mild/a strong] pearlescent light!
CANNOT_OPEN_CHEST = 7512, -- You cannot open that treasure chest.
PLAYER_HAS_CLAIM_OF_CHEST = 7513, -- <name> has claim over that treasure chest.
PARTY_NOT_OWN_CHEST = 7514, -- Your party does not have claim over that treasure chest.
CHEST_DISAPPEARED = 7517, -- The treasure chest has disappeared.
RANDOM_SUCCESS_FAIL_GUESS = 7539, -- The randomly generated number was <number>! <name> guessed [successfully/unsuccessfully]!
AIR_PRESSURE_CHANGE = 7543, -- <name> [reduced/increased] the air pressure by <number> units. Current air pressure: <number>[/ (minimum)/ (maximum)]
INPUT_SUCCESS_FAIL_GUESS = 7548, -- <name> inputs the number <number>[, but nothing happens./, successfully unlocking the chest!]
GREATER_OR_LESS_THAN = 7549, -- You have a hunch that the lock's combination is [greater/less] than <number>.
HUNCH_SECOND_FIRST_EVEN_ODD = 7550, -- You have a hunch that the [second/first] digit is [even/odd].
HUNCH_SECOND_FIRST_IS = 7551, -- You have a hunch that the [second/first] digit is <number>.
HUNCH_SECOND_FIRST_IS_OR = 7552, -- You have a hunch that the [second/first] digit is <number>, <number>, or <number>.
HUNCH_ONE_DIGIT_IS = 7553, -- You have a hunch that one of the digits is <number>.
HUNCH_SUM_EQUALS = 7554, -- You have a hunch that the sum of the two digits is <number>.
PLAYER_OPENED_LOCK = 7555, -- <name> succeeded in opening the lock!
PLAYER_FAILED_LOCK = 7556, -- <name> failed to open the lock.
TRADE_KEY_OPEN = 7557, -- <name> uses <item> and opens the lock!
BOUNDLESS_RAGE = 7580, -- You sense an aura of boundless rage...
INFO_KI = 7581, -- Your keen senses tell you that something may happen if only you had [this item/these items].
USE_KI = 7584, -- Use the [key item/key items]? Yes. No.
ITEM_CANNOT_BE_OBTAINED = 6384, -- You cannot obtain the <item>. Come back after sorting your inventory.
ITEM_OBTAINED = 6390, -- Obtained: <item>.
GIL_OBTAINED = 6391, -- Obtained <number> gil.
KEYITEM_OBTAINED = 6393, -- Obtained key item: <keyitem>.
CRUOR_TOTAL = 6988, -- Obtained <number> cruor. (Total: <number>)
CARRIED_OVER_POINTS = 7001, -- You have carried over <number> login point[/s].
LOGIN_CAMPAIGN_UNDERWAY = 7002, -- The [/January/February/March/April/May/June/July/August/September/October/November/December] <number> Login Campaign is currently underway!
LOGIN_NUMBER = 7003, -- In celebration of your most recent login (login no. <number>), we have provided you with <number> points! You currently have a total of <number> points.
MEMBERS_LEVELS_ARE_RESTRICTED = 7023, -- Your party is unable to participate because certain members' levels are restricted.
LIGHTS_MESSAGE_1 = 7322, -- Visitant Light Intensity Pearlescent: <number> / Ebon: <number> Golden: <number> / Silvery: <number>
LIGHTS_MESSAGE_2 = 7323, -- Azure: <number> / Ruby: <number> / Amber: <number>
STAGGERED = 7324, -- <name>'s attack staggers the fiend!
YELLOW_STAGGER = 7325, -- The fiend is unable to cast magic.
BLUE_STAGGER = 7326, -- The fiend is unable to use special attacks.
RED_STAGGER = 7327, -- The fiend is frozen in its tracks.
YELLOW_WEAKNESS = 7328, -- The fiend appears vulnerable to [/fire/ice/wind/earth/lightning/water/light/darkness] elemental magic!
BLUE_WEAKNESS = 7329, -- The fiend appears vulnerable to [/hand-to-hand/dagger/sword/great sword/axe/great axe/scythe/polearm/katana/great katana/club/staff/archery/marksmanship] weapon skills!
RED_WEAKNESS = 7330, -- The fiend appears vulnerable to [/fire/ice/wind/earth/lightning/water/light/darkness] elemental weapon skills!
ABYSSEA_TIME_OFFSET = 7331, -- Your visitant status will wear off in <number> [second/minute].
RETURNING_TO_SEARING_IN = 7340, -- Returning to the Searing Ward in <number> [second/seconds].
NO_VISITANT_WARD = 7341, -- You do not have visitant status. Returning to the Searing Ward in <number> [second/seconds].
RETURNING_TO_WARD = 7343, -- Returning to the Searing Ward now.
NO_VISITANT_STATUS = 7400, -- You do not have visitant status. Please proceed to the nearest Conflux Surveyor to have it granted.
MONSTER_CONCEALED_CHEST = 7483, -- The monster was concealing a treasure chest!
OBTAINS_TEMP_ITEM = 7493, -- <name> obtains the temporary item: <item>!
OBTAINS_ITEM = 7494, -- <name> obtains the item: <item>!
OBTAINS_KEYITEM = 7495, -- <name> obtains the key item: <item>!
ADD_SPOILS_TO_TREASURE = 7496, -- <name> transferred the contents of the pyxis to the cache of lottable spoils.
TEMP_ITEM_DISAPPEARED = 7499, -- That temporary item had already disappeared.
KEYITEM_DISAPPEARED = 7500, -- That key item had already disappeared.
ITEM_DISAPPEARED = 7501, -- That item had already disappeared.
CHEST_DESPAWNED = 7502, -- The treasure chest had already disappeared.
CRUOR_OBTAINED = 7503, -- <name> obtained <number> cruor.
OBTAINS_SEVERAL_TEMPS = 7504, -- <name> obtains several temporary items!
BODY_EMITS_OFFSET = 7505, -- <name>'s body emits [a faint/a mild/a strong] pearlescent light!
CANNOT_OPEN_CHEST = 7512, -- You cannot open that treasure chest.
PLAYER_HAS_CLAIM_OF_CHEST = 7513, -- <name> has claim over that treasure chest.
PARTY_NOT_OWN_CHEST = 7514, -- Your party does not have claim over that treasure chest.
CHEST_DISAPPEARED = 7517, -- The treasure chest has disappeared.
RANDOM_SUCCESS_FAIL_GUESS = 7539, -- The randomly generated number was <number>! <name> guessed [successfully/unsuccessfully]!
AIR_PRESSURE_CHANGE = 7543, -- <name> [reduced/increased] the air pressure by <number> units. Current air pressure: <number>[/ (minimum)/ (maximum)]
INPUT_SUCCESS_FAIL_GUESS = 7548, -- <name> inputs the number <number>[, but nothing happens./, successfully unlocking the chest!]
GREATER_OR_LESS_THAN = 7549, -- You have a hunch that the lock's combination is [greater/less] than <number>.
HUNCH_SECOND_FIRST_EVEN_ODD = 7550, -- You have a hunch that the [second/first] digit is [even/odd].
HUNCH_SECOND_FIRST_IS = 7551, -- You have a hunch that the [second/first] digit is <number>.
HUNCH_SECOND_FIRST_IS_OR = 7552, -- You have a hunch that the [second/first] digit is <number>, <number>, or <number>.
HUNCH_ONE_DIGIT_IS = 7553, -- You have a hunch that one of the digits is <number>.
HUNCH_SUM_EQUALS = 7554, -- You have a hunch that the sum of the two digits is <number>.
PLAYER_OPENED_LOCK = 7555, -- <name> succeeded in opening the lock!
PLAYER_FAILED_LOCK = 7556, -- <name> failed to open the lock.
TRADE_KEY_OPEN = 7557, -- <name> uses <item> and opens the lock!
BOUNDLESS_RAGE = 7580, -- You sense an aura of boundless rage...
INFO_KI = 7581, -- Your keen senses tell you that something may happen if only you had [this item/these items].
USE_KI = 7584, -- Use the [key item/key items]? Yes. No.
},
mob =
{
Expand Down
Loading