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

Commit 6a03301

Browse files
committed
Merge branch 'feature/trust' into canary
# Conflicts: # src/map/navmesh.cpp
2 parents e009425 + e4b7474 commit 6a03301

File tree

31 files changed

+412
-128
lines changed

31 files changed

+412
-128
lines changed

CONTRIBUTING.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,30 @@ local quests = tpz.quest.id.sandoria
618618
```
619619
insert into table_name
620620
```
621+
#### Commenting in SQL
622+
Our SQL tables are big and confusing, and they are also modified by hand. It can be very helpful to leave _short_ comments on your additions and modifications to highlight what they are.
623+
624+
**Example**
625+
626+
Without a comment, this entry is not easily human-readable:
627+
628+
```sql
629+
INSERT INTO `mob_droplist` VALUES (504,0,0,1000,888,340);
630+
```
631+
632+
So we instead store it as:
633+
634+
```sql
635+
INSERT INTO `mob_droplist` VALUES (504,0,0,1000,888,340); -- (Colossal Calamari) seashell
636+
```
637+
638+
Conversely, `Combo` weaponskill doesn't need any additional comments because it has a name field:
639+
640+
```sql
641+
INSERT INTO `weapon_skills` VALUES (1,'combo',0x02020000000200000000000002000000000202000000,1,5,0,16,2000,5,1,8,0,0,0,0);
642+
```
643+
644+
The format of the comment isn't massively important, but it is preferred not to use ';' as a seperator in the middle of your comment. This is a little confusing, as it's the statement-terminator in SQL.
621645

622646
## SQL Migrations for Schema changes
623647

scripts/globals/abilities/assassins_charge.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,10 @@ end
1414

1515
function onUseAbility(player, target, ability)
1616
local merits = player:getMerit(tpz.merit.ASSASSINS_CHARGE)
17-
player:addStatusEffect(tpz.effect.ASSASSINS_CHARGE, merits - 5, 0, 60, player:getMod(tpz.mod.AUGMENTS_ASSASSINS_CHARGE), merits / 5)
17+
local crit = 0
18+
if player:getMod(tpz.mod.AUGMENTS_ASSASSINS_CHARGE) > 0 then
19+
crit = merits / 5
20+
end
21+
22+
player:addStatusEffect(tpz.effect.ASSASSINS_CHARGE, merits - 5, 0, 60, 0, crit)
1823
end

scripts/globals/abilities/devotion.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function onUseAbility(player, target, ability)
4141
-- printf("Devotion MP Healed: %d", healMP)
4242

4343
damageHP = utils.stoneskin(player, damageHP)
44-
player:takeDamage(damageHP)
44+
player:delHP(damageHP)
4545
target:addMP(healMP)
4646

4747
return healMP

scripts/globals/abilities/martyr.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function onUseAbility(player, target, ability)
4444
-- printf("Martyr Healed HP: %d", healHP)
4545

4646
damageHP = utils.stoneskin(player, damageHP)
47-
player:takeDamage(damageHP)
47+
player:delHP(damageHP)
4848
target:addHP(healHP)
4949

5050
return healHP

scripts/globals/effects/assassins_charge.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require("scripts/globals/status")
99
function onEffectGain(target, effect)
1010
target:addMod(tpz.mod.QUAD_ATTACK, effect:getPower())
1111
target:addMod(tpz.mod.TRIPLE_ATTACK, 100)
12-
if (effect:getSubType() > 0) then
12+
if (effect:getSubPower() > 0) then
1313
target:addMod(tpz.mod.CRITHITRATE, effect:getSubPower())
1414
end
1515
end

scripts/globals/keyitems.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ tpz.keyItem =
701701
MARBLE_BRIDGE_COASTER = 705,
702702
LAMP_LIGHTERS_MEMBERSHIP_CARD = 706,
703703
SHAFT_GATE_OPERATING_DIAL = 707,
704-
MYSTERIOUS_AMULET = 708,
704+
MYSTERIOUS_AMULET_PRISHE = 708,
705705
MIRE_INCENSE = 709,
706706
BRAND_OF_DAWN = 710,
707707
BRAND_OF_TWILIGHT = 711,

scripts/globals/weaponskills.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ function souleaterBonus(attacker, numhits)
497497
end
498498
hitscounted = hitscounted + 1
499499
end
500-
attacker:takeDamage(numhits*0.10*attacker:getHP())
500+
attacker:delHP(numhits*0.10*attacker:getHP())
501501
return damage
502502
else
503503
return 0

scripts/zones/AlTaieu/IDs.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ zones[tpz.zone.ALTAIEU] =
1919
QUASILUMIN_01 = 7365, -- This is Al'Taieu. The celestial capital overflowing with the blessings of Altana.
2020
NOTHING_OF_INTEREST = 7475, -- There is nothing of interest here.
2121
OMINOUS_SHADOW = 7476, -- An ominous shadow falls over you...
22+
AMULET_SHATTERED = 7497, -- The mysterious amulet held by <player> has shattered...
23+
LIGHT_STOLEN = 7498, -- The light of <mea/holla/dem> was stolen by Nag'molada...
24+
RETURN_AMULET_TO_PRISHE = 7523, -- You return the mysterious amulet to Prishe.
2225
HOMEPOINT_SET = 7564, -- Home point set!
2326
},
2427
mob =

scripts/zones/AlTaieu/Zone.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,21 @@ end
3838

3939
function onEventFinish(player, csid, option)
4040
if (csid == 1) then
41+
local copCraigLights = -- Nag'molada steals one random light
42+
{
43+
tpz.ki.LIGHT_OF_HOLLA,
44+
tpz.ki.LIGHT_OF_DEM,
45+
tpz.ki.LIGHT_OF_MEA
46+
}
4147
player:setCharVar("PromathiaStatus", 1)
4248
player:addKeyItem(tpz.ki.LIGHT_OF_ALTAIEU)
49+
player:messageSpecial(ID.text.AMULET_SHATTERED, tpz.ki.MYSTERIOUS_AMULET)
50+
player:messageSpecial(ID.text.LIGHT_STOLEN, copCraigLights[math.random(#copCraigLights)])
4351
player:messageSpecial(ID.text.KEYITEM_OBTAINED, tpz.ki.LIGHT_OF_ALTAIEU)
4452
player:addTitle(tpz.title.SEEKER_OF_THE_LIGHT)
4553
elseif (csid == 167) then
4654
player:setCharVar("PromathiaStatus", 1)
55+
player:delKeyItem(tpz.ki.MYSTERIOUS_AMULET_PRISHE)
56+
player:messageSpecial(ID.text.RETURN_AMULET_TO_PRISHE, tpz.ki.MYSTERIOUS_AMULET)
4757
end
4858
end

scripts/zones/Carpenters_Landing/npcs/Anguenet.lua

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,45 @@
44
-- Type: Adventurer's Assistant
55
-- !pos 214.672 -3.013 -527.561 2
66
-----------------------------------
7+
local ID = require("scripts/zones/Carpenters_Landing/IDs")
8+
require("scripts/globals/npc_util")
79

810
function onTrade(player, npc, trade)
11+
if
12+
player:getQuestStatus(SANDORIA, tpz.quest.id.sandoria.TEA_WITH_A_TONBERRY) == QUEST_ACCEPTED and
13+
player:getCharVar('TEA_WITH_A_TONBERRY_PROG') == 1 and
14+
npcUtil.tradeHas(trade, 1683)
15+
then
16+
player:startEvent(29)
17+
end
918
end
1019

1120
function onTrigger(player, npc)
12-
player:startEvent(21)
21+
local teaGinseng = player:getCharVar('TEA_WITH_A_TONBERRY_PROG')
22+
23+
if player:getQuestStatus(SANDORIA, tpz.quest.id.sandoria.TEA_WITH_A_TONBERRY) == QUEST_ACCEPTED then
24+
if teaGinseng == 0 then
25+
player:startEvent(27, 0, 1683)
26+
elseif teaGinseng == 1 then
27+
player:startEvent(28, 0, 1683)
28+
else
29+
player:startEvent(21)
30+
end
31+
else
32+
player:startEvent(21)
33+
end
1334
end
1435

1536
function onEventUpdate(player, csid, option)
1637
end
1738

1839
function onEventFinish(player, csid, option)
40+
if csid == 27 then
41+
player:setCharVar('TEA_WITH_A_TONBERRY_PROG', 1)
42+
elseif csid == 29 then
43+
player:tradeComplete()
44+
player:addKeyItem(tpz.keyItem.TONBERRY_BLACKBOARD)
45+
player:messageSpecial(ID.text.KEYITEM_OBTAINED, tpz.keyItem.TONBERRY_BLACKBOARD)
46+
player:setCharVar('TEA_WITH_A_TONBERRY_PROG', 2)
47+
end
1948
end

0 commit comments

Comments
 (0)