Aller au contenu

Photo

"EffectDamageResistance" question about it


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

#1
Epitaffio

Epitaffio
  • Members
  • 35 messages
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 :P

#2
Rubies

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

#3
Epitaffio

Epitaffio
  • Members
  • 35 messages
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);

#4
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
I think you want to add an iProp not an effect.

#5
Rubies

Rubies
  • Members
  • 292 messages
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 .


#6
Epitaffio

Epitaffio
  • Members
  • 35 messages
My fault.. bad bracket.



Thank you all, anyway!