summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicksha <ms-shaman@gmx.de>2020-09-18 18:51:50 +0000
committerMicksha <ms-shaman@gmx.de>2020-09-18 18:51:50 +0000
commitf4091e437adf9ef849767983f2cad1a4c64ad69d (patch)
treec19bf1ff552e8dbf7293468301fe152a5d585db3
parent01ae0e398d5b49db2aafb8af31acf81fb8a522c9 (diff)
parent58d39bb066ad21c051d72b4bee577819fdba0381 (diff)
downloadserverdata-f4091e437adf9ef849767983f2cad1a4c64ad69d.tar.gz
serverdata-f4091e437adf9ef849767983f2cad1a4c64ad69d.tar.bz2
serverdata-f4091e437adf9ef849767983f2cad1a4c64ad69d.tar.xz
serverdata-f4091e437adf9ef849767983f2cad1a4c64ad69d.zip
Merge branch 'jesusalva/refinery' into 'master'
Refine prototype See merge request evol/serverdata!214
-rw-r--r--db/re/item_db.conf85
-rw-r--r--npc/config/hairstyle_config.txt2
-rw-r--r--npc/functions/global_event_handler.txt1
-rw-r--r--npc/functions/refine.txt66
-rw-r--r--npc/scripts.conf1
5 files changed, 132 insertions, 23 deletions
diff --git a/db/re/item_db.conf b/db/re/item_db.conf
index 6be57083..da7157c2 100644
--- a/db/re/item_db.conf
+++ b/db/re/item_db.conf
@@ -778,7 +778,6 @@ item_db: (
Sell: 0
Weight: 10
KeepAfterUse: true
- Refine: false
Script: <"
doevent "@rules::OnUseBook";
">
@@ -792,7 +791,6 @@ item_db: (
Sell: 10
Weight: 30
KeepAfterUse: true
- Refine: false
Script: <"
doevent "#001-2-4-Book2::OnUse";
">
@@ -965,7 +963,6 @@ item_db: (
Buy: 75
Sell: 15
Weight: 15
- Refine: false
Delay: 450
UseEffect: "EFFECT_HEAL"
Script: <"
@@ -1227,7 +1224,6 @@ item_db: (
Sell: 300
Weight: 14
KeepAfterUse: true
- Refine: false
Script: <"
// ShovelQuests_Assigned<MAP$,X,Y> → Coordinates for Treasure Map
if (!ShovelQuests_AssignedX) {
@@ -1289,7 +1285,6 @@ item_db: (
Sell: 0
Weight: 0
KeepAfterUse: false
- Refine: false
Trade: {
notrade: true
nodrop: true
@@ -2255,7 +2250,6 @@ item_db: (
Buy: 500
Sell: 110
Weight: 2
- Refine: false
},
{
Id: 809
@@ -4179,10 +4173,13 @@ item_db: (
Loc: "EQP_HAND_R"
WeaponLv: 1
EquipLv: 1
- Refine: false
+ Refine: true
Subtype: "W_DAGGER"
ViewSprite: 1
BindOnEquip: false
+ OnEquipScript: <"
+ callfunc("refinesync");
+ ">
},
{
Id: 3501
@@ -4199,9 +4196,12 @@ item_db: (
Loc: "EQP_HAND_R"
WeaponLv: 1
EquipLv: 3
- Refine: false
+ Refine: true
Subtype: "W_DAGGER"
BindOnEquip: false
+ OnEquipScript: <"
+ callfunc("refinesync");
+ ">
},
{
Id: 3502
@@ -4218,9 +4218,12 @@ item_db: (
Loc: "EQP_HAND_R"
WeaponLv: 1
EquipLv: 5
- Refine: false
+ Refine: true
Subtype: "W_1HSWORD"
BindOnEquip: false
+ OnEquipScript: <"
+ callfunc("refinesync");
+ ">
},
{
Id: 3503
@@ -4237,9 +4240,12 @@ item_db: (
Loc: "EQP_HAND_R"
WeaponLv: 1
EquipLv: 5
- Refine: false
+ Refine: true
Subtype: "W_1HSWORD"
BindOnEquip: false
+ OnEquipScript: <"
+ callfunc("refinesync");
+ ">
},
{
Id: 3504
@@ -4256,9 +4262,12 @@ item_db: (
Loc: "EQP_HAND_R"
WeaponLv: 1
EquipLv: 15
- Refine: false
+ Refine: true
Subtype: "W_1HSWORD"
BindOnEquip: false
+ OnEquipScript: <"
+ callfunc("refinesync");
+ ">
},
{
Id: 3505
@@ -4275,11 +4284,12 @@ item_db: (
Loc: ["EQP_HAND_R", "EQP_HAND_L"]
WeaponLv: 1
EquipLv: 10
- Refine: false
+ Refine: true
Subtype: "W_STAFF"
BindOnEquip: false
OnEquipScript: <"
doevent "#SpotlightMaster::OnTouch";
+ callfunc("refinesync");
">
OnUnequipScript: <"
doevent "#SpotlightMaster::OnTouch";
@@ -4304,11 +4314,12 @@ item_db: (
Loc: ["EQP_HAND_R", "EQP_HAND_L"]
WeaponLv: 1
EquipLv: 10
- Refine: false
+ Refine: true
Subtype: "W_STAFF"
BindOnEquip: false
OnEquipScript: <"
doevent "#SpotlightMaster::OnTouch";
+ callfunc("refinesync");
">
OnUnequipScript: <"
doevent "#SpotlightMaster::OnTouch";
@@ -4334,9 +4345,12 @@ item_db: (
Loc: ["EQP_HAND_R","EQP_HAND_L"]
WeaponLv: 1
EquipLv: 12
- Refine: false
+ Refine: true
Subtype: "W_2HSPEAR"
BindOnEquip: false
+ OnEquipScript: <"
+ callfunc("refinesync");
+ ">
},
{
Id: 3508
@@ -4353,10 +4367,13 @@ item_db: (
Loc: "EQP_HAND_R"
WeaponLv: 1
EquipLv: 15
- Refine: false
+ Refine: true
Subtype: "W_DAGGER"
ViewSprite: 1
BindOnEquip: false
+ OnEquipScript: <"
+ callfunc("refinesync");
+ ">
},
{
Id: 3509
@@ -4373,10 +4390,13 @@ item_db: (
Loc: "EQP_HAND_R"
WeaponLv: 1
EquipLv: 20
- Refine: false
+ Refine: true
Subtype: "W_DAGGER"
ViewSprite: 1
BindOnEquip: false
+ OnEquipScript: <"
+ callfunc("refinesync");
+ ">
},
{
Id: 3510
@@ -4393,9 +4413,12 @@ item_db: (
Loc: ["EQP_HAND_R","EQP_HAND_L"]
WeaponLv: 1
EquipLv: 15
- Refine: false
+ Refine: true
Subtype: "W_KATAR"
BindOnEquip: false
+ OnEquipScript: <"
+ callfunc("refinesync");
+ ">
},
{
Id: 3511
@@ -4412,11 +4435,12 @@ item_db: (
Loc: ["EQP_HAND_R","EQP_HAND_L"]
WeaponLv: 1
EquipLv: 10
- Refine: false
+ Refine: true
Subtype: "W_STAFF"
BindOnEquip: false
OnEquipScript: <"
doevent "#SpotlightMaster::OnTouch";
+ callfunc("refinesync");
">
OnUnequipScript: <"
doevent "#SpotlightMaster::OnTouch";
@@ -4438,9 +4462,12 @@ item_db: (
Loc: "EQP_HAND_R"
WeaponLv: 1
EquipLv: 10
- Refine: false
+ Refine: true
Subtype: "W_1HAXE"
BindOnEquip: false
+ OnEquipScript: <"
+ callfunc("refinesync");
+ ">
},
{
Id: 3513
@@ -4458,9 +4485,12 @@ item_db: (
Loc: ["EQP_HAND_R", "EQP_HAND_L"]
WeaponLv: 1
EquipLv: 10
- Refine: false
+ Refine: true
Subtype: "W_2HSTAFF"
BindOnEquip: false
+ OnEquipScript: <"
+ callfunc("refinesync");
+ ">
},
{
Id: 3514
@@ -4478,9 +4508,12 @@ item_db: (
Loc: ["EQP_HAND_R", "EQP_HAND_L"]
WeaponLv: 1
EquipLv: 20
- Refine: false
+ Refine: true
Subtype: "W_2HAXE"
BindOnEquip: false
+ OnEquipScript: <"
+ callfunc("refinesync");
+ ">
},
{
Id: 3515
@@ -4494,9 +4527,12 @@ item_db: (
Loc: "EQP_HAND_R"
WeaponLv: 1
EquipLv: 1
- Refine: false
+ Refine: true
Subtype: "W_DAGGER"
BindOnEquip: false
+ OnEquipScript: <"
+ callfunc("refinesync");
+ ">
},
{
Id: 3516
@@ -4510,10 +4546,13 @@ item_db: (
Loc: "EQP_HAND_R"
WeaponLv: 1
EquipLv: 15
- Refine: false
+ Refine: true
Subtype: "W_DAGGER"
ViewSprite: 1
BindOnEquip: false
+ OnEquipScript: <"
+ callfunc("refinesync");
+ ">
},
// Pet Eggs
{
diff --git a/npc/config/hairstyle_config.txt b/npc/config/hairstyle_config.txt
index de2d0467..6a43e4c8 100644
--- a/npc/config/hairstyle_config.txt
+++ b/npc/config/hairstyle_config.txt
@@ -20,5 +20,7 @@ OnInit:
"Fire red", "Light violet", "Purple plum", "Navy blue",
"Lagoon blue", "Twisted teal", "Spring Green", "Forest Green",
"Silver Grey", "Esperia Blue";
+
+ setarray $@REFEXP[0], 400, 900, 2250, 6500, 15000;
end;
}
diff --git a/npc/functions/global_event_handler.txt b/npc/functions/global_event_handler.txt
index bc469645..91cd12ef 100644
--- a/npc/functions/global_event_handler.txt
+++ b/npc/functions/global_event_handler.txt
@@ -51,6 +51,7 @@ OnNPCKillEvent:
$MONSTERS_KILLED+=1;
MONSTERS_KILLED+=1;
callfunc("EnoraKills");
+ callfunc("refineupdate");
if ($MONSTERS_KILLED % 1000000 == 0)
callfunc("GetBeanieCopter");
end;
diff --git a/npc/functions/refine.txt b/npc/functions/refine.txt
new file mode 100644
index 00000000..23df387c
--- /dev/null
+++ b/npc/functions/refine.txt
@@ -0,0 +1,66 @@
+// The Mana World Script
+// Author:
+// Jesusalva
+// Inspiration:
+// Pyndragon (LoF)
+// Scall (TMW-BR)
+// Saulc (ML)
+// Description:
+// Handles refinement
+
+// refineupdate( {killedrid} )
+function script refineupdate {
+ // Not armed? We do nothing
+ if (!getequipisequiped(EQI_HAND_R))
+ return;
+
+ // Set temporary variables
+ .@k=getarg(0, killedrid);
+ .@w=getequipid(EQI_HAND_R);
+ .@r=getequiprefinerycnt(EQI_HAND_R);
+
+
+ // Weapon cannot be refined
+ if (!getequipisenableref(EQI_HAND_R))
+ return;
+
+ // Register the weapon experience
+ weaponExp[.@w] = weaponExp[.@w] + getmonsterinfo(.@k, MOB_LV);
+
+ // Get exp needed to level up from global array
+ .@exp=$@REFEXP[.@r];
+
+ // Cannot level up
+ if (.@exp < 1)
+ return;
+
+ // Leveled up!
+ if (weaponExp[.@w] >= .@exp) {
+ weaponExp[.@w]-=.@exp;
+ weaponLvl[.@w] = weaponLvl[.@w] + 1;
+ successrefitem(EQI_HAND_R);
+ dispbottom l("Weapon level up!");
+ }
+ return;
+}
+
+// Resyncs weapon level
+function script refinesync {
+ // Not armed? We do nothing
+ if (!getequipisequiped(EQI_HAND_R))
+ return;
+
+ .@w=getequipid(EQI_HAND_R);
+ .@r=getequiprefinerycnt(EQI_HAND_R);
+ .@lv=weaponLvl[.@w];
+
+ if (.@r > .@lv) {
+ // Refine level overestimated
+ downrefitem(EQI_HAND_R, max(0, .@r - .@lv));
+ } else if (.@lv > .@r) {
+ // Refine level understimated
+ successrefitem(EQI_HAND_R, max(0, .@lv - .@r));
+ }
+ return;
+}
+
diff --git a/npc/scripts.conf b/npc/scripts.conf
index 601b5b8e..d3598405 100644
--- a/npc/scripts.conf
+++ b/npc/scripts.conf
@@ -49,6 +49,7 @@
"npc/functions/generic-text.txt",
"npc/functions/asklanguage.txt",
"npc/functions/game-rules.txt",
+"npc/functions/refine.txt",
"npc/functions/riddle.txt",
"npc/functions/bank.txt",
"npc/functions/confused-tree-dict.txt",