Item Combo #929
Combo Size: 2
Combo Items
Z_Stone_11
Loki_Nidhogg_Hat
Combo Effect
.@r = getequiprefinerycnt(EQI_HEAD_TOP);
if (.@r >= 7) {
setarray .@skills$, "AL_HEAL", "PR_SANCTUARY", "AM_POTIONPITCHER", "AB_HIGHNESSHEAL", "AB_CHEAL";
for( .@i = 0; .@i < getarraysize(.@skills$); .@i++) {
bonus2 bSkillHeal,.@skills$[.@i],2 + ( .@r >= 9 ) ? 2 : 0;
}
}
Script References
getequiprefinerycnt
Command
getequiprefinerycnt
Signature:
getequiprefinerycnt(<equipment slot>{,<char_id>})
Description:
slot. For a list of equipment slots see 'getequipid'.
Can be used to check if you have reached a maximum refine value, default for
this is +10:
Example:
if (getequiprefinerycnt(EQI_HEAD_TOP) < 10)
mes "I will now upgrade your " + getequipname(EQI_HEAD_TOP);
else
mes "Sorry, it's not possible to refine hats better than +10";
close;
if
Command
if
Signature:
if (<condition>) <statement>;
Description:
This is the basic conditional statement command, and just about the only one
available in this scripting language.
The condition can be any expression. All expressions resulting in a non-zero
value will be considered True, including negative values. All expressions
resulting in a zero are false.
If the expression results in True, the statement will be executed. If it isn't
true, nothing happens and we move on to the next line of the script.
For more information on conditional operators see the operators section above.
bothering to store it in a specific variable:
More examples of using the 'if' command in the real world:
Example 1:
Example 2:
Notice that examples 1 and 2 have the same effect.
Example 3:
Example 4:
Example 5:
See 'strcharinfo' for an explanation of what this function does.
Example 6: Using complex conditions.
The script engine also supports nested 'if' statements:
If the condition isn't met, it'll do the action following the 'else'.
We can also group several actions depending on a condition:
Remember that if you plan to do several actions upon the condition being false, and
you forget to use the curly braces (the { } ), the second action will be executed regardless
the output of the condition, unless of course, you stop the execution of the script if the
condition is true (that is, in the first grouping using a return; , and end; or a close; )
Also, you can have multiple conditions nested or chained.
Example:
if (1) mes "This will always print.";
if (0) mes "And this will never print.";
if (5) mes "This will also always print.";
if (-1) mes "Funny as it is, this will also print just fine.";
if (strcharinfo(0) == "Daniel Jackson") mes "It is true, you are Daniel!";
.@answer = 1;
input .@input;
if (.@input == .@answer)
close;
mes "Sorry, your answer is incorrect.";
close;
.@answer = 1;
input .@input;
if (.@input != .@answer)
mes "Sorry, your answer is incorrect.";
close;
.@count++;
mes "[Forgetful Man]";
if (.@count == 1) mes "This is the first time you have talked to me.";
if (.@count == 2) mes "This is the second time you have talked to me.";
if (.@count == 3) mes "This is the third time you have talked to me.";
if (.@count == 4) {
mes "This is the fourth time you have talked to me.";
mes "I think I am getting amnesia, I have forgotten about you...";
.@count = 0;
}
close;
mes "[Quest Person]";
if (countitem(512) < 1) { // 512 is the item ID for Apple, found in db/item_db.yml
mes "Can you please bring me an apple?";
close;
}
mes "Oh, you brought an Apple!";
mes "I didn't want it, I just wanted to see one.";
close;
mes "[Person Checker]";
if ($@name$ == "") { // global variable not yet set
mes "Please tell me someones name";
next;
input $@name$;
$@name2$ = strcharinfo(0);
mes "[Person Checker]";
mes "Thank you.";
close;
}
if ($@name$ == strcharinfo(0)) { // player name matches $@name$
mes "You are the person that " + $@name2$ + " just mentioned.";
mes "Nice to meet you!";
// reset the global variables
$@name$ = "";
$@name2$ = "";
close;
}
mes "You are not the person that " + $name2$ + " mentioned.";
close;
mes "[Multiple Checks]";
if (@queststarted == 1 && countitem(512) >= 5) {
mes "Well done, you have started the quest and brought me 5 Apples.";
@queststarted = 0;
delitem 512,5;
close;
}
mes "Please bring me 5 apples.";
@queststarted = 1;
close;
if (<condition>)
dothis;
else
dothat;
if (<condition>) {
dothis1;
dothis2;
} else {
dothat1;
dothat2;
dothat3;
}
if (<condition 1>)
dothis;
else if (<condition 2>) {
dothat;
end;
} else
dothis;
setarray
Command
setarray
Signature:
setarray <array name>[<first value>],<value>{,<value>...<value>};
Description:
This command will allow you to quickly fill up an array in one go. Check the
Kafra scripts in the distribution to see this used a lot.
First value is the index of the first element of the array to alter. For
example:
will produce:
.@array[0]=200
.@array[1]=300
.@array[2]=150
Example:
setarray .@array[0], 100, 200, 300, 400, 500, 600;
setarray .@array[0],200,200,200;
setarray .@array[1],300,150;
for
Command
for
Signature:
for (<variable initialization>; <condition>; <variable update>) <statement>;
Description:
Another pretest looping structure is the 'for' statement. It is considered a
specialized form of the 'while' statement, and is usually associated with counter-
controlled loops. Here are the steps of the 'for' statement: the initialize
statement is executed first and only once. The condition test is performed.
When the condition evaluates to false, the rest of the for statement is skipped.
When the condition evaluates to true, the body of the loop is executed, then the
update statement is executed (this usually involves incrementing a variable).
Then the condition is reevaluated and the cycle continues.
Example 1:
Example 2:
Example:
for( .@i = 1; .@i <= 5; .@i++ )
mes "This line will print 5 times.";
mes "This will print the numbers 1 - 5.";
for( .@i = 1; .@i <= 5; .@i++ )
mes "Number: " + .@i;
getarraysize
Command
getarraysize
Signature:
getarraysize(<array name>)
Description:
This function returns highest index of the array that is filled.
counted towards this number.
For example:
This will make .@arraysize == 6. But if you try this:
.@arraysize will still equal 6, even though you've set 7 values.
Example:
setarray .@array[0], 100, 200, 300, 400, 500, 600;
set .@arraysize,getarraysize(.@array);
setarray .@array[0], 100, 200, 300, 400, 500, 600, 0;
set .@arraysize,getarraysize(.@array);
bSkillHeal
Item Bonus
bSkillHeal
Signature:
bonus2 bSkillHeal,sk,n;
Description:
Increases heal amount of skill sk by n%