125 Commits

Author SHA1 Message Date
Filip Maj
63f0b024ac Finished the Souls Gone Wild quest.... mostly 2022-06-16 01:53:12 -04:00
Filip Maj
67db1035ed Added missing CNJ and Gridania npcs 2022-04-26 18:15:50 -04:00
Filip Maj
c865975df7 Adding snpc table schema. Updating server zones/privatearea tables 2022-04-15 16:10:42 -04:00
Filip Maj
aef0f2b400 Renamed QFLAG constants and moved them to quest.lua 2022-04-15 12:35:06 -04:00
Filip Maj
16c62a08d8 Added missing npcs 2022-04-15 12:34:07 -04:00
Filip Maj
6cb107870f Merged dbs 2022-04-13 21:43:43 -04:00
Filip Maj
9a2f8ef89a Merge branch 'Jorge/quest_system' into ioncannon/quest_system 2022-04-13 20:12:38 -04:00
Filip Maj
524f415b44 Fixed bug when two chars have slot == 2 2022-04-13 20:04:57 -04:00
Filip Maj
5c0d2c1d7f Fixed up some lua scripts. Fleshed out the dream stuff for Hildie quests. NOTE: Finish player.lua as it has pseudo code. 2022-04-13 20:03:46 -04:00
CuriousJorge
a7b1b79461 Hildibrand series of quests all in. Requires inn dream handling and some retail accuracy double-checking to finish it off. Misc script fixes also.
===============================
Nudgenpc.lua    - Added a command variation
Testmapobj.lua - Added !help documentation
DftWil.lua            - Corrected an npc name/function
Player.cs             - Changed Dalamud packet to default to 7, not 0.  Fixes the moon not displaying in a specific Hildibrand cutscene
Etc5g0.lua          - Made quest accepting retail-accurate with how it displayed messages/ended the TalkEvent
Etc5g1.lua          - Added Bed !.  Kinda kludged in atm since it's a pre-accepted quest state.
Etc5u1.lua          - Same as above
Etc5l1.lua           - Quest "Private Eyes" scripted.
Etc5l2.lua           - Quest "Mysteries of the Red Moon" scripted
Etc5l3.lua           - Quest "Prophecy Inspection" scripted
2022-04-13 11:45:49 -04:00
Filip Maj
c3b4735cc5 Added missing dialog to some npcs in Legends Adrift. Finished Never Shall the Twain Meet. 2022-04-12 01:07:17 -04:00
Filip Maj
ac22637b4f Got Fade to White 99% scripted out. Got Path Companion data all setup and saving/loading. Fixed the BgKeepouts and they properly show their msgs. Added quests to MarketEntrances. Fixed MarketEntrances. Hooked cutscene book to the Patch Companion you use. 2022-04-12 01:06:12 -04:00
CuriousJorge
01d05b5cee Merge remote-tracking branch 'origin/ioncannon/quest_system' into Jorge/quest_system 2022-04-03 01:14:13 -04:00
CuriousJorge
d50bfef2e5 Minor script revision + new quest
warp.lua - Switched to warp type 0x16 for flipping between city zones.  Zero gameplay interruption with this type.
etc5u1 - Added in a spawn location for privateArea
etc5g1 - Scripted, aside from the means of accepting the quest which requires special handling to trigger the intro CS for it.
2022-04-03 00:57:24 -04:00
Filip Maj
a5a039ce3d Added the other two Shposhae quests; A Slippery Stone and Cutthroat Prices. Also modified the PopFlyingShip script to move the quest along. 2022-04-02 13:34:32 -04:00
Filip Maj
514610f006 Minor fix to Call of Booty. 2022-04-02 12:47:19 -04:00
Filip Maj
159242068d Added Call of Booty ( ͡° ͜ʖ ͡°) 2022-04-02 12:45:53 -04:00
Filip Maj
a6ee42094c Finished 'What a Pirate Wants' (lol what a Pirate Needs, what a Pirate, whatever keeps rum in my arms and I'm thanking you for giving it to me.) 2022-04-02 12:26:18 -04:00
Filip Maj
6bbe272d48 Added a buttload of side quests. This should mean all talky quests and 'kill x things' quests are done. Also updated the attention messages as they were using the wrong one for getting items or killing mobs. Fixed some journal issues on various quests as well. 2022-04-02 11:52:32 -04:00
Filip Maj
938cca0298 Added An Inconvenient Dodo and Besmitten and Besmirched. 2022-03-30 00:59:56 -04:00
Filip Maj
e53e54b4bf Fixed more quests 2022-03-30 00:17:59 -04:00
Filip Maj
f6ff56299f Fixed up some more quests! 2022-03-29 23:56:08 -04:00
Filip Maj
a1bb84e80d Fixed up Food for Thought (emotes work now) and Have You Seen my Son (bnpc works). 2022-03-29 22:57:02 -04:00
Filip Maj
4d2c80a8ee testbnpckill was missing it's extension 2022-03-29 22:01:03 -04:00
Filip Maj
c2169576c2 Fixed Til Death Do Us Part and Beryl Overboard so that the proper attention msgs appear. Also added missing params to the funcs defining the objective quantity. 2022-03-29 22:00:18 -04:00
Filip Maj
4d424e57f9 Adding the rest of the wld quests: Sanguine Studies, Secrets Unearthed, and Rustproof. 2022-03-29 21:19:35 -04:00
CuriousJorge
4494b30285 Quest fixes
Etc5u1 & Etc5g1 - Added handling for the Ul'dah Inn NPC to re-issue an item as needed, otherwise play his other dialog.
Music - Made it play current zone's music if no id present.
2022-03-16 18:52:02 -04:00
CuriousJorge
74713f3dd6 Misc GM command fixes + ChangeJobCommand.lua
Anim - Cleaned up some.  It had old code sitting in it for whatever reason despite not affecting anything.
Setstate, Warpplayer & Yolo - Fixed them up so they function again
ChangeJobCommand - Just the script filled out to handle the equipping/dequipping of job stones, but it can cause issues, particularly with how the server handles a 'job' vs. a class, along with checking against skill compatibility.
2022-03-13 20:35:29 -04:00
CuriousJorge
b08827568c Chocobo stuff:
PopulaceChocoboLender - Made rental time 10 minutes again (as retail had it).  Added Vesper Bay NPC's rental location as close as I could get it from a blurry source.
ChocoboRideCommand - Fixed the method used to pull a zone's music so the script doesn't fail.
2022-03-13 18:26:20 -04:00
CuriousJorge
b34f214e67 Quests + Minor fixes
MarketEntrance - Adjusted events parameter so it works again
Warp - Added shortcut for switching between a given town's zones so I can stop having to look up the right zone id
Weather - Added shortcut for weather ids to +8000 to the value if the're within a certain range.
DftSea - Inn NPC check
etc5u0 - Used a constant in place of a value, updated a constant's name.
etc5l0 -  Fully scripted.
etc5u1 - Mostly scripted.  Requires Dream handling and privArea + NPC placement.
etc5g1 - Mostly scripted.  Requires Dream handling and privArea + NPC placement.
2022-03-13 17:45:10 -04:00
CuriousJorge
e94c037fb5 Merge remote-tracking branch 'origin/ioncannon/quest_system' into Jorge/quest_system
# Conflicts:
#	Data/scripts/commands/EmoteSitCommand.lua  - Resolved using Theirs
2022-03-11 19:21:42 -05:00
Filip Maj
65ee91e49c Finished Treasures of the Main and Legends Adrift. Fixed quests appearing in private areas (echos). Fixed other bugs. Implemented NPC Linkshells. Added more options to nudge command. Added nudgenpc command. Added testbnpckill command. 2022-03-11 02:17:46 -05:00
CuriousJorge
01ec313ffb DftFst.lua - about as documented as I can get it for now. Will finalize some NPC argument checks next time.
quest.lua - Script refactored.  Moved as much as possible out of the main function to tidy it up.  Folded in a complete-quest function from another script.  Only works with quest id numbers for now.  String support (eg. Man0u0) to come in another commit.
ObjectInnDoor.lua - Fixed it to handle events again with the current system.
2022-03-09 22:23:10 -05:00
Filip Maj
ebba56602c Removed automatic Left Instance msg, as it only happens when running out of a PrivateArea_Exit. More M0l1 work. 2022-03-05 01:28:28 -05:00
Filip Maj
49c6fdbd51 Added functionality to handle NPC LSes in quests. Linked the rest of the sequences up for Man0l1. 2022-03-05 01:02:41 -05:00
CuriousJorge
08557f41fb Minor fixes
- InstanceRaid Guide : Added DefaultTalk handling for the npcs we have currently.  Included a couple commented-out client functions for two of the raids.
- EmoteSitCommand : Added eventType to the function so sitting on environment objects works again.
- Man0u0 : SourceTree added hunk-change garbage during a conflict resolving during the last merge. I just replaced it with the raw of that commit so it matches what it should have been.
- DftFst : Added the Gridania InstanceRaidGuide NPCs to the list for documentation sake, even though it'd never be called from that script with how things are currently set up.
2022-03-04 23:12:28 -05:00
Filip Maj
a618e69dbd Fixed args on commands due to triggername becoming eventType and eventName 2022-03-04 22:55:30 -05:00
CuriousJorge
02fe9e070d Merge remote-tracking branch 'origin/ioncannon/quest_system' into Jorge/quest_system
# Conflicts:
#	Data/scripts/commands/EmoteStandardCommand.lua
#	Data/scripts/quests/man/man0g0.lua
#	Data/scripts/quests/man/man0g1.lua
#	Data/scripts/quests/man/man0u0.lua

Resolved using Theirs.
2022-03-04 21:04:17 -05:00
Filip Maj
bf20993e58 Finished sequences 55, 60, 65 for Treasures of the Main. 2022-03-04 20:33:02 -05:00
Filip Maj
2817560217 Got the emote sequence for Treasures of the Main working. Got the duty started but there are issues on zoning. 2022-03-04 02:20:56 -05:00
Filip Maj
765cf194c5 Removed more dead scripts. Exported missing sql files. 2022-03-03 23:33:55 -05:00
Filip Maj
b57f91470a Deleting more useless scripts. Moved all the elevator scripts into 1 base script. 2022-03-03 20:03:36 -05:00
Filip Maj
2cb6a9f6bd Added back loading defaulttalk npcs through script. Should speed up warps now! Added loading mapobj ifno through a db table, removing the need for unique scripts. Deleted ported mapobj scripts. 2022-03-03 19:34:33 -05:00
Filip Maj
b773098abf Added the PGL200 quest The House Always Wins. Fixed quest instances not being set on spawn. Fixed PrivateAreaPast. Added You have left the instance messages when leaving a PrivateArea. Fixed EmoteEvents. DefaultTalk has been disabled temporarily to speed up warps. 2022-03-03 01:59:13 -05:00
Filip Maj
f491c63b98 The journal update msg shows even when completing quests now. Added Revenge on the Reavers, Till Death Do Us Part, Beryl Overboard, Have You Seen My Son, and Food for Thought. 2022-03-01 14:29:59 -05:00
CuriousJorge
023527efa3 Further work on DefaultTalks
- DftFst - Every uniqueId script covered from the previous system.  Still a lot of functions to still map and actors to pose & position for them.
- AfterQuestWarpDirector - Added Man0g1 as a check.
- Nuked PopulaceStandard uId scripts for Forest region since unneeded now.
2022-02-26 23:15:20 -05:00
Filip Maj
96f9119cca Fixed Waste Not Want Not now that the quest system is final. 2022-02-24 22:59:06 -05:00
Filip Maj
f84899ff2e Added Assessin the Damage 2022-02-24 22:48:55 -05:00
CuriousJorge
a87244d13b - man0g0 - Majority of the work ported from the old quest system. Still polish to be had and fringe cases to deal with (especially relogging)
- man0g1 - Initial privateArea mostly scripted.
- SimpleContent30010 - Fixed Yda/Papalymo Id being backwards, added Active states to match retail
- QuestDirectorMan0g001-  Updated to play itself out (this is a mess to wrap my head around).  Mostly sorta kinda working on both DoW & DoM tutorials.  End cutscene on DoW not firing currently, will fix later.
2022-02-24 22:24:08 -05:00
Filip Maj
c5198783a1 Adding Sleepless in Eorzea, Bridging the Gap, and The Search for Sicksa. 2022-02-24 20:31:05 -05:00
Filip Maj
b9ab842fdd Added Spores on the Brain 2022-02-24 19:31:32 -05:00
Filip Maj
e8ee907477 Added A Bitter Oil to Swallow 2022-02-24 19:23:11 -05:00
Filip Maj
b4227cdc44 Added Sour Grapes 2022-02-24 19:07:09 -05:00
Filip Maj
59f4e4bbd5 Fixed bug in Hearing Confessions. Added Letting Out Orions Belt and Sniff Out a Profit. The former still needs the correct attention message though when talking to a NPC. 2022-02-24 18:46:55 -05:00
Filip Maj
c9f18f5415 Added Of Archons and Muses 2022-02-24 12:40:59 -05:00
Filip Maj
495bdf4ba6 Added Hearing Confessions. 2022-02-24 02:16:28 -05:00
Filip Maj
b46160763c Finished In the Name of Science 2022-02-24 01:34:26 -05:00
Filip Maj
3393eb4c9d Trading Tongueflaps is done! 2022-02-24 00:54:03 -05:00
Filip Maj
7de153dde1 Fixed markers in etc3u0 2022-02-24 00:03:16 -05:00
Filip Maj
0faa056589 Added A Call to Arms. Fixed up Seeking the Seers. 2022-02-24 00:00:58 -05:00
Filip Maj
90115f7c83 Added Tug of the Whorl. Fixed up prereqs not working when using debug command. Fixed giveexp command. Added seq constants. 2022-02-23 23:10:11 -05:00
CuriousJorge
682ddd9cae - Fixed !anim targeting the incorrect actor.
- Etc5u0 scripted start to finish.  Ul'dah Inn quest.
- DftWil - Added quest checks to the Inn NPCs.
- DfFst - Commiting what's been done thus far.  fst0Town01 zone nearly done.  Still have 100 something fst0Town01a & field npcs to add.
- Removed some fst0Town01 uniqueId scripts
2022-02-23 20:52:25 -05:00
CuriousJorge
8c70d0ddb6 - man0u0 : Updated script to work with the recent changes in how quest data is requested. 2022-02-20 23:32:47 -05:00
Filip Maj
5c49563790 Removed useless uniques after DftSea and DftWil got replaced 2022-02-20 23:23:28 -05:00
Filip Maj
c6a372ad83 Fixed replaced quests not being added to the complete list 2022-02-20 23:20:45 -05:00
CuriousJorge
d2e814b4ee Merge remote-tracking branch 'origin/ioncannon/quest_system' into Jorge/quest_system 2022-02-20 23:05:49 -05:00
Filip Maj
0cdeb5d9ac Got tutorial quests working again. Integrated Jorges DftSea work, thanks! 2022-02-20 23:03:16 -05:00
CuriousJorge
fac8f269e7 Merge remote-tracking branch 'origin/ioncannon/quest_system' into Jorge/quest_system
# Conflicts:
#	Data/scripts/player.lua  - Resolved.  Using theirs.
2022-02-20 22:57:01 -05:00
CuriousJorge
d06152be07 Commiting more work before merging in another branch.
- DftFst - More actors added
- Trl0g1/Trl0l1 - Removed a stray ] causing the script to not function.
2022-02-20 22:54:31 -05:00
Filip Maj
0b67f8e436 Fixed bugs and edited scripts causing the limsa intro to fail. 2022-02-20 22:40:35 -05:00
CuriousJorge
7fea45e1f8 Merge remote-tracking branch 'origin/ioncannon/quest_system' into Jorge/quest_system 2022-02-20 21:33:50 -05:00
CuriousJorge
696d355ae9 Commit work on DftFst before merging in some fixes unrelated issues. 2022-02-20 21:32:43 -05:00
Filip Maj
bbbab356af Fixed a bunch of bugs Jorge found. Readded tutorial quests back. 2022-02-20 21:30:09 -05:00
CuriousJorge
594e08f990 Merge remote-tracking branch 'origin/ioncannon/quest_system' into Jorge/quest_system 2022-02-20 15:10:49 -05:00
CuriousJorge
89287844f7 Player.lua - Added fallback for second half of the man0u0 tutorial to get an onNotice kicked, so it can eventually handle it and resume gameplay from a disconnect. 2022-02-20 15:06:17 -05:00
Filip Maj
c240096eb8 Added gamedata quest table. 2022-02-20 12:42:29 -05:00
Filip Maj
08e7a9cfd4 Added sql schema change to completed quests 2022-02-20 12:41:21 -05:00
Filip Maj
25f1b0fd95 Added debug script for setting quest completion 2022-02-20 12:39:34 -05:00
Filip Maj
c677479a03 Added completed quest sendback. 2022-02-20 12:06:48 -05:00
Filip Maj
306f4ef346 Got aetheryte map and completed quest work values... working. 2022-02-19 01:17:50 -05:00
Filip Maj
a2c4d077e9 Fixed quest loading 2022-02-17 21:30:06 -05:00
CuriousJorge
7e5ca6e013 Added Foundation Day 2012 actors to DftWil for now just so they can talk.
Added a Chocobo to it also that we already had spawned, unsure if authentic or not, added a comment reflecting that.
Cleaned up more orphaned scripts from Wil region.
2022-02-17 20:03:15 -05:00
Filip Maj
02cb0a3f43 Refactored quest state system seems to work! 2022-02-17 13:22:18 -05:00
CuriousJorge
dc1458c52d - Player.lua - Fixed typo on ClearData() for Ul'dah intro
- DftSea - 96% finished
- DftWil - minor comment addition
- EmoteStandardCommand - Added the new event params so the script functions again
- Mass deletion of all PplStd & PplShopSalesman for La Noscea NPCs.  No longer needed
2022-02-17 02:49:59 -05:00
Filip Maj
1523ae200b Finished quest state system idea 2022-02-16 15:32:54 -05:00
Filip Maj
aae051d73f Capitalized the DataObject class. 2022-02-16 15:30:32 -05:00
Filip Maj
9097e557ed Removed the state and custom name columns from the enpc table. Renamed server_spawn_locations to server_eventnpc_spawn_locations. Renamed animationId to motionPack. 2022-02-13 19:24:09 -05:00
Filip Maj
cfe6ef2e5e Merge branch 'Jorge/quest_system' into ioncannon/quest_system 2022-02-13 18:57:08 -05:00
Filip Maj
d26aaed953 Added a bunch of npcs to the db 2022-02-13 18:51:23 -05:00
Filip Maj
8d5f4465e3 New test gm scripts to help with positioning populace npcs 2022-02-13 18:50:48 -05:00
Filip Maj
214d730a58 Added warp to public and private areas shortcut. Fixed counter printout bug. Fixed some commands. Fixed handling of the chocobo lender at the ferry docks. 2022-02-13 18:48:22 -05:00
CuriousJorge
b6c9825b2d - Man0u0 about as polished as one can get the Talking sections for now, minus some very specific retail quirks that need replicating at some point (all revolving around the starting 15 seconds of the forced tutorial)
- Man0u1 barely started.  Just enough there to get the player out of the PrivateArea and into the public zone.
- All of the old Populace uniqueId scripts for both quests nuked into high orbit.
- DftSea:  Master list of function names and argument counts added to the list.  Will be whittling away at this over the coming week.
- GM Warp: For whatever reason using "" to compare against a nil wasn't working anymore.  Set it to nil instead.
2022-02-13 13:18:20 -05:00
CuriousJorge
acf953e909 DftFst: Added a param handling to Kinnison on DftFst since it'd crash the client otherwise.
Etc3g0: Polished up the script, made it as authentic to retail as I could get it barring reward hand-out and starting the quest
Etc5g0: Ported the quest over from the old scripting setup.
Man0u1: Still very early wip.
2022-02-10 19:35:04 -05:00
CuriousJorge
4fe8f77887 Merge remote-tracking branch 'origin/ioncannon/quest_system' into Jorge/quest_system 2022-02-08 21:41:22 -05:00
CuriousJorge
96cb8070be Man0u0 & Man0u1 work progress.
Man0u0 nearly finished.  Needs some misc. background actors Id'd and placed, and some additional bug-testing.
Man0u1 still very early.  Initial area's actors mostly scripted.
2022-02-08 17:35:29 -05:00
Filip Maj
9f077190a3 Renamed some funcs, and fleshed out a ton on man0l1. Various related things were also added. 2022-02-07 05:13:34 -05:00
CuriousJorge
0465bf6b8d Merge remote-tracking branch 'origin/ioncannon/quest_system' into Jorge/quest_system 2022-02-06 23:18:59 -05:00
Filip Maj
0ac53e23ad Fixed warp to allow private areas 2022-02-06 23:17:59 -05:00
CuriousJorge
e6d5d5a530 Merge branch 'ioncannon/quest_system' of https://bitbucket.org/Ioncannon/project-meteor-server into Jorge/quest_system 2022-02-06 20:40:25 -05:00
Filip Maj
335efcc81e Fixed Quest ENPC bug and converted over Man0l1 2022-02-06 20:08:53 -05:00
CuriousJorge
fb9d4026a5 Merge branch 'ioncannon/quest_system' of https://bitbucket.org/Ioncannon/project-meteor-server into Jorge/quest_system 2022-02-06 14:49:31 -05:00
CuriousJorge
68a2685cf1 Man0u0 wip progress. 2022-02-06 12:36:15 -05:00
Filip Maj
8b3431e557 Changed how Quest ENPCs work. They should now automatically update themselves whenever data is update for immediate effect changes. Fixed wrong map qflag value. Fixed quest gm command. Fixed Director actorId clobbering areaMasters. 2022-02-06 12:12:26 -05:00
Filip Maj
b11007b263 Quest schema in db changed 2022-02-05 22:40:24 -05:00
CuriousJorge
2cbb48621b Merge branch 'ioncannon/quest_system' into Jorge/quest_system 2022-02-05 18:26:03 -05:00
Filip Maj
f574f5b103 Revert lua engine UserData policy 2022-02-05 18:19:40 -05:00
Filip Maj
8d647ae6b0 This script was missing for some reason 2022-02-05 18:17:14 -05:00
Filip Maj
f374ee3be9 More changes 2022-02-05 18:14:23 -05:00
Filip Maj
37d04344ae Forgot file 2022-02-05 18:01:16 -05:00
Filip Maj
68e55a1c76 Added changes to how zones/areas are accessed in the lua scripts too. 2022-02-05 18:00:09 -05:00
Filip Maj
4e0cf36552 Refactored some actor field names 2022-02-05 17:48:49 -05:00
CuriousJorge
4e5a07afa4 Merge branch 'ioncannon/quest_system' into Jorge/quest_system 2022-02-05 14:21:57 -05:00
Filip Maj
563118372a Refactored how zones work. Cleaned out a lot of duplciations and smoothed out how Zones/PrivateAreas work. 2022-02-05 14:05:32 -05:00
CuriousJorge
4fc5762d41 Teleport command touch-ups.
PopulaceCompanyWarp made to look more retail authentic.  Can't figure out how to make it not play the 'npc untargeted' sound though like retail.
Music command has second argument for transition type.  Added an overloaded function in Player.cs to support this.
Setappearance adjusted to work again on player targets.
DftWil updated to cover near everything.
Re-added shop-related luas that were removed for some reason.
2022-02-05 13:56:58 -05:00
Filip Maj
56ba641e2a Fixed PrivateAreas not working due to a bad actor id colliding with players. 2022-02-05 12:15:22 -05:00
Filip Maj
3ad30460d8 Removed spawn locations warping. Fixed event packet str len. Fixed some scripts. Fixed doors not working. 2022-02-05 09:55:18 -05:00
Filip Maj
ff074c8394 Bunch of shop scripts added (by Jorge) 2022-01-29 10:01:31 -05:00
CuriousJorge
bad51717c2 Minor script fixes
=============
ChocoboRideCommand - Fixed the mount speed to be retail accurate.
TeleportCommand            - Added anima costs, mount check, and placeholder for Favoured destinations
nudge/spawn/warpid        - Plus 1 to GetPos() arrays
2022-01-28 02:29:45 -05:00
Filip Maj
26fd79bea5 Removed all the unique talk defaults for Wil region (thx Jorge). Got most of man0l0 working with the new system. Fixed nullterm str parsing. 2022-01-27 17:38:15 -05:00
Filip Maj
6e869af4fb Fixed flags being backwards 2022-01-26 01:17:59 -05:00
Filip Maj
93c90df797 Got limsa opening working again 2022-01-26 01:15:02 -05:00
Filip Maj
c38caffaf1 Fixed bug with dialog treating all characters as men. 2022-01-25 22:55:39 -05:00
Filip Maj
958a87edf2 Updated Scripts, removed all the old unique ones for the opening quest. 2022-01-25 22:54:44 -05:00
Filip Maj
2279ee7017 Started mass overhaul of quests and related components like small talk. Fixed some scripts. More fixes required. 2022-01-24 23:49:10 -05:00
Filip Maj
df49eefadb Added recipe resolver 2021-02-26 21:10:01 -05:00
1004 changed files with 28758 additions and 18087 deletions

View File

@@ -0,0 +1,204 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Meteor.Common
{
public class Bitstream
{
private byte[] Data;
public Bitstream(uint numBits, bool setAllTrue = false)
{
Debug.Assert(numBits % 8 == 0);
Debug.Assert(numBits % 4 == 0);
Data = new byte[numBits / 8];
if (setAllTrue)
SetAll(true);
}
public Bitstream(bool[] boolArray)
{
Data = Utils.ConvertBoolArrayToBinaryStream(boolArray);
}
private Bitstream(byte[] byteArray)
{
Data = byteArray;
}
public void SetAll(bool to)
{
for (int i = 0; i < Data.Length; i += 4)
{
Data[i] = Data[i + 1] = Data[i + 2] = Data[i + 3] = (byte)(to ? 0xFF : 0x00);
}
}
public void SetTo(Bitstream result)
{
Debug.Assert(Data.Length == result.Data.Length);
for (int i = 0; i < result.Data.Length; i += 4)
{
Data[i] = result.Data[i];
Data[i + 1] = result.Data[i + 1];
Data[i + 2] = result.Data[i + 2];
Data[i + 3] = result.Data[i + 3];
}
}
public void SetTo(bool[] result)
{
Debug.Assert(Data.Length == result.Length / 8);
Data = Utils.ConvertBoolArrayToBinaryStream(result);
}
public bool Get(uint at)
{
return Get((int)at);
}
public bool Get(int at)
{
int bytePos = at / 8;
int bitPos = at % 8;
return (Data[bytePos] & (1 << bitPos)) != 0;
}
public void Set(uint at)
{
Set((int)at);
}
public void Set(int at)
{
int bytePos = at / 8;
int bitPos = at % 8;
Data[bytePos] |= (byte)(1 << bitPos);
}
public void Clear(uint at)
{
Clear((int)at);
}
public void Clear(int at)
{
int bytePos = at / 8;
int bitPos = at % 8;
Data[bytePos] &= (byte)~(1 << bitPos);
}
public void NOT()
{
for (int i = 0; i < Data.Length; i += 4)
{
Data[i] = (byte)~Data[i];
Data[i + 1] = (byte)~Data[i + 1];
Data[i + 2] = (byte)~Data[i + 2];
Data[i + 3] = (byte)~Data[i + 3];
}
}
public void OR(Bitstream other)
{
Debug.Assert(Data.Length == other.Data.Length);
for (int i = 0; i < Data.Length; i += 4)
{
Data[i] |= other.Data[i];
Data[i + 1] |= other.Data[i + 1];
Data[i + 2] |= other.Data[i + 2];
Data[i + 3] |= other.Data[i + 3];
}
}
public void AND(Bitstream other)
{
Debug.Assert(Data.Length == other.Data.Length);
for (int i = 0; i < Data.Length; i += 4)
{
Data[i] &= other.Data[i];
Data[i + 1] &= other.Data[i + 1];
Data[i + 2] &= other.Data[i + 2];
Data[i + 3] &= other.Data[i + 3];
}
}
public void XOR(Bitstream other)
{
Debug.Assert(Data.Length == other.Data.Length);
for (int i = 0; i < Data.Length; i += 4)
{
Data[i] ^= other.Data[i];
Data[i + 1] ^= other.Data[i + 1];
Data[i + 2] ^= other.Data[i + 2];
Data[i + 3] ^= other.Data[i + 3];
}
}
public Bitstream Copy()
{
byte[] copy = new byte[Data.Length];
Array.Copy(Data, copy, Data.Length);
return new Bitstream(copy);
}
public byte[] GetBytes()
{
return Data;
}
public byte[] GetSlice(ushort from, ushort to)
{
int remainder = ((to - from) % 8 != 0) ? 1 : 0;
byte[] toReturn = new byte[((to - from) / 8) + remainder + 1];
toReturn[toReturn.Length - 1] = 0x3;
byte curByte = 0;
int destByteIndx = 0;
int destShiftIndx = 0;
int srcByteIndx = from / 8;
int srcShiftIndx = from % 8;
for (int i = from; i <= to; i++)
{
// Skip Zeros
if (Data[srcByteIndx] == 0)
{
srcByteIndx++;
srcShiftIndx = 0;
destByteIndx++;
i += 8;
continue;
}
bool val = (Data[srcByteIndx] & (1 << srcShiftIndx++)) != 0;
curByte |= (byte)((val ? 1 : 0) << destShiftIndx++);
if (srcShiftIndx == 8)
{
srcShiftIndx = 0;
srcByteIndx++;
}
if (destShiftIndx == 8)
{
toReturn[destByteIndx++] = curByte;
destShiftIndx = 0;
curByte = 0;
}
}
if (destByteIndx == toReturn.Length - 2)
toReturn[destByteIndx] = curByte;
return toReturn;
}
}
}

View File

@@ -87,6 +87,7 @@
<ItemGroup> <ItemGroup>
<Compile Include="BasePacket.cs" /> <Compile Include="BasePacket.cs" />
<Compile Include="Bitfield.cs" /> <Compile Include="Bitfield.cs" />
<Compile Include="Bitstream.cs" />
<Compile Include="Blowfish.cs" /> <Compile Include="Blowfish.cs" />
<Compile Include="EfficientHashTables.cs" /> <Compile Include="EfficientHashTables.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />

View File

@@ -245,7 +245,7 @@ namespace Meteor.Common
{ {
for (var bitCount = 0; bitCount < 8; bitCount++) for (var bitCount = 0; bitCount < 8; bitCount++)
{ {
if (i + bitCount >= array.Length) if (i + bitCount >= array.Length - 1)
break; break;
data[dataCounter] = (byte)(((array[i + bitCount] ? 1 : 0) << 7 - bitCount) | data[dataCounter]); data[dataCounter] = (byte)(((array[i + bitCount] ? 1 : 0) << 7 - bitCount) | data[dataCounter]);
} }
@@ -255,6 +255,26 @@ namespace Meteor.Common
return data; return data;
} }
public static bool[] ConvertBinaryStreamToBoolArray(byte[] bytes)
{
bool[] data = new bool[bytes.Length * 8];
int boolCounter = 0;
for (int i = 0; i < bytes.Length; i ++)
{
if (bytes[i] == 0)
{
boolCounter += 8;
continue;
}
for (int bitCount = 0; bitCount < 8; bitCount++)
data[boolCounter++] = (bytes[i] >> bitCount & 1) == 1;
}
return data;
}
public static string ToStringBase63(int number) public static string ToStringBase63(int number)
{ {
var lookup = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; var lookup = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
@@ -267,7 +287,20 @@ namespace Meteor.Common
public static string ReadNullTermString(BinaryReader reader, int maxSize = 0x20) public static string ReadNullTermString(BinaryReader reader, int maxSize = 0x20)
{ {
return Encoding.ASCII.GetString(reader.ReadBytes(maxSize)).Trim(new[] { '\0' }); long pos = reader.BaseStream.Position;
int size = 0;
for (int i = 0; i < maxSize; i++)
{
if (reader.ReadByte() == 0)
{
size = i;
break;
}
}
reader.BaseStream.Seek(pos, SeekOrigin.Begin);
string result = Encoding.ASCII.GetString(reader.ReadBytes(size));
reader.BaseStream.Seek(pos + maxSize, SeekOrigin.Begin);
return result;
} }
public static void WriteNullTermString(BinaryWriter writer, string value, int maxSize = 0x20) public static void WriteNullTermString(BinaryWriter writer, string value, int maxSize = 0x20)

View File

@@ -0,0 +1,19 @@
--[[
PopulaceMenuMan Script
Functions:
--]]
require ("global")
function init(npc)
return false, false, 0, 0;
end
function onEventStarted(player, npc, triggerName)
callClientFunction(player, "debugMenuEvent", player);
player:endEvent();
end

View File

@@ -0,0 +1,3 @@
function init(npc)
return false, false, 0, 0, 0, 0;
end

View File

@@ -0,0 +1,9 @@
require("global");
function init(npc)
return false, false, 0, 0;
end
function onEventStarted(player, npc, eventType, eventName)
player:EndEvent();
end

View File

@@ -1,5 +1,5 @@
require ("global") require ("global")
function init(npc) function init(npc)
return false, false, 0, 0, 5143, 326; return false, false, 0, 0, 0, 0;
end end

View File

@@ -1,5 +1,19 @@
require ("global") require ("global")
--[[
BgKeepout Script
Used to send a msg to the player that they cannot proceed passed this point. Invisible walls are
linked to this object.
]]
function init(npc) function init(npc)
return false, false, 0, 0; return false, false, 0, 0;
end end
function onEventStarted(player, npc, triggerName)
player:SendGameMessage(player, GetWorldMaster(), 60001, 0x20);
player:EndEvent();
end

View File

@@ -1,5 +1,95 @@
require ("global") require ("global")
function init(npc) --[[
return false, false, 0, 0;
Elevator Standard Script
Functions:
elevatorAskLimsa001(eventNum) - Shows the ask dialog, and plays the event cutscenes for the Crow's Head Lift Lvl 1.
elevatorAskLimsa002(eventNum) - Shows the ask dialog, and plays the event cutscenes for the Crow's Head Lift Lvl 2.
elevatorAskLimsa003(eventNum) - Shows the ask dialog, and plays the event cutscenes for the Crow's Head Lift Lvl 3.
elevatorAskUldah001(eventNum) - Shows the ask dialog, and plays the event cutscenes for the Wellhead Lift Lvl 1.
elevatorAskUldah002(eventNum) - Shows the ask dialog, and plays the event cutscenes for the Wellhead Lift Lvl 2.
elevatorAskUldah003(eventNum) - Shows the ask dialog, and plays the event cutscenes for the Wellhead Lift Lvl 3.
elevatorQuestAskEvent(questId) - Special quest related elevator dialog.
Notes:
Script to control the elevators in Limsa Lominsa and Ul'dah. Each elevator entrance has a specific event for it's floor.
The only param is used to either show the ask dialog to the player or player the appropriate cutscene given the choice
made.
--]]
function onEventStarted(player, npc, eventType, eventName)
local actorClassId = npc.GetActorClassId();
-- Limsa; Crow's Lift Level 1
if (actorClassId == 1290007) then
local floorChoice = callClientFunction(player, "elevatorAskLimsa001", 0);
if (floorChoice == 1) then
callClientFunction(player, "elevatorAskLimsa001", 1);
endEventAndWarp(player, 133, -447, 40, 220, -1.574);
elseif (floorChoice == 2) then
callClientFunction(player, "elevatorAskLimsa001", 2);
endEventAndWarp(player, 133, -458, 92, 175, -0.383);
end
-- Limsa; Crow's Lift Level 2
elseif (actorClassId == 1290008) then
local floorChoice = callClientFunction(player, "elevatorAskLimsa002", 0);
if (floorChoice == 1) then
callClientFunction(player, "elevatorAskLimsa002", 1);
endEventAndWarp(player, 133, -447, 19, 220, -1.574);
elseif (floorChoice == 2) then
callClientFunction(player, "elevatorAskLimsa002", 2);
endEventAndWarp(player, 133, -458, 92, 175, -0.383);
end
-- Limsa; Crow's Lift Level 3
elseif (actorClassId == 1290009) then
local floorChoice = callClientFunction(player, "elevatorAskLimsa003", 0);
if (floorChoice == 1) then
callClientFunction(player, "elevatorAskLimsa003", 1);
endEventAndWarp(player, 133, -447, 19, 220, -1.574);
elseif (floorChoice == 2) then
callClientFunction(player, "elevatorAskLimsa003", 2);
endEventAndWarp(player, 133, -447, 40, 220, -1.574);
end
-- Ul'dah; Wellhead Lift Level 1
elseif (actorClassId == 1090460) then
local floorChoice = callClientFunction(player, "elevatorAskUldah001", 0);
if (floorChoice == 1) then
callClientFunction(player, "elevatorAskUldah001", 1);
endEventAndWarp(player, 209, -116.78, 222, 115.7, 2.85);
elseif (floorChoice == 2) then
callClientFunction(player, "elevatorAskUldah001", 2);
endEventAndWarp(player, 209, -121.60, 269.8, 135.28, -0.268);
end
-- Ul'dah; Wellhead Lift Level 2
elseif (actorClassId == 1090461) then
local floorChoice = callClientFunction(player, "elevatorAskUldah002", 0);
if (floorChoice == 1) then
callClientFunction(player, "elevatorAskUldah002", 1);
endEventAndWarp(player, 175, -116.78, 198, 115.7, -2.8911);
elseif (floorChoice == 2) then
callClientFunction(player, "elevatorAskUldah002", 2);
endEventAndWarp(player, 209, -121.60, 269.8, 135.28, -0.268);
end
-- Ul'dah; Wellhead Lift Level 3
elseif (actorClassId == 1090462) then
local floorChoice = callClientFunction(player, "elevatorAskUldah003", 0);
if (floorChoice == 1) then
callClientFunction(player, "elevatorAskUldah003", 1);
endEventAndWarp(player, 175, -116.78, 198, 115.7, -2.8911);
elseif (floorChoice == 2) then
callClientFunction(player, "elevatorAskUldah003", 2);
endEventAndWarp(player, 209, -116.78, 222, 115.7, 2.85);
end
end
end
function endEventAndWarp(player, zoneId, x, y, z, rotation)
player:EndEvent();
GetWorldManager():DoZoneChange(player, zoneId, nil, 0, 15, x, y, z, rotation);
end end

View File

@@ -82,15 +82,12 @@ city = {
[1500394] = 3, -- Ul'dah : Edine [1500394] = 3, -- Ul'dah : Edine
} }
function onEventStarted(player, npc, eventType, eventName)
function onEventStarted(player, npc, triggerName)
local npcCity = city[npc:GetActorClassId()] or 1; local npcCity = city[npc:GetActorClassId()] or 1;
local wardPlaceName = CITY_INFO[npcCity][1]; -- Market Wards category name. Identical in all languages except Japanese local marketPlaceName = CITY_INFO[npcCity][1]; -- Market Wards category name. Identical in all languages except Japanese
local exitPlaceName = CITY_INFO[npcCity][2]; -- Central Limsa Lominsa / Heartstream / The Fronds local exitPlaceName = CITY_INFO[npcCity][2]; -- Central Limsa Lominsa / Heartstream / The Fronds
local gcHQPlaceName = CITY_INFO[npcCity][3]; -- Maelstrom Command / Adders' Nest / Hall of Flames local gcHQPlaceName = CITY_INFO[npcCity][3]; -- Maelstrom Command / Adders' Nest / Hall of Flames
local questAreaName = 0; --CITY_INFO[npcCity][4]; -- Sailors Ward / Peasants Ward / Merchants Ward local questPlaceName = CITY_INFO[npcCity][4]; -- Sailors Ward / Peasants Ward / Merchants Ward
local wardListStart = CITY_INFO[npcCity][5]; -- Starting id for the market wards local wardListStart = CITY_INFO[npcCity][5]; -- Starting id for the market wards
local wardListCount = CITY_INFO[npcCity][6]; -- Amount of wards in the list local wardListCount = CITY_INFO[npcCity][6]; -- Amount of wards in the list
local showItemSearchCounter = false; local showItemSearchCounter = false;
@@ -98,19 +95,30 @@ function onEventStarted(player, npc, triggerName)
local worldMaster = GetWorldMaster(); local worldMaster = GetWorldMaster();
local pos = player:GetPos(); local pos = player:GetPos();
local currZone = pos[4]; local currZone = pos[5];
local currRegion = player.CurrentArea.RegionId;
local quests = player:GetQuestsForNpc(npc);
if (currZone == 133 or currZone == 230 or currZone == 155 or currZone == 206 or currZone == 175 or currZone == 209) then -- City entrance specific stuff
if (currRegion == 101 or currRegion == 103 or currRegion == 104) then
exitPlaceName = 0; -- If in city, hide city menu option exitPlaceName = 0; -- If in city, hide city menu option
elseif (currZone == 232 or currZone == 234 or currZone == 233) then
gcHQPlaceName = 0; -- If in GC Office, hide office menu option -- If no quests attached to this entrence, don't show quest area
if (#quests == 0) then
questPlaceName = 0;
end
end
-- If in GC Office, hide office menu option
if (currZone == 232 or currZone == 234 or currZone == 233) then
gcHQPlaceName = 0;
end end
choice = callClientFunction(player, "eventPushChoiceAreaOrQuest", exitPlaceName, wardPlaceName, gcHQPlaceName, questAreaName, showItemSearchCounter, itemSearchId); choice = callClientFunction(player, "eventPushChoiceAreaOrQuest", exitPlaceName, marketPlaceName, gcHQPlaceName, questPlaceName, showItemSearchCounter, itemSearchId);
while (true) do while (true) do
if choice == wardPlaceName then -- Market Wards if choice == marketPlaceName then -- Market Wards
wardSelect = callClientFunction(player, "eventPushStepPrvMarket", wardListStart, wardListCount, 0); wardSelect = callClientFunction(player, "eventPushStepPrvMarket", wardListStart, wardListCount, 0);
if wardSelect and (wardSelect >= wardListStart and wardSelect <= (wardListStart+wardListCount)) then if wardSelect and (wardSelect >= wardListStart and wardSelect <= (wardListStart+wardListCount)) then
@@ -139,11 +147,14 @@ function onEventStarted(player, npc, triggerName)
wait(1); wait(1);
GetWorldManager():DoZoneChange(player, warp[1], nil, 0, 0x02, warp[2], warp[3], warp[4], warp[5]); GetWorldManager():DoZoneChange(player, warp[1], nil, 0, 0x02, warp[2], warp[3], warp[4], warp[5]);
break; break;
elseif (choice == 2095 or choice == 3095) then -- Quest
quests[1]:OnPush(player, npc, eventName);
return;
elseif (choice == 0 or choice == -3) then -- Menu Closed elseif (choice == 0 or choice == -3) then -- Menu Closed
break; break;
end end
choice = callClientFunction(player, "eventPushChoiceAreaOrQuest", exitPlaceName, wardPlaceName, gcHQPlaceName, questAreaName, showItemSearchCounter, itemSearchId); choice = callClientFunction(player, "eventPushChoiceAreaOrQuest", exitPlaceName, marketPlaceName, gcHQPlaceName, questAreaName, showItemSearchCounter, itemSearchId);
end end

View File

@@ -1,23 +1,63 @@
require ("global") require ("global")
DREAM_ITEM = {
{[1] = 3010419, [2] = 3010420, [3] = 3010421}, -- Mizzenmast/Roost/Hourglass Biscuit
3010003, -- Boiled Egg
3010101, -- Grilled Carp
3010001, -- Meat Miq'abob
3010402, -- Ginger Cookie
3020001, -- Potion
3020101, -- Ether
1000003, -- 5x Crystal Shards (Fire)
1000004, -- 5x Crystal Shards (Ice)
1000005, -- 5x Crystal Shards (Wind)
1000006, -- 5x Crystal Shards (Earth)
1000007, -- 5x Crystal Shards (Lightning)
1000008 -- 5x Crystal Shards (Water)
}
function init(npc) function init(npc)
return false, false, 0, 0; return false, false, 0, 0;
end end
function onEventStarted(player, npc, triggerName) function onEventStarted(player, npc, triggerName)
local choice = callClientFunction(player, "askLogout", player);
choice = callClientFunction(player, "askLogout", player);
-- Quit
if (choice == 2) then if (choice == 2) then
player:SetSleeping(); player:SetSleeping();
player:QuitGame(); player:QuitGame();
-- Logout
elseif (choice == 3) then elseif (choice == 3) then
player:SetSleeping(); player:SetSleeping();
player:Logout(); player:Logout();
-- Heck the bed
elseif (choice == 4) then elseif (choice == 4) then
player:SendMessage(33, "", "Heck the bed"); -- Give items based on dream
local dreamCode = player:GetLoginDreamCode();
if (dreamCode >= 21 and dreamCode <= 33) then
local innCode = player:GetInnCode();
local itemCode = DREAM_ITEM[dreamCode - 20];
-- Get biscuit for inn
if (dreamCode == 21) then
itemCode = itemCode[innCode];
end
-- If crystals you get x5 otherwise x1.
if (dreamCode > = 28 and dreamCode <= 33) then
player:AddItem(itemCode, 5);
else
player:AddItem(itemCode, 1);
end
-- Clear the code so they player doesn't keep getting things
player:SetLoginDreamCode(0);
else
-- Otherwise show standard message
player:SendGameMessage(player, npc, 7, 0x20);
end
end end
player:EndEvent(); player:EndEvent();
end end

View File

@@ -15,10 +15,37 @@ function init(npc)
end end
function onEventStarted(player, npc, triggerName) function onEventStarted(player, npc, triggerName)
choice = callClientFunction(player, "eventDoorMoveAsk"); local choice = callClientFunction(player, "eventDoorMoveAsk");
if (choice == 1) then if (choice == 1) then
local activeQuests = player:GetQuestsForNpc(npc);
-- Either let the player choose the quest or start it if it's the only one.
local chosenQuest;
if (#activeQuests > 1) then
local currentPage = 0;
local numPages = math.floor((#activeQuests-1)/4) + 1;
while (true) do
local page, index = callClientFunction(player, "switchEvent", activeQuests[currentPage * 4 + 1], activeQuests[currentPage * 4 + 2], possibleQuests[currentPage * 4 + 3], possibleQuests[currentPage * 4 + 4], currentPage + 1, numPages, 0x3F1);
if (page == 0) then
chosenQuest = activeQuests[(currentPage * 4) + index];
break;
elseif (page > 0) then
currentPage = page - 1;
else
player:EndEvent();
return;
end
end
elseif (#activeQuests == 1) then
chosenQuest = activeQuests[1];
end
if (chosenQuest ~= nil) then
chosenQuest:OnPush(player, npc, eventName);
return;
end
end end
player:EndEvent(); player:EndEvent();

View File

@@ -4,7 +4,7 @@ function init(npc)
return false, false, 0, 0; return false, false, 0, 0;
end end
function onEventStarted(player, npc, triggerName) function onEventStarted(player, npc, eventType, eventName)
defaultFst = GetStaticActor("DftFst"); defaultFst = GetStaticActor("DftFst");
choice = callClientFunction(player, "delegateEvent", player, defaultFst, "defaultTalkWithInn_ExitDoor", nil, nil, nil); choice = callClientFunction(player, "delegateEvent", player, defaultFst, "defaultTalkWithInn_ExitDoor", nil, nil, nil);

View File

@@ -1,3 +1,5 @@
require("global");
function init(npc) function init(npc)
return false, false, 0, 0; return false, false, 0, 0;
end end
@@ -7,7 +9,7 @@ function onEventStarted(player, npc, triggerName)
worldMaster = GetWorldMaster(); worldMaster = GetWorldMaster();
player:SendGameMessage(player, worldMaster, 34109, 0x20); player:SendGameMessage(player, worldMaster, 34109, 0x20);
elseif (triggerName == "exit") then elseif (triggerName == "exit") then
GetWorldManager():DoPlayerMoveInZone(player, 5); GetWorldManager():DoPlayerMoveInZone(player, 356.09, 3.74, -701.62, -1.4);
end end
player:EndEvent(); player:EndEvent();
end end

View File

@@ -0,0 +1,18 @@
require("global");
function init(npc)
return false, false, 0, 0;
end
function onEventStarted(player, npc, eventType, eventName)
if (eventType == ETYPE_PUSH) then
if (eventName == "caution") then
worldMaster = GetWorldMaster();
player:SendGameMessage(player, worldMaster, 34109, 0x20);
elseif (eventName == "exit") then
GetWorldManager():DoPlayerMoveInZone(player, 5.36433, 196, 133.656, -2.84938);
end
end
player:EndEvent();
end

View File

@@ -0,0 +1,9 @@
require("global");
function init(npc)
return false, false, 0, 0;
end
function onEventStarted(player, npc, eventType, eventName)
player:EndEvent();
end

View File

@@ -0,0 +1,9 @@
require("global");
function init(npc)
return false, false, 0, 0;
end
function onEventStarted(player, npc, eventType, eventName)
player:EndEvent();
end

View File

@@ -1,12 +1,37 @@
function init(npc) require("global");
--[[
PrivateAreaPastExit
This object contains the player inside a PrivateAreaPast, stopping them from escaping it's bounds. It is the
object that generates the circle graphic on the minimap. This object always has two push triggers, an inner
and outer inverted circle. The inner one is named "caution" and the outer one is named "exit". When the player
leaves the inner circle a warning is shown and when they leave the outer circle they either leave the instance
or get warped back to the center.
]]
function init(privAreaExit)
return false, false, 0, 0; return false, false, 0, 0;
end end
function onEventStarted(player, npc, triggerName) function onEventStarted(player, privAreaExit, eventType, eventName)
if (triggerName == "caution") then
worldMaster = GetWorldMaster();
player:SendGameMessage(player, worldMaster, 34109, 0x20);
elseif (triggerName == "exit") then
end
player:EndEvent(); player:EndEvent();
if (eventName == "caution") then
player:SendGameMessage(player, GetWorldMaster(), 34109, MESSAGE_TYPE_SYSTEM); -- You are about to leave the instance.
elseif (eventName == "exit") then
local area = privAreaExit.CurrentArea;
if (area.IsPrivate()) then
-- If you can leave, warp to public zone and show message.
if (area.CanExitPrivateArea()) then
player:SendGameMessage(player, GetWorldMaster(), 34110, MESSAGE_TYPE_SYSTEM); -- You have left the instance.
--GetWorldManager():WarpToPublicArea(player);
-- Otherwise warp back to the center of the zone.
else
--GetWorldManager():WarpToCharaPosition(player, privAreaExit);
end
end
end
end end

View File

@@ -1,19 +1,108 @@
--[[
TaskBoard
Operates the Task Board actor located in each of the Adventurers' Guilds.
Calls from the Noc000 static actor, which also applies to specific guild NPCs involved in that as well.
Functions: (only including those from Noc000 which apply to the Task Board)
pETaskBoardAskLimsa()
Desc: Show guild menu with valid options for Limsa Lominsa.
Params: None
Returns: Value dictating which item on the list was selected.
pETaskBoardAskUldah()
Desc: Show guild menu with valid options for Ul'dah.
Params: None
Returns: Value dictating which item on the list was selected.
pETaskBoardAskGridania()
Desc: Show guild menu with valid options for Gridania.
Params: None
Returns: Value dictating which item on the list was selected.
pETaskBoardGuild(guildId)
Desc: Plays back a message "The following tasks are available:".
Params: * guildId - Class Id from xtx_text_jobName. EN doesn't make use of it, but JP/DE/FR do. Thanks Koji.
pETaskBoardOrder(recommendedLvl itemId, hq, amount)
Desc: Takes the params and tells the player what the guild still needs turned in.
Params: * recommendedLvl - Recommended level the player be at
* itemId - Id of the item from xtx_itemName
* hq - Quality of item (1 = NQ, 2 = +1, 3 = +2 4 = +3)
* amount - Amount needed (The amount the player needs to turn-in, not the amount guild needs overall)
--]]
require ("global") require ("global")
local guildItem = {
-- [guildId] = { (recommendedLvl itemId, hq, amount, 2nd-recommendedLvl 2nd-itemId, 2nd-hq, 2nd-amount) }
[29] = {1, 4100604, 1, 1, 10, 4030706, 1, 1}, -- Carpenters'
[30] = {1, 4040004, 1, 1, 10, 4030004, 1, 1}, -- Blacksmiths'
[31] = {1, 6080009, 1, 1, 10, 8070606, 1, 1}, -- Armorers'
[32] = {1, 5020007, 1, 1, 10,10004103, 1, 1}, -- Goldsmiths'
[33] = {1, 4020107, 1, 1, 10, 8031514, 1, 1}, -- Leatherworkers'
[34] = {1, 8030819, 1, 1, 10, 8030821, 1, 1}, -- Weavers'
[35] = {1, 3011530, 1,12, 10, 3020527, 1, 4}, -- Alchemists'
[36] = {1, 3010103, 1, 6, 10, 3011503, 1, 6}, -- Culinarians'
[39] = {1,10009101, 1,10, 10,10001116, 1,10}, -- Miners'
[40] = {1,10005403, 1,10, 10,10008106, 1,10}, -- Botanists'
[41] = {1, 3011106, 1,10, 10, 3011113, 1,10} -- Fishermans'
}
local menuToGuild = { -- Get a guild id from a given task board's Return result
[1] = {0, 30, 31, 36, 41}, -- Limsa
[2] = {0, 29, 33, 40, 0}, -- Gridania
[3] = {0, 32, 34, 35, 39} -- Ul'dah
}
function init(npc) function init(npc)
return false, false, 0, 0; return false, false, 0, 0;
end end
function onEventStarted(player, npc, triggerName) function onEventStarted(player, npc, triggerName)
questNOC = GetStaticActor("Noc000");
local questNOC = GetStaticActor("Noc000");
local npcId = npc:GetActorClassId();
while (true) do
local guildId = 0;
if (npc:GetActorClassId() == 1200193) then if (npcId == 1200193) then -- Limsa
callClientFunction(player, "delegateEvent", player, questNOC, "pETaskBoardAskLimsa", nil, nil, nil); local choice = callClientFunction(player, "delegateEvent", player, questNOC, "pETaskBoardAskLimsa");
elseif (npc:GetActorClassId() == 1200194) then
callClientFunction(player, "delegateEvent", player, questNOC, "pETaskBoardAskUldah", nil, nil, nil); if (choice == 1 or choice == nil) then
else break; -- Exited menu
callClientFunction(player, "delegateEvent", player, questNOC, "pETaskBoardAskGridania", nil, nil, nil); else
end guildId = menuToGuild[1][choice];
end
player:EndEvent(); elseif (npcId == 1200194) then -- Ul'dah
end local choice = callClientFunction(player, "delegateEvent", player, questNOC, "pETaskBoardAskUldah");
if (choice == 1 or choice == nil) then
break; -- Exited menu
else
guildId = menuToGuild[3][choice];
end
else -- Gridania
local choice = callClientFunction(player, "delegateEvent", player, questNOC, "pETaskBoardAskGridania");
if (choice == 1 or choice == nil) then
break; -- Exited menu
else
guildId = menuToGuild[2][choice];
end
end
if (guildId > 0) then
callClientFunction(player, "delegateEvent", player, questNOC, "pETaskBoardGuild", guildId);
local gItem = guildItem[guildId]
callClientFunction(player, "delegateEvent", player, questNOC, "pETaskBoardOrder", unpack(gItem, 1, 4));
callClientFunction(player, "delegateEvent", player, questNOC, "pETaskBoardOrder", unpack(gItem, 5, 8));
end
end
player:EndEvent();
end

View File

@@ -107,7 +107,7 @@ function doLevequestInit(player, aetheryte)
player:SendGameMessage(worldMaster, 50036, 0x20, glId, player); player:SendGameMessage(worldMaster, 50036, 0x20, glId, player);
player:PlayAnimation(getGLStartAnimationFromSheet(guildleveData.borderId, guildleveData.plateId, true)); player:PlayAnimation(getGLStartAnimationFromSheet(guildleveData.borderId, guildleveData.plateId, true));
director = player:GetZone():CreateGuildleveDirector(glId, difficulty, player); director = player.CurrentArea:CreateGuildleveDirector(glId, difficulty, player);
player:AddDirector(director); player:AddDirector(director);
director:StartDirector(true, glId) director:StartDirector(true, glId)

View File

@@ -33,6 +33,30 @@ end
function onEventStarted(player, aetheryte, triggerName) function onEventStarted(player, aetheryte, triggerName)
-- Main Scenario Intro Quests
if (player:HasQuest(110002) == true) then
require ("quests/man/man0l1");
local quest = player:GetQuest("Man0l1");
if (quest:GetSequence() == SEQ_003) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent025");
quest:StartSequence(SEQ_005);
end
elseif (player:HasQuest(110006) == true) then
require ("quests/man/man0g1");
local quest = player:GetQuest("Man0g1");
if (quest:GetSequence() == SEQ_005) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent013");
--quest:StartSequence(???);
end
elseif (player:HasQuest(110010) == true) then
require ("quests/man/man0u1");
local quest = player:GetQuest("Man0u1");
if (quest:GetSequence() == SEQ_005) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent013");
quest:StartSequence(SEQ_010);
end
end
if (player:GetGuildleveDirector() ~= nil) then if (player:GetGuildleveDirector() ~= nil) then
doGuildleveMenu(player, aetheryte); doGuildleveMenu(player, aetheryte);
else else
@@ -142,7 +166,7 @@ function doLevequestInit(player, aetheryte)
player:SendGameMessage(worldMaster, 50036, 0x20, glId, player); player:SendGameMessage(worldMaster, 50036, 0x20, glId, player);
player:PlayAnimation(getGLStartAnimationFromSheet(guildleveData.borderId, guildleveData.plateId, true)); player:PlayAnimation(getGLStartAnimationFromSheet(guildleveData.borderId, guildleveData.plateId, true));
director = player:GetZone():CreateGuildleveDirector(glId, difficulty, player); director = player.CurrentArea:CreateGuildleveDirector(glId, difficulty, player);
player:AddDirector(director); player:AddDirector(director);
director:StartDirector(true, glId); director:StartDirector(true, glId);

View File

@@ -61,7 +61,7 @@ function onEventStarted(player, npc, triggerName)
local killCount = 50; local killCount = 50;
callClientFunction(player, "caravanGuardOffer", areaName, areaName2, playerGC); callClientFunction(player, "caravanGuardOffer", areaName, areaName2, playerGC);
--callClientFunction(player, "caravanGuardReward", cargo, nil, areaName, playerGC, killCount, areaName2); --callClientFunction(player, "caravanGuardReward", cargo, nil, areaName, playerGC, killCount, areaName2);
--player:SendGameMessageDisplayIDSender(npc, 6, MESSAGE_TYPE_SAY, npc.displayNameId); --player:SendGameMessageLocalizedDisplayName(npc, 6, MESSAGE_TYPE_SAY, npc.displayNameId);
player:EndEvent(); player:EndEvent();

View File

@@ -28,7 +28,8 @@ local rentalTime = 10;
local gcIssuances = { local gcIssuances = {
[1500006] = 2001004, [1500006] = 2001004,
[1500061] = 2001005, [1500061] = 2001005,
[1000840] = 2001006 [1000840] = 2001006,
[1500059] = 0
}; };
local startAppearances = { local startAppearances = {
@@ -40,7 +41,8 @@ local startAppearances = {
local cityExits = { local cityExits = {
[1500006] = {133, -6.032, 46.356, 132.572, 3.034}, [1500006] = {133, -6.032, 46.356, 132.572, 3.034},
[1500061] = {150, 333.271, 5.889, -943.275, 0.794}, [1500061] = {150, 333.271, 5.889, -943.275, 0.794},
[1000840] = {170, -26.088, 181.846, -79.438, 2.579} [1000840] = {170, -26.088, 181.846, -79.438, 2.579},
[1500059] = {172, -2133.028, 15.476, -421.471, 1.5}
}; };
function init(npc) function init(npc)
@@ -48,8 +50,9 @@ function init(npc)
end end
function onEventStarted(player, npc, triggerName) function onEventStarted(player, npc, triggerName)
local classId = npc:GetActorClassId();
local curLevel = 20; -- TODO: pull from character local curLevel = 20; -- TODO: pull from character
local hasIssuance = player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(gcIssuances[npc:GetActorClassId()]); local hasIssuance = player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(gcIssuances[classId]);
local hasChocobo = player.hasChocobo; local hasChocobo = player.hasChocobo;
if (hasChocobo == false) then -- Let GMs auto have the issuance for debugging if (hasChocobo == false) then -- Let GMs auto have the issuance for debugging
@@ -57,50 +60,64 @@ function onEventStarted(player, npc, triggerName)
end end
local hasFunds = (player:GetCurrentGil() >= rentalPrice); local hasFunds = (player:GetCurrentGil() >= rentalPrice);
callClientFunction(player, "eventTalkWelcome", player);
local menuChoice = callClientFunction(player, "eventAskMainMenu", player, curLevel, hasFunds, hasIssuance, hasChocobo, hasChocobo, 0); if ((classId == 1000840) and (player:HasQuest(110009))) then -- Cross-script Man0u0 dialog
local sequence = player:GetQuest(110009):getSequence();
if (menuChoice == 1) then -- Issuance option
if (sequence == 0) then
callClientFunction(player, "eventTalkMyChocobo", player); callClientFunction(player, "delegateEvent", player, GetStaticActor("Man0u0"), "processEvent000_13");
local nameResponse = callClientFunction(player, "eventSetChocoboName", true); elseif (sequence == 10) then
callClientFunction(player, "delegateEvent", player, GetStaticActor("Man0u0"), "processEvent020_7");
if (nameResponse == "") then -- Cancel Chocobo naming else
callClientFunction(player, "eventCancelChocoboName", player); player:EndEvent();
callClientFunction(player, "eventTalkStepBreak", player); end
player:EndEvent(); else
return; callClientFunction(player, "eventTalkWelcome", player);
else
local appearance = startAppearances[npc:GetActorClassId()]; local menuChoice = callClientFunction(player, "eventAskMainMenu", player, curLevel, hasFunds, hasIssuance, hasChocobo, hasChocobo, 0);
player:IssueChocobo(appearance, nameResponse);
if (menuChoice == 1) then -- Issuance option
callClientFunction(player, "eventAfterChocoboName", player);
callClientFunction(player, "eventTalkMyChocobo", player);
--Add Chocobo License and remove issuance local nameResponse = callClientFunction(player, "eventSetChocoboName", true);
if (player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(2001007) == false) then
player:GetItemPackage(INVENTORY_KEYITEMS):AddItem(2001007); if (nameResponse == "") then -- Cancel Chocobo naming
end callClientFunction(player, "eventCancelChocoboName", player);
player:GetItemPackage(INVENTORY_KEYITEMS):RemoveItem(gcIssuances[npc:GetActorClassId()], 1); callClientFunction(player, "eventTalkStepBreak", player);
player:EndEvent();
--Warp with the special chocobo warp mode. return;
mountChocobo(player); else
GetWorldManager():DoZoneChange(player, cityExits[npc:GetActorClassId()][1], nil, 0, SPAWN_CHOCOBO_GET, cityExits[npc:GetActorClassId()][2], cityExits[npc:GetActorClassId()][3], cityExits[npc:GetActorClassId()][4], cityExits[npc:GetActorClassId()][5]); local appearance = startAppearances[classId];
end player:IssueChocobo(appearance, nameResponse);
elseif(menuChoice == 2) then -- Summon Bird callClientFunction(player, "eventAfterChocoboName", player);
mountChocobo(player);
GetWorldManager():DoZoneChange(player, cityExits[npc:GetActorClassId()][1], nil, 0, SPAWN_NO_ANIM, cityExits[npc:GetActorClassId()][2], cityExits[npc:GetActorClassId()][3], cityExits[npc:GetActorClassId()][4], cityExits[npc:GetActorClassId()][5]); --Add Chocobo License and remove issuance
elseif(menuChoice == 3) then -- Change Barding if (player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(2001007) == false) then
callClientFunction(player, "eventTalkStepBreak", player); player:GetItemPackage(INVENTORY_KEYITEMS):AddItem(2001007);
elseif(menuChoice == 5) then -- Rent Bird end
mountChocobo(player, true, 1); player:GetItemPackage(INVENTORY_KEYITEMS):RemoveItem(gcIssuances[classId], 1);
GetWorldManager():DoZoneChange(player, cityExits[npc:GetActorClassId()][1], nil, 0, SPAWN_CHOCOBO_RENTAL, cityExits[npc:GetActorClassId()][2], cityExits[npc:GetActorClassId()][3], cityExits[npc:GetActorClassId()][4], cityExits[npc:GetActorClassId()][5]);
else --Warp with the special chocobo warp mode.
callClientFunction(player, "eventTalkStepBreak", player); mountChocobo(player);
end GetWorldManager():DoZoneChange(player, cityExits[classId][1], nil, 0, SPAWN_CHOCOBO_GET, cityExits[classId][2], cityExits[classId][3], cityExits[classId][4], cityExits[classId][5]);
end
elseif(menuChoice == 2) then -- Summon Bird
mountChocobo(player);
GetWorldManager():DoZoneChange(player, cityExits[classId][1], nil, 0, SPAWN_NO_ANIM, cityExits[classId][2], cityExits[classId][3], cityExits[classId][4], cityExits[classId][5]);
elseif(menuChoice == 3) then -- Change Barding
callClientFunction(player, "eventTalkStepBreak", player);
elseif(menuChoice == 5) then -- Rent Bird
mountChocobo(player, true, 10);
GetWorldManager():DoZoneChange(player, cityExits[classId][1], nil, 0, SPAWN_CHOCOBO_RENTAL, cityExits[classId][2], cityExits[classId][3], cityExits[classId][4], cityExits[classId][5]);
else
callClientFunction(player, "eventTalkStepBreak", player);
end
end
player:EndEvent(); player:EndEvent();
end end
@@ -114,6 +131,6 @@ function mountChocobo(player, isRental, rentalMinutes)
player:SendMountAppearance(); player:SendMountAppearance();
player:SetMountState(1); player:SetMountState(1);
player:ChangeSpeed(0.0, 5.0, 10.0, 10.0); player:ChangeSpeed(0.0, 3.6, 9.0, 9.0);
player:ChangeState(15); player:ChangeState(15);
end end

View File

@@ -4,10 +4,10 @@ PopulaceCompanyWarp Script
Functions: Functions:
eventTalkWelcome(player) - Start Text eventTalkWelcome(player) - Start Text
eventAskMainMenu(player, index) - Shows teleport menu, hides the teleport location at index value to prevent warping to the spot you're at eventAskMainMenu(player, index) - Shows teleport menu, hides the teleport location at index value to prevent warping to the spot you're at
eventAfterWarpOtherZone(player) - Fades out for warp eventAfterWarpOtherZone(player) - Fades out for warp
eventTalkStepBreak() - Ends talk eventTalkStepBreak() - Holds the client up for whatever reason?
--]] --]]
require ("global") require ("global")
@@ -82,39 +82,50 @@ function onEventStarted(player, npc, triggerName)
npcId = npc:GetActorClassId(); npcId = npc:GetActorClassId();
city = warpNpc[npcId][2]; city = warpNpc[npcId][2];
if (city == 1) then
if city == 1 then
if player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(passLimsa) then if player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(passLimsa) then
passCheck = 1; passCheck = 1;
else else
if passCheck == 0 then callClientFunction(player, "eventTalkWelcome", player); end if (passCheck == 0) then callClientFunction(player, "eventTalkWelcome", player); end
end; end;
elseif city == 2 then elseif (city == 2) then
if player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(passGrid) then -- if player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(passGrid) then
passCheck = 1;
-- else
-- if passCheck == 0 then callClientFunction(player, "eventTalkWelcome", player); end
--end;
elseif (city == 3) then
if (player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(passUldah)) then
passCheck = 1; passCheck = 1;
else else
if passCheck == 0 then callClientFunction(player, "eventTalkWelcome", player); end if (passCheck == 0) then callClientFunction(player, "eventTalkWelcome", player); end
end;
elseif city == 3 then
if player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(passUldah) then
passCheck = 1;
else
if passCheck == 0 then callClientFunction(player, "eventTalkWelcome", player); end
end end
end end
if passCheck == 1 then
if (passCheck == 1) then
choice = callClientFunction(player, "eventAskMainMenu", player, warpNpc[npcId][1]); choice = callClientFunction(player, "eventAskMainMenu", player, warpNpc[npcId][1]);
if choice == 0 then
--callClientFunction(player, "playereventTalkStepBreak"); if (choice ~= 0) then
player:EndEvent();
else
-- callClientFunction(player, "eventAfterWarpOtherZone", player); -- Commented out for now to prevent double fade-to-black for warp
callClientFunction(player, "eventAfterWarpOtherZone", player);
wait(1);
player:EndEvent(); player:EndEvent();
GetWorldManager():DoZoneChange(player, aethernet[city][choice].zone, nil, 0, 15, aethernet[city][choice].x, aethernet[city][choice].y, aethernet[city][choice].z, aethernet[city][choice].r); local player_zone = player:GetPos()[5];
spawnType = 0x0A;
if (player_zone == aethernet[city][choice].zone) then
GetWorldManager():DoPlayerMoveInZone(player, aethernet[city][choice].x, aethernet[city][choice].y, aethernet[city][choice].z, aethernet[city][choice].r, spawnType);
else
GetWorldManager():DoZoneChange(player, aethernet[city][choice].zone, nil, 0, spawnType, aethernet[city][choice].x, aethernet[city][choice].y, aethernet[city][choice].z, aethernet[city][choice].r);
end;
else
player:EndEvent();
end end
end end
player:EndEvent();
end end

View File

@@ -18,7 +18,51 @@ end
function onEventStarted(player, npc, triggerName) function onEventStarted(player, npc, triggerName)
-- Special case for A Slippery Stone and Cutthroat Prices
if (player:HasQuest(110737) == true) then
require ("quests/etc/etc3g3");
local quest = player:GetQuest("Etc3g3");
if (quest:GetSequence() == SEQ_000) then
local choice = callClientFunction(player, "delegateEvent", player, quest, "processEvent_005");
if (choice == 1) then
quest:StartSequence(SEQ_001);
addPlayerToAirship(player, 2);
end
player:EndEvent();
return;
end
elseif (player:HasQuest(110728) == true) then
require ("quests/etc/etc3u3");
local quest = player:GetQuest("Etc3u3");
if (quest:GetSequence() == SEQ_000) then
local choice = callClientFunction(player, "delegateEvent", player, quest, "processEvent_005");
if (choice == 1) then
quest:StartSequence(SEQ_001);
addPlayerToAirship(player, 3);
end
player:EndEvent();
return;
end
end
-- Otherwise normal operation
callClientFunction(player, "eventIn", player, false, nil, 5); callClientFunction(player, "eventIn", player, false, nil, 5);
player:EndEvent(); player:EndEvent();
end
function addPlayerToAirship(player, city)
if (city == 1) then
-- Limsa Airship
GetWorldManager():WarpToPosition(player, -764.519, -3.146, 384.154, 1.575);
--GetWorldManager():AddPlayerToShipList(player, 2);
elseif (city == 2) then
-- Gridania Airship
GetWorldManager():WarpToPosition(player, 54.47, -7, -1198.54, -0.02);
--GetWorldManager():AddPlayerToShipList(player, 3);
elseif (city == 3) then
-- Ul'dah Airship
GetWorldManager():WarpToPosition(player, -126.580, 271.2, 156.435, -1.35);
--GetWorldManager():AddPlayerToShipList(player, 4);
end
end end

View File

@@ -1,38 +1,381 @@
--[[ --[[
PopulacePassiveGLPublisher Script PopulacePassiveGLPublisher
Operates the Local Levequest selection menus.
Functions: Functions:
askOfferPack() - Show Classes askOfferPack(player)
askOfferRank() - Show Ranks Desc: Show class selection menu.
askOfferQuest(player) Params: * player - The player actor.
confirmOffer(nil, questId) Returns: Value dictating which item on the list was selected (1-8 for class, nil if exited/canceled)
confirmMaxOffer()
talkOfferWelcome(actor, leveAllowances) askOfferRank(player)
Desc: Show Level selection menu.
Params: * player - The player actor.
Returns: Value dictating which item on the list was selected (1 = Lv01, 2 = Lv20, 3 = Lv40, nil if exited/canceled)
askOfferQuest(player, ?, questId1, questId2, questId3, questId4, questId5, questId6, questId7, questId8)
Desc: Show Leve quest selection menu with up to 8 questId entries
Params: * player - The player actor.
* ? - Unused param. Capture has a 2.
* questId 1-8 - The local levequests available up to 8 quests.
Returns: 1 through 8 for an accepted leve in the order sent, -1 for hitting "Return", and Nil for "Cancel"
confirmOffer(player, questId)
Desc: Opens prompt asking whether to activate the leve and begin it.
Params: * player - The player actor.
* questId - The quest being confirmed.
Returns: Boolean - True on Yes, false on No or hitting escape.
confirmMaxOffer(player)
Desc: Opens ask widget stating you'll be capped on leves after accepting.
Params: * player - The player actor. Unused.
Returns: Boolean - True on Accept, false on "Quit" or hitting escape.
talkOfferWelcome(player, numAllowance)
Desc: NPC intro dialog as well as stating your available leve allowances.
Params: * player - The player actor.
* numAllowance - The number of leve allowances the player still has.
talkOfferDecide() talkOfferDecide()
Desc: Makes the NPC say dialog following the acceptance of a leve.
Params: None
talkOfferMaxOver() talkOfferMaxOver()
selectDiscardGuildleve(player) Desc: Makes the NPC say dialog stating the player is carrying too many leves currently.
confirmJournal() Params: None
askDiscardGuildleve()
confirmDiscardGuildleve(nil, questId)
askRetryRegionalleve(questId, leveAllowances)
finishTalkTurn() finishTalkTurn()
Desc: Ends the npc actor's turn towards you. Call this at the end of the script or the
npc will be stuck "facing" the player.
Params: None
selectDiscardGuildleve()
Desc: Opens the Journal widget to select a leve to discard. This is a follow-up to askDiscardGuildleve().
Params: None
Returns: Quest Actor
confirmJournal(questId, difficulty, unused, itemsCompleted, remainingMats, hasMaterials, unused)
Desc: Opens askJournalDetailWidget displaying current status of the leve.
Params: * questId - The current quest being confirmed.
* difficulty - The difficulty of the quest.
* unused - Unused param.
* itemsComplete - Sets the number of items crafted.
* remainingMats - Sets the remaining materials.
* hasMaterials - If set to 1, shows the progress section.
* unused - While loaded into widget, it doesn't do anything with this journalType (13).
Returns: True on "Exchange", Nil on "Return" or hitting Escape key
askDiscardGuildleve()
Desc: Opens an ask widget, stating the player cannot accept any more guildleves and if they'd want to return one to make room.
Params: None
Returns: Boolean
confirmDiscardGuildleve(?, questId, guildleveId)
Desc: Opens an ask widget, confirming the returning of the selected guildleve.
Params: * ? - Most likely a player actor, but unused.
* questId - The dialog is "Returning <quest>. Are you certain?". This is the questId being returned.
* guildleveId - This is mostly unused, Japanese localization has a weird switch to use this. Can be nil.
Returns: Boolean
askRetryRegionalleve(questId, numAllowance)
Desc: Opens an ask widget to re-attempt leve questId while showing leveAllowances. If no is selected, a second widget appears to confirm abandoning it.
Params: * questId - The questId being retried.
* numAllowance - The number of leve allowances the player still has.
Returns: Menu1 - Is 1 if yes is selected, 2 if no. Nil if Escape is hit (resend function in this case?)
Menu2 - Is 1 if yes is selected (leve abandoned), 2 if no. Nil if Menu1 isn't set to 2
Notes:
50141 - You have <num> leve allowances remaining.
50142 - You have run out of leve allowances. You cannot accept any more levequests at this time.
50143 - You cannot accept any more levequests at this time.
Local Leves:
~~Limsa~~
CRP: Baderon's New Counter (120007)
The Mad Fisher (120017)
Building Bridges (120039)
High Stakes (120047)
Training and Trees (120061)
BSM: Baderon's New Sword (120005)
Got Ingots (120013)
Ship Shape (120014)
A Want of Weapons (120015)
Skull Valley Delivery (120035)
Fruit's of a Vintner's Whinings (120043)
Premiums Paid (120051)
Training and Trading (120059)
Waiting on Weapons (120067)
ARM: Baderon's New Barbuts (120009)
Seeing Sallets to the See (120019)
A Step Ahead (120020)
Mailed Sailors (120021)
Running Rings (120036)
Watching the Shore (120044)
Watching the Knoll (120052)
Rings Around the Rock (120063)
Dead Ringers (120068)
GSM: Baderon's New Bands (120010)
2 x 2 Eyes (120022)
Going Brandanas (120041)
Brand New Brands (120049)
Staves to Fashion (120064)
LTW: Baderon's New Shoes (120008)
The Mad Tanner (120018)
Under Foot (120040)
Shoeing the Shore (120048)
Training and Tanning (120062)
WVR: Baderon's New Clothes (120006)
The Mad Hatter (120016)
Wear and Tear (120038)
Outfitting the Shore (120046)
Training and Tailoring (120060)
ALC: Baderon's New Soles (120011)
A Sticky Situation (120023)
Feeding Trainees (120042)
Suffering Soldiers (120050)
Training and Eating (120065)
CUL: Baderon's New Breakfast (120012)
Tall, Cool One (120024)
The Captain's Cravings (120025)
A Feast Fit for an Admiral (120026)
Supper at the Skull (120037)
The Last Supper (120045)
A Meal to Remember (120053)
Just Desserts (120066)
A Job Well Done (120069)
~~Gridania~~
CRP: A Mother's Carpentry (120203)
Shields for the Masses (120211)
Canes for the Citizens (120212)
High Tension (120213)
Bowing to Pressure (120223)
Pole Positioning (120229)
Driving up the Wall (120237)
Restocking the Stockade (120245)
Plinks Aplenty (120247)
BSM: A Mother's Metallurgy (120201)
It's All in the File (120209)
Training in Bentbranch (120221)
Re-crating the Scene (120231)
Training in Emerald Moss (120239)
ARM: A Mother's Foundry (120205)
Tending to Tendons (120217)
A Little Rusty (120225)
Springripple Rising (120233)
In Sod We Rust (120241)
GSM: A Mother's Jewelry (120206)
The Band's Bands (120218)
Dusting the Knuckles (120226)
In Arm's Reach (120234)
Knuckling Down (120242)
LTW: A Mother's Booties (120204)
Strapped for Straps (120214)
Fire and Hide (120215)
Choke Hold (120216)
Work of Friction (120224)
Hungry Like the Wolves (120230)
Back in the Harness (120238)
Morbol Measures (120246)
Harnessing Help (120248)
WVR: A Mother's Frippery (120202)
Quelling Bloody Rumors (120210)
Clearing Bentbranch (120222)
Clearing Nine Ivies (120232)
Clearing Emerald Moss (120240)
ALC: A Mother's Delicacies (120207)
Mixing It Up (120219)
Keeping It Green (120227)
Arboreal Alchemy (120235)
Growing Strains (120243)
CUL: A Mother's Muselix (120208)
Better Baker's Bounty (120220)
On a Full Belly (120228)
A Well-Deserved Dinner (120236)
Seafood Smorgasbord (120244)
~~Uldah~~
CRP: Momodi's Sturdy Supports (120403)
The Walk of Death (120413)
Pointed Ambitions (120425)
Off With Their Heads (120435)
Act of Pure Weevil (120443)
BSM: Momodi's Dancing Daggers (120401)
Pointy Props (120409)
Hammering the Point (120423)
Molten Metal (120434)
Looking to Horizon (120442)
ARM: Momodi's Sturdy Suits (120405)
Battered and Bent (120415)
Arming the Unarmed (120427)
Provisioning Drybone (120437)
Buckling Under (120445)
GSM: Momodi's Radiant Rings (120406)
A Scarcity of Scepters (120416)
Pleasure and Pain (120417)
In the Sultana's Wake (120418)
A Shining Example (120428)
A Drybone Induction (120432)
A Horizon Promotion (120440)
A Bluefog Induction (120448)
A Broken Water Promotion (120451)
LTW: Momodi's Sashed Shoes (120404)
Showing Some Leg (120414)
World-weary Souls (120426)
Camp Drybone Cares (120436)
I Would Walk 500 Malms (120444)
WVR: Momodi's Budget Breeches (120402)
Just for Kecks (120410)
Pants Make the Man (120411)
Holes in Their Defense (120412)
Hanging by a Thread (120424)
Exposed to the Elements (120433)
Busier Than the Blades (120441)
A Spot in the Shade (120449)
Fire on the Water (120452)
ALC: Momodi's Condiment Conundrum (120407)
Exports of Import (120419)
Fertile Lies (120420)
A Blind Fool (120421)
Saint Allene's Fire (120429)
Treating Steel (120431)
Blue in the Eye (120439)
Preserving the Region (120447)
Provisioning Broken Water (120450)
CUL: Momodi's Breakfast Bread (120408)
Finger Food (120422)
Irrational Behavior (120430)
Tender Victuals (120438)
Some Like It Wet (120446)
--]] --]]
require ("global") require ("global")
local limsaLocalLeves = {
{120007, 120017, 120039, 120047, 120061}, --CRP
{120005, 120013, 120014, 120015, 120035, 120043, 120051, 120059, 120067}, --BSM
{120009, 120019, 120020, 120021, 120036, 120044, 120052, 120063, 120068}, --ARM
{120010, 120022, 120041, 120049, 120064}, --GSM
{120008, 120018, 120040, 120048, 120062}, --LTW
{120006, 120016, 120038, 120046, 120060}, --WVR
{120011, 120023, 120042, 120050, 120065}, --ALC
{120012, 120024, 120025, 120026, 120037, 120045, 120053, 120066, 120069} --CUL
};
local gridaniaLocalLeves = {
{120203, 120211, 120212, 120213, 120223, 120229, 120237, 120245, 120247}, --CRP
{120201, 120209, 120221, 120231, 120239}, --BSM
{120205, 120217, 120225, 120233, 120241}, --ARM
{120206, 120218, 120226, 120234, 120242}, --GSM
{120204, 120214, 120215, 120216, 120224, 120230, 120238, 120246, 120248}, --LTW
{120202, 120210, 120222, 120232, 120240}, --WVR
{120207, 120219, 120227, 120235, 120243}, --ALC
{120208, 120220, 120228, 120236, 120244} --CUL
};
local uldahLocalLeves = {
{120403, 120413, 120425, 120435, 120443}, --CRP
{120401, 120409, 120423, 120434, 120442}, --BSM
{120405, 120415, 120427, 120437, 120445}, --ARM
{120406, 120416, 120417, 120418, 120428, 120432, 120440, 120448, 120451}, --GSM
{120404, 120414, 120426, 120436, 120444}, --LTW
{120402, 120410, 120411, 120412, 120424, 120433, 120441, 120449, 120452}, --WVR
{120407, 120419, 120420, 120421, 120429, 120431, 120439, 120447, 120450}, --ALC
{120408, 120422, 120430, 120438, 120446} --CUL
};
function init(npc) function init(npc)
return false, false, 0, 0; return false, false, 0, 0;
end end
function onEventStarted(player, npc) function onEventStarted(player, npc, triggerName)
callClientFunction(player, "talkOfferWelcome", player, 1);
local leveAllowances = 16;
local quest = 120438;
callClientFunction(player, "confirmJournal", quest, 1);
callClientFunction(player, "confirmJournal", quest, 2);
callClientFunction(player, "confirmJournal", quest, 3);
callClientFunction(player, "confirmJournal", quest, 4);
--[[callClientFunction(player, "talkOfferWelcome", player, leveAllowances);
while (true) do
-- Class Menu
local classChoice = callClientFunction(player, "askOfferPack");
if (classChoice != nil) then
while (true) do
-- Level Difficulty Menu
local levelChoice = callClientFunction(player, "askOfferRank");
if levelChoice != nil then
if levelChoice == 1 then
local levequest = callClientFunction(player, "askOfferQuest", player, 1, 120438, 120025);
if (levequest != nil and levequest > 0) then
player:SendMessage(0x20, "", "[DEBUG] Leve : " .. tostring(pickedLeve));
player:SendGameMessage(GetWorldMaster(), 50141, 0x20, leveAllowances);
end
elseif levelChoice == 2 then
pickedLeve = callClientFunction(player, "askOfferQuest", player, 1, 120026, 120027);
if (pickedLeve != nil) or (pickedLeve != -1) then
player:SendMessage(0x20, "", "[DEBUG] Leve : " .. tostring(pickedLeve));
player:SendGameMessage(GetWorldMaster(), 50141, 0x20, leveAllowances);
end
elseif levelChoice == 3 then
pickedLeve = callClientFunction(player, "askOfferQuest", player, 1, 120028, 120029);
if (pickedLeve != nil) or (pickedLeve != -1) then
player:SendMessage(0x20, "", "[DEBUG] Leve : " .. tostring(pickedLeve));
player:SendGameMessage(GetWorldMaster(), 50141, 0x20, leveAllowances)
end
end
else
break
end
end
else
break;
end
end]]--
callClientFunction(player, "finishTalkTurn");
player:EndEvent(); player:EndEvent();
end end
function onEventUpdate(player, npc, step, menuOptionSelected, lsName, lsCrest) function getAvailableLeves(class, rank)
--callClientFunction(player, "askOfferQuest", player, 1000);
end end

View File

@@ -46,7 +46,6 @@ function onEventStarted(player, npc, triggerName)
local cluster = 3020413; local cluster = 3020413;
local eventMode = 2012; local eventMode = 2012;
if eventMode == 2011 then if eventMode == 2011 then
if playerGC == 0 then if playerGC == 0 then
callClientFunction(player, "eventTalkStep0", 0); callClientFunction(player, "eventTalkStep0", 0);

View File

@@ -1,13 +1,97 @@
require("global");
--[[
Populace Standard Script
Functions:
eventSwitch(questId1, questId2, questId3, questId4, currentPage, maxPages, titleId) - Shows a dialog box with which quest to trigger
when more than one quest is active for this npc.
Notes:
This scripts fires for all normal standard ENpcs in the world. Because of how the FFXIV dialog system works, everything is technically
a quest; including the DefaultTalk responses. This script checks both static default quests and any relevant ones for that actor class
id. If only one exists; it is automatically triggered otherwise a dialog box will appear for the player to choose what quest to do.
--]]
function init(npc) function init(npc)
return false, false, 0, 0; return false, false, 0, 0;
end end
function onEventStarted(player, npc) function onEventStarted(player, npc, eventType, eventName)
player:SendMessage(0x20, "", "This PopulaceStandard actor has no event set. Actor Class Id: " .. tostring(npc:GetActorClassId())); local chosenQuest = nil;
player:EndEvent();
if (eventType == 1) then
local defaultTalk = player:GetDefaultTalkQuest(npc);
local tutorialTalk = player:GetTutorialQuest(npc);
local activeQuests = player:GetQuestsForNpc(npc);
local possibleQuests = {};
-- Create the switch table for this npc
if (defaultTalk ~= nil and eventType == ETYPE_TALK) then
table.insert(possibleQuests, defaultTalk);
end
if (tutorialTalk ~= nil and eventType == ETYPE_TALK) then
table.insert(possibleQuests, tutorialTalk);
end
if (activeQuests ~= nil) then
for i=1,#activeQuests do
table.insert(possibleQuests, activeQuests[i]);
end
end
-- Either let the player choose the quest or start it if it's the only one.
if (#possibleQuests > 1) then
local currentPage = 0;
local numPages = math.floor((#possibleQuests-1)/4) + 1;
while (true) do
local page, index = callClientFunction(player, "switchEvent", possibleQuests[currentPage * 4 + 1], possibleQuests[currentPage * 4 + 2], possibleQuests[currentPage * 4 + 3], possibleQuests[currentPage * 4 + 4], currentPage + 1, numPages, 0x3F1);
if (page == 0) then
chosenQuest = possibleQuests[(currentPage * 4) + index];
break;
elseif (page > 0) then
currentPage = page - 1;
else
player:EndEvent();
return;
end
end
elseif (#possibleQuests == 1) then
chosenQuest = possibleQuests[1];
end
else
local activeQuests = player:GetQuestsForNpc(npc);
if (#activeQuests != 0) then
chosenQuest = activeQuests[1];
end
end
-- Run the quest event or tell the devs it's missing.
if (chosenQuest ~= nil) then
doQuestEvent(player, npc, chosenQuest, eventType, eventName);
else
local msg = string.format("ERROR: This PopulaceStandard actor has no defaultTalk or quest set. \nActor Class Id: %s\nEvent Name: %s", tostring(npc:GetActorClassId()), eventName);
printf(msg);
player:SendMessage(0x20, "", msg);
player:EndEvent();
end
end end
function onEventUpdate(player, npc, blah, menuSelect) function doQuestEvent(player, npc, quest, eventType, eventName)
player:EndEvent(); if (eventType == 0) then
quest:OnCommand(player, npc, eventName);
elseif (eventType == 1) then
quest:OnTalk(player, npc);
elseif (eventType == 2) then
quest:OnPush(player, npc, eventName);
elseif (eventType == 3) then
quest:OnEmote(player, npc, eventName);
elseif (eventType == 5) then
quest:OnNotice(player, npc, eventName);
end
end end

View File

@@ -0,0 +1,56 @@
--[[
InstanceRaidGuide Script
Functions;
askEnterInstanceRaid(arg1) -- Opens a widget asking to enter the given Raid id.
--]]
require ("global")
function init(npc)
if ((npc == 1002090) or (npc == 1002091)) then
-- This won't work due to how init() works, but old scripts had it, keeping it here for now
return false, false, 0, 0, 491, 2;
else
return false, false, 0, 0;
end
end
function onEventStarted(player, npc, eventType, eventName)
npcId = npc:GetActorClassId()
if (npcId == 1002090) then -- Serpent Private Hodder (Stewart) : Gcl107
callClientFunction(player, "delegateEvent", player, GetStaticActor("DftFst"), "defaultTalkWithStewart_001"); -- "defaultTalkWithStewart_002" -- Post-Raid dialog?
--[[
choice = callClientFunction(player, "delegateEvent", player, GetStaticActor("Gcl107"), "processEventStewart", 15);
if (choice == 1) then
callClientFunction(player, "askEnterInstanceRaid", 15); -- Rivenroad
end
--]]
elseif (npcId == 1002091) then -- Serpent Private Dauremant (Trisselle) : Sum6w0
callClientFunction(player, "delegateEvent", player, GetStaticActor("DftFst"), "defaultTalkWithTrisselle_001"); -- "defaultTalkWithTrisselle_002" -- No idea for context.
--[[
choice = callClientFunction(player, "delegateEvent", player, GetStaticActor("Sum6w0"), "processEventTrisselle", 16)
if (choice == 1) then
callClientFunction(player, "askEnterInstanceRaid", 16); -- Rivenroad (Hard)
end
--]]
elseif (npcId == 1060022) then -- Louisoix
callClientFunction(player, "delegateEvent", player, GetStaticActor("DftFst"), "defaultTalkLouisoix_001");
end
player:EndEvent();
end

View File

@@ -19,7 +19,7 @@ function onBeginLogin(player)
end end
--For Opening. Set Director and reset position incase d/c --For Opening. Set Director and reset position incase d/c
if (player:HasQuest(110001) == true and player:GetZoneID() == 193) then if (player:HasQuest(110001) == true and player.CurrentArea.ZoneId == 193) then
director = player:GetZone():CreateDirector("OpeningDirector", false); director = player:GetZone():CreateDirector("OpeningDirector", false);
player:AddDirector(director); player:AddDirector(director);
director:StartDirector(true); director:StartDirector(true);
@@ -32,7 +32,7 @@ function onBeginLogin(player)
player.rotation = 0.025; player.rotation = 0.025;
player:GetQuest(110001):ClearQuestData(); player:GetQuest(110001):ClearQuestData();
player:GetQuest(110001):ClearQuestFlags(); player:GetQuest(110001):ClearQuestFlags();
elseif (player:HasQuest(110005) == true and player:GetZoneID() == 166) then elseif (player:HasQuest(110005) == true and player.CurrentArea.ZoneId == 166) then
director = player:GetZone():CreateDirector("OpeningDirector", false); director = player:GetZone():CreateDirector("OpeningDirector", false);
player:AddDirector(director); player:AddDirector(director);
director:StartDirector(false); director:StartDirector(false);
@@ -45,7 +45,7 @@ function onBeginLogin(player)
player.rotation = -1.26721; player.rotation = -1.26721;
player:GetQuest(110005):ClearQuestData(); player:GetQuest(110005):ClearQuestData();
player:GetQuest(110005):ClearQuestFlags(); player:GetQuest(110005):ClearQuestFlags();
elseif (player:HasQuest(110009) == true and player:GetZoneID() == 184) then elseif (player:HasQuest(110009) == true and player.CurrentArea.ZoneId == 184) then
--director = player:GetZone():CreateDirector("OpeningDirector", false); --director = player:GetZone():CreateDirector("OpeningDirector", false);
--player:AddDirector(director); --player:AddDirector(director);
--director:StartDirector(false); --director:StartDirector(false);

View File

@@ -13,7 +13,7 @@ local attackMagicHandlers = {
} }
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
player.Ability(command.actorId, targetActor); player.Ability(command.Id, targetActor);
player:endEvent(); player:endEvent();
end end

View File

@@ -1,5 +1,5 @@
require("global") require("global")
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
end end

View File

@@ -8,7 +8,7 @@ Switches between active and passive mode states
--]] --]]
function onEventStarted(player, command, triggerName) function onEventStarted(player, command, eventType, eventName)
if (player.currentMainState == 0x0000) then if (player.currentMainState == 0x0000) then
player.Engage(0, 0x0002); player.Engage(0, 0x0002);

View File

@@ -13,8 +13,8 @@ local attackMagicHandlers = {
} }
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
player.Ability(command.actorId, targetActor); player.Ability(command.Id, targetActor);
player:endEvent(); player:endEvent();
end end

View File

@@ -13,7 +13,7 @@ local attackMagicHandlers = {
} }
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
player.Cast(command.actorId, targetActor); player.Cast(command.Id, targetActor);
player:endEvent(); player:endEvent();
end; end;

View File

@@ -9,7 +9,7 @@ Finds the correct weaponskill subscript to fire when a weaponskill actor is acti
--]] --]]
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
--Are they in active mode? --Are they in active mode?
if (player:GetState() != 2) then if (player:GetState() != 2) then
@@ -21,6 +21,6 @@ function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, ta
if not player.aiContainer.IsEngaged() then if not player.aiContainer.IsEngaged() then
player.Engage(targetActor); player.Engage(targetActor);
end; end;
player.WeaponSkill(command.actorId, targetActor); player.WeaponSkill(command.Id, targetActor);
player:endEvent(); player:endEvent();
end; end;

View File

@@ -8,14 +8,14 @@ Handles what happens when you examine a player's bazaar
require ("global") require ("global")
function onEventStarted(player, actor, triggerName, name, arg1, arg2, arg3, bazaarActorId) function onEventStarted(player, actor, eventType, eventName, name, arg1, arg2, arg3, bazaarActorId)
local bazaarActor = nil; local bazaarActor = nil;
if (name ~= nil) then if (name ~= nil) then
bazaarActor = player:GetZone():FindPCInZone(name); bazaarActor = player.CurrentArea:FindPCInZone(name);
elseif (bazaarActorId ~= nil) then elseif (bazaarActorId ~= nil) then
bazaarActor = player:GetZone():FindActorInArea(bazaarActorId); bazaarActor = player.CurrentArea:FindActorInArea(bazaarActorId);
end end
if (bazaarActor ~= nil) then if (bazaarActor ~= nil) then

View File

@@ -20,7 +20,7 @@ seekAmount: The amount of seekItem we want.
require ("global") require ("global")
function onEventStarted(player, actor, triggerName, rewardItem, seekItem, bazaarMode, arg1, bazaarActor, rewardAmount, seekAmount, arg2, arg3, type9ItemIds) function onEventStarted(player, actor, eventType, eventName, rewardItem, seekItem, bazaarMode, arg1, bazaarActor, rewardAmount, seekAmount, arg2, arg3, type9ItemIds)
local rewarding = nil; local rewarding = nil;
local seeking = nil; local seeking = nil;

View File

@@ -10,7 +10,7 @@ All bazaar args have a Reward (The item the person who fufills the request gets)
--TODO REFACTOR --TODO REFACTOR
function onEventStarted(player, actor, triggerName, rewardItem, seekItemOrCost, seekAmount, arg1, bazaarActorId, rewardAmount, rewardItemId, nameIndex, arg2, type9ItemIds) function onEventStarted(player, actor, eventType, eventName, rewardItem, seekItemOrCost, seekAmount, arg1, bazaarActorId, rewardAmount, rewardItemId, nameIndex, arg2, type9ItemIds)
local originalReward = nil; local originalReward = nil;
local originalSeek = nil; local originalSeek = nil;
@@ -18,7 +18,7 @@ function onEventStarted(player, actor, triggerName, rewardItem, seekItemOrCost,
--Get the bazaar actor --Get the bazaar actor
if (bazaarActorId ~= nil) then if (bazaarActorId ~= nil) then
bazaarActor = player:GetZone():FindActorInArea(bazaarActorId); bazaarActor = player.CurrentArea:FindActorInArea(bazaarActorId);
end end
--Abort if no actor --Abort if no actor

View File

@@ -13,7 +13,7 @@ Handles canceling bazaar items
--]] --]]
function onEventStarted(player, actor, triggerName, rewardItem, seekItem, bazaarType, narg, bazaarActor, rewardAmount, seekAmount, narg, narg, type9ItemIds) function onEventStarted(player, actor, eventType, eventName, rewardItem, seekItem, bazaarType, narg, bazaarActor, rewardAmount, seekAmount, narg, narg, type9ItemIds)
GetWorldManager():RemoveFromBazaar(player, player:GetItem(rewardItem)); GetWorldManager():RemoveFromBazaar(player, player:GetItem(rewardItem));

View File

@@ -10,7 +10,7 @@ operateUI(pointsAvailable, pointsLimit, str, vit, dex, int, min, pie)
require ("global") require ("global")
function onEventStarted(player, actor, triggerName) function onEventStarted(player, actor, eventType, eventName)
--local points = player:GetAttributePoints(); --local points = player:GetAttributePoints();
--player:RunEventFunction("delegateCommand", actor, "operateUI", points.available, points.limit, points.inSTR, points.inVIT, points.inDEX, points.inINT, points.inMIN, points.inPIT); --player:RunEventFunction("delegateCommand", actor, "operateUI", points.available, points.limit, points.inSTR, points.inVIT, points.inDEX, points.inINT, points.inMIN, points.inPIT);
result = callClientFunction(player, "delegateCommand", actor, "operateUI", 100, 100, 10, 10, 10, 10, 10, 10); result = callClientFunction(player, "delegateCommand", actor, "operateUI", 100, 100, 10, 10, 10, 10, 10, 10);

View File

@@ -1,6 +1,90 @@
function onEventStarted(player, caller, commandRequest, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) require("global");
--[[
player:SetCurrentJob(17); ChangeJobCommand Script
Called when the player equips/unequips a job stone or uses the /job command.
--]]
local classToJob = { -- [classId] = {jobId, jobAnim, jobKeyItem}
[2] = {15, 0x4000028, 2000202}, -- PGL -> MNK
[3] = {16, 0x4000029, 2000201}, -- GLD -> PLD
[4] = {17, 0x4000027, 2000203}, -- MRD -> WAR
[7] = {18, 0x400002D, 2000205}, -- ARC -> BRD
[8] = {19, 0x400002C, 2000204}, -- LNC -> DRG
[22] = {26, 0x400002B, 2000207}, -- THM -> BLM
[23] = {27, 0x400002A, 2000206}, -- CNJ -> WHM
}
local jobToClass = { -- [jobId] = classId
[15] = 2, -- MNK -> PGL
[16] = 3, -- PLD -> GLD
[17] = 4, -- WAR -> MRD
[18] = 7, -- BRD -> ARC
[19] = 8, -- DRG -> LNC
[26] = 22, -- BLM -> THM
[27] = 23 -- WHM -> CNJ
}
function onEventStarted(player, command, eventType, eventName, jobState)
local currentClass = player:GetCurrentClassOrJob();
local jobCheck = isJob(currentClass);
local hasKeyItem = false;
if (jobCheck == false) then
hasKeyItem = player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(classToJob[currentClass][3]);
end
if (jobCheck ~= nil) then -- Valid Class/Job ids only
if (jobState == 0) then -- Toggle current class/job state
if ((jobCheck == false) and (hasKeyItem == true)) then
setPlayerJob(player, classToJob[currentClass][1], classToJob[currentClass][2]);
elseif (jobCheck == true) then
setPlayerClass(player, jobToClass[currentClass])
end
elseif (jobState == 1 and (jobCheck == false) and (hasKeyItem == true)) then -- Equipping Job stone
setPlayerJob(player, classToJob[currentClass][1], classToJob[currentClass][2]);
elseif (jobState == 2 and (jobCheck == true)) then -- Removing Job stone
setPlayerClass(player, jobToClass[currentClass]);
end
end
player:EndEvent(); player:EndEvent();
end
function setPlayerClass(player, id)
player:SetCurrentJob(0);
player:PrepareClassChange(id);
player:DoClassChange(id);
player:PlayAnimation(0x4001030);
player:SendGameMessage(player, GetWorldMaster(), 30103, 0x20, 0, 0, player, id);
end
function setPlayerJob(player, id, anim)
player:SetCurrentJob(id);
player:PrepareClassChange(id);
player:DoClassChange(jobToClass[id]);
player:PlayAnimation(anim);
player:SendGameMessage(player, GetWorldMaster(), 30103, 0x20, 0, 0, player, id);
end
function isJob(id)
local validId = {
[2] = 0, [3] = 0, [4] = 0, [7] = 0, [8] = 0, [22] = 0, [23] = 0,
[15] = 1, [16] = 1, [17] = 1, [18] = 1, [19] = 1, [26] = 1, [27] = 1
}
if (validId[id] == 0) then
return false;
elseif (validId[id] == 1) then
return true;
else
return nil;
end
end end

View File

@@ -6,7 +6,7 @@ Handles player examining someone
--]] --]]
function onEventStarted(player, commandactor, triggerName, arg1, arg2, arg3, arg4, checkedActorId) function onEventStarted(player, commandactor, eventType, eventName, arg1, arg2, arg3, arg4, checkedActorId)
actor = player:GetActorInInstance(checkedActorId); actor = player:GetActorInInstance(checkedActorId);

View File

@@ -6,44 +6,43 @@ Handles mounting and dismounting the Chocobo and Goobbue
--]] --]]
function onEventStarted(player, actor, triggerName, isGoobbue) require ("global")
if (player:GetState() == 0) then function onEventStarted(player, actor, eventType, eventName, isGoobbue)
if (player:GetState() == 0) then
worldMaster = GetWorldMaster();
worldMaster = GetWorldMaster();
if (isGoobbue ~= true) then
player:ChangeMusic(83); if (isGoobbue ~= true) then
player:SendGameMessage(player, worldMaster, 26001, 0x20); player:ChangeMusic(83, MUSIC_FADEIN);
player:SetMountState(1); player:SendGameMessage(player, worldMaster, 26001, 0x20);
else player:SetMountState(1);
player:ChangeMusic(98); else
player:SendGameMessage(player, worldMaster, 26019, 0x20); player:ChangeMusic(98, MUSIC_FADEIN);
player:SetMountState(2); player:SendGameMessage(player, worldMaster, 26019, 0x20);
end player:SetMountState(2);
end
player:ChangeSpeed(0.0, 5.0, 10.0, 10.0);
player:ChangeState(15); player:ChangeSpeed(0.0, 3.6, 9.0, 9.0);
else player:ChangeState(15);
player:ChangeMusic(player:GetZone().bgmDay); else
player:ChangeMusic(player.currentArea.bgmDay, MUSIC_FADEIN);
worldMaster = GetWorldMaster();
worldMaster = GetWorldMaster();
if (player.rentalExpireTime != 0) then
player:SendGameMessage(player, worldMaster, 26004, 0x20); --You dismount. if (player.rentalExpireTime != 0) then
else player:SendGameMessage(player, worldMaster, 26004, 0x20); --You dismount.
if (player:GetMountState() == 1) then else
player:SendGameMessage(player, worldMaster, 26003, 0x20); --You dismount X. if (player:GetMountState() == 1) then
else player:SendGameMessage(player, worldMaster, 26003, 0x20); --You dismount X.
player:SendGameMessage(player, worldMaster, 26021, 0x20); --You dismount your Gobbue. else
end player:SendGameMessage(player, worldMaster, 26021, 0x20); --You dismount your Gobbue.
end end
end
player:SetMountState(0);
player:ChangeSpeed(0.0, 2.0, 5.0, 5.0) player:SetMountState(0);
player:ChangeState(0); player:ChangeSpeed(0.0, 2.0, 5.0, 5.0)
end player:ChangeState(0);
end
player:EndEvent(); player:EndEvent();
end end

View File

@@ -124,7 +124,7 @@ local weaponskillHandlers = {
[0xA0F070EA] = nil [0xA0F070EA] = nil
} }
function onEventStarted(player, command, triggerName) function onEventStarted(player, command, eventType, eventName)
--Are they in active mode? --Are they in active mode?
if (player:GetState() != 2) then if (player:GetState() != 2) then
@@ -133,8 +133,8 @@ function onEventStarted(player, command, triggerName)
return; return;
end end
if (weaponskillHandlers[command.actorId] ~= nil) then if (weaponskillHandlers[command.Id] ~= nil) then
weaponskillHandlers[command.actorId](player); weaponskillHandlers[command.Id](player);
else else
player:SendMessage(0x20, "", "That weaponskill is not implemented yet."); player:SendMessage(0x20, "", "That weaponskill is not implemented yet.");
end end

View File

@@ -6,7 +6,7 @@ Handles what happens when you resolve an invite to a group
--]] --]]
function onEventStarted(player, actor, triggerName, groupType, result) function onEventStarted(player, actor, eventType, eventName, groupType, result)
--Accept/Refuse happened, else just close the window --Accept/Refuse happened, else just close the window
if (result == 1 or result == 2) then if (result == 1 or result == 2) then

View File

@@ -6,7 +6,7 @@ Handles what happens when you accept/refuse a trade
--]] --]]
function onEventStarted(player, actor, triggerName, groupType, result) function onEventStarted(player, actor, eventType, eventName, groupType, result)
--Accept --Accept
if (result == 1) then if (result == 1) then

View File

@@ -11,47 +11,36 @@ loadTextData()
Params: None Params: None
start(facility, requestsMode, material1, material2, material3, material4, material5, material6, material7, material8) start(facility, requestsMode, material1, material2, material3, material4, material5, material6, material7, material8)
Desc: Opens the Craft Start widget, with any preloaded materials. Widget has two modes; one for normal synthesis and another Desc: Opens the Craft Start widget, with any preloaded materials. Widget has two modes; one for normal synthesis and another
for local leve "requested items" mode. for local leve "requested items" mode.
Params: * facility/widgetMode - The current facility id buff the player may have. After opening a recipe tab, start() has to be called with this Params: * facility - The current facility id buff the player may have.
set to -1. After the player chooses a recipe, start() has to be called with this set to -2. * requestMode - If true, switches the UI to Requested Items mode otherwise it opens Normal Synthesis mode.
* requestMode - If true, switches the UI to Requested Items mode otherwise it opens Normal Synthesis mode. * material1-8 - ItemID for each of the 8 material slots. If empty, they must be set to 0 or the client will crash.
* material1-8 - ItemID for each of the 8 material slots. If empty, they must be set to 0 or the client will crash.
closeCraftStartWidget() closeCraftStartWidget()
Desc: Closes the Craft Start widget. Desc: Closes the Craft Start widget.
Params: None Params: None
selectRcp(item1, item2, item3, item4, item5, item6, item7, item8) selectRcp(itemId)
Desc: Opens a recipe selection window. If one recipe is provided, automatically selects that recipe. Desc: Selects the recipe to be crafted. May be a legacy function but still required to properly initialize the UI. Requires start() to have
Params: * itemId1-8 - The itemIDs to show in the list. If only one provided, select it. been called.
Params: * itemId - The itemID of the item to be crafted.
confirmRcp(craftedItem, quantity, crystalItem1, crystalQuantity1, crystalQuantity1, crystalItem2, crystalQuantity2, recommendedSkill, recommendedFacility) confirmRcp(craftedItem, quantity, crystalItem1, crystalQuantity1, crystalQuantity1, crystalItem2, crystalQuantity2, recommendedSkill, recommendedFacility)
Desc: Opens the confirmation window, detailing what is needed and the item that will be created. Requires a selectRcp() call first. Desc: Opens the confirmation window, detailing what is needed and the item that will be created. Requires a selectRcp() call first.
Params: * craftedItem - The itemID of the item to be crafted. Params: * craftedItem - The itemID of the item to be crafted.
* quantity - Quantity of crafted items. * quantity - Quantity of crafted items.
* crystalItem1 - The first required crystal itemID for crafting. * crystalItem1 - The first required crystal itemID for crafting.
* crystalQuantity1 - Quantity of the first crystal. * crystalQuantity1 - Quantity of the first crystal.
* crystalItem2 - The second required crystal itemID for crafting. * crystalItem2 - The second required crystal itemID for crafting.
* crystalQuantity2 - Quantity of the second crystal. * crystalQuantity2 - Quantity of the second crystal.
* recommendedSkill - Which itemID to display under the "Recommended Skill" panel. * recommendedSkill - Which itemID to display under the "Recommended Skill" panel.
* recommendedFacility - Which facility to display under the "Recommended Facility" panel. * recommendedFacility - Which facility to display under the "Recommended Facility" panel.
selectCraftQuest() selectCraftQuest()
Desc: Opens the journal to select the local leve that the player would like to do. Desc: Opens the journal to select the local leve that the player would like to do.
Params: None Params: None
confirmLeve()
Desc: Opens the summery page for the local leve.
Params: * localLeveID -
* craftedItem -
* ?
* ?
* itemsCompleted -
* remainingMaterials -
* ?
* ?
askContinueLocalLeve(localLeveID, craftedItem, itemsCompleted, craftTotal, attempts) askContinueLocalLeve(localLeveID, craftedItem, itemsCompleted, craftTotal, attempts)
Desc: Opens the dialog to continue crafting for a local leve after an item was completed. Desc: Opens the dialog to continue crafting for a local leve after an item was completed.
Params: * localLeveID - The id of the current leve in progress. Params: * localLeveID - The id of the current leve in progress.
@@ -79,7 +68,7 @@ craftCommandUI(classID, hasWait, command1, command2, command3, command4, command
* command1-5 - Five possible crafting commands (crafting skills). * command1-5 - Five possible crafting commands (crafting skills).
craftTuningUI(command1, command2, command3, command4, command5, command6, command7, command8) craftTuningUI(command1, command2, command3, command4, command5, command6, command7, command8)
Desc: Displays only the provided commands for the "Double Down" phase that happens after crafting. Desc: Displays a full list of commands for the legacy "Tuning" phase that happens after crafting. Deprecated in 1.23b.
Params: * command1-8 - The list of commands available. Params: * command1-8 - The list of commands available.
updateInfo(progress, durability, quality, tuningItem, tuningItemQuality, tuningItemQuantity, hqChance) updateInfo(progress, durability, quality, tuningItem, tuningItemQuality, tuningItemQuantity, hqChance)
@@ -100,6 +89,17 @@ cfmQst()
Desc: Quest confirmation window for when starting a crafting quest from the journal. Desc: Quest confirmation window for when starting a crafting quest from the journal.
Params: Params:
confirmLeve()
Desc: Opens the summery page for the local leve.
Params: * localLeveID - The quest id of the leve you are confirming.
* difficulty - Changes the objective.
* craftedItem? -
* ? -
* numSuccess - The number of successful crafts you did.
* remainingMaterials - The number of materials you have left.
* hasMaterials - Shows the in-progress panel of successes and attempts left.
* ? -
startRepair(craftMode, item, quality, durability, hasMateria, spiritbind) startRepair(craftMode, item, quality, durability, hasMateria, spiritbind)
Desc: Opens the repair item widget. Desc: Opens the repair item widget.
Params: * craftMode - Either 0 or 1. Anything else crashes. Params: * craftMode - Either 0 or 1. Anything else crashes.
@@ -133,214 +133,289 @@ Class ID + Starting skill
35 ALC = 22586 35 ALC = 22586
36 CUL = 22592 36 CUL = 22592
Leve objectives/rewards are in passiveGL_craft.
* Index 1:
* Index 2: Recommended Class
* Index 3: Issuing Authority
* Index 7: Levequest Location
* Index 8: Deliver Display Name
* Starts at index 14. Four sections for the four difficulties.
* Required Item, Amount, ?, Recommended Level, , Reward Item, Reward Amount, |
--]] --]]
require ("global") require ("global")
local skillAnim = {
skillAnim = {
[22553] = 0x10002000; [22553] = 0x10002000;
[22554] = 0x10001000; [22554] = 0x10001000;
[22555] = 0x10003000; [22555] = 0x10003000;
[29531] = 0x10009002; [29531] = 0x10009002;
} }
local craftStartWidgetOpen = false;
materialSlots = {0,0,0,0,0,0,0,0}; -- The 8 slots function onEventStarted(player, commandactor, eventType, eventName, arg1, arg2, arg3, arg4, checkedActorId)
recentRecipe = {10008205, 4030706, 4070009} -- Recent Recipe list local MENU_CANCEL, MENU_MAINHAND, MENU_OFFHAND, MENU_REQUEST = 0, 1, 2, 3;
awardedRecipe = {7020105, 7030011} -- Awarded Recipe list local MENU_RECENT, MENU_AWARDED, MENU_RECENT_DETAILED, MENU_AWARDED_DETAILED = 7, 8, 9, 10;
materialRecipe = { -- Always 8 params because we can't have any nils here for "start" command
[6071007] = {4070402, 4070309,0,0,0,0,0,0},
[10008205] = {10008005,10008005,0,0,0,0,0,0},
[10009617] = {4040009, 4040010, 4040011,0,0,0,0,0},
[4070009] = {4070006, 10005401, 10008203,0,0,0,0,0},
[4070010] = {10008204,10008106,10005302,0,0,0,0,0}
}
materialQuest = { -- What a quest or leve will preload slots with, in addition to any extras the player does manual
[0] = {0,0,0,0,0,0,0,0},
[1] = {0,0,0,0,0,0,0,0},
[110442] = {11000075, 11000074, 0, 0, 0, 0, 0, 0}
}
function onEventStarted(player, commandactor, triggerName, arg1, arg2, arg3, arg4, checkedActorId)
MENU_CANCEL, MENU_MAINHAND, MENU_OFFHAND, MENU_REQUEST = 0, 1, 2, 3;
MENU_RECIPE, MENU_AWARDED, MENU_RECIPE_DETAILED, MENU_AWARDED_DETAILED = 7, 8, 9, 10;
debugMessage = false; local debugMessage = true;
isRecipeRecentSent = false; local isRecipeRecentSent = false;
isRecipeAwardSent = false; local isRecipeAwardSent = false;
detailWindow = true;
isRequested = false; -- False = The default state. True = User picked a quest recipe/local leve local craftJudge = GetStaticActor("CraftJudge");
facilityId = 0; local recipeResolver = GetRecipeResolver();
chosenQuest = 0; -- Use this to store any chosen recipe/local leve
recipeDetail = 0;
detailWindowState = 0;
craftJudge = GetStaticActor("CraftJudge");
callClientFunction(player, "delegateCommand", craftJudge, "loadTextData", commandactor);
chosenOperation = -1;
while chosenOperation ~= 0 do local operationResult;
local operationMode = -1;
player:ChangeState(30); local recipeMode = -1;
local chosenMaterials;
if debugMessage then player:SendMessage(0x20, "", "[DEBUG] Menu ID: "..tostring(chosenOperation).." Recipe : "..tostring(recipeMode).." Quest : "..chosenQuest); end
local facilityId = 0;
local isRequestedItemsMode = false; -- False = The default state. True = User picked a quest recipe/local leve
if materialQuest[chosenQuest] then local recentRecipes;
if debugMessage then player:SendMessage(0x20, "", "Key is valid: "..chosenQuest); end local awardedRecipes;
materialSlots = materialQuest[chosenQuest];
else local currentCraftQuest = nil; -- Use this to store any chosen craft quest
if debugMessage then player:SendMessage(0x20, "", "Key is not valid: "..chosenQuest); end local currentCraftQuestGuildleve = nil; -- Use this to store any chosen local leve
end
callClientFunction(player, "delegateCommand", craftJudge, "loadTextData", commandactor);
player:ChangeState(30);
if isRecipeRecentSent == false then -- If Recipe button not hit, aka default state.
chosenOperation, recipeMode = callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, facilityId, isRequested, unpack(materialSlots)); -- Initial window while operationMode ~= 0 do
-- Figure out the prepped materials.
local prepedMaterials = {0,0,0,0,0,0,0,0};
-- Quest requested mode materials
if (isRequestedItemsMode == true) then
prepedMaterials = recipeResolver.RecipeToMatIdTable(currentCraftQuestGuildleve.getRecipe());
-- Recent Recipes/Awarded recipes materials
elseif ((operationMode == MENU_RECENT or operationMode == MENU_AWARDED) and recipeMode != 0) then
if (operationMode == MENU_RECENT) then
prepedMaterials = recipeResolver.RecipeToMatIdTable(recentRecipes[recipeMode]);
else
prepedMaterials = recipeResolver.RecipeToMatIdTable(awardedRecipes[recipeMode]);
end
end
-- Set this param correctly
local facilityIdParam = facilityId;
if ((operationMode == MENU_RECENT or operationMode == MENU_AWARDED) and recipeMode != 0) then
facilityIdParam = -2;
elseif (craftStartWidgetOpen == true) then
craftStartWidgetOpen = true;
facilityIdParam = -1;
end
-- Run start and grab the result operation/recipeMode/prepped
operationResult = {callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, facilityIdParam, isRequestedItemsMode, unpack(prepedMaterials))};
operationMode = operationResult[1];
recipeMode = operationResult[2];
if debugMessage then player:SendMessage(0x20, "", "[DEBUG] Menu ID: " .. tostring(operationMode) .. ", RecipeMode : " .. recipeMode); end
-- Operation
if operationMode == MENU_CANCEL then
closeCraftStartWidget(player, craftJudge, commandactor);
elseif (operationMode == MENU_MAINHAND or operationMode == MENU_OFFHAND) then
-- Recipe choosing loop
while (true) do
-- Figure out the number of preloaded mats
local materials = {};
-- Handle the possible args returned: Either 0 player items, 1 player item, 2+ palyer items. The rest is always the remaining prepped items.
if (type(operationResult[3]) == "number") then
materials = {unpack(operationResult, 3)};
elseif (type(operationResult[3]) ~= "number") then
for i=1,8 do
if (i - 1 < operationResult[3].numItems) then
materials[i] = player:GetItemPackage(operationResult[3].itemPackages[i-1]):GetItemAtSlot(operationResult[3].itemSlots[i-1]).itemId;
player:SendMessage(0x20, "", "[DEBUG] " .. tostring(materials[i]));
else
materials[i] = operationResult[3 + (i - operationResult[3].numItems)];
player:SendMessage(0x20, "", "[DEBUG] " .. tostring(materials[i]));
end
end
end
-- Choosing a recipe from the given materials
local recipes = recipeResolver.GetRecipeFromMats(unpack(materials));
local itemIds = recipeResolver.RecipesToItemIdTable(recipes);
-- No recipes found
if (#itemIds == 0) then
player:SendGameMessage(GetWorldMaster(), 40201, 0x20); -- You cannot synthesize with those materials.
break;
end
local chosenRecipeIndex = callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, unpack(itemIds));
-- Hit back on recipe list
if (chosenRecipeIndex <= 0) then break end;
chosenRecipe = recipes[chosenRecipeIndex-1];
if (chosenRecipe ~= nil) then
-- Player confirms recipe
local recipeConfirmed = callClientFunction(player, "delegateCommand", craftJudge, "confirmRcp", commandactor,
chosenRecipe.resultItemID,
chosenRecipe.resultQuantity,
chosenRecipe.crystalId1,
chosenRecipe.crystalQuantity1,
chosenRecipe.crystalId2,
chosenRecipe.crystalQuantity2,
0,
0);
elseif isRecipeRecentSent == true and recipeMode == 0 then -- If recipe window/award tab was hit if recipeConfirmed then
chosenOperation, recipeMode = callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, -1, isRequested, unpack(materialSlots)); -- Keep window going closeCraftStartWidget(player, craftJudge, commandactor);
isRecipeRecentSent = false;
elseif isRecipeRecentSent == true and recipeMode > 0 then -- If recipe item picked isRecipeAwardSent = false;
if recipeDetail then
chosenOperation, recipeMode = callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, -2, isRequested, unpack(recipeDetail)); -- Item mat(s) for picked item. -- CRAFTING STARTED
else currentlyCrafting = startCrafting(player, commandactor, craftJudge, operationMode, chosenRecipe, currentCraftQuestGuildleve, 80, 100, 50);
chosenOperation, recipeMode = callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, -2, isRequested, 10009617,0,0,0,0,0,0,0); -- Show dummy info for unfilled item
end --Once crafting is over, return to the original non-quest state.
end isRequestedItemsMode = false;
currentCraftQuestGuildleve = nil;
currentCraftQuest = nil;
if chosenOperation == MENU_CANCEL then
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor); break;
end
end
elseif (chosenOperation == MENU_MAINHAND or chosenOperation == MENU_OFFHAND) then end
-- End of Recipe choosing loops
if isRequested == true then elseif operationMode == MENU_REQUEST then -- Conditional button label based on isRequestedItemsMode
recipeResult = callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, 10009617); closeCraftStartWidget(player, craftJudge, commandactor);
else
recipeResult = callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, 10009617,6071007,5030112,5030007,10009617,6071007,5030112,5030007); if isRequestedItemsMode == false then -- "Request Items" hit, close Start and open up the Quest select
end
if recipeResult == 0 then -- Closed/Return hit.
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor);
currentlyCrafting = -1;
elseif (recipeResult >= 1 or recipeResult <= 8) then
--item yld, xstal1, qty, xstal2, qty
recipeConfirmed = callClientFunction(player, "delegateCommand", craftJudge, "confirmRcp", commandactor, 10009617, 1, 0xF4247, 1, 0xf4245, 1, 0, 0);
if recipeConfirmed then
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor);
isRecipeRecentSent = false;
isRecipeAwardSent = false;
currentlyCrafting = startCrafting(player, chosenOperation, isRequested, 80, 100, 50);
end
end
elseif chosenOperation == MENU_REQUEST then -- Conditional button label based on isRequested
if isRequested == false then -- "Request Items" hit, close Start and open up the Quest select
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor);
isRecipeRecentSent = false; isRecipeRecentSent = false;
isRecipeAwardSent = false; isRecipeAwardSent = false;
local questConfirmed, returnedQuest = GetCraftQuest(player, craftjudge, commandactor); local quest = getCraftQuest(player, craftJudge, commandactor);
chosenQuest = tonumber(returnedQuest); if (quest ~= nil) then
isRequestedItemsMode = true;
if debugMessage then player:SendMessage(0x20, "", "[DEBUG] Chosen Quest: "..tostring(chosenQuest)); end if (quest.isCraftPassiveGuildleve()) then
currentCraftQuestGuildleve = quest;
if questConfirmed then else
isRequested = true; currentCraftQuest = quest;
end end
end
elseif isRequestedItemsMode == true then -- "Normal Synthesis" button hit
elseif isRequested == true then -- "Normal Synthesis" button hit isRequestedItemsMode = false;
isRequested = false; currentCraftQuestGuildleve = nil;
chosenQuest = 0; currentCraftQuest = nil;
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor); end
elseif operationMode == MENU_RECENT then -- "Recipes" button hit
end
elseif chosenOperation == MENU_RECIPE then -- "Recipes" button hit
if isRecipeRecentSent == false then if isRecipeRecentSent == false then
callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, unpack(recentRecipe)); -- Load up recipe list recentRecipes = player.GetRecentRecipes();
local itemIds = recipeResolver.RecipesToItemIdTable(recentRecipes);
callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, unpack(itemIds)); -- Load up recipe list
isRecipeRecentSent = true; isRecipeRecentSent = true;
end end
elseif operationMode == MENU_AWARDED then -- "Awarded Recipes" tab hit
recipeDetail = materialRecipe[recentRecipe[recipeMode]];
elseif chosenOperation == MENU_AWARDED then -- "Awarded Recipes" tab hit
if isRecipeAwardSent == false then if isRecipeAwardSent == false then
callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, unpack(awardedRecipe)); -- Load up Award list awardedRecipes = player.GetAwardedRecipes();
local itemIds = recipeResolver.RecipesToItemIdTable(awardedRecipes);
callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, unpack(itemIds)); -- Load up Award list
isRecipeAwardSent = true; isRecipeAwardSent = true;
end end
elseif ((operationMode == MENU_RECENT_DETAILED or operationMode == MENU_AWARDED_DETAILED) and recipeMode > 0) then -- Pop-up for an item's stats/craft mats on a recent recipe
recipeDetail = materialRecipe[awardedRecipe[recipeMode]]; local chosenRecipe = operationMode == MENU_RECENT_DETAILED and recentRecipes[recipeMode-1] or recentRecipes[awardedMode-1];
local recipeConfirmed = callClientFunction(player, "delegateCommand", craftJudge, "confirmRcp", commandactor,
elseif (chosenOperation == MENU_RECIPE_DETAILED or chosenOperation == MENU_AWARDED_DETAILED) and recipeMode > 0 then -- Pop-up for an item's stats/craft mats chosenRecipe.resultItemID,
detailWindowState = callClientFunction(player, "delegateCommand", craftJudge, "confirmRcp", commandactor, 10009617, 1, 0xF4247, 1, 0xf4245, 1, 0, 0); chosenRecipe.resultQuantity,
chosenRecipe.crystalId1,
chosenRecipe.crystalQuantity1,
chosenRecipe.crystalId2,
chosenRecipe.crystalQuantity2,
0,
0);
-- This should never call? The window with this button only appears when you select a recent recipe with not enough materials. Otherwise it just auto-fills your "table".
if (recipeConfirmed) then
closeCraftStartWidget(player, craftJudge, commandactor);
isRecipeRecentSent = false;
isRecipeAwardSent = false;
currentlyCrafting = startCrafting(player, commandactor, craftJudge, operationMode, chosenRecipe, isRequestedItemsMode, 80, 100, 50);
end
else else
break; break;
end end
end end
player:ChangeMusic(7); -- Need way to reset music back to the zone's default
player:ChangeState(0);
player:EndEvent();
player:ResetMusic();
player:ChangeState(0);
player:EndEvent();
end end
-- Handles the menus to pick a crafter quest or local leve quest that run separate widgets from the Start command. -- Handles the menus to pick a crafter quest or local leve quest that run separate widgets from the Start command.
-- Returns whether a quest was selected, and what id the quest is. -- Returns whether a quest was selected, and what id the quest is.
function GetCraftQuest(player, craftjudge, commandactor); function getCraftQuest(player, craftJudge, commandactor);
local questId = nil;
while (true) do
local questCommandId = callClientFunction(player, "delegateCommand", craftJudge, "selectCraftQuest", commandactor);
if questCommandId then
questId = questCommandId - 0xA0F00000;
-- Craft Quest Chosen
if isCraftQuest(questId) then
local quest = player.GetQuest(questId);
local confirm = callClientFunction(player, "delegateCommand", craftJudge, "cfmQst", commandactor, quest.getQuestId(), 20, 1, 1, 1, 0, 0, "<Path Companion>");
if confirm == true then
player:SendGameMessage(craftJudge, 21, 0x20);
return quest;
end
-- PassiveGL Quest Chosen
elseif isLocalLeve(questId) then
local difficulty = 0;
local hasMaterials = 1;
local quest = player:getQuestGuildleve(questId);
if (quest ~= nil) then
-- Did they pickup the materials?
if (quest:hasMaterials() == false) then
player:SendGameMessage(GetWorldMaster(), 40210, 0x20); -- You have not obtained the proper materials from the client.
-- Did they use em all up?
elseif (quest:getRemainingMaterials() == 0) then
player:SendGameMessage(GetWorldMaster(), 40211, 0x20); -- You have used up all of the provided materials.
-- Confirm dialog
else
local confirm = callClientFunction(player, "delegateCommand", craftJudge, "confirmLeve", commandactor,
quest:getQuestId(),
quest:getCurrentDifficulty() + 1, -- Lua, 1-indexed
0,
quest:getCurrentCrafted(),
quest:getRemainingMaterials(),
quest:hasMaterials() and 1 or 0, -- Fucked up way of doing terneries on Lua
0
);
local questOffset = 0xA0F00000; -- Quest confirmed
local questId = 0; if (confirm == true) then
local requestState = false; return quest;
local requestedMenuChoice = callClientFunction(player, "delegateCommand", craftJudge, "selectCraftQuest", commandactor); end
end
if requestedMenuChoice then else
questId = requestedMenuChoice - questOffset; return nil; -- Shouldn't happen unless db fucked with
end
if isCraftQuest(questId) then -- Scenario Quest Chosen
confirm = callClientFunction(player, "delegateCommand", craftJudge, "cfmQst", commandactor, questId, 20, 1, 1, 1, 0, 0, "<Path Companion>"); else
-- TEMP for now. Cannot find source for what happens if you confirm a non-craft quest.
if confirm == true then player:SendGameMessage(GetWorldMaster(), 40209, 0x20); -- You cannot undertake that endeavor.
requestState = true; end
player:SendGameMessage(craftJudge, 21, 0x20); else
end return nil;
end
elseif isLocalLeve(questId) then end
confirm = callClientFunction(player, "delegateCommand", craftJudge, "confirmLeve", commandactor, questId, 0, 8030421, 5, 50, 0, 0);
if confirm == true then
requestState = true;
itemSlots = { unpack(materialRecipe[4070010])};
end
elseif isScenarioQuest(questId) == true then
-- TEMP for now. Cannot find source for what happens if you confirm a non-craft quest.
player:SendGameMessage(GetWorldMaster(), 40209, 0x20);
end
end
return requestState, questId;
end end
function isScenarioQuest(id) function isScenarioQuest(id)
if (id >= 110001 and id <= 120026) then if (id >= 110001 and id <= 120026) then
return true; return true;
else else
@@ -359,7 +434,6 @@ end
function isLocalLeve(id) function isLocalLeve(id)
if (id >= 120001 and id <= 120452) then if (id >= 120001 and id <= 120452) then
return true; return true;
else else
@@ -367,58 +441,73 @@ function isLocalLeve(id)
end end
end end
function closeCraftStartWidget(player, craftJudge, commandactor)
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor);
craftStartWidgetOpen = false;
end
-- No real logic in this function. Just smoke and mirrors to 'see' the minigame in action at the minimum level. -- No real logic in this function. Just smoke and mirrors to 'see' the minigame in action at the minimum level.
function startCrafting(player, hand, quest, startDur, startQly, startHQ) function startCrafting(player, commandactor, craftJudge, hand, recipe, quest, startDur, startQly, startHQ)
local worldMaster = GetWorldMaster(); local worldMaster = GetWorldMaster();
local craftProg = 0; local progress = 0;
local attempts = 5; local attempts = 5;
local craftedCount = 0; local craftedCount = 0;
local craftTotal = 2; local craftTotal = 2;
local itemId = 10009617;
player:ChangeState(30+hand); -- Craft kneeling w/ appropriate tool out player:ChangeState(30+hand); -- Craft kneeling w/ appropriate tool out
player:ChangeMusic(73); player:ChangeMusic(73);
callClientFunction(player, "delegateCommand", craftJudge, "openCraftProgressWidget", commandactor, startDur, startQly, startHQ); callClientFunction(player, "delegateCommand", craftJudge, "openCraftProgressWidget", commandactor, startDur, startQly, startHQ);
while true do while (true) do
local progDiff = math.random(30,50);
local progDiff = math.random(25,25);
local duraDiff = math.random(1,3); local duraDiff = math.random(1,3);
local qltyDiff = math.random(0,2); local qltyDiff = math.random(0,2);
if craftProg >= 100 then if (progress >= 100) then
testChoice2 = callClientFunction(player, "delegateCommand", craftJudge, "updateInfo", commandactor, 100, 10, 20, 5020111, 69, 70, 75);
-- From Lodestone: If the HQ odds are 1% or better, players will have the option of selecting either Finish or Double Down.
-- By electing to double down, the player takes a chance on creating an HQ item at the risk of losing the completed item if the attempt fails
testChoice = callClientFunction(player, "delegateCommand", craftJudge, "craftTuningUI", commandactor, 22503, 22504);
player:SendGameMessage(GetWorldMaster(), 40111, 0x20, player, itemId, 3, 8); -- "You create <#3 quantity> <#1 item> <#2 quality>."
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftProgressWidget", commandactor); callClientFunction(player, "delegateCommand", craftJudge, "closeCraftProgressWidget", commandactor);
if quest then -- Handle local levequest craft success
continueLeve = callClientFunction(player, "delegateCommand", craftJudge, "askContinueLocalLeve", 120001, itemId, craftedCount, craftTotal, attempts); if quest then
quest:craftSuccess();
if (quest:getCurrentCrafted() >= quest:getObjectiveQuantity()) then
attentionMessage(player, 40121, quest:getQuestId(), quest:getCurrentCrafted(), quest:getObjectiveQuantity()); -- "All items for <QuestId> complete!"
else
attentionMessage(player, 40119, quest:getQuestId(), quest:getCurrentCrafted(), quest:getObjectiveQuantity()); -- "<QuestId> Successfull. (<crafted> of <attempts>)"
end
-- Continue local levequest (should this be in here??)
if (quest:getRemainingMaterials() ~= 0) then
continueLeve = callClientFunction(player, "delegateCommand", craftJudge, "askContinueLocalleve", commandactor,
quest:getQuestId(),
quest:getRecipe().resultItemID,
quest:getCurrentCrafted(),
quest:getObjectiveQuantity(),
quest:getRemainingMaterials()
);
if continueLeve == true then if (continueLeve == 1) then
craftProg = 0; progress = 0;
callClientFunction(player, "delegateCommand", craftJudge, "openCraftProgressWidget", commandactor, startDur, startQly, startHQ); callClientFunction(player, "delegateCommand", craftJudge, "openCraftProgressWidget", commandactor, startDur, startQly, startHQ);
else else
break; break;
end end
else else
break; break;
end
-- Normal synth craft success
else
player:SendGameMessage(GetWorldMaster(), 40111, 0x20, player, recipe.resultItemID, 1, recipe.resultQuantity); -- "You create <#3 quantity> <#1 item> <#2 quality>."
player:getItemPackage(location):addItem(recipe.resultItemID, recipe.resultQuantity, 1);
break;
end end
end end
choice = callClientFunction(player, "delegateCommand", craftJudge, "craftCommandUI", commandactor, 29, 2, 29530,29531,29532,29533,29534); choice = callClientFunction(player, "delegateCommand", craftJudge, "craftCommandUI", commandactor, 29, 2, 29530,29531,29532,29533,29534);
--player:SendMessage(0x20, "", "[DEBUG] Command id selected: "..choice); --player:SendMessage(0x20, "", "[DEBUG] Command id selected: "..choice);
if (choice) then
if choice then
if skillAnim[choice] then if skillAnim[choice] then
player:PlayAnimation(skillAnim[choice]); player:PlayAnimation(skillAnim[choice]);
@@ -428,11 +517,11 @@ function startCrafting(player, hand, quest, startDur, startQly, startHQ)
player:SendGameMessage(worldMaster, 40108, 0x20, choice,2); player:SendGameMessage(worldMaster, 40108, 0x20, choice,2);
if choice ~= 29531 then if (choice ~= 29531) then
craftProg = craftProg + progDiff; progress = progress + progDiff;
if craftProg >= 100 then if (progress >= 100) then
craftProg = 100; progress = 100;
end end
startDur = startDur - duraDiff; startDur = startDur - duraDiff;
@@ -443,12 +532,9 @@ function startCrafting(player, hand, quest, startDur, startQly, startHQ)
player:SendGameMessage(worldMaster, 40104, 0x20, qltyDiff); player:SendGameMessage(worldMaster, 40104, 0x20, qltyDiff);
end end
--prg dur qly, ???, ???, ???, HQ --prg dur qly, ???, ???, ???, HQ
callClientFunction(player, "delegateCommand", craftJudge, "updateInfo", commandactor, craftProg, startDur, startQly, nil, nil, nil, nil, nil); callClientFunction(player, "delegateCommand", craftJudge, "updateInfo", commandactor, progress, startDur, startQly, nil, nil, nil, nil, nil);
--testChoice = callClientFunction(player, "delegateCommand", craftJudge, "craftTuningUI", commandactor, 29501, 24233, 29501,29501, 24223, 29501,12008,12004);
end end
end end
end
return -1;
end

View File

@@ -1,5 +1,5 @@
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
player.Cast(command.actorId, targetActor); player.Cast(command.Id, targetActor);
player:endEvent(); player:endEvent();
end end

View File

@@ -1,5 +1,5 @@
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
player.Cast(command.actorId, targetActor); player.Cast(command.Id, targetActor);
player:endEvent(); player:endEvent();
end end

View File

@@ -9,7 +9,7 @@ Finds the correct weaponskill subscript to fire when a weaponskill actor is acti
--]] --]]
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
--Are they in active mode? --Are they in active mode?
if (player:GetState() != 2) then if (player:GetState() != 2) then
@@ -21,6 +21,6 @@ function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, ta
if not player.aiContainer.IsEngaged() then if not player.aiContainer.IsEngaged() then
player.Engage(targetActor); player.Engage(targetActor);
end; end;
player.WeaponSkill(command.actorId, targetActor); player.WeaponSkill(command.Id, targetActor);
player:endEvent(); player:endEvent();
end; end;

View File

@@ -4,7 +4,7 @@ DiceCommand Script
--]] --]]
function onEventStarted(player, actor, triggerName, maxNumber) function onEventStarted(player, actor, eventType, eventName, maxNumber)
if (maxNumber == nil or maxNumber > 1000 or maxNumber < 1) then if (maxNumber == nil or maxNumber > 1000 or maxNumber < 1) then
maxNumber = 100; maxNumber = 100;

View File

@@ -62,67 +62,59 @@ rangeInputWidget()
* goodMin * goodMin
* goodMax * goodMax
* bool * bool
Notes:
* Aim = Where on the aim gauge the player chose.
* Remainder = How many attempts you get on the section portion of the minigame
* Sweetspot = Where you hit on the second portion of the minigame
--]] --]]
minerAnim = {0x14001000, 0x14002000, 0x14003000}; minerAnim = {0x14001000, 0x14002000, 0x14003000};
--[[ Mooglebox - Aim --[[Mooglebox - Aim
+5 +4 +3 +2 +1 0 -1 -2 -3 -4 -5 +5 = 0
0 10 20 30 40 50 60 70 80 90 100 +4 = 10
+3 = 20
+2 = 30
+1 = 40
0 = 50
-1 = 60
-2 = 70
-3 = 80
-4 = 90
-5 = 100
Sweetspots 1=10 2=30 3=70 4=100 for Mining Sweetspots 1=10 2=30 3=70 4=100 for Mining
Remainder A=40 B=60 C=70 D=80 remainder A=40 B=60 C=70 D=80
--]] --]]
harvestNodeContainer = { -- nodeGrade, harvestAttempts, #ofItemsBecauseICantIntoIpairs, Item1, Item2, etc nodeContainer = { -- harvestAttempts, #ofItemsBecauseLuaIsShitAtTableLength, Item1, Item2, etc
[1001] = {2, 2, 3, 1, 2, 3}, [1] = {4, 3, 1, 2, 3}
[1002] = {2, 4, 5, 3005, 3003, 3002, 3001, 3004}
} }
harvestNodeItems = { nodeItems = {
--itemId, remainder, aim, sweetspot, max yield --itemId, remainder, aim, sweetspot, max yield
[1] = {10009104, 70, 30, 30, 4}, -- Rock Salt [1] = {10009104, 70, 30, 30, 4}, -- Rock Salt
[2] = {10006001, 80, 10, 30, 4}, -- Bone Chip [2] = {10006001, 80, 10, 30, 4}, -- Bone Chip
[3] = {10001006, 80, 20, 30, 3}, -- Copper Ore [3] = {10001006, 80, 20, 30, 3} -- Copper Ore
[3001] = {10001003, 80, 50, 30, 3},
[3002] = {10001006, 70, 70, 10, 4},
[3003] = {10001005, 80, 90, 70, 1},
[3004] = {10009104, 40, 10, 100, 2},
[3005] = {10001007, 40, 0, 30, 1}
} }
require ("global") require ("global")
function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg4, checkedActorId) function onEventStarted(player, commandActor, eventType, eventName, arg1, arg2, arg3, arg4, checkedActorId)
debugMsg = false; debugMsg = false;
powerCurrent = 0;
powerLast = 0;
powerRange = 10; -- 'Feels' look a good amount compared to vids/ARR's minigame.
showTutorial = 0;
commandMine = 22002; commandMine = 22002;
commandLog = 22003; commandLog = 22003;
commandFish = 22004; commandFish = 22004;
remainderA, remainderB, remainderC, remainderD = 40, 60, 70, 80;
harvestNodeId = 1001; -- What the server should send eventually
harvestNode = BuildHarvestNode(player, harvestNodeId); -- [1-11] = {itemId, remainder, sweetspot, maxYield} currentPower = 0;
harvestGrade = harvestNodeContainer[harvestNodeId][1] or 0; nodeGrade = 3;
harvestAttempts = harvestNodeContainer[harvestNodeId][2] or 0; showTutorial = 0;
nodeRemainder = 0; harvestAttempts = 2;
nodeRemainder = remainderC;
item = 10001006;
harvestType = commandMine; harvestType = commandMine;
@@ -134,12 +126,12 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg
player:ChangeState(50); player:ChangeState(50);
if harvestType == commandMine then if harvestType == commandMine then
player:SendGameMessage(harvestJudge, 26, MESSAGE_TYPE_SYSTEM, 1, harvestGrade); player:SendGameMessage(harvestJudge, 26, MESSAGE_TYPE_SYSTEM, 1, nodeGrade);
callClientFunction(player, "delegateCommand", harvestJudge, "openInputWidget", commandActor, harvestType, harvestGrade); callClientFunction(player, "delegateCommand", harvestJudge, "openInputWidget", commandActor, harvestType, nodeGrade);
callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, nil, harvestType); callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, nil, harvestType);
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, nil, 0, 0, 0, 0); callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, nil, 0, 0, 0, 0);
@@ -147,42 +139,22 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg
while harvestAttempts > 0 do while harvestAttempts > 0 do
-- "Aim", 0 = Top of bar, 100 = Bottom. -- "Aim", 0 = Top of bar, 100 = Bottom. Mooglebox conversion is +5 = 0, 0 = 50, -5 = 100
menuResult, sliderPhase, unk3 = callClientFunction(player, "delegateCommand", harvestJudge, "askInputWidget", commandActor, harvestType, 1, showTutorial, false, false, nil, false); menuResult, sliderPhase, ret3 = callClientFunction(player, "delegateCommand", harvestJudge, "askInputWidget", commandActor, harvestType, 1, showTutorial, false, false, nil, false);
if debugMsg then player:SendMessage(0x20, "", "menuResult: "..tostring(menuResult).." sliderPhase: "..tostring(sliderPhase).." Unk: "..tostring(unk3)); end
if debugMsg then player:SendMessage(0x20, "", tostring(menuResult).." unk: "..tostring(sliderPhase).." unk: "..tostring(ret3)); end
if menuResult == 22701 then -- Begin. if menuResult == 22701 then -- Begin.
player:SendGameMessage(harvestJudge, 36, MESSAGE_TYPE_SYSTEM);
local aimSlot = (sliderPhase/10)+1; -- Thanks LUA index = 1 nodeRemainder = remainderC;
local nodeDetails = harvestNode[aimSlot];
local nodeItem = nodeDetails[1];
local nodeRemainder = nodeDetails[2];
local nodeSweetspot = nodeDetails[3];
local nodeYield = nodeDetails[4];
local isFirstSwing = true;
local sweetspotDifference;
local sweetspotDifferencePrevious;
if debugMsg then
player:SendMessage(0x20, "", "aimSlot: "..(aimSlot).." itemId:"..tostring(nodeDetails[1]).." remainder: "..tostring(nodeDetails[2]));
end
player:SendGameMessage(harvestJudge, 36, MESSAGE_TYPE_SYSTEM); -- "You set your sights on an area."
callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, nil, harvestType); callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, nil, harvestType);
while true do while true do
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, nil, 0, 0, 0, 0);
-- "Strike" 0 = Empty, 100 = Filled. Mooglebox sweespots are 1=10, 2=30, 3=70, 4=100 for Mining -- "Strike" 0 = Empty, 100 = Filled. Mooglebox sweespots are 1=10, 2=30, 3=70, 4=100 for Mining
chosenCommand, powerCurrent = callClientFunction(player, "delegateCommand", harvestJudge, "askInputWidget", commandActor, harvestType, 2, showTutorial, false, false, nil, false); -- Strike chosenCommand, currentPower = callClientFunction(player, "delegateCommand", harvestJudge, "askInputWidget", commandActor, harvestType, 2, showTutorial, false, false, nil, false); -- Strike
if debugMsg then player:SendMessage(0x20, "", tostring(chosenCommand).." Power: "..tostring(powerCurrent)); end if debugMsg then player:SendMessage(0x20, "", tostring(chosenCommand).." Power: "..tostring(currentPower)); end
if chosenCommand == 22702 then -- Cancel. if chosenCommand == 22702 then -- Cancel.
@@ -196,64 +168,23 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg
player:SendGameMessage(player, worldMaster, 40339, 0x20, harvestAttempts); player:SendGameMessage(player, worldMaster, 40339, 0x20, harvestAttempts);
end end
break; break;
elseif chosenCommand == 22703 then -- Strike. elseif chosenCommand == 22703 then -- Strike.
player:PlayAnimation(minerAnim[math.random(1,3)]);
nodeRemainder = nodeRemainder - 20; nodeRemainder = nodeRemainder - 20;
if nodeRemainder < 0 then if nodeRemainder < 0 then
nodeRemainder = 0; nodeRemainder = 0;
end end
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, nil, 0, 0, 0, 0);
player:PlayAnimation(minerAnim[math.random(1,3)]);
wait(2);
sweetspotDifference = math.abs(powerCurrent - nodeSweetspot);
if powerRange >= sweetspotDifference then
callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, false, harvestType);
-- "You obtain <yield> <item> <quality>"
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 25, nodeItem, 0, nodeYield, 0);
player:SendGameMessage(player, worldMaster, 40301, MESSAGE_TYPE_SYSTEM, player, nodeItem, nodeYield); -- TODO: Refer to caps to see wtf is going on here
HarvestReward(player, nodeItem, nodeYield);
nodeRemainder = 0;
else
if isFirstSwing then
if sweetspotDifference < 19 then -- TODO: TWEAK THESE, likely need to be larger
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 45);
player:SendGameMessage(harvestJudge, 45, MESSAGE_TYPE_SYSTEM); -- "You feel something promising."
elseif sweetspotDifference > 20 then
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 42);
player:SendGameMessage(harvestJudge, 42, MESSAGE_TYPE_SYSTEM); -- "You feel nothing promising."
end
else
if sweetspotDifference > sweetspotDifferencePrevious then
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 43);
player:SendGameMessage(harvestJudge, 43, MESSAGE_TYPE_SYSTEM); -- "You are getting farther from the mark."
elseif sweetspotDifference < sweetspotDifferencePrevious then
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 44);
player:SendGameMessage(harvestJudge, 44, MESSAGE_TYPE_SYSTEM); -- "You are getting closer to the mark."
else
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 42);
player:SendGameMessage(harvestJudge, 42, MESSAGE_TYPE_SYSTEM); -- "You feel nothing promising."
end
end
end
if not isFirstSwing then
powerLast = powerCurrent;
end;
--player:SendGameMessage(harvestJudge, 25, MESSAGE_TYPE_SYSTEM, item, 4, 1);
callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, false, harvestType); callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, false, harvestType);
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 25, item, 4, 1, 0);
if nodeRemainder == 0 then if nodeRemainder == 0 then
harvestAttempts = harvestAttempts - 1; harvestAttempts = harvestAttempts - 1;
@@ -262,20 +193,13 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg
player:SendGameMessage(player, worldMaster, 40344, 0x20, harvestAttempts); player:SendGameMessage(player, worldMaster, 40344, 0x20, harvestAttempts);
else else
-- There is nothing left to gather at this location. -- There is nothing left to gather at this location.
player:ChangeMusic(101);
player:SendGameMessage(player, worldMaster, 40339, 0x20, harvestAttempts); player:SendGameMessage(player, worldMaster, 40339, 0x20, harvestAttempts);
end end
wait(2); wait(2);
break; break;
end end
if isFirstSwing and debugMsg then player:SendMessage(0x20, "", "First swing"); end
isFirstSwing = false;
sweetspotDifferencePrevious = sweetspotDifference;
elseif chosenCommand == 22710 then -- "Strike" Tutorial. elseif chosenCommand == 22710 then -- "Strike" Tutorial.
SendTutorial(player, harvestJudge, 2); SendTutorial(player, harvestJudge, 2);
end end
@@ -295,12 +219,8 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg
end end
player:SendGameMessage(harvestJudge, 31, MESSAGE_TYPE_SYSTEM);
if harvestAttempts == 0 then if harvestAttempts == 0 then
player:SendGameMessage(player, worldMaster, 40310, 0x20); -- "The deposit has been exhausted." player:SendGameMessage(harvestJudge, 31, MESSAGE_TYPE_SYSTEM);
--TO:DO Despawn node + whatever logic to respawn an exsiting expired node in the area.
end end
callClientFunction(player, "delegateCommand", harvestJudge, "closeInputWidget", commandActor, harvestType); callClientFunction(player, "delegateCommand", harvestJudge, "closeInputWidget", commandActor, harvestType);
@@ -311,67 +231,6 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg
end end
-- Returns a table in the following format: nodeTable = { [1-11] = {itemId, remainder, sweetspot, maxYield} }
function BuildHarvestNode(player, sentNode)
if harvestNodeContainer[sentNode] then
local node = harvestNodeContainer[sentNode];
local nodeTable = {};
local nodeItems = {};
local nodeItemCount = node[3];
local grade = node[1];
local attempts = node[2];
-- Load up nodeItems[] with the harvestNodeItems{} key and Aim point
for i=1, nodeItemCount do
local nodeItemKey = node[3+i];
local item = harvestNodeItems[ node[3+i] ]
nodeItems[i] = { nodeItemKey, ((item[3] / 10)+1) };
if debugMsg then player:SendMessage(0x20, "", "nodeItems: "..nodeItems[i][1].." "..nodeItems[i][2]); end
end
-- Iterate through the 11 Aim spots
for i=1,11,1 do
local hasItem = false;
-- See if there's a nodeItems[] that has an Aim spot that matches the current loop
-- TODO: Just set nodeItems[] keys to the actual slots to skip this loop inside a loop
for j=1, nodeItemCount do
if nodeItems[j][2] == i then
hasItem = j;
break;
end
end
if hasItem then
local item = harvestNodeItems[ nodeItems[hasItem][1] ];
-- Assign itemId, remainder, sweetspot, yield to this slot
nodeTable[i] = {item[1], item[2], item[4], item[5] };
if debugMsg then
player:SendMessage(0x20, "", "nodeTable: "..i.." "..nodeTable[i][1].." "..nodeTable[i][2].." "..nodeTable[i][3].." "..nodeTable[i][3]);
end
else
nodeTable[i] = {0,0,0,0};
if debugMsg then player:SendMessage(0x20, "", "nodeTable: "..i); end
end
end
return nodeTable
end
end
function SendTutorial(player, harvestJudge, id) function SendTutorial(player, harvestJudge, id)
if id == 1 then if id == 1 then
@@ -388,24 +247,4 @@ function SendTutorial(player, harvestJudge, id)
player:SendGameMessage(harvestJudge, 16, MESSAGE_TYPE_SYSTEM); player:SendGameMessage(harvestJudge, 16, MESSAGE_TYPE_SYSTEM);
end end
end
function HarvestReward(player, item, qty) -- Really should get a helper function for this
local worldMaster = GetWorldMaster();
local location = INVENTORY_NORMAL;
local invCheck = player:getItemPackage(location):addItem(item, qty, 1);
if (invCheck == INV_ERROR_FULL) then
-- Your inventory is full.
player:SendGameMessage(player, worldMaster, 60022, MESSAGE_TYPE_SYSTEM_ERROR);
elseif (invCheck == INV_ERROR_ALREADY_HAS_UNIQUE) then
-- You cannot have more than one <itemId> <quality> in your possession at any given time.
player:SendGameMessage(player, worldMaster, 40279, MESSAGE_TYPE_SYSTEM_ERROR, item, 1);
elseif (invCheck == INV_ERROR_SYSTEM_ERROR) then
player:SendMessage(MESSAGE_TYPE_SYSTEM_ERROR, "", "[DEBUG] Server Error on adding item.");
elseif (invCheck == INV_ERROR_SUCCESS) then
--player:SendMessage(MESSAGE_TYPE_SYSTEM, "", message);
player:SendGameMessage(player, worldMaster, 25246, MESSAGE_TYPE_SYSTEM, item, qty);
end
end end

View File

@@ -1,5 +1,5 @@
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
player.Cast(command.actorId, targetActor); player.Cast(command.Id, targetActor);
player:endEvent(); player:endEvent();
end end

View File

@@ -4,7 +4,7 @@ EmoteSitCommand Script
--]] --]]
function onEventStarted(player, actor, triggerName, emoteId) function onEventStarted(player, actor, eventType, eventName, emoteId)
if (player:GetState() == 0) then if (player:GetState() == 0) then
if (emoteId == 0x2712) then if (emoteId == 0x2712) then

View File

@@ -66,7 +66,7 @@ emoteTable = {
}; };
function onEventStarted(player, actor, triggerName, emoteId, showText, arg2, arg3, targetId) function onEventStarted(player, actor, eventType, triggerName, emoteId, showText, arg2, arg3, targetId)
if (targetId == nil) then if (targetId == nil) then
targetId = 0; targetId = 0;

View File

@@ -6,7 +6,7 @@ require ("global")
--commandid: command being equipped --commandid: command being equipped
function onEventStarted(player, equipAbilityWidget, triggername, slot, commandid, unkown, arg1, arg2, arg3, arg4, arg5, arg6) function onEventStarted(player, equipAbilityWidget, eventType, eventName, slot, commandid, unkown, arg1, arg2, arg3, arg4, arg5, arg6)
local worldManager = GetWorldManager(); local worldManager = GetWorldManager();
local ability = worldManager:GetBattleCommand(commandid); local ability = worldManager:GetBattleCommand(commandid);

View File

@@ -53,7 +53,7 @@ GRAPHICSLOT_L_RINGFINGER = 24;
GRAPHICSLOT_R_INDEXFINGER = 25; GRAPHICSLOT_R_INDEXFINGER = 25;
GRAPHICSLOT_L_INDEXFINGER = 26; GRAPHICSLOT_L_INDEXFINGER = 26;
function onEventStarted(player, actor, triggerName, equippedItem, param1, param2, param3, param4, param5, param6, param7, equipSlot, itemDBIds) function onEventStarted(player, actor, eventType, eventName, equippedItem, param1, param2, param3, param4, param5, param6, param7, equipSlot, itemDBIds)
equipSlot = equipSlot-1; equipSlot = equipSlot-1;
--Equip Item --Equip Item
@@ -174,7 +174,7 @@ function equipItem(player, equipSlot, item)
if (gItem:IsWeaverWeapon() == true) then graphicSlot = GRAPHICSLOT_SPOFFHAND; end if (gItem:IsWeaverWeapon() == true) then graphicSlot = GRAPHICSLOT_SPOFFHAND; end
if (gItem:IsGoldSmithWeapon() == true) then graphicSlot = GRAPHICSLOT_SPOFFHAND; end if (gItem:IsGoldSmithWeapon() == true) then graphicSlot = GRAPHICSLOT_SPOFFHAND; end
end end
--Graphic Slot was set, otherwise it's a special case --Graphic Slot was set, otherwise it's a special case
if (graphicSlot ~= nil) then if (graphicSlot ~= nil) then
player:GraphicChange(graphicSlot, item); player:GraphicChange(graphicSlot, item);

View File

@@ -1,5 +1,5 @@
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
player.Cast(command.actorId, targetActor); player.Cast(command.Id, targetActor);
player:endEvent(); player:endEvent();
end end

View File

@@ -6,7 +6,7 @@ Handles moving items across item packages (IE: Taking loot)
--]] --]]
function onEventStarted(player, actor, triggerName, itemReference, targetPackage, sourcePackage, arg1, arg2, unknown, arg3, arg4, arg5, type9ItemIds) function onEventStarted(player, actor, eventType, eventName, itemReference, targetPackage, sourcePackage, arg1, arg2, unknown, arg3, arg4, arg5, type9ItemIds)
player:EndEvent(); player:EndEvent();

View File

@@ -6,7 +6,7 @@ Handles giving an item to another party member.
--]] --]]
function onEventStarted(player, actor, triggerName, itemReference, targetPackage, sourcePackage, arg1, targetPlayer, arg2, arg3, arg4, arg5, type9ItemIds) function onEventStarted(player, actor, eventType, eventName, itemReference, targetPackage, sourcePackage, arg1, targetPlayer, arg2, arg3, arg4, arg5, type9ItemIds)
player:EndEvent(); player:EndEvent();

View File

@@ -9,7 +9,7 @@ The param "itemDBIds" has the vars: item1 and item2.
--]] --]]
function onEventStarted(player, actor, triggerName, itemReference, targetPackage, sourcePackage, arg1, arg2, unknown, arg3, arg4, arg5, type9ItemIds) function onEventStarted(player, actor, eventType, eventName, itemReference, targetPackage, sourcePackage, arg1, arg2, unknown, arg3, arg4, arg5, type9ItemIds)
player:GetItemPackage(itemReference.itemPackage):RemoveItemAtSlot(itemReference.slot); player:GetItemPackage(itemReference.itemPackage):RemoveItemAtSlot(itemReference.slot);
player:EndEvent(); player:EndEvent();
end end

View File

@@ -8,7 +8,7 @@ Fired when you try to abandon a quest
--]] --]]
function onEventStarted(player, command, triggerName, questId) function onEventStarted(player, command, eventType, eventName, questId)
player:AbandonQuest(questId); player:AbandonQuest(questId);
player:EndEvent(); player:EndEvent();

View File

@@ -4,7 +4,7 @@ LinkshellAppointCommand Script
--]] --]]
function onEventStarted(player, actor, triggerName, linkshellName, memberName, rank) function onEventStarted(player, actor, eventType, eventName, linkshellName, memberName, rank)
GetWorldManager():RequestWorldLinkshellRankChange(player, linkshellName, memberName, rank); GetWorldManager():RequestWorldLinkshellRankChange(player, linkshellName, memberName, rank);
player:EndEvent(); player:EndEvent();

View File

@@ -4,7 +4,7 @@ LinkshellChangeCommand Script
--]] --]]
function onEventStarted(player, actor, triggerName, linkshellName, arg1, arg2) function onEventStarted(player, actor, eventType, eventName, linkshellName, arg1, arg2)
if (linkshellName == nil) then if (linkshellName == nil) then
linkshellName = ""; linkshellName = "";

View File

@@ -6,7 +6,7 @@ Handles what happens when you cancel an invite to a linkshell
--]] --]]
function onEventStarted(player, actor, triggerName, arg1, arg2, arg3, arg4, actorId) function onEventStarted(player, actor, eventType, eventName, arg1, arg2, arg3, arg4, actorId)
GetWorldManager():RequestWorldLinkshellCancelInvite(player); GetWorldManager():RequestWorldLinkshellCancelInvite(player);
player:EndEvent(); player:EndEvent();

View File

@@ -6,7 +6,7 @@ Handles what happens when you invite a player to a linkshell
--]] --]]
function onEventStarted(player, actor, triggerName, linkshellName, arg1, arg2, arg3, actorId) function onEventStarted(player, actor, eventType, eventName, linkshellName, arg1, arg2, arg3, actorId)
GetWorldManager():RequestWorldLinkshellInviteMember(player, linkshellName, actorId); GetWorldManager():RequestWorldLinkshellInviteMember(player, linkshellName, actorId);
player:EndEvent(); player:EndEvent();

View File

@@ -4,7 +4,7 @@ LinkshellKickCommand Script
--]] --]]
function onEventStarted(player, actor, triggerName, linkshellName, kickedName) function onEventStarted(player, actor, eventType, eventName, linkshellName, kickedName)
GetWorldManager():RequestWorldLinkshellKick(player, linkshellName, kickedName); GetWorldManager():RequestWorldLinkshellKick(player, linkshellName, kickedName);
player:EndEvent(); player:EndEvent();

View File

@@ -4,7 +4,7 @@ LinkshellLeaveCommand Script
--]] --]]
function onEventStarted(player, actor, triggerName, linkshellName) function onEventStarted(player, actor, eventType, eventName, linkshellName)
GetWorldManager():RequestWorldLinkshellLeave(player, linkshellName); GetWorldManager():RequestWorldLinkshellLeave(player, linkshellName);
player:EndEvent(); player:EndEvent();

View File

@@ -8,7 +8,7 @@ Handles post-dream events.
require ("global") require ("global")
function onEventStarted(player, actor, triggerName, dreamCode, innCode, narg1, narg2, bedActor) function onEventStarted(player, actor, eventType, eventName, dreamCode, innCode, narg1, narg2, bedActor)
--In Plain Sight --In Plain Sight
if (dreamCode == 1) then if (dreamCode == 1) then

View File

@@ -12,7 +12,7 @@ eventLogoutFade()
require ("global") require ("global")
function onEventStarted(player, command, triggerName) function onEventStarted(player, command, eventType, eventName)
choice = callClientFunction(player, "delegateCommand", command, "eventConfirm"); choice = callClientFunction(player, "delegateCommand", command, "eventConfirm");

View File

@@ -40,7 +40,7 @@ updateNegotiationWidget(player, gridIndex, key, itemIconId, pointValue, ?, ?) -
require ("global") require ("global")
function onEventStarted(player, commandactor, triggerName, arg1, arg2, arg3, arg4, arg5) function onEventStarted(player, commandactor, eventType, eventName, arg1, arg2, arg3, arg4, arg5)
negotiationJudge = GetStaticActor("NegotiationJudge"); negotiationJudge = GetStaticActor("NegotiationJudge");

View File

@@ -4,42 +4,14 @@ require ("global")
NpcLinkshellChatCommand Script NpcLinkshellChatCommand Script
Handler for when a player clicks a npc ls to talk to. If adding new linkshells to the handle, make sure to add Player class will go through all quests and see if there are active msgs for one. If there was, it will
it to the handler table (with correct offset), and that your function is above the handler. If padding is needed return true and that quest must end the event (if needed). Otherwise if nothing caught the event, the
to hit some ID, add "nils". event is ended here.
--]] --]]
function onEventStarted(player, command, eventType, eventName, npcLsId)
local function handleAdventurersGuild(player) if (player:HandleNpcLs(npcLsId) == false) then
if (player:HasQuest(110006) == true) then player:EndEvent();
local man0g1Quest = player:GetQuest("Man0g1");
player:SendGameMessage(man0g1Quest, 330, 39, 1300018, nil);
end end
end end
local function handlePathOfTheTwelve(player)
player:SendMessage(0x20, "", "Test");
end
local npcLsHandlers = {
handleAdventurersGuild,
nil,
nil,
nil,
nil,
handlePathOfTheTwelve
}
function onEventStarted(player, command, triggerName, npcLsId)
if (npcLsHandlers[npcLsId] ~= nil) then
npcLsHandlers[npcLsId](player);
player:SetNpcLS(npcLsId-1, NPCLS_ACTIVE);
else
player:SendMessage(0x20, "", "That Npc Linkshell is not implemented yet.");
end
player:endEvent();
end

View File

@@ -6,7 +6,7 @@ Handles disbanding the party.
--]] --]]
function onEventStarted(player, actor, triggerName) function onEventStarted(player, actor, eventType, eventName)
worldMaster = GetWorldMaster(); worldMaster = GetWorldMaster();
if (player:IsPartyLeader()) then if (player:IsPartyLeader()) then

View File

@@ -15,7 +15,7 @@ TextIds:
--]] --]]
function onEventStarted(player, actor, name) function onEventStarted(player, actor, eventType, eventName, name)
worldMaster = GetWorldMaster(); worldMaster = GetWorldMaster();
if (player:IsPartyLeader()) then if (player:IsPartyLeader()) then

View File

@@ -6,7 +6,7 @@ Handles what happens when you invite
--]] --]]
function onEventStarted(player, actor, triggerName, name, arg1, arg2, arg3, actorId) function onEventStarted(player, actor, eventType, eventName, name, arg1, arg2, arg3, actorId)
if (name ~= nil) then if (name ~= nil) then
GetWorldManager():CreateInvitePartyGroup(player, name); GetWorldManager():CreateInvitePartyGroup(player, name);

View File

@@ -15,7 +15,7 @@ TextIds:
--]] --]]
function onEventStarted(player, actor, triggerName, name, arg2, arg3, arg4, actorId) function onEventStarted(player, actor, eventType, eventName, name, arg2, arg3, arg4, actorId)
worldMaster = GetWorldMaster(); worldMaster = GetWorldMaster();
if (player:IsPartyLeader()) then if (player:IsPartyLeader()) then

View File

@@ -6,7 +6,7 @@ Handles requesting to change party leader and various errors.
--]] --]]
function onEventStarted(player, actor, triggerName, name, arg2, arg3, arg4, actorId) function onEventStarted(player, actor, eventType, eventName, name, arg2, arg3, arg4, actorId)
worldMaster = GetWorldMaster(); worldMaster = GetWorldMaster();
if (player:IsPartyLeader()) then if (player:IsPartyLeader()) then

View File

@@ -6,7 +6,7 @@ Handles leaving a party
--]] --]]
function onEventStarted(player, actor, triggerName) function onEventStarted(player, actor, eventType, eventName)
player:PartyLeave(name); player:PartyLeave(name);
player:EndEvent(); player:EndEvent();
end end

View File

@@ -27,7 +27,7 @@ markers = { -- [id] = {overheadIcon, textIcon}
} }
function onEventStarted(player, actor, triggerName, commandValue, category, unk1, unk2, targetActor, unk3, unk4, unk5, unk6) function onEventStarted(player, actor, eventType, eventName, commandValue, category, unk1, unk2, targetActor, unk3, unk4, unk5, unk6)
workName = "charaWork.parameterTemp.targetInformation"; workName = "charaWork.parameterTemp.targetInformation";
uiFunc = "charaWork/stateForAll"; uiFunc = "charaWork/stateForAll";

View File

@@ -8,16 +8,16 @@ Notes:
--]] --]]
require("global") require("global")
function onEventStarted(player, actor, triggerName, pushCommand, unk1, unk2, unk3, ownerActorId, unk4, unk5, unk6, unk7) function onEventStarted(player, actor, eventType, eventName, pushCommand, unk1, unk2, unk3, ownerActorId, unk4, unk5, unk6, unk7)
actor = player:GetActorInInstance(ownerActorId); actor = player:GetActorInInstance(ownerActorId);
print("TESSSSSSSSSSSSSST");
harvestCommand = GetStaticActorById(0xA0F055F7);
if (actor != nil) then if (actor != nil) then
if (actor:GetActorClassId() == 1200052) then if (actor:GetActorClassId() == 1200052) then
player:kickEvent(actor, "commandJudgeMode", "commandJudgeMode"); player:KickEventSpecial(harvestCommand, 0, "commandJudgeMode", 0, 0, 0, 0, 0x4E26, 0, nil, 0xF, actor, nil, nil, nil, nil);
else else
printf("TEST"); player:kickEvent(actor, "pushCommand", false);
player:kickEvent(actor, "pushCommand", "pushCommand");
end end
else else
player:endEvent(); player:endEvent();

View File

@@ -1,7 +1,7 @@
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
player.Cast(command.actorId, targetActor); player.Cast(command.Id, targetActor);
player:endEvent(); player:endEvent();
end end

View File

@@ -1,5 +1,5 @@
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
player.Cast(command.actorId, targetActor); player.Cast(command.Id, targetActor);
player:endEvent(); player:endEvent();
end end

View File

@@ -3,7 +3,7 @@
--]] --]]
function onEventStarted(player, actor, questId) function onEventStarted(player, actor, eventType, eventName, questId)
player:SendDataPacket("requestedData", "activegl", 7, nil, nil, nil, nil, nil, nil, nil); player:SendDataPacket("requestedData", "activegl", 7, nil, nil, nil, nil, nil, nil, nil);
-- player:SendRequestedInfo("requestedData", "glHist", 10, 0x1D4F2, 1009, 12464, 11727, 12485, 12526); -- player:SendRequestedInfo("requestedData", "glHist", 10, 0x1D4F2, 1009, 12464, 11727, 12485, 12526);
end end

View File

@@ -1,23 +1,30 @@
--[[ --[[
RequestQuestJournalCommand Script
Functions: None
Notes:
Fires when the player looks at a quest's journal entry and the map section. Check the quest sheet and quest_marker sheet
for valid entries for your quest.
--]] --]]
function onEventStarted(player, actor, trigger, questId, mapCode) function onEventStarted(player, command, eventType, eventName, questId, mapCode)
local quest = player:GetQuest(questId);
quest = player:GetQuest(questId);
if (quest == nil) then if (quest ~= nil) then
player:EndEvent(); if (mapCode == nil) then
return; -- Get Quest Journal Data
end local journalInfo = quest:GetJournalInformation();
player:SendDataPacket("requestedData", "qtdata", quest:GetQuestId(), quest:GetSequence(), unpack(journalInfo));
if (mapCode == nil) then else
player:SendDataPacket("requestedData", "qtdata", quest:GetQuestId(), quest:GetPhase()); -- Get Quest Map Data
player:EndEvent(); local mapMarkers = quest:GetJournalMapMarkerList();
else player:SendDataPacket("requestedData", "qtmap", quest:GetQuestId(), unpack(mapMarkers));
player:SendDataPacket("requestedData", "qtmap", quest:GetQuestId()); end
player:EndEvent();
end end
player:EndEvent();
end end

View File

@@ -9,7 +9,7 @@ Finds the correct weaponskill subscript to fire when a weaponskill actor is acti
--]] --]]
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
player.Ability(command.actorId, targetActor); player.Ability(command.Id, targetActor);
player:endEvent(); player:endEvent();
end; end;

View File

@@ -13,7 +13,7 @@ local attackMagicHandlers = {
} }
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
player.Cast(command.actorId, targetActor); player.Cast(command.Id, targetActor);
player:endEvent(); player:endEvent();
end; end;

View File

@@ -6,7 +6,7 @@ Functions:
eventRegion(numAnima) eventRegion(numAnima)
eventAetheryte(region, animaCost1, animaCost2, animaCost3, animaCost4, animaCost5, animaCost6) eventAetheryte(region, animaCost1, animaCost2, animaCost3, animaCost4, animaCost5, animaCost6)
eventConfirm(isReturn, isInBattle, cityReturnNum, 138821, forceAskReturnOnly) eventConfirm(isReturn, isInBattle, HomePointInn, HomePoint, forceAskReturnOnly)
--]] --]]
@@ -15,112 +15,189 @@ require ("aetheryte")
require ("utils") require ("utils")
teleportMenuToAetheryte = { teleportMenuToAetheryte = {
[1] = { [1] = {
[1] = 1280001, [1] = 1280001,
[2] = 1280002, [2] = 1280002,
[3] = 1280003, [3] = 1280003,
[4] = 1280004, [4] = 1280004,
[5] = 1280005, [5] = 1280005,
[6] = 1280006 [6] = 1280006
}, },
[2] = { [2] = {
[1] = 1280092, [1] = 1280092,
[2] = 1280093, [2] = 1280093,
[3] = 1280094, [3] = 1280094,
[4] = 1280095, [4] = 1280095,
[5] = 1280096 [5] = 1280096
}, },
[3] = { [3] = {
[1] = 1280061, [1] = 1280061,
[2] = 1280062, [2] = 1280062,
[3] = 1280063, [3] = 1280063,
[4] = 1280064, [4] = 1280064,
[5] = 1280065, [5] = 1280065,
[6] = 1280066 [6] = 1280066
}, },
[4] = { [4] = {
[1] = 1280031, [1] = 1280031,
[2] = 1280032, [2] = 1280032,
[3] = 1280033, [3] = 1280033,
[4] = 1280034, [4] = 1280034,
[5] = 1280035, [5] = 1280035,
[6] = 1280036 [6] = 1280036
}, },
[5] = { [5] = {
[1] = 1280121, [1] = 1280121,
[2] = 1280122 [2] = 1280122
} }
} }
function onEventStarted(player, actor, triggerName, isTeleport) zoneIdToRegionChoice =
{
[128] = 1, [129] = 1, [130] = 1, [131] = 1, [132] = 1, [133] = 1, [134] = 1, [135] = 1, [230] = 1,
[143] = 2, [144] = 2, [145] = 2, [147] = 2, [148] = 2,
[150] = 3, [151] = 3, [152] = 3, [153] = 3, [154] = 3, [155] = 3, [157] = 3, [158] = 3, [159] = 3, [160] = 3, [206] = 3,
[170] = 4, [171] = 4, [172] = 4, [173] = 4, [174] = 4, [175] = 4, [176] = 4, [178] = 4, [180] = 4, [181] = 4, [209] = 4,
[190] = 5
}
local worldMaster = GetWorldMaster();
if (isTeleport == 0) then function onEventStarted(player, actor, eventType, eventName, isTeleport)
while (true) do
regionChoice = callClientFunction(player, "delegateCommand", actor, "eventRegion", 100);
if (regionChoice == nil) then break end
while (true) do
aetheryteChoice = callClientFunction(player, "delegateCommand", actor, "eventAetheryte", regionChoice, 2, 2, 2, 4, 4, 4);
if (aetheryteChoice == nil) then break end
player:PlayAnimation(0x4000FFA);
player:SendGameMessage(worldMaster, 34101, 0x20, 2, teleportMenuToAetheryte[regionChoice][aetheryteChoice], 100, 100);
confirmChoice = callClientFunction(player, "delegateCommand", actor, "eventConfirm", false, false, 1, 138824, false);
if (confirmChoice == 1) then
player:PlayAnimation(0x4000FFB);
player:SendGameMessage(worldMaster, 34105, 0x20);
--Do teleport
destination = aetheryteTeleportPositions[teleportMenuToAetheryte[regionChoice][aetheryteChoice]];
if (destination ~= nil) then
randoPos = getRandomPointInBand(destination[2], destination[4], 3, 5);
rotation = getAngleFacing(randoPos.x, randoPos.y, destination[2], destination[4]);
GetWorldManager():DoZoneChange(player, destination[1], nil, 0, 2, randoPos.x, destination[3], randoPos.y, rotation);
end
end
player:endEvent();
return;
end
end
else
player:PlayAnimation(0x4000FFA);
local choice, isInn = callClientFunction(player, "delegateCommand", actor, "eventConfirm", true, false, player:GetHomePointInn(), player:GetHomePoint(), false);
if (choice == 1) then
player:PlayAnimation(0x4000FFB);
player:SendGameMessage(worldMaster, 34104, 0x20);
--bandaid fix for returning while dead, missing things like weakness and the heal number local worldMaster = GetWorldMaster();
if (player:GetHP() == 0) then local playerState = player:GetState();
player:SetHP(player.GetMaxHP()); local currentAnima = 100;
player:ChangeState(0); local baseAnimaCost = 6;
player:PlayAnimation(0x01000066); local animaCost = 0;
end local favoredLocation = {1280003, 1280005, 1280062};
local currentRegion = zoneIdToRegionChoice[player:GetPos()[5]] or 0;
local isCity = {[1280001] = true, [1280061] = true, [1280031] = true};
local isFavoredDesination = false;
local destination = 0;
if (isInn) then
--Return to Inn
if (player:GetHomePointInn() == 1) then
GetWorldManager():DoZoneChange(player, 244, nil, 0, 15, -160.048, 0, -165.737, 0);
elseif (player:GetHomePointInn() == 2) then
GetWorldManager():DoZoneChange(player, 244, nil, 0, 15, 160.048, 0, 154.263, 0);
elseif (player:GetHomePointInn() == 3) then
GetWorldManager():DoZoneChange(player, 244, nil, 0, 15, 0.048, 0, -5.737, 0);
end
elseif (choice == 1 and isInn == nil) then
--Return to Homepoint
destination = aetheryteTeleportPositions[player:GetHomePoint()];
if (destination ~= nil) then
randoPos = getRandomPointInBand(destination[2], destination[4], 3, 5);
rotation = getAngleFacing(randoPos.x, randoPos.y, destination[2], destination[4]);
GetWorldManager():DoZoneChange(player, destination[1], nil, 0, 2, randoPos.x, destination[3], randoPos.y, rotation);
end if (isTeleport == 0) then -- Teleport hit
end while (true) do
end regionChoice = callClientFunction(player, "delegateCommand", actor, "eventRegion", currentAnima);
end
if (regionChoice == nil) then break end
while (true) do
if (regionChoice > 0 and regionChoice < 6) then -- If Region selected
if (regionChoice == currentRegion) then -- Check if selected region matches player's region, reduce cost if so.
baseAnimaCost = baseAnimaCost - 2;
else
baseAnimaCost = 6;
end
-- Assign anima cost to the six possible slots after factoring in same region or not.
animaCost = {baseAnimaCost, baseAnimaCost, baseAnimaCost, baseAnimaCost, baseAnimaCost, baseAnimaCost};
if (isCity[teleportMenuToAetheryte[regionChoice][1]] == true) then
-- Halve the cost of applicable city aetheryte
animaCost[1] = animaCost[1] / 2;
end
elseif (regionChoice == 6) then -- Favored Destinations selected.
-- Dummy info. Favored would be half price after factoring in same region cost or not.
animaCost = {2, 3, 3, favoredLocation[1], favoredLocation[2], favoredLocation[3]};
isFavoredDesination = true;
end
aetheryteChoice = callClientFunction(
player,
"delegateCommand",
actor,
"eventAetheryte",
regionChoice,
animaCost[1],
animaCost[2],
animaCost[3],
animaCost[4],
animaCost[5],
animaCost[6]
);
if (aetheryteChoice == nil) then break end
player:PlayAnimation(0x4000FFA);
if (isFavoredDesination == true) then
destination = aetheryteTeleportPositions[favoredLocation[aetheryteChoice]];
player:SendGameMessage(worldMaster, 34101, 0x20, 2, favoredLocation[aetheryteChoice], animaCost[aetheryteChoice], currentAnima);
else
destination = aetheryteTeleportPositions[teleportMenuToAetheryte[regionChoice][aetheryteChoice]];
player:SendGameMessage(worldMaster, 34101, 0x20, 2, teleportMenuToAetheryte[regionChoice][aetheryteChoice], animaCost[aetheryteChoice], currentAnima);
end
confirmChoice = callClientFunction(player, "delegateCommand", actor, "eventConfirm", false, false, 1, 138824, false);
if (confirmChoice == 1) then
player:PlayAnimation(0x4000FFB);
player:SendGameMessage(worldMaster, 34105, 0x20);
if (destination ~= 0) then
randoPos = getRandomPointInBand(destination[2], destination[4], 3, 5);
rotation = getAngleFacing(randoPos.x, randoPos.y, destination[2], destination[4]);
if (playerState == ACTORSTATE_MOUNTED) then
player:SetMountState(0);
player:ChangeSpeed(0.0, 2.0, 5.0, 5.0)
player:ChangeState(ACTORSTATE_PASSIVE);
end
GetWorldManager():DoZoneChange(player, destination[1], nil, 0, 2, randoPos.x, destination[3], randoPos.y, rotation);
end
end
player:endEvent();
return;
end
end
else -- Return hit
player:PlayAnimation(0x4000FFA);
local choice, isInn = callClientFunction(player, "delegateCommand", actor, "eventConfirm", true, false, player:GetHomePointInn(), player:GetHomePoint(), false);
if (choice == 1) then
player:PlayAnimation(0x4000FFB);
player:SendGameMessage(worldMaster, 34104, 0x20);
--bandaid fix for returning while dead, missing things like weakness and the heal number
if (player:GetHP() == 0) then
player:SetHP(player.GetMaxHP());
player:ChangeState(0);
player:PlayAnimation(0x01000066);
end
if (isInn) then
--Return to Inn
if (player:GetHomePointInn() == 1) then
GetWorldManager():DoZoneChange(player, 244, nil, 0, 15, -160.048, 0, -165.737, 0);
elseif (player:GetHomePointInn() == 2) then
GetWorldManager():DoZoneChange(player, 244, nil, 0, 15, 160.048, 0, 154.263, 0);
elseif (player:GetHomePointInn() == 3) then
GetWorldManager():DoZoneChange(player, 244, nil, 0, 15, 0.048, 0, -5.737, 0);
end
elseif (choice == 1 and isInn == nil) then
--Return to Homepoint
destination = aetheryteTeleportPositions[player:GetHomePoint()];
if (destination ~= nil) then
randoPos = getRandomPointInBand(destination[2], destination[4], 3, 5);
rotation = getAngleFacing(randoPos.x, randoPos.y, destination[2], destination[4]);
if (playerState == ACTORSTATE_MOUNTED) then
player:SetMountState(0);
player:ChangeSpeed(0.0, 2.0, 5.0, 5.0)
player:ChangeState(ACTORSTATE_PASSIVE);
end
GetWorldManager():DoZoneChange(player, destination[1], nil, 0, 2, randoPos.x, destination[3], randoPos.y, rotation);
end
end
end
end
player:endEvent();
end
player:endEvent();
end

View File

@@ -24,7 +24,7 @@ reedit: Target has canceled their accept.
require ("global") require ("global")
function onEventStarted(player, actor, triggerName) function onEventStarted(player, actor, eventType, eventName)
callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandOpenTray"); callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandOpenTray");

View File

@@ -6,7 +6,7 @@ Handles what happens a player cancels a trade
--]] --]]
function onEventStarted(player, actor, triggerName, commandId, result) function onEventStarted(player, actor, eventType, eventName, commandId, result)
GetWorldManager():CancelTrade(player); GetWorldManager():CancelTrade(player);
player:EndEvent(); player:EndEvent();

View File

@@ -6,16 +6,16 @@ Handles what happens when you invite to trade
--]] --]]
function onEventStarted(player, actor, triggerName, name, arg1, arg2, arg3, actorId) function onEventStarted(player, actor, eventType, eventName, name, arg1, arg2, arg3, actorId)
local otherActor = nil; local otherActor = nil;
--ActorID Search --ActorID Search
if (actorId ~= nil) then if (actorId ~= nil) then
otherActor = player:GetZone():FindActorInArea(actorId); otherActor = player.CurrentArea):FindActorInArea(actorId);
--Name Search --Name Search
elseif (name ~= nil) then elseif (name ~= nil) then
otherActor = player:GetZone():FindPCInZone(name); otherActor = player.CurrentArea:FindPCInZone(name);
end end
if (otherActor ~= nil) then if (otherActor ~= nil) then

View File

@@ -24,7 +24,7 @@ function onSkillFinish(caster, target, skill, action, actionContainer)
local amount = buff.GetExtra(); local amount = buff.GetExtra();
caster.AddMP(amount); caster.AddMP(amount);
actionContainer.AddMPAction(caster.actorId, 33007, amount); actionContainer.AddMPAction(caster.Id, 33007, amount);
caster.statusEffects.RemoveStatusEffect(buff, actionContainer, 30329); caster.statusEffects.RemoveStatusEffect(buff, actionContainer, 30329);
else else
--Blissful mind takes 25% of CURRENT HP and begins storing MP up to that point, at which point the buff changes to indicate its full --Blissful mind takes 25% of CURRENT HP and begins storing MP up to that point, at which point the buff changes to indicate its full

View File

@@ -0,0 +1,21 @@
require("global");
properties = {
permissions = 0,
parameters = "s",
description = "Adds a quest by <id>.",
}
function onTrigger(player, argc, glId)
if player then
local glIdAsNumber = tonumber(glId);
if (glIdAsNumber == nil) then
player:AddQuest(glId);
else
player:AddQuest(glIdAsNumber);
end
else
print(sender.."unable to add guildleve, ensure player name is valid.");
end;
end;

View File

@@ -15,7 +15,7 @@ function onTrigger(player, argc)
if player then if player then
if player.target then if player.target then
print("hi") print("hi")
local id = player.target.actorId local id = player.target.Id
print("hi") print("hi")
player.currentParty:AddMember(id); player.currentParty:AddMember(id);
player.target.currentParty = player.currentParty; player.target.currentParty = player.currentParty;

View File

@@ -0,0 +1,95 @@
require("global");
properties = {
permissions = 0,
parameters = "dddd",
description =
[[
Sets anim id for current target
!anim <animID> |
!anim <category> <effect> <motion>
]],
}
function onTrigger(player, argc, aType, a1, a2)
local actor = player.CurrentArea.FindActorInArea(player.currentTarget) or nil;
if (player and actor) then
a1 = bit32.band(a1, 0xFFF);
a2 = bit32.band(a2, 0xFFF);
aType = bit32.band(aType, 0xFF);
animId = bit32.bor(bit32.lshift(a2, 12), a1);
animId = bit32.bor(bit32.lshift(aType, 24), animId);
-- player:SendMessage(0x20, "[anim] ", tostring(animId));
actor:PlayAnimation(animId);
local output = string.format("%x", animId)
player:SendMessage(0x20, "[anim] ", "0x"..tostring(output).. " Target:"..tostring(actor));
end
end
--[[ Categories:
1 MGK: 01 - Magic
2 SYS: 02 - System noises
3 ETC: 03 - ?? - Item sound?
4 LIB: 04 - Posing animations
5-9 ITM: 05-09 - Items
10 KAO: 0A - KAO = Face emotes?
11-12 GLI1/2/3: 0B/0C - Leve card things
13 CBI: 0D - Two small effects
14 ABL: 0E - Cooldown buffs
15 POP: 0F - Warp effects
16 CFT: 10 - Crafting?
17 BTL: 11 - More Crafting?
18 WSC: 12 - Weapon Skills Arg1 - Weapon Skill Arg2 - Player Animation
19 WSS: 13 - Mob animations
20 PIC: 14 - Gathering weapons?
21 LIU: 15 - Player Hand Emotes
22 LIN: 16 - Doesn't exist?
23 LIF: 17 - Doesn't exist?
24 LIL: 18 - Mouth
25 ATK: 19 - Autoattacks
33 = ?
34 = Crash
120 = ???
Notes:
------
CATEGORY
Shift 18 bits right
CMP 0xB
ANIMATION??????
Shift 0xC bits right
AND 0x0FFF
PARTICLE EFFECT
AND 0x0FFF
This number is in the subfolder (wsc, abi, etc)
That 12 is:
CMP 7C
CMP 6f
CMP 70
CMP 71
7C000062
ec000000
00FFFFFF
19: Auto Attack?
6F: Casting
71: Seems to deal with signaling monster parts
7C: Sheath/Unsheath
7F: Cast failed
--]]

View File

@@ -0,0 +1,23 @@
require("global");
properties = {
permissions = 0,
parameters = "",
description =
[[
Changes appearance for equipment with given parameters.
!graphic <slot> <wID> <eID> <vID> <vID>
]],
}
function onTrigger(player, argc)
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
local sender = "[changetonpc] ";
local npc = player.CurrentArea:FindActorInArea(player.currentTarget);
if npc then
player:ChangeIntoNpc(npc);
end
end

View File

@@ -0,0 +1,58 @@
require("global");
properties = {
permissions = 0,
parameters = "dd",
description =
[[
Sets if a quest is completed.
!completedQuest <questId> true/false
]],
}
function onTrigger(player, argc, questId, flag)
print("HEY");
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
local sender = "[completedQuest] ";
local message = "Error";
if (argc < 1) then
return;
end
local questId = tonumber(questId);
local flag = flag or nil;
-- Fail if not valid questId
if (questId < 110001 or questId > 110001 + 2048) then
player:SendMessage(messageID, sender, "Invalid questId entered");
return;
end
-- Getting
if (arc == 1) then
player:SendMessage(messageID, sender, string.format("Quest %d completion is set to: %s", questId, tostring(player:IsQuestCompleted(questId))));
return;
-- Setting
else
-- Fail if not valid flag
if (not flag == nil) then
player:SendMessage(messageID, sender, "Invalid flag entered");
else
local boolFlag = false;
if (flag == "true" or flag == "1" or flag == "on" or flag == "O") then
boolFlag = true;
elseif (flag == "false" or flag == "0" or flag == "off" or flag == "X") then
boolFlag = false;
elseif flag == "flip" or flag == "toggle" then
boolFlag = not player:IsQuestCompleted(questId);
end
player:SetQuestComplete(questId, boolFlag);
player:SendMessage(messageID, sender, string.format("Quest %d completion set to: %s", questId, tostring(player:IsQuestCompleted(questId))));
return;
end
end
end

View File

@@ -8,9 +8,8 @@ properties = {
function onTrigger(player, argc, actorName) function onTrigger(player, argc, actorName)
if (actorName ~= nil) then if (actorName ~= nil) then
zone = player:GetZone(); actor = player.CurrentArea:DespawnActor(actorName);
actor = zone:DespawnActor(actorName);
end end
end; end;

View File

@@ -0,0 +1,29 @@
require("global");
properties = {
permissions = 0,
parameters = "ssss",
description =
[[
Gets the info about the current target
]],
}
function onTrigger(player)
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
local sender = "[Info] ";
local targetActor = player.CurrentArea.FindActorInArea(player.currentTarget) or nil;
if not targetActor then
player:SendMessage(messageID, sender, "No target selected");
return
end
player:SendMessage(messageID, sender, string.format("Position (XYZ-O): %.3f, %.3f, %.3f - %.3f", targetActor.positionX, targetActor.positionY, targetActor.positionZ, targetActor.rotation));
player:SendMessage(messageID, sender, string.format("Actor ID: 0x%X", targetActor.Id));
player:SendMessage(messageID, sender, string.format("Class Name: %s", targetActor.className));
player:SendMessage(messageID, sender, string.format("Class ID: %d", targetActor:GetActorClassId()));
end

View File

@@ -26,8 +26,8 @@ function onTrigger(player, argc, qty, name, lastName)
currency = 1000001; currency = 1000001;
qty = tonumber(qty) or 1; qty = tonumber(qty) or 1;
location = INVENTORY_CURRENCY; location = INVENTORY_CURRENCY;
print("ASDASDASDASDASD");
actionList = player:AddExp(qty, player.charaWork.parameterSave.state_mainSkill[0], 0); actionList = player:AddExp(qty, player.charaWork.parameterSave.state_mainSkill[1], 0);
player:DoBattleAction(0, 0, actionList); player:DoBattleAction(0, 0, actionList);
else else
print(sender.."unable to add experience, ensure player name is valid."); print(sender.."unable to add experience, ensure player name is valid.");

Some files were not shown because too many files have changed in this diff Show More