Jump to content

Utility: DotA Runes


Emistry

Recommended Posts


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

File Name: DotA Runes

File Submitter: Emistry

File Submitted: 29 Jul 2012

File Category: Utilities

Content Author: Emistry


I believe most of you have heard of this or seen this before in DotA ( Defend of the Ancient )
Well, this script work alike with the Runes System you seen in the DotA.

It will give players a Buff / Bonus Randomly .

Video Preview :



Configuration :
OnInit:	// Runes Duration in Seconds	set .duration,60;	// Name of Each Runes.	setarray .name$[0],		"Double Damage",	//	2 x ATK Rate		"Invisibility",		//	Cloaking		"Regeneration",		//	HP / SP Regeneration		"Self Clone",		//	Create 2 Clones		"Unlimit Haste";	//	Improve Movement Speed	// npc sprite switching if any.	setarray .npc_sprite,		112,		113,		114,		115,		116;			// Random Coordinate where NPC will Shown Again	setarray .CoordinateX[0],150,155;	setarray .CoordinateY[0],175,175;


Add in more cases if you add extra Buff / Bonus. ( make sure edit the .names$ Array also )

	switch( .runes ){		case 0:			// 2x ATK / MATK			sc_start SC_INCATKRATE,( .duration * 1000 ),100;			sc_start SC_INCMATKRATE,( .duration * 1000 ),100;			break;		case 1:			// Invisible			skill "AS_CLOAKING",10,1;			sc_start SC_CLOAKING,( .duration * 1000 ),10;			break;		case 2:			// Restore			sc_start4 SC_REGENERATION,( .duration * 1000 ),-10,1,0,0;			break;		case 3:			// Clone			getmapxy( .@map$,.@x,.@y,0,strcharinfo(0) );			clone .@map$,.@X,.@y,"",getcharid(0),getcharid(0),"",1,.duration;			clone .@map$,.@X,.@y,"",getcharid(0),getcharid(0),"",1,.duration;			break;		case 4:			// Haste			sc_start SC_SpeedUp1,( .duration * 1000 ),0;			break;		default: end;	}



Click here to download this file

Link to comment
Share on other sites

  • 4 years later...

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   0
  • Joined:  04/22/17
  • Last Seen:  

/http://rathena.org/board/topic/57784-request-dota-runes/page__fromsearch__1

pvp_n_2-5,99,100,5    script    Runes    757,1,1,{
dispbottom "Walkthrough to get Runes.";
end;

OnTouch:
    switch( .runes ){
        case 0:
            // 2x ATK / MATK
            sc_start SC_INCATKRATE,( .duration * 1000 ),100;
            sc_start SC_INCMATKRATE,( .duration * 1000 ),100;
            break;
        case 1:
            // Invisible
            skill "AS_CLOAKING",10,1;
            sc_start SC_CLOAKING,( .duration * 1000 ),10;
            break;
        case 2:
            // Restore
            sc_start4 SC_REGENERATION,( .duration * 1000 ),-10,1,0,0;
            break;
        case 3:
            // Clone
            getmapxy( .@map$,.@x,.@y,0,strcharinfo(0) );
            clone .@map$,.@X,.@y,"",getcharid(0),getcharid(0),"",1,.duration;
            clone .@map$,.@X,.@y,"",getcharid(0),getcharid(0),"",1,.duration;
            break;
        case 4:
            // Haste
            sc_start SC_SpeedUp1,( .duration * 1000 ),0;
            break;
        default: end;
    }
    announce "[Rune]  "+strcharinfo(0)+" gained "+.name$[.runes]+".",bc_self,0x00FF00;
    hideonnpc .npc_name$;
    delwaitingroom;
    .runes = -1;
    attachnpctimer;
    initnpctimer;
    specialeffect2 EF_PROVIDENCE;
    end;
    
OnTimer6000:
    sc_end SC_CLOAKING;
    sc_end SC_REGENERATION;
OnTimerQuit:
    stopnpctimer;
    callsub( OnAssign );
    end;

OnAssign:
    .random = rand( .coordinate_size );
    movenpc .npc_name$,.CoordinateX[ .random ],.CoordinateY[ .random ];
    hideoffnpc .npc_name$;
    if( .runes < 0 ) 
        .runes = rand( .rune_size );
    if( .npc_sprite[.runes] )
        setnpcdisplay( .npc_name$,.name$[.runes],.npc_sprite[.runes] );
    delwaitingroom;
    waitingroom "   "+.name$[.runes],0;
    return;

OnInit:
    // Runes Duration in Seconds
    set .duration,60;

    // Name of Each Runes.
    setarray .name$[0],
        "Double Damage",    //    2 x ATK Rate
        "Invisibility",        //    Cloaking
        "Regeneration",        //    HP / SP Regeneration
        "Illusion",        //    Create 2 Clones
        "Haste";    //    Improve Movement Speed

    // npc sprite switching if any.
    setarray .npc_sprite,
        117,
        117,
        117,
        117,
        117;
        
    // Random Coordinate where NPC will Shown Again
    setarray .pvp_n_2-5,95,100;
    setarray .pvp_n_2-5,103,100;
    
    .rune_size = getarraysize( .name$ );
    .coordinate_size = getarraysize( .CoordinateX );
    .npc_name$ = strnpcinfo(0);
    callsub( OnAssign );
    end;
}

Hello sir im using ur script , but theres a problem that npc always show up for 5 sec , and i wanted it to make 2min per runes like dota timer .

and also only Double Damage runes show up .

the image i attached is the error i got on putty . can u help me fix this sir ?

Capture.PNG

Edited by Cyro
use code box instead of quote when you are pasting a script/code
Link to comment
Share on other sites

  • 6 years later...

  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  49
  • Reputation:   0
  • Joined:  06/28/12
  • Last Seen:  

Happy 2024 @Emistry,

 

Im trying to get your script to work across two maps. Any ideas on how it can be modified to work across many? Im trying to add this to all of the fields.

When I duplicate onto the second map, functionality is lost on the first. The buff appears in one cell instead of jumping around the entire map like it does when I comment out the duplicate.

Here is what Ive got so far:
 

prt_fild08,1,1,5	script	Runes#1	757,1,1,{
//dispbottom "Walkthrough to get Runes.";
end;

OnTouch:

	switch( .runes ){
		case 0: // 2x ATK / MATK
			if( getstatus( SC_INCATKRATE ) ){dispbottom "You already have the buff: "+.name$[.runes]+".";
			end;}{if( Zeny >= 1000 ){ Zeny -= 1000;
			dispbottom "You spent 1,000 Zeny on a buff: "+.name$[.runes]+".";
			specialeffect2 EF_PROVIDENCE; // This can be custom per case later
			sc_start SC_INCATKRATE,( .duration * 1000 ),100;
			sc_start SC_INCMATKRATE,( .duration * 1000 ),100;
			}else{dispbottom "You do not have enough Zeny for the buff: "+.name$[.runes]+".";
			end;}}
			break;
		case 1: // Invisible
			if( getstatus( SC_INCATKRATE ) ){dispbottom "You already have the buff: "+.name$[.runes]+".";
			end;}{if( Zeny >= 1000 ){ Zeny -= 1000;
			dispbottom "You spent 1,000 Zeny on a buff: "+.name$[.runes]+".";
			specialeffect2 EF_PROVIDENCE; // This can be custom per case later
			skill "AS_CLOAKING",10,1;
			}else{dispbottom "You do not have enough Zeny for the buff: "+.name$[.runes]+".";
			end;}}
			break;
		case 2:
			// Restore
			if( getstatus( SC_INCATKRATE ) ){dispbottom "You already have the buff: "+.name$[.runes]+".";
			end;}{if( Zeny >= 1000 ){ Zeny -= 1000;
			dispbottom "You spent 1,000 Zeny on a buff: "+.name$[.runes]+".";
			specialeffect2 EF_PROVIDENCE; // This can be custom per case later
			sc_start4 SC_REGENERATION,( .duration * 1000 ),-10,1,0,0;
			}else{dispbottom "You do not have enough Zeny for the buff: "+.name$[.runes]+".";
			end;}}
			break;
		case 3:
			// Clone
			if( getstatus( SC_INCATKRATE ) ){dispbottom "You already have the buff: "+.name$[.runes]+".";
			end;}{if( Zeny >= 1000 ){ Zeny -= 1000;
			dispbottom "You spent 1,000 Zeny on a buff: "+.name$[.runes]+".";
			specialeffect2 EF_PROVIDENCE; // This can be custom per case later
			getmapxy( .@map$, .@x, .@y, BL_PC, strcharinfo(0) );
			clone .@map$, .@x, .@y, "", getcharid(0), getcharid(0), "", 1, .duration;
			clone .@map$,.@x,.@y,"",getcharid(0),getcharid(0),"",1,.duration;
			}else{dispbottom "You do not have enough Zeny for the buff: "+.name$[.runes]+".";
			end;}}
			break;
		case 4:
			// Haste
			if( getstatus( SC_INCATKRATE ) ){dispbottom "You already have the buff: "+.name$[.runes]+".";
			end;}{if( Zeny >= 1000 ){ Zeny -= 1000;
			specialeffect2 EF_PROVIDENCE; // This can be custom per case later
			dispbottom "You spent 1,000 Zeny on a buff: "+.name$[.runes]+".";
			sc_start SC_SpeedUp1,( .duration * 1000 ),0;
			}else{dispbottom "You do not have enough Zeny for the buff: "+.name$[.runes]+".";
			end;}}
			break;
		default: end;
	}
	
//	
	end;

OnInit:
	// Runes Duration in Seconds
	set .duration,60;

	// Name of Each Runes.
	setarray .name$[0],
		"Double Damage",	//	2 x ATK Rate
		"Invisibility",		//	Cloaking
		"Regeneration",		//	HP / SP Regeneration
		"Shadow Clone",		//	Create 2 Clones
		"Crazy Legs";	//	Improve Movement Speed

	// npc sprite switching if any.
	setarray .npc_sprite,
		10428,
		10429,
		10430,
		10431,
		10432;
		
	.rune_size = getarraysize( .name$ );
	.npc_name$ = strnpcinfo(0);
	callsub( OnAssign );
	
	// Auto movement and spawning get onTimer10 for debugging
	initnpctimer;
	end;
    OnTimer10:
	.runes = rand( .rune_size );
	delwaitingroom;
    callsub( OnAssign );

	setnpctimer(0);
	end;
	
	OnAssign:
			.@rand_x = rand( 0, 400);
			.@rand_y = rand( 0, 400);
		movenpc .npc_name$, .@rand_x, .@rand_y;
		hideoffnpc .npc_name$;
		if ( .npc_sprite[.runes] )
			setnpcdisplay( .npc_name$, "Buff Cost: -1,000 Zeny", .npc_sprite[.runes] );
		delwaitingroom;
		waitingroom "   " + .name$[.runes], 0;
		return;
	
	
}

moc_fild07,1,1,5	duplicate(Runes#1)	Runes#2	811

 

Edited by Raikumi
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  49
  • Reputation:   0
  • Joined:  06/28/12
  • Last Seen:  

I made significant progress for a noobie like myself! This code is now working. One NPC block with buffs and timers that get set up once, then you can duplicate the npc's logic across the map or many maps.

 

prt_fild08,70,167,3	script	-1,000 Zeny#1	1907,1,1,{
	if (Zeny >= 999) {
		Zeny -= 1000;

		set .foundBuff, 0;
		hideonnpc strnpcinfo(0);
		set .start, rand(1,6); // Random start point for buff selection

		for( set .i, 0; .i < 6; set .i, .i + 1 ) {
			set .buff, (.start + .i) % 6 + 1; // Cycles through 1 to 6

			switch( .buff ) {
				case 1: // 2x ATK / MATK
					if( getstatus( SC_ATKPOTION ) ) continue;
					specialeffect2 EF_MAXPOWER;
					sc_start SC_ATKPOTION,( .duration * 1000 ),100;
					sc_start SC_MATKPOTION,( .duration * 1000 ),100;
					sc_start SC_INCATKRATE,( .duration * 1000 ),100;
					sc_start SC_INCMATKRATE,( .duration * 1000 ),100;
					set .foundBuff, 1;
					break;
				case 2: // Enchant Deadly Poison
					if( getstatus( SC_EDP ) ) continue;
					sc_start SC_EDP,( .duration * 1000 ),100;
					specialeffect2 EF_EDP;
					specialeffect2 EF_GREENBODY;
					set .foundBuff, 1;
					break;
				case 3: // Two Hand Quicken
					if( getstatus( SC_TWOHANDQUICKEN ) ) continue;
					sc_start4 SC_TWOHANDQUICKEN,( .duration * 1000 ),-10,1,0,0;
					specialeffect2 EF_TWOHANDQUICKEN;
					set .foundBuff, 1;
					break;
				case 4: // Clone
					// replace with actual status check for clone if available
					if( getstatus( SC_SOMETHING_FOR_CLONE ) ) continue;
					getmapxy( .@map$, .@x, .@y, BL_PC, strcharinfo(0) );
					clone .@map$, .@x, .@y, "", getcharid(0), getcharid(0), "", 1, .duration;
					clone .@map$,.@x,.@y,"",getcharid(0),getcharid(0),"",1,.duration;
					set .foundBuff, 1;
					break;
				case 5: // Haste
					if( getstatus( SC_SpeedUp1 ) ) continue;
					specialeffect2 EF_INCAGILITY;
					sc_start SC_SpeedUp1,( .duration * 1000 ),200;
					set .foundBuff, 1;
					break;
				case 6: // Blessing
					if( getstatus( SC_AUTOGUARD ) ) continue;
					sc_start SC_AUTOGUARD,( .duration * 1000 ),100;
					specialeffect2 EF_GUARD3;
					set .foundBuff, 1;
					break;
			}
			if( .foundBuff ) break; // If a buff is applied, break the loop
		}
		if( !.foundBuff ) {
			dispbottom "You already have all buffs.";
		}
		end;
	} else {
		dispbottom "Not enough Zeny!";
		close;
	}

OnTimer4000:
	movenpc  strnpcinfo(0),rand(0,400), rand(0,400);
	end;

OnTimer10000:
	hideoffnpc strnpcinfo(0);
	setnpctimer 0;

OnInit:
	initnpctimer;

	set .duration,60;

	setarray .name$[0],
		"Double Damage",	//	2 x ATK Rate
		"Enchant Deadly Poison",	//	EDP
		"Two Hand Quicken",	//	Two Hand Quicken
		"Self Clone",		//	Clone
		"Unlimit Haste",	//	Haste
		"Blessing";		//	Blessing
	
	end;
}

prt_fild08,81,168,5	duplicate(-1,000 Zeny#1)	-1,000 Zeny#2	1907,1,1
prt_fild08,81,168,5	duplicate(-1,000 Zeny#1)	-1,000 Zeny#3	1907,1,1
prt_fild08,81,168,5	duplicate(-1,000 Zeny#1)	-1,000 Zeny#4	1907,1,1
prt_fild08,81,168,5	duplicate(-1,000 Zeny#1)	-1,000 Zeny#5	1907,1,1
prt_fild08,81,168,5	duplicate(-1,000 Zeny#1)	-1,000 Zeny#6	1907,1,1
prt_fild08,81,168,5	duplicate(-1,000 Zeny#1)	-1,000 Zeny#7	1907,1,1
prt_fild08,81,168,5	duplicate(-1,000 Zeny#1)	-1,000 Zeny#8	1907,1,1
prt_fild08,81,168,5	duplicate(-1,000 Zeny#1)	-1,000 Zeny#9	1907,1,1
prt_fild08,81,168,5	duplicate(-1,000 Zeny#1)	-1,000 Zeny#10	1907,1,1
prt_fild08,81,168,5	duplicate(-1,000 Zeny#1)	-1,000 Zeny#11	1907,1,1
prt_fild08,81,168,5	duplicate(-1,000 Zeny#1)	-1,000 Zeny#12	1907,1,1
prt_fild08,81,168,5	duplicate(-1,000 Zeny#1)	-1,000 Zeny#13	1907,1,1
prt_fild08,81,168,5	duplicate(-1,000 Zeny#1)	-1,000 Zeny#14	1907,1,1
prt_fild08,81,168,5	duplicate(-1,000 Zeny#1)	-1,000 Zeny#15	1907,1,1
prt_fild08,81,168,5	duplicate(-1,000 Zeny#1)	-1,000 Zeny#16	1907,1,1
prt_fild08,81,168,5	duplicate(-1,000 Zeny#1)	-1,000 Zeny#17	1907,1,1
prt_fild08,81,168,5	duplicate(-1,000 Zeny#1)	-1,000 Zeny#18	1907,1,1
prt_fild08,81,168,5	duplicate(-1,000 Zeny#1)	-1,000 Zeny#19	1907,1,1
prt_fild08,81,168,5	duplicate(-1,000 Zeny#1)	-1,000 Zeny#20	1907,1,1

 

 

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
Reply to this topic...

×   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...