Author Topic: AC on Level Up  (Read 459 times)

Legacy_Explodingrunes

  • Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
AC on Level Up
« on: December 16, 2010, 09:09:18 pm »


               I am considering modifying how armor works in my module, and part of what I have in mind is to have different classes gain AC at different rates (alternating between dodge and natural AC). Does anyone have an idea how this could be accomplished?
               
               

               
            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
AC on Level Up
« Reply #1 on: December 16, 2010, 09:30:05 pm »


               Something perhaps along these lines?

#include "x2_inc_switches"
#include "x2_inc_intweapon"

void ApplyArmorEffects(object oPC)
  {
    effect eInvis
       // Do not apply if already there:
       effect eScan = GetFirstEffect(oPC);

       while (GetIsEffectValid(eScan))
      {
           if (GetEffectCreator(eScan) == OBJECT_SELF) //return;  do not stop the script, but remove the old effects
        RemoveEffect(oPC, eScan);
           eScan = GetNextEffect(oPC);
         }

  if ( (GetHitDice(oPC) == 1) )
  {
     // Add a check for specific character class here as well
     // Change AC bonus here
           eInvis = SupernaturalEffect (EffectACIncrease (1, DAMAGE_TYPE_MAGICAL));

        }

  ApplyEffectToObject (DURATION_TYPE_PERMANENT, eInvis, oPC);

}

void main()
  {
  object oPC   = GetPCLevelingUp();
  object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oPC);

  AssignCommand(oItem, ApplyArmorEffects(oPC));

  }


You'll want to work on it of course but that's a general idea and option for OnLevelUp.

FP!
               
               

               


                     Modifié par Fester Pot, 16 décembre 2010 - 09:33 .
                     
                  


            

Legacy_Explodingrunes

  • Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
AC on Level Up
« Reply #2 on: December 16, 2010, 09:49:07 pm »


               Huh... Would that work for a persistent world?
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
AC on Level Up
« Reply #3 on: December 16, 2010, 10:05:16 pm »


               You need something that applies the effect/s when they log in, and again after they're raised from the dead, in order to make it 'permanent' on a PW. Otherwise, yes.



Funky