Page 1 of 1

making a +5 jewel

Posted: Thu Feb 15, 2007 5:43 pm
by Damo307
How would i make a +5 str / +5 Mana / +5 Stam jewel? so when you equip you get +5 to that status depending on the jewel, and when you take then off, your status gose back to what it is.. ?

Posted: Thu Feb 15, 2007 9:22 pm
by mr bubbles
You'll do that in the items equip and unequip scripts.
In the items itemdesc.cfg both scripts are delcared something like this.

equipscript ::equip
unequipscript ::unequip

And from there its straight forward.

Posted: Fri Feb 16, 2007 4:59 am
by StrelOK
The script on destruction is still necessary, and that at destruction of a subject statuses will remain as at the dressed thing

Posted: Fri Feb 16, 2007 5:00 am
by Damo307
i did what you said, but what do i type to make it add not take? like i seen on the Platemail Ar it has '[quote][i]DexPenalty 2[/i][/quote]' , how would i change it say it'll add insted ?

Posted: Fri Feb 16, 2007 12:43 pm
by mr bubbles
As far as i know the "DexPenalty" prop is a built in one? You can try using a negative number.

Otherwise add a prop to the item such as "dex" and in the equip make it look for the prop and if found alter the chars dex. And of course do the same in the unequip script.

And you will want to use the SetAttributeTemporaryMod function.

Posted: Fri Feb 16, 2007 2:17 pm
by Yukiko
First question one who wishes to help you should ask is "What version of scripts are you using?"

The reason this must be asked is that the POL 0.97 Distro has different function calls for stat mods than does virtually any other scriptbase out there.

In POL 0.95 Distro based shards look into the attributes.inc located in \pol\scripts\include file for stat mod functions. In POL 0.97 look in stats.inc located in \pol\pkg\systems\attributes\include.

Posted: Sun Feb 18, 2007 4:22 am
by Damo307
im using pol 95, i got the Dex jewel working, but when i come to do the Str/hits or Int/mana , i can't get it to work, i dunno what to do..

Posted: Mon Feb 19, 2007 8:10 pm
by Yukiko
Next thing is to post the code here so we can see what it's doing.

Posted: Tue Feb 20, 2007 4:54 am
by Damo307
what i ment was like it has "DexPenalty" and to make it Add Str or Int insted, i don't know what to put insted of dex =(

-------------------------------------
Armor 0x21
{
Name dexjewel
desc Dex Jewel
Graphic 4230
Color 1996
Coverage Hands
VendorSellsFor 122
VendorBuysFor 61
MaxHP 60
strrequired 30
repairable 1
medloss nomed
DexPenalty -10
equipscript equip
unequipscript unequip
controlscript itemControl
destroyscript destroy
}

Posted: Tue Feb 20, 2007 12:14 pm
by tekproxy
You say you want 3 different types of jewels/rings that give bonuses to stats, right? I believe mr bubbles mentioned the easiest way to do this--use equip and unequip scripts.


I suggest making an equip and unequip script that could be used for all magic items that modify stats, instead of having one script for dex jewel, one script for str jewel, etc... What if you wanted to modify stamina, int, health, regen, etc. You'd have a lot of scripts. This is a good example of how great cprops are.

In the configuration for your item, add two lines something like:

Code: Select all

CProp MagicMod s3:str
CProp MagicModVal i50
When you set a cprop in a config file you have to do it in packed form. The s3 means 3 character string, and the i before 50 tells POL it's an integer of 50. You have to do this so POL knows if it's a string, array, integer, etc... If you're setting a cprop in script you don't have to worry about it.

In the equip script, you would do something like this:

Code: Select all

// Get the mod type, in this example, it's "str"
var mod := GetObjProperty(item, "MagicMod");

// Only do this if we find a mod property
if ( mod != error )
  // If CInt() gets a non integer, it converts it to 0
  var modVal = CInt(GetObjProperty(item, "MagicModVal));

  // Only do this if we find a mod value property and it's > 0
  if ( modVal != error && modVal > 0 )
    // Modify the attribute temporary mod depending on the MagicMod
    // This is where you would add other mod types, like "int", "dex", etc
    // Note: Modifications are made in tenths, so altering by 50 tenths = 5.0
    case ( modVal )
      "str": AlterAttributeTemporaryMod(character, "Strength", modVal );
             break;

    endcase
  endif
endif

This might not be the best way, and I invite anyone else to suggest one if they know of one. This code is also off the top of my head so it may not compile.

By the by, do you mean "Damo" as in "Da Mo"?