Please read EDITS at the bottom when your done reading the tutorial.
(you must know how to edit table files)
First, open misc.txt. Find the thawing potion(row #10) and copy it.
Paste it at the bottom of the file. Re-name it to Fire Resist potion (or whatever you like, but this tutorial is for a fire resistance potion) Change the code to frp and namestr to frp.
Then scroll over until you hit the "State" column, and change that to "potion_fire_res" Remove the entries for cstate1 and cstate2, in the Len column, you must specify a length in frames that the effect will last, or the potion will not work. (I believe it will just stay in your inventory, unused and will not apply the effect)
For Stat1 change it to "fireresist" the number beside it controls how much to add to your fire resistance. in Stat2, is another effect the potion can have, change it to "maxfireresist" and enter a number beside that. Then in the spelldesc column, put 1, and in spelldescstr, input the string you'll use in the table file (I put PotionFireRes) and close misc.txt
Now open states.txt, Create a new column, and in the state field, put "potion_fire_res" and change the ID to the next number in the list. Scroll over to "rfblue" and enter 1, this will make it so when the potion is used, and for the duration of it, the resist fire field in your character stat panel in-game will be blue.
Now, scroll over to the Stat column, and input "fireresist". And finally in the eol column, put 0 (to prevent the trailing bits error for ms excel users).
Now you have a potion that will add however much fire resistance you want, and increase your maximum fire resistance for a temporary duration.
But we still have to add our entries into patchstring.tbl
So using whatever table editor you like (for this I'm using darkstorms)
open patchstring.tbl and add the entry "frp" and for the text enter "Fire Resistance Potion".
Create another new entry called "PotionFireRes" and enter in this order, from top to bottom and in new rows: "+X% to Maximum Fire Resistance", "+Y% to Fire Resistance"
(where X is the number you entered for maximum fire resistance, and Y is the number you entered for the addition to fireresistance)
Now the item will work in the game, but it has no visual flare, or representation, but that is no good. this part is Entierly optional, but will make the effect look better.
Back in states.txt scroll over to "overlay1" and enter "aura_resistfire", now scroll over to "Castoverlay" and enter "fire_cast_2". now finally scroll over to "onsound" and enter "paladin_aura_resistfire".
Now when you drink the potion, you'll get a Very nice effect.
But a warning, if you drink 2 of the exact same potions, it will stop the effect (eg/ drink the fire res potion, then drink another and the it will stop the effect)
Now, since you cloned the thawing potion, these will still be sold by any vendor that will sell thawing potions, and for 25 gold only. So you will have to change that on your own.
You can create any type of potion you want using modifiers from itemstatcosts.txt. (although some may not work, but I have not tested any that do not work)
ALSO, it is good to have a visual for any stat you are changing, that is in no way visible (eg/ dmg resistance, magic find, gold find, +% experience)
EDIT: Made it easier to read by seperating some lines.
EDIT: info from kingping an jugalator
And from jugalator, you MUST create a state for the potion to work aparently.kingpin" wrote: pSpell 9 = Used by stamina potion/Herbs
pSpell 8 = Used by Elixir potion that Adds Experience (All potions that needed to add stats to a player should use pSpell 8)
pSpell 7 = Used by Horadic Cube
pSpell 6 = Used by Thawing Potion
pSpell 5 = Used by Rejuvenation potion/Full rejuvenate potion
pSpell 4 = Not used
pSpell 3 = Used by Health/Mana potions
pSpell 2 = Used by Book of Townportal/Townportal scroll
pSpell 1 = Used by Book of Identify/Scroll of Identify
Edit (JBouley): Disabled smilies to prevent a "cool" smilie where a parenthesis followed the number 8.