diff --git a/Data-1.13/Scripts/StrategicTownLoyalty.lua b/Data-1.13/Scripts/StrategicTownLoyalty.lua index 988ac11ae..ca1745415 100644 --- a/Data-1.13/Scripts/StrategicTownLoyalty.lua +++ b/Data-1.13/Scripts/StrategicTownLoyalty.lua @@ -20,7 +20,9 @@ - SectorEnemyControlled ( IDSector ) check if enemy controls sector - - SECTOR( SectorX, SectorY ) + - CALCULATE_STRATEGIC_INDEX( SectorX, SectorY ) + + - SECTOR ( SectorX, SectorY ) - CheckMercIsDead (ProfilID) check merc is dead @@ -46,12 +48,8 @@ ************** ** Examples ** ************** - - if SectorEnemyControlled ( SECTOR(13,4) ) == false then - -- instructions - end - - if SectorEnemyControlled ( SECTOR(13,4) ) == false then + + if ( SectorEnemyControlled ( CALCULATE_STRATEGIC_INDEX(13,4) ) ) == false then -- instructions else -- instructions @@ -121,6 +119,26 @@ Town = CHITZENA = 12, } +SectorY = +{ + MAP_ROW_A = 1, + MAP_ROW_B = 2, + MAP_ROW_C = 3, + MAP_ROW_D = 4, + MAP_ROW_E = 5, + MAP_ROW_F = 6, + MAP_ROW_G = 7, + MAP_ROW_H = 8, + MAP_ROW_I = 9, + MAP_ROW_J = 10, + MAP_ROW_K = 11, + MAP_ROW_L = 12, + MAP_ROW_M = 13, + MAP_ROW_N = 14, + MAP_ROW_O = 15, + MAP_ROW_P = 16, +} + -- gain pts per real loyalty pt local GAIN_PTS_PER_LOYALTY_PT = 500 @@ -168,7 +186,7 @@ EventGlobal = } -function CheckConditionsForTriggeringCreatureQuest( sSectorX, sSectorY, bSectorZ ) +local function CheckConditionsForTriggeringCreatureQuest( sSectorX, sSectorY, bSectorZ ) local ubValidMines = 0 @@ -176,6 +194,7 @@ function CheckConditionsForTriggeringCreatureQuest( sSectorX, sSectorY, bSectorZ return -- No scifi, no creatures... end + -- giLairID from Luaglobal.cpp -- if ( giLairID ) -> that does not work in LUA, because that is always TRUE!! if ( giLairID ~= 0 ) then return -- Creature quest already begun @@ -184,22 +203,22 @@ function CheckConditionsForTriggeringCreatureQuest( sSectorX, sSectorY, bSectorZ -- Count the number of "infectible mines" the player occupies -- SEC_D13 - if SectorEnemyControlled ( SECTOR(13,4) ) == false then + if ( SectorEnemyControlled ( CALCULATE_STRATEGIC_INDEX(13, SectorY.MAP_ROW_D) ) == false ) then ubValidMines = ubValidMines + 1 end -- SEC_H8 - if SectorEnemyControlled ( SECTOR(8,8) ) == false then + if ( SectorEnemyControlled ( CALCULATE_STRATEGIC_INDEX(8, SectorY.MAP_ROW_H) ) == false ) then ubValidMines = ubValidMines + 1 end -- SEC_I14 - if SectorEnemyControlled ( SECTOR(14,9) ) == false then + if ( SectorEnemyControlled ( CALCULATE_STRATEGIC_INDEX(14, SectorY.MAP_ROW_I) ) == false ) then ubValidMines = ubValidMines + 1 end -- SEC_H3 - if SectorEnemyControlled ( SECTOR(3,8) ) == false then + if ( SectorEnemyControlled ( CALCULATE_STRATEGIC_INDEX(3, SectorY.MAP_ROW_H) ) == false ) then ubValidMines = ubValidMines + 1 end diff --git a/Data-UB/Scripts/StrategicTownLoyalty.lua b/Data-UB/Scripts/StrategicTownLoyalty.lua index 3c7109341..7eb264d6a 100644 --- a/Data-UB/Scripts/StrategicTownLoyalty.lua +++ b/Data-UB/Scripts/StrategicTownLoyalty.lua @@ -20,7 +20,9 @@ - SectorEnemyControlled ( IDSector ) check if enemy controls sector - - SECTOR( SectorX, SectorY ) + - CALCULATE_STRATEGIC_INDEX( SectorX, SectorY ) + + - SECTOR ( SectorX, SectorY ) - CheckMercIsDead (ProfilID) check merc is dead @@ -47,39 +49,35 @@ ** Examples ** ************** - if SectorEnemyControlled ( SECTOR(13,4) ) == false then - -- instructions - end + if ( SectorEnemyControlled ( CALCULATE_STRATEGIC_INDEX (13,4) ) == false ) then + -- instructions + else + -- instructions + end - if SectorEnemyControlled ( SECTOR(13,4) ) == false then - -- instructions - else - -- instructions - end - - if ( CheckMercIsDead (101) == true ) then - -- merc is dead - else - -- instructions - end - - -- 1 * 500 = 500 = 4% - DecrementTownLoyaltyEverywhere ( 1 ) - - -- 10 * 500 = 5000 = 45% - IncrementTownLoyalty (10) - - -- 20 * 500 = 10000 = 90% - DecrementTownLoyalty ( 2 , 20 ) - - -- 30 * 500 = 15000 = 100% - IncrementTownLoyaltyEverywhere (30) + if ( CheckMercIsDead (101) == true ) then + -- merc is dead + else + -- instructions + end - -- 100 = 100% - SetTownLoyalty ( 1, 100 ) - - -- 30 = 30% - SetTownLoyalty ( 1, 30 ) + -- 1 * 500 = 500 = 4% + DecrementTownLoyaltyEverywhere ( 1 ) + + -- 10 * 500 = 5000 = 45% + IncrementTownLoyalty (10) + + -- 20 * 500 = 10000 = 90% + DecrementTownLoyalty ( 2 , 20 ) + + -- 30 * 500 = 15000 = 100% + IncrementTownLoyaltyEverywhere (30) + + -- 100 = 100% + SetTownLoyalty ( 1, 100 ) + + -- 30 = 30% + SetTownLoyalty ( 1, 30 ) EventGlobal = { @@ -121,6 +119,26 @@ Town = CHITZENA = 12, } +SectorY = +{ + MAP_ROW_A = 1, + MAP_ROW_B = 2, + MAP_ROW_C = 3, + MAP_ROW_D = 4, + MAP_ROW_E = 5, + MAP_ROW_F = 6, + MAP_ROW_G = 7, + MAP_ROW_H = 8, + MAP_ROW_I = 9, + MAP_ROW_J = 10, + MAP_ROW_K = 11, + MAP_ROW_L = 12, + MAP_ROW_M = 13, + MAP_ROW_N = 14, + MAP_ROW_O = 15, + MAP_ROW_P = 16, +} + -- gain pts per real loyalty pt local GAIN_PTS_PER_LOYALTY_PT = 500 @@ -168,7 +186,7 @@ EventGlobal = } -function CheckConditionsForTriggeringCreatureQuest( sSectorX, sSectorY, bSectorZ ) +local function CheckConditionsForTriggeringCreatureQuest( sSectorX, sSectorY, bSectorZ ) local ubValidMines = 0 @@ -176,6 +194,7 @@ function CheckConditionsForTriggeringCreatureQuest( sSectorX, sSectorY, bSectorZ return -- No scifi, no creatures... end + -- giLairID from Luaglobal.cpp -- if ( giLairID ) -> that does not work in LUA, because that is always TRUE!! if ( giLairID ~= 0 ) then return -- Creature quest already begun @@ -184,22 +203,22 @@ function CheckConditionsForTriggeringCreatureQuest( sSectorX, sSectorY, bSectorZ -- Count the number of "infectible mines" the player occupies -- SEC_D13 - if SectorEnemyControlled ( SECTOR(13,4) ) == false then + if ( SectorEnemyControlled ( CALCULATE_STRATEGIC_INDEX(13, SectorY.MAP_ROW_D) ) == false ) then ubValidMines = ubValidMines + 1 end -- SEC_H8 - if SectorEnemyControlled ( SECTOR(8,8) ) == false then + if ( SectorEnemyControlled ( CALCULATE_STRATEGIC_INDEX(8, SectorY.MAP_ROW_H) ) == false ) then ubValidMines = ubValidMines + 1 end -- SEC_I14 - if SectorEnemyControlled ( SECTOR(14,9) ) == false then + if ( SectorEnemyControlled ( CALCULATE_STRATEGIC_INDEX(14, SectorY.MAP_ROW_I) ) == false ) then ubValidMines = ubValidMines + 1 end -- SEC_H3 - if SectorEnemyControlled ( SECTOR(3,8) ) == false then + if ( SectorEnemyControlled ( CALCULATE_STRATEGIC_INDEX(3, SectorY.MAP_ROW_H) ) == false ) then ubValidMines = ubValidMines + 1 end diff --git a/Data/Scripts/StrategicTownLoyalty.lua b/Data/Scripts/StrategicTownLoyalty.lua index fd00029ac..12f0df929 100644 --- a/Data/Scripts/StrategicTownLoyalty.lua +++ b/Data/Scripts/StrategicTownLoyalty.lua @@ -20,7 +20,9 @@ - SectorEnemyControlled ( IDSector ) check if enemy controls sector - - SECTOR( SectorX, SectorY ) + - CALCULATE_STRATEGIC_INDEX( SectorX, SectorY ) + + - SECTOR ( SectorX, SectorY ) - CheckMercIsDead (ProfilID) check merc is dead @@ -47,11 +49,7 @@ ** Examples ** ************** - if SectorEnemyControlled ( SECTOR(13,4) ) == false then - -- instructions - end - - if SectorEnemyControlled ( SECTOR(13,4) ) == false then + if ( SectorEnemyControlled ( CALCULATE_STRATEGIC_INDEX (13,4) ) == false ) then -- instructions else -- instructions @@ -121,6 +119,26 @@ Town = CHITZENA = 12, } +SectorY = +{ + MAP_ROW_A = 1, + MAP_ROW_B = 2, + MAP_ROW_C = 3, + MAP_ROW_D = 4, + MAP_ROW_E = 5, + MAP_ROW_F = 6, + MAP_ROW_G = 7, + MAP_ROW_H = 8, + MAP_ROW_I = 9, + MAP_ROW_J = 10, + MAP_ROW_K = 11, + MAP_ROW_L = 12, + MAP_ROW_M = 13, + MAP_ROW_N = 14, + MAP_ROW_O = 15, + MAP_ROW_P = 16, +} + -- gain pts per real loyalty pt local GAIN_PTS_PER_LOYALTY_PT = 500 @@ -167,7 +185,7 @@ EventGlobal = } -function CheckConditionsForTriggeringCreatureQuest( sSectorX, sSectorY, bSectorZ ) +local function CheckConditionsForTriggeringCreatureQuest( sSectorX, sSectorY, bSectorZ ) local ubValidMines = 0 @@ -175,6 +193,7 @@ function CheckConditionsForTriggeringCreatureQuest( sSectorX, sSectorY, bSectorZ return -- No scifi, no creatures... end + -- giLairID from Luaglobal.cpp -- if ( giLairID ) -> that does not work in LUA, because that is always TRUE!! if ( giLairID ~= 0 ) then return -- Creature quest already begun @@ -183,22 +202,22 @@ function CheckConditionsForTriggeringCreatureQuest( sSectorX, sSectorY, bSectorZ -- Count the number of "infectible mines" the player occupies -- SEC_D13 - if SectorEnemyControlled ( SECTOR(13,4) ) == false then + if ( SectorEnemyControlled ( CALCULATE_STRATEGIC_INDEX(13, SectorY.MAP_ROW_D) ) == false ) then ubValidMines = ubValidMines + 1 end -- SEC_H8 - if SectorEnemyControlled ( SECTOR(8,8) ) == false then + if ( SectorEnemyControlled ( CALCULATE_STRATEGIC_INDEX(8, SectorY.MAP_ROW_H) ) == false ) then ubValidMines = ubValidMines + 1 end -- SEC_I14 - if SectorEnemyControlled ( SECTOR(14,9) ) == false then + if ( SectorEnemyControlled ( CALCULATE_STRATEGIC_INDEX(14, SectorY.MAP_ROW_I) ) == false ) then ubValidMines = ubValidMines + 1 end -- SEC_H3 - if SectorEnemyControlled ( SECTOR(3,8) ) == false then + if ( SectorEnemyControlled ( CALCULATE_STRATEGIC_INDEX(3, SectorY.MAP_ROW_H) ) == false ) then ubValidMines = ubValidMines + 1 end