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

Commit

Permalink
Merge branch 'feature/trust' into canary
Browse files Browse the repository at this point in the history
  • Loading branch information
zach2good committed Oct 31, 2020
2 parents 2ff3b4e + ed7068e commit e009425
Show file tree
Hide file tree
Showing 24 changed files with 345 additions and 29 deletions.
2 changes: 1 addition & 1 deletion cmake/StandardProjectSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if(ENABLE_IPO)
if(result)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(SEND_ERROR "IPO is not supported: ${output}")
message(WARNING "IPO is not supported: ${output}")
endif()
endif()

Expand Down
2 changes: 1 addition & 1 deletion scripts/globals/abilities/maintenance.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function onUseAbility(player, target, ability)
if pet:delStatusEffect(tpz.effect.SILENCE) then return true end
if pet:delStatusEffect(tpz.effect.BANE) then return true end
if pet:delStatusEffect(tpz.effect.CURSE_II) then return true end
if pet:delStatusEffect(tpz.effect.CURSE) then return true end
if pet:delStatusEffect(tpz.effect.CURSE_I) then return true end
if pet:delStatusEffect(tpz.effect.PARALYSIS) then return true end
if pet:delStatusEffect(tpz.effect.PLAGUE) then return true end
if pet:delStatusEffect(tpz.effect.POISON) then return true end
Expand Down
2 changes: 1 addition & 1 deletion scripts/globals/abilities/pets/attachments/eraser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ local removable = {
tpz.effect.SILENCE,
tpz.effect.BANE,
tpz.effect.CURSE_II,
tpz.effect.CURSE,
tpz.effect.CURSE_I,
tpz.effect.PARALYSIS,
tpz.effect.PLAGUE,
tpz.effect.POISON,
Expand Down
2 changes: 1 addition & 1 deletion scripts/globals/abilities/pets/eraser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function onPetAbility(target, automaton, skill, master, action)
if target:delStatusEffect(tpz.effect.SILENCE) then return true end
if target:delStatusEffect(tpz.effect.BANE) then return true end
if target:delStatusEffect(tpz.effect.CURSE_II) then return true end
if target:delStatusEffect(tpz.effect.CURSE) then return true end
if target:delStatusEffect(tpz.effect.CURSE_I) then return true end
if target:delStatusEffect(tpz.effect.PARALYSIS) then return true end
if target:delStatusEffect(tpz.effect.PLAGUE) then return true end
if target:delStatusEffect(tpz.effect.POISON) then return true end
Expand Down
2 changes: 1 addition & 1 deletion scripts/globals/abilities/repair.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function onUseAbility(player, target, ability)
if pet:delStatusEffect(tpz.effect.SILENCE) then return true end
if pet:delStatusEffect(tpz.effect.BANE) then return true end
if pet:delStatusEffect(tpz.effect.CURSE_II) then return true end
if pet:delStatusEffect(tpz.effect.CURSE) then return true end
if pet:delStatusEffect(tpz.effect.CURSE_I) then return true end
if pet:delStatusEffect(tpz.effect.PARALYSIS) then return true end
if pet:delStatusEffect(tpz.effect.PLAGUE) then return true end
if pet:delStatusEffect(tpz.effect.POISON) then return true end
Expand Down
26 changes: 26 additions & 0 deletions scripts/globals/items/dusty_elixir.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
-----------------------------------------
-- ID: 5433
-- Item: Dusty Elixir
-- Item Effect: Instantly restores 25% of HP and MP
-----------------------------------------
require("scripts/globals/msg")

function onItemCheck(target)
local result = 0
local mHP = target:getMaxHP()
local cHP = target:getHP()
local mMP = target:getMaxMP()
local cMP = target:getMP()

if mHP == cHP and mMP == cMP then
result = 56 -- Does not let player use item if their hp and mp are full
end

return result
end

function onItemUse(target)
target:addHP(target:getMaxHP() * .25)
target:addMP(target:getMaxMP() * .25)
target:messageBasic(tpz.msg.basic.RECOVERS_HP_AND_MP)
end
106 changes: 102 additions & 4 deletions scripts/globals/items/nexus_cape.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
-----------------------------------------
require("scripts/globals/teleports")
require("scripts/globals/status")
require('scripts/globals/zone')
-----------------------------------------

function onItemCheck(target)
Expand All @@ -16,15 +17,112 @@ function onItemCheck(target)
-- Don't try to teleport to self!
if (target:getID() ~= leader:getID()) then
local leaderZone = leader:getZoneID()

-- Locations with "**" in comment:
-- ** If the party leader is located in a battlefield or other special location,
-- players will be forced to travel to a specific location.
--
-- Other commented locations:
-- Players will travel of a specific location, not that of the party leader.
local validZoneList =
{
5, 7, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
115, 116, 117, 118, 119, 120, 123, 124, 125, 126, 127, 128, 230, 231, 232, 234,
235, 236, 238, 239, 240, 241, 243, 244, 245, 246, 247, 248, 249, 250, 252, 257
tpz.zone.ULEGUERAND_RANGE,
tpz.zone.ATTOHWA_CHASM,
tpz.zone.WEST_RONFAURE,
tpz.zone.EAST_RONFAURE,
tpz.zone.LA_THEINE_PLATEAU,
tpz.zone.VALKURM_DUNES,
tpz.zone.JUGNER_FOREST,
tpz.zone.BATALLIA_DOWNS,
tpz.zone.NORTH_GUSTABERG,
tpz.zone.SOUTH_GUSTABERG,
tpz.zone.KONSCHTAT_HIGHLANDS,
tpz.zone.PASHHOW_MARSHLANDS,
tpz.zone.ROLANBERRY_FIELDS,
tpz.zone.BEAUCEDINE_GLACIER,
tpz.zone.XARCABARD,
tpz.zone.CAPE_TERIGGAN,
tpz.zone.EASTERN_ALTEPA_DESERT,
tpz.zone.WEST_SARUTABARUTA,
tpz.zone.EAST_SARUTABARUTA,
tpz.zone.TAHRONGI_CANYON,
tpz.zone.BUBURIMU_PENINSULA,
tpz.zone.MERIPHATAUD_MOUNTAINS,
tpz.zone.SAUROMUGUE_CHAMPAIGN,
tpz.zone.YUHTUNGA_JUNGLE,
tpz.zone.YHOATOR_JUNGLE,
tpz.zone.WESTERN_ALTEPA_DESERT,
tpz.zone.QUFIM_ISLAND,
tpz.zone.BEHEMOTHS_DOMINION,
tpz.zone.VALLEY_OF_SORROWS,
tpz.zone.SOUTHERN_SAN_DORIA,
tpz.zone.NORTHERN_SAN_DORIA,
tpz.zone.PORT_SAN_DORIA,
tpz.zone.BASTOK_MINES,
tpz.zone.BASTOK_MARKETS,
tpz.zone.PORT_BASTOK,
tpz.zone.WINDURST_WATERS,
tpz.zone.WINDURST_WALLS,
tpz.zone.PORT_WINDURST,
tpz.zone.WINDURST_WOODS,
tpz.zone.RULUDE_GARDENS,
tpz.zone.UPPER_JEUNO,
tpz.zone.LOWER_JEUNO,
tpz.zone.PORT_JEUNO,
tpz.zone.RABAO,
tpz.zone.SELBINA,
tpz.zone.MHAURA,
tpz.zone.KAZHAM,
tpz.zone.NORG,
tpz.zone.CARPENTERS_LANDING,
tpz.zone.BIBIKI_BAY,
tpz.zone.LUFAISE_MEADOWS,
tpz.zone.MISAREAUX_COAST,
-- tpz.zone.TAVNAZIAN_SAFEHOLD,
tpz.zone.ALTAIEU,
-- tpz.zone.AL_ZAHBI,
-- tpz.zone.AHT_URHGAN_WHITEGATE,
-- ** tpz.zone.WAJAOM_WOODLANDS,
tpz.zone.BHAFLAU_THICKETS,
-- tpz.zone.NASHMAU,
-- ** tpz.zone.MOUNT_ZHAYOLM,
-- ** tpz.zone.CAEDARVA_MIRE,
-- tpz.zone.SOUTHERN_SAN_DORIA_S,
tpz.zone.EAST_RONFAURE_S,
tpz.zone.JUGNER_FOREST_S,
tpz.zone.VUNKERL_INLET_S,
tpz.zone.BATALLIA_DOWNS_S,
-- tpz.zone.BASTOK_MARKETS_S,
tpz.zone.NORTH_GUSTABERG_S,
tpz.zone.GRAUBERG_S,
tpz.zone.PASHHOW_MARSHLANDS_S,
tpz.zone.ROLANBERRY_FIELDS_S,
-- tpz.zone.WINDURST_WATERS_S,
tpz.zone.WEST_SARUTABARUTA_S,
tpz.zone.FORT_KARUGO_NARUGO_S,
tpz.zone.MERIPHATAUD_MOUNTAINS_S,
tpz.zone.SAUROMUGUE_CHAMPAIGN_S,
tpz.zone.THE_SANCTUARY_OF_ZITAH,
tpz.zone.ROMAEVE,
tpz.zone.RUAUN_GARDENS,
tpz.zone.BEAUCEDINE_GLACIER_S,
tpz.zone.XARCABARD_S,
-- tpz.zone.METALWORKS,
-- tpz.zone.HEAVENS_TOWER,
-- tpz.zone.WESTERN_ADOULIN,
-- tpz.zone.EASTERN_ADOULIN,
-- tpz.zone.YAHSE_HUNTING_GROUNDS,
-- tpz.zone.CEIZAK_BATTLEGROUNDS,
-- tpz.zone.FORET_DE_HENNETIEL,
-- tpz.zone.YORCIA_WEALD,
-- tpz.zone.MORIMAR_BASALT_FIELDS,
-- tpz.zone.MARJAMI_RAVINE,
-- tpz.zone.KAMIHR_DRIFTS,
-- tpz.zone.LEAFALLIA,
}
-- Make sure we can actually tele to that zone..
for _, validZone in ipairs(validZoneList) do
if validZone == leaderZone then
if validZone == leaderZone and target:isZoneVisited(validZone) then
result = 0
end
end
Expand Down
52 changes: 52 additions & 0 deletions scripts/globals/items/tube_of_clear_salve_i.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
-----------------------------------------
-- ID: 5837
-- Item: tube_of_clear_salve_i
-- Item Effect: Instantly removes 1-2 negative status effects at random from pet
-----------------------------------------
require("scripts/globals/settings")
require("scripts/globals/msg")

function onItemCheck(target)
if not target:hasPet() then
return tpz.msg.basic.REQUIRES_A_PET
end
return 0
end

function onItemUse(target)
local pet = target:getPet()
local effects =
{
tpz.effect.PETRIFICATION,
tpz.effect.SILENCE,
tpz.effect.BANE,
tpz.effect.CURSE_II,
tpz.effect.CURSE_I,
tpz.effect.PARALYSIS,
tpz.effect.PLAGUE,
tpz.effect.POISON,
tpz.effect.DISEASE,
tpz.effect.BLINDNESS
}

local count = math.random(1, 2)
local statusEffectTable = utils.shuffle(effects)

local function removeStatus()
for _, effect in ipairs(statusEffectTable) do
if pet:delStatusEffect(effect) then return true end
end
if pet:eraseStatusEffect() ~= 255 then return true end
return false
end

local removed = 0

for i = 0, count do
if not removeStatus() then break end
removed = removed + 1
if removed >= count then break end
end

return removed
end
53 changes: 53 additions & 0 deletions scripts/globals/items/tube_of_clear_salve_ii.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
-----------------------------------------
-- ID: 5838
-- Item: tube_of_clear_salve_ii
-- Item Effect: Instantly removes all negative status effects from pet
-----------------------------------------
require("scripts/globals/settings")
require("scripts/globals/msg")

function onItemCheck(target)
if not target:hasPet() then
return tpz.msg.basic.REQUIRES_A_PET
end
return 0
end

function onItemUse(target)
local pet = target:getPet()

local effects =
{
tpz.effect.PETRIFICATION,
tpz.effect.SILENCE,
tpz.effect.BANE,
tpz.effect.CURSE_II,
tpz.effect.CURSE_I,
tpz.effect.PARALYSIS,
tpz.effect.PLAGUE,
tpz.effect.POISON,
tpz.effect.DISEASE,
tpz.effect.BLINDNESS
}

local count = 10
local statusEffectTable = effects

local function removeStatus()
for _, effect in ipairs(statusEffectTable) do
if pet:delStatusEffect(effect) then return true end
end
if pet:eraseStatusEffect() ~= 255 then return true end
return false
end

local removed = 0

for i = 0, count do
if not removeStatus() then break end
removed = removed + 1
if removed >= count then break end
end

return removed
end
21 changes: 21 additions & 0 deletions scripts/globals/items/tube_of_healing_salve_i.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-----------------------------------------
-- ID: 5835
-- Item: tube_of_healing_salve_i
-- Item Effect: Instantly restores 50% of pet HP
-----------------------------------------
require("scripts/globals/settings")
require("scripts/globals/msg")

function onItemCheck(target)
if not target:hasPet() then
return tpz.msg.basic.REQUIRES_A_PET
end
return 0
end

function onItemUse(target)
local pet = target:getPet()
local totalHP = pet:getMaxHP() / 2
pet:addHP(totalHP)
pet:messageBasic(tpz.msg.basic.RECOVERS_HP, 0, totalHP)
end
21 changes: 21 additions & 0 deletions scripts/globals/items/tube_of_healing_salve_ii.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-----------------------------------------
-- ID: 5836
-- Item: tube_of_healing_salve_ii
-- Item Effect: Instantly restores 100% of pet HP
-----------------------------------------
require("scripts/globals/settings")
require("scripts/globals/msg")

function onItemCheck(target)
if not target:hasPet() then
return tpz.msg.basic.REQUIRES_A_PET
end
return 0
end

function onItemUse(target)
local pet = target:getPet()
local totalHP = pet:getMaxHP()
pet:addHP(totalHP)
pet:messageBasic(tpz.msg.basic.RECOVERS_HP, 0, totalHP)
end
4 changes: 3 additions & 1 deletion scripts/globals/roe_records.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ local timedSchedule = {
{ 0, 4009, 4015, 4011, 4017, 4014}, -- Saturday
}
-- Load timetable for timed records
RoeParseTimed(timedSchedule)
if ENABLE_ROE_TIMED and ENABLE_ROE_TIMED > 0 then
RoeParseTimed(timedSchedule)
end

local defaults = {
check = checks.masterCheck, -- Check function should return true/false
Expand Down
1 change: 1 addition & 0 deletions scripts/globals/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ GOV_REWARD_ALLIANCE = 1 -- Allow Grounds of Valor rewards while being a member o

-- Records of Eminence
ENABLE_ROE = 1
ENABLE_ROE_TIMED = 1 -- Enable 4-hour timed records

-- TREASURE CASKETS
-- Retail droprate = 0.1 (10%) with no other effects active
Expand Down
8 changes: 4 additions & 4 deletions sql/item_usable.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1634,10 +1634,10 @@ INSERT INTO `item_usable` VALUES (5831,'lucid_elixir_ii',1,1,34,0,0,0,0,0);
INSERT INTO `item_usable` VALUES (5832,'flask_of_healing_mist',1,4,30,0,0,0,0,0);
INSERT INTO `item_usable` VALUES (5833,'flask_of_mana_mist',1,4,32,0,0,0,0,0);
INSERT INTO `item_usable` VALUES (5834,'pair_of_lucid_wings_i',1,4,0,0,0,0,0,0);
INSERT INTO `item_usable` VALUES (5835,'tube_of_healing_salve_i',1,4,0,0,0,0,0,0);
INSERT INTO `item_usable` VALUES (5836,'tube_of_healing_salve_ii',1,4,0,0,0,0,0,0);
INSERT INTO `item_usable` VALUES (5837,'tube_of_clear_salve_i',1,4,0,0,0,0,0,0);
INSERT INTO `item_usable` VALUES (5838,'tube_of_clear_salve_ii',1,4,0,0,0,0,0,0);
INSERT INTO `item_usable` VALUES (5835,'tube_of_healing_salve_i',1,1,0,0,0,0,0,0);
INSERT INTO `item_usable` VALUES (5836,'tube_of_healing_salve_ii',1,1,0,0,0,0,0,0);
INSERT INTO `item_usable` VALUES (5837,'tube_of_clear_salve_i',1,1,0,0,0,0,0,0);
INSERT INTO `item_usable` VALUES (5838,'tube_of_clear_salve_ii',1,1,0,0,0,0,0,0);
INSERT INTO `item_usable` VALUES (5839,'bottle_of_stalwarts_tonic',1,4,0,0,0,0,0,0);
INSERT INTO `item_usable` VALUES (5840,'bottle_of_stalwarts_gambir',1,4,0,0,0,0,0,0);
INSERT INTO `item_usable` VALUES (5841,'bottle_of_ascetics_tonic',1,4,0,0,0,0,0,0);
Expand Down
2 changes: 1 addition & 1 deletion src/common/sql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ int32 Sql_Keepalive(Sql_t* self)
uint32 timeout, ping_interval;

// set a default value first
timeout = 28800; // 8 hours
timeout = 7200; // 2 hours

// request the timeout value from the mysql server
Sql_GetTimeout(self, &timeout);
Expand Down
Loading

0 comments on commit e009425

Please sign in to comment.