-
Content Count
363 -
Joined
-
Days Won
46
Posts posted by meko
-
-
One could make a script command ("buildin") for this, but iterating through every single player every time this command is called would be very slow, especially if there's like 2k players online. One solution could be to have a separate property of map besides map->users that would count just like map->users but would be updated every time a player's vending state changes... but this would not be general-purpose so I don't think it should be in the core engine, this should rather be a plugin
-
What are you referring to? "SB" could mean anything; please elaborate.
If you're trying to change the attack range of a monster, have a look at db/re/mob_db.conf and db/mob_db2.conf
-
That sentence is sent directly to clif, which sends to the client so you can't catch it without source modification. If what you want is just to count all connected users there's an easy way for that:
getusers(1)
-
For the cheapest VPS offers have a look at LowEndBox.
Keep in mind that most of those cheep providers advertised on LowEndBox do not offer DDOS protection.
As for a guide to setting up a VPS running Hercules, I would first advise you to learn the basics of Linux:
https://www.linux.com/learn/complete-beginners-guide-linux
https://opensource.com/education/14/4/windows-to-linux-system-administration
http://linuxsurvival.com/linux-tutorial-introduction/
For the distribution, I recommend Debian, or Ubuntu Server (which is itself based on Debian)
What is a VPS, what are the limitations:
http://www.webhostingsecretrevealed.net/vps-hosting-guide/
How to use SSH:
https://support.suso.com/supki/SSH_Tutorial_for_Linux
https://www.ssh.com/ssh/putty/windows/
How to use git:
https://git-scm.com/documentation
How to compile Hercules:
https://github.com/HerculesWS/Hercules/blob/master/README.md#prerequisites
How to use SQL:
-
La documentation de Hercules est toujours à jour, puisqu'elle est aussi versionnée dans le répertoire git. Donc peut importe quelle version tu as, tu as toujours la documentation qui va avec.
Regarde ce lien pour savoir comment compiler (dans Visual Studio 2015):
https://github.com/HerculesWS/Hercules/blob/master/README.md#prerequisites
Et ce lien pour savoir comment scripter:
https://github.com/HerculesWS/Hercules/blob/master/doc/script_commands.txt
Pour la documentation intégrale:
https://github.com/HerculesWS/Hercules/tree/master/doc
Et pour l'amour de tout ce qui existe, pitié, rends service à l'Humanité toute entière et n'utilises plus jamais Comic Sans.
-
@True Zeal
thanks for that info
For commands introduced by plugins I believe you can simply add them to groups.conf like any other command. For commands introduced by scripts though you have to set the group in bindatcmd, but soon you'll be able to specify for each individual group.
----------------------------------------------------------------
@CraftNCheez
simply add the following to your groups.conf, in the Commands section of the Player group:
feelreset: true allskill: true hatredreset: true
Hope it helps
-
-
In your example you set it to zero (false) but you should set it to one (true), else you just disable the already-disabled flag.
Also please make sure your X1, Y1, X2, Y2 are valid coordinates. In the picture you referenced your (X1,Y1) and (X2,Y2) are in the wrong corners; It should be top-left and bottom-right.
See http://herc.ws/board/topic/14707-making-square-as-basilica/?p=82285
-
Here, I made this for you:
- script @give FAKE_NPC,{ end; OnCall: .@full$ = implode(.@atcmd_parameters$[0], " "); // put the string back together if ((.@full$ ~= "^([1-9]{1,10}) ([Zz]enys?|[Ii]tems? ([0-9]+)|[Cc]ash(?: ?point)?s?) to (.{1,23})$") == false) { dispbottom("@give : Invalid syntax!"); dispbottom("@give : Proper syntax is @give <amount> <zeny | item <name> | cash> to <player name>"); end; } .@amount = max(1, atoi($@regexmatch$[1])); .@type = ord(strtolower($@regexmatch$[2])); .@item = atoi($@regexmatch$[3]); .@player$ = escape_sql($@regexmatch$[4]); .@player = getcharid(CHAR_ID_ACCOUNT, .@player$); .@char = getcharid(CHAR_ID_CHAR, .@player$); .@count = query_sql(sprintf("SELECT `name`, `char_id`, `account_id` " "FROM `char` " "WHERE `name` = '%s' LIMIT 1;", .@player$), .@player$, .@char, .@player); if (.@count < 1 || .@player < 1 || .@char < 1) { dispbottom("@give : Player not found in database!"); end; } switch (.@type) { case 122: // ZENY if (isloggedin(.@player, .@char)) { charcommand(sprintf("#zeny \"%s\" %i", .@player$, .@amount)); } else { query_sql(sprintf("INSERT INTO `mail` (send_name,dest_name,dest_id,title,time,zeny) " "VALUES ('%s','%s',%i,'%s',%i,%i);", "SRV", .@player$, .@char, "Event Reward", gettimetick(2), .@amount)); } break; case 105: // ITEM if (.@item < 1 || getiteminfo(.@item, 0) < 0) { dispbottom("@give : Item not found!"); end; } if (isloggedin(.@player, .@char)) { getitem(.@item, .@amount, .@player); } else { query_sql(sprintf("INSERT INTO `mail` (send_name,dest_name,dest_id,title,time,amount,nameid) " "VALUES ('%s','%s',%i,'%s',%i,%i,%i);", "SRV", .@player$, .@char, "Event Reward", gettimetick(2), .@amount, .@item)); } break; case 99: // CASH if (isloggedin(.@player, .@char)) { set(getvariableofpc(#CASHPOINTS, .@player), getvariableofpc(#CASHPOINTS, .@player) + .@amount); } else { query_sql(sprintf("UPDATE `acc_reg_num_db` " "SET `index` = `index` + %i " "WHERE `account_id` = %i AND `key` = '#CASHPOINTS';", .@amount, .@player)); } } dispbottom(sprintf("@give : Reward has been delivered to `%s`.", .@player$)); end; OnInit: bindatcmd("give", "@give::OnCall", 0, 99, 0); // <<< MAKE SURE YOU CHANGE THE GROUP ID HERE }
Example usage:
@give 50 zeny to meko @give 69 cash to meko @give 1 item 508 to meko
If the player is online the reward is delivered instantly; If the player is offline the reward is delivered via the mail system (except for Cash rewards)
-
-
This will just encourage people making spam posts to increase their post count, and encourage creating other accounts to increase reputation. It makes everything cumbersome for everyone. You cannot and should not force people to contribute. You'll just end up driving away possible contributors to other projects (ie rAthena). Most people nowadays prefer to try first, then if they like it they come back and contribute. If people feel forced they just bail.
-
You could also emulate it in your scripts by adding some zeros to your numbers, ie
.@percent = rand(10000); if (.@percent == 4273) { // 42.73% }
-
well I assumed it was more than one because your percentage exceeds 100%, which implies you want to give 1~2 (154% ➜ 1.54) items
-
you could make it use doevent() to call an external script and in that script do the check for enchant poison, and call itself with addtimer() with a short delay like 500ms, so it will keep checking
-
You want the player to get only one item? Your percents make a total of 154% ...
list of items,qty / Chance
607,5 50%
608,6 52%
678,4 50%
672,1 2%
Try this:
.@rnd = rand(154); if (.@rnd < 50) { getitem(607, 5); } else if (.@rnd < 102) { getitem(608, 6); } else if (.@rnd < 152) { getitem(678, 4); } else { getitem(672, 1); }
-
Very hard to understand what you're saying... Try to just say it in Spanish and I'll use Google Translate on my side.
Also why did you remove all the parentheses? o_o
Not using them is the legacy syntax and is deprecated.
And if you do remove them you can't omit the space and do things like
input.@input;
And you can't just turn a mesf() into a mes(), there's extra parameters
Do you happen to be using rAthena and not using the right forums? I can't think of any other reason why you would turn a properly formatted script back to a horror show otherwise.
If what you want is to prevent the quest from being done again I had already added in the script a method to prevent it, just uncomment the line:
.quest_tratoa = 2;
If what you're saying is you can't get it to work at all, well in your modified version there is a ton of malformed lines, so fix that first.
-
-
It seems there's been no changelog since quite a while so here's one highlighting the most recent changes related to scripting.Sorry if that's not the right category, please move accordingly.New script commands:- chr
- ord
- gettimer
- getunits
- getvariableofpc
- can_use_command
- has_permission
- addchannelhandler
- removechannelhandler
- setunitdata
- getunitdata
- getunitname
- setunitname
- getequipisenableopt
- getequippedoptioninfo
- getequipoptioninfo
- setequipoption
- navigateto
Modified script commands (extra parameters):- strcharinfo
- strnpcinfo
- addtimer
- deltimer
- addtimercount
- checkoption
- checkoption1
- checkoption2
- setoption
- warpparty
- warpguild
- classchange
New params:Big projects currently in development:
-
You can implement your own wrapper functions around atcommands by using bindatcmd()
-
Just add more Apple in the Drops{} section of the Poring. You can have a maximum of 10 drops per monster, so you will have to remove some existing drops if you want 8 apples.
-
first you might want to change this
setunitdata(.@unitID, UDT_MODE, getunitdata(.@mobGID, UDT_MODE) &~ 1);
to this (mobGID is unused here)
setunitdata(.@unitID, UDT_MODE, getunitdata(.@unitID, UDT_MODE) &~ 1);
to set the AI to zero you don't need to do any bitwise operation, you can just do this:
setunitdata(.@unitID, UDT_AI, 0);
to prevent skill use I'm not sure, you could try setting UDT_ATKMAX and UDT_MATKMAX to 0, or setting UDT_CANMOVETICK to 2147483647 (but that's just an ugly workaround, if it works at all)
-
First of all, I would encourage you to read the whole documentation to understand how the herc language works. If you still have problems then, here's something that could help you get started:
<map>,<x>,<y>,<dir> script <name> <sprite>,{ // YOUR INPUT FUNCTIONS GO HERE function input_mob_id { do { mes("Please enter the desired mob ID."); input(.@id, 1001, 10000); } while(getmonsterinfo(.@id, MOB_LV) < 0); // ^ the above will keep asking the player over and over until // they enter the ID of a monster that exists next(); return .@id; } function input_mob_agi { mes("Please enter the desired AGI."); input(.@agi, 1, 99); // ^ the above will ask the player once, but cap the value next(); return .@agi; } // YOUR MAIN SCRIPT GOES HERE do { mes("Hi there, please enter the desired values."); // print a message next(); // require the player to click "next" .@mobID = input_mob_id(); // call the mob id menu, store the value .@mobAGI = input_mob_agi(); // call the mob AGI menu, store the value // ^ HERE ADD MORE CALLS AS NEEDED mes("Do you wish to proceed?"); // print a message select("Start over.", "Proceed."); // ask the player if they wish to continue } while (@menu != 2); mes("Please close the dialog to continue."); close2(); // require the player to close the dialog // HERE SPAWN YOUR MONSTER .@unitID = monster("<map name>", <x>, <y>, getmonsterinfo(.@mobID, MOB_NAME), .@mobID, 1); // MAKE SURE TO CHANGE THE map, x and y // NOW MANIPULATE THE MONSTER WITH THE DATA YOU GATHERED setunitdata(.@unitID, UDT_AGI, .@mobAGI); end; // terminate the script }
-
for inputs just use the aptly-named input() command.
if you want to restrict to only a few choices you could use select() in combination with switch()
-
here, I made this for you:
<map>,<x>,<y>,<dir> script <name> <sprite>,{ mes("Hi there."); mes("Can I help you?"); next(); select("claim reward"); mes("..."); next(); for (.@i = 0; .@i < .reward_len; .@i += 3) { if (rand(100) < .reward[.@i + 2]) { getitem(.reward[.@i], .reward[.@i + 1]); mesf("You obtained %i %s.", .reward[.@i + 1], getitemname(.reward[.@i])); .@reward = true; // got at least one reward next(); } } if (.@reward != true) { mes("It seems you're out of luck."); next(); } mes("Come back anytime!"); close; OnInit: setarray(.reward[0], //ID,QTY,% 607, 5, 50, 608, 6, 52, 678, 4, 50, 672, 1, 2); .reward_len = getarraysize(.reward); }
hope it helps
UPDATE: added reward_len (sorry, forgot that)
Creating custom item triggers NPC
in Script Requests
Posted
For this simply make a new item and in the script<> section use getitem() for each item you want to give, then use doevent() to call your npc script and in this npc before any dialog use delitem() to remove the box, then put your dialog that asks which item you want