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
# Conflicts:
#	scripts/commands/addalltrusts.lua
#	scripts/zones/Chateau_dOraguille/npcs/Curilla.lua
#	src/map/packets/message_basic.h
#	win32/vcxproj/topaz_game.vcxproj.filters
  • Loading branch information
zach2good committed Oct 10, 2020
2 parents e5be483 + 1e63855 commit 8bace25
Show file tree
Hide file tree
Showing 32 changed files with 546 additions and 135 deletions.
5 changes: 3 additions & 2 deletions scripts/commands/addalltrusts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ function onTrigger(player, target)
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,
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,
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,
971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 1004, 1005, 1006, 1007, 1008, 1009,
1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019
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,
996, 997, 998, 999,
1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019,
}

-- validate target
Expand Down
16 changes: 10 additions & 6 deletions scripts/globals/gambits.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ ai = ai or {}
-- Target
ai.target =
{
SELF = 0,
PARTY = 1,
TARGET = 2,
MASTER = 3,
TANK = 4,
SELF = 0,
PARTY = 1,
TARGET = 2,
MASTER = 3,
TANK = 4,
MELEE = 5,
RANGED = 6,
CASTER = 7,
TOP_ENMITY = 8,
}
ai.t = ai.target

Expand Down Expand Up @@ -70,7 +74,7 @@ ai.select =
ai.s = ai.select

-- TP Move Trigger
ai.tp =
ai.tp =
{
ASAP = 0,
RANDOM = 1,
Expand Down
4 changes: 2 additions & 2 deletions scripts/globals/msg.lua
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ tpz.msg.basic =
ROE_BONUS_ITEM_PLURAL = 709, -- As a special bonus for your valiant efforts, you have been awarded the following: <itemid> x<amount>!

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

------------------------------------
Expand Down
8 changes: 5 additions & 3 deletions scripts/globals/spells/trust/ajido-marujido.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ require("scripts/globals/status")
require("scripts/globals/trust")
-----------------------------------------

local message_page_offset = 8

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell)
end
Expand All @@ -16,7 +18,7 @@ function onSpellCast(caster, target, spell)
end

function onMobSpawn(mob)
tpz.trust.teamworkMessage(mob, {
tpz.trust.teamworkMessage(mob, message_page_offset, {
[tpz.magic.spell.SHANTOTTO] = tpz.trust.message_offset.TEAMWORK_1,
[tpz.magic.spell.STAR_SIBYL] = tpz.trust.message_offset.TEAMWORK_2,
[tpz.magic.spell.KORU_MORU] = tpz.trust.message_offset.TEAMWORK_3,
Expand All @@ -38,9 +40,9 @@ function onMobSpawn(mob)
end

function onMobDespawn(mob)
tpz.trust.message(mob, tpz.trust.message_offset.DESPAWN)
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DESPAWN)
end

function onMobDeath(mob)
tpz.trust.message(mob, tpz.trust.message_offset.DEATH)
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DEATH)
end
8 changes: 5 additions & 3 deletions scripts/globals/spells/trust/ayame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ require("scripts/globals/trust")
require("scripts/globals/weaponskillids")
-----------------------------------------

local message_page_offset = 4

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell, tpz.magic.spell.AYAME_UC)
end
Expand All @@ -18,7 +20,7 @@ function onSpellCast(caster, target, spell)
end

function onMobSpawn(mob)
tpz.trust.teamworkMessage(mob, {
tpz.trust.teamworkMessage(mob, message_page_offset, {
[tpz.magic.spell.NAJI] = tpz.trust.message_offset.TEAMWORK_1,
[tpz.magic.spell.GILGAMESH] = tpz.trust.message_offset.TEAMWORK_2,
})
Expand Down Expand Up @@ -51,9 +53,9 @@ function onMobSpawn(mob)
end

function onMobDespawn(mob)
tpz.trust.message(mob, tpz.trust.message_offset.DESPAWN)
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DESPAWN)
end

function onMobDeath(mob)
tpz.trust.message(mob, tpz.trust.message_offset.DEATH)
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DEATH)
end
8 changes: 5 additions & 3 deletions scripts/globals/spells/trust/curilla.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ require("scripts/globals/trust")
require("scripts/globals/weaponskillids")
-----------------------------------------

local message_page_offset = 6

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell)
end
Expand All @@ -18,7 +20,7 @@ function onSpellCast(caster, target, spell)
end

function onMobSpawn(mob)
tpz.trust.teamworkMessage(mob, {
tpz.trust.teamworkMessage(mob, message_page_offset, {
[tpz.magic.spell.TRION] = tpz.trust.message_offset.TEAMWORK_1,
[tpz.magic.spell.RAINEMARD] = tpz.trust.message_offset.TEAMWORK_2,
[tpz.magic.spell.RAHAL] = tpz.trust.message_offset.TEAMWORK_3,
Expand All @@ -36,9 +38,9 @@ function onMobSpawn(mob)
end

function onMobDespawn(mob)
tpz.trust.message(mob, tpz.trust.message_offset.DESPAWN)
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DESPAWN)
end

function onMobDeath(mob)
tpz.trust.message(mob, tpz.trust.message_offset.DEATH)
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DEATH)
end
8 changes: 5 additions & 3 deletions scripts/globals/spells/trust/excenmille.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ require("scripts/globals/weaponskillids")
require("scripts/globals/zone")
-----------------------------------------

local message_page_offset = 3

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell, tpz.magic.spell.EXCENMILLE_S)
end
Expand All @@ -26,7 +28,7 @@ function onSpellCast(caster, target, spell)
end

function onMobSpawn(mob)
tpz.trust.teamworkMessage(mob, {
tpz.trust.teamworkMessage(mob, message_page_offset, {
[tpz.magic.spell.RAHAL] = tpz.trust.message_offset.TEAMWORK_1,
})

Expand All @@ -43,9 +45,9 @@ function onMobSpawn(mob)
end

function onMobDespawn(mob)
tpz.trust.message(mob, tpz.trust.message_offset.DESPAWN)
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DESPAWN)
end

function onMobDeath(mob)
tpz.trust.message(mob, tpz.trust.message_offset.DEATH)
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DEATH)
end
8 changes: 5 additions & 3 deletions scripts/globals/spells/trust/iron_eater.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ require("scripts/globals/trust")
require("scripts/globals/weaponskillids")
-----------------------------------------

local message_page_offset = 21

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell)
end
Expand All @@ -18,7 +20,7 @@ function onSpellCast(caster, target, spell)
end

function onMobSpawn(mob)
tpz.trust.teamworkMessage(mob, {
tpz.trust.teamworkMessage(mob, message_page_offset, {
[tpz.magic.spell.NAJI] = tpz.trust.message_offset.TEAMWORK_1,
})

Expand All @@ -27,9 +29,9 @@ function onMobSpawn(mob)
end

function onMobDespawn(mob)
tpz.trust.message(mob, tpz.trust.message_offset.DESPAWN)
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DESPAWN)
end

function onMobDeath(mob)
tpz.trust.message(mob, tpz.trust.message_offset.DEATH)
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DEATH)
end
45 changes: 45 additions & 0 deletions scripts/globals/spells/trust/koru-moru.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,58 @@
-----------------------------------------
-- Trust: Koru-Moru
-----------------------------------------
require("scripts/globals/ability")
require("scripts/globals/gambits")
require("scripts/globals/magic")
require("scripts/globals/status")
require("scripts/globals/trust")
require("scripts/globals/utils")
-----------------------------------------

local message_page_offset = 57

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell)
end

function onSpellCast(caster, target, spell)
return tpz.trust.spawn(caster, spell)
end

function onMobSpawn(mob)
tpz.trust.teamworkMessage(mob, message_page_offset, {
[tpz.magic.spell.SHANTOTTO] = tpz.trust.message_offset.TEAMWORK_1,
[tpz.magic.spell.SHANTOTTO_II] = tpz.trust.message_offset.TEAMWORK_1,
[tpz.magic.spell.AJIDO_MARUJIDO] = tpz.trust.message_offset.TEAMWORK_2,
})

mob:addSimpleGambit(ai.t.SELF, ai.c.MPP_LT, 5,
ai.r.JA, ai.s.SPECIFIC, tpz.ja.CONVERT)

mob:addSimpleGambit(ai.t.PARTY, ai.c.HPP_LT, 50, ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.CURE)

mob:addSimpleGambit(ai.t.MELEE, ai.c.NOT_STATUS, tpz.effect.HASTE, ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.HASTE)
mob:addSimpleGambit(ai.t.CASTER, ai.c.NOT_STATUS, tpz.effect.REFRESH, ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.REFRESH)
mob:addSimpleGambit(ai.t.RANGED, ai.c.NOT_STATUS, tpz.effect.FLURRY, ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.FLURRY)
mob:addSimpleGambit(ai.t.TOP_ENMITY, ai.c.NOT_STATUS, tpz.effect.PHALANX, ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.PHALANX)

mob:addSimpleGambit(ai.t.TARGET, ai.c.STATUS_FLAG, tpz.effectFlag.DISPELABLE, ai.r.MA, ai.s.SPECIFIC, tpz.magic.spell.DISPEL)

mob:addSimpleGambit(ai.t.TARGET, ai.c.NOT_STATUS, tpz.effect.DIA, ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.DIA, 60)
mob:addSimpleGambit(ai.t.TARGET, ai.c.NOT_STATUS, tpz.effect.SLOW, ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.SLOW, 60)
mob:addSimpleGambit(ai.t.TARGET, ai.c.NOT_STATUS, tpz.effect.EVASION_DOWN, ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.DISTRACT, 60)
mob:addSimpleGambit(ai.t.TARGET, ai.c.NOT_STATUS, tpz.effect.DIA, ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.DIA, 60)

mob:addSimpleGambit(ai.t.PARTY, ai.c.NOT_STATUS, tpz.effect.PROTECT, ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.PROTECT)
mob:addSimpleGambit(ai.t.PARTY, ai.c.NOT_STATUS, tpz.effect.SHELL, ai.r.MA, ai.s.HIGHEST, tpz.magic.spellFamily.SHELL)

mob:SetAutoAttackEnabled(false)
end

function onMobDespawn(mob)
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DESPAWN)
end

function onMobDeath(mob)
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DEATH)
end
7 changes: 4 additions & 3 deletions scripts/globals/spells/trust/kupipi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require("scripts/globals/weaponskillids")
require("scripts/globals/zone")
-----------------------------------------

local message_page_offset = 2

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell)
Expand All @@ -27,7 +28,7 @@ function onSpellCast(caster, target, spell)
end

function onMobSpawn(mob)
tpz.trust.teamworkMessage(mob, {
tpz.trust.teamworkMessage(mob, message_page_offset, {
[tpz.magic.spell.SHANTOTTO] = tpz.trust.message_offset.TEAMWORK_1,
[tpz.magic.spell.STAR_SIBYL] = tpz.trust.message_offset.TEAMWORK_2,
})
Expand Down Expand Up @@ -61,9 +62,9 @@ function onMobSpawn(mob)
end

function onMobDespawn(mob)
tpz.trust.message(mob, tpz.trust.message_offset.DESPAWN)
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DESPAWN)
end

function onMobDeath(mob)
tpz.trust.message(mob, tpz.trust.message_offset.DEATH)
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DEATH)
end
8 changes: 5 additions & 3 deletions scripts/globals/spells/trust/maat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ require("scripts/globals/status")
require("scripts/globals/trust")
-----------------------------------------

local message_page_offset = 37

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell, 1006)
end
Expand All @@ -16,17 +18,17 @@ function onSpellCast(caster, target, spell)
end

function onMobSpawn(mob)
tpz.trust.message(mob, tpz.trust.message_offset.SPAWN)
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.SPAWN)

-- On cooldown
mob:addSimpleGambit(ai.t.SELF, ai.c.ALWAYS, 0,
ai.r.JA, ai.s.SPECIFIC, tpz.ja.MANTRA)
end

function onMobDespawn(mob)
tpz.trust.message(mob, tpz.trust.message_offset.DESPAWN)
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DESPAWN)
end

function onMobDeath(mob)
tpz.trust.message(mob, tpz.trust.message_offset.DEATH)
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DEATH)
end
14 changes: 14 additions & 0 deletions scripts/globals/spells/trust/monberaux.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,24 @@
require("scripts/globals/trust")
-----------------------------------------

local message_page_offset = 120

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell)
end

function onSpellCast(caster, target, spell)
return tpz.trust.spawn(caster, spell)
end

function onMobSpawn(mob)
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.SPAWN)
end

function onMobDespawn(mob)
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DESPAWN)
end

function onMobDeath(mob)
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DEATH)
end
8 changes: 5 additions & 3 deletions scripts/globals/spells/trust/naji.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ require("scripts/globals/weaponskillids")
require("scripts/globals/zone")
-----------------------------------------

local message_page_offset = 1

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell)
end
Expand All @@ -26,7 +28,7 @@ function onSpellCast(caster, target, spell)
end

function onMobSpawn(mob)
tpz.trust.teamworkMessage(mob, {
tpz.trust.teamworkMessage(mob, message_page_offset, {
[tpz.magic.spell.AYAME] = tpz.trust.message_offset.TEAMWORK_1,
})

Expand All @@ -35,9 +37,9 @@ function onMobSpawn(mob)
end

function onMobDespawn(mob)
tpz.trust.message(mob, tpz.trust.message_offset.DESPAWN)
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DESPAWN)
end

function onMobDeath(mob)
tpz.trust.message(mob, tpz.trust.message_offset.DEATH)
tpz.trust.message(mob, message_page_offset, tpz.trust.message_offset.DEATH)
end
Loading

0 comments on commit 8bace25

Please sign in to comment.