Aller au contenu

Photo

something unpleasant


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

#1
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
i have this code that handles the attack impact event via a redirection from the original script.
 case EVENT_TYPE_ATTACK_IMPACT:
        {
            object oAttacker = GetEventObject(ev, 0);
            object oTarget = GetEventObject(ev, 1);
            int     nHitResult = GetEventInteger(ev, 0);
            int     nEffectId = GetEventInteger(ev,1);
            effect  eImpactEffect = GetAttackImpactDamageEffect(oAttacker,nEffectId);
            if(oAttacker == GetHero())
            {
            float fDistance = GetDistanceBetween(GetHero(), oTarget);
           
            if(fDistance > 3.0)
             {
              nHitResult = FALSE;
             }
           
            if(Combat_GetFlankingBonus(oAttacker, oTarget) > 0.0)
            { 
             if(GetTag(oTarget) == "gale_inquisitor")
               {
                Effects_ApplyInstantEffectDamage(GetObjectByTag("gale_inquisitor"), oAttacker, 20.0);
           
                }
             }

i haven't come up with any other approach to solving these problems but i don't like that this everytime something is hit all of these checks will have to be done even though they are only relevant to one encounter. is there some other way of doing the same thing but not as redudant?

#2
TimelordDC

TimelordDC
  • Members
  • 923 messages
Set a variable before the encounter and redirect the event only if the variable is set?

#3
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
i've done the redirection via eventmanager. in this case it would be done through scripting?