Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion doc/script_commands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1228,7 +1228,7 @@ you have to set it back to black unless you want all the rest of the text be in
that color:

mes("This is ^FF0000 red ^000000 and this is ^00FF00 green, ^000000 so.");
mes(callfunc("F_MesColor", C_BLUE) +"This message is now in BLUE");
mesf("%sThis message is now in BLUE.", F_MesColor(C_BLUE));

Notice that the text coloring is handled purely by the client. If you use
non-English characters, the color codes might get screwed if they stick to
Expand All @@ -1252,6 +1252,14 @@ This will allow you to visit 'Google' with the in-game browser using default dim

Clicking 'Bing!' will open the in-game browser using the specified dimensions. (800x600)

If you're using client from 2013-01-30 onwards, you can also use <ITEMLINK> to show
the item's description. Gravity changed this into <ITEM> since 2015-07-29 onwards.

mes("Bring me an <ITEM>Apple<INFO>512</INFO></ITEM>.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line shall be removed, since not every client version support the <ITEM> tag. It could be confusing.

Copy link
Contributor Author

@AnnieRuru AnnieRuru Jan 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hard to define this, many members said its harder and harder to use older hex client
because client translation project always keep itself up to date with no backward compatibility

I have some older hexed client just simply because when I inactive, and active back
I always install newer stuffs, and the old stuffs just kept inside external harddisk

we should always encourage members to use latest client revision ... isn't it ?

and removing that line ... is just like hide this method from public

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I mean we should encourage them to use the F_ItemMesInfo and not <ITEM> or <ITEMLINK>.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my opinion is show them both methods ...

ok 1 vote for showing 1 method (Emistry)
1 vote for showing both methods (AnnieRuru)

any one else vote for showing 1 method or showing both ?

mesf("Bring me an %s.", F_MesItemInfo(Apple));

This will show the item name and a clickable link for the item description.

---------------------------------------

*mesf("<format>"{, <param>{, <param>{, ...}}})
Expand Down
23 changes: 22 additions & 1 deletion npc/other/Global_Functions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ function script F_ShuffleNumbers {
//== Function F_MesColor ===================================
// Function to colorize npc dialog without having to memorize the color code
// Examples:
// mes callfunc("F_MesColor", C_BLUE) +"This message is now in BLUE";
// mesf("%sThis message is now in BLUE.", F_MesColor(C_BLUE));
function script F_MesColor {
return sprintf("^%06X", min(getarg(0), 0xFFFFFF));
}
Expand Down Expand Up @@ -475,3 +475,24 @@ function script F_GetTradeRestriction {
.@trade$ += "NoAuction|";
}
}

//== Function F_MesItemInfo ===================================
// Show the item name and a clickable link for the item description
// Only works with mes and mesf, does not work in menu/select
function script F_MesItemInfo {
.@item = getarg(0);
.@itemname$ = getitemname(.@item);
if (.@itemname$ != "null") {
.@itemslot = getitemslots(.@item);
if (.@itemslot)
.@itemname$ = sprintf("%s [%d]", .@itemname$, .@itemslot);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the equipment slot should check for item type is EQI_ARMOR / EQI_WEAPON or not.
If its not armor/weapon then it shall not show any postfix of equipment slot in the item name.
If the item were armor/weapon then it shall show the equipment slot even if its [0] slot.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I knew you going to say this, I have tested this in my getitemname2 function
all items are default to 0 slots

	Def: Defense                  (int, defaults to 0)
	Range: Attack Range           (int, defaults to 0)
	Slots: Slots                  (int, defaults to 0)
	Job: {                        (defaults to all job)
		All: true/false               (boolean, defaults to false)
		Novice: true/false            (boolean, defaults to false)
		Swordsman: true/false         (boolean, defaults to false)
		Magician: true/false          (boolean, defaults to false)

and no, items with [0] slot doesn't show in-game
please test it,

and WHY the fuck I have to upload a screenshot every time ????
sigh...
OK I upload screenshots because you think it work your way but it doesn't work like that

prontera,155,185,5	script	asdasdad	1_F_MARIA,{
	getitem 1201, 1;
	getitem 1203, 1;
	mes(F_MesItemInfo(1201));
	mes(F_MesItemInfo(1203));
	close;
}

fuck

}
else
.@itemname$ = "Unknown Item";
if (PACKETVER >= 20150729)
return sprintf("<ITEM>%s<INFO>%d</INFO></ITEM>", .@itemname$, .@item);
else if (PACKETVER >= 20130130)
return sprintf("<ITEMLINK>%s<INFO>%d</INFO></ITEMLINK>", .@itemname$, .@item);
else
return .@itemname$;
}
4 changes: 2 additions & 2 deletions npc/re/instances/OldGlastHeim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2744,7 +2744,7 @@ glast_01,188,273,5 script White Knight#1a 4_WHITEKNIGHT,{
close();
}
mes("I exchange you a White Knight Card for ^0000FF3000 Coagulated Spell^000000 or ^FF000070 Contaminated Magic^000000.");
mes("<ITEMLINK>White Knight Card<INFO>4608</INFO></ITEMLINK>");
mes(F_MesItemInfo(White_Knightage_Card));
next();
setarray(.@item[0], Coagulated_Spell, Corrupted_Charm);
setarray(.@cost[0], 3000, 70);
Expand Down Expand Up @@ -2777,7 +2777,7 @@ glast_01,192,273,3 script Khalitzburg Knight#1a 4_F_KHALITZBURG,{
close();
}
mes("I exchange you a Khalitzburg Knight Card for ^0000FF5000 Coagulated Spell^000000 or ^FF0000100 Contaminated Magic^000000.");
mes("<ITEMLINK>Khalitzburg Knight Card<INFO>4609</INFO></ITEMLINK>");
mes(F_MesItemInfo(Khali_Knightage_Card));
next();
setarray(.@item[0], Coagulated_Spell, Corrupted_Charm);
setarray(.@cost[0], 5000, 100);
Expand Down