kaansoral / adventureland

Adventure Land The Open Source CODE MMORPG
Other
199 stars 62 forks source link

Destat NPC #119

Open FreezePhoenix opened 8 months ago

FreezePhoenix commented 8 months ago

This pull request adds an NPC to Desertland that allows players to remove the stat modifier from an item that has had one applied via scrolls. This process only works on items that have a stat applied to them, i.e. item.stat_type != null.

The number of scrolls returned is equivalent to the number of scrolls that would be required to apply the stat to the item if it were at level 0. For example, if Wanderer's Breeches (common at +0) were upgraded to level 7 (they are High grade at +7), and then Intelligence scrolls were used to apply Intelligence to the item (10 scrolls would be required), and then the item were brought to this NPC, the NPC would return only 1 Intelligence scroll.

Additionally, the cost scales with the number of scrolls that would be returned - it is 10 times the value of G.items[scrollname].g times the quantity of scrolls returned. For our example with Wanderer's Breeches +7, it would cost 8,000 gold (at the time of writing, prices may change for rarer scrolls).

As a precaution, the NPC cannot return scrolls for which there exist no scroll definition: Suppose that an item somehow had "charisma", then the NPC would not return an invalid "charismascroll" item.

The NPC can be found in Desertland, near the purple Scorpion spawn.