diff options
-rw-r--r-- | Changelog-Trunk.txt | 1 | ||||
-rw-r--r-- | doc/script_commands.txt | 23 | ||||
-rw-r--r-- | src/map/npc.c | 2 | ||||
-rw-r--r-- | src/map/pet.c | 6 |
4 files changed, 28 insertions, 4 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index dfb5dfc78..5cfa245c4 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -5,6 +5,7 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EV GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
2006/02/05
+ * Fixed and documented script command "callshop". [Skotlex]
* Updated sq;-files/mob_db.sql with current mob_db. [Skotlex]
* Updated sql-files/item_db.sql with current item_db. [Skotlex]
2006/02/04
diff --git a/doc/script_commands.txt b/doc/script_commands.txt index a9512e601..7ed01c0d5 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -3384,6 +3384,29 @@ You can see the full list of available effect types you can possibly inflict in It is pretty certain that addressing the target by an ID number will not
currently work due to a bug.
+
---------------------------------------
+
+*callshop "<shop name>",<flag>;
+
+This command forces an npc shop to be invoked as if the player clicked on it.
+With normal shops it will not work unless the player is within clicking range,
+but the real use of this script command is together with "invisible shops",
+which are specified in the same way an invisible npc would be specified.
+For example, a generic invisible tool shop could be:
+
+- shop INVISIBLE_SHOP -,611:-1,1750:-1,501:-1,502:-1,503:-1,504:-1,506:-1
+
+Which players cannot click on, but can be invoked using:
+
+callshop "INVISIBLE_SHOP", 0;
+
+The flag values are: 1 invokes the buying window, 2 invokes the selling
+window, any other value invokes the buy/sell dialogue.
+
+The function returns 1 on success, and the script is not automatically
+closed, so be careful to not do any item trading on the same script to prevent
+possible exploits (if possible, use close or close2 before invoking the shop
+itself).
---------------------------------------
diff --git a/src/map/npc.c b/src/map/npc.c index e3517458b..cf0632416 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -1764,7 +1764,7 @@ static int npc_parse_shop (char *w1, char *w2, char *w3, char *w4) nd->flag = 0;
memcpy(nd->name, w3, NAME_LENGTH-1);
nd->name[NAME_LENGTH-1] = '\0';
- nd->class_ = m==-1?0:atoi(w4);
+ nd->class_ = m==-1?-1:atoi(w4);
nd->speed = 200;
nd = (struct npc_data *)aRealloc(nd,
diff --git a/src/map/pet.c b/src/map/pet.c index 17d97d225..f94154fe4 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -176,9 +176,6 @@ static int pet_attack(struct pet_data *pd,unsigned int tick,int data) target= map_id2bl(pd->target_id);
- if(!status_check_skilluse(&pd->bl, target, 0, 0))
- return 0;
-
if(target == NULL || pd->bl.m != target->m || target->prev == NULL ||
!check_distance_bl(&pd->bl, target, pd->db->range3))
{
@@ -186,6 +183,9 @@ static int pet_attack(struct pet_data *pd,unsigned int tick,int data) return 0;
}
+ if(!status_check_skilluse(&pd->bl, target, 0, 0))
+ return 0;
+
range = pd->db->range;
if (battle_iswalking(&pd->bl)) range++;
if (battle_iswalking(target)) range++;
|