Author Topic: "EffectDamageResistance" question about it  (Read 851 times)

Legacy_Epitaffio

  • Jr. Member
  • **
  • Posts: 70
  • Karma: +0/-0
"EffectDamageResistance" question about it
« on: September 20, 2010, 03:14:28 pm »


               Hi, i have a problem with this function. What i want to do is to create a system that reduce the damaged inflicted to a pc by the armor material.

I've had made a basic system based on the tag and activated by the onEquip event but i don't know how to make this effect to work, this is a snippet of my code:


        if(iArmorResTagl > 0){
            effect eArmorTagl = EffectDamageResistance(DAMAGE_TYPE_SLASHING, iArmorResTagl);
            ApplyEffectToObject(DURATION_TYPE_PERMANENT, eArmorTagl, oPc);
        }

        if(iArmorResCont > 0){
            effect eArmorCont = EffectDamageResistance(DAMAGE_TYPE_BLUDGEONING, iArmorResCont);
            ApplyEffectToObject(DURATION_TYPE_PERMANENT, eArmorCont, oPc);
        }

        if(iArmorResPerf > 0){
            effect eArmorPerf = EffectDamageResistance(DAMAGE_TYPE_PIERCING, iArmorResPerf);
            ApplyEffectToObject(DURATION_TYPE_PERMANENT, eArmorPerf, oPc);
        }

The EffectDamageResistance seems not to work because, just trying to combine the effect (though they are 3 different type of damage).

Any hint?


inb4: sorry for bad english '<img'>
               
               

               
            

Legacy_Rubies

  • Hero Member
  • *****
  • Posts: 508
  • Karma: +0/-0
"EffectDamageResistance" question about it
« Reply #1 on: September 20, 2010, 04:48:05 pm »


               You'll need to paste a larger chunk of your code than that. That code doesnt really tell anyone anything.
               
               

               
            

Legacy_Epitaffio

  • Jr. Member
  • **
  • Posts: 70
  • Karma: +0/-0
"EffectDamageResistance" question about it
« Reply #2 on: September 20, 2010, 05:23:55 pm »


               Hum, for clarify:..



Is there a right way to do this?



effect eArmorTagl = EffectDamageResistance(DAMAGE_TYPE_SLASHING, 5);

ApplyEffectToObject(DURATION_TYPE_PERMANENT, eArmorTagl, oPc);



effect eArmorCont = EffectDamageResistance(DAMAGE_TYPE_BLUDGEONING, 10);

ApplyEffectToObject(DURATION_TYPE_PERMANENT, eArmorCont, oPc);



effect eArmorPerf = EffectDamageResistance(DAMAGE_TYPE_PIERCING, 15);

ApplyEffectToObject(DURATION_TYPE_PERMANENT, eArmorPerf, oPc);
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
"EffectDamageResistance" question about it
« Reply #3 on: September 20, 2010, 06:09:25 pm »


               I think you want to add an iProp not an effect.
               
               

               
            

Legacy_Rubies

  • Hero Member
  • *****
  • Posts: 508
  • Karma: +0/-0
"EffectDamageResistance" question about it
« Reply #4 on: September 20, 2010, 06:32:17 pm »


               

int nPiercing = 10;
effect ePiercing = EffectDamageResistance(DAMAGE_TYPE_PIERCING, nPiercing, 0);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, ePiercing, oPC);

int nBludgeoning = 10;
effect eBludgeoning = EffectDamageResistance(DAMAGE_TYPE_BLUDGEONING, nPiercing, 0);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBludgeoning, oPC);

int nSlashing = 10;
effect eSlashing = EffectDamageResistance(DAMAGE_TYPE_SLASHING, nPiercing, 0);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSlashing, oPC);

Looks about the same to yours. I think your problem lies with how you're getting the numbers in the first place, but you haven't pasted the code for it, so I can't be sure.
               
               

               


                     Modifié par Rubies, 20 septembre 2010 - 05:33 .
                     
                  


            

Legacy_Epitaffio

  • Jr. Member
  • **
  • Posts: 70
  • Karma: +0/-0
"EffectDamageResistance" question about it
« Reply #5 on: September 21, 2010, 10:19:03 am »


               My fault.. bad bracket.



Thank you all, anyway!