          
======================================
* Methods used in <expression> block *
======================================
METHOD:
Commander.GetLevel (int CommanderID)

DESCRIPTION:
Returns level of commander with given ID

===========================================================================
METHOD:
Country.GetAlliance (int CountryID)

DESCRIPTION:
Returns Alliance of country with given ID. Possible returned values are:
0 - neutral country, 
1 - member of Allies, 
2 - member of Axis, 
3 - member of Comintern, 
4 - leader of Allies, 
5 - leader of Axis, 
6 - leader of Comintern

===========================================================================

METHOD:
Country.GetAllianceEntry (int CountryID)

DESCRIPTION:
Returns Alliance Entry of given country

===========================================================================

METHOD:
Country.GetDiplomaticPoints (int CountryID)

DESCRIPTION:
Returns Diplomatic Points of given country

===========================================================================


METHOD:
Country.GetPoliticalStrength (int CountryID)

DESCRIPTION:
Returns Political Strength of given country

===========================================================================

METHOD:
Country.GetProductionPoints (int CountryID)

DESCRIPTION:
Returns Production Points of given country

===========================================================================

METHOD:
Country.GetSocialUnrest (int CountryID)

DESCRIPTION:
Returns Social Unrest of given country

===========================================================================


METHOD:
Country.GetStrategicMovementPoints (int CountryID)

DESCRIPTION:
Returns SMP of given country.

===========================================================================

METHOD:
Country.GetWarEconomy (int CountryID)

DESCRIPTION:
Returns War Economy level of given country (0 to 100)

===========================================================================

METHOD:
Country.HasWarWithCountry (int Country1ID, int Country2ID)

DESCRIPTION:
Returns 1 if there is a war between two given countries, and 0 if there is peace.

===========================================================================

METHOD:
Country.IsActive (int CountryID)

DESCRIPTION:
Returns if given country is active (countries that surrendered become inactive)

===========================================================================

METHOD:
Country.IsAIControlled (int CountryID)

DESCRIPTION:
Returns 1 if given country is controlled by AI, 0 if it is controlled by human.

===========================================================================

METHOD:
Country.IsAtWar (int CountryID)

DESCRIPTION:
Returns 1 if given country is at war with any other country. Otherwise 0 is returned.

===========================================================================

METHOD:
Flag.GetValue (int FlagID)

DESCRIPTION:
Returns the value of given flag. There are 10000 flags available to use. Values of the flags are of integer type.
For new events added to scenario it is recommended to use flags with IDs greater than 5000.

===========================================================================

METHOD:
Hex.ControlledByAliance (int X, int Y, int allianceID)

DESCRIPTION:
Returns 1 if hex at coordinates (X,Y) is controlled by given alliance. 
Allowable allianceID values: 1=allied, 2=axis, 3=comintern

===========================================================================

METHOD:
System.GetRandomNumber (int minRange, int maxRange)

DESCRIPTION:
Returns a random number from given range. MaxRange should not exceed 2^16

===========================================================================


METHOD:
Hex.Occupied (int hexX, int hexY)

DESCRIPTION:
Returns 1 if hex with given coordinates is occupied by a unit (land or air), otherwise returns 0.

===========================================================================

METHOD:
Hex.OccupiedAndControlledByAlliance (int hexX, int hexY, int allianceID)

DESCRIPTION:
Returns 1 if hex with given coordinates is both controlled by given alliance and occupied by a unit (land or air).
Otherwise 0 is returned.
Allowable allianceID values: 1=allied, 2=axis, 3=comintern

===========================================================================



Add:

HexStripe.ChangeControllerAndOwner
Unit.Teleport
Unit.Unfreeze
          
          
          
          
          
          
          
--------------------------          
--------------------------
==========================
*Methods used in <effect>*
==========================
--------------------------







METHOD:
AI.AddCountryToPress (int countryID, int IdOfCountryToAdd)

DESCRIPTION:
Adds information about country to exert pressure on for AI of given country. 

EXAMPLE:
AI.AddCountryToPress (2, 26) means that AI of Germany (ID=2) should try to exert pressure on Romania (ID=26)

===========================================================================

METHOD:
AI.AddInvasionTarget (int countryID, int cityX, int cityY, int invasionStregth)

DESCRIPTION:
Adds new _land_ invasion target for AI of given country. Invasion target must be a city, hence parameters are
coordinates (cityX,cityY). City owner should be neutral and the city itself should be a border city. 
Last parameter tells AI how much strength to concentrate for invasion. Setting this to -1 means 'concentrate
as much strength as possible'. AI of given country can have multiple invasion targets.

EXAMPLE:
AI.AddCountryToPress (2, 134, 110, -1) means that AI of Germany (ID=2) should concentrate in order to
invade Yugoslavia (because hex (134,110) is Yugoslavian city of Lublana). Last parameter tells that there
is no limit of strength to concentrate on border near Lublana. 

===========================================================================

METHOD:
AI.RemoveDoNotAttackCity (int CountryID, int cityX, int xityY)

DESCRIPTION
Removes city at given coordinates from the list of cities that given country's AI would not attack. 
If there is no city at given coordinates or the city is not on the do-not-attack list for AI, 
nothing happens. List of cities that AI should not attack is defined in ai_data.csv file.

===========================================================================

METHOD:
AI.SetDesiredStrategicMovementPoints (int CountryID, int desiredSMP)

DESCRIPTION:
Sets desired SMP level for AI of given country. AI wont purchase any new units until it purchases SMP up to the
desired level.

===========================================================================

METHOD:
AI.SetDesiredTechLevel (int countryID, int techID, int desiredLevel)

DESCRIPTION:
Sets desired level of given technology for AI of given country. Only when desired tech level is greater than
current level AI will spend PP on respective research field, so this method is very important, in fact, using 
it is the only way to make the AI do any research! Current levels of technology can be checked in countries.csv
while desired levels of techs are in ai_data.csv.

techID parameters:
0: artillery
1: tanks
2: not used anymore...
3: combat aircrafts
4: submarines
5: naval units
6: nuclear weapons

Using techID out of 0 to 6 range is not handled and will result in game crash when firing event.

===========================================================================

METHOD:
AI.SetMakesSeaInvasionsParameter (int CountryID, int Value)

DESCRIPTION
Sets MakesSeaInvasion parameter for AI of given country. Value set to 0 means that country will not plan 
and execute sea invasions. Any other value means that it will.

===========================================================================

METHOD:
City.SetProductionPoints (int cityX, cityY, float PPValue)

DESCRIPTION:
Sets Production Points in city at given coordinates. If no city exists at given coords, nothing happens. Do not
set Production Points to negative value.


===========================================================================

METHOD:
City.ChangeProductionPoints (int cityX, cityY, float change)

DESCRIPTION:
Changes Production Points in city at given coordinates by given value. If no city exists at given coords
nothing happens. Be careful while decreasing Production Points: it is advised that PP in a city should be >=0.

===========================================================================

METHOD:
Country.ChangeAllianceEntry (int countryID, int change)

DESCRIPTION:
Changes Alliance Entry of given Country by given value. If Alliance entry exceeds 100 country joins alliance
automatically (no further operations needed)

===========================================================================

METHOD:
Country.ChangeDiplomaticPoints (int countryID, int change)

DESCRIPTION:
Changes DP of given Country by given value. 

===========================================================================

METHOD:
Country.ChangeOwnershipOfAllNavalUnits (int countryID, int newOwnerCountryID)

DESCRIPTION
Changes ownership of all fleets & naval units of given country to a new owner. 
This includes transports and amphibias!

===========================================================================

METHOD:
Country.ChangeProductionPoints (int countryID, int change)

DESCRIPTION:
Changes PP of given Country by given value. 

===========================================================================

METHOD:
Country.ChangeProductionPoints (int countryID, int change)

DESCRIPTION:
Changes Political Strength of given Country by given value. 

===========================================================================

METHOD:
Country.ChangeSocialUnrest (int countryID, int change)

DESCRIPTION:
Changes Social Unrest of given Country by given value. 

===========================================================================

METHOD:
Country.ChangeWarEconomy (int countryID, int change)

DESCRIPTION:
Changes War Economy of given Country by given value. 

===========================================================================

METHOD:
Country.DeclareWarOnCountry (int countryID, int targetCountryID)

DESCRIPTION:
Country with given ID declares war on target country. All game rules needed to declare such war must be met
otherwise event will do nothing. There is one exception however: declaring war by this method does not
require any Diplomatic Points.

===========================================================================

METHOD:
Country.KillAllAirUnits (int countryID)

DESCRIPTION
Deletes immediately all air units of given country that are on map. Use Country.KillAllUnitsInReserve to
delete all units in reserve.

===========================================================================

METHOD:
Country.KillAllLandUnits (int countryID)

DESCRIPTION
Deletes immediately all land units of given country. This includes land units on map and
being carried by transports/amphibs. Use Country.KillAllUnitsInReserve to
delete all units in reserve.

===========================================================================

METHOD:
Country.KillAllUnitsInReserve (int countryID)

DESCRIPTION
Deletes all units (land and air) in reserve for given country.

===========================================================================

METHOD:
Country.SetActive (int countryID, int activeFlag)

DESCRIPTION
Sets if the country is active or not. ActiveFlag==0 means country is inactive, 1 = active. 
Countries are by default deactivated when they surrender. Deactivating manually from event
must be done carefully! Example of deactivating country is Vichy France event.

===========================================================================

METHOD:
Country.SetAllianceEntry (int countryID, int value)

DESCRIPTION:
Sets Alliance Entry of given Country to a given value. If Alliance entry is set to 100, country joins alliance
automatically (no further operations needed)

===========================================================================

METHOD:
Country.SetDiplomaticPoints (int countryID, int value)

DESCRIPTION:
Sets DP of given Country to a given value. 

===========================================================================

METHOD:
Country.SetFreezeLevelForAllFreezedUnits (int countryID, int value)

DESCRIPTION:
Sets Freeze level (number of turns unit should remain freezed) for freezed units of given country to a given
value. Setting freeze level to 10000 will be displayed to player as "permanent" freeze. Note that this 
method does not affect un-freezed units.

===========================================================================

METHOD:
Country.SetProductionPoints (int countryID, int value)

DESCRIPTION:
Sets PP of given Country to a given value. 

===========================================================================

METHOD:
Country.SetPoliticalStrength (int countryID, int value)

DESCRIPTION:
Sets Political Strength of given Country to a given value. 

===========================================================================

METHOD:
Country.SetSocialUnrest (int countryID, int value)

DESCRIPTION:
Sets Social Unrest of given Country to a given value. 

===========================================================================

METHOD:
Country.SetWarEconomy (int countryID, int value)

DESCRIPTION:
Sets War Economy of given Country to a given value. 

===========================================================================

METHOD:
Country.UnFreezeAllUnits (int countryID)

DESCRIPTION:
Un-freezes all units of given country.  

===========================================================================

METHOD
Commander.ChangeLevel

NIE ZAIMPLEMENTOWANE

===========================================================================

METHOD
Commander.SetLevel

NIE ZAIMPLEMENTOWANE

===========================================================================

METHOD:
Flag.ChangeValue (int flagID, int change)

DESCRIPTION:
Changes value of given flag by given value.  

===========================================================================

METHOD:
Flag.SetValue (int flagID, int value)

DESCRIPTION:
Sets value of given flag.  

===========================================================================

METHOD:
Hex.SetFortLevel (int x, int y, int newLevel)

DESCRIPTION:
Sets fortification level of given hex. Be careful, range is not checked, so entering incorrect hex coordinates 
will cause game to crash. Fort level should be in range from 0 (no fortification) to 9 (max fortification).

===========================================================================

METHOD:
HexStripe.ChangeControllerAndOwner (int hexX, int hexY, int stripeHeight, int newOwnerID)

DESCRIPTION: 
This method changes controller and owner of a vertical hex stripe, beginning from hex 
with coordinates (hexX, hexY). Hex stripe height is specified by third parameter 
(stripeHeight), hexes are changed from start hex going south. Owner and Controller
of hex is changed to a country specified with 4th parameter (newOwnerID). Additional
effect: each unit not owned by specified country or its allies and standing on
changed hex is automatically transferred to its owner's reserve pool. 

EXAMPLE:
<effect method="HexStripe.ChangeControllerAndOwner" param1="10" param2="24" param3="3" param4="7" />
Three hexes: (10,24) (10,25) and (10,26) will change their owner and controller to
country with id=7.

===========================================================================

METHOD:
HexStripe.ChangeControllerOwnerAndOriginalOwner (int hexX, int hexY, int stripeHeight, int newOwnerID)

DESCRIPTION:
Identical to HexStripe.ChangeControllerAndOwner but this one also changes original owner of hex stripe.

===========================================================================

METHOD:
Unit.Teleport (int sourceX, int sourceY, int destinationX, int destinationY)

DESCRIPTION:
This method teleports unit from hex (sourceX,sourceY) to (destinationX,destinationY). If no unit 
is present at source hex or destination hex is occupied - nothing happens. NOTE: teleportation does not 
check who controls destination hex and after unit is teleported destination hex controller remains unchanged!

===========================================================================


METHOD:
Unit.Unfreeze (int unitX, int unitY)

DESCRIPTION
Un-freezes unit at given coordinates. If no unit is present at given coordinates or present unit is 
not freezed - nothing happens.

===========================================================================


METHOD:
Hex.KillUnit (int hexX, int hexY)

DESCRIPTION
Kills the unit that occupies hex with given coordinates. If no unit is present on the hex - nothing happens. If 
the coordinates are out of range, game will crash, so be careful.
===========================================================================

METHOD:
Country.ChangeEffectivityOfAllUnits (int countryID, int allianceID, int changeValue)

DESCRIPTION
Changes the effectivity of all units of given alliance (Allowable allianceID values: 1=axis, 2=allied, 3=comintern, 4=neutrals) in the area ORIGINALLY controlled by given country (countryID) to the end of the next turn. ChangeValue is a percentage change it may be positive (increased eff.) or negative. 

EXAMPLE:
Country.ChangeEffectivityOfAllUnits (3, 1, -35)

This will decrease the effectivity of all axis units on the territory that was originally owned by USSR.

===========================================================================

METHOD:
Area.ChangeEffectivityOfAllUnits (int topLeftX, int topLeftY, int bottomRightX, int bottomRightY, int allianceID, int changeValue)

DESCRIPTION:
Changes the effectivity of all units of given alliance (Allowable allianceID values: 1=axis, 2=allied, 3=comintern, 4=neutrals) in the rectangle area set by (topLeftX, topleftY)-(bottomRightX,bottomRightY) to the end of the next turn. ChangeValue is a percentage change it may be positive (increased eff.) or negative. 



===========================================================================

METHOD:
Country.AddConvoy (int countryID, int convoyType, int value, int departurePortX, int departurePortY, int targetPortX, int targetPortY)

DESCRIPTION:
Adds a convoy of given type for given country. Set ConvoyType parameter to 0 for supply convoy, and 1 for resource convoy. If convoy is a resource convoy, use value parameter to set an amount of PP sent otherwise value parameter can have any value. Set both departure and target port coordinates, if these coordinates are incorrect convoy won't be executed, if they are out of range, game will crash.

EXAMPLE:
Country.AddConvoy (53, 1, 50, 7, 78, 205, 4) will create a resource convoy for USA, from New York (7,78) to Archangelsk (205,4) carrying 50 PP. 


============================

METHOD:
Hex.AddLandUnit(int hexX, int hexY, int countryID, int unitType, int unitLevel, int unitStrength)

DESCRIPTION:
Adds a land unit to pointed hex or to unit pool (if hexX and hexY == -1).

============================



*Flags used in Europe 1939 *
============================

1 to 1000: standard flags marking if the event with given ID was fired
1001: Set to 1 if Germans dishonored Ribbentrop-Molotov Pact.
1002: Set to 1 if Germans decided to seek armistice with france (fires vichy france event)
1003: Set to 1 if France accepts armistice proposal (i.e. Vichy France is established)
1004: Set to 1 if USSR decided to give ultimatum to Lithuania
1005: Set to 1 if USSR decided to give ultimatum to Latvia
1006: Set to 1 if USSR decided to give ultimatum to Estonia
1007: Set to 1 if USA passed Lend-Lease act