Jump to content

Tier Stone Refining


Angst

Recommended Posts


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  97
  • Reputation:   20
  • Joined:  11/13/11
  • Last Seen:  

Author: Angst

Compatible with: r14558+

This system would replace the traditional system for refinement, and there is no refinement failure unless stated otherwise.

Also this system uses no source modifications (Npc Menu Driven).

The system requires three of the same stone to get to the next tier; a total of 59049 fragments needed to make a +10.

The system will convert as many stones as it can automatically without the need for the player to use the input box.

DB entries you will need.

Item_DB:

// ----- Tier Stones -----
32100,Amra_Shard,Amra Shard,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32100; },{},{}
32101,Amra_Stone,Amra Stone 1,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32101; },{},{}
32102,Amra_Stone,Amra Stone 2,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32102; },{},{}
32103,Amra_Stone,Amra Stone 3,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32103; },{},{}
32104,Amra_Stone,Amra Stone 4,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32104; },{},{}
32105,Amra_Stone,Amra Stone 5,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32105; },{},{}
32106,Amra_Stone,Amra Stone 6,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32106; },{},{}
32107,Amra_Stone,Amra Stone 7,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32107; },{},{}
32108,Amra_Stone,Amra Stone 8,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32108; },{},{}
32109,Amra_Stone,Amra Stone 9,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32109; },{},{}
32110,Amra_Stone,Amra Stone 10,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32110; },{},{}

idnum2itemresname:

(Suggested, but you can use your own icons)

32100#ºê¶óµð¿òÆÄÆí#
32101#Åõ¸íÇѺ¸¼®#
32102#Åõ¸íÇѺ¸¼®#
32103#Åõ¸íÇѺ¸¼®#
32104#Åõ¸íÇѺ¸¼®#
32105#Åõ¸íÇѺ¸¼®#
32106#Åõ¸íÇѺ¸¼®#
32107#Åõ¸íÇѺ¸¼®#
32108#Åõ¸íÇѺ¸¼®#
32109#Åõ¸íÇѺ¸¼®#
32110#17ij·µ´ÙÀ̾Æ#

No Breakage, No Catalysts

Max Refinement +10.

Version: 5

-Some If statements had the wrong comparison operators.

-Changed refinement back to atcommand since it's easier and doesn't cause the script to hang when refining and doesn't show refinement from 1-10 in the chat window like normal refining does.

-Added "Merge all stones to highest possible Tier" menu option, allowing to merge 512x T1 stones into a T10, or 1023x T1 == 1x of each level of tier stones.

-Changed rates from 3 to 2 stones required per Tier. 10 fragments required for T1.

-Added simple anti-hack checking.

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

Version: 1.3 >Updated refinement section with loop instead of atcommand. Optimized itemID usage into vars if the user changes Tstone itemID.

Version: 1.2 >Initial Release.

Link

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

Max Refinement +20

Link

Breakage, Catalysts

Max Refinement +10

Catalyst items, 'Enhancement Stone' and 'Support Stone'.

Enhancement Stones in sets of 10 bring out the full %chance to refine.

To prevent failure and breaking, have a Support Stone in your inventory.

Failure removes attempted Tstone, Enhancement and Support stones from inventory.

Version: 1.3 >Fixed refinement tiers 1-4 from delitem'ing Enhancement Stones.

Version: 1.2 >Initial Release.

Link

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

Max Refinement +20

Link

Edited by Angst
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  97
  • Reputation:   20
  • Joined:  11/13/11
  • Last Seen:  

Yes, item type 11 makes the stone useable which kicks the callfunc script without deleting the item itself after doubleclick, leaving it in inventory.

Should you not have enough stones to make higher tiers the script will not delete the item.

Item deletion from inventory only occurs if you use the stone to refine equipment or upgrade it to a higher tier.

Item deletion controlled by the function.

Thus the reason for item type 11 and the clickable status. :]

I hope this doesn't sound like circular reasoning..

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  29
  • Topics Per Day:  0.01
  • Content Count:  566
  • Reputation:   34
  • Joined:  11/17/11
  • Last Seen:  

You can use an NPC that will delitem the stone you required.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  97
  • Reputation:   20
  • Joined:  11/13/11
  • Last Seen:  

The script is an npc/function.

Basically, you have 3, Amra Stone 3's.

This is all menu handled, giving you the option to upgrade tier or refine the item according to the Stone's level.

You double click it in your inventory and the script attached in the item_db will call the function, removing (delitem) the three stones from inventory and giving you an Amra Stone 4.

[Code: delitem .@id, .@del; where .@id is the argument (itemID) passed from the item_db code and where .@del is how many.]

If you have six(6) Amra Stone 3's in inventory and decide to upgrade Tier, it will consume all 6 and give you two Amra Stone 4's.

This removes the time consumed of upgrading Tier if you have farmed a few hundred shards, as the old way would have you create one stone at a time, delitem 3, getitem 1, this way does delitem (how many you have possible), getitem (how many possible).

Note: This replaces the official Refining Script.

Edited by Angst
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  201
  • Reputation:   47
  • Joined:  11/17/11
  • Last Seen:  

I actually really like this idea, it makes refininy simple and easy at the start, but it seems to be an exponential growth rate, making it harder to get higher refines. This alternate method is a nicely made idea, im wondering if i could use it somewhere :D haha

Just for a quick question, is it like this?

Amra Stone 1 = Amra Stone 2

Amra Stone 2 + Amra Stone 2 = Amra Stone 3

Amra Stone 3 + Amra Stone 3 + Amra Stone 3 = Amra Stone 4

If not, then my reply is sort of off, but its still a nice idea.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  97
  • Reputation:   20
  • Joined:  11/13/11
  • Last Seen:  

I actually really like this idea, it makes refininy simple and easy at the start, but it seems to be an exponential growth rate, making it harder to get higher refines. This alternate method is a nicely made idea, im wondering if i could use it somewhere :D haha

Just for a quick question, is it like this?

Amra Stone 1 = Amra Stone 2

Amra Stone 2 + Amra Stone 2 = Amra Stone 3

Amra Stone 3 + Amra Stone 3 + Amra Stone 3 = Amra Stone 4

If not, then my reply is sort of off, but its still a nice idea.

It's more like this =D

Amra Shard x3 = Amra Stone 1

Amra Stone 1 x3 = Amra Stone 2

Amra Stone 2 x3 = Amra Stone 3

Amra Stone 3 x3 = Amra Stone 4

Amra Stone 4 x3 = Amra Stone 5

Amra Stone 5 x3 = Amra Stone 6

Amra Stone 6 x3 = Amra Stone 7

Amra Stone 7 x3 = Amra Stone 8

Amra Stone 8 x3 = Amra Stone 9

Amra Stone 9 x3 = Amra Stone 10

Amra Stone 10 (Final, no more possible Tier, unless you mod the script ;] )

In total, as said in my first post it would take 59049 Amra Shards to make a +10.

The way I have it setup, only the shards should drop from monsters, or bought, however you wish.

And it's up to the player to upgrade Tier.

If you wanted it to be harder I'm sure you could mod the script to add a catalyst item required to upgrade Tier.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  201
  • Reputation:   47
  • Joined:  11/17/11
  • Last Seen:  

Ah i see, well its still a really difficult method to achieve a +10, so it is still very nice. (The way i described would be so difficult haha i can't imagine how many it would take)

Edited by Truly
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   11
  • Joined:  11/16/11
  • Last Seen:  

How to modify this to support +20 and if it has no refine failure, it means 100% success rate? or it will still fail but it wont destroy the item? :D

Edited by Diurnal
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  97
  • Reputation:   20
  • Joined:  11/13/11
  • Last Seen:  

It doesn't have any failedrefineitem script.

*failedrefitem <equipment slot="">;

This command will fail to refine an item in the specified equipment slot of the

invoking character. The item will be destroyed. This will also display a 'refine

failure' effect on the character and put appropriate messages into their chat

window.

The official scripts seem to use the 'failedrefitem' command as a function

instead: 'failedrefitem(<number>)' but it returns nothing on the stack. This is

since jAthena, so probably nobody knows for sure why is it so.

To make it accept +20 you could try using this mod.

I haven't tested this though.

(I usually test my scripts before release but I don't have the +20 refinement capability enabled :/ )

Add to item_db2:

32100,Amra_Shard,Amra Shard,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32100; },{},{}
32101,Amra_Stone,Amra Stone 1,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32101; },{},{}
32102,Amra_Stone,Amra Stone 2,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32102; },{},{}
32103,Amra_Stone,Amra Stone 3,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32103; },{},{}
32104,Amra_Stone,Amra Stone 4,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32104; },{},{}
32105,Amra_Stone,Amra Stone 5,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32105; },{},{}
32106,Amra_Stone,Amra Stone 6,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32106; },{},{}
32107,Amra_Stone,Amra Stone 7,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32107; },{},{}
32108,Amra_Stone,Amra Stone 8,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32108; },{},{}
32109,Amra_Stone,Amra Stone 9,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32109; },{},{}
32110,Amra_Stone,Amra Stone 10,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32110; },{},{}
32111,Amra_Stone,Amra Stone 11,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32111; },{},{}
32112,Amra_Stone,Amra Stone 12,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32112; },{},{}
32113,Amra_Stone,Amra Stone 13,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32113; },{},{}
32114,Amra_Stone,Amra Stone 14,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32114; },{},{}
32115,Amra_Stone,Amra Stone 15,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32115; },{},{}
32116,Amra_Stone,Amra Stone 16,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32116; },{},{}
32117,Amra_Stone,Amra Stone 17,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32117; },{},{}
32118,Amra_Stone,Amra Stone 18,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32118; },{},{}
32119,Amra_Stone,Amra Stone 19,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32119; },{},{}
32120,Amra_Stone,Amra Stone 20,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "AMRA", 32120; },{},{}

idnum2itemresnametable:

32100#ºê¶óµð¿òÆÄÆí#
32101#Åõ¸íÇѺ¸¼®#
32102#Åõ¸íÇѺ¸¼®#
32103#Åõ¸íÇѺ¸¼®#
32104#Åõ¸íÇѺ¸¼®#
32105#Åõ¸íÇѺ¸¼®#
32106#Åõ¸íÇѺ¸¼®#
32107#Åõ¸íÇѺ¸¼®#
32108#Åõ¸íÇѺ¸¼®#
32109#Åõ¸íÇѺ¸¼®#
32110#Åõ¸íÇѺ¸¼®#
32111#Åõ¸íÇѺ¸¼®#
32112#Åõ¸íÇѺ¸¼®#
32113#Åõ¸íÇѺ¸¼®#
32114#Åõ¸íÇѺ¸¼®#
32115#Åõ¸íÇѺ¸¼®#
32116#Åõ¸íÇѺ¸¼®#
32117#Åõ¸íÇѺ¸¼®#
32118#Åõ¸íÇѺ¸¼®#
32119#Åõ¸íÇѺ¸¼®#
32120#17ij·µ´ÙÀ̾Æ#

Function:

function script AMRA {
set .@id, getarg(0);
if (.@id == 32100) {
 if (countitem(.@id) > 2) {
  set .@del, ((countitem(.@id)/3)*3);
  getitem (1 + .@id), (countitem(.@id)/3);
  delitem .@id, .@del;
 }
 end;
}
if (.@id >= 32101 && .@id <= 32119) {
 prompt "Merge 3 "+getitemname(.@id)+"'s","Apply "+getitemname(.@id)+" to Equipment";
 if (@menu == 1) {
  if (countitem(.@id) == 2) {
message strcharinfo(0), "Merge Failed: "+(3 - countitem(.@id))+" more "+getitemname(.@id)+" is needed to merge.";
close;
  }
  if (countitem(.@id) == 1) {
message strcharinfo(0), "Merge Failed: "+(3 - countitem(.@id))+" more "+getitemname(.@id)+"'s are needed to merge.";
close;
  } else {
set .@del, ((countitem(.@id)/3)*3);
getitem (1 + .@id), (countitem(.@id)/3);
delitem .@id, .@del;
if (countitem(.@id) == 1) {
 dispbottom "One "+getitemname(.@id)+" could not merge.";
}
if (countitem(.@id) == 2) {
 dispbottom "Two "+getitemname(.@id)+"'s could not merge.";
}
  }
  close;
 }
 if (@menu == 2) {
  callfunc "AMRACOMB",.@id;
 }
}
if (.@id == 32120) {
 prompt "Apply to Equipment";
 if (@menu == 1) {
  callfunc "AMRACOMB",.@id;
 }
}
}

function script AMRACOMB {
set .@id, getarg(0);
mes "Select what you wish to refine.";
mes " ";
mes "You can refine an item up to +"+(.@id - 32100)+" using this stone.";
setarray .@position$[1], "Head (Upper)","Armor","Left hand","Right hand","Robe","Shoes","Accessory (Left)","Accessory (Right)","Head (Mid)","Head (Lower)";
set .@menu$,"";
for (set .@i, 1; .@i <= 10; set .@i, .@i + 1) {
 if (getequipisequiped(.@i))
  if (getequiprefinerycnt(.@i) > 0) {
set .@menu$, .@menu$ + .@position$[.@i] + " - " + "[+" + getequiprefinerycnt(.@i) + " " + getequipname(.@i) + "]";
  } else {
set .@menu$, .@menu$ + .@position$[.@i] + " - " + "[" + getequipname(.@i) + "]";
  }
 set .@menu$, .@menu$ + ":";
}
set .@part, select(.@menu$);
if (!getequipisequiped(.@part)) {
 next;
 mes "Nothing equipped in that slot.";
 close;
}
if (!getequipisenableref(.@part)) {
 next;
 mes "This item is not refineable.";
 close;
}
if (!getequipisidentify(.@part)) {
 next;
 mes "This has not been identified. Please identify it before attempting to refine.";
 close;
}
if (getequiprefinerycnt(.@part) >= 20) {
 next;
 mes "Max level reached, the process has failed.";
 close;
}
close2;
if (.@id >= 1) {
 if (.@part == 1) { set .@reflvl, 256; }
 if (.@part == 2) { set .@reflvl, 16; }
 if (.@part == 3) { set .@reflvl, 2; }
 if (.@part == 4) { set .@reflvl, 32; }
 if (.@part == 5) { set .@reflvl, 4; }
 if (.@part == 6) { set .@reflvl, 64; }
 if (.@part == 7) { set .@reflvl, 8; }
 if (.@part == 8) { set .@reflvl, 128; }
 if (.@part == 9) { set .@reflvl, 512; }
 if (.@part == 10) { set .@reflvl, 1; }
 set .@tlevel, (.@id - 32100);
 set .@currefine, getequiprefinerycnt(.@part);
 if (getequiprefinerycnt(.@part) > 0) {
  if (.@currefine == .@tlevel) { mes "You cannot use this stone on your "+getequipname(.@part)+"."; mes "Current equipment's refinement is equal to the stone's power."; close;}
  if (.@currefine > .@tlevel) { mes "You cannot use this stone on your "+getequipname(.@part)+"."; mes "Current equipment's refinement is higher than the stone's power."; close;}
  if (.@currefine < .@tlevel) {
delitem .@id, 1;
atcommand "@refine "+.@reflvl+" "+(.@tlevel - .@currefine);
close;
  }
 }
 if (getequiprefinerycnt(.@part) == 0) {
  delitem .@id, 1;
  atcommand "@refine "+.@reflvl+" "+.@tlevel+"";
 }

}
return;
}

Edited by Angst
Link to comment
Share on other sites

  • 4 weeks later...

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  97
  • Reputation:   20
  • Joined:  11/13/11
  • Last Seen:  

Updated the scripts, optimized with variables and split into two main categories ( Nonfailing | Failing+Catalyst ) and two subcategories ( +10 or +20 max refinement ).

Any other mods to this script are welcome by pm. :]

Link to comment
Share on other sites

  • 5 weeks later...

  • Group:  Members
  • Topic Count:  251
  • Topics Per Day:  0.06
  • Content Count:  698
  • Reputation:   15
  • Joined:  01/07/12
  • Last Seen:  

nice script, changed the whole refine systems haha, i like it

Link to comment
Share on other sites

  • 3 weeks later...

  • Group:  Members
  • Topic Count:  251
  • Topics Per Day:  0.06
  • Content Count:  698
  • Reputation:   15
  • Joined:  01/07/12
  • Last Seen:  

so here is the noob question, how can i remove the default refine system?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

so here is the noob question, how can i remove the default refine system?

npc/scripts_athena.conf

remove the following line

npc: npc/merchants/refine.txt

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  37
  • Topics Per Day:  0.01
  • Content Count:  126
  • Reputation:   6
  • Joined:  11/18/11
  • Last Seen:  

Sir im confused. Which files should I download? The Version 5 Link and the +10 Link (For Example) Then where is the NPC Location?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  97
  • Reputation:   20
  • Joined:  11/13/11
  • Last Seen:  

Sir im confused. Which files should I download? The Version 5 Link and the +10 Link (For Example) Then where is the NPC Location?

There is no npc location because the script is a function called from items, stated inside the First Spoiler under this line:

"DB entries you will need."

As for which file to download, choose by category in Teal.

Link to comment
Share on other sites

  • 3 weeks later...

  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  530
  • Reputation:   33
  • Joined:  01/17/12
  • Last Seen:  

Hi Angst is it possible to make Amra Stone refining to work only for +11 above Weapon or Armor?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  97
  • Reputation:   20
  • Joined:  11/13/11
  • Last Seen:  

Hi Angst is it possible to make Amra Stone refining to work only for +11 above Weapon or Armor?

Find this in the Second function.

close2
;

if
(
.@id
>=
1
)
{

This is presuming you have set the script to allow +20 refinement.

Add this-v above the find^

if (getequiprefinerycnt(.@part) <= 9) {
   close2;
   message strcharinfo(0), "Equipment is required to already be refined to +10, the process has failed.";
   end;
}

Should look like this:

if (getequiprefinerycnt(.@part) <= 9) {

close2
;

message strcharinfo
(
0
)
,
"Equipment is required to already be refined to +10, the process has failed."
;

end
;

}

close2
;

if
(
.@id
>=
1
)
{
Edited by Angst
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  530
  • Reputation:   33
  • Joined:  01/17/12
  • Last Seen:  

Thanks a lot Angst.

Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  231
  • Reputation:   23
  • Joined:  12/18/11
  • Last Seen:  

can you make upto +15

Link to comment
Share on other sites

  • 4 months later...

  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  48
  • Reputation:   1
  • Joined:  08/30/12
  • Last Seen:  

sorry i am a noob and new to this. i am confused now, i knw there's no NPC for this and what i don't understand is do i only need to fulfill the number of tier stones required in.order to upgrade my gear up to +10 and +20?

how do i do that? do i have to have the stones in my inventory then click it and it will just call out the function?

one last question.. do i have to name the text file "AMRA" for it to function and in what folder in the server do i save it?

sorry for the questions... as i've said i am new to this.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...