Jump to content

Kyoya G

Members
  • Content Count

    8
  • Joined

  • Last visited

Posts posted by Kyoya G


  1. On 20/06/2018 at 1:54 PM, melv0 said:

    i have script npc event tic tac toe

    
    -	script	3er_2	-1,{
    
    	if ( ( .X2 && .O2 ) && ( .X2 == getcharid ( 3 ) || .O2 == getcharid ( 3 ) ) &&  ( ! isloggedin ( .X2, .X ) || ! isloggedin ( .O2, .O ) ) ) donpcevent "Tic Tac Toe#3z::OnResetGame";
    	set .@a, atoi ( strnpcinfo ( 2 ) );
    	if ( ( ! $@ttt_a[.@a] ) && ( $@ttt_turn ) ) {
    		if ( getcharid ( 0 ) == getvariableofnpc ( .X, "Tic Tac Toe#3z" ) ) {
    			if ( ( $@ttt_turn % 2 ) ) {
    				set $@ttt_a[.@a], 1;
    				setnpcdisplay "Poring#"+ .@a, $@ttt_ids[0] ;
    				set .@c, 1;
    			}
    			else dispbottom "Is not your turn!";
    		}
    		if ( getcharid ( 0 ) == getvariableofnpc ( .O, "Tic Tac Toe#3z" ) ) {
    			if ( ! ( $@ttt_turn % 2 ) ) {
    				set $@ttt_a[.@a], 2;
    				setnpcdisplay "Poring#"+ .@a, $@ttt_ids[1] ;
    				set .@c, 2;
    			}
    			else dispbottom "Is not your turn!";
    		}
    		if ( .@c ) {
    			set $@ttt_turn, $@ttt_turn + 1;
    			specialeffect 44 ;
    			set .@b, callsub ( CheckTic, .@c );
    			if ( .@b ) callsub Winner, .@b;
    			else if ( $@ttt_turn >= 10 ) {
    				if ( $@ttt_ann >= 0 ) announce "Draw game.", ( ( $@ttt_ann <= 3 ) ? $@ttt_ann : 3 ), "0x"+$@ttt_ann$ ;
    				donpcevent "Tic Tac Toe#3z::OnResetGame";
    			}
    		}
    	}
    	end ;
    
    OnInit:
    	/*
    			Item1 Amount1, Item2, Amount2, {Item...}, {Amount...}
    			( Max items: 64 )
    	*/
    	setarray $@ttt_prizes[0],607,5;
    
    			// Sprites.
    			// ID X  ID O
    	setarray $@ttt_ids[0],1582,1568;
    
    	/*
    		Announce:
    		-1 = No announce
    		0 = All.
    		1 = Map.
    		2 = Area.
    		3 = Self.
    	*/
    	set $@ttt_ann,1;
    
    	// Color of the announce (winner).
    	// Default = "30bdb5"
    	set $@ttt_ann$,"30bdb5";
    
    	end;
    
    CheckTic:
    
    
    	setarray .@a[0], 1, 2, 3, 1, 5, 9, 3, 5, 7, 4, 5, 6, 7, 8, 9, 1, 6, 7, 2, 5, 8, 3, 4, 9;
    	for ( set .@b, 0; .@b < getarraysize ( .@a ) ; set .@b, .@b + 3 )
    		if (
    			$@ttt_a[.@a[.@b]] == getarg ( 0 ) &&
    			$@ttt_a[.@a[.@b + 1]] == getarg ( 0 ) &&
    			$@ttt_a[.@a[.@b + 2]] == getarg ( 0 )
    		) return getarg ( 0 ) ;
    	return 0;
    
    Winner:
    
    	for ( set .@i, 0; .@i < getarraysize ( $@ttt_prizes ) ; set .@i, .@i + 2 )
    		getitem $@ttt_prizes[.@i], $@ttt_prizes[.@i + 1];
    	if ( $@ttt_ann >= 0 ) announce "The player "+ getarg ( 0 ) +" ("+ strcharinfo ( 0 ) +") has won!", ( ( $@ttt_ann <= 3 ) ? $@ttt_ann : 3 ), "0x"+$@ttt_ann$ ;
    	donpcevent "Tic Tac Toe#3z::OnResetGame";
    	return ;
    	
    }
    
    prontera,152,136,4	duplicate(3er_2)	Poring#1	909
    prontera,155,136,4	duplicate(3er_2)	Poring#2	909
    prontera,158,136,4	duplicate(3er_2)	Poring#3	909
    prontera,158,133,4	duplicate(3er_2)	Poring#4	909
    prontera,155,133,4	duplicate(3er_2)	Poring#5	909
    prontera,152,133,4	duplicate(3er_2)	Poring#6	909
    prontera,152,130,4	duplicate(3er_2)	Poring#7	909
    prontera,155,130,4	duplicate(3er_2)	Poring#8	909
    prontera,158,130,4	duplicate(3er_2)	Poring#9	909
    
    prontera,164,136,4	script	Tic Tac Toe#3z	909,{
    
    	// NPC Name.
    	set .@a$, "^2b86b5Tic Tac Toe^000000";
    
    	mes .@a$;
    	setarray .@a[0], .X2, .X, .O2, .O;
    	for ( set .@b, getarraysize ( .@a ) ; .@c < .@b ; set .@c, .@c + 2 ) {
    		if ( isloggedin ( .@a[.@c], .@a[.@c + 1] ) ) mes "Player "+ ( .@c / 2 + 1 ) +": "+ rid2name ( ( ( .@c == 0 ) ? .X2 : .O2 ) ) +".";
    		else {
    			mes "Player "+ ( .@c / 2 + 1 ) +": There isn't.";
    			setd ( ( .@c == 0 ) ? ".X2" : ".O2" ), 0;
    			setd ( ( .@c == 0 ) ? ".X" : ".O" ), 0;
    		}
    	}
    	switch ( select ( "Register", "^911b1bExit^000000" ) ) {
    
    		case 1:
    
    			if (  .X && .O ) {
    				mes "I'm sorry, but somebody else has already register before than you.";
    				break ;
    			}
    			if ( .X2 == getcharid ( 3 ) || .O2 == getcharid ( 3 ) ) {
    				mes "You're registered already.";
    				break ;
    			}
    			if ( ! .X && ! .O ) {
    				set .@a, rand ( 1, 2 );
    				setd ( ( .@a == 1 ) ? ".X" : ".O" ), getcharid ( 0 );
    				setd ( ( .@a == 1 ) ? ".X2" : ".O2" ), getcharid ( 3 );
    			}
    			else {
    				setd ( ( .X == 0 ) ? ".X" : ".O" ), getcharid ( 0 );
    				setd ( ( .X2 == 0  ) ? ".X2" : ".O2" ), getcharid ( 3 );
    			}
    			if (  .X && .O )  {
    				set $@ttt_turn, rand ( 1, 2 );
    				npctalk "The game can start, "+ strcharinfo ( 0 ) +" has been register!";
    			}
    			mes "You're registered now, you're the "+ ( ( .X2 == getcharid ( 3 ) ) ? "Deviling" : "Angeling" );
    			break ;
    
    		case 2:
    
    			mes "Have a nice day.";
    			break ;
    	}
    	close ;
    
    OnResetGame:
    
    	while ( set ( .@i, .@i + 1 ) < 10 ) {
    		set $@ttt_a[.@i], 0;
    		setnpcdisplay "Poring#"+ .@i, 909 ;
    	}
    	set .X2, 0;
    	set .X, 0;
    	set .O2, 0;
    	set .O, 0;
    	end ;
    }

    how to make cost zeny when register

    somebody can help me?

     

    Try this:

    Spoiler

    prontera,164,136,4    script    Tic Tac Toe#3z    909,{

        // NPC Name.
        set .@a$, "^2b86b5Tic Tac Toe^000000";
        
        // Zeny cost
        set .@zeny, 100000;

        mes .@a$;
        setarray .@a[0], .X2, .X, .O2, .O;
        for ( set .@b, getarraysize ( .@a ) ; .@c < .@b ; set .@c, .@c + 2 ) {
            if ( isloggedin ( .@a[.@c], .@a[.@c + 1] ) ) mes "Player "+ ( .@c / 2 + 1 ) +": "+ rid2name ( ( ( .@c == 0 ) ? .X2 : .O2 ) ) +".";
            else {
                mes "Player "+ ( .@c / 2 + 1 ) +": There isn't.";
                setd ( ( .@c == 0 ) ? ".X2" : ".O2" ), 0;
                setd ( ( .@c == 0 ) ? ".X" : ".O" ), 0;
            }
        }
        switch ( select ( "Register", "^911b1bExit^000000" ) ) {

            case 1:
                if (  .X && .O ) {
                    mes "I'm sorry, but somebody else has already register before than you.";
                    break ;
                }
                if ( .X2 == getcharid ( 3 ) || .O2 == getcharid ( 3 ) ) {
                    mes "You're registered already.";
                    break ;
                }
                
                mes "You need to pay "+.@zeny+" to register in this game.";
                switch ( select ( "Pay the fee", "^911b1bExit^000000" ) ) {
                    
                    case 1:
                        if(Zeny >= .@zeny){
                            Zeny = Zeny - .@zeny;
                        } 
                        else {
                            next;
                            mes "You don't have the required money."
                            close;
                        }
                        break;
                        
                    case 2:
                        next;
                        mes "Have a nice day.";
                        close;
                        break;
                }
                
                if ( ! .X && ! .O ) {
                    set .@a, rand ( 1, 2 );
                    setd ( ( .@a == 1 ) ? ".X" : ".O" ), getcharid ( 0 );
                    setd ( ( .@a == 1 ) ? ".X2" : ".O2" ), getcharid ( 3 );
                }
                else {
                    setd ( ( .X == 0 ) ? ".X" : ".O" ), getcharid ( 0 );
                    setd ( ( .X2 == 0  ) ? ".X2" : ".O2" ), getcharid ( 3 );
                }
                
                if (  .X && .O )  {
                    set $@ttt_turn, rand ( 1, 2 );
                    npctalk "The game can start, "+ strcharinfo ( 0 ) +" has been register!";
                }
                
                mes "You're registered now, you're the "+ ( ( .X2 == getcharid ( 3 ) ) ? "Deviling" : "Angeling" );
                break ;

            case 2:
                mes "Have a nice day.";
                break ;
        }
        close ;

    OnResetGame:

        while ( set ( .@i, .@i + 1 ) < 10 ) {
            set $@ttt_a[.@i], 0;
            setnpcdisplay "Poring#"+ .@i, 909 ;
        }
        set .X2, 0;
        set .X, 0;
        set .O2, 0;
        set .O, 0;
        end ;
    }

    If you got any problem just tell me here.


  2. 10 hours ago, 4144 said:

    if you using 2016 exe, then you must use lua/txt and other files from 2016 version. 2018 files with outdated client exe may not works.

     

    which files? 

    I tried every kind of file about quests that I found in my exe...

    Should I update my exe or take a older version client?

    thanks...


  3. 2 hours ago, Dastgir said:

    For newish client like early 2018(ragexeRE) clients you can edit System/OngoingQuestInfoList_Sakray.lub, I guess quest lub which you are currently editing was introduced on early 2013.

    The file you are editing does not show npc image if it's on progress, you have added it in ep14.1, so if you check there, it would show npc I suppose(if those Lua/lub is even read by 2016 client)

    I looked for that file but I only found System/OngoingQuestInfoList.lub and I edited it, but it still doesn't work. 

    I guess that, as you mentioned, those lub files(data/luafiles514/luafiles/quest) are not even being read by my 2018 client.

    I noticed that not only the sprites are not working but also the navigation, as you can see here: 

    Spoiler

    asdasd.png

     

     

    Besides that I also noticed that even the original quests sprites are not working too, only the navigation, as you can see here:

    Spoiler

    asdasdasdasdasd.png

     

     

    I dont know if Im rigth but I think those sprites are related with navigation system.

    I guess the problem is with my client, hexed, or translated data and system versions...

    Could you recommend me a client/hexed version and translation that the npc quests sprites and navigation system works??

    Thanks for helping me~


  4. 11 hours ago, Dastgir said:

    My mistake, it seems that's correct name.

    Which client are you using? (By the looks of screenshot, it seems it isn't reading Lua file).

    Im using kRO 2018.03.27 client. 

    My hexed is 2016-07-06Ragexe.

    Yes, my Iteminfo is lub too. Seems its not reading lua files. Do you think it is a problem?

    Thanks~

     

    7 hours ago, Ridley said:

    as for the count, you need to add a target and the count in quest_db.conf

     

    
    {
    	Id: 20017
    	Name: "Treinamento Inicial"
    	Targets: (
    	{
    		MobId: 1002
    		Count: 10
    	},
    },

    for your lua file, I'm pretty sure it's not read. Try putting it into the official one and if it works, check your custom settings.

    Yeees, it worked, the count is working now, thank you so much.

    But I still with the sprites(navigation) problems. As you said it seems that my quest lub files arent read.

    I took a look into kRO data quest files and I think they arent read too, seems like only questid2display.txt(in my data) and quest.conf(in my client) are read.

    Is there a way to make it read those files or it is my client that dont accept npc quest sprites?


  5. 4 hours ago, Dastgir said:

    You mentioned file name as "epsoid141_list"  pretty sure that's not the name in kRO

    Yes, I edited it because is the only file there:

    (data\luafiles514\lua files\quest\ep_141quest_list.lub)   and    (data\luafiles514\lua files\quest\questinfo\epsoid141_list)

     

    Should I create a new file with my custom quests?


  6. Hello, 

    I added some custom quests and they were ok, but the sprites and the count(how many monster or item left) didnt work.

    I added by following some topics here but they were very old so Im not sure if its rigth.

    I did it by modifying these files:

    - quest_db.conf:

    {
    	Id: 20017
    	Name: "Treinamento Inicial"
    },

     

    - questid2display.txt:

    20017#Treinamento Inicial#SG_FEEL#QUE_NOIMAGE#
    Prove que voce e capaz de ser treinado por mim, mate 10 Esporos e volte para falar comigo!#
    Mate 10 Esporos.#

     

    -  ep_141quest_list.lub (data\luafiles514\lua files\quest):

    {
    													name =[[Treinamento Inicial]],
    													scrfilename = [[epsoid141Quest]],
    													questID = 20017,
    												},

     

    - epsoid141_list.lub (data\luafiles514\lua files\quest\questinfo):

    [20017] = {
    				NPCToName = "Tayen",
    				NPCToMap = "payon",
    				NPCToSpr = "F_ORIENT_03",
    				NPCToX = 166,
    				NPCToY = 101,
    				NPCFromName = "Tayen",
    				NPCFromMap = "payon",
    				NPCFromSpr = "F_ORIENT_03",
    				NPCFromX = 166,
    				NPCFromY = 101,
    				Item = "",
    				PrizeItem = "",
    				Title = "Treinamento Inicial",
    				Info = "Prove que voc??capaz de ser treinado por mim, mate 10 Esporos e volte para falar comigo!",
    				Hunt1 = "< link = \"ESPORO\">Esporo<\\end> x 10 ",
    				Hunt2 = "",
    				Hunt3 = "",
    				Time = "0",
    				LV = "0",
    			},

     

    Here is the result:      (missing sprite and the count of how many esporos I need to kill)

    https://1.bp.blogspot.com/-qvZjAaEsSQA/W25wj6qtcQI/AAAAAAAAlAU/Aniv9kZUvPoo94JXoi8R2c6kjQRynwG8QCLcBGAs/s1600/sprite.png

     

    Did I do it rigth? Is it missing any file?

    How can I add the sprites?

    Thanks

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.