Item Option System Demo NPC

Protos

Core Developers
Messages
236
Points
0
Age
35
IRC Nickname
smoke
Github
smokexyz
Emulator
So with the release of Item Options System I had created a demo NPC with a small number of options to test the system out or be used as a full fledged NPC.

Configuration

/**
* General Configuration
*/
/* Chance of the enhancement process to fail. (0 - 99 in percent) */
.chance_of_failure = 10;
/* Delete the item on failure? (true/false) */
.delete_on_failure = true;
/* Required amount of zeny for a try. */
.zeny_requirement = 100;
/* Minimum amount of the bonus value.
* For negative effects or certain bonuses that require negative values
* Maximum possible value is -INT16_MAX)
*/
.minimum_bonus_amount = -100; // usually used with delay bonus options, although not provided in the script.
/* Maximum amount of the bonus value.
* Maximum possible value is INT16_MAX */
.maximum_bonus_amount = 100;
/* Disable selection of bonus value (true/false) */
.enable_random_bonus = false;

/* Item Option Descriptions */
setarray(.options$[0], "Max HP", "Max SP", "STR", "AGI", "VIT", "INT", "DEX", "LUK");
/* Item Option Constants */
setarray(.option_constants[0], VAR_MAXHPAMOUNT, VAR_MAXSPAMOUNT, VAR_STRAMOUNT, VAR_AGIAMOUNT, VAR_VITAMOUNT, VAR_INTAMOUNT, VAR_DEXAMOUNT, VAR_LUKAMOUNT);
end;


File v1.0

item_options.txt 

Let me know what you think!

Enjoy~!
default_smile.png


 

Attachments

The method call for setequipoption has his variables inverted.

setequipoption(.@equip_index, .@option_slot, .option_constants[.@option_variable - 1], .@value);
should be

Code:
setequipoption(.@equip_index, .option_constants[.@option_variable - 1], .@option_slot, .@value);
 
setequipoption(.@equip_index, .@option_slot, .option_constants[.@option_variable - 1], .@value);

is correct, Hercules has been updated.

 
Hello. Can I request a modification for this NPC? I'm new at hercules and I'm having a hard time.

  • Weapon Only
  • Maximum Bonus = 5
  • Random item option for every try. Only 1 option allowed. Random Stat (e.g. Str/dex/agi/etc...) meaning you can't choose what option it will give you. giving you a random stat with a random value
Thanks!

 
Quazi said:
hi @Smoke is it possible to request an additional configuration in your demo script like this..
just an idea to improve the Item Option System Demo NPC..

Purpose of Max Item Option Limit is to avoid getting packet errors by editing the mmo.c
and 4144 also said that the client is set to only exact 5 Options..

i hope you can give it a try when you have some extra time.. thank you in advance  :innocent:

 Configuration

                Max Item Option Limit ( can be set to 1, 2, 3, 4, or 5) 

                 .Max_Item_Option_Limit = 3;

Requirements and Required amount for a try.( Can be set to either Zeny or cashpoints or PvPPoints or ItemID)
.zeny_requirement = 100; ( Can be set to 0 )
  .cashpoints_requirement = 1000; ( Can be set to 0 )
  .pvppoints_requirement = 100; ( Can be set to 0 )
    .Item_requirement = 503; ( this is set 503 as Red Potion )

Everything I think is already in the script Smoke provided. Look for this..
 

for (.@i = 1; .@i <= MAX_ITEM_OPTIONS; ++.@i) {


Change the MAX_ITEM_OPTIONS to .Max_Item_Option_Limit

Also in Requirements and Required amount (zeny or points or item) it can be done already in script.. 

 
Back
Top