Jump to content
  • 0

Function Kafra with paid Gstorage


Eross

Question


  • Group:  Members
  • Topic Count:  155
  • Topics Per Day:  0.11
  • Content Count:  349
  • Reputation:   12
  • Joined:  04/05/20
  • Last Seen:  

I need to make a new function for GUILD STORAGE wherein it will check if you re a member of a guild and check zeny .. 

 

I tried doing this 

default: setarray .@K_Menu0$[0],"Save","Use Storage", "Use Teleport Service","Rent a Pushcart","Check Other Information","Cancel"; break;

default: setarray .@K_Menu0$[0],"Save","Use Storage", "Use Guild Storage","Use Teleport Service","Rent a Pushcart","Check Other Information","Cancel"; break;

The guild storage opens , yes , but doesnt look like opening normal storage that you need to hit CLOSE before the storage opens ... And also doesnt check for ZENY (I think this is for free service only)

 

 

How will I add another function here and call it ? Like this ???

		else if (.@K_Menu0$[.@j] == "Use Guild Storage (200 Zeny)") {
			callfunc "F_KafGuildStor",1,0;
			next;
		}

and create this ? 

function	script	F_KafGuildStor	{

 <CONTENT HERE>

}

Everytime I do it the npc stuck ... 

I'm trying to edit it from FUNCTION KAFRA.txt coz I want all my kafra to have this paid GUILD STORAGE service 

Thanks in advance

Edited by Origami
additional
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

function	script	F_KafGuildStor	{
	if (Zeny < 200) {
		mes "You need 200 Zeny";
	}
	else {
		switch(guildopenstorage()) {
			case GSTORAGE_OPEN:
				Zeny -= 200;
				mes "Successfully opened.";
				break;
			case GSTORAGE_STORAGE_ALREADY_OPEN:
				mes "Player storage is already open.";
				break;
			case GSTORAGE_ALREADY_OPEN:
				mes "Guild storage is already open.";
				break;
			case GSTORAGE_NO_GUILD:
				mes "Player is not in a guild.";
				break;
			case GSTORAGE_NO_STORAGE:
				mes "Guild hasn't invested in the Guild Storage Expansion skill (only if OFFICIAL_GUILD_STORAGE is enabled).";
				break;
			case GSTORAGE_NO_PERMISSION:
				mes "Player doesn't have permission to use the guild storage.";
				break;
		}
	}
	close;
}

you can try something like this

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  155
  • Topics Per Day:  0.11
  • Content Count:  349
  • Reputation:   12
  • Joined:  04/05/20
  • Last Seen:  

5 hours ago, Emistry said:

function	script	F_KafGuildStor	{
	if (Zeny < 200) {
		mes "You need 200 Zeny";
	}
	else {
		switch(guildopenstorage()) {
			case GSTORAGE_OPEN:
				Zeny -= 200;
				mes "Successfully opened.";
				break;
			case GSTORAGE_STORAGE_ALREADY_OPEN:
				mes "Player storage is already open.";
				break;
			case GSTORAGE_ALREADY_OPEN:
				mes "Guild storage is already open.";
				break;
			case GSTORAGE_NO_GUILD:
				mes "Player is not in a guild.";
				break;
			case GSTORAGE_NO_STORAGE:
				mes "Guild hasn't invested in the Guild Storage Expansion skill (only if OFFICIAL_GUILD_STORAGE is enabled).";
				break;
			case GSTORAGE_NO_PERMISSION:
				mes "Player doesn't have permission to use the guild storage.";
				break;
		}
	}
	close;
}

you can try something like this

Thankyou for your response sir @Emistry but right before the response ive already did this script 

Quote

function    script    Guild_Storage    {

            if(!getcharid(2) > 0){
                mes "[Kafra Employee]";
                mes "You need to join a guild to";
                mes "use this service.";
                return;
            }
            if (Zeny < 400) {
                mes "[Kafra Employee]";
                mes "I'm sorry, but you don't";
                mes "have enough zeny to use";
                mes "the Storage Service. Our";
                mes "Storage access fee is 400 zeny.";
                return;
            }
            
            mes "[Kafra Empsloyee]";
            mes "Welcome. ^ff0000" + getguildname( getcharid(2) ) + "^000000 Member.";
            mes "The Kafra Coporation will stay with you wherever you go.";            
            close2;
            if (guildopenstorage()) {
                mes "[Kafra Employee]";
                mes "I'm sorry but another guild member is using the guild storage";
                mes "right now.  Please wait until that person is finished.";
                return;
            }
            Zeny -= 400;
            guildopenstorage();
            cutin "", 255;
            end;
}

Works fine but I cannot move this line 

           if (guildopenstorage()) {
                mes "[Kafra Employee]";
                mes "I'm sorry but another guild member is using the guild storage";
                mes "right now.  Please wait until that person is finished.";
                return;
            }

On upper part coz it will cause problem .. Thanks!

 

Just one question sir ! what kafra uses this equation ? 

Quote

if (.@welcome == 2)// Guild Kafra Menu override (free Teleport, free Storage, Free Cart)
        setarray .@K_Menu0$[0], "Use Storage", "Use Guild Storage", "Rent a Pushcart", "Use Teleport Service", "Cancel";

just to make sure that it wont make problem by adding this paid Guild storage ... 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...