int imProcessSwirl(const imImage* src_image, imImage* dst_image, float k, int order)
{
  int ret = 0;

  int counter = imCounterBegin("Swirl Distort");
  int src_depth = src_image->has_alpha? src_image->depth+1: src_image->depth;
  imCounterTotal(counter, src_depth*dst_image->height, "Processing...");  /* size of the destiny image */

  for (int i = 0; i < src_depth; i++)
  {
    switch(src_image->data_type)
    {
    case IM_BYTE:
      ret = Swirl(src_image->width, src_image->height, (imbyte*)src_image->data[i], (imbyte*)dst_image->data[i], k, counter, float(0), order);
      break;
    case IM_USHORT:
      ret = Swirl(src_image->width, src_image->height, (imushort*)src_image->data[i], (imushort*)dst_image->data[i], k, counter, float(0), order);
      break;
    case IM_INT:
      ret = Swirl(src_image->width, src_image->height, (int*)src_image->data[i], (int*)dst_image->data[i], k, counter, float(0), order);
      break;
    case IM_FLOAT:
      ret = Swirl(src_image->width, src_image->height, (float*)src_image->data[i], (float*)dst_image->data[i], k, counter, float(0), order);
      break;
    case IM_CFLOAT:
      ret = Swirl(src_image->width, src_image->height, (imcfloat*)src_image->data[i], (imcfloat*)dst_image->data[i], k, counter, imcfloat(0,0), order);
      break;
    }

    if (!ret)
      break;
  }

  imCounterEnd(counter);

  return ret;
}
Beispiel #2
0
        void UpdateAI(const uint32 diff)
        {
            if (!UpdateVictim())
                return;

            if (berserk <= diff)
            {
                me->CastSpell(me, 64238);
                berserk = 32432234;
            }
            else
                berserk -= diff;

            if (swirlhit <= diff)
            {
                Swirl();
                swirlhit = 3000;
            }
            else
                swirlhit -= diff;

            if (sheepingsha <= diff)
            {
                SeepingSha();
                sheepingsha = 4500;
            }
            else
                sheepingsha -= diff;

            events.Update(diff);

            if (me->HasUnitState(UNIT_STATE_CASTING))
                return;

            switch (events.ExecuteEvent())
            {
            case EVENT_SHA_BOLT:
            {
                me->CastSpell(me, 143290);

                std::list<Player*> pl_list;
                pl_list.clear();

                me->GetPlayerListInGrid(pl_list, 300.0f);

                if (pl_list.empty())
                    return;

                for (auto itr : pl_list)
                {
                    me->CastSpell(itr, SPELL_SHA_BOLT_COSMETIC);
                }

                events.ScheduleEvent(EVENT_SHA_BOLT, 10000, GROUP_TEARS_OF_THE_VALE);
                break;
            }
            case EVENT_SWIRL_DE:
                swirl = false;
                break;
            case EVENT_SWIRL:
            {
                for (int i = 0; i <= 50; i++)
                {
                    Position pos;
                    me->GetRandomNearPosition(pos, 100.0f);

                    me->SummonCreature(TRIGGER_SHA_SWIRL, pos, TEMPSUMMON_TIMED_DESPAWN, 30000);
                }
                target = NULL;

                swirl = true;

                uint32 rando;

                if(roll_chance_i(50))
                {
                    rando = 1;
                }
                else
                {
                    rando = 4;
                }

                DespawnCreaturesInArea(TRIGGER_SHA_SWIRL_CIRCLE, me);

                Creature* trigger = me->SummonCreature(TRIGGER_SHA_SWIRL_CIRCLE, circleposition[rando], TEMPSUMMON_MANUAL_DESPAWN);
                target = trigger;

                me->CastSpell(trigger, SPELL_SWIRL_DUMMY);
                events.ScheduleEvent(EVENT_SWIRL_DE, 10000);
                events.ScheduleEvent(EVENT_SWIRL, 40000, GROUP_TEARS_OF_THE_VALE);
                break;
            }
            case EVENT_CORRSIVE_BLAST:
                me->SetFacingToObject(me->getVictim());


                me->CastSpell(me->getVictim(), SPELL_CORROSIVE_BLAST);
                events.ScheduleEvent(EVENT_CORRSIVE_BLAST, 42000, GROUP_TEARS_OF_THE_VALE);
                break;
            case EVENT_SEEPING_SHA:
                for (int i = 0; i <= 5; i++)
                {
                    Position pos;
                    me->GetRandomNearPosition(pos, 35.0f); // estimated?

                    me->SummonCreature(TRIGGER_SEEPING_SHA, pos, TEMPSUMMON_TIMED_DESPAWN, 20000);
                }
                events.ScheduleEvent(EVENT_SEEPING_SHA, 20000, GROUP_TEARS_OF_THE_VALE);
                break;
                // 2ND PHASE
            case EVENT_SPLIT_PHASE:
                events.ScheduleEvent(EVENT_SPLIT_PHASE_2, 1000);
                split = false;
                splitphase = true;

                me->SetHealth(me->GetMaxHealth());
                DespawnCreaturesInArea(71544, me);

                me->SummonCreature(CREATURE_SHA_POOL_HC, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_MANUAL_DESPAWN);

                me->CastSpell(me, SPELL_SPLIT_DUMMY);   

                if (AuraPtr aura = me->GetAura(SPELL_SPLIT_DUMMY))
                {
                    aura->SetDuration(500000);
                }

                events.CancelEvent(EVENT_SPLIT_PHASE);
                break;
            case EVENT_SPLIT_PHASE_2:
                //me->SetDisplayId(11686);
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);

                for (int i = 0; i <= 12; i++)
                {
                    me->CastSpell(me, SPELL_SPLIT_SHA_PUDDLE_THROW, true);
                    me->CastSpell(me, SPELL_SPLIT_CONTEMPLATED_THROW, true);
                }

                count = 0;

                events.CancelEvent(EVENT_SPLIT_PHASE);
                events.Reset();
                break;
            }
            DoMeleeAttackIfReady();
        }