Aller au contenu

Photo

AC on Level Up


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
Explodingrunes

Explodingrunes
  • Members
  • 24 messages
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?

#2
Fester Pot

Fester Pot
  • Members
  • 1 394 messages
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 .


#3
Explodingrunes

Explodingrunes
  • Members
  • 24 messages
Huh... Would that work for a persistent world?

#4
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
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