-
Posts
618 -
Joined
-
Last visited
-
Days Won
11
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by Z3R0
-
Personally, if someone was asking this in Request, then I would help write the script, but when asking for support, I gave a more broad example of how to actually write the script yourself and all the things you should look for and focus on.
-
BWA HA HA HA Absolutely not, it's actually copy and pasted from the rathena script_commands.txt https://github.com/rathena/rathena/blob/master/doc/script_commands.txt
-
I won't explain exactly how to do this, but you could simply use the following information OnPCKillEvent: This special label triggers when a player kills another player. The variable 'killedrid' is set to the ID of the player killed. *getmapxy("<variable for map name>",<variable for x>,<variable for y>{,<type>,"<search value>"}) *getcharid(<type>{,"<character name>"}) // Type = 3 (for Account ID) #KAFRAPOINTS *attachrid(<account_id>); - Attaches Script to Account ID (reads information from attached account) Using the information here, we can determine the following: When the Trigger Runs, we can use getmapxy to determine the location of the user and check the map that they are on, the NPC should be hidden with a -1 and placed on the map... I believe it will only trigger if ON that map, but I could be mistaken, hence the reason to use getmapxy and check... Once you determined if they are on that map, the next thing to do, would be to set a variable called origrid = getcharid(3); // this will allow you to go "back" to this user, once we go to the killed user to get their information... So, then using attachrid(killedrid); you can attach the script to the killed player, and then store a variable (npc variable) to store the #KAFRAPOINTS they had, and no you can set those to ZERO... Then reattach the script back to the origrid and add that npc variable with the #KAFRAPOINTS to the original killer's #KAFRAPOINTS
-
Forgot to delitem the redpot ?
-
Glad you got it resolved. Sorry, I don't get on much during the weekends ?
-
Which part of the script actually breaks? The first menu? after you select it? More details are definitely needed ?
-
I might actually try and tackle this... I can already see quite a few ways this can be implemented... ?
-
itemdb_readdb: Invalid format (Script column) in line 111
Z3R0 replied to Get Backers's question in Database Support
First, this probably belongs in Support, NOT requests... setarray .@maps$, "dbroom1", "dbroom2", "dbroom3"; if (inarray( .@maps$, strcharinfo(3) )) { delitem 604,1; monster "this",-1,-1,"--ja--",-1,1,""; } else dispbottom "This item cannot be used within this are. please use the db room!"; },{},{} might make debugging a bit easier to see -
https://pastebin.com/sCJ905qt this should resolve it, see the first example, where I use strings, and combine multiple prizes with | and also specify multiple rewards with prizes... It's not "perfect" but it should get the job done (untested)
-
Above the else... But @part needs to change to @refine
-
Do you have hte script that you wrote?
-
after OnShower: OnShower: if (!getgmlevel() < 99) { end; }
-
fyi, I think I missed a closing } at the bottom (but if I edit it, it screws up the code...)
-
Sure I can rewrite it tonight and put some comments around the code
-
Use the 2nd one I wrote, not the first... the first had a glitch in it... check all map variables.. make sure they match :D
-
- script Sample -1,{ OnInit: set .amount, 40; // amount of item to shower set .item_id, 7227; // item id to shower set .item_id2, 1234; // next item id to shower bindatcmd "itemshower",strnpcinfo(3)+"::OnShower"; end; OnShower: getmapxy .@map$, .@x, .@y, UNITTYPE_PC; while ( .count < .amount ) { do { .@x_diff = .@x + rand(1,5); .@y_diff = .@y + rand(1,5); } while (!checkcell(.@map$,.@x_diff,.@y_diff,cell_chkpass)); .@var = rand(2); makeitem .@var?.item_id:.item_id2,1,.@map$,.@x_diff,.@y_diff; set .count, .count + 1; } set .count, 0; end; This will make the command @itemshow ... start with the characters position, then it will consider a differential between 1 and 5 from their X,Y coordinates to "shower" around them...
-
- script Sample -1,{ OnInit: set .amount, 40; // amount of item to shower set .item_id, 7227; // item id to shower set .item_id2, 1234; // next item id to shower bindatcmd "itemshower",strnpcinfo(3)+"::OnShower"; end; OnShower: getmapxy .@map$, .@x, .@y, UNITTYPE_PC; while ( .count < .amount ) { do { .@x_diff = .@x + rand(1,5); .@y_diff = .@y + rand(1,5); } while (!checkcell(.@map$,.@x_diff,.@y_diff,cell_chkpass)); .@var = rand(2); makeitem .@var?.item_id:.item_id2,1,.map$,.@x,.@y; set .count, .count + 1; } set .count, 0; end; This will make the command @itemshow ... start with the characters position, then it will consider a differential between 1 and 5 from their X,Y coordinates to "shower" around them...
-
Of course, you could do something much simpler just.... set got_plat_skills, 1; // on a player when they receive them, and simply check it...
-
Untested, but makes for easy updating without a bunch of repetition... harboro1,128,200,6 script Platinum Skill Pusher 779,{ function SetSkills; function SetJobLevel; function Validate; mes "[Platinum Skill Pusher]"; mes "Pssst, ehy you!"; mes "Hand me ^0000FF100.000 zeny^000000 and you'll avoid a boring training, none will know!"; mes "Man, there's no refund... are you sure you want it?"; next; if (select("Yes Please:No") == 2) { mes "[Platinum Skill Pusher]"; mes "Have a nice day... dude!"; close; } if( Zeny < .@zeny ) { mes "...ehy dude, you need ^0000FF100.000 zeny^000000,"; mes "ask them to mom!"; close; } Validate(); set Zeny,Zeny -100000; callfunc "F_GetPlatinumSkills"; mes "[Platinum Skill Pusher]"; mes "Dehee thanks man...lazy people like you makes me rich buahah!"; close; OnInit: SetSkills(Job_Swordman, 144, 145, 146); SetJobLevel(Job_Swordman, 35); SetSkills(Job_Mage, 157); SetSkills(Job_Archer, 147, 148); SetSkills(Job_Acolyte, 156); SetSkills(Job_Merchant, 153, 154, 155); SetSkills(Job_Thief, 149, 150, 151, 152); SetSkills(Job_Knight, 1001); SetSkills(Job_Wizard, 1006); SetSkills(Job_Hunter, 1009); SetSkills(Job_Priest, 1014); SetSkills(Job_Blacksmith, 1012, 1013); SetSkills(Job_Assassin, 1003, 1004); SetSkills(Job_Crusader, 1002); SetSkills(Job_Sage, 1007, 1008, 1017, 1018, 1019); SetSkills(Job_Bard, 1010); SetSkills(Job_Dancer, 1011); SetSkills(Job_Monk, 1015, 1016); SetSkills(Job_Alchemist, 238); SetSkills(Job_Rogue, 238); set .@zeny, 100000; end; // getarg(0) = Class ID // getarg(1+) = Skill ID function SetSkills { // Skip 0 because that's Class ID, not a Skill ID for(.@i = 1; .@i <= getargcount(); .@i++) { setd(".job_" + getarg(0) + "_skills["+(.@i - 1)+"]", getarg(.@i)); // .job_ClassID[0] = SkillID 1, [1] = SKill ID2 etc... } return; } // getarg(0) = Class ID // getarg(1) = Job Level function SetJobLevel { for(.@i = 1; .@i <= getargcount(); .@i++) { setd("job_" + getarg(0) + "_level", getarg(1)); } return; } function Validate { if (getd(".job_" + Class + "_level")) { if (JobLevel < getd(".job_" + Class + "_level")) { mes "You do not meet the Job Level Requirements"; close; } } for(.@i = 0; .@i < getarraysize(getd(".job_" + Class + "_skills")); .@i++) { if (getskilllv(getd(".job_" + Class + "_skills["+.@i+"]"))) { mes "You have already received your skills"; close; } } return; } }
-
Yes, this is exactly what instances are for.... You in theory "temporarily duplicate a map" to create an instance of it, and it's available while the instance is alive...
-
Custom Enchant NPC : script line for success percentage
Z3R0 replied to kamirie's question in Scripting Support
Correct it will continue down to the next else if if the first if fails... so it just tiers downwards... so if it never falls between X number then it doesn't work... the difference, is the more "chance" you want to give, the higher the initial value needs to be... especially when dealing with multiple cases... for instance in that case he went from 1 to 555... he could have gone from 1 to 100, but that would lower the chances between the items since you only have 100 total options, and have to split them among X number of items... so by increasing the base number from 100 to 555, he increased the chance range between goods so that they have a higher chance of hitting... -
Custom Enchant NPC : script line for success percentage
Z3R0 replied to kamirie's question in Scripting Support
Well, kinda... that makes it almost 50% chance... 36/60... where as ALL 60 #'s would be 100% so 36/60 would be 60/100 = 36/X .... so cross multiply / divide ==.... 100 * 36 / 60 = 60% chance refine rate... it would have been the same as doing... 1 outta 5... and only accept 1,2,3 and not accepting 4,5 ... The issue, is that you have to break it down to the common denominator... since you want a 1% chance you will most likely need to do it out of a full 100.... set .@chance, rand(1,100); if (.@chance == 1) { // The 1% chance is successful! } elseif (.@chance <= 10) { // 10% chance } elseif (.@chance <= 30) { // 30% chance } elseif (.@chance <= 75) { // 75% chance } else { mes "Failed"; close; } -
if (Class = X && getskilllv(145) && getskilllv(#)) { mes "sorry"; close; } There's probably some better ways to do it, but this is a basic way...
-
no reason to set a needless variable when you can just determine if they have the skills or not
-
add a check if (getskilllv(152)) // 152 = SKILL ID ... if they already have it, then just have them say mes "Sorry"; close; Thanks, Z3R0