Jump to content

Litro Endemic

Members
  • Posts

    283
  • Joined

  • Days Won

    10

Everything posted by Litro Endemic

  1. the dummy shops in the bottom parts of script, move it to first line... // Dummy shop data -- copy as needed. //============================================================ - shop qshop1 -1,909:-1 - shop qshop2 -1,909:-1 - shop qshop3 -1,909:-1 - shop qshop4 -1,909:-1 - shop qshop5 -1,909:-1 I suppose you have faced with the situation where when you reloadnpcfile the shop is only have jellopy in it?, that because reloadscript and reloadnpcfile is different, reloadnpcfile, is applying script from start to end, reloadscript is from end to start (I think I have seen annieruru or someone else said this somewhere), so with reloadscript the dummy shops have been there for core quest shop script to manage the shop entry, but not the case with reloadnpcfile, the shop is not there in server memory yet because it was unloaded, this is under my assumption of how the src code do it work wit (re)load-ing the script and what I have tried and it worked for me.
  2. move the dummy shop to upper part of the script, with that @reloadnpcfile can be used freely
  3. pc.cpp replace //add lootcommon if (sd->state.lootcommon && item_data->flag.dropEffect != 0) return false; with //add lootcommon if (sd->state.lootcommon) return (item_data->flag.dropEffect == 0);
  4. You can peruse this thread as reference https://rathena.org/board/topic/74630-help-array/
  5. on mob_db.yml find DamageTaken and delete all those
  6. just use function in your item bonus, in the function you can query to sql db to get the tittle currenty used.
  7. you have to include the pet egg on client side files system/PetEvolutionCln_true_E.lub too
  8. bl and src usually used as a variable of game object structure pointer (can be player, item, monster, npc, ...), take a function on status.cpp it have details information, on what param stand for, to initialize a blocklist depend on usage or function you want to reach your need. /** * Applies SC defense to a given status change * This function also determines whether or not the status change will be applied * @param src: Source of the status change [PC|MOB|HOM|MER|ELEM|NPC] * @param bl: Target of the status change * @param type: Status change (SC_*) * @param rate: Initial percentage rate of affecting bl (0~10000) * @param tick: Initial duration that the status change affects bl * @param flag: Value which determines what parts to calculate. See e_status_change_start_flags * @return adjusted duration based on flag values */ t_tick status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_type type, int rate, t_tick tick, unsigned char flag)
  9. isn't it you can just follow the example you give above, if you want it to work on gvg use mf_gvg, as for woe can use mf_gvg_castle for specific, or compare map name with g_cas like in woe controller script and for koe you need custom mapflag like mf_koe as condition and same other too, I can said this is strange question.
  10. try debuging the output of .teamname and .teamcid with debugmes, you can see where it gone wrong.
  11. id is unit game id not mob id, the check is correct, if target is monster, then convert it to mob_data then check the target mob id if that monster is emperium. if(target->type == BL_MOB) { struct mob_data *md = BL_CAST(BL_MOB, target); if (md->mob_id == MOBID_EMPERIUM) hp = 1; }
  12. element like fire, wind and water? if yes, there is no available script command for that, since element is script based not field member of item, you need to create indexes your self for it
  13. you can't use same type, for each bonus look at the db structure -- -- Table structure for table `bonus_script` -- CREATE TABLE IF NOT EXISTS `bonus_script` ( `char_id` INT(11) UNSIGNED NOT NULL, `script` TEXT NOT NULL, `tick` BIGINT(20) NOT NULL DEFAULT '0', `flag` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0', `type` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', `icon` SMALLINT(3) NOT NULL DEFAULT '-1', PRIMARY KEY (`char_id`, `type`) ) ENGINE=InnoDB; and script command of bonus_script *bonus_script "<script code>",<duration>{,<flag>{,<type>{,<status_icon>{,<char_id>}}}}; This command will attach a script to a player for a given duration, in seconds. After that time, the script will automatically expire. The same bonus cannot be stacked. By default, this bonus will be stored on `bonus_script` table when player logs out. Flags (bitmask): 1 : Remove when dead. 2 : Removable by Dispell. 4 : Removable by Clearance. 8 : Remove when player logs out. 16 : Removeable by Banishing Buster. 32 : Removable by Refresh. 64 : Removable by Lux Anima. 128 : Remove when Madogear is activated or deactivated. 256 : Remove when receive damage. 512 : Script is permanent, cannot be cleared by bonus_script_clear. 1024: Force to replace duplicated script by expanding the duration. 2048: Force to add duplicated script. This flag cannot be stacked with 1024, if both are defined, 1024 will be checked first and ignore this flag. Types: This will be used to decide negative or positive buff for 'debuff_on_logout'. 0: Ignore the buff type and won't be removed if the flag is not &8 (Default) 1: Buff 2: Debuff Status_icon: See "Status Icon" section in 'src/map/script_constants.hpp'. Default is SI_BLANK (-1). Example: // Apple gives you +5 Str bonus for 1 minute when it's consumed. 512,Apple,Apple,0,15,,20,,,,,0xFFFFFFFF,63,2,,,,,,{ bonus_script "{ bonus bStr,5; }",60; },{},{} this 2 script contain same type and then resulting duplicate entry, which was clear if you read in console (150003, 0) 150003 is that char id and 0 is the type. bonus_script "{ bonus bNoGemStone; bonus bUseSPrate,25; }",180,0,0,EFST_MVPCARD_MISTRESS; bonus_script "{ bonus bMaxHPrate,100; bonus bDefRate,-50; bonus bMdefRate,-50; }",180,0,0,EFST_MVPCARD_TAOGUNKA; for the fix, you can change the primary key in the db. since type field is only have 3 type 0,1,2 which maybe will be used in multiple script_bonus script, try replacing the primary key of table with char id and icon, which mean you can't use same icon for each entry of bonus_script and icon has many type and you can make new icon too. -- -- Table structure for table `bonus_script` -- CREATE TABLE IF NOT EXISTS `bonus_script` ( `char_id` INT(11) UNSIGNED NOT NULL, `script` TEXT NOT NULL, `tick` BIGINT(20) NOT NULL DEFAULT '0', `flag` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0', `type` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', `icon` SMALLINT(3) NOT NULL DEFAULT '-1', PRIMARY KEY (`char_id`, `icon`) ) ENGINE=InnoDB;
  14. try this, untested in game or compile : bHPGainRateWhenHit.patch
  15. the md (monster data) is null, because the mob isn't there but the code send it anyway to clif_bossmapinfo, there is 2 way imo to solve this. search for code which responsible sending clif_bossmapinfo with flag BOSS_INFO_ALIVE_WITHMSG then add check there if md is null don't send it, or you can put check on the function clif_bossmapinfo on case flag BOSS_INFO_ALIVE_WITHMSG, put condition if md is null do return, so it will be back to wherever it call and not sending this packet.
  16. // START OF NEW CHECK - [Duplicate IP in one party?] attachrid .@origin; // Check Party Members .@p = getcharid(1); if (.@p == 0) { mes "you have no party"; close; } getpartymember .@p, 2, .@aid; .@count = $@partymembercount; // make sure there is no pause between the check and collected party member data // like script command next, select, prompt, sleep2, sleep. for (.@i = 0; .@i < .@count; .@i++) { // no need to check with isloggedin anymore, // if failed to attach meaning the party member / player isn't online, // since only one char in account id can online at one time. if (attachrid(.@aid[.@i]) == true) { // getcharip() script command was there in the script engine, why query? .@ip$ = getcharip(); // script for you self? if use gepard do not bother using query, // get_unique_id() should be there in the script engine, why query? .@guid = get_unique_id(); // check ip duplicate if ((.@j = inarray(.@iplist$, .@ip$)) > -1) .@iplist_$[getarraysize(.@iplist_$)] = strcharinfo(0); else .@iplist$[getarraysize(.@iplist$)] = .@ip$; // check gepard unique id duplicate if ((.@j = inarray(.@guidlist, .@guid)) > -1) .@guidlist$[getarraysize(.@guidlist$)] = strcharinfo(0); else .@guidlist[getarraysize[.@guidlist]] = .@guid; } } // Get back to party leader to display message attachrid .@origin; if (getarraysize(.@iplist_$)) { mes "There is party member that found with same ip they are "+ implode(.@iplist$, ","); close; } if (getarraysize(.@guidlist$)) { mes "There is party member that found with same pc they are "+ implode(.@guidlist$, ","); close; } // END OF NEW CHECK
  17. udah dari 2018 ini klo lg penuh kek lg pasar pas lebaran https://letmegooglethat.com/?q=telkom+dropping+packet
  18. this is super weird, functor even reacted up there.
  19. first make a mysql user that suit your need. replace user, ip, password and your_db to what you need. ip can be "%" which mean can from anywhere CREATE USER 'user'@'ip' IDENTIFIED BY 'password'; GRANT ALL ON your_db.* TO 'user'@'ip'; note: grant all is bad practice, imo just set permission as you deem fit (i am lazy to look up permission that needed for rA db). find in file '/etc/mysql/my.cnf' set bind-address value like below. "x.x.x.x" is ip that used when created mysql user or can be set with "0.0.0.0" to match if you use "%" when created mysql user. # # Allow server to accept connections on all interfaces. # bind-address=x.x.x.x
  20. you can use file monster_size_effect in folder system and play around the mob size and effect with that
  21. prefer method 1, another note with an array and card id as index and price will get same output. duh when I said "simplify", my script is too extra haha..
  22. after re-reading the script I see err in my writing.. .@card_list$ = getarg(1, ""); if (.@card$ == "") { debugmes sprintf("[%s] AddCard: card list is empty for price %d", strnpcinfo(0), .@price); return; } explode(.@card$, .@card_list$, ":"); for (.@i = 0; .@i < getarraysize(.@card$); .@i++) { .@id = atoi(.@card$); should be .@card_list$ = getarg(1, ""); if (.@card_list$ == "") { debugmes sprintf("[%s] AddCard: card list is empty for price %d", strnpcinfo(0), .@price); return; } explode(.@card$, .@card_list$, ":"); for (.@i = 0; .@i < getarraysize(.@card$); .@i++) { .@id = atoi(.@card$[.@i]); here fixed script. prontera,181,204,4 script Card Buyer#rAthena 658,{ mes "[Card Buyer]"; mes "You have any card to sell ? <3"; next; getinventorylist; for (.@i = 0; .@i < @inventorylist_count; .@i++) { .@card_id = @inventorylist_id[.@i]; .@card_qt = @inventorylist_amount[.@i]; if (getiteminfo(.@card_id, 2) != 6) continue; // skip not card // find if this card can be sold to this npc .@f = inarray(.card_list, .@card_id); // not in list card that can be sold, skip! if (.@f == -1) continue; .@menu$[.@n] = getitemname(.@card_id) +" "+ callfunc("F_InsertComma", .card_price[.@card_id]); .@card_ids[.@n] = .@card_id; .@card_qts[.@n] = .@card_qt; .@n++; } if (!.@n) { mes "[Card Buyer]"; mes "You don't have any card huh?"; close; } .@s = select(implode(.@menu$, ":")) -1; mes "[Card Buyer]"; .@card_id = .@card_ids[.@s]; .@card_qt = .@card_qts[.@s]; mes "You have "+ callfunc("F_InsertComma", .@card_qt) +"x "+ getitemname(.@card_id); mes "You want to sell "+ getitemname(.@card_id) +"? I will pay you "+ callfunc("F_InsertComma", .card_price[.@card_id]) +"z/ea"; .@total = .card_price[.@card_id] * .@card_qt; mes "For total: "+ callfunc("F_InsertComma", .@total)+"z."; select("Yes"); delitem .@card_id, .@card_qt; Zeny += .@total; clear; mes "[Card Buyer]"; mes "Thank you for your patronage!"; close; OnInit: function AddCard; /* @param price in zeny @param "card id:card id:card id:...." Sample: AddCard(10000, "4001:4002:4003"); */ freeloop(true); AddCard(100000, "4032:4013:4023:4009:4004:4002:4026:4019:4006:4050:4008:4011:4001:4021:4022:4028:4016:4051"); AddCard(500000, "4043:4015:4052:4027:4003:4014:4012:4010:4034"); freeloop(false); end; function AddCard { .@price = getarg(0, 0); if (.@price < 1) { debugmes sprintf("[%s] AddCard: buying price is %d, minimum price is 1", strnpcinfo(0), .@price); return; } .@card_list$ = getarg(1, ""); if (.@card_list$ == "") { debugmes sprintf("[%s] AddCard: card list is empty for price %d", strnpcinfo(0), .@price); return; } explode(.@card$, .@card_list$, ":"); for (.@i = 0; .@i < getarraysize(.@card$); .@i++) { .@id = atoi(.@card$[.@i]); if (getitemname(.@id) == "null") { debugmes sprintf("[%s] AddCard: card id %d is not exist price %d", strnpcinfo(0), .@id, .@price); continue; } .@f = inarray(.card_list, .@id); if (.@f > -1) { debugmes sprintf("[%s] AddCard: card id %d duplicate entry, first set price %d", strnpcinfo(0), .@id, .card_price[.@id]); continue; } .card_list[getarraysize(.card_list)] = .@id; .card_price[.@id] = .@price; } return; } } just ask... if anyone has time and understand it, maybe there is someone will answer.
  23. testing random will give you random result ?, if (rand(1,100) < 91) ^ that mean 90% = 1 ~ 100 lower than 91
  24. imho addrid and so on, should be inside check map bracket, if outside it will trigger any mvp in or not in the map set.
  25. too many loop, simplify your script prontera,181,204,4 script Card Buyer 658,{ mes "[Card Buyer]"; mes "You have any card to sell ? <3"; next; getinventorylist; for (.@i = 0; .@i < @inventorylist_count; .@i++) { .@card_id = @inventorylist_id[.@i]; .@card_qt = @inventorylist_amount[.@i]; if (getiteminfo(.@card_id, 2) != 6) continue; // skip not card // find if this card can be sold to this npc .@f = inarray(.card_list, .@card_id); // not in list card that can be sold, skip! if (.@f == -1) continue; .@menu$[.@n] = getitemname(.@card_id) + callfunc("F_InsertComma", .card_price[.@card_id]); .@card_ids[.@n] = .@card_id; .@card_qts[.@n] = .@card_qt; .@n++; } .@s = select(implode(.@menu$, ":")) -1; mes "[Card Buyer]"; .@card_id = .@card_ids[.@s]; .@card_qt = .@card_qts[.@s]; mes "You want to sell "+ getitemname(.@card_id) +"?"; mes "I will pay you "+ callfunc("F_InsertComma", .card_price[.@card_id]) +"z/ea"; .@total = .card_price[.@card_id] * .@card_qt; mes "Total Price: "+ callfunc("F_InsertComma", .@total)+"z."; select("Yes"); delitem .@card_id, .@card_qt; Zeny += .@total; mes "[Card Buyer]"; mes "Thank you for your patronage!"; close; OnInit: function AddCard; /* @param price in zeny @param "card id:card id:card id:...." Sample: AddCard(10000, "4001:4002:4003"); */ freeloop(true); AddCard(100000, "4032:4013:4023:4009:4004:4002:4026:4019:4006:4050:4008:4011:4001:4021:4022:4028:4016:4051"); AddCard(500000, "4043:4015:4052:4027:4003:4014:4012:4010:4034"); freeloop(false); end; function AddCard { .@price = getarg(0, 0); if (.@price < 1) { debugmes sprintf("[%s] AddCard: buying price is %d, minimum price is 1", strnpcinfo(0), .@price); return; } .@card_list$ = getarg(1, ""); if (.@card$ == "") { debugmes sprintf("[%s] AddCard: card list is empty for price %d", strnpcinfo(0), .@price); return; } explode(.@card$, .@card_list$, ":"); for (.@i = 0; .@i < getarraysize(.@card$); .@i++) { .@id = atoi(.@card$); if (getitemname(.@id) == "null") { debugmes sprintf("[%s] AddCard: card id %d is not exist price %d", strnpcinfo(0), .@id, .@price); continue; } .@f = inarray(.card_list, .@id); if (.@f > -1) { debugmes sprintf("[%s] AddCard: card id %d duplicate entry, first set price %d", strnpcinfo(0), .@id, .card_price[.@id]); continue; } .card_list[getarraysize(.card_list)] = .@id; .card_price[.@id] = .@price; } return; } } writing it with out testing it work or not, you can use this as sample tho.. if you want
×
×
  • Create New...