Ryzen

Citizen
ServUO Version
Publish Unknown
Ultima Expansion
None
I'd like to set a vendor price of magery scrolls based on SpellCircle.

Scripts\VendorInfo\SBMage.cs (row 69, master branch)
Add(new GenericBuyInfo(types[i], 12 + ((i / 8) * 10), 20, itemID, 0, true));

after this line before, i than add this one
Item itemScroll = new Item(itemID); if( itemScroll is SpellScroll) { }

but it always skip this condition: what i wrong? Thanks
 

Juzzver

Rookie
I'd like to set a vendor price of magery scrolls based on SpellCircle.

Scripts\VendorInfo\SBMage.cs (row 69, master branch)
Add(new GenericBuyInfo(types[i], 12 + ((i / 8) * 10), 20, itemID, 0, true));

after this line before, i than add this one
Item itemScroll = new Item(itemID); if( itemScroll is SpellScroll) { }

but it always skip this condition: what i wrong? Thanks
You've tried to create just an Item which won't have any relation with SpellScroll, so your condition can never be performed.
if you want to add all spells, you need just increase "circle" variable from 3 to 8.
int circles = 3; for (int i = 0; i < circles * 8 && i < types.Length; ++i) { int itemID = 0x1F2E + i; if (i == 6) itemID = 0x1F2D; else if (i > 6) --itemID; Add(new GenericBuyInfo(types[i], 12 + ((i / 8) * 10), 20, itemID, 0, true)); }
If you want to change price, you can correct this formula: 12 + ((i / 8) * 10), where i = circle.
If you want to add special price per special scroll you can define it by:
if (types[i] == typeof(EarthquakeScroll)) Add(new GenericBuyInfo(types[i], 500000, 20, itemID, 0, true)); else if (types[i] == typeof(MeteorSwarmScroll)) Add(new GenericBuyInfo(types[i], 7777777, 20, itemID, 0, true)); else Add(new GenericBuyInfo(types[i], 12 + ((i / 8) * 10), 20, itemID, 0, true));