Author Topic: any way to make it so Use Magic Device (UMD) is limited?  (Read 369 times)

Legacy_zero-feeling

  • Sr. Member
  • ****
  • Posts: 287
  • Karma: +0/-0
any way to make it so Use Magic Device (UMD) is limited?
« on: August 05, 2014, 07:24:32 am »


               

so basicly it's like this:


 


rogues can use anything... that dosn't work for me.


i only want rogues to be able to use magical items... not any and all items that are set to class restrictions.


 


so a rogue would not be able to use a cloak with properties set for Use Class Limitation Bard.. or some junk.. can't remember how it's worded.


 


BUT... a rogue could use this item if it was "magical"... like when you create the item and hit that little check option... yeah... you know the one..


 


so... can it be done?


 


can someone give me the needed scripts or a DETAILED instruction of how to do it myself?


 


thanks



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
any way to make it so Use Magic Device (UMD) is limited?
« Reply #1 on: August 05, 2014, 07:32:50 am »


               

There is a problem, there is no flag that makes item magical by itself, that opton you get in toolset has no impact on anything - it does nothing. Whether item is magical or not could be determined by scripting however usually that checks for any positive property which meets almost every item.


 


So you need to decide how you can clasify item as magical, then the solution is to (force) unequip the item when attempted to equip without correct class. Easy to do.



               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
any way to make it so Use Magic Device (UMD) is limited?
« Reply #2 on: August 05, 2014, 08:15:20 am »


               

^



               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
any way to make it so Use Magic Device (UMD) is limited?
« Reply #3 on: August 05, 2014, 02:59:54 pm »


               

If the non-magical items are merely decoration, used for the sake of granting the character a specific parts based appearance, then you could make them plot and set the item value (which is not spent when buying/selling plot items) so high that it is beyond the possibility to UMD.



               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
any way to make it so Use Magic Device (UMD) is limited?
« Reply #4 on: August 07, 2014, 03:13:54 am »


               

I assume you are talking via (or adding it to) the onequip event script? Got a snipet of code that can do this you wouldn't mind sharing for this purpose?


               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
any way to make it so Use Magic Device (UMD) is limited?
« Reply #5 on: August 07, 2014, 04:33:33 am »


               

Shadooow is talking about the OnEquip script.  I am talking about 2da editing to go over 9000000 gold value to prevent the item from ever being able to be equipped by UMD.



               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
any way to make it so Use Magic Device (UMD) is limited?
« Reply #6 on: August 07, 2014, 06:04:34 am »


               


I assume you are talking via (or adding it to) the onequip event script? Got a snipet of code that can do this you wouldn't mind sharing for this purpose?




 


Uh, this is a segment of code in an older module that I was using for some special armor that required a certain amount of dexterity to use.  Should give you the gist of the idea.  Might need a ClearAllActions call to be safer, don't recall, never wound up testing it extensively.



// -------------------------------------------------------------------------
// Shadowwalker Armor code
// Gives higher AC but requires a certain amount of base dexterity
// Base dexterity modifier must be equal to (total AC value/2) -1
// -------------------------------------------------------------------------

string sArmor = GetTag(oItem);

if (GetStringLeft(sArmor, 9) == "arm_pa_sw" || GetStringLeft(sArmor, 9) == "arm_la_sw" || GetStringLeft(sArmor, 9) == "arm_sl_sw")
{
    int nDex = ((GetAbilityScore(oPC, ABILITY_DEXTERITY, TRUE))-10)/2;
    int nAC = GetItemACValue(oItem);
    if (nDex < ((nAC/2) + 1))
    {
        AssignCommand(oPC, ActionUnequipItem(oItem));
        FloatingTextStringOnCreature("You are not able to make proper use of of this armor.", oPC, FALSE);
    }
 }


               
               

               
            

Legacy_zero-feeling

  • Sr. Member
  • ****
  • Posts: 287
  • Karma: +0/-0
any way to make it so Use Magic Device (UMD) is limited?
« Reply #7 on: August 09, 2014, 07:51:43 am »


               

thanks MM.. i'll try and use this... prolly end up asking for help again, but i'll at least give it a go =D


 


@ lazarus ... dem some big @$$ glasses dude...



               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
any way to make it so Use Magic Device (UMD) is limited?
« Reply #8 on: August 12, 2014, 05:28:14 am »


               

Thanks MM. Our world isn't looking into this directly, but thought an example script should be posted for those that are interested.


 


And yes Zero, they are. And if you are really perceptive you might notice they don't have any handles (or ear holders or whatever you call them...) either o_O.