utofaery
-
Content Count
101 -
Joined
-
Last visited
-
Days Won
1
Reputation Activity
-
utofaery got a reaction from MikZ in Daily random supplies
prontera,158,167,3 script Sample 4_M_SIT_NOVICE,{ if (#xTaken + .next_take> gettimetick(2)) { mes "[Random Item Giver]"; mes "Please talk to me after 24 hours."; close; } else { mes "[Random Item Giver]"; mes "Have some of these!"; .@riRate1 = rand (.@Ai11,.@Ai12); .@riRate2 = rand (.@Ai21,.@Ai22); .@riRate3 = rand (.@Ai31,.@Ai32); .@rItemid1 = .@Aitem1[rand(getarraysize (.@Aitem1))]; .@rItemid2 = .@Aitem2[rand(getarraysize (.@Aitem2))]; .@rItemid3 = .@Aitem3[rand(getarraysize (.@Aitem3))]; getitem ( .@rItemid1, .@riRate1 ) ; // dispbottom ( "rItemid1 :: " + .@rItemid1 + " riRate1 :: " + .@riRate1 + " Name :: " + getitemname ( .@rItemid1 ) ) ; // debug use only !!! getitem ( .@rItemid2, .@riRate2 ) ; // dispbottom ( "rItemid2 :: " + .@rItemid2 + " riRate2 :: " + .@riRate2 + " Name :: " + getitemname ( .@rItemid2 ) ) ; // debug use only !!! getitem ( .@rItemid3, .@riRate3 ) ; // dispbottom ( "rItemid3 :: " + .@rItemid3 + " riRate3 :: " + .@riRate3 + " Name :: " + getitemname ( .@rItemid3 ) ) ; // debug use only !!! #xTaken = gettimetick(2); next; close; } OnInit: //set cooldown to take item again. .next_take = 24*60*60; //set item here setarray .Aitem1[0],501,502,503,504,505,14510; setarray .Aitem2[0],601,602,603,604,605,14510; setarray .Aitem3[0],701,702,703,704,705,14510; //set rate here .Ai11 = 1; .Ai12 = 10; .Ai21 = 5; .Ai22 = 15; .Ai31 = 10; .Ai32 = 20; end; } Refined and fixed up npc variable..
-
utofaery got a reaction from skyundersea in [Help] Skill change and Job Sprite
Hercules\conf\char\char-server.conf
// Player-related configuration player: { new: { // Start point (Renewal) start_point_re: { map: "iz_int" x: 18 y: 27 } // Start point (Pre-Renewal) start_point_pre: { map: "new_1-1" x: 53 y: 111 }
-
utofaery reacted to AnnieRuru in H>Pet egg renewal fixing
pet eggs are not simple as that, there is also a `pet` table you have to worry about
you can't just *delitem ... have to list the pet owner, intimacy, ... etc fetch the pet information then use *delitem2 to delete the correct pet ID
also your script is a total mess, I have totally no idea what you are doing
// counting_sort_index <input array>, <output index>{, <total index>}; function script counting_sort_index { .@total = .@size = getarg( 2, getarraysize( getarg(0) ) ); copyarray .@arr, getarg(0), .@size; for ( .@i = 0; .@i < .@size; ++.@i ) setd ".@index_"+ .@arr[.@i] +"["+( .@tmp[.@arr[.@i]]++ )+"]", .@i; for ( ; .@size; --.@size ) { .@index = getarraysize(.@tmp) -1; .@out[.@size-1] = getd( ".@index_"+ .@index +"["+( --.@tmp[.@index] )+"]" ); } copyarray getarg(1), .@out, .@total; return; } prontera,155,185,5 script F_PetTrader 1_F_MARIA,{ disable_items; if ( getpetinfo(1) ) { mes "please return your pet into egg state to continue"; close; } getinventorylist; for ( .@i = 0; .@i < @inventorylist_count; ++.@i ) { if ( @inventorylist_card1[.@i] == -256 ) { .@egg_id[.@c] = @inventorylist_id[.@i]; .@pet_id[.@c] = @inventorylist_card2[.@i] + @inventorylist_card3[.@i] * ( 1 << 16 ); ++.@c; } } if ( !.@c ) { mes "your inventory doesn't have any pet egg"; close; } counting_sort_index .@petid, .@s, .@c; // never thought a time need a sorting algorithm for ( .@i = 0; .@i < .@c; ++.@i ) { .@petid[.@i] = .@pet_id[.@s[.@i]]; .@eggid[.@i] = .@egg_id[.@s[.@i]]; } .@pet_field$ = .@petid[0]; for ( .@i = 1; .@i < .@c; ++.@i ) .@pet_field$ += ","+ .@petid[.@i]; .@nb = query_sql( "select intimate, class, equip, name from pet where pet_id in ("+ .@pet_field$ +") order by pet_id", .@intimate, .@class, .@equipped, .@name$ ); if ( .@nb != .@c ) { mes "Error ... "; close; } mesf "There are %d pet egg inside your inventory", .@c; for ( .@i = 0; .@i < .@nb; ++.@i ) { mesf "\rPet ID : %d", .@petid[.@i]; mesf "Pet Name : %s", .@name$[.@i]; mesf "Pet Class : %d", .@class[.@i]; mesf "Egg ID : %d", .@eggid[.@i]; mesf "Intimacy : %d", .@intimate[.@i]; } next; for ( .@i = 0; .@i < .@nb; ++.@i ) .@menu$ += sprintf( ("[%d] %s:"), .@petid[.@i], replacestr( .@name$[.@i], ":", ";" ) ); .@s = select(.@menu$) -1; mesf "Selected #%d %s", .@petid[.@s], .@name$; // then decide what you want to do here mes "delete it ?"; next; if ( select( "Yes", "No" ) == 2 ) close; delitem2 .@eggid[.@s], 1,1,0,0, -256, .@petid[.@s] % ( 1 << 16 ), .@petid[.@s] / ( 1 << 16 ), 0; close; }
-
utofaery reacted to AnnieRuru in H>Pet egg renewal fixing
its *bpet actually
*bpet() This command opens up a pet hatching window on the client connected to the invoking character. It is used in item script for the pet incubators and will let the player hatch an owned egg. If the character has no eggs, it will just open up an empty incubator window. This is still usable outside item scripts.
there is already pet_return_egg function, so just use it
#include "common/hercules.h" #include "map/pc.h" #include "map/pet.h" #include "map/script.h" #include "common/HPMDataCheck.h" HPExport struct hplugin_info pinfo = { "pet_return_egg", SERVER_TYPE_MAP, "0.1", HPM_VERSION, }; BUILDIN(pet_return_egg) { struct map_session_data *sd; if ( script_hasdata(st,2) ) { if ( script_isstringtype(st,2) ) sd = script->nick2sd( st, script_getstr(st,2) ); else sd = script->id2sd( st, script_getnum(st,2) ); } else sd = script->rid2sd(st); if ( !sd ) return true; if ( !sd->pd ) { ShowWarning( "buildin_pet_return_egg: Pet not found !\n" ); return false; } pet->return_egg(sd, sd->pd); return true; } HPExport void plugin_init(void) { addScriptCommand( "pet_return_egg", "?", pet_return_egg ); } prontera,155,185,5 script kjhdfksjf 1_F_MARIA,{ if ( getpetinfo(1) ) pet_return_egg; close; } -
utofaery got a reaction from AnnieRuru in How to setup OFFLINE server for personal development use
I don't know if you realise this.
You could retarget project even if you are not on
Windows 10 SDK 10.0.15063
Windows 8.1 SDK
I used 10.0.17763.0
and retarget project by rightclicking solution in solution explorer.
function ok I think even in newer version of sdk
for both rathena and hercules (retarget)
and about download speed
Do make use of internet download manager ...
it's like "@speed 0" compare to normal way of download which is "@speed 100"
it shorten download time by at least 75% if you use it.
Nah I would not agree only developer grade or someone pro on source code stuff love linux more
even when linux has nice and improved desktop environment the keyboard shortcut are all different if you are above pro window user you hate it
(it's like your kitchen stuff is not where it should be and you need to learn or find them when you need them)
I guess same here dah
Westerner try to judge asian people's way to teach kid...sick and bad
When I got the chance to learn to ride motorcycle I had nobody to teach me nothing
all the adult say is keep your balance and hold on to the speed...including fall and break the bone.
forgotten this:
You should include the internet download manager into the guide too
it helps with download speed with anything bigger than 500MB
-
utofaery reacted to Daifuku in Ragnarok Emojis v2.0
View File Ragnarok Emojis v2.0
__________***PLEASE READ***__________
I updated a variety of ragnarok emojis. Example:
became >
Feel free to do whatever with the graphics. Use parts of it or fully, use them as a base or else - but please follow these rules:
________________________________________
Rules:
Do not sell these graphics to anyone. Do not ask me to fix, adjust or change something unless you're willing to pay for it. If you upload them somewhere for others to download, please credit me and/or link back to herc.ws's download section. Contains:
Ragnarok Emojis Submitter Daifuku Submitted 02/10/19 Category Other Graphics
-
utofaery reacted to AnnieRuru in Q>sql query MD_BOSS
hahaha ~ took me so long to find out,
yes, ONLY baphomet card is missing from my query because there is a non-MVP boss monster can drop MVP card
The Baphomet, MVP is monster BAPHOMET(1039) and there is another boss monster call BAPHOMET_I(1929) that can also drop baphomet card
-
utofaery reacted to AnnieRuru in H>How to make it report actual sold item count?
prontera,155,185,4 script Mass Junk Seller 1_M_MERCHANT,{ disable_items; getinventorylist; for ( .@i = 0; .@i < @inventorylist_count; ++.@i ) { if ( getiteminfo( @inventorylist_id[.@i], ITEMINFO_TYPE ) == IT_ETC ) { .@id[.@c] = @inventorylist_id[.@i]; .@amount[.@c] = @inventorylist_amount[.@i]; .@zeny_total += getiteminfo( .@id[.@c], ITEMINFO_SELLPRICE ) * .@amount[.@c] *(100 + .Overcharge[ getskilllv(MC_OVERCHARGE)] )/100; ++.@c; } } if ( !.@c ) { mes "you don't have any items to sell"; close; } mes "Are you sure selling :"; for ( .@i = 0; .@i < .@c; ++.@i ) mes .@amount[.@i] +"x "+ getitemname(.@id[.@i]); mes "for "+ F_InsertComma(.@zeny_total) +" Zeny ?"; next; if ( select( "Yes", "No" ) == 2 ) close; if ( Zeny + .@zeny_total > MAX_ZENY ) { mes "You can't carry that much Zeny."; close; } for ( .@i = 0; .@i < .@c; ++.@i ) delitem .@id[.@i], .@amount[.@i]; mes "All item sold for "+ F_InsertComma(.@zeny_total) +" Zeny"; Zeny += .@zeny_total; close; OnInit: setarray .Overcharge[0], 0, 7,9,11,13,15,17,19,21,23,24; end; }
-
utofaery got a reaction from AnnieRuru in Help Removing duplicates value from array
Nice Case Closed
Annie thanks for showing all this stuff
Guess will go the 3rd options.
since using hercules as main rathena as supportive testing only..
-
utofaery reacted to AnnieRuru in Help Removing duplicates value from array
Let me show you 3 different methods
1. loop the value back in another array, almost similar to meko did
prontera,155,185,5 script kjdshfsk 1_F_MARIA,{ getinventorylist; for ( .@i = 0; .@i < @inventorylist_count; ++.@i ) { .@j = 0; while ( .@j < .@itemtotal && .@itemid[.@j] != @inventorylist_id[.@i] ) ++.@j; if ( .@j == .@itemtotal ) .@itemid[.@itemtotal++] = @inventorylist_id[.@i]; } for ( .@i = 0; .@i < .@itemtotal; ++.@i ) dispbottom getitemname( .@itemid[.@i] ) +" -> "+ countitem( .@itemid[.@i] ) +"x"; end; } most people will show you this method, and this method is usable in almost all programming language
BUT ... in my opinion this method use lots of loops ...
2. store the value in a string, then compare them later
prontera,158,185,5 script dskjfhsdfk 1_F_MARIA,{ getinventorylist; .@compare$ = "#"; for ( .@i = 0; .@i < @inventorylist_count; ++.@i ) { if ( !compare( .@compare$, "#"+ @inventorylist_id[.@i] +"#" ) ) { .@compare$ += @inventorylist_id[.@i] +"#"; .@itemid[.@itemtotal++] = @inventorylist_id[.@i]; } } for ( .@i = 0; .@i < .@itemtotal; ++.@i ) dispbottom getitemname( .@itemid[.@i] ) +" -> "+ countitem( .@itemid[.@i] ) +"x"; end; } I have used this method in
https://rathena.org/board/topic/91826-special-party-warper/#comment-241434
https://rathena.org/board/topic/91723-please-help-this-script-about-mac_address/?do=findComment&comment=240887
I used this method a lot before Ind upgrade our scripting engine,
but search using strings is quite slow in C language, hercules script language included
and comes the recommended method below
3. abuse hercules script engine, array is store in a pointer.
prontera,161,185,5 script zcxvsfer 1_F_MARIA,{ getinventorylist; for ( .@i = 0; .@i < @inventorylist_count; ++.@i ) { if ( !.@compare[ @inventorylist_id[.@i] ] ) { .@compare[ @inventorylist_id[.@i] ] = true; .@itemid[.@itemtotal++] = @inventorylist_id[.@i]; } } for ( .@i = 0; .@i < .@itemtotal; ++.@i ) dispbottom getitemname( .@itemid[.@i] ) +" -> "+ countitem( .@itemid[.@i] ) +"x"; end; } ever since Ind upgrade our scripting engine, this is my latest method, and I think this is the fastest way -> compare to all 3 methods
I have used in
getitemname2 function
soul linker spirit
As you can see, I used Method 2 while still on rAthena forum, and switch to Method 3 after switch to Hercules
And for your 2nd question, you can solve it yourself after you learn any of these techniques
-
-
utofaery reacted to Arduino in How to make countitem not counting equip equipments
With getinventorylist you can get the list of items.
It's not possible to delete an item from the inventory only. Delitem does not support arguments for inventory index, even though it should. If you want a source mod for it I can help.
You can do something like:
getinventorylist; for(.@i=0; .@i < @inventorylist_count; .@i++){ if(@inventorylist_equip[.@i] == 0) .@inventlist++; //Do the thing that you want to do here with the item, .@i is the index of the item. }
with this, you are counting all the items in the inventory of the character that are not being used.
Sorry if I replied late to this post, but i wanted to help.
PD:
Here are the variables that you can retrieve from getinventorylist:
@inventorylist_id[] - array of item ids. @inventorylist_amount[] - their corresponding item amounts. @inventorylist_equip[] - will return the slot the item is equipped on, if at all. @inventorylist_refine[] - for how much it is refined. @inventorylist_identify[] - whether it is identified. @inventorylist_attribute[] - whether it is broken. @inventorylist_card1[] - These four arrays contain card data for the @inventorylist_card2[] items. These data slots are also used to store @inventorylist_card3[] names inscribed on the items, so you can @inventorylist_card4[] explicitly check if the character owns an item made by a specific craftsman. @inventorylist_expire[] - expire time (Unix time stamp). 0 means never expires. @inventorylist_bound - whether it is an account bounded item or not. @inventorylist_count - the number of items in these lists.
-
utofaery reacted to Asheraf in [HELP] Item Script
im not sure how this is could be done but an easier solution would be to give the player the box again if it failed.
-
utofaery got a reaction from AnnieRuru in Q>sql query MD_BOSS
After Testing script provided.
According to ratemyserver.net
Baphomet (BAPHOMET) Mob-ID#1039
is counted as mvp
but it is not listed any section of all three
Normal Cards
Mini-Boss Cards
or the
MVP Cards
what can I do to make it work??