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

Commit

Permalink
Merge pull request #411 from kaincenteno/mhaura_ferries
Browse files Browse the repository at this point in the history
Fixing Ferries in Mhaura
  • Loading branch information
zircon-tpl authored Mar 26, 2020
2 parents 5fdee32 + 91d0a71 commit 2071cc1
Show file tree
Hide file tree
Showing 50 changed files with 1,093 additions and 994 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ LIBS_ALL += -lzmq

## Add Architecture-specific stuff
if TOPAZ_ARCH_LINUX
LIBS_ALL += -ldl
LIBS_ALL += -ldl -lpthread
endif

if TOPAZ_ARCH_SOLARIS
Expand Down
16 changes: 8 additions & 8 deletions scripts/globals/armorstorage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ local armorSets =
75, 6, 0x001000, 5, 15084, 15099, 15114, 15129, 15144, 1000, tpz.ki.KOGA_GARB_CLAIM_SLIP,
76, 6, 0x002000, 5, 15085, 15100, 15115, 15130, 15145, 1000, tpz.ki.WYRM_ARMOR_CLAIM_SLIP,
77, 6, 0x004000, 5, 15086, 15101, 15116, 15131, 15146, 1000, tpz.ki.SUMMONERS_ATTIRE_CLAIM_SLIP,
78, 4, 0x040000, 5, 16138, 14578, 15002, 15659, 15746, 500, tpz.ki.DANCERS_ATTIRE_CLAIM_SLIP,
79, 4, 0x080000, 5, 16139, 14579, 15003, 15660, 15747, 500, tpz.ki.DANCERS_ATTIRE_CLAIM_SLIP,
78, 4, 0x040000, 5, 16138, 14578, 15002, 15659, 15746, 500, tpz.ki.DANCERS_ATTIRE_CLAIM_SLIP_M,
79, 4, 0x080000, 5, 16139, 14579, 15003, 15660, 15747, 500, tpz.ki.DANCERS_ATTIRE_CLAIM_SLIP_F,
80, 4, 0x100000, 5, 16140, 14580, 15004, 16311, 15748, 500, tpz.ki.SCHOLARS_ATTIRE_CLAIM_SLIP,
81, 4, 0x200000, 5, 16062, 14525, 14933, 15604, 15688, 1000, tpz.ki.AMIR_ARMOR_CLAIM_SLIP,
82, 4, 0x400000, 5, 16069, 14530, 14940, 15609, 15695, 1000, tpz.ki.PAHLUWAN_ARMOR_CLAIM_SLIP,
Expand All @@ -108,7 +108,7 @@ tpz.armorStorage.onTrade = function(player, trade, deposit)

for i = 1, #armorSets, 11 do
local T1 = trade:hasItemQty(armorSets[i + 5], 1)

if T1 then
if not player:hasKeyItem(armorSets[i + 10]) then
if trade:getItemCount() == armorSets[i + 3] then
Expand All @@ -128,7 +128,7 @@ tpz.armorStorage.onTrade = function(player, trade, deposit)
end
end
end

return returnValue
end

Expand All @@ -143,7 +143,7 @@ tpz.armorStorage.onTrigger = function(player, withdrawal)
if player:hasKeyItem(armorSets[i]) then
local group = armorSets[i - 9]
local mask = armorSets[i - 8]

if group == 1 then
G1 = G1 + mask
elseif group == 2 then
Expand All @@ -157,7 +157,7 @@ tpz.armorStorage.onTrigger = function(player, withdrawal)
end
end
end

player:startEvent(withdrawal, G1, G2, G3, G4, player:getGil(), G5)
end

Expand All @@ -177,14 +177,14 @@ end
tpz.armorStorage.onEventFinish = function(player, csid, option, deposit, withdrawal)
if csid == deposit then
player:tradeComplete()

elseif csid == withdrawal then
if option > 0 and option <= armorSets[#armorSets] - 10 then
local idx = (option * 11) - 10
local count = armorSets[idx + 3]
local cost = armorSets[idx + 9]
local ki = armorSets[idx + 10]

if player:hasKeyItem(ki) and player:getFreeSlotsCount() >= count and player:getGil() >= cost then
for i = 4, 8 do
local itemId = armorSets[idx + i]
Expand Down
12 changes: 12 additions & 0 deletions scripts/globals/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ function printf(s,...)
print(s:format(...))
end

-----------------------------------
-- set()
-- Returns a set that can be checked against
-----------------------------------
function set(list)
local set = {}
for _, item in pairs(list) do
set[item] = true
end
return set
end

-----------------------------------
-- getMidnight
-- Returns midnight for the current day in epoch format
Expand Down
4 changes: 2 additions & 2 deletions scripts/globals/keyitems.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1954,8 +1954,8 @@ tpz.keyItem =
MAGUS_ATTIRE_CLAIM_SLIP = 1964,
CORSAIRS_ATTIRE_CLAIM_SLIP = 1965,
PUPPETRY_ATTIRE_CLAIM_SLIP = 1966,
DANCERS_ATTIRE_CLAIM_SLIP = 1967,
DANCERS_ATTIRE_CLAIM_SLIP = 1968,
DANCERS_ATTIRE_CLAIM_SLIP_M = 1967,
DANCERS_ATTIRE_CLAIM_SLIP_F = 1968,
SCHOLARS_ATTIRE_CLAIM_SLIP = 1969,
AMIR_ARMOR_CLAIM_SLIP = 1970,
PAHLUWAN_ARMOR_CLAIM_SLIP = 1971,
Expand Down
2 changes: 2 additions & 0 deletions scripts/globals/titles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,7 @@ tpz.title =
SIDHE_SMASHER = 1036,
ALEXANDER_ANNIHILATOR = 1037,
LILITH_LIQUIDATOR = 1038,
MIREU_MINCER = 1039,
VEGETABLE_HERO = 1044,
CONTRIBUTER_FROM_THE_SHADOWS = 1045,
THE_DECIDER = 1046,
Expand All @@ -1049,6 +1050,7 @@ tpz.title =
LEGENDARY_BONEWORKER = 1125,
LEGENDARY_ALCHEMIST = 1126,
LEGENDARY_CULINARIAN = 1127,
ETERNAL_COMMUNER = 1128,
}

-----------------------------------
Expand Down
49 changes: 49 additions & 0 deletions scripts/globals/transport.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,46 @@ tpz.transport.messageTime =
SILVER_SEA = 480
}

tpz.transport.trigger =
{
mhaura =
{
FERRY_ARRIVING_FROM_ALZAHBI = 0,
FERRY_DEPARTING_TO_ALZAHBI = 1,
FERRY_ARRIVING_FROM_SELBINA = 2,
FERRY_DEPARTING_TO_SELBINA = 3
}
}

tpz.transport.interval =
{
mhaura =
{
FROM_TO_ALZAHBI = 480,
FROM_TO_SELBINA = 480
}
}

tpz.transport.offset =
{
mhaura =
{
FERRY_ARRIVING_FROM_ALZAHBI = 159,
FERRY_DEPARTING_TO_ALZAHBI = 239,
FERRY_ARRIVING_FROM_SELBINA = 399,
FERRY_DEPARTING_TO_SELBINA = 479
}
}

tpz.transport.pos =
{
mhaura =
{
ARRIVING = {7.06, -1.36, 2.20},
DEPARTING = {8.26, -1.36, 2.20}
}
}

-------------------------------------------------
-- public functions
-------------------------------------------------
Expand All @@ -33,4 +73,13 @@ tpz.transport.captainMessage = function(npc, triggerID, messages)
for _, player in pairs(playersInZone) do
player:showText(player, messages[triggerID])
end
end

tpz.transport.dockMessage = function(npc, triggerID, messages, dock)
npc:showText(npc, messages[triggerID])
if (triggerID % 2) == 0 then
npc:pathThrough(tpz.transport.pos[dock].ARRIVING, PATHFLAG_WALLHACK)
else
npc:pathThrough(tpz.transport.pos[dock].DEPARTING, PATHFLAG_WALLHACK)
end
end
2 changes: 1 addition & 1 deletion scripts/zones/Batallia_Downs/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ zones[tpz.zone.BATALLIA_DOWNS] =
ALREADY_POSSESS_TEMP = 7693, -- You already possess that temporary item.
NO_COMBINATION = 7698, -- You were unable to enter a combination.
REGIME_REGISTERED = 9976, -- New training regime registered!
COMMON_SENSE_SURVIVAL = 12829, -- It appears that you have arrived at a new survival guide provided by the Adventurers' Mutual Aid Network. Common sense dictates that you should now be able to teleport here from similar tomes throughout the world.
COMMON_SENSE_SURVIVAL = 12832, -- It appears that you have arrived at a new survival guide provided by the Adventurers' Mutual Aid Network. Common sense dictates that you should now be able to teleport here from similar tomes throughout the world.
},
mob =
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/zones/Beadeaux/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ zones[tpz.zone.BEADEAUX] =
LOCKED_DOOR_QUADAV_HAS_KEY = 7212, -- It is locked tight, but has what looks like a keyhole. Maybe one of the Quadav here has the key.
YOU_CAN_NOW_BECOME_A_DARK_KNIGHT = 7349, -- You can now become a dark knight!
CHEST_UNLOCKED = 7360, -- You unlock the chest!
COMMON_SENSE_SURVIVAL = 7784, -- It appears that you have arrived at a new survival guide provided by the Adventurers' Mutual Aid Network. Common sense dictates that you should now be able to teleport here from similar tomes throughout the world.
COMMON_SENSE_SURVIVAL = 7787, -- It appears that you have arrived at a new survival guide provided by the Adventurers' Mutual Aid Network. Common sense dictates that you should now be able to teleport here from similar tomes throughout the world.
},
mob =
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/zones/Beaucedine_Glacier/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ zones[tpz.zone.BEAUCEDINE_GLACIER] =
ALREADY_POSSESS_TEMP = 8561, -- You already possess that temporary item.
NO_COMBINATION = 8566, -- You were unable to enter a combination.
REGIME_REGISTERED = 10744, -- New training regime registered!
COMMON_SENSE_SURVIVAL = 12767, -- It appears that you have arrived at a new survival guide provided by the Adventurers' Mutual Aid Network. Common sense dictates that you should now be able to teleport here from similar tomes throughout the world.
COMMON_SENSE_SURVIVAL = 12770, -- It appears that you have arrived at a new survival guide provided by the Adventurers' Mutual Aid Network. Common sense dictates that you should now be able to teleport here from similar tomes throughout the world.
},
mob =
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/zones/Behemoths_Dominion/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ zones[tpz.zone.BEHEMOTHS_DOMINION] =
ALREADY_POSSESS_TEMP = 7346, -- You already possess that temporary item.
NO_COMBINATION = 7351, -- You were unable to enter a combination.
REGIME_REGISTERED = 9529, -- New training regime registered!
COMMON_SENSE_SURVIVAL = 11524, -- It appears that you have arrived at a new survival guide provided by the Adventurers' Mutual Aid Network. Common sense dictates that you should now be able to teleport here from similar tomes throughout the world.
COMMON_SENSE_SURVIVAL = 11527, -- It appears that you have arrived at a new survival guide provided by the Adventurers' Mutual Aid Network. Common sense dictates that you should now be able to teleport here from similar tomes throughout the world.
},
mob =
{
Expand Down
4 changes: 2 additions & 2 deletions scripts/zones/Bostaunieux_Oubliette/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ zones[tpz.zone.BOSTAUNIEUX_OUBLIETTE] =
SEEMS_LOCKED = 7310, -- It seems to be locked.
SPIRAL_HELL_LEARNED = 7417, -- You have learned the weapon skill Spiral Hell!
SENSE_OMINOUS_PRESENCE = 7418, -- You sense an ominous presence...
ITEMS_ITEMS_LA_LA = 7421, -- You can hear a strange voice... "Items, Items, la la la la la~♪"
ITEMS_ITEMS_LA_LA = 7421, -- You can hear a strange voice... Items, items, la la la la la
GOBLIN_SLIPPED_AWAY = 7427, -- The Goblin slipped away when you were not looking...
REGIME_REGISTERED = 9532, -- New training regime registered!
COMMON_SENSE_SURVIVAL = 10622, -- It appears that you have arrived at a new survival guide provided by the Adventurers' Mutual Aid Network. Common sense dictates that you should now be able to teleport here from similar tomes throughout the world.
COMMON_SENSE_SURVIVAL = 10625, -- It appears that you have arrived at a new survival guide provided by the Adventurers' Mutual Aid Network. Common sense dictates that you should now be able to teleport here from similar tomes throughout the world.
PLAYER_OBTAINS_ITEM = 10584, -- <name> obtains <item>!
UNABLE_TO_OBTAIN_ITEM = 10585, -- You were unable to obtain the item.
PLAYER_OBTAINS_TEMP_ITEM = 10586, -- <name> obtains the temporary item: <item>!
Expand Down
2 changes: 1 addition & 1 deletion scripts/zones/Castle_Oztroja/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ zones[tpz.zone.CASTLE_OZTROJA] =
YAGUDO_AVATAR_DEATH = 7446, -- Our lord, Tzee Xicu the Manifest! Even should our bodies be crushed and broken, may our souls endure into eternity...
YAGUDO_KING_ENGAGE = 7447, -- You are not here as sacrifices, are you? Could you possibly be committing this affront in the face of a deity? Very well, I will personally mete out your divine punishment, kyah!
YAGUDO_KING_DEATH = 7448, -- You have...bested me... However, I...am...a god... I will never die...never rot...never fade...never...
COMMON_SENSE_SURVIVAL = 8293, -- It appears that you have arrived at a new survival guide provided by the Adventurers' Mutual Aid Network. Common sense dictates that you should now be able to teleport here from similar tomes throughout the world.
COMMON_SENSE_SURVIVAL = 8296, -- It appears that you have arrived at a new survival guide provided by the Adventurers' Mutual Aid Network. Common sense dictates that you should now be able to teleport here from similar tomes throughout the world.
},
mob =
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/zones/Castle_Zvahl_Keep/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ zones[tpz.zone.CASTLE_ZVAHL_KEEP] =
NOTHING_OUT_OF_ORDINARY = 6561, -- There is nothing out of the ordinary here.
FELLOW_MESSAGE_OFFSET = 6576, -- I'm ready. I suppose.
CHEST_UNLOCKED = 7223, -- You unlock the chest!
ITEMS_ITEMS_LA_LA = 7232, -- You can hear a strange voice... "Items, Items, la la la la la~♪"
ITEMS_ITEMS_LA_LA = 7232, -- You can hear a strange voice... Items, items, la la la la la
GOBLIN_SLIPPED_AWAY = 7238, -- The Goblin slipped away when you were not looking...
HOMEPOINT_SET = 7281, -- Home point set!
},
Expand Down
2 changes: 1 addition & 1 deletion scripts/zones/Crawlers_Nest/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ zones[tpz.zone.CRAWLERS_NEST] =
PLAYER_OBTAINS_TEMP_ITEM = 7344, -- <name> obtains the temporary item: <item>!
ALREADY_POSSESS_TEMP = 7345, -- You already possess that temporary item.
NO_COMBINATION = 7350, -- You were unable to enter a combination.
COMMON_SENSE_SURVIVAL = 11377, -- It appears that you have arrived at a new survival guide provided by the Adventurers' Mutual Aid Network. Common sense dictates that you should now be able to teleport here from similar tomes throughout the world.
COMMON_SENSE_SURVIVAL = 11380, -- It appears that you have arrived at a new survival guide provided by the Adventurers' Mutual Aid Network. Common sense dictates that you should now be able to teleport here from similar tomes throughout the world.
},
mob =
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/zones/Davoi/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ zones[tpz.zone.DAVOI] =
AN_ORCISH_STORAGE_HOLE = 7450, -- An Orcish storage hole. There is something inside, but you cannot open it without a key.
A_WELL = 7452, -- A well, presumably dug by Orcs.
CHEST_UNLOCKED = 7471, -- You unlock the chest!
COMMON_SENSE_SURVIVAL = 7969, -- It appears that you have arrived at a new survival guide provided by the Adventurers' Mutual Aid Network. Common sense dictates that you should now be able to teleport here from similar tomes throughout the world.
COMMON_SENSE_SURVIVAL = 7972, -- It appears that you have arrived at a new survival guide provided by the Adventurers' Mutual Aid Network. Common sense dictates that you should now be able to teleport here from similar tomes throughout the world.
},
mob =
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/zones/FeiYin/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ zones[tpz.zone.FEIYIN] =
ALREADY_POSSESS_TEMP = 7510, -- You already possess that temporary item.
NO_COMBINATION = 7515, -- You were unable to enter a combination.
REGIME_REGISTERED = 9593, -- New training regime registered!
HOMEPOINT_SET = 10689, -- Home point set!
HOMEPOINT_SET = 10692, -- Home point set!
},
mob =
{
Expand Down
4 changes: 2 additions & 2 deletions scripts/zones/Garlaige_Citadel/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ zones[tpz.zone.GARLAIGE_CITADEL] =
PRESENCE_FROM_CEILING = 7295, -- You sense a presence from in the ceiling.
HEAT_FROM_CEILING = 7296, -- You feel a terrible heat from the ceiling.
CHEST_UNLOCKED = 7326, -- You unlock the chest!
ITEMS_ITEMS_LA_LA = 7453, -- You can hear a strange voice...Items, items, la la la la la~♪”
ITEMS_ITEMS_LA_LA = 7453, -- You can hear a strange voice... Items, items, la la la la la
GOBLIN_SLIPPED_AWAY = 7459, -- The Goblin slipped away when you were not looking...
PLAYER_OBTAINS_ITEM = 7519, -- <name> obtains <item>!
UNABLE_TO_OBTAIN_ITEM = 7520, -- You were unable to obtain the item.
PLAYER_OBTAINS_TEMP_ITEM = 7521, -- <name> obtains the temporary item: <item>!
ALREADY_POSSESS_TEMP = 7522, -- You already possess that temporary item.
NO_COMBINATION = 7527, -- You were unable to enter a combination.
REGIME_REGISTERED = 9605, -- New training regime registered!
COMMON_SENSE_SURVIVAL = 11553, -- It appears that you have arrived at a new survival guide provided by the Adventurers' Mutual Aid Network. Common sense dictates that you should now be able to teleport here from similar tomes throughout the world.
COMMON_SENSE_SURVIVAL = 11556, -- It appears that you have arrived at a new survival guide provided by the Adventurers' Mutual Aid Network. Common sense dictates that you should now be able to teleport here from similar tomes throughout the world.
},
mob =
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/zones/Ghelsba_Outpost/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ zones[tpz.zone.GHELSBA_OUTPOST] =
KEYITEM_OBTAINED = 6921, -- Obtained key item: <keyitem>.
FELLOW_MESSAGE_OFFSET = 6947, -- I'm ready. I suppose.
FISHING_MESSAGE_OFFSET = 7579, -- You can't fish here.
HUT_DOOR = 7713, -- This looks like an orcish dwelling. The door is firmly shut.
HUT_DOOR = 7713, -- This looks like an Orcish dwelling. The door is firmly shut.
LOGGING_IS_POSSIBLE_HERE = 7740, -- Logging is possible here if you have <item>.
YOU_CAN_NOW_BECOME_A_DRAGOON = 7780, -- You can now become a dragoon!
},
Expand Down
2 changes: 1 addition & 1 deletion scripts/zones/Gusgen_Mines/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ zones[tpz.zone.GUSGEN_MINES] =
ALREADY_POSSESS_TEMP = 8300, -- You already possess that temporary item.
NO_COMBINATION = 8305, -- You were unable to enter a combination.
REGIME_REGISTERED = 10383, -- New training regime registered!
COMMON_SENSE_SURVIVAL = 11465, -- It appears that you have arrived at a new survival guide provided by the Adventurers' Mutual Aid Network. Common sense dictates that you should now be able to teleport here from similar tomes throughout the world.
COMMON_SENSE_SURVIVAL = 11468, -- It appears that you have arrived at a new survival guide provided by the Adventurers' Mutual Aid Network. Common sense dictates that you should now be able to teleport here from similar tomes throughout the world.
},
mob =
{
Expand Down
4 changes: 0 additions & 4 deletions scripts/zones/Horlais_Peak/mobs/Cottontail.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
require("scripts/globals/status")
-----------------------------------

function onMobInitialize(mob)
mob:setMobMod(tpz.mobMod.NO_DROPS, 1)
end

function onMobSpawn(mob)
mob:setMobMod(tpz.mobMod.CHARMABLE, 1)
end
Expand Down
8 changes: 2 additions & 6 deletions scripts/zones/Horlais_Peak/mobs/Helltail_Harry.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@
require("scripts/globals/status")
-----------------------------------

function onMobInitialize(mob)
mob:setMobMod(tpz.mobMod.NO_DROPS, 1)
end

function onMobSpawn(mob)
mob:setMod(tpz.mod.SLEEPRES, 1000) -- needs to be set as full immunity but worried that setting it will knock out chance of lullaby
mob:setMod(tpz.mod.SLEEPRES, 1000)
mob:setMod(tpz.mod.SILENCERES, 900)
mob:setMod(tpz.mod.LULLABYRES, 700) -- this is for lullaby since he can be slept with it, just not easily
mob:setMod(tpz.mod.LULLABYRES, 700)
end

function onMobDeath(mob, player, isKiller)
Expand Down
2 changes: 1 addition & 1 deletion scripts/zones/Konschtat_Highlands/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ zones[tpz.zone.KONSCHTAT_HIGHLANDS] =
ALREADY_POSSESS_TEMP = 7597, -- You already possess that temporary item.
NO_COMBINATION = 7602, -- You were unable to enter a combination.
REGIME_REGISTERED = 9780, -- New training regime registered!
COMMON_SENSE_SURVIVAL = 11903, -- It appears that you have arrived at a new survival guide provided by the Adventurers' Mutual Aid Network. Common sense dictates that you should now be able to teleport here from similar tomes throughout the world.
COMMON_SENSE_SURVIVAL = 11906, -- It appears that you have arrived at a new survival guide provided by the Adventurers' Mutual Aid Network. Common sense dictates that you should now be able to teleport here from similar tomes throughout the world.
},
mob =
{
Expand Down
Loading

0 comments on commit 2071cc1

Please sign in to comment.