Jump to content

Zephyr

Members
  • Content Count

    9
  • Joined

  • Last visited


Reputation Activity

  1. Upvote
    Zephyr got a reaction from vBrenth in About continuity of custom NPCs on Hercules Repository.   
    Remove them all. If an adm can't make this basic scripts by themselves, they don't deserve a successful RO server.
     
    @edit
    Keep just the warper, job master and card remover. Because they are a very long NPC to build, but don't keep them at the git, instead, make some pinned topic at the scripts area here in the forum to put them.
  2. Upvote
    Zephyr reacted to kisuka in checkquest / questprogress   
    checkquest deprecated in favor of questprogress in db1abaf.
    questactive() implemented in 98274e4.

  3. Upvote
    Zephyr reacted to evilpuncker in Scripting Tutorials & Guides   
    pls don't teach them to use "menu" =P
     
    ref: https://github.com/HerculesWS/Hercules/pull/374
  4. Upvote
    Zephyr reacted to Mystery in August Digest 2014   
    August Digest 2014
    The following digest covers the month of August 1st - August 31st 2014.
     

    Development Highlights
    [*]Fixed several issues with SO_EL_SYMPATHY (b791b66) [*]Corrected an issue that caused the elemental's HP and SP would
    _decrease to_ summon_level*5% instead of _increasing by_ said amount. [*]Corrected an issue that decreased the SP cost of summon elemental
    skills by 5% even when the Spirit Sympathy skill wasn't present. [*]Added/renamed some variables to prevent confusion. Please don't reuse
    'i' variables for things that aren't array indices. Or don't reuse
    variables altogether for different purposes than their original one.
    [*]Add MAX_REFINE as hard-coded constant (bac319d)
    [*]MAX_REFINE has different value for renewal(20) and non-renewal(10) and some server even adjust this value so its better to add this constant so there's no need to add a configuration when making custom refiner scripts
    [*]New Optional Configuration for unequipped disabled equipments (33a43e) [*]Fixed an issue when Token_Of_Siegfried is used, under certain conditions (b29402) [*]Extended item_check to also add unique_ids to any non-stackable items (49d604) [*]Fixed official devotion behaviour, various cleanups (e7be725) [*]Fixed a crash when a mercenary warps back to its master (7f4d6fc) [*]Battle config option for knockback style when on same tile (2b8d501) [*]sc_config.txt Update! (ec0272) [*]Fixed some MSVC incompatibilities () [*]Corrected several format-string errors through the code (c45e3fa) [*]Fixes on 3rd class skills !  (356a83b)
    [*]When under Mind Break Matk Effect and Mdef reduction should not show on ALT Q(bug:7915) [*]Plagiarism should not copy New 3rd class skills. Thanks to OmegaRed (bug:8118) [*]Update Runstone Lux Anima to official formula (bug:8285) [*]Add official formula for Demonic Fire [*]Update damage formula for Unlimit, apply Def and Mdef to 1 during the skill and adjust the cooldown to official. (bug:8227) [*]Flash Combo should not consume hp-sp and the skill not ignore the distance. [*]Fix a bug with Full Throttle that not consuming sp correctly and adjust the cooldown to official. [*]All WoE items are inactive outside WoE or PVP [*]Add bonus3 bSPVanishRate for Vellum Items. [*]Script Vellum Items. [*]Add 2 new bonus bSetDefRace and bSetMDefRace for the Vellum Items. (rAthena c046668034) [*]Fixed Bowling Bash, Brandish Spear, Grand Darkness and Meteor Assault reducing def during cast; the only skill that does this officially is Grand Cross (rAthena 6947190) [*]Implemented official Bowling Bash with all its special behaviors including the gutter line [*]As many servers probably want to remove the gutter line problem, it is configurable; just adjust the bowling_bash_area setting in skill.conf (Bug:4209) [*]Sonic Blow now has a fixed range of 1, even for monsters; a monster can't use this skill if you tank it from farther away (rAthena a15cee0)



     
    Database Highlights
    [*]Massive renewal mob_db update! (0fadf3) [*]Some item fixes (5145cd) [*]Fix some incorrect card effect rate (f8e0227) [*]Update some official mob spawn info (b4bea48)

     
    August Statistics
    [*]During the period there were 52 Commits. [*]Of these 52 commits, 23 included bug-fixes. [*]15 Commits from Pull Requests  [*]In this month, there were 14,771 Additions and 12,889 Deletions.

  5. Upvote
    Zephyr reacted to GmOcean in Itemdb/db2 SQL & CONF   
    Okay, so adding items via itemdb.conf is really easy now, since you essentially only need to input 3 fields to get an item to exist in game. However, on the SQL side for those of us who use it, you still need to add all the information or it'll be buggy and could cause issues. Since default is either NULL or 0.
     
    #1. I suggest we update this to take on the same parameters as itemdb.conf when not filling them in. It only makes sense in my opinion. (Yes I know I can easily do this myself by editing the main.sql file. But this is a suggestion so that we won't have to in the future).
     
    #2. of the suggestion is about the inherit feature. While looking in itemdb.c you'll notice that it does some PRE-checks before adding the data to the *db. It reads the sql entries -> checks to see if it's valid -> changes information so that it is valid in the instance where it is incorrect.
    /** * Processes one itemdb entry from the sql backend, loading and inserting it * into the item database. * * @param *handle MySQL connection handle. It is expected to have data * available (i.e. already queried) and it won't be freed (it * is care of the caller to do so) * @param n Ordinal number of the entry, to be displayed in case of * validation errors. * @param *source Source of the entry (table name), to be displayed in case of * validation errors. * @return Nameid of the validated entry, or 0 in case of failure. */int itemdb_readdb_sql_sub(Sql *handle, int n, const char *source) { struct item_data id = { 0 }; char *data = NULL; /* * `id` smallint(5) unsigned NOT NULL DEFAULT '0' * `name_english` varchar(50) NOT NULL DEFAULT '' * `name_japanese` varchar(50) NOT NULL DEFAULT '' * `type` tinyint(2) unsigned NOT NULL DEFAULT '0' * `price_buy` mediumint(10) DEFAULT NULL * `price_sell` mediumint(10) DEFAULT NULL * `weight` smallint(5) unsigned DEFAULT NULL * `atk` smallint(5) unsigned DEFAULT NULL * `matk` smallint(5) unsigned DEFAULT NULL * `defence` smallint(5) unsigned DEFAULT NULL * `range` tinyint(2) unsigned DEFAULT NULL * `slots` tinyint(2) unsigned DEFAULT NULL * `equip_jobs` int(12) unsigned DEFAULT NULL * `equip_upper` tinyint(8) unsigned DEFAULT NULL * `equip_genders` tinyint(2) unsigned DEFAULT NULL * `equip_locations` smallint(4) unsigned DEFAULT NULL * `weapon_level` tinyint(2) unsigned DEFAULT NULL * `equip_level_min` smallint(5) unsigned DEFAULT NULL * `equip_level_max` smallint(5) unsigned DEFAULT NULL * `refineable` tinyint(1) unsigned DEFAULT NULL * `view` smallint(3) unsigned DEFAULT NULL * `bindonequip` tinyint(1) unsigned DEFAULT NULL * `buyingstore` tinyint(1) NOT NULL DEFAULT NULL * `delay` mediumint(9) NOT NULL DEFAULT NULL * `trade_flag` smallint(4) NOT NULL DEFAULT NULL * `trade_group` smallint(4) NOT NULL DEFAULT NULL * `nouse_flag` smallint(4) NOT NULL DEFAULT NULL * `nouse_group` smallint(4) NOT NULL DEFAULT NULL * `stack_amount` mediumint(6) NOT NULL DEFAULT NULL * `stack_flag` smallint(2) NOT NULL DEFAULT NULL * `sprite` mediumint(6) NOT NULL DEFAULT NULL * `script` text * `equip_script` text * `unequip_script` text */ SQL->GetData(handle, 0, &data, NULL); id.nameid = (uint16)atoi(data); SQL->GetData(handle, 1, &data, NULL); safestrncpy(id.name, data, sizeof(id.name)); SQL->GetData(handle, 2, &data, NULL); safestrncpy(id.jname, data, sizeof(id.jname)); SQL->GetData(handle, 3, &data, NULL); id.type = atoi(data); SQL->GetData(handle, 4, &data, NULL); id.value_buy = data ? atoi(data) : -1; // Using invalid price -1 when missing, it'll be validated later SQL->GetData(handle, 5, &data, NULL); id.value_sell = data ? atoi(data) : -1; SQL->GetData(handle, 6, &data, NULL); id.weight = data ? atoi(data) : 0; SQL->GetData(handle, 7, &data, NULL); id.atk = data ? atoi(data) : 0; SQL->GetData(handle, 8, &data, NULL); id.matk = data ? atoi(data) : 0; SQL->GetData(handle, 9, &data, NULL); id.def = data ? atoi(data) : 0; SQL->GetData(handle, 10, &data, NULL); id.range = data ? atoi(data) : 0; SQL->GetData(handle, 11, &data, NULL); id.slot = data ? atoi(data) : 0; SQL->GetData(handle, 12, &data, NULL); itemdb->jobid2mapid(id.class_base, data ? (unsigned int)strtoul(data,NULL,0) : UINT_MAX); SQL->GetData(handle, 13, &data, NULL); id.class_upper = data ? (unsigned int)atoi(data) : ITEMUPPER_ALL; SQL->GetData(handle, 14, &data, NULL); id.sex = data ? atoi(data) : 2; SQL->GetData(handle, 15, &data, NULL); id.equip = data ? atoi(data) : 0; SQL->GetData(handle, 16, &data, NULL); id.wlv = data ? atoi(data) : 0; SQL->GetData(handle, 17, &data, NULL); id.elv = data ? atoi(data) : 0; SQL->GetData(handle, 18, &data, NULL); id.elvmax = data ? atoi(data) : 0; SQL->GetData(handle, 19, &data, NULL); id.flag.no_refine = data && atoi(data) ? 0 : 1; SQL->GetData(handle, 20, &data, NULL); id.look = data ? atoi(data) : 0; SQL->GetData(handle, 21, &data, NULL); id.flag.bindonequip = data && atoi(data) ? 1 : 0; SQL->GetData(handle, 22, &data, NULL); id.flag.buyingstore = data && atoi(data) ? 1 : 0; SQL->GetData(handle, 23, &data, NULL); id.delay = data ? atoi(data) : 0; SQL->GetData(handle, 24, &data, NULL); id.flag.trade_restriction = data ? atoi(data) : ITR_NONE; SQL->GetData(handle, 25, &data, NULL); id.gm_lv_trade_override = data ? atoi(data) : 0; SQL->GetData(handle, 26, &data, NULL); id.item_usage.flag = data ? atoi(data) : INR_NONE; SQL->GetData(handle, 27, &data, NULL); id.item_usage.override = data ? atoi(data) : 0; SQL->GetData(handle, 28, &data, NULL); id.stack.amount = data ? atoi(data) : 0; SQL->GetData(handle, 29, &data, NULL); if (data) { int stack_flag = atoi(data); id.stack.inventory = (stack_flag&1)!=0; id.stack.cart = (stack_flag&2)!=0; id.stack.storage = (stack_flag&4)!=0; id.stack.guildstorage = (stack_flag&8)!=0; } SQL->GetData(handle, 30, &data, NULL); if (data) { id.view_id = atoi(data); if (id.view_id) id.flag.available = 1; } SQL->GetData(handle, 31, &data, NULL); id.script = data && *data ? script->parse(data, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS, NULL) : NULL; SQL->GetData(handle, 32, &data, NULL); id.equip_script = data && *data ? script->parse(data, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS, NULL) : NULL; SQL->GetData(handle, 33, &data, NULL); id.unequip_script = data && *data ? script->parse(data, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS, NULL) : NULL; return itemdb->validate_entry(&id, n, source);} Knowing this we could add an INHERIT column in our sql itemdb entries to allow for the option of making an item inherit that of another item. Which leads to my third suggestion.
     
     
    #3. While inherit is useful in some cases, it's fairly if not vastly limited, since it's a boolean option. Meaning either YES inherit or NO don't inherit. This should be changed to an item_id entry. So that we can specify WHAT item it inherits its information from. That way were not limited to re-making an existing item just to change or add a feature.
     
    Example of current inherit:
    {  Id: 501  AegisName: "Red_Potion"  Name: "Red Potion"  Buy: 1200  Weight: 150  Script: <" itemheal rand(325,405),0; "> Inherit: true}, This will make a red potion inherit all of it's information from itemdb.conf but make it act like a White Potion in terms of buy/sell price, weight and heal power.
     
    Example of suggested inherit:
    { Id: 501 AegisName: "Red_Potion" Name: "Red Potion" Inherit: 504}, This would effectively do the same thing as above should we decide to add it. BUT more importantly, i wouldn't be limited to using an existing item ID.
    { Id: 32000 AegisName: "New_Potion" Name: "New Potion" Inherit: 504}, Thusly allowing us to add new items in and inherit information without the need to overwrite an item already in existence. ( I'm repeating myself xD ).
     
    Naturally this could be applied to the SQL side as well and rightfully should if there aren't any underlying compatibility issues.
     
    For those who don't know what I'm talking about in relation to the src here is the section in question:
    if( (t = libconfig->setting_get_member(it, "Inherit")) && (inherit = libconfig->setting_get_bool(t)) ) { if( !itemdb->exists(id.nameid) ) { ShowWarning("itemdb_readdb_libconfig_sub: Trying to inherit nonexistent item %d, default values will be used instead.n", id.nameid); inherit = false; } else { // Use old entry as default struct item_data *old_entry = itemdb->load(id.nameid); memcpy(&id, old_entry, sizeof(struct item_data)); } } It would be a simple change to: *Note - would also need to change   bool inherit = false   to int inherit = false
    if( (inherit = libconfig->setting_lookup_int(it, "Inherit", &i32 )) ) {      if( !itemdb->exists(id.nameid) && inherit == 1 || !itemdb->exists(inherit) && inherit != 1 ) {      ShowWarning("itemdb_readdb_libconfig_sub: Trying to inherit nonexistent item %d, default values will be used instead.n", inherit);      inherit = false;    } else {      // Use old entry as default      if( inherit = 1 ) {        struct item_data *old_entry = itemdb->load(id.nameid);        memcpy(&id, old_entry, sizeof(struct item_data));      } else {        struct item_data *old_entry = itemdb->load(inherit);        memcpy(&id, old_entry, sizeof(struct item_data));      }    }  }  
    From my limited knowledge on the src code ( and coding in general ), this would let it lookup the item specified rather than a boolean option and then use that information as the default, else go to the default paramters given in itemdb.conf
  6. Upvote
    Zephyr got a reaction from nana in checkquest / questprogress   
    That's fine if I can check if the quest is with the player, even if it's inactive. I thought that checkprogress would return false if the quest were inactive. But I still prefer the way it is, for example, if the user inactive the quest by mistake (it happens a lot, since it's just to right-click), my NPC checks if the quest is inactive and alert the player:
     
    for( set @i, 50009; @i <= 50036; set @i, @i + 1 )  if(checkquest(@i) == 0) {    mes "Oh! You returned alive,";    mes "I thought you were died";    mes "for that stupid monsters,";    mes "I was almost sending reinforcements";    mes "to you.";    next;    mes .@n$;    mes "Please, your mission seems like";    mes "to be inactive at the moment,";    mes "open your quest menu (alt+u),";    mes "click on the 2nd tab and active";    mes "it again. Back to work soldier!";    close;  } I think this is cleaner, beaultiful, alerts the player, and you can make the player feels good. lol
     
    My whole script for consult:
     
  7. Upvote
    Zephyr reacted to GmOcean in explode to push arraysize   
    I just wanna suggest that the *explode script command, should push the array size of the one it creates. So that things like this are possible:
    .@a = 10;while( .@b != .@a ) { .@menu$ = .@menu$ +""+ .@b +":"; .@b++;}.@menu$ = .@menu$ +"Last Option";if( select( .@menu$ ) == ( .@size = explode( .@temp$, .@menu$, ":" ) ) ) { close; } // Clicked Last Option in list. vs what we have to do now:
    .@a = 10;while( .@b != .@a ) { .@menu$ = .@menu$ +""+ .@b +":"; .@b++;}.@menu$ = .@menu$ +"last Option";explode( .@temp$, .@menu$, ":" );if( select( .@menu$ ) == getarraysize( .@temp$ ) ){ close; } // Clicked Last Option in list.  
    It's not really " needed " more of just a feature I think it should have since commands like query_sql have it. I figure why not give it the extra feature since it's not a downgrade nor does it break backwards compatibility.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.