Announcement

Collapse
No announcement yet.

Sabotage!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    35% Chance you get a percentage of there map but not whole map
    From all the stuff you mentioned this is the only one impossible for CTP2

    Note: The big Mc used to use you new avatar. Every time i see it i think i am talking to him
    "Kill a man and you are a murder.
    Kill thousands and you are a conquer.
    Kill all and you are a God!"
    -Jean Rostand

    Comment


    • #17
      Me to I look at that avatar and think there my posts.

      but I am working on a new avatar for myself.
      "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
      The BIG MC making ctp2 a much unsafer place.
      Visit the big mc’s website

      Comment


      • #18
        Since my mod is taking longer than i expected.

        Here is the bribe code if anyone wants it:

        Code:
        // Bribe Order
        //////////////////////////
        
        int_t BribedType[];
        unit_t BribedUnit[];
        location_t BribeLocation;
        int_t BribeCount;
        int_t BRIBE_COST;
        
        HandleEvent(AirliftOrder) 'BribeOrderByPedrunn' pre {
        int_t num;
        int_t i;
        int_t j;
        int_t tmpPlayer;
        unit_t tmpUnit;
        location_t tmpLoc;
        location_t tmpLoc2;
        city_t tmpCity;
        	tmpPlayer = g.player;
        	BRIBE_COST = 0;
        	BribeCount = 0;
        	tmpLoc = location[0];
        	num = GetUnitsAtLocation(tmpLoc);
        	GetCityByLocation(tmpLoc, tmpCity);
        	if(!CityIsValid(tmpCity)
        	&& num > 0) {
        		for(i = 0; i < num; i = i + 1){
        			GetUnitFromCell(tmpLoc, i, tmpUnit);
        			BribedUnit[BribeCount] = tmpUnit;
        			BribedType[BribeCount] = tmpUnit.type;
        			BribeCount = BribeCount + 1;
        			BRIBE_COST = BRIBE_COST + (Random(200) 
        //						+ (30*IsFlankingUnit(tmpUnit)) 
        //						+ (100*IsEliteUnit(tmpUnit)) 
        //						+ (40*IsNonGroupLandUnit(tmpUnit)) 
        //						+ (20*SeaTransporterCapacity(tmpUnit)) 
        //						+ (40*IsAirUnit(tmpUnit)) 
        //						+ (100*IsLeviathonUnit(tmpUnit)) 
        //						+ (50*(1 + AS_GetAge(tmpUnit)))
        						);
        			if(tmpUnit.owner == 0) {
        				BRIBE_COST = BRIBE_COST/2;
        			}
        		}
        		if(BribeCount > 0) {
        			if(PlayerGold(tmpPlayer) > BRIBE_COST) {
        				if(IsHumanPlayer(tmpPlayer)) {
        					BribeLocation = BribedUnit[0].location;
        					message(tmpPlayer, 'DoYouWantToBribe');
        				}
        				else{
        					for(i = 0; i < BribeCount; i = i + 1) {
        						Event: DisbandUnit(BribedUnit[i]);
        					}
        					for(j = 0; j < BribeCount; j = j + 1) {
        						CreateUnit(tmpPlayer, BribedType[j], BribeLocation, 0);
        					}
        					AddEffect(location[0], "SPECEFFECT_REVOLUTION", "SOUND_ID_REVOLUTION");
        					AddGold(tmpPlayer, BRIBE_COST);
        				}
        			}
        			else{
        				if(IsHumanPlayer(tmpPlayer)) {
        					message(tmpPlayer, 'NotEnoughMoneyForBribe');
        				}
        			}
        		}
        	}
        	else{
        //		AddEffect(BribeLocation, "SPECEFFECT_NONE", "SOUND_ID_NONE"); // Dont exist
        	}
        	return STOP;
        }
        
        alertbox 'DoYouWantToBribe' {
        int_t i;
        int_t j;
        int_t tmpPlayer;
        	tmpPlayer = g.player;
        	show();
        	text(ID_DO_YOU_WANT_TO_BRIBE);
        	Button(ID_YES) {
        		if(Random(4) == 0) {
        			for(i = 0; i < BribeCount; i = i + 1) {
        				Event: DisbandUnit(BribedUnit[i]);
        			}
        			for(j = 0; j < BribeCount; j = j + 1) {
        				CreateUnit(tmpPlayer, BribedType[j], BribeLocation, 0);
        			}
        			AddEffect(location[0], "SPECEFFECT_REVOLUTION", "SOUND_ID_REVOLUTION");
        			AddGold(tmpPlayer, BRIBE_COST);
        		}
        		else{
        			message(tmpPlayer, 'TheyAreGoodSoldiers');	
        		}
        		Kill();  
        	}
        	Button(ID_NO) {			// if the player does accept	
        		Kill();
        	}
        
        }
        
        alertbox 'NotEnoughMoneyForBribe' {
        	show();
        	text(ID_BRIBE_COST_TOO_HIGH);
        	Button(ID_OK) {	
        		Kill();  
        	}
        }
        
        alertbox 'TheyAreGoodSoldiers' {
        	show();
        	text(ID_BRIBE_REFUSED);
        	Button(ID_OK) {	
        		Kill();  
        	}
        }
        and this should go to the orders.txt (note: all units that can sue will have the brice ability.
        Code:
        ORDER_BRIBE {
          Gold 0
          Move 100
          EventName "AirliftOrder"
        
          LocalizedName str_ldl_order_airlift
          StatusText str_ldl_order_airlift
        
          TargetPretest:EnemySpecialUnit
          UnitPretest_CanSue
          
          Range 1
        
          CPIcon "upsi21.tga"
          ButtonLocation 10
          DefaultIcon ICON_ORDER_INCITE_REVOLUTION
          Cursor 40
          InvalidCursor 41
        }
        And this should go in the info_str.txt

        Code:
        DO_YOU_WANT_TO_BRIBE	"Great Leader, we could surely use this army for our needs but they we calculate an overall cost of {BRIBE_COST} gold from our treasury. Are you Do you want to send them the offer?"
        BRIBE_COST_TOO_HIGH	"Unfortunetly, Our treasury cannot afford the {BRIBE_COST} gold expense for bribing these units. "
        
        BRIBE_REFUSED		"The men you tried to bribe are too patriotic soldiers so they did not accept the offer."
        and finally this is to go in the scen_str.txt.

        Code:
        ORDER_BRIBE			"Bribe"
        str_ldl_order_airlift		"Bribe"
        OK		"Ok"
        Sorry for messing up the thread lenght
        Last edited by Pedrunn; October 30, 2002, 18:47.
        "Kill a man and you are a murder.
        Kill thousands and you are a conquer.
        Kill all and you are a God!"
        -Jean Rostand

        Comment

        Working...
        X