You use strcharinfo(3) which first of all returns a string, so your calculation fails and second it returns the name of the map the character is in, which sure isn't what you want.
.@price = .@base_price * strcharinfo(3);
*strcharinfo(<type>{,<char_id>})
This function will return either the name, party name or guild name for the
invoking character. Whatever it returns is determined by type.
To get the level of a character, you can simply use the BaseLevel variable, which is pre-defined by rAthena. This should do what you want:
.@price = .@base_price * BaseLevel;
Also, since you always need the same base price, you could move the variable to OnInit and use a NPC variable.
This saves your script from having to assign the variable on every call. Probably this isn't really crucial performancewise, but it also helps to organize your script better, because you can use NPC variables globally in your NPC, you can use them anywhere you want and know they are defined.
Lastly, you are writing the zeny price hard in your string. I assume because you want it to be comma separated. You can achieve this dynamically with the global F_InsertComma function.
Here is an example of the script you provided, with what I mean:
- script BUFF_CMD FAKE_NPC,{
OnInit:
.basePrice = 5000; // ราคาพื้นฐานสำหรับการให้บัฟ
bindatcmd "buff", strnpcinfo(0) + "::OnCommand";
end;
OnCommand:
.@price = BaseLevel * .basePrice;
if ( getmapflag(strcharinfo(3), MF_PVP) || getmapflag(strcharinfo(3), MF_BATTLEGROUND) || getmapflag(strcharinfo(3), MF_GVG) ) {
mes "ใช้ไม่ได้ในแผนที่ PVP/BG/WOE";
close;
}
if ( Zeny < .@price ) {
mes "ต้องใช้เงิน " + F_InsertComma(.@price) + "z. ในการกดใช้บัฟ";
close;
}
if ( select("บัฟเลย " + F_InsertComma(.@price) + "z ก็ไหว!","ไม่เอาดีกว่า!") == 2 ) {
mes "แค่ " + F_InsertComma(.@price) + "z ก็ยัง ^FF0000งก^000000 เนอะ";
mes "ตีมอนแปปเดียวก็ได้แล้ว";
mes "ฆ่ามอนยังไงก็ได้เงินไปด้วยอยู่แล้ว";
close;
}
Zeny -= .@price;
// บัฟที่ได้
specialeffect2(42);
sc_start(SC_BLESSING, 3600000, 10);
specialeffect2(37);
sc_start(SC_INCREASEAGI, 3600000, 10);
specialeffect2(112);
sc_start(SC_KYRIE, 3600000, 10);
specialeffect2(76);
sc_start(SC_MAGNIFICAT, 3600000, 10);
mes "จัดไป!";
mes "ขอให้มีความสุขกับการเก็บเลเวล!";
mes "ด้วยความปรารถนาดีจาก TooHard-RO!";
close;
}