public EventControl(Event_dataset Data,Int32 ID,uint creatureid)
{
InitializeComponent();
this.Name = ID.ToString();
eventid = ID;
creature_id = creatureid;
this.eventnumber.Text = "Event: " + ID.ToString();
this.expand.Checked = true;
for(int n=0; n < Info.EventListInfo.GetLength(0);n++)
this.EventTypeCBox.Items.Add(Info.EventListInfo[n,0]);
// set width
EventTypeCBox.DropDownWidth = DropDownWidth(EventTypeCBox);
for (int n = 0; n < Info.ActionListInfo.GetLength(0); n++)
{
this.Action1TypeCBox.Items.Add(Info.ActionListInfo[n, 0]);
this.Action2TypeCBox.Items.Add(Info.ActionListInfo[n, 0]);
this.Action3TypeCBox.Items.Add(Info.ActionListInfo[n, 0]);
}
this.Action1TypeCBox.SelectedIndex = Data.action1_type;
this.Action1Param1Tbox.Text = Data.action1_param1.ToString();
this.Action1Param2Tbox.Text = Data.action1_param2.ToString();
this.Action1Param3Tbox.Text = Data.action1_param3.ToString();
this.Action2TypeCBox.SelectedIndex = Data.action2_type;
this.Action2Param1Tbox.Text = Data.action2_param1.ToString();
this.Action2Param2Tbox.Text = Data.action2_param2.ToString();
this.Action2Param3Tbox.Text = Data.action2_param3.ToString();
this.Action3TypeCBox.SelectedIndex = Data.action3_type;
this.Action3Param1Tbox.Text = Data.action3_param1.ToString();
this.Action3Param2Tbox.Text = Data.action3_param2.ToString();
this.Action3Param3Tbox.Text = Data.action3_param3.ToString();
this.EventTypeCBox.SelectedIndex = Data.event_type;
this.EventParam1.Text = Data.event_param1.ToString();
this.EventParam2.Text = Data.event_param2.ToString();
this.EventParam3.Text = Data.event_param3.ToString();
this.EventParam4.Text = Data.event_param4.ToString();
this.EventChanceTBox.Text = Data.event_chance.ToString();
this.EventFlagTBox.Text = Data.event_flags.ToString();
this.txtBoxComment.Text = Data.comment;
this.SetInversePhaseMask(Data.event_inverse_phase_mask);
this.EventTypeCBox.DropDownStyle = ComboBoxStyle.DropDownList;
this.Action1TypeCBox.DropDownStyle = ComboBoxStyle.DropDownList;
this.Action2TypeCBox.DropDownStyle = ComboBoxStyle.DropDownList;
this.Action3TypeCBox.DropDownStyle = ComboBoxStyle.DropDownList;
// load event boxes
if (EventTypeCBox.SelectedIndex == 30)
EventParam1ComboBox.SelectedIndex = Convert.ToInt32(EventParam1.Text);
// set width
Action1TypeCBox.DropDownWidth = DropDownWidth(Action1TypeCBox);
Action2TypeCBox.DropDownWidth = DropDownWidth(Action2TypeCBox);
Action3TypeCBox.DropDownWidth = DropDownWidth(Action3TypeCBox);
// load combo boxes
switch (Action1TypeCBox.SelectedIndex)
{
case 11: // Cast
case 12: // Summon
case 13: // Threat single
case 15: // Quest event
case 18: // Set unit flag
case 19: // Remove unit flag
case 32: // Summon
case 33: // Killed unit
case 34: // Set instance data
case 35: // Set instance data 64
case 36: // Update template
Action1Param2Combobox.SelectedIndex = Convert.ToInt32(Action1Param2Tbox.Text);
break;
case 16: // Cast creature/go
case 17: // Set unit field
Action1Param3Combobox.SelectedIndex = Convert.ToInt32(Action1Param3Tbox.Text);
break;
case 20: // Auto attack
case 28: // Remove aura
case 40: // Set Sheat
case 42: // Set invincibility level
case 45: // Throw AI event
Action1Param1Combobox.SelectedIndex = Convert.ToInt32(Action1Param1Tbox.Text);
break;
case 21: // Combat movement
Action1Param1Combobox.SelectedIndex = Convert.ToInt32(Action1Param1Tbox.Text);
Action1Param2Combobox.SelectedIndex = Convert.ToInt32(Action1Param2Tbox.Text);
break;
}
switch (Action2TypeCBox.SelectedIndex)
{
case 11: // Cast
case 12: // Summon
case 13: // Threat single
case 15: // Quest event
case 18: // Set unit flag
case 19: // Remove unit flag
case 32: // Summon
case 33: // Killed unit
case 34: // Set instance data
case 35: // Set instance data 64
case 36: // Update template
Action2Param2Combobox.SelectedIndex = Convert.ToInt32(Action2Param2Tbox.Text);
break;
case 16: // Cast creature/go
case 17: // Set unit field
Action2Param3Combobox.SelectedIndex = Convert.ToInt32(Action2Param3Tbox.Text);
break;
case 20: // Auto attack
case 28: // Remove aura
case 40: // Set Sheat
case 42: // Set invincibility level
case 45: // Throw AI event
Action2Param1Combobox.SelectedIndex = Convert.ToInt32(Action2Param1Tbox.Text);
break;
case 21: // Combat movement
Action2Param1Combobox.SelectedIndex = Convert.ToInt32(Action2Param1Tbox.Text);
Action2Param2Combobox.SelectedIndex = Convert.ToInt32(Action2Param2Tbox.Text);
break;
}
switch (Action3TypeCBox.SelectedIndex)
{
case 11: // Cast
case 12: // Summon
case 13: // Threat single
case 15: // Quest event
case 18: // Set unit flag
case 19: // Remove unit flag
case 32: // Summon
case 33: // Killed unit
case 34: // Set instance data
case 35: // Set instance data 64
case 36: // Update template
Action3Param2Combobox.SelectedIndex = Convert.ToInt32(Action3Param2Tbox.Text);
break;
case 16: // Cast creature/go
case 17: // Set unit field
Action3Param3Combobox.SelectedIndex = Convert.ToInt32(Action3Param3Tbox.Text);
break;
case 20: // Auto attack
case 28: // Remove aura
case 40: // Set Sheat
case 42: // Set invincibility level
case 45: // Throw AI event
Action3Param1Combobox.SelectedIndex = Convert.ToInt32(Action3Param1Tbox.Text);
break;
case 21: // Combat movement
Action3Param1Combobox.SelectedIndex = Convert.ToInt32(Action3Param1Tbox.Text);
Action3Param2Combobox.SelectedIndex = Convert.ToInt32(Action3Param2Tbox.Text);
break;
}
locked = false;
}