Jump to content
  • 0

How to edit Emistry Chain Quest for Gepard support and remove Zeny requirement all together?


Question

Posted

So I was wondering how to add Gepard UniqueID, have it reset OnClock0000 and remove the Zeny requirement?

I've been trying to tinker with it to no avail, It's been awhile since I scripted(8 years?), so I don't remember much and it's like starting all over again.

6 answers to this question

Recommended Posts

  • 0
Posted (edited)

Wow, thanks for the fast reply BeWan, Honestly, I'm having trouble getting it to hold and remove basic variables haha, here's a crack at it, but I'm stuck from here(also probably a few errors).

// NPC Name must have a Number behind it.  ex Name#1 , Name#2,...

prontera,155,181,5	script	Chained Quest#1	757,{
.gui = get_unique_id ();
.sqls = query_sql( "SELECT `variable_storage`, `unique_id` from `chain_quest`, .@chain, .@uid );
.sqlu = query_sql( "UPDATE `chain_quest`, SET `variable_storage` = 1 );

function	ChainedQuest;
mes "I am a Chained Quest NPC, you can only redo the previous Quest after you have finished all of my Quests.";
next;

// Quest Setup : 
// ChainedQuest( Reward,Amount , Required Zeny, {Item1,Amount1,Item2,Amount2,...} );
switch( getd( "Quest"+strnpcinfo(2) ) ){
	Case 0: ChainedQuest( 5001,1, 10000, 607,10 );
	Case 1: ChainedQuest( 5002,1, 15000, 607,20, 608,20 );
	Case 2: ChainedQuest( 5003,1, 20000, 607,30, 608,30, 7539,30 );
//	Case 3: ChainedQuest( 5004,1, 25000, 607,40, 608,30, 7539,40 ,501,10 );
//	Case 4: ChainedQuest( 5005,1, 30000, 607,50, 608,30, 7539,50 ,501,10 ,502,10 );
//	Case 5: ChainedQuest(....);
//	Case 6: ChainedQuest(....);
default:
	mes "Congratulation ,You have finished all the Quest i gave you, you may Re-Do if you want.";
	set getd( "Quest"+strnpcinfo(2) ),0;
	close;
}

OnPCLoadMapEvent:
	showevent 1,0;
	end;

if (.@chain = 1) {
	mes "You have already completed this quest today, come back tomorrow";
	close;
	
function	ChainedQuest	{
	for( set .@i,3; getarg( .@i,0 ) != 0 ; set .@i,.@i + 2 ){
		if( countitem( getarg( .@i ) ) < ( getarg( .@i + 1 )) ){
			mes "[ ^FF0000Part "+( getd( "Quest"+strnpcinfo(2) ) + 1 )+"^000000 ]";
			mes "^00FF00_______________________________^000000";
			mes "^FF0000Reward^000000 : "+getarg(1)+" x ^0000FF"+getitemname( getarg(0) )+"^000000";
			mes "^00FF00_______________________________^000000";
			mes "then bring me those items :";
			mes "^00FF00_______________________________^000000";
			mes ( Zeny < getarg(2) ? "^FF0000":"^0000FF" )+getarg(2)+" Zeny^000000";
			for( set .@a,3; getarg( .@a,0 ) != 0 ; set .@a,.@a + 2 ){
				mes (( countitem(getarg( .@a )) < ( getarg(.@a + 1 )) )? "^FF0000[ "+countitem(getarg(.@a))+" / "+(getarg(.@a+1)):"^0000FF[ "+getd( "Quest"+strnpcinfo(2) ) )+" ] "+getitemname(getarg(.@a))+"^000000 ";
				}
			close;
			}
		}
	if( Zeny < getarg( 2 ) ){
		mes "You required "+getarg( 2 )+" Zeny.";
		close;
		}
	mes "[ ^FF0000Part "+( getd( "Quest"+strnpcinfo(2) ) + 1 )+"^000000 ]";
	mes "Look's like you have collected all";
	mes "^FF0000_______________________________^000000";
	mes ( Zeny < getarg(2) ? "^FF0000":"^0000FF" )+getarg(2)+" Zeny^000000";
	for( set .@i,3; getarg( .@i,0 ) != 0 ; set .@i,.@i + 2 ){
		mes "^FF0000"+getarg( .@i+1 )+" x ^0000FF "+getitemname( getarg( .@i ) )+"^000000";
		}
	next;
	if( select("^0000FFContinue^000000:Cancel") == 2 ){
		mes "Okay..as you wish ~ come back again when you do continue it.";
		close;
		}
	for( set .@i,3; getarg( .@i,0 ) != 0 ; set .@i,.@i + 2 ){
		delitem getarg( .@i ),getarg( .@i + 1 );
		}
	set Zeny,Zeny - getarg( 2 );
	set getd( "Quest"+strnpcinfo(2) ),getd( "Quest"+strnpcinfo(2) ) + 1;
	mes "You will be rewarded with ";
	mes "^0000FF_______________________________^000000";
	mes "^FF0000"+getarg(1)+"^000000 x ^0000FF"+getitemname( getarg(0) )+"^000000";
	mes "^0000FF_______________________________^000000";
	getitem getarg(0),getarg(1);
	.sqlu;
	close;
	}
}
	
OnClock0000;
		query_sql("UPDATE `chain_quest` SET `variable_storage` = '0'");
		addrid(0);
		chain = 0;
	end;

prontera	mapflag	loadevent
CREATE TABLE IF NOT EXISTS `chain_quest` (
	`unique_id` int(11) unsigned NOT NULL default '0',
	`variable_storage` varchar(30) NOT NULL default '',
	PRIMARY KEY	`unique_id` (`unique_id`)
	KEY	`variable_storage` (`variable_storage`)
) ENGINE=MyISAM;

 

Edited by DR4LUC0N
  • 0
Posted

@DR4LUC0N try this.

prontera,155,181,5    script    Chained Quest#1    757,{
.gui = get_unique_id ();
.@nb = query_sql("SELECT `variable_storage` FROM `chain_quest` WHERE `unique_id` = "+.gui+" LIMIT 1", .@chain);

if (.@chain >= 1) {
    mes "You have already completed this quest today, come back tomorrow";
    close;
}

function    ChainedQuest;
mes "I am a Chained Quest NPC, you can only redo the previous Quest after you have finished all of my Quests.";
next;

// Quest Setup : 
// ChainedQuest( Reward,Amount , Required Zeny, {Item1,Amount1,Item2,Amount2,...} );
switch( getd( "Quest"+strnpcinfo(2) ) ){
    case 0: ChainedQuest( 5001,1, 0, 607,10 );
    case 1: ChainedQuest( 5002,1, 0, 607,20, 608,20 );
    case 2: ChainedQuest( 5003,1, 0, 607,30, 608,30, 7539,30 );
//    Case 3: ChainedQuest( 5004,1, 0, 607,40, 608,30, 7539,40 ,501,10 );
//    Case 4: ChainedQuest( 5005,1, 0, 607,50, 608,30, 7539,50 ,501,10 ,502,10 );
//    Case 5: ChainedQuest(....);
//    Case 6: ChainedQuest(....);
default:
    mes "Congratulation ,You have finished all the Quest i gave you, you may Re-Do if you want.";
    set getd( "Quest"+strnpcinfo(2) ),0;
    close;
}

OnPCLoadMapEvent:
    showevent 1,0;
    end;


OnClock0000:
    query_sql "TRUNCATE `chain_quest`";
    end;

    
function    ChainedQuest    {
    for( set .@i,3; getarg( .@i,0 ) != 0 ; set .@i,.@i + 2 ){
        if( countitem( getarg( .@i ) ) < ( getarg( .@i + 1 )) ){
            mes "[ ^FF0000Part "+( getd( "Quest"+strnpcinfo(2) ) + 1 )+"^000000 ]";
            mes "^00FF00_______________________________^000000";
            mes "^FF0000Reward^000000 : "+getarg(1)+" x ^0000FF"+getitemname( getarg(0) )+"^000000";
            mes "^00FF00_______________________________^000000";
            mes "then bring me those items :";
            mes "^00FF00_______________________________^000000";
            if(getarg(2) == 0) {
            } else
            mes ( Zeny < getarg(2) ? "^FF0000":"^0000FF" )+getarg(2)+" Zeny^000000";
            for( set .@a,3; getarg( .@a,0 ) != 0 ; set .@a,.@a + 2 ){
                mes (( countitem(getarg( .@a )) < ( getarg(.@a + 1 )) )? "^FF0000[ "+countitem(getarg(.@a))+" / "+(getarg(.@a+1)):"^0000FF[ "+getd( "Quest"+strnpcinfo(2) ) )+" ] "+getitemname(getarg(.@a))+"^000000 ";
                }
            close;
            }
        }
    if( Zeny < getarg( 2 ) ){
        mes "You required "+getarg( 2 )+" Zeny.";
        close;
        }
    mes "[ ^FF0000Part "+( getd( "Quest"+strnpcinfo(2) ) + 1 )+"^000000 ]";
    mes "Look's like you have collected all";
    mes "^FF0000_______________________________^000000";
    if(getarg(2) == 0) {
    } else
    mes ( Zeny < getarg(2) ? "^FF0000":"^0000FF" )+getarg(2)+" Zeny^000000";
    for( set .@i,3; getarg( .@i,0 ) != 0 ; set .@i,.@i + 2 ){
        mes "^FF0000"+getarg( .@i+1 )+" x ^0000FF "+getitemname( getarg( .@i ) )+"^000000";
        }
    next;
    if( select("^0000FFContinue^000000:Cancel") == 2 ){
        mes "Okay..as you wish ~ come back again when you do continue it.";
        close;
        }
    for( set .@i,3; getarg( .@i,0 ) != 0 ; set .@i,.@i + 2 ){
        delitem getarg( .@i ),getarg( .@i + 1 );
        }
    set Zeny,Zeny - getarg( 2 );
    set getd( "Quest"+strnpcinfo(2) ),getd( "Quest"+strnpcinfo(2) ) + 1;
    mes "You will be rewarded with ";
    mes "^0000FF_______________________________^000000";
    mes "^FF0000"+getarg(1)+"^000000 x ^0000FF"+getitemname( getarg(0) )+"^000000";
    mes "^0000FF_______________________________^000000";
    getitem getarg(0),getarg(1);
    query_sql( "INSERT INTO `chain_quest` VALUES ("+.gui+", 1)");
    close;
    }
}

prontera    mapflag    loadevent
  • 0
Posted (edited)

@Alzhea I appreciate you taking the time out of your day to help me, but TRUNCATE did not work, instead I was able to muster up using 

query_sql( "DELETE FROM `chain_quest` WHERE `daily` = '1'" ); to delete the entries.

Thank you very much!

 

I do have another question, how would I add 2 checks? Like 1 check be unique ID and the other be ip? So it checks unique ID and ip, and when completing the quest, it gives daily =1?

 

If I added an ip table, would it be create this and do a check like we do with unique ID? Like this? 

.lip = last_ip ();
.@ip = query_sql("SELECT `daily` FROM `chain_quest` WHERE `last_ip` = "+.lip+" LIMIT 1", .@chain);
Edited by DR4LUC0N
  • 0
Posted

@DR4LUC0N  i just base that 1 in your script.

.sqlu = query_sql( "UPDATE `chain_quest`, SET `variable_storage` = 1 );


if you want to increase the max daily quest just change the 1 in this part into any numbers you desire/max quest per day

if (.@chain >= 1 && .@ip$ == .@lip$) {
    mes "You have already completed this quest today, come back tomorrow";
    close;
} 


please try this script not yet tested.


CREATE TABLE IF NOT EXISTS `chain_quest` (
	`unique_id` int(11) unsigned NOT NULL default '0',
        `last_ip` varchar(100) NOT NULL default '',
	`variable_storage` varchar(30) NOT NULL default '',
	PRIMARY KEY	`unique_id` (`unique_id`)
	KEY	`variable_storage` (`variable_storage`)
) ENGINE=MyISAM;


prontera,155,181,5    script    Chained Quest#1    757,{
.gui = get_unique_id ();
.@nb = query_sql("SELECT `variable_storage`,`last_ip` FROM `chain_quest` WHERE `unique_id` = "+.gui+" LIMIT 1", .@chain, .@ip$);
.@dip = query_sql("SELECT `last_ip` FROM `login` WHERE `account_id` = "+getcharid(3), .@lip$);

if (.@chain >= 1 && .@ip$ == .@lip$) {
    mes "You have already completed this quest today, come back tomorrow";
    close;
}

function    ChainedQuest;
mes "I am a Chained Quest NPC, you can only redo the previous Quest after you have finished all of my Quests.";
next;

// Quest Setup : 
// ChainedQuest( Reward,Amount , Required Zeny, {Item1,Amount1,Item2,Amount2,...} );
switch( getd( "Quest"+strnpcinfo(2) ) ){
    case 0: ChainedQuest( 5001,1, 0, 607,10 );
    case 1: ChainedQuest( 5002,1, 0, 607,20, 608,20 );
    case 2: ChainedQuest( 5003,1, 0, 607,30, 608,30, 7539,30 );
//    Case 3: ChainedQuest( 5004,1, 0, 607,40, 608,30, 7539,40 ,501,10 );
//    Case 4: ChainedQuest( 5005,1, 0, 607,50, 608,30, 7539,50 ,501,10 ,502,10 );
//    Case 5: ChainedQuest(....);
//    Case 6: ChainedQuest(....);
default:
    mes "Congratulation ,You have finished all the Quest i gave you, you may Re-Do if you want.";
    set getd( "Quest"+strnpcinfo(2) ),0;
    close;
}

OnPCLoadMapEvent:
    showevent 1,0;
    end;


OnClock0000:
    query_sql( "DELETE FROM `chain_quest` WHERE `variable_storage` = '1'" );
    end;

    
function    ChainedQuest    {
    for( set .@i,3; getarg( .@i,0 ) != 0 ; set .@i,.@i + 2 ){
        if( countitem( getarg( .@i ) ) < ( getarg( .@i + 1 )) ){
            mes "[ ^FF0000Part "+( getd( "Quest"+strnpcinfo(2) ) + 1 )+"^000000 ]";
            mes "^00FF00_______________________________^000000";
            mes "^FF0000Reward^000000 : "+getarg(1)+" x ^0000FF"+getitemname( getarg(0) )+"^000000";
            mes "^00FF00_______________________________^000000";
            mes "then bring me those items :";
            mes "^00FF00_______________________________^000000";
            if(getarg(2) == 0) {
            } else
            mes ( Zeny < getarg(2) ? "^FF0000":"^0000FF" )+getarg(2)+" Zeny^000000";
            for( set .@a,3; getarg( .@a,0 ) != 0 ; set .@a,.@a + 2 ){
                mes (( countitem(getarg( .@a )) < ( getarg(.@a + 1 )) )? "^FF0000[ "+countitem(getarg(.@a))+" / "+(getarg(.@a+1)):"^0000FF[ "+getd( "Quest"+strnpcinfo(2) ) )+" ] "+getitemname(getarg(.@a))+"^000000 ";
                }
            close;
            }
        }
    if( Zeny < getarg( 2 ) ){
        mes "You required "+getarg( 2 )+" Zeny.";
        close;
        }
    mes "[ ^FF0000Part "+( getd( "Quest"+strnpcinfo(2) ) + 1 )+"^000000 ]";
    mes "Look's like you have collected all";
    mes "^FF0000_______________________________^000000";
    if(getarg(2) == 0) {
    } else
    mes ( Zeny < getarg(2) ? "^FF0000":"^0000FF" )+getarg(2)+" Zeny^000000";
    for( set .@i,3; getarg( .@i,0 ) != 0 ; set .@i,.@i + 2 ){
        mes "^FF0000"+getarg( .@i+1 )+" x ^0000FF "+getitemname( getarg( .@i ) )+"^000000";
        }
    next;
    if( select("^0000FFContinue^000000:Cancel") == 2 ){
        mes "Okay..as you wish ~ come back again when you do continue it.";
        close;
        }
    for( set .@i,3; getarg( .@i,0 ) != 0 ; set .@i,.@i + 2 ){
        delitem getarg( .@i ),getarg( .@i + 1 );
        }
    set Zeny,Zeny - getarg( 2 );
    set getd( "Quest"+strnpcinfo(2) ),getd( "Quest"+strnpcinfo(2) ) + 1;
    mes "You will be rewarded with ";
    mes "^0000FF_______________________________^000000";
    mes "^FF0000"+getarg(1)+"^000000 x ^0000FF"+getitemname( getarg(0) )+"^000000";
    mes "^0000FF_______________________________^000000";
    getitem getarg(0),getarg(1);
    if(.@nb) 
        query_sql("UPDATE `chain_quest` SET `variable_storage` = "+(.@chain+1)+" WHERE `unique_id` = "+.gui+" LIMIT 1");
    else
        query_sql( "INSERT INTO `chain_quest` VALUES ("+.gui+", "+.@lip+", 1)");
    close;
    }
}

prontera    mapflag    loadevent
  • 0
Posted

@Alzhea Once again I appreciate your help, I understand what you're doing, just wasn't sure how to execute it, I haven't scripted in a long time so trying to get back into the swing of things.

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...