This repository has been archived by the owner on Dec 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 221
Pathfind fix for NPC/MOB and poor old Novalmauge #548
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
dfcac36
Pathfind fix for Novalmauge
Omnione 8638cdc
Pathfind fix for Novalmauge
Omnione d22aa09
Changed setPathPoint to use uint16 rather than uint8
Omnione 652116d
Pathing adjustments
Omnione 34bcbaf
Big update
Omnione 816cded
Changes and additions
Omnione File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,58 +4,57 @@ | |
-- Involved in Mission: Infiltrate Davoi | ||
-- !pos 23 0.1 -23 149 | ||
----------------------------------- | ||
require("scripts/globals/missions"); | ||
require("scripts/globals/keyitems"); | ||
local ID = require("scripts/zones/Davoi/IDs"); | ||
require("scripts/globals/pathfind"); | ||
local ID = require("scripts/zones/Davoi/IDs") | ||
require("scripts/globals/missions") | ||
require("scripts/globals/keyitems") | ||
require("scripts/globals/pathfind") | ||
----------------------------------- | ||
|
||
local path = | ||
{ | ||
20.6, 0, -23, | ||
46, 0, -19, | ||
53.5, -1.8, -19, | ||
61, -1.1, -18.6, | ||
67.3, -1.5, -18.6, | ||
90, -0.5, -19 | ||
}; | ||
{20.600, -0.343, -23.000, {delay = 5}}, | ||
{35.431, -0.045, -20.227}, | ||
{51.795, -1.790, -18.843}, | ||
{58.037, -0.957, -18.724}, | ||
{65.919, -1.722, -18.767}, | ||
{92.143, -0.451, -16.231, {delay = 5}}, | ||
{65.919, -1.722, -18.767}, | ||
{58.037, -0.957, -18.724}, | ||
{51.795, -1.790, -18.843}, | ||
{35.431, -0.045, -20.227}, | ||
} | ||
|
||
function onSpawn(npc) | ||
npc:initNpcAi(); | ||
npc:setPos(tpz.path.first(path)); | ||
onPath(npc); | ||
end; | ||
npc:initNpcPathing() | ||
onPath(npc) | ||
end | ||
|
||
function onPath(npc) | ||
tpz.path.general(npc, path, tpz.path.flag.WALLHACK, false) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at this "in the wild", I wonder if Now that I say the other options, I guess it's as good as all the others 🤷 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe refactor to |
||
end | ||
|
||
tpz.path.patrol(npc, path); | ||
end; | ||
|
||
function onTrade(player,npc,trade) | ||
end; | ||
|
||
function onTrigger(player,npc) | ||
function onTrade(player, npc, trade) | ||
end | ||
|
||
function onTrigger(player, npc) | ||
if (player:getCurrentMission(SANDORIA) == tpz.mission.id.sandoria.INFILTRATE_DAVOI and player:getCharVar("MissionStatus") == 3) then | ||
player:startEvent(117); | ||
npc:wait(); | ||
player:startEvent(117) | ||
npc:pathStop() | ||
else | ||
player:showText(npc, ID.text.QUEMARICOND_DIALOG); | ||
npc:wait(2000); | ||
player:showText(npc, ID.text.QUEMARICOND_DIALOG) | ||
npc:clearTargID() | ||
end | ||
end | ||
|
||
end; | ||
|
||
function onEventUpdate(player,csid,option) | ||
end; | ||
|
||
function onEventFinish(player,csid,option,npc) | ||
function onEventUpdate(player, csid, option) | ||
end | ||
|
||
function onEventFinish(player, csid, option, npc) | ||
if (csid == 117) then | ||
player:setCharVar("MissionStatus",4); | ||
player:addKeyItem(tpz.ki.ROYAL_KNIGHTS_DAVOI_REPORT); | ||
player:messageSpecial(ID.text.KEYITEM_OBTAINED,tpz.ki.ROYAL_KNIGHTS_DAVOI_REPORT); | ||
player:setCharVar("MissionStatus",4) | ||
player:addKeyItem(tpz.ki.ROYAL_KNIGHTS_DAVOI_REPORT) | ||
player:messageSpecial(ID.text.KEYITEM_OBTAINED,tpz.ki.ROYAL_KNIGHTS_DAVOI_REPORT) | ||
end | ||
|
||
npc:wait(0); | ||
end; | ||
npc:pathResume() | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section really nicely highlights the benefits of this PR!