Post Pacific

Post Pacific (https://postpacific.loc-online.com/index.php)
-   Темы без сохранившегося раздела (https://postpacific.loc-online.com/forumdisplay.php?f=10001)
-   -   [HELP] Oracle of Revelations AI (https://postpacific.loc-online.com/showthread.php?t=3366)

hamidouch 16.02.2006 14:33

[HELP] Oracle of Revelations AI
 
i copied sauron ai for noobie buffer and modded it for ssq.
but atm it doesn't work,
it compile without errors, but when clicking on the reply bypass it just doesn't work

can someone help?

Code:

//***********************************************************************************************Oracle of Dusk
class dusk_orator : default_npc
{
parameter:
    string fnHi = "dusk_orator.htm";
    string fnWait = "dusk_orator_wait.htm";
    string fnNobuff = "dusk_orator_no.htm";   

   
handler:
EventHandler TALKED(talker)
        {
                        ShowPage(talker, fnHi);
        }

  EventHandler CREATED()
  {
      myself.i_ai0 = 0;
  }
   
  EventHandler MENU_SELECTED(talker, ask ,reply)
  {
      if(ask == 2 && reply == 2 && myself.i_ai0 == 0)
      {
        if(IsInCategory(@fighter_group, talker.occupation) && OwnItemCount(talker, @ssq_dusk) && OwnItemCount(talker, @ssq_winner))
        {
            if(talker.level >= 40 && talker.level <= 60)
            {
              myself.i_ai1 = 1;
              AddTimerEx(1, 1);
            }
            else if(talker.level >= 61 && talker.level <= 70)
            {
              myself.i_ai1 = 1;
              AddTimerEx(2, 1);
            }
            else if(talker.level >= 71 && talker.level <= 80)
            {
              myself.i_ai1 = 1;
              AddTimerEx(3, 1);
            }
            else
            {
              ShowPage(talker, fnNobuff);
            }
        }
        else if(IsInCategory(@mage_group, talker.occupation) && OwnItemCount(talker, @ssq_dusk) && OwnItemCount(talker, @ssq_winner))
        {
            if(talker.level >= 40 && talker.level <= 60)
            {
              myself.i_ai1 = 1;
              AddTimerEx(10, 1);
            }
            else if(talker.level >= 61 && talker.level <= 70)
            {
              myself.i_ai1 = 1;
              AddTimerEx(20, 1);
            }
            else if(talker.level >= 71 && talker.level <= 80)
            {
              myself.i_ai1 = 1;
              AddTimerEx(30, 1);
            }
            else
            {
              ShowPage(talker, fnNobuff);
            }
        }
      }
      else
      {
        ShowPage(talker, fnWait);
      }     
  }   
  EventHandler TIMER_FIRED_EX(timer_id, talker, creature)
  {
      myself.i_ai0 = 1; // casting
      creature = talker;
     
// FIGHTER CLASS BEGIN!!!

      if (timer_id == 1) // todos los buff
      {
        if(myself.i_ai1 == 1)
        {
            AddUseSkillDesire(creature, 1106433, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000); ///
            myself.i_ai1 = 2;
            AddTimerEx(1, 1000);
        }
        else if(myself.i_ai1 == 2)
        {
            AddUseSkillDesire(talker, 1106689, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000); ////
            myself.i_ai1 = 3;
            AddTimerEx(1, 1000);
        }
        else if(myself.i_ai1 == 3)
        {
            AddUseSkillDesire(creature, 1106945, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000); ////
            myself.i_ai1 = 4;
            AddTimerEx(1, 1000);
        }
        else if(myself.i_ai1 == 4)
        {
            AddUseSkillDesire(creature, 1107201, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000); ////
            myself.i_ai1 = 5;
            AddTimerEx(1, 1000);
        }
        else if(myself.i_ai1 == 5)
        {
            AddUseSkillDesire(creature, 1107457, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000); ////
            myself.i_ai1 = 6;
            AddTimerEx(1, 1000);
        }
        else if(myself.i_ai1 == 6)
        {
            AddUseSkillDesire(creature, 1107713, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000); ////
            myself.i_ai1 = 7;
            AddTimerEx(1, 1000);
        }
        else if(myself.i_ai1 == 7)
        {
            AddUseSkillDesire(creature, 1108993, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000); /////
        }
      }     
      else if (timer_id == 2)
      {
        if(myself.i_ai1 == 1)
        {
            AddUseSkillDesire(creature, 1106433, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000); ////
            myself.i_ai1 = 2;
            AddTimerEx(2, 1000);
        }
        else if(myself.i_ai1 == 2)
        {
            AddUseSkillDesire(creature, 1106689, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000); ////
            myself.i_ai1 = 3;
            AddTimerEx(2, 1000);
        }
        else if(myself.i_ai1 == 3)
        {
            AddUseSkillDesire(creature, 1106945, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000); ////
            myself.i_ai1 = 4;
            AddTimerEx(2, 1000);
        }
        else if(myself.i_ai1 == 4)
        {
            AddUseSkillDesire(creature, 1107201, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000); ////
            myself.i_ai1 = 5;
            AddTimerEx(2, 1000);
        }
        else if(myself.i_ai1 == 5)
        {
            AddUseSkillDesire(creature, 1107457, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000); ////
            myself.i_ai1 = 6;
            AddTimerEx(2, 1000);
        }
        else if(myself.i_ai1 == 6)
        {
            AddUseSkillDesire(creature, 1107713, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000); ////
        }
      }         
      else if (timer_id == 3)
      {
        if(myself.i_ai1 == 1)
        {
            AddUseSkillDesire(creature, 1106433, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000); ////
            myself.i_ai1 = 2;
            AddTimerEx(3, 1000);
        }
        else if(myself.i_ai1 == 2)
        {
            AddUseSkillDesire(creature, 1106689, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000); /////
            myself.i_ai1 = 3;
            AddTimerEx(3, 1000);
        }
        else if(myself.i_ai1 == 3)
        {
            AddUseSkillDesire(creature, 1106945, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000); /////
            myself.i_ai1 = 4;
            AddTimerEx(3, 1000);
        }
        else if(myself.i_ai1 == 4)
        {
            AddUseSkillDesire(creature, 1107201, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000); ////
            myself.i_ai1 = 5;
            AddTimerEx(3, 1000);
        }
        else if(myself.i_ai1 == 5)
        {
            AddUseSkillDesire(creature, 1107457, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000); ////
        }
      }   
//MAGE CLASS BEGIN!!

      else if (timer_id == 10) // todos los buff
      {
        if(myself.i_ai1 == 1)
        {
            AddUseSkillDesire(creature, 1106433, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000); /////
            myself.i_ai1 = 2;
            AddTimerEx(10, 1000);
        }
        else if(myself.i_ai1 == 2)
        {
            AddUseSkillDesire(creature, 1106689, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000); /////
            myself.i_ai1 = 3;
            AddTimerEx(10, 1000);
        }
        else if(myself.i_ai1 == 3)
        {
            AddUseSkillDesire(creature, 1107969, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000); ///
            myself.i_ai1 = 4;
            AddTimerEx(10, 1000);
        }
        else if(myself.i_ai1 == 4)
        {
            AddUseSkillDesire(creature, 1108225, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000);  /////
            myself.i_ai1 = 5;
            AddTimerEx(10, 1000);
        }
        else if(myself.i_ai1 == 5)
        {
            AddUseSkillDesire(creature, 1108481, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000);  /////
            myself.i_ai1 = 6;
            AddTimerEx(10, 1000);
        }
        else if(myself.i_ai1 == 6)
        {
            AddUseSkillDesire(creature, 1108737, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000);  ////
            myself.i_ai1 = 7;
            AddTimerEx(10, 1000);
        }
        else if(myself.i_ai1 == 7)
        {
            AddUseSkillDesire(creature, 1108993, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000);  /////
        }
      }   
     
      else if (timer_id == 20)
      {
        if(myself.i_ai1 == 1)
        {
            AddUseSkillDesire(creature, 1106433, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000); ////
            myself.i_ai1 = 2;
            AddTimerEx(20, 1000);
        }
        else if(myself.i_ai1 == 2)
        {
            AddUseSkillDesire(creature, 1106689, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000); ////
            myself.i_ai1 = 3;
            AddTimerEx(20, 1000);
        }
        else if(myself.i_ai1 == 3)
        {
            AddUseSkillDesire(creature, 1107969, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000);  ////
            myself.i_ai1 = 4;
            AddTimerEx(20, 1000);
        }
        else if(myself.i_ai1 == 4)
        {
            AddUseSkillDesire(creature, 1108225, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000);  ////
            myself.i_ai1 = 5;
            AddTimerEx(20, 1000);
        }
        else if(myself.i_ai1 == 5)
        {
            AddUseSkillDesire(creature, 1108481, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000);  /////
            myself.i_ai1 = 6;
            AddTimerEx(20, 1000);
        }
        else if(myself.i_ai1 == 6)
        {
            AddUseSkillDesire(creature, 1108737, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000);  ////
        }
      }         
     

      else if (timer_id == 30)
      {
        if(myself.i_ai1 == 1)
        {
            AddUseSkillDesire(creature, 1106433, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000);  /////
            myself.i_ai1 = 2;
            AddTimerEx(30, 1000);
        }
        else if(myself.i_ai1 == 2)
        {
            AddUseSkillDesire(creature, 1106689, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000); /////
            myself.i_ai1 = 3;
            AddTimerEx(30, 1000);
        }
        else if(myself.i_ai1 == 3)
        {
            AddUseSkillDesire(creature, 1107969, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000);    ////
            myself.i_ai1 = 4;
            AddTimerEx(30, 1000);
        }
        else if(myself.i_ai1 == 4)
        {
            AddUseSkillDesire(creature, 1108225, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000);  /////
            myself.i_ai1 = 5;
            AddTimerEx(30, 1000);
        }
        else if(myself.i_ai1 == 5)
        {
            AddUseSkillDesire(creature, 1108481, @ST_HEAL, @AMT_MOVE_TO_TARGET, 1000000);  /////
        }
      }     
   
      myself.i_ai0 = 0;
  }
}


cool_santino 16.02.2006 14:54

to let it work, you mast chage all hendlers and func calls in the compiled ai

toolpunk 16.02.2006 15:32

maybe some prob with your html files...

hamidouch 16.02.2006 15:43

no problem in html file.
and cool santino i know that, it's not the problem neither.

Kenster 16.02.2006 18:00

Hami, in retail, when you walk back you either get BUFFED or DEBUFFED depending on your side that wins/loose.

toolpunk 16.02.2006 19:26

i think the prob is that the code doesnt work. no matter if it deviates from retail...

cool_santino 16.02.2006 20:36

If all ok in handlers and func calls, then look at this

this is a part of original source:

Quote:

EventHandler MENU_SELECTED(talker, ask ,reply)
{
if(ask == 2 && reply == 2 && myself.i_ai0 == 0)
{
if(talker.level < 10 || talker.level > 25)
ShowPage(talker, "nobuff.htm");
else
{
ShowPage(talker, "wait.htm");
myself.i_ai2 = talker;
if(IsInCategory(@fighter_group, talker.occupation))
{
if(talker.level >= 15 && talker.level <= 19)
{
myself.i_ai1 = 1;
AddTimerEx(1, 1);
}
......
and in the handler EventHandler TIMER_FIRED_EX(timer_id, creature):

Quote:

EventHandler TIMER_FIRED_EX(timer_id, creature)
{
myself.i_ai0 = 1;
creature = myself.i_ai2;
....
in you source you try cast spells on creature, but not on talker...

sry for my bad english)

hamidouch 16.02.2006 21:58

cool_santino, thks i got it now.


All times are GMT. The time now is 15:48.