summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authormasao87 <masao87@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-05-17 20:39:42 +0000
committermasao87 <masao87@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-05-17 20:39:42 +0000
commitb3fd25f45c560fce6f1db4181f3642022d2ccb94 (patch)
tree8fff28023bc72cad46338b0dd25ad7cedbf22436 /src/map
parent6c343ca6bb3c64f1d8fadafe2c83c2a54d951411 (diff)
downloadhercules-b3fd25f45c560fce6f1db4181f3642022d2ccb94.tar.gz
hercules-b3fd25f45c560fce6f1db4181f3642022d2ccb94.tar.bz2
hercules-b3fd25f45c560fce6f1db4181f3642022d2ccb94.tar.xz
hercules-b3fd25f45c560fce6f1db4181f3642022d2ccb94.zip
- Added +11 and above refiner NPC.
- Added NPC to refine Oridecons / Eluniums to Cardium / Bradium. - Added downrefitem script command and updated script_commands.txt with it. - Updated refine_db.txt with probably custom values for +11 to +20 values. Source : http://ratemyserver.net/index.php?page=misc_table_refine - Some little script improvements to Suhnbi. (Enriched Elunium / Oridecon Upgrader.) * Further improvements for the refinement system and refinement NPC's will come within the next few days. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16126 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/script.c67
-rw-r--r--src/map/skill.c4
2 files changed, 55 insertions, 16 deletions
diff --git a/src/map/script.c b/src/map/script.c
index eb1876008..84b9b3140 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -7008,10 +7008,10 @@ BUILDIN_FUNC(repair)
*------------------------------------------*/
BUILDIN_FUNC(getequipisequiped)
{
- int i=-1,num;
+ int i = -1,num;
TBL_PC *sd;
- num=script_getnum(st,2);
+ num = script_getnum(st,2);
sd = script_rid2sd(st);
if( sd == NULL )
return 0;
@@ -7031,10 +7031,10 @@ BUILDIN_FUNC(getequipisequiped)
*------------------------------------------*/
BUILDIN_FUNC(getequipisenableref)
{
- int i=-1,num;
+ int i = -1,num;
TBL_PC *sd;
- num=script_getnum(st,2);
+ num = script_getnum(st,2);
sd = script_rid2sd(st);
if( sd == NULL )
return 0;
@@ -7054,10 +7054,10 @@ BUILDIN_FUNC(getequipisenableref)
*------------------------------------------*/
BUILDIN_FUNC(getequipisidentify)
{
- int i=-1,num;
+ int i = -1,num;
TBL_PC *sd;
- num=script_getnum(st,2);
+ num = script_getnum(st,2);
sd = script_rid2sd(st);
if( sd == NULL )
return 0;
@@ -7077,10 +7077,10 @@ BUILDIN_FUNC(getequipisidentify)
*------------------------------------------*/
BUILDIN_FUNC(getequiprefinerycnt)
{
- int i=-1,num;
+ int i = -1,num;
TBL_PC *sd;
- num=script_getnum(st,2);
+ num = script_getnum(st,2);
sd = script_rid2sd(st);
if( sd == NULL )
return 0;
@@ -7100,10 +7100,10 @@ BUILDIN_FUNC(getequiprefinerycnt)
*------------------------------------------*/
BUILDIN_FUNC(getequipweaponlv)
{
- int i=-1,num;
+ int i = -1,num;
TBL_PC *sd;
- num=script_getnum(st,2);
+ num = script_getnum(st,2);
sd = script_rid2sd(st);
if( sd == NULL )
return 0;
@@ -7123,10 +7123,10 @@ BUILDIN_FUNC(getequipweaponlv)
*------------------------------------------*/
BUILDIN_FUNC(getequippercentrefinery)
{
- int i=-1,num;
+ int i = -1,num;
TBL_PC *sd;
- num=script_getnum(st,2);
+ num = script_getnum(st,2);
sd = script_rid2sd(st);
if( sd == NULL )
return 0;
@@ -7149,7 +7149,7 @@ BUILDIN_FUNC(successrefitem)
int i=-1,num,ep;
TBL_PC *sd;
- num=script_getnum(st,2);
+ num = script_getnum(st,2);
sd = script_rid2sd(st);
if( sd == NULL )
return 0;
@@ -7203,7 +7203,7 @@ BUILDIN_FUNC(failedrefitem)
int i=-1,num;
TBL_PC *sd;
- num=script_getnum(st,2);
+ num = script_getnum(st,2);
sd = script_rid2sd(st);
if( sd == NULL )
return 0;
@@ -7225,6 +7225,44 @@ BUILDIN_FUNC(failedrefitem)
}
/*==========================================
+ * Downgrades an Equipment Part by -1 . [Masao]
+ *------------------------------------------*/
+BUILDIN_FUNC(downrefitem)
+{
+ int i = -1,num,ep;
+ TBL_PC *sd;
+
+ num = script_getnum(st,2);
+ sd = script_rid2sd(st);
+ if( sd == NULL )
+ return 0;
+
+ if (num > 0 && num <= ARRAYLENGTH(equip))
+ i = pc_checkequip(sd,equip[num-1]);
+ if(i >= 0) {
+ ep = sd->status.inventory[i].equip;
+
+ //Logs items, got from (N)PC scripts [Lupus]
+ log_pick_pc(sd, LOG_TYPE_SCRIPT, -1, &sd->status.inventory[i]);
+
+ sd->status.inventory[i].refine++;
+ pc_unequipitem(sd,i,2); // status calc will happen in pc_equipitem() below
+
+ clif_refine(sd->fd,2,i,sd->status.inventory[i].refine = sd->status.inventory[i].refine - 2);
+ clif_delitem(sd,i,1,3);
+
+ //Logs items, got from (N)PC scripts [Lupus]
+ log_pick_pc(sd, LOG_TYPE_SCRIPT, 1, &sd->status.inventory[i]);
+
+ clif_additem(sd,i,1,0);
+ pc_equipitem(sd,i,ep);
+ clif_misceffect(&sd->bl,2);
+ }
+
+ return 0;
+}
+
+/*==========================================
*
*------------------------------------------*/
BUILDIN_FUNC(statusup)
@@ -16254,6 +16292,7 @@ struct script_function buildin_func[] = {
BUILDIN_DEF(getequippercentrefinery,"i"),
BUILDIN_DEF(successrefitem,"i"),
BUILDIN_DEF(failedrefitem,"i"),
+ BUILDIN_DEF(downrefitem,"i"),
BUILDIN_DEF(statusup,"i"),
BUILDIN_DEF(statusup2,"ii"),
BUILDIN_DEF(bonus,"iv"),
diff --git a/src/map/skill.c b/src/map/skill.c
index 44e28860f..f4305d5f8 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -13307,7 +13307,7 @@ void skill_weaponrefine (struct map_session_data *sd, int idx)
if(item->nameid > 0 && ditem->type == IT_WEAPON)
{
if( item->refine >= sd->menuskill_val
- || item->refine >= MAX_REFINE // if it's no longer refineable
+ || item->refine >= 10 // if it's no longer refineable
|| ditem->flag.no_refine // if the item isn't refinable
|| (i = pc_search_inventory(sd, material [ditem->wlv])) < 0 )
{
@@ -13333,7 +13333,7 @@ void skill_weaponrefine (struct map_session_data *sd, int idx)
if (ep)
pc_equipitem(sd,idx,ep);
clif_misceffect(&sd->bl,3);
- if(item->refine == MAX_REFINE &&
+ if(item->refine == 10 &&
item->card[0] == CARD0_FORGE &&
(int)MakeDWord(item->card[2],item->card[3]) == sd->status.char_id)
{ // Fame point system [DracoRPG]