PenUltima Online Forum Index Official Core: 096.7
Official Core: 097 2008-02-26
Donate towards the POL web hosting bill!
 POL Home   FAQ   Search    Memberlist   Usergroups    Register    Profile   Log in to check your private messages   Log in
manavamp

 
Post new topic   Reply to topic    PenUltima Online Forum Index -> General Help (095)
Display posts from previous:   

Author Message
Dev Impy



Joined: 10 Aug 2006
Posts: 30

PostPosted: Tue Nov 21, 2006 10:28 pm    Post subject: manavamp Reply with quote

Problem with Manavamp. Every time a player uses magic arrow them mana vamp it crashes the (reciever of spells) client.


Manavamp.src
Code:
use uo;

include "include/spelldata";
include "include/attributes";
include "include/client";

const SPELL_EFFECT_TYPE_MOVING := MOVING_SPELL_MANA_VAMPIRE;
const SPELL_EFFECT_ID       := FX_SPELL_MANA_VAMPIRE;
const SPELL_EFFECT_SPEED    := SPEED_SPELL_MANA_VAMPIRE;
const SPELL_EFFECT_LOOP       := LOOP_SPELL_MANA_VAMPIRE;

program mana_drain ( parms )

   var circle := 7;
   var caster;
   var cast_on;
   var fromhit;

   if (parms[1] == "#MOB")
      caster := parms[2];
      cast_on := parms[3];
      if (parms[4])
         circle := parms[4];
      endif
      if (parms[5])
         fromhit := parms[5];
      endif

      send_attack(cast_on, caster, SPELLID_MANA_VAMPIRE);
   else
      caster := parms;
      cast_on := CanTargetSpell(caster, circle, TGTOPT_HARMFUL + TGTOPT_CHECK_LOS );
      if (!cast_on)
         return;
      endif
      if (AutoCallGuardCheck(caster, cast_on))
         return;
      endif
   endif

   if( !fromhit )
      Detach();
      cast_on := Reflected( caster, cast_on, circle );
   else
      PlayObjectCenteredEffect(cast_on,
                                         SPELL_EFFECT_ID,
                                         SPELL_EFFECT_SPEED,
                                         SPELL_EFFECT_LOOP);
   endif
   PlaySoundEffect( caster, SFX_SPELL_MANA_VAMPIRE );

   var immunity := IsProtected( caster, cast_on, circle );

   if( immunity == IMMUNED )
      return;
   endif

   var magery := ModifyWithMagicEfficiency( caster, GetEffectiveSkill( caster, SKILLID_MAGERY ) );
   var resist := GetEffectiveSkill( cast_on, SKILLID_MAGICRESISTANCE );

   if( immunity == CURSED )
      magery := magery * 2;
      resist := CInt(resist / 2);
   endif

   if( GetObjProperty( cast_on, CLASSEID_MAGE ) )
      resist := CInt( resist * CLASSE_BONUS );
   endif

   if( resist >= magery + 5 )
      PrintTextAbovePrivate( caster, cast_on.name + "'s will is too strong!", caster );
   else
      var amount := Resisted( caster, cast_on, circle, magery );
      if( amount > GetMana(cast_on) )
         amount := GetMana(cast_on);
      endif

      SetMana(cast_on, GetMana(cast_on) - amount);
      SetMana(caster, GetMana(caster) + amount);
      if( GetMana(caster) > GetMaxMana(caster) )
         SetMana(caster, caster.maxmana);
      endif

      PrintTextAbovePrivate( cast_on,
                   "You drained " + amount + " mana out of " + cast_on.name + "'s aura!",
                   caster );
   endif

endprogram


Any one know how i could stop this, or having the same sorta problems?

Post new topic   Reply to topic    PenUltima Online Forum Index -> General Help (095) All times are GMT - 4 Hours
Page 1 of 1

 




Powered by phpBB © 2001, 2005 phpBB Group :: Theme & Graphics by GHS & Scott E. Royalty