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

Commit 8bace25

Browse files
committed
Merge branch 'feature/trust' into canary
# Conflicts: # scripts/commands/addalltrusts.lua # scripts/zones/Chateau_dOraguille/npcs/Curilla.lua # src/map/packets/message_basic.h # win32/vcxproj/topaz_game.vcxproj.filters
2 parents e5be483 + 1e63855 commit 8bace25

32 files changed

+546
-135
lines changed

scripts/commands/addalltrusts.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ function onTrigger(player, target)
2020
896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920,
2121
921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945,
2222
946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970,
23-
971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 1004, 1005, 1006, 1007, 1008, 1009,
24-
1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019
23+
971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995,
24+
996, 997, 998, 999,
25+
1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019,
2526
}
2627

2728
-- validate target

scripts/globals/gambits.lua

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@ ai = ai or {}
1111
-- Target
1212
ai.target =
1313
{
14-
SELF = 0,
15-
PARTY = 1,
16-
TARGET = 2,
17-
MASTER = 3,
18-
TANK = 4,
14+
SELF = 0,
15+
PARTY = 1,
16+
TARGET = 2,
17+
MASTER = 3,
18+
TANK = 4,
19+
MELEE = 5,
20+
RANGED = 6,
21+
CASTER = 7,
22+
TOP_ENMITY = 8,
1923
}
2024
ai.t = ai.target
2125

@@ -70,7 +74,7 @@ ai.select =
7074
ai.s = ai.select
7175

7276
-- TP Move Trigger
73-
ai.tp =
77+
ai.tp =
7478
{
7579
ASAP = 0,
7680
RANDOM = 1,

scripts/globals/msg.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,8 @@ tpz.msg.basic =
330330
ROE_BONUS_ITEM_PLURAL = 709, -- As a special bonus for your valiant efforts, you have been awarded the following: <itemid> x<amount>!
331331

332332
-- TRUST & ALTER EGO
333-
TRUST_NO_CAST_TRUST = 700, -- You are unable to use Trust magic at this time.
334-
TRUST_NO_CALL_AE = 717, -- You cannot call forth alter egos here.
333+
TRUST_NO_CAST_TRUST = 700, -- You are unable to use Trust magic at this time.
334+
TRUST_NO_CALL_AE = 717, -- You cannot call forth alter egos here.
335335
}
336336

337337
------------------------------------

scripts/globals/spells/trust/ajido-marujido.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ require("scripts/globals/status")
77
require("scripts/globals/trust")
88
-----------------------------------------
99

10+
local message_page_offset = 8
11+
1012
function onMagicCastingCheck(caster, target, spell)
1113
return tpz.trust.canCast(caster, spell)
1214
end
@@ -16,7 +18,7 @@ function onSpellCast(caster, target, spell)
1618
end
1719

1820
function onMobSpawn(mob)
19-
tpz.trust.teamworkMessage(mob, {
21+
tpz.trust.teamworkMessage(mob, message_page_offset, {
2022
[tpz.magic.spell.SHANTOTTO] = tpz.trust.message_offset.TEAMWORK_1,
2123
[tpz.magic.spell.STAR_SIBYL] = tpz.trust.message_offset.TEAMWORK_2,
2224
[tpz.magic.spell.KORU_MORU] = tpz.trust.message_offset.TEAMWORK_3,
@@ -38,9 +40,9 @@ function onMobSpawn(mob)
3840
end
3941

4042
function onMobDespawn(mob)
41-
tpz.trust.message(mob, tpz.trust.message_offset.DESPAWN)
43+
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DESPAWN)
4244
end
4345

4446
function onMobDeath(mob)
45-
tpz.trust.message(mob, tpz.trust.message_offset.DEATH)
47+
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DEATH)
4648
end

scripts/globals/spells/trust/ayame.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ require("scripts/globals/trust")
99
require("scripts/globals/weaponskillids")
1010
-----------------------------------------
1111

12+
local message_page_offset = 4
13+
1214
function onMagicCastingCheck(caster, target, spell)
1315
return tpz.trust.canCast(caster, spell, tpz.magic.spell.AYAME_UC)
1416
end
@@ -18,7 +20,7 @@ function onSpellCast(caster, target, spell)
1820
end
1921

2022
function onMobSpawn(mob)
21-
tpz.trust.teamworkMessage(mob, {
23+
tpz.trust.teamworkMessage(mob, message_page_offset, {
2224
[tpz.magic.spell.NAJI] = tpz.trust.message_offset.TEAMWORK_1,
2325
[tpz.magic.spell.GILGAMESH] = tpz.trust.message_offset.TEAMWORK_2,
2426
})
@@ -51,9 +53,9 @@ function onMobSpawn(mob)
5153
end
5254

5355
function onMobDespawn(mob)
54-
tpz.trust.message(mob, tpz.trust.message_offset.DESPAWN)
56+
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DESPAWN)
5557
end
5658

5759
function onMobDeath(mob)
58-
tpz.trust.message(mob, tpz.trust.message_offset.DEATH)
60+
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DEATH)
5961
end

scripts/globals/spells/trust/curilla.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ require("scripts/globals/trust")
99
require("scripts/globals/weaponskillids")
1010
-----------------------------------------
1111

12+
local message_page_offset = 6
13+
1214
function onMagicCastingCheck(caster, target, spell)
1315
return tpz.trust.canCast(caster, spell)
1416
end
@@ -18,7 +20,7 @@ function onSpellCast(caster, target, spell)
1820
end
1921

2022
function onMobSpawn(mob)
21-
tpz.trust.teamworkMessage(mob, {
23+
tpz.trust.teamworkMessage(mob, message_page_offset, {
2224
[tpz.magic.spell.TRION] = tpz.trust.message_offset.TEAMWORK_1,
2325
[tpz.magic.spell.RAINEMARD] = tpz.trust.message_offset.TEAMWORK_2,
2426
[tpz.magic.spell.RAHAL] = tpz.trust.message_offset.TEAMWORK_3,
@@ -36,9 +38,9 @@ function onMobSpawn(mob)
3638
end
3739

3840
function onMobDespawn(mob)
39-
tpz.trust.message(mob, tpz.trust.message_offset.DESPAWN)
41+
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DESPAWN)
4042
end
4143

4244
function onMobDeath(mob)
43-
tpz.trust.message(mob, tpz.trust.message_offset.DEATH)
45+
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DEATH)
4446
end

scripts/globals/spells/trust/excenmille.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ require("scripts/globals/weaponskillids")
1010
require("scripts/globals/zone")
1111
-----------------------------------------
1212

13+
local message_page_offset = 3
14+
1315
function onMagicCastingCheck(caster, target, spell)
1416
return tpz.trust.canCast(caster, spell, tpz.magic.spell.EXCENMILLE_S)
1517
end
@@ -26,7 +28,7 @@ function onSpellCast(caster, target, spell)
2628
end
2729

2830
function onMobSpawn(mob)
29-
tpz.trust.teamworkMessage(mob, {
31+
tpz.trust.teamworkMessage(mob, message_page_offset, {
3032
[tpz.magic.spell.RAHAL] = tpz.trust.message_offset.TEAMWORK_1,
3133
})
3234

@@ -43,9 +45,9 @@ function onMobSpawn(mob)
4345
end
4446

4547
function onMobDespawn(mob)
46-
tpz.trust.message(mob, tpz.trust.message_offset.DESPAWN)
48+
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DESPAWN)
4749
end
4850

4951
function onMobDeath(mob)
50-
tpz.trust.message(mob, tpz.trust.message_offset.DEATH)
52+
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DEATH)
5153
end

scripts/globals/spells/trust/iron_eater.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ require("scripts/globals/trust")
99
require("scripts/globals/weaponskillids")
1010
-----------------------------------------
1111

12+
local message_page_offset = 21
13+
1214
function onMagicCastingCheck(caster, target, spell)
1315
return tpz.trust.canCast(caster, spell)
1416
end
@@ -18,7 +20,7 @@ function onSpellCast(caster, target, spell)
1820
end
1921

2022
function onMobSpawn(mob)
21-
tpz.trust.teamworkMessage(mob, {
23+
tpz.trust.teamworkMessage(mob, message_page_offset, {
2224
[tpz.magic.spell.NAJI] = tpz.trust.message_offset.TEAMWORK_1,
2325
})
2426

@@ -27,9 +29,9 @@ function onMobSpawn(mob)
2729
end
2830

2931
function onMobDespawn(mob)
30-
tpz.trust.message(mob, tpz.trust.message_offset.DESPAWN)
32+
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DESPAWN)
3133
end
3234

3335
function onMobDeath(mob)
34-
tpz.trust.message(mob, tpz.trust.message_offset.DEATH)
36+
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DEATH)
3537
end
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,58 @@
11
-----------------------------------------
22
-- Trust: Koru-Moru
33
-----------------------------------------
4+
require("scripts/globals/ability")
5+
require("scripts/globals/gambits")
6+
require("scripts/globals/magic")
7+
require("scripts/globals/status")
48
require("scripts/globals/trust")
9+
require("scripts/globals/utils")
510
-----------------------------------------
611

12+
local message_page_offset = 57
13+
714
function onMagicCastingCheck(caster, target, spell)
815
return tpz.trust.canCast(caster, spell)
916
end
1017

1118
function onSpellCast(caster, target, spell)
1219
return tpz.trust.spawn(caster, spell)
1320
end
21+
22+
function onMobSpawn(mob)
23+
tpz.trust.teamworkMessage(mob, message_page_offset, {
24+
[tpz.magic.spell.SHANTOTTO] = tpz.trust.message_offset.TEAMWORK_1,
25+
[tpz.magic.spell.SHANTOTTO_II] = tpz.trust.message_offset.TEAMWORK_1,
26+
[tpz.magic.spell.AJIDO_MARUJIDO] = tpz.trust.message_offset.TEAMWORK_2,
27+
})
28+
29+
mob:addSimpleGambit(ai.t.SELF, ai.c.MPP_LT, 5,
30+
ai.r.JA, ai.s.SPECIFIC, tpz.ja.CONVERT)
31+
32+
mob:addSimpleGambit(ai.t.PARTY, ai.c.HPP_LT, 50, ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.CURE)
33+
34+
mob:addSimpleGambit(ai.t.MELEE, ai.c.NOT_STATUS, tpz.effect.HASTE, ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.HASTE)
35+
mob:addSimpleGambit(ai.t.CASTER, ai.c.NOT_STATUS, tpz.effect.REFRESH, ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.REFRESH)
36+
mob:addSimpleGambit(ai.t.RANGED, ai.c.NOT_STATUS, tpz.effect.FLURRY, ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.FLURRY)
37+
mob:addSimpleGambit(ai.t.TOP_ENMITY, ai.c.NOT_STATUS, tpz.effect.PHALANX, ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.PHALANX)
38+
39+
mob:addSimpleGambit(ai.t.TARGET, ai.c.STATUS_FLAG, tpz.effectFlag.DISPELABLE, ai.r.MA, ai.s.SPECIFIC, tpz.magic.spell.DISPEL)
40+
41+
mob:addSimpleGambit(ai.t.TARGET, ai.c.NOT_STATUS, tpz.effect.DIA, ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.DIA, 60)
42+
mob:addSimpleGambit(ai.t.TARGET, ai.c.NOT_STATUS, tpz.effect.SLOW, ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.SLOW, 60)
43+
mob:addSimpleGambit(ai.t.TARGET, ai.c.NOT_STATUS, tpz.effect.EVASION_DOWN, ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.DISTRACT, 60)
44+
mob:addSimpleGambit(ai.t.TARGET, ai.c.NOT_STATUS, tpz.effect.DIA, ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.DIA, 60)
45+
46+
mob:addSimpleGambit(ai.t.PARTY, ai.c.NOT_STATUS, tpz.effect.PROTECT, ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.PROTECT)
47+
mob:addSimpleGambit(ai.t.PARTY, ai.c.NOT_STATUS, tpz.effect.SHELL, ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.SHELL)
48+
49+
mob:SetAutoAttackEnabled(false)
50+
end
51+
52+
function onMobDespawn(mob)
53+
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DESPAWN)
54+
end
55+
56+
function onMobDeath(mob)
57+
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DEATH)
58+
end

scripts/globals/spells/trust/kupipi.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ require("scripts/globals/weaponskillids")
1010
require("scripts/globals/zone")
1111
-----------------------------------------
1212

13+
local message_page_offset = 2
1314

1415
function onMagicCastingCheck(caster, target, spell)
1516
return tpz.trust.canCast(caster, spell)
@@ -27,7 +28,7 @@ function onSpellCast(caster, target, spell)
2728
end
2829

2930
function onMobSpawn(mob)
30-
tpz.trust.teamworkMessage(mob, {
31+
tpz.trust.teamworkMessage(mob, message_page_offset, {
3132
[tpz.magic.spell.SHANTOTTO] = tpz.trust.message_offset.TEAMWORK_1,
3233
[tpz.magic.spell.STAR_SIBYL] = tpz.trust.message_offset.TEAMWORK_2,
3334
})
@@ -61,9 +62,9 @@ function onMobSpawn(mob)
6162
end
6263

6364
function onMobDespawn(mob)
64-
tpz.trust.message(mob, tpz.trust.message_offset.DESPAWN)
65+
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DESPAWN)
6566
end
6667

6768
function onMobDeath(mob)
68-
tpz.trust.message(mob, tpz.trust.message_offset.DEATH)
69+
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DEATH)
6970
end

0 commit comments

Comments
 (0)