summaryrefslogtreecommitdiff
path: root/world/map/npc
diff options
context:
space:
mode:
authortux9th <mr.x@aon.at>2013-11-24 10:41:18 -0800
committertux9th <mr.x@aon.at>2013-11-24 10:41:18 -0800
commit5b7768879adf803278e425bc20961c2dc4bc4147 (patch)
tree56e71a52fa2f564fc9b10b21d571852fcd46b4bd /world/map/npc
parent9bab4466134d43018070483b6d6a505dc0c08780 (diff)
parent5d34457becf1d1bbdda00c950d76b538d322c7bc (diff)
downloadclassic-serverdata-5b7768879adf803278e425bc20961c2dc4bc4147.tar.gz
classic-serverdata-5b7768879adf803278e425bc20961c2dc4bc4147.tar.bz2
classic-serverdata-5b7768879adf803278e425bc20961c2dc4bc4147.tar.xz
classic-serverdata-5b7768879adf803278e425bc20961c2dc4bc4147.zip
Merge pull request #45 from wushin/equip-arrow-fix
Unequip & Multiple Ammo Types and Launcher Fix
Diffstat (limited to 'world/map/npc')
-rw-r--r--world/map/npc/021-1/north_shops.txt2
-rw-r--r--world/map/npc/042-2/sorfina.txt2
-rw-r--r--world/map/npc/042-2/tanisha.txt12
-rw-r--r--world/map/npc/items/launcher_ammo.txt36
-rw-r--r--world/map/npc/items/require_stat.txt12
-rw-r--r--world/map/npc/items/restricted_item.txt3
-rw-r--r--world/map/npc/items/unequipcb.txt27
-rw-r--r--world/map/npc/items/unreleased_item.txt10
-rw-r--r--world/map/npc/scripts.conf2
9 files changed, 95 insertions, 11 deletions
diff --git a/world/map/npc/021-1/north_shops.txt b/world/map/npc/021-1/north_shops.txt
index b4e03d28..b7c2b65a 100644
--- a/world/map/npc/021-1/north_shops.txt
+++ b/world/map/npc/021-1/north_shops.txt
@@ -3,7 +3,7 @@
// More high-end stuff to satisfy the richer people in Royal Tulimshar
// Some clothing
-021-1.gat,135,38,0|shop|Inar|108,CottonShirt :-1,CottonShorts :-1,CottonBoots :-1,DesertShirt :-1,SilkRobe :-5,DesertHat :-4
+021-1.gat,135,38,0|shop|Inar|108,SlingShot :-1,SlingBullet :-1,CottonShirt :-1,CottonShorts :-1,CottonBoots :-1,DesertShirt :-1,SilkRobe :-5,DesertHat :-4
021-1.gat,129,40,0|script|Well|400,
{
diff --git a/world/map/npc/042-2/sorfina.txt b/world/map/npc/042-2/sorfina.txt
index b01a83c7..20c04adf 100644
--- a/world/map/npc/042-2/sorfina.txt
+++ b/world/map/npc/042-2/sorfina.txt
@@ -231,6 +231,8 @@ L_SkipTut:
mes "\"Alright, if you say so. But take at least this.";
callfunc "TutorialCompleted";
getitem "Knife", 1;
+ getitem "SlingShot", 1;
+ getitem "SlingBullet", 100;
getitem "CottonShirt", 1;
getitem "RaggedShorts", 1;
set Zeny, Zeny + 50;
diff --git a/world/map/npc/042-2/tanisha.txt b/world/map/npc/042-2/tanisha.txt
index 437099dd..de93b8d5 100644
--- a/world/map/npc/042-2/tanisha.txt
+++ b/world/map/npc/042-2/tanisha.txt
@@ -50,7 +50,7 @@ L_Maggots:
L_Fight_Again:
mes "\"Ok, listen what to do.";
- mes "Equip the knife and kill the maggots.\"";
+ mes "Equip a weapon and kill the maggots.\"";
next;
mes "\"Press A to focus on a monster. With X you can focus and start attacking the same time.";
mes "But it also works to click on the monster with your mouse.\"";
@@ -64,7 +64,15 @@ L_Fight_Again:
// The getitem must be in the same place as set tanisha, 2;
// since it was moved to after L_Fight_Again, add it conditionally
if (tanisha == 1)
- getitem "Knife", 1;
+ goto L_GetFightItems;
+ goto L_ContinueFight;
+
+L_GetFightItems:
+ getitem "Knife", 1;
+ getitem "SlingShot", 1;
+ getitem "SlingBullet", 100;
+
+L_ContinueFight:
set tanisha, 2;
set @Maggot_Kills, 0;
set @time, 0;
diff --git a/world/map/npc/items/launcher_ammo.txt b/world/map/npc/items/launcher_ammo.txt
new file mode 100644
index 00000000..3b0b21f8
--- /dev/null
+++ b/world/map/npc/items/launcher_ammo.txt
@@ -0,0 +1,36 @@
+// ------------------------------------------------------------
+// Ammo Needs to know Launcher and vice versa.
+//
+// Behavior:
+// Ammo is always unequipped
+//
+// Variables passed to this script:
+//
+// @LauncherType, @AmmoType
+//
+// ------------------------------------------------------------
+
+function|script|CheckLauncher|,
+{
+ set @AmmoEquip, (getequipid(equip_arrow) + 1);
+ if (@AmmoEquip)
+ goto L_Return;
+
+L_NoAmmoEquip:
+ set @LauncherType, 0;
+
+L_Return:
+ return;
+}
+
+function|script|CheckAmmo|,
+{
+ if ((@LauncherType == @AmmoType) || (!@LauncherType))
+ goto L_Return;
+
+L_Unequip:
+ callfunc "UnequipLater";
+
+L_Return:
+ return;
+}
diff --git a/world/map/npc/items/require_stat.txt b/world/map/npc/items/require_stat.txt
index 77a518b1..8629b686 100644
--- a/world/map/npc/items/require_stat.txt
+++ b/world/map/npc/items/require_stat.txt
@@ -11,9 +11,15 @@
function|script|RequireStat|,
{
set @bStatVal, readparam(@bStat);
- // If the requirement isn't met, then we end the script.
- // Hence, subsequent item modifiers won't be applied.
+ // If the requirement isn't met, we set an unequip trigger.
+ // The item is now removed.
if (@bStatVal < @minbStatVal)
- end;
+ goto L_Unequip;
+ goto L_Return;
+
+L_Unequip:
+ callfunc "UnequipLater";
+
+L_Return:
return;
}
diff --git a/world/map/npc/items/restricted_item.txt b/world/map/npc/items/restricted_item.txt
index 2aa69c7e..7e3213c0 100644
--- a/world/map/npc/items/restricted_item.txt
+++ b/world/map/npc/items/restricted_item.txt
@@ -11,11 +11,10 @@ function|script|RestrictedItem|,
if (!@minLvl) set @minLvl, 60;
if (debug || getgmlevel() >= @minLvl) goto L_Return; // If the active character is staff, do nothing.
message strcharinfo(0), "This item repells you with extreme force. It does not seem to be meant for you.";
- unequipbyid @slotId;
+ callfunc "UnequipLater";
if (getgmlevel()) goto L_Return;
gmcommand "@wgm Restricted item '" + @itemId + "' used by character '" + strcharinfo(0) + "'.";
gmcommand "@l Restricted item '" + @itemId + "' used by character '" + strcharinfo(0) + "'.";
- end;
L_Return:
return;
diff --git a/world/map/npc/items/unequipcb.txt b/world/map/npc/items/unequipcb.txt
new file mode 100644
index 00000000..ec185f02
--- /dev/null
+++ b/world/map/npc/items/unequipcb.txt
@@ -0,0 +1,27 @@
+// For now this has to use a real map name, but the effect happens
+// on any map because of the -1s at the end.
+// Note: the client (I think) has a display bug if this is called
+// during the intial connection's equip hook
+botcheck.gat,0,0,0|script|UnequipCB|-1,-1,-1
+{
+
+OnUnequip:
+ unequipbyid (@unequip_slot -1);
+ set @unequip_slot, 0;
+ end;
+}
+
+// Paired with unequipcb
+function|script|UnequipLater|,
+{
+ if(@unequip_slot)
+ goto L_Return;
+ goto L_ReturnTimer;
+
+L_ReturnTimer:
+ set @unequip_slot, (@slotId + 1);
+ addtimer 0, "UnequipCB::OnUnequip";
+
+L_Return:
+ return;
+}
diff --git a/world/map/npc/items/unreleased_item.txt b/world/map/npc/items/unreleased_item.txt
index 708cc1e0..457c2bcb 100644
--- a/world/map/npc/items/unreleased_item.txt
+++ b/world/map/npc/items/unreleased_item.txt
@@ -5,8 +5,12 @@
function|script|UnreleasedItem|,
{
- if (debug || getgmlevel()) end; // If the server allows equipping unreleased items or if the active character is staff, do nothing.
+ // If the server allows equipping unreleased items or if the active character is staff, do nothing.
+ if (debug || getgmlevel())
+ goto L_Return;
message strcharinfo(0), "You have difficulties equipping this item, as if it is not yet fully in this world.";
- unequipbyid @slotId;
- end;
+ callfunc "UnequipLater";
+
+L_Return:
+ return;
}
diff --git a/world/map/npc/scripts.conf b/world/map/npc/scripts.conf
index 26a0b0b4..2fff74b8 100644
--- a/world/map/npc/scripts.conf
+++ b/world/map/npc/scripts.conf
@@ -29,6 +29,8 @@ npc: npc/items/unreleased_item.txt
npc: npc/items/require_stat.txt
npc: npc/items/restricted_item.txt
npc: npc/items/warpTowels.txt
+npc: npc/items/unequipcb.txt
+npc: npc/items/launcher_ammo.txt
import: npc/_import.txt