Author Topic: Lifesteal, Script attach to specefic item  (Read 390 times)

Legacy_KiKurA

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
Lifesteal, Script attach to specefic item
« on: April 04, 2011, 07:44:48 pm »


               i'm BRANDNEW to nwn forums and all this jazz '<img'>

okey, as you can see in topic i'm not satisfied with the nwn vampiric regen offer us '<img'>, how
can i, firstly i guess, get this script to work, and then put it on
specefic weapons

void main()
{
  int DamageHeal = (int GetDamageDealtByType(DAMAGE_TYPE_BASE_WERAPON) / 20 * 1);
  string Output =  ("You stole "+IntToString(DamageHeal)+" life.");
  if (DamageHeal > 0)
  {
    EffectDamage(DamageHeal,DAMAGE_TYPE_BASE_WERAPON,DAMAGE_POWER_PLUS_FIFTEEN);
    EffectHeal(DamageHeal);
    //Console.WriteLine(Output)... something that will give feedback in combat log of what happened '<img'> ?
  }
}
               
               

               


                     Modifié par KiKurA, 04 avril 2011 - 07:05 .
                     
                  


            

Legacy_KiKurA

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
Lifesteal, Script attach to specefic item
« Reply #1 on: April 04, 2011, 07:58:00 pm »


               with the attach to specefic item i mean, can i somehow "put the script in a item" export one file and mail it to someone that can put it in a quest or something on the server i play on xD lol
               
               

               
            

Legacy_ehye_khandee

  • Hero Member
  • *****
  • Posts: 1415
  • Karma: +0/-0
Lifesteal, Script attach to specefic item
« Reply #2 on: April 04, 2011, 08:06:06 pm »


               In my humble opinion, you would be best to modify the default on_damaged script you use, and have it check to see if the damaging weapon has the life stealing property, if so, then run your code to heal the weapon wielder the same amount of damage. iirc that is how dnd treats vampiric regen. Send me a PM if you'd like me to follow up with some code examples.

Be well. Game on.
GM_ODA
               
               

               
            

Legacy_KiKurA

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
Lifesteal, Script attach to specefic item
« Reply #3 on: April 04, 2011, 09:07:17 pm »


               the nwn toolset only have +1,2,3,4.5  vampiric regen, not percentages of the actual damage dealt xD heh heh