Jump to content

Normynator

Developer
  • Posts

    292
  • Joined

  • Days Won

    16

Posts posted by Normynator

  1. //Script by Normynator v1.1
    prontera,163,172,4	script	Guild Reward	79,{ 
    	mes "Hi";
    	query_sql( "SELECT `guild_id` FROM `rathena`.`char` WHERE `char_id` = "+ getcharid(0) , .@guild_id);
    	//mes .@guild_id;
    	query_sql( "SELECT `name`, `guild_lv`, `average_lv` FROM `guild` WHERE `guild_id`= '"+ .@guild_id +"'", .@name$, .@guild_lv, .@guild_av );
    	.@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ .@guild_id +"'", .@name_m$ );
    	for( .@i = 0; .@i < .@size; .@i++ ){
    		if( getcharid( 0,.@name_m$[ .@i ] ) ) .@m++;
    	}
    	mes "Guild Name: " + .@name$;
    	mes "Guild Level: " + .@guild_lv;
    	mes "Guild Average Level: " + .@guild_av;
    	mes "Members online: " + .@m;
    	
    	if(.@guild_lv == 50 && .@m == 11 && .@guild_av == 255){
    		next;
    		if (#GuildReward){
    			mes "You already got your item.";
    			close;
    		}
    		set #GuildReward, 1;
    		mes "A Berry for you";
    		getitem 607, 1; 
    		close;
    	}
    	close;
    }
    

    Hope it works :)

  2. //Script by Normynator v1.0
    prontera,163,172,4	script	Guild Reward	79,{ 
    	mes "Hi";
    	query_sql( "SELECT `guild_id` FROM `rathena`.`char` WHERE `char_id` = "+ getcharid(0) , .@guild_id);
    	//mes .@guild_id;
    	query_sql( "SELECT `name`, `guild_lv` FROM `guild` WHERE `guild_id`= '"+ .@guild_id +"'", .@name$, .@guild_lv );
    	.@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ .@guild_id +"'", .@name_m$ );
    	for( .@i = 0; .@i < .@size; .@i++ ){
    		if( getcharid( 0,.@name_m$[ .@i ] ) ) .@m++;
    	}
    	mes "Guild Name: " + .@name$;
    	mes "Guild Level: " + .@guild_lv;
    	mes "Members online: " + .@m;
    	
    	if(.@guild_lv == 50 && .@m == 11){
    		next;
    		if (#GuildReward){
    			mes "You already got your item.";
    			close;
    		}
    		set #GuildReward, 1;
    		mes "A Berry for you";
    		getitem 607, 1; 
    		close;
    	}
    	close;
    }
    

    255/120 all members, or only the members which are online?

  3. //Script by Normynator v1.1
    prontera,140,180,5    script    Item    80,{
    function EndEvent;
        if(getgmlevel() >= 99){
            .@s = select("Start:Stop:Chancel");
            if(.@s == 1){
                mes "Start";
                set $giveaway, 0;
                announce "Give away has just started!!", 0;
                close;
            }else if(.@s == 2){
                mes "Stop";
                set $giveaway, 50;
                EndEvent;
                close;
            }else{
                close;
            }
        }
        if($giveaway == 50){
            mes "All items are gone!";
            close;
        }else{
            set .@left, 50 - $giveaway;
            mes "Hi";
            mes .@left + " Items left.";
            //mes $giveaway;
            if (#AlreadyGot){
                mes "You already got your item.";
                close;
            }
            set #AlreadyGot, 1;
            mes "An Apple for you";
            getitem 512, 1;
            set $giveaway, $giveaway + 1;
            if($giveaway == 50){
                EndEvent;
            }
            close;
        }
    EndEvent:
            announce "Give away has just ended!!", 0;
            query_sql "DELETE FROM `rathena`.`global_reg_value` WHERE `str`='#AlreadyGot'";
        end;
    }
    

    Hope it works :)

    • Upvote 1
  4. //changed script by Normynator
    function	script	refinemain	{
    	disable_items;
    	set .@features,getarg(1);
    	mes "[" + getarg(0) + "]";
    	mes "I'm the Armsmith.";
    	mes "I can refine all kinds of weapons, armor and equipment, so let me";
    	mes "know what you want me to refine.";
    	next;
    
    	setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3";
    	set .@menu$,"";
    	for(set .@i,1; .@i<=10; set .@i,.@i+1) {
    		if(getequipisequiped(.@i)) {
    			set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]";
    			set .@equipped,1;
    		}
    		set .@menu$, .@menu$ + ":";
    	}
    	if (.@equipped == 0) {
    		mes "[" + getarg(0) + "]";
    		mes "I don't think I can refine any items you have...";
    		close;
    	}
    	set .@part, select(.@menu$);
    
    	if(!getequipisequiped(.@part)) { //custom check
    		mes "[" + getarg(0) + "]";
    		mes "You're not wearing";
    		mes "anything there that";
    		mes "I can refine.";
    		emotion e_an;
    		close;
    	}
    	//Check if the item is refinable...
    	if(!getequipisenableref(.@part)) {
    		mes "[" + getarg(0) + "]";
    		mes "I don't think I can";
    		mes "refine this item at all...";
    		close;
    	}
    	//Check to see if the items is already +10
    	if(getequiprefinerycnt(.@part) >= 10) {
    		mes "[" + getarg(0) + "]";
    		mes "I can't refine this";
    		mes "any more. This is as";
    		mes "refined as it gets!";
    		close;
    	}
    	set .@refineitemid, getequipid(.@part); // save id of the item
    	set .@refinerycnt, getequiprefinerycnt(.@part); //save refinery count
    	switch(getequipweaponlv(.@part)){
    	case 0: 	//Refine Armor
    		set .@price,2000;
    		set .@material,985; //Elunium
    		set .@safe,4;
    		break;
    	case 1: 	//Refine Level 1 Weapon
    		set .@price,50;
    		set .@material,1010; //Phracon
    		set .@safe,7;
    		break;
    	case 2: 	//Refine Level 2 Weapon
    		set .@price,200;
    		set .@material,1011; //Emveretarcon
    		set .@safe,6;
    		break;
    	case 3: 	//Refine Level 3 Weapon
    		set .@price,5000;
    		set .@material,984; //Oridecon
    		set .@safe,5;
    		break;
    	case 4: 	//Refine Level 4 Weapon
    		set .@price,20000;
    		set .@material,984; //Oridecon
    		set .@safe,4;
    		break;
    	case 5: 	//Refine other stuff?
    		set .@price,2000;
    		set .@material,985; //Elunium
    		set .@safe,4;
    		break;
    	}
    
    	// If the VIP system is enabled, the prices for non-VIP players are considerably higher.
    	if (VIP_SCRIPT && !vip_status(1)) {
    		switch(getequipweaponlv(.@part)) {
    			case 0: set .@price, .@price * 10; break;
    			case 1: set .@price, .@price * 40; break;
    			case 2: set .@price, .@price * 50; break;
    			case 3: set .@price, .@price * 2; break;
    			case 4: set .@price, .@price * 2; break;
    			case 5: set .@price, .@price * 10; break;
    		}
    	}
    
    	if(.@features != 1) {
    		mes "[" + getarg(0) + "]";
    		mes "To refine this I need";
    		mes "one ^003366"+getitemname(.@material)+"^000000 and";
    		mes "a service fee of " + .@price + " Zeny.";
    		mes "Do you really wish to continue?";
    		next;
    		if(select("Yes:No") == 2){
    			mes "[" + getarg(0) + "]";
    			mes "Yeah...";
    			mes "There's no need to";
    			mes "rush. Take your time.";
    			close;
    		}
    		.@g = getequippercentrefinery(.@part);
    		//dispbottom "getequ .@g : " + .@g;
    		if(.@safe == 4){
    		//dispbottom .@refinerycnt;
    			if(.@refinerycnt >= 4){
    				mes "Do you want to use Donation-Refiner?";
    				if(select("Yes:No") == 1){
    						next;
    						//dispbottom "Check: mit Item";
    						if(.@refinerycnt == 4){
    								.@w = 100;
    								.@z = 5;
    								//dispbottom .@w;
    						}else if(.@refinerycnt == 5 ){
    								.@w = 100;
    								.@z = 10;
    								//dispbottom .@w;
    						}else if(.@refinerycnt == 6 ){
    								.@w = 80;
    								.@z = 15;
    								//dispbottom .@w;
    						}else if(.@refinerycnt == 7 ){
    								.@w = 70;
    								.@z = 16;
    								//dispbottom .@w;
    						}else if(.@refinerycnt == 8 ){
    								.@w = 60;
    								.@z = 18;
    								//dispbottom .@w;
    						}else if(.@refinerycnt == 9 ){
    								.@w = 50;
    								.@z = 20;
    								//dispbottom .@w;
    						}
    						
    						mes "[" + getarg(0) + "]";
    						mes "You need: "+ .@z + " " + getitemname( 7179 );
    						next;
    						if(select("Yes:No") == 1 && ( countitem( 7179 ) > .@z )){
    							delitem 7179,.@z;
    							.@g = .@w;
    						}else{
    							mes "[" + getarg(0) + "]";
    							mes "Not enought " + getitemname( 7179 );
    							close;
    						}
    				}else{
    					.@g = .@w;
    					next;
    				}
    			}
    		}
    		
    		
    		if(.@g < 100) {
    			mes "[" + getarg(0) + "]";
    			mes "Oh no! If I continue to";
    			mes "refine this, there's a risk it could";
    			switch(.@material) {
    			case 985:
    				mes "be destroyed! That means that ^FF0000this equipment^000000, and ^FF0000any cards^000000 or special properties added to this armor, ^FF0000will be gone^000000.";
    				break;
    			default:
    				mes "be destroyed, and you'd ^FF0000lose the weapon^000000, any ^FF0000cards in the weapon^000000,";
    				mes "or any added special properties.";
    				break;
    			}
    			next;
    			mes "["+getarg(0)+"]";
    			mes "I can't make it any clearer.";
    			mes "Once a weapon is destroyed,";
    			mes "there's no getting it back.";
    			mes "You really have a chance to";
    			mes "^FF0000lose this weapon^000000 forever.";
    			mes "Do you still want to refine?";
    			next;
    			if(select("Yes:No") == 2){
    				mes "[" + getarg(0) + "]";
    				mes "I completely agree...";
    				mes "I might be a great refiner, but sometimes even I make mistakes.";
    				close;
    			}
    		}
    		if((countitem(.@material) < 1) || (Zeny < .@price)) {
    			mes "[" + getarg(0) + "]";
    			mes "You don't seem to have";
    			mes "enough Zeny or "+getitemname(.@material)+"...";
    			mes "Go get some more. I'll be";
    			mes "here all day if you need me.";
    			close;
    		}
    		set Zeny, Zeny-.@price;
    		delitem .@material,1;
    
    		//custom checks
    		if(.@g == 0) { // hacker has removed the item (not changed, why?)
    			mes "[" + getarg(0) + "]";
    			mes "Look here... you don't have any Items on...";
    			close;
    		}
    		if(getequiprefinerycnt(.@part) != .@refinerycnt || getequipid(.@part) != .@refineitemid) { // hacker has changed the item
    			mes "[" + getarg(0) + "]";
    			emotion e_an;
    			mes "Wait a second...";
    			mes "Do you think I'm stupid?!";
    			mes "You switched the item while I wasn't looking! Get out of here!";
    			close;
    		}
    
    		//dispbottom getequippercentrefinery(.@part); wieviel % auf succes!
    		//dispbottom .@refinerycnt; UPGRADELVL!	
    		//dispbottom "Check: Versuch zu Upgraden";
    		if(.@g <= rand(100)) {
    			//dispbottom getequippercentrefinery(.@part);
    			failedrefitem .@part;
    			mes "[" + getarg(0) + "]";
    			emotion (!rand(5))?e_cash:e_omg;
    			set .@lose,rand(1,3);
    			if (.@lose == 1) {
    				mes "OH! MY GOD!";
    				mes "Damn it! Not again!";
    				mes "I'm terribly sorry, but you know practice does make perfect.";
    				mes "Um, right? Heh heh...";
    			} else if(.@lose == 2) {
    				mes "Nooooooo!";
    				mes "It broke!";
    				mes "I-I'm sorry!";
    			} else {
    				mes "Crap!";
    				mes "It couldn't take";
    				mes "much more tempering!";
    				mes "Sorry about this...";
    			}
    			close;
    		}
    		mes "["+getarg(0)+"]";
    		successrefitem .@part;
    		emotion e_heh;
    		set .@win,rand(1,3);
    		if (.@win == 1) {
    			mes "Perfect!";
    			mes "Heh heh!";
    			mes "Once again,";
    			mes "flawless work";
    			mes "from the master~";
    		} else if(.@win == 2) {
    			mes "Success...!";
    			mes "Yet again, my amazing";
    			mes "talent truly dazzles";
    			mes "and shines today.";
    		} else {
    			mes "Heh heh!";
    			mes "I'm all done.";
    			mes "No doubt, my work is";
    			mes "to your satisfaction.";
    			mes "Sheer, utter perfection~";
    		}
    		close;
    	}
    }
    
    prontera,140,176,5	script	Dunno	74,{
    	callfunc "refinemain","Dunno",0;
    	end;
    }
    

    Now it should work as a npc, just change the last lines if you want to change location, styl or name

  5. prontera,157,162,5	script	disguise	794,{
    
    if (getgmlevel()<99)
    {
    	mes "^3399FF[Disguise CP]^000000";	
    	mes "Sorry, du hast keine Berechtigung.";
    	close;
    }
    
    mes "^3399FF[Disguise CP]^000000";	
    mes "Hallo Boss,";
    mes "Was möchtest du heute machen?";
    switch(select("Event starten:Event stoppen:Anzahl der Runden kalkulieren[^E50000"+$guessrounds+"^000000]:Preis kalkulieren^E50000 ["+getitemname($guessprize)+"]^000000 ^E50000 ["+ $guessprizecount + "]^000000:Nichts"))
    {
    	case 1: 
    	{
    		next;
    		mes "^3399FF[Disguise CP]^000000";
    		mes "Bestätigen sie durch die Eingabe von START."; 
    		input .@confirm$;          
    		if (.@confirm$ == "START") 
    		{
    			donpcevent "guessAnnouncer::OnGMStart";
    			dispbottom "START";
    			close;
    		}
    		mes "Bestätigung fehlgeschlagen";
    		close;
    		break;
    	}
    	case 2:
    	{
    		next;
    		mes "^3399FF[Disguise CP]^000000";
    		mes "Bestätigen sie durch die Eingabe von STOP."; 
    		input .@confirm$;          
    		if (.@confirm$ == "STOP") 
    		{
    			donpcevent "guessAnnouncer::OnGMStop";
    			close;
    		}
    		mes "Bestätigung fehlgeschlagen";
    		close;
    		break;
    		
    	}
    	
    	case 3:
    	{
    		next; mes "^3399FF[Disguise CP]^000000";
    		mes "Bitte gib eine neue Nummer ein."; 
    		input $guessrounds; 
    		if ($guessrounds > 30) set $guessrounds, 30;
    		else if ($guessrounds < 1) set $guessrounds, 1;
    		close;
    	}
    	
    	case 4:
    	{
    		next; mes "^3399FF[Disguise CP]^000000";
    		mes "Bitte gib eine Preis ID ein."; 
    		input .@guessprizeid; 
    		if (getitemname(.@guessprizeid) == "null" || getitemname(.@guessprizeid) == "") {next; mes "^3399FF[Disguise CP]^000000"; mes "Error"; mes "This item does not exist in the database..."; close;}
    		set $guessprize, .@guessprizeid;
    		next; mes "^3399FF[Disguise CP]^000000";
    		mes "Bitte gib die Anzahl der Preise an."; 
    		input .@guessprizeamount;
    		if (!.@guessprizeamount) set .@guessprizeamount,1 ;
    		set $guessprizecount,.@guessprizeamount; 
    		next; mes "^3399FF[Disguise CP]^000000";
    		mes "Der Preis wurde zu ^E50000 "+ getitemname($guessprize)+ "^000000 und die Menge ^E50000 " +$guessprizecount+"^000000";
    		close;
    	}
    	
    					
    	case 5:
    	{
    		next; mes "^3399FF[Disguise CP]^000000";
    		mes "Schönen Tag noch."; 
    		close;
    	}
    
    }
    
    
    }
    
    prontera,158,162,5	script	guessAnnouncer	794,{
        mes "Hey the Disguise NPC starts my script!";
        close2;
        //set .@emote, rand(1,30);
    OnGMStart:
    	announce "Test Message by Normynator",bc_all;
        end;
    }
    
    

    Do you see the part I added?

    If you type "START" the script will not stop at:

    donpcevent "guessAnnouncer::OnGMStart"; 
    

    Now it goes on at:

    prontera,158,162,5	script	guessAnnouncer	794,{
        mes "Hey the Disguise NPC starts my script!";
        close2;
        //set .@emote, rand(1,30);
    OnGMStart:
    	announce "Test Message by Normynator",bc_all;
        end;
    }
    
    

    Soo there is something missing in your script

  6. I tried to make a working script. but I still have the problem that I have to restart the server the make it work :( but i am still working on the problem

    prontera,155,160,5	script	Guild	70,{
    	mes "Join Guild!";
    	if(select("Join:Cancel") -1) end;
    	mes getcharid(3);
    	mes getcharid(0);
    	mes strcharinfo(0);
    	next;
    	atcommand "@kick "+strcharinfo(0);
    	query_sql("INSERT INTO `guild_member` (guild_id, account_id, char_id, position, name) VALUES ('1', "+getcharid(3)+", "+getcharid(0)+", '1', '"+strcharinfo(0)+"')");
    	query_sql("UPDATE `rathena`.`char` SET `guild_id` = '1' WHERE `char`.`char_id` = "+getcharid(0));
    	end;
    }
    

    This is not the requested script but maybe you like it too. :)

    The script lists all guilds and tell the guildmembers if some1 wants to join.

    //by Normynator
    
    prontera,155,160,5    script    Guild    70,{
    
    function makeCategory;
    function guildMember;    
    
        query_sql("SELECT guild_id FROM `guild`", @id$);    
        for(.@b = 0; .@b < getarraysize(@id$); .@b++){
            dispbottom @id$[.@b];
        }
            
        mes "[Guild Joiner]";
        mes "Which Guild do you want to join?";
        set .@selected,select(makeCategory()) -1;
        next;
        
        mes "You selected: " + @gl$[.@selected -1];
        mes "Do you want to join this Guild?";
        if(select("Yes:No") -1) end;
        next;
        
        mes "The Npc sent a request to the Guild";
        query_sql("SELECT name FROM `guild_member` WHERE guild_id = "+ @id$[.@selected - 1], @m$);
        for(.@a = 0; .@a < getarraysize(@m$); .@a++){
            //dispbottom @m$[.@a];
            message @m$[.@a], "Player "+  strcharinfo(0)+ " wants to Join your Guild!";
            set @m$[.@a], "";
        }
        end;
        
        function makeCategory {
            set .@make_string$,"";
            for(.@i = 0; .@i < getarraysize(@id$) ; .@i++){
                query_sql("SELECT name FROM `guild` WHERE guild_id = "+ @id$[.@i], @gl$);
                set .@make_string$,.@make_string$+":"+@gl$;
            }
            return .@make_string$;    
        }
        
        function guildMember {
            query_sql("SELECT name FROM `guild_member` WHERE guild_id = "+ @id$[.@selected - 1], @m$);
            return @m$;
        }
    }
    
  7. e_tower,78,80,2	script	Endless Reset	406,{
    	mes "Purification Tower";
    	mes "Do you want to Reset your Endless Tower Quest?";
    
    	if(select("Yes:No") -1){
    		next;
    		mes "Purification Tower";
    		mes "Come Back Again.";
    		close;
    	}else{
    		if(countitem(6127)  1){
    			mes "You dont have a Purification Stone to Reset your Endless Tower Quest";
    			close;
    		}else {
    			set .@etower_timer,0;
    			set .@etower_timer2,0;
    			erasequest 60200;
    			erasequest 60201;
    			delitem 6127,1;
    			mes "^0000ffThe records and aftereffects related to the Endless Tower have been removed. You can generate and enter the Endless Tower again.^000000";
    			next;
    			set .@etower_timer,0;
    			set .@etower_timer2,0;
    			erasequest 60200;
    			erasequest 60201;
    			mes "^0000ffThe records and aftereffects related to the Endless Tower have been removed. You can generate and enter the Endless Tower again.^000000";
    			close;
    			warp e_tower,75,108;
    			end;
    		}
    	}
    }
    

    I was too slow xD

    I did a quick repair on your code and it run just good in my test server but I can't test any further since my character doesn't have this NPC quest record.

     

    e_tower,78,80,2	script	Endless Reset	406,{
    	mes "Purification Tower";
    	mes "Do you want to Reset your Endless Tower Quest?";
    	menu "Yes",R_Tower,"No",Dis;
    	close;
    	
    	R_Tower:
    	if(countitem(6127) == 1)
    	{
    		set .@etower_timer,0;
    		set .@etower_timer2,0;
    		erasequest 60200;
    		erasequest 60201;
    		delitem 6127,1;
    		mes "^0000ffThe records and aftereffects related to the Endless Tower have been removed. You can generate and enter the Endless Tower again.^000000";
    		next;
    		set .@etower_timer,0;
    		set .@etower_timer2,0;
    		erasequest 60200;
    		erasequest 60201;
    		mes "^0000ffThe records and aftereffects related to the Endless Tower have been removed. You can generate and enter the Endless Tower again.^000000";
    		close;
    		warp e_tower,75,108;
    		end;
    	}
    	else 
    	{
    		mes "You don't have a Purification Stone to Reset your Endless Tower Quest";
    		close;
    	}
    	
    	Dis:
    	mes "Purification Tower";
    	mes "Come Back Again.";
    	close;
    
    }
    

    The error should gone but you need to test it again. Keep this topic posted because someone might able to help you.

    P/S: I'm no pro in this field.

  8. for example 1 gold coin for 10 silver coins?

    prontera,163,174,4	script	Exchanger	71,{ 
    	mes "[Exchanger]";
    	mes "Hello, do you want to exchange Seeds into Berrys?";
    	if (select("Yes:No") -1) end;
    	next;
    	mes "[Exchanger]";
    	mes "You trade 3 Seeds for 1 Berry";
    	if (select ("Trade all!:Single trade!") -1){
    		next;
    		mes "[Exchanger]";
    		mes "Single trade!";
    		if(countitem(.req_item) < .req_num){
    			next;
    			mes "[Exchanger]";
    			mes "Not enought seeds to exchange";
    		}else{
    			next;
    			mes "[Exchanger]";
    			mes "Successful!";
    			delitem .req_item, .req_num;
    			getitem .get_item, .get_num;
    		}
    	}else{
    		next;
    		mes "[Exchanger]";
    		mes "Trade all!";
    		next;
    		mes "[Exchanger]";
    		mes "Successful!";
    		.@c = (countitem(.req_item) / .req_num);
    		for(.@i = 0; .@i <= .@c ; .@i ++){
    			delitem .req_item, .req_num;
    			getitem .get_item, .get_num;
    		}
    				
    			
    	}
    	end;
    OnInit:
    	.req_item = 608; //Item you need to exchange
    	.req_num = 3;	//how many?
    		
    	.get_item = 607; //Item you get
    	.get_num = 1;	//how many?
    		
    	end;
    }
    
  9. why are you not using the script commands?

     

     

    *vip_status(<type>,{"<character name>"})

    Returns various information about a player's VIP status.

    Valid types:
     1 - VIP status. (1 if VIP, 0 if non-VIP)
     2 - VIP expire date. (timestamp string if VIP, 0 if non-VIP)
     3 - VIP time remaining. (timestamp string if VIP, 0 if non-VIP)

    NOTE: This command is only available if the VIP System is enabled.

    ---------------------------------------

    *vip_time <time>,{"<character name>"};

    Changes a player's VIP time (in minutes). A positive value will increase time, and a
    negative value will decrease time.

    NOTE: This command is only available if the VIP System is enabled.

     

    http://rathena.org/board/topic/89848-official-vip-system/

  10. OK i changed it to "Proof of donation"

    function	script	refinemain	{
    	disable_items;
    	set .@features,getarg(1);
    	mes "[" + getarg(0) + "]";
    	mes "I'm the Armsmith.";
    	mes "I can refine all kinds of weapons, armor and equipment, so let me";
    	mes "know what you want me to refine.";
    	next;
    
    	setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3";
    	set .@menu$,"";
    	for(set .@i,1; .@i<=10; set .@i,.@i+1) {
    		if(getequipisequiped(.@i)) {
    			set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]";
    			set .@equipped,1;
    		}
    		set .@menu$, .@menu$ + ":";
    	}
    	if (.@equipped == 0) {
    		mes "[" + getarg(0) + "]";
    		mes "I don't think I can refine any items you have...";
    		close;
    	}
    	set .@part, select(.@menu$);
    
    	if(!getequipisequiped(.@part)) { //custom check
    		mes "[" + getarg(0) + "]";
    		mes "You're not wearing";
    		mes "anything there that";
    		mes "I can refine.";
    		emotion e_an;
    		close;
    	}
    	//Check if the item is refinable...
    	if(!getequipisenableref(.@part)) {
    		mes "[" + getarg(0) + "]";
    		mes "I don't think I can";
    		mes "refine this item at all...";
    		close;
    	}
    	//Check to see if the items is already +10
    	if(getequiprefinerycnt(.@part) >= 10) {
    		mes "[" + getarg(0) + "]";
    		mes "I can't refine this";
    		mes "any more. This is as";
    		mes "refined as it gets!";
    		close;
    	}
    	set .@refineitemid, getequipid(.@part); // save id of the item
    	set .@refinerycnt, getequiprefinerycnt(.@part); //save refinery count
    	switch(getequipweaponlv(.@part)){
    	case 0: 	//Refine Armor
    		set .@price,2000;
    		set .@material,985; //Elunium
    		set .@safe,4;
    		break;
    	case 1: 	//Refine Level 1 Weapon
    		set .@price,50;
    		set .@material,1010; //Phracon
    		set .@safe,7;
    		break;
    	case 2: 	//Refine Level 2 Weapon
    		set .@price,200;
    		set .@material,1011; //Emveretarcon
    		set .@safe,6;
    		break;
    	case 3: 	//Refine Level 3 Weapon
    		set .@price,5000;
    		set .@material,984; //Oridecon
    		set .@safe,5;
    		break;
    	case 4: 	//Refine Level 4 Weapon
    		set .@price,20000;
    		set .@material,984; //Oridecon
    		set .@safe,4;
    		break;
    	case 5: 	//Refine other stuff?
    		set .@price,2000;
    		set .@material,985; //Elunium
    		set .@safe,4;
    		break;
    	}
    
    	// If the VIP system is enabled, the prices for non-VIP players are considerably higher.
    	if (VIP_SCRIPT && !vip_status(1)) {
    		switch(getequipweaponlv(.@part)) {
    			case 0: set .@price, .@price * 10; break;
    			case 1: set .@price, .@price * 40; break;
    			case 2: set .@price, .@price * 50; break;
    			case 3: set .@price, .@price * 2; break;
    			case 4: set .@price, .@price * 2; break;
    			case 5: set .@price, .@price * 10; break;
    		}
    	}
    
    	if(.@features != 1) {
    		mes "[" + getarg(0) + "]";
    		mes "To refine this I need";
    		mes "one ^003366"+getitemname(.@material)+"^000000 and";
    		mes "a service fee of " + .@price + " Zeny.";
    		mes "Do you really wish to continue?";
    		next;
    		if(select("Yes:No") == 2){
    			mes "[" + getarg(0) + "]";
    			mes "Yeah...";
    			mes "There's no need to";
    			mes "rush. Take your time.";
    			close;
    		}
    		.@g = getequippercentrefinery(.@part);
    		//dispbottom "getequ .@g : " + .@g;
    		if(.@safe == 4){
    		//dispbottom .@refinerycnt;
    			if(.@refinerycnt >= 4){
    				mes "Do you want to use Donation-Refiner?";
    				if(select("Yes:No") == 1){
    						next;
    						//dispbottom "Check: mit Item";
    						if(.@refinerycnt == 4){
    								.@w = 100;
    								.@z = 5;
    								//dispbottom .@w;
    						}else if(.@refinerycnt == 5 ){
    								.@w = 100;
    								.@z = 10;
    								//dispbottom .@w;
    						}else if(.@refinerycnt == 6 ){
    								.@w = 80;
    								.@z = 15;
    								//dispbottom .@w;
    						}else if(.@refinerycnt == 7 ){
    								.@w = 70;
    								.@z = 16;
    								//dispbottom .@w;
    						}else if(.@refinerycnt == 8 ){
    								.@w = 60;
    								.@z = 18;
    								//dispbottom .@w;
    						}else if(.@refinerycnt == 9 ){
    								.@w = 50;
    								.@z = 20;
    								//dispbottom .@w;
    						}
    						
    						mes "[" + getarg(0) + "]";
    						mes "You need: "+ .@z + " " + getitemname( 7179 );
    						next;
    						if(select("Yes:No") == 1 && ( countitem( 7179 ) > .@z )){
    							delitem 7179,.@z;
    							.@g = .@w;
    						}else{
    							mes "[" + getarg(0) + "]";
    							mes "Not enought " + getitemname( 7179 );
    							close;
    						}
    				}else{
    					.@g = .@w;
    					next;
    				}
    			}
    		}
    		
    		
    		if(.@g < 100) {
    			mes "[" + getarg(0) + "]";
    			mes "Oh no! If I continue to";
    			mes "refine this, there's a risk it could";
    			switch(.@material) {
    			case 985:
    				mes "be destroyed! That means that ^FF0000this equipment^000000, and ^FF0000any cards^000000 or special properties added to this armor, ^FF0000will be gone^000000.";
    				break;
    			default:
    				mes "be destroyed, and you'd ^FF0000lose the weapon^000000, any ^FF0000cards in the weapon^000000,";
    				mes "or any added special properties.";
    				break;
    			}
    			next;
    			mes "["+getarg(0)+"]";
    			mes "I can't make it any clearer.";
    			mes "Once a weapon is destroyed,";
    			mes "there's no getting it back.";
    			mes "You really have a chance to";
    			mes "^FF0000lose this weapon^000000 forever.";
    			mes "Do you still want to refine?";
    			next;
    			if(select("Yes:No") == 2){
    				mes "[" + getarg(0) + "]";
    				mes "I completely agree...";
    				mes "I might be a great refiner, but sometimes even I make mistakes.";
    				close;
    			}
    		}
    		if((countitem(.@material) < 1) || (Zeny < .@price)) {
    			mes "[" + getarg(0) + "]";
    			mes "You don't seem to have";
    			mes "enough Zeny or "+getitemname(.@material)+"...";
    			mes "Go get some more. I'll be";
    			mes "here all day if you need me.";
    			close;
    		}
    		set Zeny, Zeny-.@price;
    		delitem .@material,1;
    
    		//custom checks
    		if(.@g == 0) { // hacker has removed the item (not changed, why?)
    			mes "[" + getarg(0) + "]";
    			mes "Look here... you don't have any Items on...";
    			close;
    		}
    		if(getequiprefinerycnt(.@part) != .@refinerycnt || getequipid(.@part) != .@refineitemid) { // hacker has changed the item
    			mes "[" + getarg(0) + "]";
    			emotion e_an;
    			mes "Wait a second...";
    			mes "Do you think I'm stupid?!";
    			mes "You switched the item while I wasn't looking! Get out of here!";
    			close;
    		}
    
    		//dispbottom getequippercentrefinery(.@part); wieviel % auf succes!
    		//dispbottom .@refinerycnt; UPGRADELVL!	
    		//dispbottom "Check: Versuch zu Upgraden";
    		if(.@g <= rand(100)) {
    			//dispbottom getequippercentrefinery(.@part);
    			failedrefitem .@part;
    			mes "[" + getarg(0) + "]";
    			emotion (!rand(5))?e_cash:e_omg;
    			set .@lose,rand(1,3);
    			if (.@lose == 1) {
    				mes "OH! MY GOD!";
    				mes "Damn it! Not again!";
    				mes "I'm terribly sorry, but you know practice does make perfect.";
    				mes "Um, right? Heh heh...";
    			} else if(.@lose == 2) {
    				mes "Nooooooo!";
    				mes "It broke!";
    				mes "I-I'm sorry!";
    			} else {
    				mes "Crap!";
    				mes "It couldn't take";
    				mes "much more tempering!";
    				mes "Sorry about this...";
    			}
    			close;
    		}
    		mes "["+getarg(0)+"]";
    		successrefitem .@part;
    		emotion e_heh;
    		set .@win,rand(1,3);
    		if (.@win == 1) {
    			mes "Perfect!";
    			mes "Heh heh!";
    			mes "Once again,";
    			mes "flawless work";
    			mes "from the master~";
    		} else if(.@win == 2) {
    			mes "Success...!";
    			mes "Yet again, my amazing";
    			mes "talent truly dazzles";
    			mes "and shines today.";
    		} else {
    			mes "Heh heh!";
    			mes "I'm all done.";
    			mes "No doubt, my work is";
    			mes "to your satisfaction.";
    			mes "Sheer, utter perfection~";
    		}
    		close;
    	}
    
    
  11.  

    I made it yesterday, untested. Just to give my version

    prontera,155,169,5	script	rstat	56,{
    	if ( countitem( 607 ) < .num_req ) {
    		dispbottom "I need "+ .num_req +" "+ getitemname( 607 ) +" to gamble.";
    		end;
    	}
    	else if ( select( "Gamble", "Leave" ) -1 ) end;
    	delitem 607,1;
    	.@r = rand( .min_stat,.max_stat );
    	if ( .@r < stat_bonus ) {
    		dispbottom "you only get "+ .@r +", your previous bonus were "+ stat_bonus;
    		end;
    	}
    	dispbottom "your new bonus stat are "+ .@r +". Equip something to see your news stats";
    	stat_bonus = .@r;
    	end;
    OnPCStatCalcEvent:
    	bonus bAllStats, stat_bonus;
    	end;
    OnInit:
    	.num_req = 1;	// number item 607 required to gamble
    	.min_stat = 1;	// min allstats
    	.max_stat = 200;	// max
    	end;	
    }
    

    I tried the

    bonus bType, delta

    too, but it is only for itemscripts and it wont work :( unfortunetly

  12. Hey Hey,

     

    check my changed scripted and if you like it i'll continue my work :)

     

    Edit & Update:

    function    script    refinemain    {
        disable_items;
        set .@features,getarg(1);
        mes "[" + getarg(0) + "]";
        mes "I'm the Armsmith.";
        mes "I can refine all kinds of weapons, armor and equipment, so let me";
        mes "know what you want me to refine.";
        next;
    
        setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3";
        set .@menu$,"";
        for(set .@i,1; .@i<=10; set .@i,.@i+1) {
            if(getequipisequiped(.@i)) {
                set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]";
                set .@equipped,1;
            }
            set .@menu$, .@menu$ + ":";
        }
        if (.@equipped == 0) {
            mes "[" + getarg(0) + "]";
            mes "I don't think I can refine any items you have...";
            close;
        }
        set .@part, select(.@menu$);
    
        if(!getequipisequiped(.@part)) { //custom check
            mes "[" + getarg(0) + "]";
            mes "You're not wearing";
            mes "anything there that";
            mes "I can refine.";
            emotion e_an;
            close;
        }
        //Check if the item is refinable...
        if(!getequipisenableref(.@part)) {
            mes "[" + getarg(0) + "]";
            mes "I don't think I can";
            mes "refine this item at all...";
            close;
        }
        //Check to see if the items is already +10
        if(getequiprefinerycnt(.@part) >= 10) {
            mes "[" + getarg(0) + "]";
            mes "I can't refine this";
            mes "any more. This is as";
            mes "refined as it gets!";
            close;
        }
        set .@refineitemid, getequipid(.@part); // save id of the item
        set .@refinerycnt, getequiprefinerycnt(.@part); //save refinery count
        switch(getequipweaponlv(.@part)){
        case 0:     //Refine Armor
            set .@price,2000;
            set .@material,985; //Elunium
            set .@safe,4;
            break;
        case 1:     //Refine Level 1 Weapon
            set .@price,50;
            set .@material,1010; //Phracon
            set .@safe,7;
            break;
        case 2:     //Refine Level 2 Weapon
            set .@price,200;
            set .@material,1011; //Emveretarcon
            set .@safe,6;
            break;
        case 3:     //Refine Level 3 Weapon
            set .@price,5000;
            set .@material,984; //Oridecon
            set .@safe,5;
            break;
        case 4:     //Refine Level 4 Weapon
            set .@price,20000;
            set .@material,984; //Oridecon
            set .@safe,4;
            break;
        case 5:     //Refine other stuff?
            set .@price,2000;
            set .@material,985; //Elunium
            set .@safe,4;
            break;
        }
    
        // If the VIP system is enabled, the prices for non-VIP players are considerably higher.
        if (VIP_SCRIPT && !vip_status(1)) {
            switch(getequipweaponlv(.@part)) {
                case 0: set .@price, .@price * 10; break;
                case 1: set .@price, .@price * 40; break;
                case 2: set .@price, .@price * 50; break;
                case 3: set .@price, .@price * 2; break;
                case 4: set .@price, .@price * 2; break;
                case 5: set .@price, .@price * 10; break;
            }
        }
    
        if(.@features != 1) {
            mes "[" + getarg(0) + "]";
            mes "To refine this I need";
            mes "one ^003366"+getitemname(.@material)+"^000000 and";
            mes "a service fee of " + .@price + " Zeny.";
            mes "Do you really wish to continue?";
            next;
            if(select("Yes:No") == 2){
                mes "[" + getarg(0) + "]";
                mes "Yeah...";
                mes "There's no need to";
                mes "rush. Take your time.";
                close;
            }
            .@g = getequippercentrefinery(.@part);
            dispbottom "getequ .@g : " + .@g;
            if(.@safe == 4){
            dispbottom .@refinerycnt;
                if(.@refinerycnt >= 4){
                    mes "Do you want to use Donation-Refiner?";
                    if(select("Yes:No") == 1){
                            next;
                            dispbottom "Check: mit Item";
                            if(.@refinerycnt == 4){
                                    .@w = 100;
                                    .@z = 5;
                                    dispbottom .@w;
                            }else if(.@refinerycnt == 5 ){
                                    .@w = 100;
                                    .@z = 10;
                                    dispbottom .@w;
                            }else if(.@refinerycnt == 6 ){
                                    .@w = 80;
                                    .@z = 15;
                                    dispbottom .@w;
                            }else if(.@refinerycnt == 7 ){
                                    .@w = 70;
                                    .@z = 16;
                                    dispbottom .@w;
                            }else if(.@refinerycnt == 8 ){
                                    .@w = 60;
                                    .@z = 18;
                                    dispbottom .@w;
                            }else if(.@refinerycnt == 9 ){
                                    .@w = 50;
                                    .@z = 20;
                                    dispbottom .@w;
                            }
                            
                            mes "[" + getarg(0) + "]";
                            mes "You need: "+ .@z + " " + getitemname( 607 );
                            next;
                            if(select("Yes:No") == 1 && ( countitem( 607 ) > .@z )){
                                delitem 607,.@z;
                                .@g = .@w;
                            }else{
                                mes "[" + getarg(0) + "]";
                                mes "Not enought " + getitemname( 607 );
                                close;
                            }
                    }else{
                        .@g = .@w;
                        next;
                    }
                }
            }
            
            
            if(.@g < 100) {
                mes "[" + getarg(0) + "]";
                mes "Oh no! If I continue to";
                mes "refine this, there's a risk it could";
                switch(.@material) {
                case 985:
                    mes "be destroyed! That means that ^FF0000this equipment^000000, and ^FF0000any cards^000000 or special properties added to this armor, ^FF0000will be gone^000000.";
                    break;
                default:
                    mes "be destroyed, and you'd ^FF0000lose the weapon^000000, any ^FF0000cards in the weapon^000000,";
                    mes "or any added special properties.";
                    break;
                }
                next;
                mes "["+getarg(0)+"]";
                mes "I can't make it any clearer.";
                mes "Once a weapon is destroyed,";
                mes "there's no getting it back.";
                mes "You really have a chance to";
                mes "^FF0000lose this weapon^000000 forever.";
                mes "Do you still want to refine?";
                next;
                if(select("Yes:No") == 2){
                    mes "[" + getarg(0) + "]";
                    mes "I completely agree...";
                    mes "I might be a great refiner, but sometimes even I make mistakes.";
                    close;
                }
            }
            if((countitem(.@material) < 1) || (Zeny < .@price)) {
                mes "[" + getarg(0) + "]";
                mes "You don't seem to have";
                mes "enough Zeny or "+getitemname(.@material)+"...";
                mes "Go get some more. I'll be";
                mes "here all day if you need me.";
                close;
            }
            set Zeny, Zeny-.@price;
            delitem .@material,1;
    
            //custom checks
            if(.@g == 0) { // hacker has removed the item (not changed, why?)
                mes "[" + getarg(0) + "]";
                mes "Look here... you don't have any Items on...";
                close;
            }
            if(getequiprefinerycnt(.@part) != .@refinerycnt || getequipid(.@part) != .@refineitemid) { // hacker has changed the item
                mes "[" + getarg(0) + "]";
                emotion e_an;
                mes "Wait a second...";
                mes "Do you think I'm stupid?!";
                mes "You switched the item while I wasn't looking! Get out of here!";
                close;
            }
    
            //dispbottom getequippercentrefinery(.@part); wieviel % auf succes!
            //dispbottom .@refinerycnt; UPGRADELVL!    
            dispbottom "Check: Versuch zu Upgraden";
            if(.@g <= rand(100)) {
                dispbottom getequippercentrefinery(.@part);
                failedrefitem .@part;
                mes "[" + getarg(0) + "]";
                emotion (!rand(5))?e_cash:e_omg;
                set .@lose,rand(1,3);
                if (.@lose == 1) {
                    mes "OH! MY GOD!";
                    mes "Damn it! Not again!";
                    mes "I'm terribly sorry, but you know practice does make perfect.";
                    mes "Um, right? Heh heh...";
                } else if(.@lose == 2) {
                    mes "Nooooooo!";
                    mes "It broke!";
                    mes "I-I'm sorry!";
                } else {
                    mes "Crap!";
                    mes "It couldn't take";
                    mes "much more tempering!";
                    mes "Sorry about this...";
                }
                close;
            }
            mes "["+getarg(0)+"]";
            successrefitem .@part;
            emotion e_heh;
            set .@win,rand(1,3);
            if (.@win == 1) {
                mes "Perfect!";
                mes "Heh heh!";
                mes "Once again,";
                mes "flawless work";
                mes "from the master~";
            } else if(.@win == 2) {
                mes "Success...!";
                mes "Yet again, my amazing";
                mes "talent truly dazzles";
                mes "and shines today.";
            } else {
                mes "Heh heh!";
                mes "I'm all done.";
                mes "No doubt, my work is";
                mes "to your satisfaction.";
                mes "Sheer, utter perfection~";
            }
            close;
        }
    
  13. wow very complex script, need to read it again :(

    sry i am working with rAthena scripts for less then a week...

     

    EDIT:

    			case 2:
    				set @qe3, getlook(3); set @qe4, getlook(4); set @qe5, getlook(5);
    				if (@qe1&4096) atcommand "@changelook 3 "+@qe2;
    				if (@qe1&1024) atcommand "@changelook 1 "+@qe2;
    				if (@qe1&2048) atcommand "@changelook 2 "+@qe2;
    				set @qe6,1;
    				dispbottom @qe2;
    				dispbottom @qe1;
    				break;
    

    Just tell me the respond :)

×
×
  • Create New...