Famous Posted February 25, 2013 Posted February 25, 2013 http://www.eathena.ws/board/index.php?showtopic=199843 === npc/custom/storagepass.txt ================================================================== --- npc/custom/storagepass.txt (revision 13266) +++ npc/custom/storagepass.txt (local) @@ -0,0 +1,11 @@ +- script StoragePassword -1,{ + + if( #kafra_code != 0 ) + { + mes "[Storage password system]"; + callfunc("F_CheckKafCode"); + close2; + } + + openstorage; +} Property changes on: npc/custom/storagepass.txt ___________________________________________________________________ Name: svn:eol-style +native === src/map/atcommand.c ================================================================== --- src/map/atcommand.c (revision 13266) +++ src/map/atcommand.c (local) @@ -1134,19 +1134,18 @@ *------------------------------------------*/ int atcommand_storage(const int fd, struct map_session_data* sd, const char* command, const char* message) { + struct npc_data* nd; nullpo_retr(-1, sd); if (sd->npc_id || sd->vender_id || sd->state.trading || sd->state.storage_flag) return -1; - if (storage_storageopen(sd) == 1) - { //Already open. - clif_displaymessage(fd, msg_txt(250)); + nd = npc_name2id("StoragePassword"); + if( nd == NULL ) return -1; - } + + run_script(nd->u.scr.script, 0, sd->bl.id, fake_nd->bl.id); - clif_displaymessage(fd, "Storage opened."); - return 0; } Quote
Brian Posted February 25, 2013 Posted February 25, 2013 Here is the diff, updated for the latest rAthena (r17160): storagepass-r17160.diff stop your login,char,map servers apply the diff recompile your map-server start your servers Quote
Famous Posted February 26, 2013 Author Posted February 26, 2013 thnx Brian gonna tried this when I tried to use "@storage" nothing happen.. no password pump out.. but when I tried to talk to npc and open may storage from the kafra npc there is a password.. Quote
Yahiko Posted February 28, 2013 Posted February 28, 2013 (edited) use this one , tested and working on rAthena Revision 17165 click me Edited February 28, 2013 by Yahiko Quote
Brian Posted February 28, 2013 Posted February 28, 2013 when I tried to use "@storage" nothing happen.. no password pump out.. Did you stop, recompile, and restart your servers? Did you disable the script trunk/npc/kafras/functions_kafras.txt on your server? If you did, you'd have to put the "StoragePassword" NPC in a different file. // Kafra Storage Password prompt when using @storage - script StoragePassword -1,{ if (#kafra_code != 0) { mes "[Storage password system]"; callfunc("F_CheckKafCode"); close2; } openstorage; dispbottom "Storage opened."; }It works for me:@storage @set #kafra_code 12345 @storage Quote
Fresh prince Posted March 18, 2013 Posted March 18, 2013 Hello, how can an admin retrieve their pass if forgotten by players? thanks! Quote
Fresh prince Posted March 18, 2013 Posted March 18, 2013 Nvm i saw it on global req, very nice code thanks! 1 Quote
Question
Famous
http://www.eathena.ws/board/index.php?showtopic=199843
==================================================================
--- npc/custom/storagepass.txt (revision 13266)
+++ npc/custom/storagepass.txt (local)
@@ -0,0 +1,11 @@
+- script StoragePassword -1,{
+
+ if( #kafra_code != 0 )
+ {
+ mes "[Storage password system]";
+ callfunc("F_CheckKafCode");
+ close2;
+ }
+
+ openstorage;
+}
Property changes on: npc/custom/storagepass.txt
___________________________________________________________________
Name: svn:eol-style
+native
=== src/map/atcommand.c
==================================================================
--- src/map/atcommand.c (revision 13266)
+++ src/map/atcommand.c (local)
@@ -1134,19 +1134,18 @@
*------------------------------------------*/
int atcommand_storage(const int fd, struct map_session_data* sd, const char* command, const char* message)
{
+ struct npc_data* nd;
nullpo_retr(-1, sd);
if (sd->npc_id || sd->vender_id || sd->state.trading || sd->state.storage_flag)
return -1;
- if (storage_storageopen(sd) == 1)
- { //Already open.
- clif_displaymessage(fd, msg_txt(250));
+ nd = npc_name2id("StoragePassword");
+ if( nd == NULL )
return -1;
- }
+
+ run_script(nd->u.scr.script, 0, sd->bl.id, fake_nd->bl.id);
- clif_displaymessage(fd, "Storage opened.");
-
return 0;
}
8 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.