void EnterCombat(Unit* who)
			{
				BossAI::EnterCombat(who);
				Talk(SAY_AGGRO);

				events.ScheduleEvent(EVENT_SPELL_ENRAGE, 600000);
				events.ScheduleEvent(EVENT_CHECK_AURA, 1000);
				SetForm(false, true);
			}
예제 #2
0
ExposedList :: ExposedList(FuncObjC&        FOref,
                           const char*      mainT,
                           DSC_IndexMSSpec& msRef,
                           int              offVal,
                           SC_StringArray&  strRef) :
    ExposedObjC(FOref, mainT),
#ifndef ADCONSOLEAPP
    exposedMS(msRef),
#endif
    offsetVal(offVal),
    listData(strRef)
{
#ifndef ADCONSOLEAPP

    ArgListC args;


    if (exposedMS.enteredIndexIsSingle)
        {

            args.Clear();
            args.LeftPosAttach(2);
            args.RightPosAttach(98);
            args.BottomFormAttach();
            animRowForm.InitWidget(exposedObjectDialogForm.GetWidget(), args);

            // buttons
            args.Clear();
            args.LeftFormAttach();
            args.RightFormAttach();
            args.BottomFormAttach(2);

            animateButton.StdButtonInit("Animate", animRowForm.GetWidget(), args);
            animateButton.AddOtherObjectCallback(AnimButtonCB, this);

            args.Clear();
            args.LeftFormAttach();
            args.RightFormAttach();
            args.BottomBaseAttach(animRowForm);
            bottomRowForm.InitWidget(exposedObjectDialogForm.GetWidget(), args);

            args.Clear();
            args.BottomFormAttach(2);
            args.SetPlaceHolder();

            args.LeftPosAttach(2);
            args.RightPosAttach(48);
            toStartButton.StdButtonInit(" |<- ", bottomRowForm.GetWidget(), args);
            toStartButton.AddOtherObjectCallback(ToStartButtonCB, this);

            args.ResetPlace();
            args.LeftPosAttach(52);
            args.RightPosAttach(98);
            toEndButton.StdButtonInit(" ->| ", bottomRowForm.GetWidget(), args);
            toEndButton.AddOtherObjectCallback(ToEndButtonCB, this);

            // next row buttons
            args.Clear();
            args.LeftFormAttach();
            args.RightFormAttach();
            args.BottomBaseAttach(bottomRowForm);
            nextRowForm.InitWidget(exposedObjectDialogForm.GetWidget(), args);

            args.Clear();
            args.BottomFormAttach(2);
            args.SetPlaceHolder();

            args.LeftPosAttach(2);
            args.RightPosAttach(48);
            nextButton.StdButtonInit(" > ", nextRowForm.GetWidget(), args);
            nextButton.AddOtherObjectCallback(NextButtonCB, this);

            args.ResetPlace();
            args.LeftPosAttach(52);
            args.RightPosAttach(98);
            prevButton.StdButtonInit(" < ", nextRowForm.GetWidget(), args);
            prevButton.AddOtherObjectCallback(PrevButtonCB, this);

            args.Clear();
            args.LeftFormAttach();
            args.RightFormAttach();
            args.BottomBaseAttach(nextRowForm);
            toggleRowForm.InitWidget(exposedObjectDialogForm.GetWidget(), args);

            args.StdToggleSetup(5);
            startAnimAtZero.StdToggleInit("animate from start", toggleRowForm.GetWidget(), args);
            startAnimAtZero.SetValue(true);

            args.StdFormAttach(5);
            args.BottomWidgetAttach(toggleRowForm.GetWidget());
        }
    else
        {
            args.Clear();
            args.LeftPosAttach(2);
            args.RightPosAttach(98);
            args.BottomFormAttach();
            bottomRowForm.InitWidget(exposedObjectDialogForm.GetWidget(), args);

            args.Clear();
            args.LeftFormAttach();
            args.RightFormAttach();
            args.BottomFormAttach(2);

            applyButton.StdButtonInit(" Apply ", bottomRowForm.GetWidget(), args);
            applyButton.AddOtherObjectCallback(ApplyCB, this);

            // next row buttons
            args.Clear();
            args.LeftFormAttach();
            args.RightFormAttach();
            args.BottomBaseAttach(bottomRowForm);
            nextRowForm.InitWidget(exposedObjectDialogForm.GetWidget(), args);

            args.Clear();
            args.BottomFormAttach(2);
            args.SetPlaceHolder();

            args.LeftPosAttach(2);
            args.RightPosAttach(48);
            selectNoneButton.StdButtonInit(" None ", nextRowForm.GetWidget(), args);
            selectNoneButton.AddOtherObjectCallback(SelectNoneCB, this);

            args.ResetPlace();
            args.LeftPosAttach(52);
            args.RightPosAttach(98);
            selectAllButton.StdButtonInit(" All ", nextRowForm.GetWidget(), args);
            selectAllButton.AddOtherObjectCallback(SelectAllCB, this);

            args.StdFormAttach(10);
            args.BottomWidgetAttach(nextRowForm.GetWidget());
        }

    // list
    args.BottomOffset(5);
    scrolledList.isSingleSel = exposedMS.enteredIndexIsSingle;
    scrolledList.InitWidget(exposedObjectDialogForm.GetWidget(), args);
    scrolledList.AddOtherObjectCallback(ListChangeCB, this);

    SetForm(&exposedObjectDialogForm);
    ResetForm();

    SetAllSensitive();

    // set title
    Update();
#endif

}
			void UpdateAI(uint32 diff)
			{
				if (!UpdateVictim())
					return;

				events.Update(diff);
				if (me->HasUnitState(UNIT_STATE_CASTING))
					return;

				switch (events.ExecuteEvent())
				{
					case EVENT_CHECK_AURA:
						if (me->HasAura(SPELL_BLUE_BEAM) == me->HasAura(SPELL_CORRUPTION))
							SetForm(!me->HasAura(SPELL_BLUE_BEAM), false);
						events.ScheduleEvent(EVENT_CHECK_AURA, 1000);
						break;
					case EVENT_SPELL_ENRAGE:
						me->CastSpell(me, SPELL_ENRAGE, true);
						break;
					case EVENT_SPELL_MARK_OF_HYDROSS1:
						me->CastSpell(me, SPELL_MARK_OF_HYDROSS1, false);
						break;
					case EVENT_SPELL_MARK_OF_HYDROSS2:
						me->CastSpell(me, SPELL_MARK_OF_HYDROSS2, false);
						break;
					case EVENT_SPELL_MARK_OF_HYDROSS3:
						me->CastSpell(me, SPELL_MARK_OF_HYDROSS3, false);
						break;
					case EVENT_SPELL_MARK_OF_HYDROSS4:
						me->CastSpell(me, SPELL_MARK_OF_HYDROSS4, false);
						break;
					case EVENT_SPELL_MARK_OF_HYDROSS5:
						me->CastSpell(me, SPELL_MARK_OF_HYDROSS5, false);
						break;
					case EVENT_SPELL_MARK_OF_HYDROSS6:
						me->CastSpell(me, SPELL_MARK_OF_HYDROSS6, false);
						events.ScheduleEvent(EVENT_SPELL_MARK_OF_HYDROSS6, 15000, GROUP_ABILITIES);
						break;
					case EVENT_SPELL_MARK_OF_CORRUPTION1:
						me->CastSpell(me, SPELL_MARK_OF_CORRUPTION1, false);
						break;
					case EVENT_SPELL_MARK_OF_CORRUPTION2:
						me->CastSpell(me, SPELL_MARK_OF_CORRUPTION2, false);
						break;
					case EVENT_SPELL_MARK_OF_CORRUPTION3:
						me->CastSpell(me, SPELL_MARK_OF_CORRUPTION3, false);
						break;
					case EVENT_SPELL_MARK_OF_CORRUPTION4:
						me->CastSpell(me, SPELL_MARK_OF_CORRUPTION4, false);
						break;
					case EVENT_SPELL_MARK_OF_CORRUPTION5:
						me->CastSpell(me, SPELL_MARK_OF_CORRUPTION5, false);
						break;
					case EVENT_SPELL_MARK_OF_CORRUPTION6:
						me->CastSpell(me, SPELL_MARK_OF_CORRUPTION6, false);
						events.ScheduleEvent(EVENT_SPELL_MARK_OF_CORRUPTION6, 15000, GROUP_ABILITIES);
						break;
					case EVENT_SPELL_WATER_TOMB:
						if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 60.0f, true))
							me->CastSpell(target, SPELL_WATER_TOMB, false);
						events.ScheduleEvent(EVENT_SPELL_WATER_TOMB, 7000, GROUP_ABILITIES);
						break;
					case EVENT_SPELL_VILE_SLUDGE:
						if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 60.0f, true))
							me->CastSpell(target, SPELL_VILE_SLUDGE, false);
						events.ScheduleEvent(EVENT_SPELL_VILE_SLUDGE, 15000, GROUP_ABILITIES);
						break;

				}

				DoMeleeAttackIfReady();
			}
예제 #4
0
//  object control
void PS_ObjectDialog::OpenObjectDialog()
{
    if (!IsCreated())
    {
        //controlDialog.CreateShell(basePlatform.plotShell.GetWidget(), true, "Plot Object Control");
        CRect rect(0, 0, 180, 400);

        char plotName[80];
        basePlatform.GetMainWindowTitle(plotName, false, 80);
        ConcatString(plotName, "::Control", 80);

        CreateShell(NULL, true, plotName, rect);

        ArgListC args;

        //args.AddArg(XmNautoUnmanage,          True);
        //args.AddWidthHeight(175, 400);
        //controlDialogForm.CreateWidget(controlDialog, args);
        //TODO:
        //controlDialogForm.AddCallback(XmNfocusCallback, FocusCB, this);

        // add buttons to bottom
        // bottom row buttons
        args.Clear();
        args.LeftFormAttach();
        args.RightFormAttach();
        args.BottomFormAttach();
        bottomRowForm.InitWidget(controlDialogForm.GetWidget(), args);

        args.Clear();
        args.AddArg(Arg::XmNwidth, 76);
        args.BottomFormAttach(2);
        args.SetPlaceHolder();

        // close
        args.LeftPosAttach(2);
        //TODO:
        //controlCloseButton.FixedSizeButtonArgs(args);
        controlCloseButton.StdButtonInit(" Close ", bottomRowForm.GetWidget(), args);
        controlCloseButton.AddOtherObjectCallback(CloseButtonCB, this);

        // apply
        args.ResetPlace();
        args.LeftPosAttach(50);
        controlApplyButton.StdButtonInit("Apply", bottomRowForm.GetWidget(), args);
        controlApplyButton.AddOtherObjectCallback(ApplyButtonCB, this);

        // next row buttons
        args.Clear();
        args.LeftFormAttach();
        args.RightFormAttach();
        args.BottomBaseAttach(bottomRowForm);
        nextRowForm.InitWidget(controlDialogForm.GetWidget(), args);

        args.Clear();
        args.AddArg(Arg::XmNwidth, 76);
        args.BottomFormAttach(2);
        args.SetPlaceHolder();

        // step button
        args.LeftPosAttach(2);
        controlClearButton.StdButtonInit(" Clear ", nextRowForm.GetWidget(), args);
        controlClearButton.AddOtherObjectCallback(ClearAllButtonCB, this);

        //  to start
        args.ResetPlace();
        args.LeftPosAttach(50);
        controlAllButton.StdButtonInit(" Set ", nextRowForm.GetWidget(), args);
        controlAllButton.AddOtherObjectCallback(SetAllButtonCB, this);

        // scroll window
        args.Clear();
        args.StdFormAttach();
        args.BottomBaseAttach(nextRowForm);
        //controlScrollArea.needHorizontal = false;
        controlScrollArea.InitWidget(controlDialogForm.GetWidget(), args);
        SetForm(&controlDialogForm);
    }

    Manage();
}
예제 #5
0
void PS_TransparencyDialog::DoCreateDialog(CWnd* pParentWnd)
{
    ArgListC args;
    CRect rect(0, 0, 350, 550);

    char plotName[80];
    base3DPlatform.GetMainWindowTitle(plotName, false, 80);
    ConcatString(plotName, "::Transparency", 80);

    CreateShell(pParentWnd, true, plotName, rect);
    CenterWindow();

    args.StdFormAttach();
    topRowForm.InitWidget(transparencyDialogForm.GetWidget(), args);

    args.StdToggleSetup(5);
    useTransparencyUI.StdToggleInit("Enable transparency", topRowForm.GetWidget(), args);
    useTransparencyUI.AddOtherObjectCallback(SetAllSensitiveCB, this);

    args.StdTopObjectAttach(topRowForm.GetWidget());
    groupForm.InitWidget(transparencyDialogForm.GetWidget(), args);

    args.StdFormAttach();
    for (int i = 0; i < PC_TransparencySpec::maxTransparencyGroup; i++)
    {
        char tempStr[80];
        ConcatInt(i + 1, "Group ", tempStr, 1, 80);
        transparencyGroupsUI[i].InitFramedUI(tempStr, groupForm.GetWidget(), args);
        args.StdTopObjectAttach(transparencyGroupsUI[i]);
    }

    // bottom row buttons
    args.Clear();
    args.LeftFormAttach();
    args.RightFormAttach();
    args.BottomFormAttach();
    bottomRowForm.InitWidget(transparencyDialogForm.GetWidget(), args);

    // animate
    args.StdSplitMiddle(2, 30);
    animateButton.StdButtonInit("Anim.", bottomRowForm.GetWidget(), args);
    animateButton.AddOtherObjectCallback(AnimateButtonCB, this);

    args.StdSplitMiddle(32, 64);
    applyButton.StdButtonInit("Apply", bottomRowForm.GetWidget(), args);
    applyButton.AddOtherObjectCallback(ApplyButtonCB, this);

    //  close
    args.StdSplitMiddle(66, 99);
    closeButton.StdButtonInit("Close", bottomRowForm.GetWidget(), args);
    closeButton.AddOtherObjectCallback(CloseButtonCB, this);

    // next row buttons
    args.Clear();
    args.LeftFormAttach();
    args.RightFormAttach();
    args.BottomBaseAttach(bottomRowForm);
    nextRowForm.InitWidget(transparencyDialogForm.GetWidget(), args);

    args.StdSplitMiddle(2, 30);
    stepButton.StdButtonInit("Step", nextRowForm.GetWidget(), args);
    stepButton.AddOtherObjectCallback(StepButtonCB, this);

    args.StdSplitMiddle(32, 64);
    startButton.StdButtonInit("Start", nextRowForm.GetWidget(), args);
    startButton.AddOtherObjectCallback(StartButtonCB, this);

    args.StdSplitMiddle(66, 98);
    endButton.StdButtonInit("End", nextRowForm.GetWidget(), args);
    endButton.AddOtherObjectCallback(EndButtonCB, this);

    // # of frames
    args.Clear();
    args.LeftFormAttach();
    args.RightFormAttach();
    args.BottomBaseAttach(nextRowForm);
    ntransStepsUI.SetFieldLen(5);
    ntransStepsUI.InitLabeledUI("# of frames", transparencyDialogForm.GetWidget(), args);

    SetForm(&transparencyDialogForm);
    ResetForm();
}