-
Posts
696 -
Joined
-
Last visited
-
Days Won
102
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by Tokei
-
You can try this script: function script DivToDecimal { .@x = getarg(0); .@y = getarg(1); .@precision = 2; // The amount of digits to keep after the dot .@mod = pow(10, .@precision); .@left = .@x / .@y; .@right = (.@x * .@mod / .@y) % .@mod; .@result$ = "" + .@left; if (!.@right) return .@result$; // Removes trailing zeroes, for example: // With .@zeroes set to 0, 5 / 2 will output 2.5 // With .@zeroes set to 1, 5 / 2 will output 2.50 .@zeroes = 0; for (.@i = 0; .@i < .@precision; .@i++) { .@digit = .@right % 10; .@right = .@right / 10; if (!.@zeroes) { if (.@digit == 0) continue; .@output$ = insertchar(.@output$, .@digit + "", 0); .@zeroes = 1; } else { .@output$ = insertchar(.@output$, .@digit + "", 0); } } return .@result$ + "." + .@output$; } prontera,154,161,0 script TestNPC 567,{ dispbottom "Your number is: " + callfunc("DivToDecimal", 5, 2); end; } Be careful with overflows if your numbers are too high (this script breaks easily, but for simple divisions it will work out fine). Edit: If you must store the result of your division in a variable, you'll have to do some dirty tricks, for example: Something = 5 * 100 / 2; //... dispbottom "There are " + callfunc("DivToDecimal", Something, 100);
- 1 reply
-
- 4
-
-
-
The command you're looking for is @changecharsex.
-
To make the mapflag usable with @mapflag, open atcommand.c, ACMD_FUNC(mapflag) and add it to the list of existing flags: checkflag(nousecart); checkflag(noitemconsumption); checkflag(nosumstarmiracle); checkflag(nomineeffect); checkflag(nolockon); checkflag(notomb); checkflag(nocostume); checkflag(gvg_te); checkflag(gvg_te_castle); checkflag(newmapflag); checkflag(newmapflag2); ... setflag(nousecart); setflag(noitemconsumption); setflag(nosumstarmiracle); setflag(nomineeffect); setflag(nolockon); setflag(notomb); setflag(nocostume); setflag(gvg_te); setflag(gvg_te_castle); setflag(newmapflag); setflag(newmapflag2); To make the mapflag readable from a script, you'll have to add the flag as a constant first: Go in script.c, search for "MF_NOTOMB" and add your flag at the end of the list, such as: MF_NOTOMB, MF_SKILL_DAMAGE, //60 MF_NOCOSTUME, MF_GVG_TE_CASTLE, MF_GVG_TE, MF_NEWMAPFLAG = 100, // Custom flags MF_NEWMAPFLAG2, // Custom flags }; and then add it as a script constant. Open script_constants.h and add export_constant(MF_NOTOMB); export_constant(MF_SKILL_DAMAGE); export_constant(MF_NOCOSTUME); export_constant(MF_GVG_TE_CASTLE); export_constant(MF_GVG_TE); export_constant(MF_NEWMAPFLAG); // Custom flags export_constant(MF_NEWMAPFLAG2); Now you'll have to add the mapflag to the map structure, so go in map.h: unsigned nocostume : 1; // Disable costume sprites [Cydh] unsigned newmapflag : 1; // Custom flag unsigned newmapflag2 : 1; // Custom flag2 unsigned gvg_te : 1; // GVG WOE:TE. This was added as purpose to change 'gvg' for GVG TE, so item_noequp, skill_nocast exlude GVG TE maps from 'gvg' (flag &4) unsigned gvg_te_castle : 1; // GVG WOE:TE Castle #ifdef ADJUST_SKILL_DAMAGE unsigned skill_damage : 1; #endif } flag; You have to make it so that the script engine can read your flag, so go in npc.c and ctrl-f "nowarp": else if (!strcmpi(w3,"noteleport")) map[m].flag.noteleport=state; else if (!strcmpi(w3,"nowarp")) map[m].flag.nowarp=state; else if (!strcmpi(w3,"newmapflag")) map[m].flag.newmapflag=state; else if (!strcmpi(w3,"newmapflag2")) map[m].flag.newmapflag2=state; else if (!strcmpi(w3,"nowarpto")) map[m].flag.nowarpto=state; You should now be done, but if you want to make your flag work with the getmapflag/setmapflag/removemapflag script commands, you'll have to edit script.c: //BUILDIN_FUNC(getmapflag) case MF_NEWMAPFLAG: script_pushint(st,map[m].flag.newmapflag); break; //BUILDIN_FUNC(setmapflag) case MF_NEWMAPFLAG: map[m].flag.newmapflag = 1; break; //BUILDIN_FUNC(removemapflag) case MF_NEWMAPFLAG: map[m].flag.newmapflag = 0; break; Now you can use your mapflag in the source with (map[m].flag.newmapflag) { ... } Good luck ;O!
-
Envenom's element can be found in db/(pre-)re/skill_db.txt, look for TF_POISON. 52,-2,6,1,5,0,0,10,1,no,0,0,0,weapon,0,0x0, TF_POISON,Envenom The 5 is for poison. As for the rest, you'll have to look up how it's been implemented. Start off by checking in skill.c and you'll see soon enough that the status is applied in skill_additional_effect. You're looking for: case TF_POISON: case AS_SPLASHER: if(!sc_start2(src,bl,SC_POISON,(4*skill_lv+10),skill_lv,src->id,skill_get_time2(skill_id,skill_lv)) && sd && skill_id==TF_POISON ) clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); break; The proc chance is at (4*skill_lv+10), which is out of 100. If you want to costumize TF_POISON only, you'll have to separate it from AS_SPLASHER since they share the same poison effect. Battle formulas (or skill damage) are usually in battle.c. Searching for TF_POISON will get you to // renewal: if(skill_id == TF_POISON) //Additional ATK from Envenom is treated as mastery type damage [helvetica] ATK_ADD(wd.masteryAtk, wd.masteryAtk2, 15 * skill_lv); // or pre-renewal: if (skill_id == TF_POISON) ATK_ADD(wd.damage, wd.damage2, 15 * skill_lv); So the damage of 15 * skill_lv can be changed there. SP costs and other skill requirements are found in db/(pre-re)/skill_require_db.txt. 52,0,0,12,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //TF_POISON Poison will consume 12 SP as shown on the line above. Cast times and delays are found in db/(pre-)re/skill_cast_db.txt : //-- TF_POISON 52,0,0,0,0,15000:20000:25000:30000:35000:40000:45000:50000:55000:60000,0,0 So here it uses the 'duration2' field, which is then used in the function above 'skill_get_time2(skill_id,skill_lv)' to get the duration of the status on the player. You can get more info from the file's header. Edit: oops, I missed the pre-renewal part! Sorry ;x! Most of the information still works though xD
-
This feature is for other purposes! It will not create a thor patch. The problem is that your file names are not in the proper encoding. Download GRF Editor, go in File > New > New Thor. Click on 'root' > Container options (on the right side panel) > Set the Patching mode to Merge into GRF. Then drag and drop your files, save, and you should be able to patch properly. I'm guessing you're using Korean based file names, so you might want to change the encoding to Korean (Tools > Settings > General > Display encoding). Though this part doesn't change anything other than the language displayed.
-
clif_parse: Disconnecting Error session #3 with unknow packet version
Tokei replied to marcusvcr's question in General Support
(p:0x7ae7,1:19) looks like a packet when you connect to the map-server. Did you disable/enabe packet obfuscastion? -
-
Just wanted to point out that .@index = rand(0, getarraysize(.@item_ids) - 1); is the equivalent of .@index = rand(getarraysize(.@item_ids)); Except it's easier to read xD. Also, you should avoid using temporary char-bound variables in scripts (@item_id versus .@item_id), those are kept until the player logs out. The usage of "set" is also deprecated, you should be using 'variable = value;". prontera,137,203,4 script TEST::KST01 834,{ setarray .@item_ids, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510; for (.@i = 0; .@i < 5; .@i++) { .@index = rand(getarraysize(.@item_ids)); getitem .@item_ids[.@index], 1; deletearray .@item_ids[.@index], 1; } end; }
-
how to convert image by script runner in act editor?
Tokei replied to dreamsambit's question in Graphics Support
Bgra32 images take a lot more space than indexed8 images. Indexed8 images are RLE compressed while bgra32 images are just raw data. Either way, putting them in a GRF will compress your files so there's no real need to worry too much about that. -
how to convert image by script runner in act editor?
Tokei replied to dreamsambit's question in Graphics Support
You can simply right-click the image and convert it: I'm not sure what you're trying to do here. Edit: The script up there will break the SPR format. I should really remake that tool's interface, was a bit messy at the time. -
The GRF name doesn't matter, it's the executable name that has to be the same.
-
You wouldn't be able to patch your GRF anymore.
-
This error happens if the filename doesn't match the one used for the encryption. Make sure it is exact (it is case sensitive).
-
Big Head Characters + weapons, backpacks, wings, shields
Tokei replied to jumpjung's question in Client Requests
I'm going to copy paste what I wrote on Hercules: I'm afraid this link will not be coming back along with several other files I uploaded. I am aware many of you probably already has the files and that's great, but I'd kindly ask you not to re-upload them. I am no longer willing to share free content due to how often my work has been stolen recently. It got up to a point where one of my GRF was publicly available on a RO website with all of its files fully decrypted (it's been removed now, at least). It is very demotivating and does not make me want to give back, not for now anyway. -
Headgears cannot have more than 1 layer ingame. You can use Scripts > Generate sprite from selection. This will create a new layer with all your other layers merged into one (this will, however, increase the size of your spr file by a lot, especially if you're using semi-transparent images). What most people would do is to make a single image from all the black balls and move them with photoshop (well, I'm assuming they're moving).
-
Version 586: only for the final save, this version is buggy otherwise and should be avoided as much as possible. Version 620: everything else. You should not work with 586 for anything other than texture work. It has issues regarding the rotation of models (it's not rotating in the correct order). This cannot be fixed later on unless you redo all those objects manually. If you do not rotate your objects, you can use version 586 but you'll risk having a different map while using the client afterwards. The problem with 620 is that it doesn't calculate the quadtrees properly when you save it, so you have to switch back to 586 and save with an older version which was working fine for that part. (Bad quadtrees = black squares.)
-
Using an encoding different than 1252 or Korean will most likely cause you issues, so no these can't be converted back.
-
I'd recommend a script command instead for what you need. - script atcmd_mypoints -1,{ end; OnInit: bindatcmd "mypoints", strnpcinfo(3) + "::OnAtcommand", 0, 99; end; OnAtcommand: dispbottom "You have " + variable_here + " points.", 0x00ff00; end; } They are easier to manage and doesn't require a server recompile.
-
The GID is not supposed to be 199 (GIDs are way higher); the monster function does not return a value by default either, so I'm assuming you made a custom command? Either way, the following should work properly: monster(.@map$,359,294,"",2337,1); .@skillunit = $@mobid[0]; setunitdata .@skillunit, 9, 0; setunitdata .@skillunit, 29, 1; unitskilluseid .@skillunit,353,10,1;
-
Nightmareish Jitterbug (Episode 14.3)
Tokei replied to Nova's topic in Game, Event, Quest Script Releases
It's a value set source-wise after calling menu; it gives you the latest selected option. -
Well, you've never set the .map$ variable, so it defauts to an empty string. In the OnInit part, add .map$ = "prontera"; Or whatever map that you're using.
-
Your data folder files should be put inside your server's GRF, especially if they contain korean names (aka 'weird' symbols).
-
Team viewer for recompiling using cygwin
Tokei replied to rayleigh's question in Installation Support
As others have already told you, you're doing it wrong. You're applying a Linux compilation guide on Windows, this won't work (well it will but it's definitely not recommended). If you want to run your server on a Windows environment, you will need to compile it with Visual Studio, not cygwin. All the information you need can be found here: https://rathena.org/wiki/Installation_on_Windows . For the SQL installation part, you can use https://rathena.org/wiki/SQL_Installation#Windows . This is usually to make a local server. If you plan on making a 'real server', you'll most likely want a host which is going to be using Linux and then you'll have to use the other appropriate guides. -
You could use the following: UPDATE `debt` SET `zeny` = `zeny` - 1 WHERE `zeny` > 0