function script omnirefine {
.@name$ = getarg(0);
/// Custom chances 1 to 20.
setarray .@refine_chances[1], 100, 100, 100, 100, 95, 80, 80, 50, 50, 35, 20, 20, 16, 16, 15, 15, 14, 14, 10, 10;
/// Equipment position names (Don't edit that order).
setarray .@equip_name$[1],"Head","Middle","Lower","Armor","Weapon","Shield","Garment","Shoes","Accessory 1","Accessory 2";
/// Weapon material
.@weapon_material = 6438; // Omni-Oridecon
/// Armor material
.@armor_material = 6439; // Mega-Elunium
disable_items;
mes "["+ .@name$ +"]";
mes "I am the best Armsmith ever!";
mes "I don't refine with normal, boring materials.";
// mes "I only refine items using ^FF0000" + getitemname(.@weapon_material) + "^000000 and FF0000" + getitemname(.@armor_material) + "^000000.";
mes "I only refine items using ^FF0000Omni-Oridecon^000000 and ^FF0000Mega-Elunium^000000.";
next;
mes "["+ .@name$ +"]";
mes "Anyway, you may use my services if you have any of that materials.";
mes "What do you want me to refine?";
next;
setarray .@equip_pos[1],EQI_HEAD_TOP,EQI_HEAD_MID,EQI_HEAD_LOW,EQI_ARMOR,EQI_HAND_R,EQI_HAND_L,EQI_GARMENT,EQI_SHOES,EQI_ACC_R,EQI_ACC_L;
for (.@i = 1; .@i <= getarraysize(.@equip_pos); ++.@i) {
if (getequipisequiped(.@equip_pos[.@i]))
.@menu$ += getequipname(.@equip_pos[.@i]);
else
.@menu$ += "^777777" + .@equip_name$[.@i] + " - " + "[Unavailable]" + "^000000";
.@menu$ += ":";
}
.@part = .@equip_pos[select(.@menu$)];
.@equip_id = getequipid(.@part);
.@refinerycnt = getequiprefinerycnt(.@part);
if (!getequipisequiped(.@part)) { //custom check
mes "["+ .@name$ +"]";
mes "You're not wearing";
mes "anything there that";
mes "I can refine.";
emotion ET_FRET;
close;
}
if (!getequipisenableref(.@part)) {
mes "["+ .@name$ +"]";
mes "I don't think I can";
mes "refine this item at all...";
close;
}
if (.@refinerycnt >= 20) { //custom check
mes "["+ .@name$ +"]";
mes "I can't refine this";
mes "any more. This is as";
mes "refined as it gets!";
close;
}
// if (getiteminfo(.@equip_id,2) == 5) .@material = .@weapon_material;
// else if (getiteminfo(.@equip_id,2) == 4) .@material = .@armor_material;
if (getiteminfo(.@equip_id,2) == 5) .@material = "Omni-Oridecon";
else if (getiteminfo(.@equip_id,2) == 4) .@material = "Mega-Elunium";
if ((getequipweaponlv(.@part) >= 1) && (getequipweaponlv(.@part) <= 4)) {
.@article$ = "a";
.@type$ = "weapon";
} else {
.@article$ = "an";
.@type$ = "armor";
}
mes "["+ .@name$ +"]";
mes "Hmm " + .@article$ + " " + .@type$ + ", is that ok?";
mes "If you want to refine this " + .@type$ + ",";
mes "I will need 1 ^FF0000" + getitemname(.@material) + "^000000.";
mes "Are you sure you want to continue?";
next;
if(select("Yes:No") == 2){
mes "["+ .@npc_name$ +"]";
mes "Hm... if you mind... never mind...";
close;
}
while (1) {
.@refinerycnt = getequiprefinerycnt(.@part);
if (countitem(.@material) < 1) {
mes "["+ .@name$ +"]";
mes "Hm. You don't seem to have enough "+getitemname(.@material)+".";
mes "Please come back when you have them.";
close;
}
delitem .@material,1;
// anti-hack
if (callfunc("F_IsEquipIDHack", .@part, .@equip_id) ||
callfunc("F_IsEquipRefineHack", .@part, .@refinerycnt)) {
mes "["+ .@name$ +"]";
emotion ET_FRET;
mes "Wait a second...";
mes "Do you think I'm stupid?!";
mes "You switched the item while I wasn't looking! Get out of here!";
close;
}
if (.@refine_chances[.@refinerycnt+1] > rand(100)) {
mes "["+ .@name$ +"]";
mes "Clang! Clang! Clang! Clang!";
successrefitem .@part;
next;
emotion ET_BEST;
mes "["+ .@name$ +"]";
mes "Good! Succes!!!";
mes "I am the best Armsmith.";
next;
} else {
if (rand(100) < 80) {
mes "["+ .@name$ +"]";
mes "Clang! Clang! Clang! Clang!";
downrefitem .@part,0; // Only for the fail refinement animation
next;
emotion (!rand(5))?ET_MONEY:ET_HUK;
mes "["+ .@name$ +"]";
mes "Ahhh!!!";
next;
mes "["+ .@name$ +"]";
mes "Oh my god!";
mes "The upgrade level has dropped...";
} else {
mes "["+ .@name$ +"]";
mes "Clang! Clang! Clang!";
downrefitem .@part,0; // Only for the fail refinement animation
next;
emotion (!rand(5))?ET_MONEY:ET_HUK;
mes "["+ .@name$ +"]";
mes "Hmmm!";
next;
mes "["+ .@name$ +"]";
mes "Oh my! I've failed to refine stuff...";
mes "I didn't mean it!";
}
mes "I could have made a mistake even though I am the best Armsmith ever.";
mes "It just wasn't meant to be.";
next;
mes "["+ .@name$ +"]";
mes "I will do a better job next time! Don't worry!";
next;
}
mes "["+ .@name$ +"]";
mes "Do you want to refine again?";
next;
if(select("Yes:No") == 2){
mes "["+ .@npc_name$ +"]";
mes "Hm... if you mind... never mind...";
close;
}
}
return;
}
prt_in,54,58,3 script Refiner#1 813,{
callfunc "omnirefine","^0000FFBlessed Refiner^000000";
end;
}
I changed here, I do not know how to change that other part:
// mes "I only refine items using ^FF0000" + getitemname(.@weapon_material) + "^000000 and FF0000" + getitemname(.@armor_material) + "^000000.";
mes "I only refine items using ^FF0000Omni-Oridecon^000000 and ^FF0000Mega-Elunium^000000.";
In this part I would like to change the variable to a text, because the name it carries I do not like.
// if (getiteminfo(.@equip_id,2) == 5) .@material = .@weapon_material;
// else if (getiteminfo(.@equip_id,2) == 4) .@material = .@armor_material;
for
if (getiteminfo(.@equip_id,2) == 5) .@material = "Omni-Oridecon";
else if (getiteminfo(.@equip_id,2) == 4) .@material = "Mega-Elunium";
It loads this variable here:
mes "["+ .@name$ +"]";
mes "Hmm " + .@article$ + " " + .@type$ + ", is that ok?";
mes "If you want to refine this " + .@type$ + ",";
mes "I will need 1 ^FF0000" + getitemname(.@material) + "^000000.";
mes "Are you sure you want to continue?";
I want it to either show the text without loading the actual name of the Item, only with the text that I chose.
Can you do that?
I know I can only change the item name in itemdb. but I want to learn this.
Question
Tassadar
I'm editing this npc:
I changed here, I do not know how to change that other part:
In this part I would like to change the variable to a text, because the name it carries I do not like.
for
It loads this variable here:
I want it to either show the text without loading the actual name of the Item, only with the text that I chose.
Can you do that?
Edited by TassadarI know I can only change the item name in itemdb. but I want to learn this.
Thank you for your help.
misspelled word
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.