Skip to content

Commit

Permalink
Initial upload
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDawg committed Aug 22, 2021
0 parents commit db0eecc
Show file tree
Hide file tree
Showing 28 changed files with 893 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*.ini text eol=crlf
*.txt text eol=crlf
*.htm text eol=crlf
*.html text eol=crlf
*.gitignore text eol=crlf
*.gitattributes text eol=crlf
*.gif binary
*.ico binary
*.jpg binary
*.png binary
*.exe binary
35 changes: 35 additions & 0 deletions .github/workflows/InfinityAutoPackager.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Infinity Auto Packager by AL|EN (alienquake@hotmail.com)
# A tool that automatically generates Infinity Engine mod packages when you publish a release.

on:
release:
types: [published]
jobs:
InfinityAutoPackager:
runs-on: ubuntu-latest
steps:

- name: Initial setup
run: |
git lfs uninstall
git config --global core.autocrlf false
git config --global core.ignorecase true
- name: Clone repository using 'github.ref' from release
uses: actions/checkout@master

- name: Create Infinity Engine Mod Packages (.iemod and .zip)
uses: ALIENQuake/CreateIEModZipPackage@master
id: CreateIEModZipPackage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload iemod package to latest release
uses: svenstaro/upload-release-action@v1-release
if: github.ref != 'refs/heads/master'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ steps.CreateIEModZipPackage.outputs.PackageBaseName }}.iemod
asset_name: ${{ steps.CreateIEModZipPackage.outputs.PackageBaseName }}.iemod
tag: ${{ github.ref }}
overwrite: true
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
__macosx
backup/
$RECYCLE.BIN/
temp/
tmp/

*.bak
*.tmp
*.bak
*.lnk
Thumbs.db
ehthumbs.db

*.7z
*.rar
*.zip
*.tar.gz

.DS_Store
.AppleDouble
.LSOverride
.AppleDB
.AppleDesktop
.apdisk
20 changes: 20 additions & 0 deletions cd_appraiser/appraise.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
BEGIN ~cdapprai~

IF ~~ THEN BEGIN 0 SAY @102 // Is there another item you need appraised?
IF ~~ THEN REPLY @103 GOTO 2 // Yes, I have another item.
IF ~~ THEN REPLY @104 GOTO 3 // No, that will be all for now.
END

IF ~~ THEN BEGIN 1 SAY @111 // This item is special, and you may not be able to sell it.
IF ~~ THEN GOTO 0
END

IF ~True()~ THEN BEGIN 2 SAY @100 // What type of item do you need appraised?
// category names will be EXTEND_TOPped into this pace
IF ~~ THEN REPLY @101 GOTO 3 // Nothing at the moment.
END

IF ~~ THEN BEGIN 3 SAY @105 // Farewell.
IF ~~ THEN DO ~DestroySelf()~ EXIT
END

39 changes: 39 additions & 0 deletions cd_appraiser/cd_appraiser.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Never copy this from other mod, always use https://github.com/ALIENQuake/ProjectInfinity/wiki/Adding-metadata-for-mod
# Filename must be the same as tp2 basename, placed at the same folder where
# .tp2 file is located, use UTF8 (without BOM) encoding, everything is optional

# ini section header is required to avoid false detection
[Metadata]

# Full name of the mod, without the version number, without the list of supported games
Name = Bardic Appraisal

# Author name or nick, don't use an email address
Author = CamDawg

# Short description of the mod, main goals, features etc
Description = The Lore From Learning mod is a small WeiDU mod that adds lore bonuses to your main character as you learn and adventure throughout the game. The bonuses (and the stimuli that provide them) are, by design, meant to be minor and enhance the role-playing aspect of the game.

# Web address of mod readme file (filename is case-sensitive!) You can link to txt, md, html, pdf etc.
Readme = https://gibberlings3.github.io/Documentation/readmes/readme-cd_appraisal.html

# Web address of mod dedicated forum or forum thread
Forum = https://www.gibberlings3.net/forums/forum/28-miscellaneous-released-mods/

# Web address of mod personal Homepage, no need to duplicate with a mod dedicated forum
# Homepage = https://www.gibberlings3.net/mods/tweaks/lore

# if you use GitHub.com, simply use https://github.com/AccountOrOrgName/RepositoryName
# read more about Delta Updates https://github.com/ALIENQuake/ProjectInfinity/wiki/Delta-Updates-for-mods-hosted-at-Github
Download = https://github.com/Gibberlings3/Bardic_Appraisal

# Type of LABELs used by the mod, read more here https://www.gibberlings3.net/forums/topic/32516-tutorial-what-is-label
LabelType = GloballyUnique

# Dynamic Install Order, use mod ID as tp2 name without file extension and `setup-` prefix

# This mod must be installed *before* the mods listed after the keyword
# Before = EET_end

# This mod must be installed *after* the mods listed after the keyword
# After = EET
186 changes: 186 additions & 0 deletions cd_appraiser/cd_appraiser.tp2
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
BACKUP ~cd_appraiser/backup~ // location to store files for
SUPPORT ~http://gibberlings3.net/forums/index.php?showforum=34~ // URL displayed if install fails
AUTO_EVAL_STRINGS

ALWAYS

ACTION_IF ((FILE_EXISTS ~dlc/sod-dlc.zip~) OR (FILE_EXISTS ~sod-dlc.zip~)) THEN BEGIN FAIL @1001 END // DLC Merge check

// convert strings to UTF-8 for BGEE/BG2EE
ACTION_DEFINE_ARRAY cdreload BEGIN game_strings END
ACTION_DEFINE_ARRAY cdnoconvert BEGIN weidu game_strings_ee END // List of tra files that contain ONLY strings for the WeiDU installer and NOT game content
LAF HANDLE_CHARSETS INT_VAR infer_charsets = 1 STR_VAR tra_path = ~cd_appraiser/lang~ noconvert_array = cdnoconvert reload_array = cdreload END

END

VERSION ~v1~

README ~cd_appraiser/lang/%LANGUAGE%/readme-cd_appraiser.html~ ~cd_appraiser/readme-cd_appraiser.html~

LANGUAGE
~English~
~en_us~
~cd_appraiser/lang/en_us/game_strings.tra~
~cd_appraiser/lang/en_us/weidu.tra~

/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
///// \\\\\
///// Stuff n' junk \\\\\
///// \\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\

BEGIN @1000
REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~kitlist.2da~ @1002
LABEL ~cd_bardic_appraisal~

MKDIR ~cd_appraiser/working~

ACTION_IF GAME_IS ~bgee bg2ee eet iwdee~ BEGIN
LOAD_TRA ~cd_appraiser/lang/%LANGUAGE%/game_strings_ee.tra~
END

OUTER_SET default_bard = 9562
OUTER_SET valid_range = 78 // don't bother with item types > 77 until I see otherwise

ACTION_IF GAME_IS iwdee BEGIN
OUTER_SET default_bard = 37236
END

OUTER_FOR (type = 0 ; type < valid_range ; ++type) BEGIN

COPY ~cd_appraiser/item_type_array.tpa~ ~cd_appraiser/working/item_type_array.tpa~ EVALUATE_BUFFER
REINCLUDE ~cd_appraiser/working/item_type_array.tpa~
OUTER_SPRINT $cd_valid_types("%type%") "%string%"

END

ACTION_FOR_EACH invalid IN 28 33 BEGIN // exclude gold pieces amd h2h weapons
OUTER_SET $cd_valid_types("%invalid%") = 0
END

COPY ~cd_appraiser/cdapprai.bam~ ~override~
~cd_appraiser/cdapprai.eff~ ~override~
COPY ~cd_appraiser/cdapprai.cre~ ~override~
SAY 0x08 @112
SAY 0x0c @112

COPY ~cd_appraiser/cdapprai.spl~ ~override~
SAY 0x08 @112
SAY 0x0c @112
SAY 0x50 @113
SAY 0x54 @113

COMPILE ~cd_appraiser/cdapprai.baf~

ACTION_CLEAR_ARRAY cd_bard_clabs
ACTION_DEFINE_ASSOCIATIVE_ARRAY cd_bard_clabs BEGIN // start with base class tables
clabba01 => "%default_bard%" // generic bard abilities
END

// add kit tables dynamically by reading kitlist
COPY_EXISTING ~kitlist.2da~ ~override~
COUNT_2DA_ROWS 9 rows
FOR (index = 2 ; index < rows ; ++index) BEGIN // skip reserve row
READ_2DA_ENTRY index 8 9 class
PATCH_IF class = 5 BEGIN
READ_2DA_ENTRY index 4 9 desc
READ_2DA_ENTRY index 5 9 clab
DEFINE_ASSOCIATIVE_ARRAY cd_bard_clabs BEGIN "%clab%" => "%desc%" END
END
END
BUT_ONLY

ACTION_PHP_EACH cd_bard_clabs AS clab => desc_strref BEGIN

ACTION_IF FILE_EXISTS_IN_GAME ~%clab%.2da~ BEGIN

APPEND ~%clab%.2da~ ~ABILITYX GA_CDAPPRAI CDREPLACE~ UNLESS ~GA_SPCL922~

COPY_EXISTING ~%clab%.2da~ ~override~
COUNT_2DA_COLS cols
FOR (index = 3 ; index < cols ; ++index) BEGIN
REPLACE_TEXTUALLY ~CDREPLACE~ ~**** CDREPLACE~
END
REPLACE_TEXTUALLY ~CDREPLACE~ ~****~
PRETTY_PRINT_2DA
BUT_ONLY

ACTION_GET_STRREF desc_strref desc
OUTER_PATCH_SAVE desc "%desc%" BEGIN
PATCH_IF desc_strref = default_bard BEGIN
SPRINT old @115 // main bard descript doesn't have 'disadvantages' line
SPRINT break ~~
END ELSE BEGIN
SPRINT old @116
SPRINT break ~
~
END
SPRINT new @117
REPLACE_TEXTUALLY ~%new%~ ~~ // purge in case the text is already there
REPLACE_TEXTUALLY ~[%LNL%%MNL%%WNL%]*\([%LNL%%MNL%%WNL%]\)\(%old%\)~ ~\1%new%%break%\2~ // swap text
END
STRING_SET_EVALUATE desc_strref "%desc%"

END

END

COMPILE ~cd_appraiser/appraise.d~

COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~
READ_LONG 0x18 flags ELSE 0
PATCH_IF ((flags & BIT2) = BIT2) BEGIN // if droppable
READ_SHORT 0x1c item_type
PATCH_IF ((item_type >= 0) AND (item_type < valid_range) AND ($cd_valid_types("%item_type%") != 0))BEGIN
SET type_name = $cd_valid_types("%item_type%")
READ_LONG 0x0c string
PATCH_IF NOT (string >= 0 && string < 9999999) BEGIN READ_LONG 0x08 string END // try unidentified name if identified name invalid
PATCH_IF (string >= 0 && string < 9999999) BEGIN // skip entirely if unidentified is also an invlaid string
SET critical_item = 0
READ_LONG 0x34 price
READ_LONG 0x0c string
PATCH_IF NOT (string >= 0 && string < 9999999) BEGIN READ_LONG 0x08 string END // use unidentified name if identified name invalid
PATCH_IF ((flags & BIT0) = BIT0) BEGIN SET critical_item = 1 END
DEFINE_ASSOCIATIVE_ARRAY ~cd_%item_type%_array~ BEGIN "%string%","%critical_item%","%SOURCE_RES%" => "%price%" END
PATCH_IF !FILE_EXISTS ~cd_appraiser/working/template_%item_type%.d~ BEGIN
INNER_ACTION BEGIN
COPY ~cd_appraiser/template.d~ ~cd_appraiser/working/template_%item_type%.d~
EVALUATE_BUFFER // should set item_type
END
END
END
END
END
BUT_ONLY

OUTER_FOR (index = valid_range ; index >= 0 ; --index) BEGIN

ACTION_IF FILE_EXISTS ~cd_appraiser/working/template_%index%.d~ BEGIN
COPY ~cd_appraiser/working/template_%index%.d~ ~cd_appraiser/working/template_%index%.d~
PHP_EACH ~cd_%index%_array~ AS params => price BEGIN
PATCH_IF price BEGIN
SPRINT appraised @109
INNER_PATCH_SAVE appraised ~%appraised%~ BEGIN
REPLACE_TEXTUALLY EXACT_MATCH ~PRICE~ ~%price%~
END
END ELSE BEGIN
SPRINT appraised @110
END
REPLACE_EVALUATE ~OR(\([0-9]+\))~ BEGIN
SET or_count = (%MATCH1% + 1)
END ~OR(%or_count%) PartyHasItemIdentified("%params_2%")~
REPLACE_TEXTUALLY ~\(//cd_insert_reply_here\)~ ~~~~~ IF ~PartyHasItemIdentified("%params_2%")~ THEN REPLY #%params_0% DO ~SetGlobal("cd_appraisal","LOCALS",%index%)~ GOTO cd_%params_2%
\1~~~~~
REPLACE_TEXTUALLY ~\(//cd_insert_state_here\)~ ~~~~~ IF ~~ BEGIN cd_%params_2% SAY ~%appraised%~
IF ~~ THEN GOTO %params_1%
END
\1~~~~~
END

COMPILE ~cd_appraiser/working/template_%index%.d~

END

END
17 changes: 17 additions & 0 deletions cd_appraiser/cdapprai.baf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
IF
NumTimesTalkedTo(0)
THEN
RESPONSE #100
SetGlobalTimer("summoned","LOCALS",6)
StartDialogNoSet(LastSummonerOf(Myself))
END

IF
OR(2)
!NumTimesTalkedTo(0)
GlobalTimerExpired("summoned","LOCALS")
THEN
RESPONSE #100
DestroySelf()
END

Binary file added cd_appraiser/cdapprai.bam
Binary file not shown.
Binary file added cd_appraiser/cdapprai.cre
Binary file not shown.
Binary file added cd_appraiser/cdapprai.eff
Binary file not shown.
Binary file added cd_appraiser/cdapprai.spl
Binary file not shown.
6 changes: 6 additions & 0 deletions cd_appraiser/desktop.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[.ShellClassInfo]
IconResource=style\g3.ico,0
[ViewState]
Mode=
Vid=
FolderType=Generic
1 change: 1 addition & 0 deletions cd_appraiser/item_type_array.tpa
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
OUTER_SET string = RESOLVE_STR_REF ( @%type% )
Loading

0 comments on commit db0eecc

Please sign in to comment.