View Single Post
  #2  
Old 07-15-2012, 11:44 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Yes it's possible.

Code:
using System;
using System.Collections;
using System.Collections.Generic;
using maddox.game;
using maddox.game.world;

public class Mission : AMission
{

    public override void OnBattleStarted()
    {
        base.OnBattleStarted();

        MissionNumberListener = -1;
    }

    public override void OnTrigger(int missionNumber, string shortName, bool active)
    {
        base.OnTrigger(missionNumber, shortName, active);

        if (shortName.Equals("YourTriggerName"))
        {
            
            List<string> actions = new List<string>{"Action1", "Action2", "Action3", "Action4"};

            actions.ForEach(item => {
                                        AiAction action = GamePlay.gpGetAction(item);
                                        if (action != null)
                                           action.Do();
                                    });
            GamePlay.gpGetTrigger(shortName).Enable = false; // to avoid multible activations
        }
    }


}
change "YourTriggerName" and the action names in {"Action1", "Action2", "Action3", "Action4"} to your needs.
Reply With Quote