[RELZ] Mercantile leveling - FIXED

Post » Sat Sep 27, 2014 6:42 pm

By studying the OBSE functions my comrade figured out a way to calculate the increasing of the mercantile skill for EVERY item which was sold.

Normally the Oblivion engine only counts the first item (or only every transaction if you want).

With the normal skill use increment of 0.4 the player has to do around 25k transactions until he reaches level 100 which is a bit frustrating.

Now he only have to sell 25k items since even multiple items are correctly awared with the right amount of skill exp.

Spoiler
scn 00MercantileFIXEDquestSCRIPTfloat fquestdelaytimefloat OldGoldCountfloat SkillXPBarshort OldSkillLevelshort ConversationCheckBegin GameMode    set fquestdelaytime to 1.5    if ConversationCheck        set ConversationCheck to 0    endifEndBegin MenuModeset fquestdelaytime to 0.01If (Menumode 1009 == 1)    Set ConversationCheck to 1    Set OldGoldCount to player.getgold    Set OldSkillLevel to Player.GetBaseAV Mercantile    returnelseif (ConversationCheck == 1 && MenuMode 1008 == 1)else    returnendifIf (player.GetGold > OldGoldCount) && Player.GetBaseAV Mercantile < 100    if GetLastTransactionQuantity > 1 ;=> This OBSE function will hold the exact amount of sold items from the last transaction. 1 Item is just a normal transaction.        Set OldGoldCount to GetSkillUseIncrement Mercantile 0 * (GetLastTransactionQuantity - 1) ;=> Calculating the new skill experience.        ModPlayerSkillExp Mercantile OldGoldCount ;=> Increases the skill through the skill xp. Unfortunately this doesn't count as regular increase.'        if OldSkillLevel < 100 && Player.GetBaseAV Mercantile >= 100            if Player.GetBaseAV Mercantile > 100 ;=> Selling many items at once can get the player from 99 to 101 so there is some security system needed.                Player.SetAV Mercantile 100            endif            Set OldGoldCount to Player.GetBaseAV Mercantile - OldSkillLevel            ModPCMiscStat 2 OldGoldCount ;=> "AdvancePCSkill" doesn't increment the skill increase misc stat so it has to be done by script.'            Player.SetAV Mercantile OldSkillLevel ;=> The skill level is set back to the old one since increasing the skill experience doesn't count as regular skill increase.'            Player.AdvancePCSkill Mercantile OldGoldCount ;=>"AdvancePCSkill" increases the skill in a regular way by the specified amount but also clears any skill xp.        elseif OldSkillLevel < Player.GetBaseAV Mercantile            Set OldGoldCount to Player.GetBaseAV Mercantile - OldSkillLevel            ModPCMiscStat 2 OldGoldCount            Set SkillXPBar to GetPlayerSkillUse Mercantile            Player.SetAV Mercantile OldSkillLevel            Player.AdvancePCSkill Mercantile OldGoldCount            ModPlayerSkillExp Mercantile SkillXPBar ;=> The player get his skill experience back after the regular increasemant.        endif    endifendifSet OldGoldCount to player.getgoldSet OldSkillLevel to Player.GetBaseAV MercantileEnd

It's just a simple quest script but it does the job :D

Feel free to use the code in any mod you want.

http://www.nexusmods.com/oblivion/mods/45558/?

User avatar
luis dejesus
 
Posts: 3451
Joined: Sun Aug 19, 2007 7:40 am

Return to IV - Oblivion