diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-07-04 17:44:22 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-07-04 17:44:22 +0300 |
commit | a97a98fb46d6ed7e90dc0ba8416d9a3d0b1bcb5f (patch) | |
tree | 0164cdb9dc41603d60c5a9fd6a988f98ef95e18b | |
parent | 7e910ba495a74cc968fc630e5cfdb08753b4f228 (diff) | |
download | serverdata-a97a98fb46d6ed7e90dc0ba8416d9a3d0b1bcb5f.tar.gz serverdata-a97a98fb46d6ed7e90dc0ba8416d9a3d0b1bcb5f.tar.bz2 serverdata-a97a98fb46d6ed7e90dc0ba8416d9a3d0b1bcb5f.tar.xz serverdata-a97a98fb46d6ed7e90dc0ba8416d9a3d0b1bcb5f.zip |
Fix different issues in oscar script.
-rw-r--r-- | npc/001-2-12/oscar.txt | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/npc/001-2-12/oscar.txt b/npc/001-2-12/oscar.txt index 873a9003..b604730a 100644 --- a/npc/001-2-12/oscar.txt +++ b/npc/001-2-12/oscar.txt @@ -18,39 +18,43 @@ function item_is_bleachable { + .@item_index = getarg(0); + if (.@item_index < 0) + return false; + getinventorylist; - if (@inventorylist_card1[@item_index] != 0) + if (@inventorylist_card1[.@item_index] != 0) { - if ((@inventorylist_card1[@item_index] > YellowCottonDye) || - (@inventorylist_card1[@item_index] < CrimsonCashmereDye)) + if ((@inventorylist_card1[.@item_index] > YellowCottonDye) || + (@inventorylist_card1[.@item_index] < CrimsonCashmereDye)) { return false; } .@is_bleachable = true; } - if (@inventorylist_card2[@item_index] != 0) + if (@inventorylist_card2[.@item_index] != 0) { - if ((@inventorylist_card2[@item_index] > YellowCottonDye) || - (@inventorylist_card2[@item_index] < CrimsonCashmereDye)) + if ((@inventorylist_card2[.@item_index] > YellowCottonDye) || + (@inventorylist_card2[.@item_index] < CrimsonCashmereDye)) { return false; } .@is_bleachable = true; } - if (@inventorylist_card3[@item_index] != 0) + if (@inventorylist_card3[.@item_index] != 0) { - if ((@inventorylist_card3[@item_index] > YellowCottonDye) || - (@inventorylist_card3[@item_index] < CrimsonCashmereDye)) + if ((@inventorylist_card3[.@item_index] > YellowCottonDye) || + (@inventorylist_card3[.@item_index] < CrimsonCashmereDye)) { return false; } .@is_bleachable = true; } - if (@inventorylist_card4[@item_index] != 0) + if (@inventorylist_card4[.@item_index] != 0) { - if ((@inventorylist_card4[@item_index] > YellowCottonDye) || - (@inventorylist_card4[@item_index] < CrimsonCashmereDye)) + if ((@inventorylist_card4[.@item_index] > YellowCottonDye) || + (@inventorylist_card4[.@item_index] < CrimsonCashmereDye)) { return false; } @@ -70,8 +74,8 @@ narrator 5, l("You can drag and drop an item to the NPC window or select an item through your inventory."); - @item_index = requestitemindex(); - if (!item_is_bleachable()) + .@item_index = requestitemindex(); + if (!item_is_bleachable(.@item_index)) { speech 4, l("You should know this, an item like this can't be bleached."); @@ -89,7 +93,7 @@ l("Ok, let me see..."), l("..."); - failedremovecardsindex @item_index, 1; + failedremovecardsindex .@item_index, 1; speech 12, l("..."), |