Skip to content

Commit 3358acf

Browse files
committed
Update highlight language of some scripts to HercScript
1 parent c2d5179 commit 3358acf

File tree

4 files changed

+71
-71
lines changed

4 files changed

+71
-71
lines changed

docs/basics/zeny.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ setting `vending_over_max` in
4343
The name `Zeny` is recognized by the script engine as a [parameter constant](../scripting/parameter-constant.md), which
4444
affects the amount of Zeny of the [currently attached](./rid.md#usage) player. It can be both read and written.
4545

46-
```C
46+
```HercScript
4747
Zeny += 120; // gives the player 120z
4848
mesf("Your current balance is %dz.", Zeny);
4949
Zeny = 0; // takes all Zeny from the player

docs/customization/war-of-emperium.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Open
88
[`npc/guild/agit_controller.txt`](https://github.com/HerculesWS/Hercules/blob/stable/npc/guild/agit_controller.txt)
99
The body of the script should look similar to the following:
1010

11-
```C
11+
```HercScript
1212
- script Agit_Event FAKE_NPC,{
1313
end;
1414

docs/scripting/timers.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ lines.
1515
Here's an example of it in proccess.
1616
We'll take this apart after we look at it.
1717

18-
```C
18+
```HercScript
1919
prontera,23,20,2 script Non-spamming-NPC-Talker 1_M_JOBGUIDER,{
2020
end;
2121
@@ -49,7 +49,7 @@ We'll start with "OnInit:".
4949
Q: What is "OnInit:"?
5050
A: "OnInit:" is the commands you wish the NPC to execute right after the NPC is loaded.
5151

52-
```C
52+
```HercScript
5353
OnInit:
5454
$GlobalVariable = 10;
5555
end;
@@ -67,7 +67,7 @@ has ended.
6767

6868
**If you do not end the "On" label with "end;", horrible things will happen, such as running through other labels.**
6969

70-
```C
70+
```HercScript
7171
OnInit:
7272
$GlobalVariable = 10;
7373
@@ -84,7 +84,7 @@ Note: Sometimes this is usefull too...
8484

8585
Example:
8686

87-
```C
87+
```HercScript
8888
// ...
8989
9090
OnClock2100:
@@ -104,7 +104,7 @@ This Script will run at 21:00 AND at 23:00 (c&p from the woe-starting-script)
104104
Delayed warping is a feature you can put in your script to add more drama, or to automatically warp someone from a room
105105
when the player has exceeded the allotted time for being there. Here is an example of a delayed warp:
106106

107-
```C
107+
```HercScript
108108
prontera,23,20,2 script Bomb Squad 1_M_JOBGUIDER,{
109109
mes("[Dismantler]");
110110
mes("Where is the bomb? WHERE IS IT??");
@@ -144,7 +144,7 @@ However, the script will keep on running in the background, after the close butt
144144
presses the close button, it continues with the next line. For you lazy bums, here is an outtake of the script to
145145
prevent your scrolling finger from getting tired.
146146

147-
```C
147+
```HercScript
148148
addtimer(15000, "Bomb Squad::OnWarn");
149149
addtimer(30000, "Bomb Squad::OnBoom");
150150
dispbottom("Dismantler : The bomb will detonate in 30 seconds!");
@@ -167,7 +167,7 @@ need to manipulate the player later on, we need the script to remember the RID.
167167

168168
Anyway, after 15 seconds, if the player hasn't logged out, the script will restart at the following point:
169169

170-
```C
170+
```HercScript
171171
OnWarn:
172172
dispbottom("Dismantler : OH MY GOD! ONLY 15 SECONDS LEFT - HURRY!!!!");
173173
end;
@@ -176,7 +176,7 @@ OnWarn:
176176
What it does here, is another text display in the chat of the player, and then end the script again. So, we wait, and we
177177
wait, and then, after another 15 seconds, the second timer triggers the label OnBoom:, and starts this piece of code:
178178

179-
```C
179+
```HercScript
180180
OnBoom:
181181
dispbottom("*time slows down as suddenly the ticking stops*");
182182
dispbottom("....");
@@ -203,7 +203,7 @@ addtimer command, as they both behave the same.
203203

204204
so the Bomb Squad npc script now look like this
205205

206-
```C
206+
```HercScript
207207
prontera,155,188,2 script Bomb Squad 1_M_JOBGUIDER,{
208208
mes("[Dismantler]");
209209
mes("Where is the bomb? WHERE IS IT??");
@@ -241,7 +241,7 @@ see the player variable boom set back to 0 with "[set](./commands/set.md) @boom,
241241

242242
Now, on to the bomb npc.
243243

244-
```C
244+
```HercScript
245245
prontera,50,50,2 script Bomb HIDDEN_NPC,{
246246
if (@boom == 0)
247247
end;
@@ -272,7 +272,7 @@ and recompile your server.
272272

273273
Let's start with another example:
274274

275-
```C
275+
```HercScript
276276
prontera,23,20,2 script Daily Healer 1_M_JOBGUIDER,{
277277
mes("[Healer]");
278278
mes("Hello there.");
@@ -311,7 +311,7 @@ A: That is correct. This NPC uses what I would like to call a Static Timer. We w
311311
Ok, at a first glance, this is a normal healer NPC that fully heals your HP and SP. The interesting part though is at
312312
the bottom. Let's start with the bottom most part:
313313

314-
```C
314+
```HercScript
315315
close2();
316316
percentheal(100, 100);
317317
TimeHealed = gettimetick(GETTIMETICK_UNIXTIME);
@@ -322,7 +322,7 @@ the bottom. Let's start with the bottom most part:
322322
The NPC does the healing here, but after the healing, it sets a weird value to TimeHealed. First, it gets a value from
323323
`gettimetick(GETTIMETICK_UNIXTIME)`. This command returns the amount of seconds elapsed since 1/1/1970, based on your server current time.
324324

325-
```C
325+
```HercScript
326326
if (TimeHealed + 86400 > gettimetick (GETTIMETICK_UNIXTIME)) {
327327
```
328328

@@ -340,7 +340,7 @@ making it dynamic means.
340340

341341
By turning that numbers into a Global variable,
342342

343-
```c
343+
```HercScript
344344
if ((TimeHealed + $HealInterval) > Gettimetick(GETTIMETICK_UNIXTIME)) {
345345
```
346346

@@ -397,7 +397,7 @@ How they work? Relatively easy. OnClock is already explained in the first part o
397397
case you forgot. To make it work, you replace XXXX by an actual time in the 24 hour format. The time you put there, is
398398
when the label is triggered. So, for example:
399399

400-
```C
400+
```HercScript
401401
OnClock0700: // This label is triggered at 7 AM servertime.
402402
OnClock1414: // This label is triggered at 2:14 PM servertime.
403403
```
@@ -409,7 +409,7 @@ month, the second XX is the day of that month. When it is that day, it will be t
409409
only once at the start of that day, or the first time that your server is up during that day. Here are a couple of
410410
examples:
411411

412-
```C
412+
```HercScript
413413
OnDay0101: // This label is triggered on the first day of January.
414414
OnDay0515: // This one is triggered on the fifteenth day of May.
415415
OnDay1231: // This one is triggered on the last day of December.
@@ -420,7 +420,7 @@ OnDay0229: // This label is only triggered when it is February 29th,
420420
OnHourXX and OnMinuteXX are similar in use. With OnHour, the XX stands for a specific hour during the day when it is
421421
triggered. The XX within OnMinute stands for a specific minute per hour. Some examples to make it clear:
422422

423-
```C
423+
```HercScript
424424
OnHour01: // Triggers at 1 AM every day.
425425
OnHour20: // Triggers at 8 PM every day.
426426
OnMinute00: // Triggers at each new hour, so 1:00, 2:00, 3:00, 4:00 etc.
@@ -433,7 +433,7 @@ replaced by a number in the same way as the XXXX in OnClockXXXX. It notes a spec
433433
triggered on the specified day of the week (SSS) at the specified time in 24 hour format (XXXX). At least, that is the
434434
theory. Here are some examples you can work with:
435435

436-
```C
436+
```HercScript
437437
OnSat1200: // Triggers at noon on each Saturday.
438438
OnTue0707: // Triggers at 7 past 7 AM on Tuesday.
439439
```
@@ -443,7 +443,7 @@ Note: Although there is no OnSecondXX or OnMillisecondXXXX label, you can simula
443443
heavy load on your server. To do this, you will have to use a NPC. Here is a short example simulating OnSecond30 using a
444444
NPC timer:
445445

446-
```C
446+
```HercScript
447447
- script Annoying Announcer FAKE_NPC,{
448448
OnInit:
449449
initnpctimer();
@@ -460,7 +460,7 @@ OnTimer1000:
460460

461461
And one that triggers every 40 milliseconds:
462462

463-
```C
463+
```HercScript
464464
- script Flooder FAKE_NPC,{
465465
OnInit:
466466
initnpctimer();
@@ -492,7 +492,7 @@ There are many more of these kinds of special event triggered labels, like the l
492492
exception of OnTimerX, are all triggered without the need of a player. With OnTimerX, the X should be replaced by a time
493493
in milliseconds, for example:
494494

495-
```C
495+
```HercScript
496496
OnTimer100: // Triggers 100ms after a player timer or NPC timer is started in the same NPC.
497497
OnTimer3600000: // Triggers 1 hour after a player timer or NPC timer is started in the same NPC.
498498
```
@@ -553,7 +553,7 @@ online, the player's RID will be set equal to his account ID (`getcharid(CHAR_ID
553553

554554
Some examples:
555555

556-
```C
556+
```HercScript
557557
initnpctimer(); // Start a new NPC timer and make it count from 0.
558558
initnpctimer("My Other NPC"); // Start a new NPC timer in the NPC named "My Other NPC" and make it count from 0.
559559
@@ -571,7 +571,7 @@ this command. If you like you can read `continuenpctimer` instead of `startnpcti
571571
Again, for the various options, you might want to look at `InitNPCTimer`. We will just show
572572
some examples here:
573573

574-
```C
574+
```HercScript
575575
startnpctimer(); // Continues the NPC timer where it left off, or start a new one if there isn't a timer already.
576576
577577
startnpctimer("My Other NPC"); // Same as above, but starts it in the NPC named "My Other NPC".
@@ -588,7 +588,7 @@ ignored), then **stopnpctimer** will also detach the player, if any was attached
588588

589589
Some examples again:
590590

591-
```C
591+
```HercScript
592592
stopnpctimer(); // Pauses the NPC timer in the current NPC.
593593
stopnpctimer("My Other NPC"); // Pauses the NPC timer in the NPC named "My Other NPC"
594594
stopnpctimer(1); // Pauses the NPC timer in the current NPC and detaches any attached player.
@@ -622,7 +622,7 @@ attached, or it will give you back an error and return 0.
622622

623623
Some examples:
624624

625-
```C
625+
```HercScript
626626
getnpctimer(0); // Returns the current amount of ticks.
627627
getnpctimer(0,"My Other NPC"); // Does the same, only for the NPC named "My Other NPC".
628628
getnpctimer(1); // Returns the amount of OnTimer labels that are still untriggered.
@@ -646,7 +646,7 @@ there is to this command. It works, no matter if there is a player attached to i
646646

647647
Some examples again:
648648

649-
```C
649+
```HercScript
650650
setnpctimer(10000); // Sets the NPC Timer of the current NPC to 10 seconds.
651651
setnpctimer(2345, "My Other NPC"); // Sets the NPC Timer in the NPC named "My Other NPC" to 2345 ticks or ms.
652652
setnpctimer(0); // Sets the current NPC Timer to 0.
@@ -667,7 +667,7 @@ his account id or RID (or UID/GID in some devs words) as a parameter.
667667

668668
Examples:
669669

670-
```C
670+
```HercScript
671671
attachnpctimer(getcharid(3)); // Attaches current player to the NPC Timer.`
672672
attachnpctimer(2000000); // Attaches the player with account id 2000000 to the NPC Timer, if he is online.`
673673
```
@@ -680,7 +680,7 @@ parameter. This is optional of course.
680680

681681
Examples:
682682

683-
```C
683+
```HercScript
684684
detachnpctimer(); // Detaches the attached player from the NPC Timer, if anyone was attached.`
685685
detachnpctimer("My Other NPC"); // Does the same, only for the NPC named "My Other NPC".`
686686
```
@@ -737,7 +737,7 @@ timer runs down to 0, it will jump to that label in that NPC. For easiness sake,
737737
the command, and the upcoming commands, also the name of the player timer.
738738
Well, that is all there is to the addtimer command, so some last examples:
739739

740-
```C
740+
```HercScript
741741
addtimer(1000, "My NPC::OnMyLabel"); // Starts a timer that runs out after 1000 ms (1 second), and then jumps to OnMyLabel in My NPC.
742742
addtimer(60000, "NPC1::OnLoser"); // After 60 seconds, this timer runs out, and jumps to OnLoser in the NPC named NPC1.
743743
```
@@ -750,7 +750,7 @@ which timer it does this, is up to you and the player who is currently attached
750750
alter, is what you specify with the second parameter, "NPC::OnEvent" (or as said earlier, the name of the timer).
751751
Some examples:
752752

753-
```C
753+
```HercScript
754754
addtimercount(5000, "My NPC::OnMyLabel"); // Adds 5 seconds to the timer with the name "My NPC::OnMyLabel".
755755
addtimercount(-10000, "NPC1::OnLoser"); // Removes 10 seconds from the timer with the name "NPC1::OnLoser".
756756
```
@@ -762,7 +762,7 @@ the same event label/name as specified in the parameter. Of course, it only does
762762
is currently attached to the script, but well, that is all it does.
763763
Some examples:
764764

765-
```C
765+
```HercScript
766766
deltimer("My NPC::OnMyLabel"); // Erases the timer that was supposed to jump to OnMyLabel in the NPC named My NPC.
767767
deltimer("NPC1::OnLoser"); // Erases the timer named NPC1::OnLoser. (Name == Event label)
768768
```

0 commit comments

Comments
 (0)