Skip to content
Permalink
Browse files
Initial release of 'itemshop' and 'pointshop'
-- Suggestion: http://rathena.org/board/topic/84169-specialty-shops/
-- Credits: Aleos & Akinari for first diff file that I used to finish this and testing/debugging (well, I don't know the original ones, just tell us or just do pull request if you know the first creator.)
-- How to use?
---> -%TAB%itemshop%TAB%<NPC Name>%TAB%<sprite id>,<costitemid>,<itemid>:<price>{,<itemid>:<price>...}
---> -%TAB%pointshop%TAB%<NPC Name>%TAB%<sprite id>,<costvariable>,<itemid>:<price>{,<itemid>:<price>...}

Signed-off-by: Cahyadi Ramadhan Togihon <house.bad@gmail.com>
  • Loading branch information
cydh committed Nov 30, 2013
1 parent 1d485ca commit 32fd3ee3030574d6771a20f16917032bea43abd2
Showing with 189 additions and 62 deletions.
  1. +12 −5 conf/msg_conf/map_msg.conf
  2. +19 −6 doc/script_commands.txt
  3. +1 −1 src/map/map.h
  4. +147 −42 src/map/npc.c
  5. +2 −0 src/map/npc.h
  6. +3 −3 src/map/pc.c
  7. +5 −5 src/map/script.c
@@ -676,10 +676,6 @@
678: You are no longer the Guild Master.
679: You have become the Guild Master!
680: You have been recovered!
681: Item %d has been removed from your inventory.
682: Item %d has been removed from your cart.
683: Item %d has been removed from your storage.
//684-899 free

681: Rune Knight T
682: Warlock T
@@ -707,7 +703,18 @@
706: Player '%s' is now VIP for %d years, %d months, %d days, %d hours and %d minutes.
707: You are VIP until: %s
708: The player is now VIP until: %s
//709-899 free

709: Item %d has been removed from your inventory.
710: Item %d has been removed from your cart.
711: Item %d has been removed from your storage.

//Item shop
712: You do not have enough %s (%d).
713: You do not have enough '%s'.
714: Item Shop List: %s (%d)
715: Point Shop List: '%s'
716: Your '%s' now: %d
//717-899 free

//------------------------------------
// More atcommands message
@@ -268,11 +268,17 @@ normally mean it's pointless since it can't do anything, but there are
exceptions, mostly related to running scripts at specified time, which is what
these floating NPC objects are for. More on that below.

** Define a shop/cashshop NPC.
** Define a shop/cashshop/itemshop/pointshop NPC.

-%TAB%shop%TAB%<NPC Name>%TAB%<sprite id>,<itemid>:<price>{,<itemid>:<price>...}
<map name>,<x>,<y>,<facing>%TAB%shop%TAB%<NPC Name>%TAB%<sprite id>,<itemid>:<price>{,<itemid>:<price>...}

-%TAB%itemshop%TAB%<NPC Name>%TAB%<sprite id>,<costitemid>,<itemid>:<price>{,<itemid>:<price>...}
<map name>,<x>,<y>,<facing>%TAB%itemshop%TAB%<NPC Name>%TAB%<sprite id>,<costitemid>,<itemid>:<price>{,<itemid>:<price>...}

-%TAB%pointshop%TAB%<NPC Name>%TAB%<sprite id>,<costvariable>,<itemid>:<price>{,<itemid>:<price>...}
<map name>,<x>,<y>,<facing>%TAB%pointshop%TAB%<NPC Name>%TAB%<sprite id>,<costvariable>,<itemid>:<price>{,<itemid>:<price>...}

This will define a shop NPC, which, when triggered (which can only be done by
clicking) will cause a shop window to come up. No code whatsoever runs in shop
NPCs and you can't change the prices otherwise than by editing the script
@@ -291,17 +297,24 @@ This type of shop will not allow you to sell items at it, you may only
purchase items here. The layout used to define sale items still count, and
"<price>" refers to how many points will be spent purchasing the them.

** Define an warp/shop/cashshop/NPC duplicate.
Since trunk rX you can alternatively use "itemshop" or "pointshop" in place
of "shop" to use the Shop interface, allowing you to buy items with a specific
item or special points from a variable. 'pointshop' only supported variable types
are permanent character variables, temporary character variables, permanent
local account variables, or permanent global account variables. These variables
must be of integer type, not string.

** Define an warp/shop/cashshop/itemshop/pointshop/NPC duplicate.

warp: <map name>,<x>,<y>,<facing>%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<spanx>,<spany>
shop/cashshop/npc: -%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<sprite id>
shop/cashshop/npc: <map name>,<x>,<y>,<facing>%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<sprite id>
shop/cashshop/itemshop/pointshop/npc: -%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<sprite id>
shop/cashshop/itemshop/pointshop/npc: <map name>,<x>,<y>,<facing>%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<sprite id>
npc: -%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<sprite id>,<triggerX>,<triggerY>
npc: <map name>,<x>,<y>,<facing>%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<sprite id>,<triggerX>,<triggerY>

This will duplicate an warp/shop/cashshop/NPC referred to by 'label'.
This will duplicate an warp/shop/cashshop/itemshop/pointshop/NPC referred to by 'label'.
Warp duplicates inherit the target location.
Shop/cashshop duplicates inherit the item list.
Shop/cashshop/itemshop/pointshop duplicates inherit the item list.
NPC duplicates inherit the script code.
The rest (name, location, facing, sprite ID, span/trigger area)
is obtained from the definition of the duplicate (not inherited).
@@ -261,7 +261,7 @@ enum bl_type {
//For common mapforeach calls. Since pets cannot be affected, they aren't included here yet.
#define BL_CHAR (BL_PC|BL_MOB|BL_HOM|BL_MER|BL_ELEM)

enum npc_subtype { WARP, SHOP, SCRIPT, CASHSHOP, TOMB };
enum npc_subtype { WARP, SHOP, SCRIPT, CASHSHOP, ITEMSHOP, POINTSHOP, TOMB };

enum {
RC_FORMLESS=0,

0 comments on commit 32fd3ee

Please sign in to comment.