Author Topic: is there a way to find + values of weapons?  (Read 308 times)

Legacy_lordofworms

  • Sr. Member
  • ****
  • Posts: 422
  • Karma: +0/-0
is there a way to find + values of weapons?
« on: April 13, 2011, 07:13:33 pm »


               I am writing a homebrew weapon damage system based on variables placed on creatures so that some creatures can damage weapons with acid, or flame, or just trauma due to high AC hides (admantium golems,etc) simply by setting a variable called 'DAMAGE_ACID,DAMAGE_FIRE,etc' to '1' on creature with resistance

its quick, efficient and handy for me, the only thing missing is I would like to modify it a little more and make percentages based on the + value of the weapon, so if its say a +5 weapon it would have less of a chance to break then a +2 or +1 weapon.
I can totally write the code if I knew how to find that value on an item

is there a function? or way to determine roughly what attack/dmage bonus is of an item?

I did a search on old and new forum but I guess I dont know how to 'word' it so I end up with no results found.


Thanks!!!!
               
               

               
            

Legacy_lordofworms

  • Sr. Member
  • ****
  • Posts: 422
  • Karma: +0/-0
is there a way to find + values of weapons?
« Reply #1 on: April 13, 2011, 07:27:01 pm »


               Ok, no sooner do I post this that I try a google search and voila!
thanks to our good friend mr. lightfoot.


//////////////////////////////////
//code by Lightfoot///////
/////////////////////////////////

int GetItemAttackBonus(object oItem)
{
  itemproperty  ipSearch=GetFirstItemProperty(oItem);
  while (GetIsItemPropertyValid(ipSearch)== TRUE)
  {
     if(GetItemPropertyType(ipSearch)==ITEM_PROPERTY_ATTACK_BONUS)
     {
       return  GetItemPropertyCostTableValue(ipSearch);
     }
     ipSearch=GetNextItemProperty(oItem);
  }
  return 0;
}
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
is there a way to find + values of weapons?
« Reply #2 on: April 13, 2011, 07:38:28 pm »


               IPGetWeaponEnhancementBonus
               
               

               
            

Legacy_lordofworms

  • Sr. Member
  • ****
  • Posts: 422
  • Karma: +0/-0
is there a way to find + values of weapons?
« Reply #3 on: April 14, 2011, 12:23:27 pm »


               once again...you have made life easier for me.