Advertisement
sorvani

ImplmentInfuriate.diff

Feb 11th, 2013
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 8.31 KB | None | 0 0
  1. Index: trunk/EQEmuServer/zone/attack.cpp
  2. ===================================================================
  3. --- trunk/EQEmuServer/zone/attack.cpp   (revision 2509)
  4. +++ trunk/EQEmuServer/zone/attack.cpp   (working copy)
  5. @@ -384,6 +384,10 @@
  6.         damage = -3;
  7.         mlog(COMBAT__DAMAGE, "I am enraged, riposting frontal attack.");
  8.     }
  9. +   if (IsInfuriated()) {
  10. +       damage = -3;
  11. +       mlog(COMBAT__DAMAGE, "I am infuriated, riposting attacks from all sides.");
  12. +   }
  13.  
  14.     /////////////////////////////////////////////////////////
  15.     // riposte
  16. Index: trunk/EQEmuServer/zone/bot.cpp
  17. ===================================================================
  18. --- trunk/EQEmuServer/zone/bot.cpp  (revision 2509)
  19. +++ trunk/EQEmuServer/zone/bot.cpp  (working copy)
  20. @@ -3755,6 +3755,9 @@
  21.                 // Stop attacking if the target is enraged
  22.                 if(IsEngaged() && !BehindMob(GetTarget(), GetX(), GetY()) && GetTarget()->IsEnraged())
  23.                     return;
  24. +               // Stop attacking if the target is infuriated
  25. +               if(IsEngaged() && GetTarget()->IsInfuriated())
  26. +                   return;
  27.  
  28.                 if(GetBotStance() == BotStancePassive)
  29.                     return;
  30. @@ -4083,6 +4086,9 @@
  31.                     // Stop attacking while we are on a front arc and the target is enraged
  32.                     if(!botPet->BehindMob(botPet->GetTarget(), botPet->GetX(), botPet->GetY()) && botPet->GetTarget()->IsEnraged())
  33.                         return;
  34. +                   // Stop attacking while the target is infuriated
  35. +                   if(botPet->GetTarget()->IsInfuriated())
  36. +                       return;
  37.  
  38.                     if(botPet->Attack(GetTarget(), SLOT_PRIMARY))           // try the main hand
  39.                         if (botPet->GetTarget())                    // Do we still have a target?
  40. @@ -7841,6 +7847,10 @@
  41.         damage = -3;
  42.         mlog(COMBAT__DAMAGE, "I am enraged, riposting frontal attack.");
  43.     }
  44. +   if (IsInfuriated()) {
  45. +       damage = -3;
  46. +       mlog(COMBAT__DAMAGE, "I am infuriated, riposting attacks from all sides.");
  47. +   }
  48.    
  49.     /////////////////////////////////////////////////////////
  50.     // riposte
  51. Index: trunk/EQEmuServer/zone/common.h
  52. ===================================================================
  53. --- trunk/EQEmuServer/zone/common.h (revision 2509)
  54. +++ trunk/EQEmuServer/zone/common.h (working copy)
  55. @@ -84,11 +84,11 @@
  56.  
  57.  /*
  58.  Used:
  59. -b,d,f,g,j,m,n,o,p,r,t
  60. +b,d,e,f,g,j,m,n,o,p,r,t
  61.  A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,Q,R,S,T,U,W,Y
  62.  
  63.  Unused:
  64. -a,c,e,h,k,l,q,s,u,v,w,x,y,z
  65. +a,c,h,k,l,q,s,u,v,w,x,y,z
  66.  P,V,X
  67.  */
  68.  
  69. @@ -96,6 +96,7 @@
  70.     SPECATK_NONE = 0,
  71.     SPECATK_SUMMON,             // S
  72.     SPECATK_ENRAGE,             // E
  73. +   SPECATK_INFURIATE,          // e
  74.     SPECATK_RAMPAGE,            // R
  75.     SPECATK_AREA_RAMPAGE,       // r
  76.     SPECATK_FLURRY,             // F
  77. Index: trunk/EQEmuServer/zone/merc.cpp
  78. ===================================================================
  79. --- trunk/EQEmuServer/zone/merc.cpp (revision 2509)
  80. +++ trunk/EQEmuServer/zone/merc.cpp (working copy)
  81. @@ -1708,6 +1708,9 @@
  82.                 // Stop attacking if the target is enraged
  83.                 if(IsEngaged() && !BehindMob(GetTarget(), GetX(), GetY()) && GetTarget()->IsEnraged())
  84.                     return;
  85. +               // stop attacking if the target is infuriated
  86. +               if(IsEngaged() && GetTarget()->IsInfuriated())
  87. +                   return;
  88.                 //TODO: Implement Stances.
  89.                 /*if(GetBotStance() == BotStancePassive)
  90.                     return;*/
  91. Index: trunk/EQEmuServer/zone/mob.h
  92. ===================================================================
  93. --- trunk/EQEmuServer/zone/mob.h    (revision 2509)
  94. +++ trunk/EQEmuServer/zone/mob.h    (working copy)
  95. @@ -646,6 +646,7 @@
  96.      void StartEnrage();
  97.      void ProcessEnrage();
  98.      bool IsEnraged();
  99. +   bool IsInfuriated();
  100.      void Taunt(NPC* who, bool always_succeed,  float chance_bonus = 0);
  101.  
  102.      virtual void        AI_Init();
  103. @@ -916,6 +917,7 @@
  104.      char lastname[64];
  105.  
  106.      bool bEnraged;
  107. +   bool bInfuriated;
  108.      Timer *SpecAttackTimers[SPECATK_MAXNUM];
  109.      bool destructibleobject;
  110.  
  111. Index: trunk/EQEmuServer/zone/MobAI.cpp
  112. ===================================================================
  113. --- trunk/EQEmuServer/zone/MobAI.cpp    (revision 2509)
  114. +++ trunk/EQEmuServer/zone/MobAI.cpp    (working copy)
  115. @@ -1854,12 +1854,12 @@
  116.  void Mob::StartEnrage()
  117.  {
  118.      // dont continue if already enraged
  119. -    if (bEnraged)
  120. +    if (bEnraged || bInfuriated)
  121.          return;
  122.      if (SpecAttackTimers[SPECATK_ENRAGE] && !SpecAttackTimers[SPECATK_ENRAGE]->Check())
  123.          return;
  124.      // see if NPC has possibility to enrage
  125. -    if (!SpecAttacks[SPECATK_ENRAGE])
  126. +    if (!SpecAttacks[SPECATK_ENRAGE] && !SpecAttacks[SPECATK_INFURIATE])
  127.          return;
  128.      // check if timer exists (should be true at all times)
  129.      if (SpecAttackTimers[SPECATK_ENRAGE])
  130. @@ -1874,16 +1874,25 @@
  131.      }
  132.      // start the timer. need to call IsEnraged frequently since we dont have callback timers :-/
  133.      SpecAttackTimers[SPECATK_ENRAGE]->Start();
  134. -    bEnraged = true;
  135. -   entity_list.MessageClose_StringID(this, true, 200, MT_NPCEnrage, NPC_ENRAGE_START, GetCleanName());
  136. +   if (SpecAttacks[SPECATK_ENRAGE]) {
  137. +       bEnraged = true;
  138. +       entity_list.MessageClose_StringID(this, true, 200, MT_NPCEnrage, NPC_ENRAGE_START, GetCleanName());
  139. +   } else if (SpecAttacks[SPECATK_INFURIATE]) {
  140. +       bInfuriated = true;
  141. +       entity_list.MessageClose(this, true, 200, MT_NPCEnrage, "%1 is infuriated.", GetCleanName());
  142. +   }
  143.  }
  144.  
  145.  void Mob::ProcessEnrage(){
  146. -   if(IsEnraged()){
  147. +   if(IsEnraged() || IsInfuriated()){
  148.         if(SpecAttackTimers[SPECATK_ENRAGE] && SpecAttackTimers[SPECATK_ENRAGE]->Check()){
  149. -           entity_list.MessageClose_StringID(this, true, 200, MT_NPCEnrage, NPC_ENRAGE_END, GetCleanName());
  150.             SpecAttackTimers[SPECATK_ENRAGE]->Start(EnragedTimer);
  151. -           bEnraged = false;
  152. +           if(IsEnraged()) {
  153. +               entity_list.MessageClose_StringID(this, true, 200, MT_NPCEnrage, NPC_ENRAGE_END, GetCleanName());
  154. +               bEnraged = false;
  155. +           } else if(IsInfuriated()) {
  156. +               entity_list.MessageClose(this, true, 200, MT_NPCEnrage,"%1 is no longer infuriated.", GetCleanName());
  157. +               bInfuriated = false;            }
  158.         }
  159.     }
  160.  }
  161. @@ -1893,6 +1902,11 @@
  162.      return bEnraged;
  163.  }
  164.  
  165. +bool Mob::IsInfuriated()
  166. +{
  167. +    return bInfuriated;
  168. +}
  169. +
  170.  bool Mob::Flurry()
  171.  {
  172.      // this is wrong, flurry is extra attacks on the current target
  173. Index: trunk/EQEmuServer/zone/npc.cpp
  174. ===================================================================
  175. --- trunk/EQEmuServer/zone/npc.cpp  (revision 2509)
  176. +++ trunk/EQEmuServer/zone/npc.cpp  (working copy)
  177. @@ -1443,6 +1443,9 @@
  178.             case 'E':
  179.                 SpecAttacks[SPECATK_ENRAGE] = (remove ? false : true);
  180.                 break;
  181. +           case 'e':
  182. +               SpecAttacks[SPECATK_INFURIATE] = (remove ? false : true);
  183. +               break;
  184.             case 'F':
  185.                 SpecAttacks[SPECATK_FLURRY] = (remove ? false : true);
  186.                 break;
  187. @@ -1588,6 +1591,10 @@
  188.                 if (!SpecAttacks[SPECATK_ENRAGE])
  189.                     HasAllAttacks = false;
  190.                 break;
  191. +           case 'e':
  192. +               if (!SpecAttacks[SPECATK_INFURIATE])
  193. +                   HasAllAttacks = false;
  194. +               break;
  195.             case 'F':
  196.                 if (!SpecAttacks[SPECATK_FLURRY])
  197.                     HasAllAttacks = false;
  198. Index: trunk/EQEmuServer/zone/perl_mob.cpp
  199. ===================================================================
  200. --- trunk/EQEmuServer/zone/perl_mob.cpp (revision 2509)
  201. +++ trunk/EQEmuServer/zone/perl_mob.cpp (working copy)
  202. @@ -4986,6 +4986,32 @@
  203.     XSRETURN(1);
  204.  }
  205.  
  206. +XS(XS_Mob_IsInfuriated); /* prototype to pass -Wmissing-prototypes */
  207. +XS(XS_Mob_IsInfuriated)
  208. +{
  209. +   dXSARGS;
  210. +   if (items != 1)
  211. +       Perl_croak(aTHX_ "Usage: Mob::IsInfuriated(THIS)");
  212. +   {
  213. +       Mob *       THIS;
  214. +       bool        RETVAL;
  215. +
  216. +       if (sv_derived_from(ST(0), "Mob")) {
  217. +           IV tmp = SvIV((SV*)SvRV(ST(0)));
  218. +           THIS = INT2PTR(Mob *,tmp);
  219. +       }
  220. +       else
  221. +           Perl_croak(aTHX_ "THIS is not of type Mob");
  222. +       if(THIS == NULL)
  223. +           Perl_croak(aTHX_ "THIS is NULL, avoiding crash.");
  224. +
  225. +       RETVAL = THIS->IsInfuriated();
  226. +       ST(0) = boolSV(RETVAL);
  227. +       sv_2mortal(ST(0));
  228. +   }
  229. +   XSRETURN(1);
  230. +}
  231. +
  232.  XS(XS_Mob_GetReverseFactionCon); /* prototype to pass -Wmissing-prototypes */
  233.  XS(XS_Mob_GetReverseFactionCon)
  234.  {
  235. @@ -8243,6 +8269,7 @@
  236.         newXSproto(strcpy(buf, "IsStunned"), XS_Mob_IsStunned, file, "$");
  237.         newXSproto(strcpy(buf, "StartEnrage"), XS_Mob_StartEnrage, file, "$");
  238.         newXSproto(strcpy(buf, "IsEnraged"), XS_Mob_IsEnraged, file, "$");
  239. +       newXSproto(strcpy(buf, "IsInfuriated"), XS_Mob_IsInfuriated, file, "$");
  240.         newXSproto(strcpy(buf, "GetReverseFactionCon"), XS_Mob_GetReverseFactionCon, file, "$$");
  241.         newXSproto(strcpy(buf, "IsAIControlled"), XS_Mob_IsAIControlled, file, "$");
  242.         newXSproto(strcpy(buf, "GetAggroRange"), XS_Mob_GetAggroRange, file, "$");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement