summaryrefslogtreecommitdiff
path: root/src/map/script.c
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/script.c
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/script.c')
-rw-r--r--src/map/script.c67
1 files changed, 53 insertions, 14 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"),