Skip to content

Commit

Permalink
optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
hybridcompiler committed Jul 6, 2019
1 parent a660241 commit fef83bd
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 71 deletions.
61 changes: 26 additions & 35 deletions EECustom/Setup-EECustom.tp2
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,15 @@

BACKUP ~EECustom/backup~
AUTHOR ~HybridGame~
VERSION "2019.06.26"
VERSION "2019.07.06"

LANGUAGE ~All~
~All~
~EECustom/Language/setup.tra~

///////////////////////////////////////////////////////////////////////////////////////////////////
// BG1EE

// ------------------------------------------------------------------------------------------------
// Tutorial items and bag of holding in Candlekeep

BEGIN @101
REQUIRE_PREDICATE GAME_IS ~bgee~ @1

EXTEND_BOTTOM ~AR2600.BCS~ ~EECustom/script/bg1item.baf~
COPY ~EECustom/item/ttaxe1.itm~ ~override~
~EECustom/item/ttdagg1.itm~ ~override~

///////////////////////////////////////////////////////////////////////////////////////////////////
// BG2EE

// ------------------------------------------------------------------------------------------------
// Tutorial items and bag of holding in Irenicus dungeon

BEGIN @201
REQUIRE_PREDICATE GAME_IS ~bg2ee~ @2

EXTEND_BOTTOM ~AR0602.BCS~ ~EECustom/script/bg2item.baf~
COPY ~EECustom/item/ttaxe1.itm~ ~override~
~EECustom/item/ttdagg1.itm~ ~override~

// ------------------------------------------------------------------------------------------------
// Triple-class HLA tables

Expand All @@ -47,6 +24,16 @@ COPY ~EECustom/2da/lufmc.2da~ ~override~
///////////////////////////////////////////////////////////////////////////////////////////////////
// BGEE

// ------------------------------------------------------------------------------------------------
// Tutorial items and containters
BEGIN @300
REQUIRE_PREDICATE GAME_IS ~bgee bg2ee~ @3

ACTION_IF GAME_IS ~bgee~
BEGIN EXTEND_BOTTOM ~AR2600.BCS~ ~EECustom/script/bg1item.baf~ END
ELSE
BEGIN EXTEND_BOTTOM ~AR0602.BCS~ ~EECustom/script/bg2item.baf~ END

// ------------------------------------------------------------------------------------------------
// Free action fix
BEGIN @306
Expand All @@ -68,17 +55,22 @@ BEGIN
ACTION_IF FILE_EXISTS_IN_GAME ~%file%~ THEN
BEGIN
COPY_EXISTING ~%file%~ ~override~ // Potion of Freedom
LPF DELETE_EFFECT INT_VAR match_opcode = 206 STR_VAR match_resource = spwi613 END // Improved Haste
LPF DELETE_EFFECT INT_VAR match_opcode = 206 STR_VAR match_resource = spwi305 END // Haste
LPF DELETE_EFFECT INT_VAR match_opcode = 206 STR_VAR match_resource = spra301 END // Haste
LPF DELETE_EFFECT INT_VAR match_opcode = 206 STR_VAR match_resource = spin572 END // Haste
LPF DELETE_EFFECT INT_VAR match_opcode = 169 match_parameter2 = 110 END // Improved Haste
LPF DELETE_EFFECT INT_VAR match_opcode = 169 match_parameter2 = 38 END // Haste
LPF DELETE_EFFECT INT_VAR match_opcode = 240 match_parameter2 = 110 END // Improved Haste
LPF DELETE_EFFECT INT_VAR match_opcode = 240 match_parameter2 = 38 END // Haste
LPF DELETE_EFFECT INT_VAR match_opcode = 267 match_parameter1 = 14023 END // Haste
PATCH_FOR_EACH spell IN spwi613 spwi305 spra301 spin572
BEGIN // Protection from Spell
LPF DELETE_EFFECT INT_VAR match_opcode = 206 STR_VAR match_resource = EVAL ~%spell%~ END
END
PATCH_FOR_EACH icon IN 38 110
BEGIN // Prevent Special Effect Icon, Remove Special Effect Icon
LPF DELETE_EFFECT INT_VAR match_opcode = 169 match_parameter2 = icon END
LPF DELETE_EFFECT INT_VAR match_opcode = 240 match_parameter2 = icon END
END
// Protection from Display Specific String (Hasted)
LPF DELETE_EFFECT INT_VAR match_opcode = 267 match_parameter1 = 14023 END
// Protection from Opcode
LPF DELETE_EFFECT INT_VAR match_opcode = 101 match_parameter2 = 16 END // Haste
LPF DELETE_EFFECT INT_VAR match_opcode = 101 match_parameter2 = 126 END // Movement Modifier
// Movement Modifier
LPF DELETE_EFFECT INT_VAR match_opcode = 126 match_parameter2 = 1 END // Movement Modifier
LPF DELETE_EFFECT INT_VAR match_opcode = 126 match_parameter2 = 2 END // Movement Modifier
BUT_ONLY_IF_IT_CHANGES
END
Expand Down Expand Up @@ -115,7 +107,7 @@ REQUIRE_PREDICATE GAME_IS ~bgee bg2ee~ @3

COPY_EXISTING ~intmod.2da~ ~override~
COUNT_2DA_ROWS ~3~ "rows"
FOR (index = 3; index < rows ; index = index + 1)
FOR (index = 3; index < rows ; ++index)
BEGIN
SET_2DA_ENTRY_LATER ~intmod~ index 1 ~150~
END
Expand Down Expand Up @@ -149,5 +141,4 @@ REQUIRE_PREDICATE GAME_IS ~bgee bg2ee~ @3

OUTER_SET stack = 999
INCLUDE ~EECustom/lib/increase_ammo.tpa~
INCLUDE ~EECustom/lib/increase_gem.tpa~
INCLUDE ~EECustom/lib/increase_potion.tpa~
Binary file removed EECustom/item/ttaxe1.itm
Binary file not shown.
Binary file removed EECustom/item/ttdagg1.itm
Binary file not shown.
7 changes: 2 additions & 5 deletions EECustom/language/Setup.tra
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
@1 = ~BG1EE required~
@2 = ~BG2EE required~
@3 = ~BG1EE or BG2EE required~

@101 = ~Tutorial items and bag of holding in Candlekeep~

@201 = ~Tutorial items and bag of holding in Irenicus dungeon~
@202 = ~Triple-class HLA tables~

@300 = ~Tutorial items and containters~
@301 = ~Remove XP cap (maximum level 40)~
@302 = ~Un-nerfed bard spell progression table (maximum level 8)~
@303 = ~Easy spell learning~
@304 = ~Happy patch~
@305 = ~Unlimited Stacking (ammo, gem, jewelry and potion)~
@305 = ~Unlimited Stacking (ammo and potion)~
@306 = ~Free action fix (item and spell)~
21 changes: 11 additions & 10 deletions EECustom/script/bg1item.baf
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
IF
Global("BG1MoveItem","AR2600",0)
Global("TUTORIALITEMCHECK","GLOBAL",1)
Global("CreateTutorialItem","MYAREA",0)
THEN
RESPONSE #100
SetGlobal("BG1MoveItem","AR2600",1)
ActionOverride("Container 1",CreateItem("TTSWORD1",1,1,1)) // 장검 +1
ActionOverride("Container 1",CreateItem("TTSWORD6",1,1,1)) // 양손검
ActionOverride("Container 1",CreateItem("TTSHLD01",1,1,1)) // 중형 방패 +1
ActionOverride("Container 1",CreateItem("TTSCRL01",1,1,1)) // 화염 화살
ActionOverride("Container 1",CreateItem("TTSCRL02",1,1,1)) // 몬스터 소환 I
ActionOverride("Container 1",CreateItem("TTDAGG1",1,1,1)) // 단검
ActionOverride("Container 1",CreateItem("TTAXE1",1,1,1)) // 전투 도끼
ActionOverride("Container 1",CreateItem("BAG31",1,1,1)) // 무한의 가방
SetGlobal("CreateTutorialItem","MYAREA",1)
ActionOverride(Player1,CreateItem("TTSCRL01",1,1,1))
ActionOverride(Player1,CreateItem("TTSCRL02",1,1,1))
ActionOverride(Player1,CreateItem("TTSHLD01",1,1,1))
ActionOverride(Player1,CreateItem("TTSWORD1",1,1,1))
ActionOverride(Player1,CreateItem("TTSWORD2",1,1,1))
ActionOverride(Player1,CreateItem("bag19",1,1,1))
ActionOverride(Player1,CreateItem("bag05",1,1,1))
ActionOverride(Player1,CreateItem("bag06",1,1,1))
END
22 changes: 11 additions & 11 deletions EECustom/script/bg2item.baf
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
IF
Global("BG2Item","AR0602",0)
Global("TakeImportItems","MYAREA",1)
Global("CreateTutorialItem","MYAREA",0)
THEN
RESPONSE #100
SetGlobal("BG2Item","AR0602",1)
ActionOverride("Jailkeep Table",CreateItem("TTSWORD1",1,1,1)) // 장검 +1
ActionOverride("Jailkeep Table",CreateItem("TTSHLD01",1,1,1)) // 중형 방패 +1
ActionOverride("Jailkeep Table",CreateItem("TTSCRL01",1,1,1)) // 화염 화살
ActionOverride("Jailkeep Table",CreateItem("TTSCRL02",1,1,1)) // 몬스터 소환 I
ActionOverride("Jailkeep Table",CreateItem("TTDAGG1",1,1,1)) // 단검
ActionOverride("Jailkeep Table",CreateItem("TTAXE1",1,1,1)) // 전투 도끼
ActionOverride("Jailkeep Table",CreateItem("bag04",1,1,1))
ActionOverride("Jailkeep Table",CreateItem("bag05",1,1,1))
ActionOverride("Jailkeep Table",CreateItem("bag06",1,1,1))
SetGlobal("CreateTutorialItem","MYAREA",1)
ActionOverride(Player1,CreateItem("TTSCRL01",1,1,1))
ActionOverride(Player1,CreateItem("TTSCRL02",1,1,1))
ActionOverride(Player1,CreateItem("TTSHLD01",1,1,1))
ActionOverride(Player1,CreateItem("TTSWORD1",1,1,1))
ActionOverride(Player1,CreateItem("TTSWORD2",1,1,1))
ActionOverride(Player1,CreateItem("bag04",1,1,1))
ActionOverride(Player1,CreateItem("bag05",1,1,1))
ActionOverride(Player1,CreateItem("bag06",1,1,1))
END
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,28 @@

## English

### BG1EE only
* Tutorial items and bag of holding in Candlekeep

### BG2EE only
* Tutorial items and bag of holding in Irenicus dungeon
* Triple-class HLA tables

### BGEE
* Tutorial items and containers
* Free action fix (item and spell)
* Remove XP cap (maximum level 40)
* Un-nerfed bard spell progression table (maximum level 8)
* Easy spell learning
* Happy patch
* Unlimited Stacking (ammo, gem, jewelry and potion)
* Unlimited Stacking (ammo and potion)

## 한국어

### BG1EE only
* 캔들킵에서 무한의 가방과 튜토리얼 아이템 제공

### BG2EE only
* 이레니쿠스 던전에서 무한의 가방과 튜토리얼 아이템 제공
* 파/메/시, 파/메/클 하이레벨 어빌리티 지원

### BGEE
* 가방들과 튜토리얼 아이템 제공
* 프리 액션 수정 (아이템과 스펠)
* 경험치 제한 해제 (최대 40 레벨)
* 바드 마법 8레벨까지 성장
* 100% 마법 이해
* 명성치에 따른 파티원 탈퇴 방지
* 무제한 겹치기 (목걸이, 보석, 포션, 탄환)
* 무제한 겹치기 (탄환, 포션)

0 comments on commit fef83bd

Please sign in to comment.