Skip to content

Commit 16bd03c

Browse files
committed
Merge branch 'release' into feature/trust
# Conflicts: # scripts/zones/Chateau_dOraguille/IDs.lua # scripts/zones/Heavens_Tower/IDs.lua # scripts/zones/Metalworks/IDs.lua # scripts/zones/Northern_San_dOria/IDs.lua # scripts/zones/Port_Bastok/IDs.lua # scripts/zones/Southern_San_dOria/IDs.lua # scripts/zones/Windurst_Walls/IDs.lua # scripts/zones/Windurst_Woods/IDs.lua # sql/item_basic.sql
2 parents 91b858e + a821b58 commit 16bd03c

File tree

685 files changed

+10273
-6218
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

685 files changed

+10273
-6218
lines changed

.github/workflows/analyse.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: analyse
2+
3+
on:
4+
workflow_dispatch: # Manual triggering from Actions > analyse > Run workflow
5+
6+
jobs:
7+
sonarcloud:
8+
name: "SonarCloud Scan"
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
with:
13+
fetch-depth: 0
14+
15+
- name: Install Dependencies
16+
run: |
17+
sudo apt-get update
18+
sudo apt-get install -y software-properties-common wget cmake libmariadb-dev-compat libluajit-5.1-dev libzmq3-dev zlib1g-dev libssl-dev
19+
20+
- name: Configure CMake
21+
run: |
22+
cmake .
23+
24+
- name: Download Sonar Build Wrapper
25+
run: |
26+
wget -c https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
27+
unzip build-wrapper-linux-x86.zip
28+
cp ./build-wrapper-linux-x86/* ./
29+
30+
- name: Build Wrapped Binaries
31+
run: |
32+
./build-wrapper-linux-x86-64 --out-dir . make -j $(nproc)
33+
34+
- name: Extract git info
35+
run: |
36+
GIT_TAG=`git describe --abbrev=0`
37+
echo "GIT_TAG=${GIT_TAG}" >> $GITHUB_ENV
38+
echo $GIT_TAG
39+
40+
GIT_BRANCH=`git branch --show-current`
41+
echo "GIT_BRANCH=${GIT_BRANCH}" >> $GITHUB_ENV
42+
echo $GIT_BRANCH
43+
44+
GIT_FULL_REPO_NAME=`git rev-parse --show-toplevel`
45+
GIT_REPO_NAME=`basename $GIT_FULL_REPO_NAME`
46+
echo "GIT_REPO_NAME=${GIT_REPO_NAME}" >> $GITHUB_ENV
47+
echo $GIT_REPO_NAME
48+
49+
- name: Setup Sonar
50+
uses: warchant/setup-sonar-scanner@v3
51+
52+
- name: Run Sonar Scanner
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
run: sonar-scanner
56+
-Dsonar.login=${{ secrets.SONAR_TOKEN }}
57+
-Dsonar.organization=${{ github.repository_owner }}
58+
-Dsonar.projectKey=${{ github.repository_owner }}_${{ env.GIT_REPO_NAME }}
59+
-Dsonar.branch.name=${{ env.GIT_BRANCH }}
60+
-Dsonar.projectVersion=${{ env.GIT_TAG }}
61+
-Dsonar.host.url=https://sonarcloud.io/
62+
-Dsonar.sources=src
63+
-Dsonar.exclusions=src/common/detour/**/*,src/common/fmt/**/*,src/common/lua/**/*,src/common/recast/**/*
64+
-Dsonar.cfamily.build-wrapper-output=.
65+
-Dsonar.cfamily.threads=2
66+
-Dsonar.cfamily.cache.enabled=false

CONTRIBUTING.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
**NOTICE: AS OF NOVEMBER 16TH, 2020, PROJECT TOPAZ IS ONLY ACCEPTING COMMUNITY PULL REQUESTS FOR CRITICAL CRASH FIXES, EXPLOIT FIXES, AND VERSION UPDATES. ANY PULL REQUEST FOR ANOTHER PURPOSE -- SUCH AS NEW CONTENT, REFACTORING, OR NON-VITAL FIXES -- WILL BE CLOSED WITHOUT COMMENT OR REVIEW.**
2+
3+
----
4+
15
# Issue Report Contributions:
26

37
* If an issue involves incorrect NPCs or text, please include your client version (type `/ver` in game)

conf/default/map.conf

+5
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,8 @@ msg_server_ip: 127.0.0.1
244244
#anticheat_enabled: 1
245245
#Set to 1 to completely disable auto-jailing offenders
246246
#anticheat_jail_disable: 0
247+
248+
# Gobbie Mystery Box settings
249+
daily_tally_amount: 10
250+
daily_tally_limit: 50000
251+

conf/default/version.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#Topaz Version Info
22

33
#Expected Client version (wrong version cannot log in)
4-
CLIENT_VER: 30201006_1
4+
CLIENT_VER: 30201103_1
55

66
#WE STRONGLY ADVISE AGAINST LOCKING THE SERVER TO OLDER VERSIONS. IT IS A UNIVERSALLY BAD IDEA.
77

scripts/commands/setweather.lua

+2-27
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
-- desc: Sets the current weather for the current zone.
44
---------------------------------------------------------------------------------------------------
55

6-
require("scripts/globals/weather")
6+
require("scripts/globals/world")
77

88
cmdprops =
99
{
@@ -17,31 +17,6 @@ function error(player, msg)
1717
end
1818

1919
function onTrigger(player, weather)
20-
21-
local weatherList =
22-
{
23-
["none"] = 0,
24-
["sunshine"] = 1,
25-
["clouds"] = 2,
26-
["fog"] = 3,
27-
["hot spell"] = 4,
28-
["heat wave"] = 5,
29-
["rain"] = 6,
30-
["squall"] = 7,
31-
["dust storm"] = 8,
32-
["sand storm"] = 9,
33-
["wind"] = 10,
34-
["gales"] = 11,
35-
["snow"] = 12,
36-
["blizzards"] = 13,
37-
["thunder"] = 14,
38-
["thunderstorms"] = 15,
39-
["auroras"] = 16,
40-
["stellar glare"] = 17,
41-
["gloom"] = 18,
42-
["darkness"] = 19
43-
}
44-
4520
-- validate weather
4621
if (weather == nil) then
4722
error(player, "You must supply a weather ID.")
@@ -55,7 +30,7 @@ function onTrigger(player, weather)
5530

5631
-- invert weather table
5732
local weatherByNum={}
58-
for k, v in pairs(weatherList) do
33+
for k, v in pairs(tpz.weather) do
5934
weatherByNum[v]=k
6035
end
6136

scripts/globals/abilities/call_beast.lua

+5
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,9 @@ end
2525
function onUseAbility(player, target, ability)
2626
tpz.pet.spawnPet(player, player:getWeaponSubSkillType(tpz.slot.AMMO))
2727
player:removeAmmo()
28+
-- Briefly put the recastId for READY/SIC (102) into a recast state to
29+
-- toggle charges accumulating. 102 is the shared recast id for all jug
30+
-- pet abilities and for SIC when using a charmed mob.
31+
-- see sql/abilities_charges and sql_abilities
32+
player:addRecast(tpz.recast.ABILITY, 102, 1)
2833
end

scripts/globals/abilities/deactivate.lua

+5
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,10 @@ function onAbilityCheck(player, target, ability)
1414
end
1515

1616
function onUseAbility(player, target, ability)
17+
-- Reset the Activate ability.
18+
local pet = player:getPet()
19+
if pet:getHP() == pet:getMaxHP() then
20+
player:resetRecast(tpz.recast.ABILITY, 205) -- activate
21+
end
1722
target:despawnPet()
1823
end

scripts/globals/abilities/elemental_siphon.lua

+3-15
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,9 @@ function onAbilityCheck(player, target, ability)
2222
end
2323
end
2424

25-
function onUseAbility(player, target, ability)
26-
local spiritEle = player:getPetID() + 1 -- get the spirit's ID, then make it line up with element value for the day order.
27-
-- pet order: fire, ice, air, earth, thunder, water, light, dark
28-
-- day order: fire, earth, water, wind, ice, thunder, light, dark
29-
if (spiritEle == 2) then
30-
spiritEle = 5
31-
elseif (spiritEle == 3) then
32-
spiritEle = 4
33-
elseif (spiritEle == 4) then
34-
spiritEle = 2
35-
elseif (spiritEle == 5) then
36-
spiritEle = 6
37-
elseif (spiritEle == 6) then
38-
spiritEle = 3
39-
end
25+
function onUseAbility(player,target,ability)
26+
local spiritEle = player:getPetID() + 1 -- get the spirit's ID, it is already aligned in proper element order
27+
-- element order: fire, ice, wind, earth, thunder, water, light, dark
4028

4129
local pEquipMods = player:getMod(tpz.mod.ENHANCES_ELEMENTAL_SIPHON)
4230
local basePower = player:getSkillLevel(tpz.skill.SUMMONING_MAGIC) + pEquipMods - 50

scripts/globals/abilities/pets/attachments/volt_gun.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ require("scripts/globals/status")
66

77
function onEquip(pet)
88
local skill = math.max(pet:getSkillLevel(tpz.skill.AUTOMATON_MELEE), pet:getSkillLevel(tpz.skill.AUTOMATON_RANGED), pet:getSkillLevel(tpz.skill.AUTOMATON_MAGIC))
9-
pet:addMod(tpz.mod.ENSPELL, 6)
9+
pet:addMod(tpz.mod.ENSPELL, tpz.magic.element.THUNDER)
1010
pet:addMod(tpz.mod.ENSPELL_DMG, skill * 0.1)
1111
pet:addMod(tpz.mod.ENSPELL_CHANCE, 20)
1212
end
1313

1414
function onUnequip(pet)
15-
pet:delMod(tpz.mod.ENSPELL, 6)
15+
pet:delMod(tpz.mod.ENSPELL, tpz.magic.element.THUNDER)
1616
pet:delMod(tpz.mod.ENSPELL_DMG, pet:getMod(tpz.mod.ENSPELL_DMG))
1717
pet:delMod(tpz.mod.ENSPELL_CHANCE, 20)
1818
end

scripts/globals/abyssea.lua

+17-15
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
-- Abyssea functions, vars, tables
33
-- DO NOT mess with the order
44
-- or change things to "elseif"!
5+
6+
-- TODO: Change these to use enums!
57
-----------------------------------
68
require("scripts/globals/keyitems")
9+
require("scripts/globals/magic")
710
require("scripts/globals/zone")
8-
-----------------------------------
911

1012
tpz = tpz or {}
1113
tpz.abyssea = tpz.abyssea or {}
@@ -36,21 +38,21 @@ local redWeakness =
3638
local yellowWeakness =
3739
{
3840
--fire
39-
[0] = { 146, 147, 176, 204, 591, 321, 455 },
40-
--earth
41-
[1] = { 161, 162, 191, 210, 555, 330, 458 },
42-
--water
43-
[2] = { 171, 172, 201, 515, 336, 454 },
44-
--wind
45-
[3] = { 156, 157, 186, 208, 534, 327, 457 },
41+
[tpz.magic.element.FIRE] = { 146, 147, 176, 204, 591, 321, 455 },
4642
--ice
47-
[4] = { 151, 152, 181, 206, 531, 324, 456 },
43+
[tpz.magic.element.ICE] = { 151, 152, 181, 206, 531, 324, 456 },
44+
--wind
45+
[tpz.magic.element.WIND] = { 156, 157, 186, 208, 534, 327, 457 },
46+
--earth
47+
[tpz.magic.element.EARTH] = { 161, 162, 191, 210, 555, 330, 458 },
4848
--ltng
49-
[5] = { 166, 167, 196, 212, 644, 333, 459 },
49+
[tpz.magic.element.THUNDER] = { 166, 167, 196, 212, 644, 333, 459 },
50+
--water
51+
[tpz.magic.element.WATER] = { 171, 172, 201, 515, 336, 454 },
5052
--light
51-
[6] = { 29, 30, 38, 39, 21, 112, 565, 461 },
53+
[tpz.magic.element.LIGHT] = { 29, 30, 38, 39, 21, 112, 565, 461 },
5254
--dark
53-
[7] = { 247, 245, 231, 260, 557, 348, 460 }
55+
[tpz.magic.element.DARK] = { 247, 245, 231, 260, 557, 348, 460 }
5456
}
5557

5658
local blueWeakness =
@@ -265,12 +267,12 @@ tpz.abyssea.getDemiluneAbyssite = function(player)
265267
end
266268

267269
tpz.abyssea.getNewYellowWeakness = function(mob)
268-
local day = VanadielDayElement()
270+
local day = VanadielDayOfTheWeek()
269271
local weakness = math.random(day - 1, day + 1)
270272

271273
if weakness < 0 then weakness = 7 elseif weakness > 7 then weakness = 0 end
272-
273-
return yellowWeakness[weakness][math.random(#yellowWeakness[weakness])]
274+
local element = tpz.magic.dayElement[weakness]
275+
return yellowWeakness[element][math.random(#yellowWeakness[element])]
274276
end
275277

276278
tpz.abyssea.getNewRedWeakness = function(mob)

scripts/globals/bcnm.lua

+8-7
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ local battlefields = {
2222
{ 0, 640, 0}, -- Flames of the Dead (PM5-3 U3)
2323
-- { 1, 641, 0}, -- Follow the White Rabbit (ENM)
2424
-- { 2, 642, 0}, -- When Hell Freezes Over (ENM)
25-
{ 3, 643, 0}, -- Brothers (ENM) -- TODO: Chthonian Ray mobskill
25+
-- { 3, 643, 0}, -- Brothers (ENM) -- TODO: Chthonian Ray mobskill
2626
-- { 4, 644, 0}, -- Holy Cow (ENM)
2727
-- { 5, ?, 3454}, -- Taurassic Park (HKC30)
2828
},
@@ -31,8 +31,8 @@ local battlefields = {
3131
{
3232
{ 0, 672, 0}, -- Head Wind (PM5-3 U2)
3333
-- { 1, 673, 0}, -- Like the Wind (ENM) -- TODO: mob constantly runs during battle
34-
-- { 2, 674, 0}, -- Sheep in Antlion's Clothing (ENM)
35-
-- { 3, 675, 0}, -- Shell We Dance? (ENM)
34+
{ 2, 674, 0}, -- Sheep in Antlion's Clothing (ENM)
35+
-- { 3, 675, 0}, -- Shell We Dance? (ENM) -- TODO: Needs testing, cleanup, and mixin work
3636
-- { 4, 676, 0}, -- Totentanz (ENM)
3737
-- { 5, 677, 0}, -- Tango with a Tracker (Quest)
3838
-- { 6, 678, 0}, -- Requiem of Sin (Quest)
@@ -183,7 +183,7 @@ local battlefields = {
183183
{
184184
-- { 0, 1120, 0}, -- Tough Nut to Crack (ISNM)
185185
-- { 1, 1121, 0}, -- Happy Caster (ISNM)
186-
-- { 2, 1122, 0}, -- Omens (Quest)
186+
{ 2, 1122, 0}, -- Omens (BLU AF2)
187187
{ 3, 1123, 2333}, -- Achieving True Power (PUP LB5)
188188
{ 4, 1124, 0}, -- Shield of Diplomacy (TOAU22)
189189
},
@@ -287,10 +287,10 @@ local battlefields = {
287287
{11, 75, 1552}, -- Grove Guardians (BS30)
288288
-- {12, 76, 1553}, -- The Hills are Alive (KS99) -- TODO: Tartaruga Gigante is not coded
289289
-- {13, 77, 1131}, -- Royal Jelly (BS40) -- TODO: all combat mechanics, loot
290-
{14, 78, 1177}, -- The Final Bout (BS50) -- TODO: mobskills Big Blow and Counterstance
290+
-- {14, 78, 1177}, -- The Final Bout (BS50) -- TODO: mobskills Big Blow and Counterstance
291291
{15, 79, 1130}, -- Up in Arms (BS60)
292292
-- {16, 80, 1175}, -- Copycat (KS30)
293-
-- {17, 81, 1178}, -- Operation Desert Swarm (KS30) -- TODO: Wild Rage gets stronger as they die. Sync TP moves. Self-bind/stun. Build sleep resistance.
293+
-- {17, 81, 1178}, -- Operation Desert Swarm (KS30) -- TODO: Wild Rage gets stronger as they die. Build sleep resistance. Testing.
294294
-- {18, 82, 1180}, -- Prehistoric Pigeons (KS30) -- TODO: Build resistance to sleep quickly. When one dies, remaining ones become more powerful.
295295
-- {19, 83, 3351}, -- The Palborough Project (KC30)
296296
-- {20, 84, 3352}, -- Shell Shocked (KC50)
@@ -317,7 +317,7 @@ local battlefields = {
317317
{ 8, 104, 1552}, -- Creeping Doom (BS30)
318318
{ 9, 105, 1551}, -- Charming Trio (BS20)
319319
{10, 106, 1552}, -- Harem Scarem (BS30)
320-
-- {11, 107, 1553}, -- Early Bird Catches the Wyrm (KS99) -- TODO: Wyrm is not coded at all
320+
{11, 107, 1553}, -- Early Bird Catches the Wyrm (KS99)
321321
{12, 108, 1131}, -- Royal Succession (BS40)
322322
{13, 109, 1177}, -- Rapid Raptors (BS50)
323323
{14, 110, 1130}, -- Wild Wild Whiskers (BS60) -- TODO: should use petrifactive breath more often than other mobskill. Message before spellcasting.
@@ -669,6 +669,7 @@ function checkReqs(player, npc, bfid, registrant)
669669
[1090] = function() return ( player:hasKeyItem(tpz.ki.TOGGLE_SWITCH) ) end, -- Quest: Puppetmaster Blues
670670
[1091] = function() return ( mjob == tpz.job.COR and mlvl >= 66 ) end, -- Quest: Breaking the Bonds of Fate (COR LB5)
671671
[1092] = function() return ( toau == mi.toau.LEGACY_OF_THE_LOST ) end, -- TOAU35: Legacy of the Lost
672+
[1122] = function() return ( player:getQuestStatus(AHT_URHGAN,tpz.quest.id.ahtUrhgan.OMENS) == QUEST_ACCEPTED and player:getCharVar('OmensProgress') == 1 ) end, -- Quest: Omens (BLU AF Quest 2)
672673
[1123] = function() return ( mjob == tpz.job.PUP and mlvl >= 66 ) end, -- Quest: Achieving True Power (PUP LB5)
673674
[1124] = function() return ( toau == mi.toau.SHIELD_OF_DIPLOMACY and toauStat == 2 ) end, -- TOAU22: Shield of Diplomacy
674675
[1154] = function() return ( mjob == tpz.job.BLU and mlvl >= 66 ) end, -- Quest: The Beast Within (BLU LB5)

scripts/globals/beastmentreasure.lua

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
require('scripts/globals/keyitems')
66
require('scripts/globals/quests')
77
require('scripts/globals/status')
8-
require('scripts/globals/weather')
98
require('scripts/globals/zone')
109
------------------------------------
1110
tpz = tpz or {}
@@ -240,7 +239,7 @@ tpz.beastmentreasure.updatePeddlestox = function(zone, peddlestox)
240239
only need to enable her on the appropriate day and disable her on the following day. ]]--
241240
local peddlestox = GetNPCByID(peddlestox)
242241

243-
if zoneData[zone].day == VanadielDayElement() then
242+
if zoneData[zone].day == VanadielDayOfTheWeek() then
244243
peddlestox:setStatus(tpz.status.NORMAL)
245244
elseif peddlestox:getStatus() == tpz.status.NORMAL then
246245
--[[

scripts/globals/bluemagic.lua

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ TPMOD_CRITICAL = 1
77
TPMOD_DAMAGE = 2
88
TPMOD_ACC = 3
99
TPMOD_ATTACK = 4
10+
TPMOD_DURATION = 5
1011

1112
-- The SC the spell makes
1213
SC_IMPACTION = 0
@@ -230,8 +231,9 @@ function BlueFinalAdjustments(caster, target, spell, dmg, params)
230231
-- handling stoneskin
231232
dmg = utils.stoneskin(target, dmg)
232233

234+
local attackType = params.attackType or tpz.attackType.NONE
233235
local damageType = params.damageType or tpz.damageType.NONE
234-
target:takeSpellDamage(caster, spell, dmg, tpz.attackType.PHYSICAL, damageType)
236+
target:takeSpellDamage(caster, spell, dmg, attackType, damageType)
235237
target:updateEnmityFromDamage(caster, dmg)
236238
target:handleAfflatusMiseryDamage(dmg)
237239
-- TP has already been dealt with.

scripts/globals/chocobo_digging.lua

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
-- https://www.bg-wiki.com/bg/Category:Chocobo_Digging
55
-----------------------------------
66
require("scripts/globals/settings")
7-
require("scripts/globals/weather")
87
require("scripts/globals/status")
98
require("scripts/globals/utils")
109
require("scripts/globals/zone")
@@ -935,7 +934,7 @@ local function getChocoboDiggingItem(player)
935934
end
936935
elseif itemId == 1255 then
937936
if weather >= tpz.weather.CLOUDS and moon >= 10 and moon <= 40 and player:getSkillRank(tpz.skill.DIG) >= 7 then
938-
itemId = oreMap[VanadielDayElement()]
937+
itemId = oreMap[VanadielDayOfTheWeek()]
939938
else
940939
itemId = 0
941940
end

scripts/globals/effects/blood_weapon.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require("scripts/globals/status")
77
-----------------------------------
88

99
function onEffectGain(target, effect)
10-
target:addMod(tpz.mod.ENSPELL, 16)
10+
target:addMod(tpz.mod.ENSPELL, 17)
1111
target:addMod(tpz.mod.ENSPELL_DMG, 1)
1212
end
1313

scripts/globals/effects/enaero.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require("scripts/globals/status")
77
-----------------------------------
88

99
function onEffectGain(target, effect)
10-
target:addMod(tpz.mod.ENSPELL, 4)
10+
target:addMod(tpz.mod.ENSPELL, tpz.magic.element.WIND)
1111
target:addMod(tpz.mod.ENSPELL_DMG, effect:getPower())
1212
end
1313

0 commit comments

Comments
 (0)