-
Posts
245 -
Joined
-
Last visited
-
Days Won
19
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by Winterfox
-
You could create a registration function to register a streamer via @command which sets an account variable that you can check for in another npc. A small example: - script STREAMER_SUPPLY FAKE_NPC,{ OnInit: bindatcmd("registerStreamer", strnpcinfo(3) + "::OnRegisterStreamer", 99); bindatcmd("unregisterStreamer", strnpcinfo(3) + "::OnUnregisterStreamer", 99); end; OnRegisterStreamer: OnUnregisterStreamer: if(.@atcmd_numparameters < 1) dispbottom("Usage: " + .@atcmd_command$ + " <charname>"); .@switch = (.@atcmd_command$ == "@registerStreamer") ? 1 : 0; charcommand("#set " + .@atcmd_parameters$[0] + " #STREAMER " + .@switch); } prontera,124,201,1 script Streamer Supplies 726,{ mes "[ Streamer Supplies ]"; mes "You are " + ((#STREAMER == 0) ? "no" : "an") + " Streamer!"; close; } @registerStreamer <charname> to register an account as streamer and @unregisterStreamer <charname> to unregister an account as streamer.
-
When you use the monster command with a label, the rid of the player that killed the mob is already attached to it, so you can execute all commands like he started the script himself. For example, you can give him an item with getitem. - script LAST_HIT_MONSTER FAKE_NPC,{ OnInit: monster("prontera", 0, 0, "Demo Poring", 1002, 10, strnpcinfo(3) + "::OnDemoPoringDead"); end; OnDemoPoringDead: getitem(502, 1); }
-
Your script thinks MD_CANATTACKMOB is a permanent variable attached to a character, but since this script doesn't get executed by a character, there is no rid attached. Therefore, the parser doesn't have a character it can get the MD_CANATTACKMOB variable from and defaults to 0. The reason why the parser thinks MD_CANATTACKMOB is a permanent character variable is because it isn't an existing monster mode flag. This means there is also no constant exported to the script space.
-
When Buy or Sell Card it will show like this.
Winterfox replied to ooGubAoo's question in Scripting Support
In OnSellItem and OnBuyItem replace close with end. This removes the error and just works like expected. Don't ask me why end has the same effect as close in these labels and seemingly creates a close button in the message box. I have no idea. -
That is good to hear. I already finished my version of the script I did out of curiosity, the only thing missing is a fitting map.
-
Hu? I thought my link gave you a virus, so to prevent spreading a malicious link I removed it.
-
I never heard of such problems with anonfiles, but I will remove the link from my post so no one else is in danger. Sorry for the inconvenience. As I said before, you can of course get the illustrations from a patched kro client. I will explain the process in detail: 1. Install a kro client. 2. Get the ro patcher lite from here: https://nn.ai4rei.net/dev/rsu/ 3. Put it in your kro client root folder. 4. Run the patcher till it says it is finished. 5. Open the data.grf in your kro client folder with a grf editor. I recommend this one: https://rathena.org/board/files/file/2766-grf-editor/ 6. Go to data/texture/À¯ÀúÀÎÅÍÆäÀ̽º/illust and put into the searchfilter: ep18 this will show you all illustrations of the ep 18 npcs in your grf. From there you can do whatever you want with them. Extract them and put them in your custom grf etc. The cutin function reads the pictures from the data/texture/À¯ÀúÀÎÅÍÆäÀ̽º/illust folder. Every .bmp file you put in there can be shown by the client via this function. You also can omit the .bmp extension when passing the filename to the function.
-
Why don't you update your grf using ro patcher lite from here: https://nn.ai4rei.net/dev/rsu/? Then you have always the latest content.
-
- Id: 6010 AegisName: Pickaxe Name: Pickaxe Type: Armor Buy: 10 Weight: 10 Attack: 10 Range: 1 Classes: Normal: true Upper: true Baby: true Gender: Female Locations: Both_Hand: true Script: | bonus bAspd,-30; bonus bCritical,100; bonus bAtkRate,-100; autobonus "{ callfunc \"Minner_Main\",1; }",10000,1,BF_WEAPON; EquipScript: | callfunc "Minner_Main",0; UnEquipScript: | callfunc "Minner_Main",2; According to the csv2yaml tool, your item should look like above. I can't check it, since I can't find the documentation of the old rathena text format. But without knowing the details of the item, it seems weird that it gets typed as armor and female only.
-
display count what they select in the menu
Winterfox replied to kalabasa's question in Script Requests
Then you are doing something wrong. I tested it and it works fine for me. prontera,155,177,5 script Test 100,{ if(select("Yes:No") == 1) $@yes++; else $@no++; announce("Yes: " + $@yes + " No: " + $@no, bc_all); end; } -
display count what they select in the menu
Winterfox replied to kalabasa's question in Script Requests
if(select("Yes:No") == 1) $@yes++; else $@no++; announce("Yes: " + $@yes + " No: " + $@no, bc_all); -
How do you create these special auras?
-
There is a slight mistake in the script, it has a chance of 1:99 instead of 1:100. if( .@rnd < .item_arrays[.@i+2] ) { Makes it range from 1 to 99 since the last check is: 1 - 100 < 100. //Created Date: 04/07/2022 - script AEOUS_MVP_DROP FAKE_NPC,{ OnNPCKillEvent: .@rnd = rand(1,100); if( getmonsterinfo( killedrid,MOB_MVPEXP ) <= 0) end; for( .@i = 0; .@i < getarraysize(.item_arrays); .@i += 3 ) { if( .@rnd <= .item_arrays[.@i+2] ) { getitem .item_arrays[.@i], .item_arrays[.@i+1]; announce "Congratulations! Player "+ strcharinfo(0) +" has obtained "+ getitemname( .item_arrays[.@i] ) +" ["+ .item_arrays[.@i+1] +"] from "+ getmonsterinfo(killedrid, 0) +" (chance: "+.item_arrays[.@i+2]+"%) MVP Drop(s).",bc_all,0x00FF00; } } end; } OnInit: // (<structure,<item_id>,<chances>) setarray .item_arrays[0], 675, 1, 10, 677, 1, 30, 7539, 1, 100; end; }
-
What happened is that rAthena uses a new format for the databases since the release of the script you are using. For the first, I assume the 200 is the ID to make sure it doesn't collide with upcoming instances. - Id: 200 Name: Emperium Test Breaker TimeLimit: 3600 Enter: Map: job3_arch01 X: 26 Y: 28 For the mob db you could simply copy the original Emperium und use the ID 3002 for the copy. But beware: You can't add 3002 if you use renewal, since a mob is already defined at this ID. In this case you would have to take an ID that is higher and match the script and mob avail accordingly. You mixed the order up in your mob avail: - Mob: 3002 Sprite: 1288 The first ID is the mob, the second is the sprite it should use, in this case the sprite of the emperium. The client doesn't know what sprite to show for your mob, so you have to tell the server to send it a known ID the client can use to show the mob.
-
How to set can't input same values in NPC?
Winterfox replied to Lilori's question in Scripting Support
mes "Pick your number!"; next; input(.@number); .@rowCount = query_sql("SELECT `number` FROM numberdb WHERE `number` = " + .@number + ";"); if(.@rowCount == 1) { mes "This number is already used. Try again."; close; } query_sql("INSERT INTO numberdb (`number`) VALUES (" + .@number + ");"); -
Logically, that would make sense, yes. But the calculations in ragnarok don't seem to always work exactly as one would expect under all circumstances.
-
It is hard to help you when parts of the NPC are missing.
-
Well in this case you will have to use a script to add the itemscript to the items. setarray(.@itemIds[0], 1101, 1102); for (.@i; .@i < ; .@i++) setitemscript(.@itemIds[.@i], "{ bonus(bMaxHP, 100); }");
-
bonus2 bSubEle,e,x; +x% damage reduction against attack element e I couldn't find a state bonus that gives immunity to an element. So I am not sure if something like that exists.
-
You have to put the script in the item you want to use it on in the item_db_equip.yml. - Id: 1101 AegisName: Sword Name: Sword Type: Weapon SubType: 1hSword Buy: 100 Weight: 500 Attack: 25 Range: 1 Slots: 3 Jobs: Alchemist: true Assassin: true Blacksmith: true Crusader: true Knight: true Merchant: true Novice: true Rogue: true SuperNovice: true Swordman: true Thief: true Locations: Right_Hand: true WeaponLevel: 1 EquipLevelMin: 2 Refineable: true Script: | bonus bMaxHP,100; - Id: 1102 AegisName: Sword_ Name: Sword Type: Weapon SubType: 1hSword Buy: 100 Weight: 500 Attack: 25 Range: 1 Slots: 4 Jobs: Alchemist: true Assassin: true Blacksmith: true Crusader: true Knight: true Merchant: true Novice: true Rogue: true SuperNovice: true Swordman: true Thief: true Locations: Right_Hand: true WeaponLevel: 1 EquipLevelMin: 2 Refineable: true Script: | bonus bMaxHP,100;
-
What is the best client to patch using Warp/Nemo for new Renewal + 4th classes?
Winterfox replied to zeusc137's question in General Support
I think supportwise the best option is to use a client with a date according to the packet version rathena uses by default or earlier, since I assume the packet version defined by rathena is the latest stable one and backwards compatibility is given by the server naturally growing with the version numbers of the client. -
I added the possibility to change the server to work with Argon2id hashes, since md5 is insecure since forever and there is no alternative, which bugged me for a while now. If someone of you is interested, you can find the source changes here: https://github.com/Reilaen/rathena/tree/feature/argon_2_hashing
-
These cooldowns are made with the quest commands. It works by giving the player a quest that has an expiration time. Here is a small example: prontera,124,201,1 script Example NPC 726,{ // Check if the time limit is still running. if(checkquest(200000, PLAYTIME) == 0) { mes "Example"; mes "I am still preparing the cake, please wait!"; close; } // Check if the time limit expired. if(checkquest(200000, PLAYTIME) == 2) { mes "Example"; mes "Finally! Here is your cake!"; erasequest(200000); getitem(12062, 1); close; } // Give the quest with the time limit mes "Example"; mes "Hello, how may i help you?"; mes "Oh, a free special cake?"; mes "Sure, i will bake you a fresh one."; mes "Please come back in 5 minutes!"; setquest(200000); close; } The actual quest and time limit is defined in the quest_db.yml. For the Example NPC the entry would look like this: - Id: 200000 Title: "Example Cake Timer" TimeLimit: +5mn If you want to show the quest info in the client like in your screenshot, you need to edit the System/OngoingQuestInfoList_True_EN.lub. For the quest in the example, the entry could look like this: [200000] = { Title = "Example Cake Timer", Description = { "Wait for Example to prepare your cake." }, Summary = "" }
-
There is a sample in the docs under doc/samples/instancing.txt. Please note the comment that says you need to add the instance to the database, for the script to work. It is in the old format, but you shouldn't have issues to convert it to the yaml version. //===== rAthena Script ======================================= //= Sample: Instancing //===== By: ================================================== //= Euphy //===== Last Updated: ======================================== //= 20140129 //===== Description: ========================================= //= Contains elements of a basic instance script. //============================================================ // Before running this script, add the entry below to // 'db/(pre-)re/instance_db.txt': // 100,Abyss Lake Instance,3600,300,abyss_03,160,155 // Instance Creation //============================================================ prontera,151,190,6 script Sample Instance 101,{ .@instance$ = "Abyss Lake Instance"; if (instance_live_info(ILI_NAME, instance_id(IM_PARTY)) == .@instance$) { // the instance "Abyss Lake Instance" is running mes "[Sample Instance]"; mes "You are already part of an instance."; next; switch(select("Enter Instance.:Cancel.")) { case 1: break; case 2: mes "[Sample Instance]"; mes "You don't want to try again?"; emotion ET_CRY; close; } } else if (instance_id(IM_PARTY)) { // another instance is running mes "[Sample Instance]"; mes "You are part of the instance " + instance_live_info(ILI_NAME, instance_id(IM_PARTY)) + "."; close; } else { mes "[Sample Instance]"; mes "Would you like to try the sample instance in Abyss Lake 3?"; next; switch(select("Create Instance.:Cancel.")) { case 1: .@create = instance_create(.@instance$); if (.@create < 0) { mes "[Sample Instance]"; switch (.@create) { case -1: mes "ERROR: Invalid type."; break; case -2: mes "ERROR: Party not found."; break; case -3: mes "ERROR: Instance already exists."; break; case -4: mes "ERROR: No free instances."; break; } mes " "; mes "Instance creation ^FF0000failed^000000."; emotion ET_HUK; close; } mes "[Sample Instance]"; mes "Instance created."; mes " "; mes "Now entering the instance..."; next; break; case 2: mes "[Sample Instance]"; mes "Okay. Maybe next time!"; close; } } .@enter = instance_enter(.@instance$); if (.@enter != 0) { mes "[Sample Instance]"; switch (.@enter) { case 1: mes "ERROR: Party not found."; break; case 2: mes "ERROR: Party does not have an instance."; break; case 3: mes "ERROR: Unknown error."; break; } mes " "; mes "Instance entry ^FF0000failed^000000."; emotion ET_HUK; close; } close; } // Instance Scripts //============================================================ abyss_03,154,159,6 script Instance NPC#start 101,{ mes "[Instance NPC]"; mes "Are you ready to begin?"; next; switch(select("Yes.:No.")) { case 1: mes "[Instance NPC]"; mes "Good luck."; close2; donpcevent instance_npcname("#ins_abyss03_mobs")+"::OnEnable"; delwaitingroom; disablenpc instance_npcname(strnpcinfo(0)); end; case 2: mes "[Instance NPC]"; mes "Take your time."; close; } end; OnInit: // hide the NPC on the normal map disablenpc strnpcinfo(0); end; OnInstanceInit: // initialize the NPC when the instance is created disablenpc instance_npcname("abysslakedunwarp004"); // disable original warp portal (currently buggy) waitingroom "Click here to start!",0; end; } abyss_03,0,0,0 script #ins_abyss03_mobs -1,{ end; OnEnable: initnpctimer; end; OnTimer1000: //strnpcinfo(4) will retrieve the instanced map name mapannounce strnpcinfo(4),"Instance NPC: The Abyss Lake instance has begun.",bc_all; end; OnTimer4000: mapannounce strnpcinfo(4),"Instance NPC: Smash the Treasure Chest in the center of the map for a prize.",bc_all; end; OnTimer5000: stopnpctimer; // spawn mobs .@map$ = instance_mapname("abyss_03"); .@label$ = instance_npcname(strnpcinfo(0))+"::OnMyMobDead"; .@label_boss$ = instance_npcname(strnpcinfo(0))+"::OnMyBossDead"; monster .@map$,0,0,"Huge Poring",1002,20,.@label$,2; monster .@map$,0,0,"Huge Drops",1113,15,.@label$,2; monster .@map$,0,0,"Huge Poporing",1031,10,.@label$,2; monster .@map$,0,0,"Huge Marin",1242,10,.@label$,2; monster .@map$,0,0,"Tiny Zombie",1015,30,.@label$,1; monster .@map$,0,0,"Huge Mime Monkey",1585,2,.@label$,2; monster .@map$,97,102,"Treasure Chest",1732,1,.@label_boss$,2; end; OnMyMobDead: // normal mobs dispbottom "What am I doing? I should be attacking the Treasure Chest!"; viewpoint 0,97,102,0,0xFF0000; switch (rand(6)) { // for fun (: case 0: sc_start SC_STONE,5000,0; break; case 1: sc_start SC_FREEZE,5000,0; break; case 2: sc_start SC_STUN,5000,0; break; case 3: sc_start SC_SLEEP,5000,0; break; case 4: sc_start SC_CONFUSION,5000,0; break; case 5: sc_start SC_BLIND,5000,0; break; } end; OnMyBossDead: // treasure chest specialeffect2 EF_MVP; getitem 512,1; //Apple // trigger other events .@map$ = instance_mapname("abyss_03"); .@label$ = instance_npcname(strnpcinfo(0))+"::OnMyMobDead"; killmonster .@map$,.@label$; mapannounce .@map$,"Instance NPC: Good work! Please speak to me as soon as possible.",bc_all; donpcevent instance_npcname("Instance NPC#finish")+"::OnEnable"; end; } abyss_03,97,102,4 script Instance NPC#finish 101,{ mes "[Instance NPC]"; mes "Congratulations! You've finished the instance."; mes "I'll send you back to town now."; emotion ET_BEST; close2; warp "prontera",156,191; instance_destroy(); end; OnInit: disablenpc strnpcinfo(0); end; OnInstanceInit: disablenpc instance_npcname(strnpcinfo(0)); end; OnEnable: enablenpc instance_npcname(strnpcinfo(0)); specialeffect EF_HIDING; end; } abyss_03,115,26,0 script #ins_abyss03_warp 45,5,5,{ end; OnTouch: mes "Are you sure you want to leave?"; next; switch(select("Leave.:Stay.")) { case 1: warp "prontera",156,191; break; case 2: warp strnpcinfo(4),160,155; break; } close; OnInit: disablenpc strnpcinfo(0); end; }