Jump to content
  • 0

[Script Support] Permanent effect


Phenomena

Question


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  94
  • Reputation:   4
  • Joined:  10/31/12
  • Last Seen:  

Hello, dear commynity!

1) Is this possible to make permanent(!) specialeffect (effect) on the ground via OnInit or OnPCLoadMapEvent?

For example - Pneuma (specialeffect 141):

cooridates:

[X Line]

130,129;

131,129;

132,129;

133,129;

134,129;

135,129;

[Y Line]

135,128;

135,127;

135,126;

135,125;

135,124;

 

It will look like this:

000000

XXXXX0

XXXXX0

XXXXX0

XXXXX0

 

where 0 - Pneuma.

 

2) Make this effect repeatable (because pneuma have time about 6 seconds) until at this map at least one player.

3) Make this area X1-130,Y1-124 / X2-135,Y2-129 no use skill / no effect by skills / no damage, like SAFE NO PVP ZONE.

 

Thank you.

Link to comment
Share on other sites

9 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  44
  • Reputation:   5
  • Joined:  12/06/11
  • Last Seen:  

*npcskilleffect <skill id>,<number>,<x>,<y>;
*npcskilleffect "<skill name>",<number>,<x>,<y>;

This command behaves identically to 'skilleffect', however, the effect will not 
be centered on the invoking character's sprite, nor on the NPC sprite, if any, 
but will be centered at map coordinates given on the same map as the invoking 
character.

Put this in a 'freeloop' and you'll have your effect.

 

Something like this

freeloop(1);
while(!.i){
*npcskilleffect <skill id>,<number>,<x>,<y>;
*sleep {<milliseconds>};
}

Sleep:

*sleep {<milliseconds>};
*sleep2 {<milliseconds>};
*awake "<NPC name>";

These commands are used to control the pause of a NPC.
sleep and sleep2 will pause the script for the given amount of milliseconds.
Awake is used to cancel a sleep. When awake is called on a NPC it will run as
if the sleep timer ran out, and thus making the script continue. Sleep and sleep2
basically do the same, but the main difference is that sleep will not keep the rid,
while sleep2 does.

Examples:
	sleep 10000; //pause the script for 10 seconds and ditch the RID (so no player is attached anymore)
	sleep2 5000; //pause the script for 5 seconds, and continue with the RID attached.
	awake "NPC"; //Cancels any running sleep timers on the NPC 'NPC'.

Freeloop:

*freeloop(<toggle>)

Toggling this to enabled (1) allows the script instance to bypass the infinite loop 
protection, allowing your script to loop as much as it may need. Disabling (0) will
warn you if an infinite loop is detected.

Example:
	freeloop(1); // enable script to loop freely

	//Be aware with what you do here.
	for ( set .@i,0; .@i<.@bigloop; set .@i, .@i+1 ) {
		dothis;
		// will sleep the script for 1ms when detect an infinity loop to 
		// let rAthena do what it need to do (socket, timer, process, etc.)
	}

	freeloop(0); // disable

	for ( set .@i,0; .@i<.@bigloop; set .@i, .@i+1 ) {
		dothis;
		// throw an infinity loop error
	}

 

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  94
  • Reputation:   4
  • Joined:  10/31/12
  • Last Seen:  

Not working for me, maybe i do something wrong. Btw this is working:

 

 

pvp_arena01,130,129,1    script    effect_zone#Effect1    139,{
    end;
OnStarting:
    while(.@a != 1000) {
            //for( set .@a, 0; .@a < 1000; set .@a, .@a + 1 )
                set .@a, .@a + 1;
                npcskilleffect 25,1,130,129;    // 25 - Pheuma, 12 - Safety Wall, 362 - Basilica
                sleep 300;
                //npcskilleffect 25,0,131,129;
                //sleep 300;
                //npcskilleffect 252,1,132,129;
                //sleep 300;
                //npcskilleffect 25,0,133,129;
                //sleep 300;
                //npcskilleffect 362,0,134,129;
                //sleep 300;
                npcskilleffect 25,0,135,129;
                sleep 300;
                //npcskilleffect 12,0,135,128;
                //sleep 300;
                //npcskilleffect 25,0,135,127;
                //sleep 300;
                //npcskilleffect 12,0,135,126;
                //sleep 300;
                //npcskilleffect 25,0,135,125;
                //sleep 300;
                npcskilleffect 25,0,135,124;
                sleep 10000;
        }
}
 

but does it working on OnInit?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  44
  • Reputation:   5
  • Joined:  12/06/11
  • Last Seen:  

It should works on OnInit label, but go on, test it x)

  • Upvote 1
Link to comment
Share on other sites


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

if you wanna do it this is script....

you have to duplicate the same NPC on all your "0" spot ....1 NPC = 1 coordinate effect ...

 

however, adding Map effects like this should be done through map edit instead of npc script.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  44
  • Reputation:   5
  • Joined:  12/06/11
  • Last Seen:  

We can't use more than one npcskilleffect per npc ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  94
  • Reputation:   4
  • Joined:  10/31/12
  • Last Seen:  

We can't use more than one npcskilleffect per npc ?

 

We can, dont mind on my "//" in post above, its for testing...

Emisty, you right at 100% with mapedit, but i have no enough skill to edit maps :)

I will try anything else, maybe just delete this pass, and after some testing if community permiss me to share my custom pvp arena without any "God Like Script Knowlage", i will :)

 

Thank you for help.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  44
  • Reputation:   5
  • Joined:  12/06/11
  • Last Seen:  

dont mind on my "//" in post above, its for testing...

No, no it's just that since Emistry said you to duplicate your npc to do this i tough that maybe it wasn't possible :)

But then i don't understand why you should duplicate your npc, having only 1npc wouldn't be better in terms of performance ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  53
  • Topics Per Day:  0.01
  • Content Count:  411
  • Reputation:   261
  • Joined:  04/25/12
  • Last Seen:  

We can't use more than one npcskilleffect per npc ?

We can, dont mind on my "//" in post above, its for testing...

Emisty, you right at 100% with mapedit, but i have no enough skill to edit maps :)

I will try anything else, maybe just delete this pass, and after some testing if community permiss me to share my custom pvp arena without any "God Like Script Knowlage", i will :)

Thank you for help.

Tell me the coordenares and mapa and i add the effects to you on browedit

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  94
  • Reputation:   4
  • Joined:  10/31/12
  • Last Seen:  

I take maps from this post (thx to Syouji).

Coorinates can be found on script below.

 

Left Bottom Corner:
130,129
131,129
132,129
133,129
134,129
135,129
135,128
135,127
135,126
135,125
135,124

Left Upper Corner:
130,158
131,158
132,158
133,158
134,158
135,158
130,159
130,160
130,161
130,162
130,163

Right Upper Corner:
164,163
164,162
164,161
164,160
164,159
164,158
165,158
166,158
167,158
168,158
169,158

Right Bottom Corner:
164,124
164,125
164,126
164,127
164,128
164,129
165,129
166,129
167,129
168,129
166,129

 

/* TODO */
/* This areas must be like under sage skill landprotector: No Damage, No Skills, Cant kill players - SAFE ZONE! */
/* 130,124 - 135,129 --- SAFE ZONE -- left bottom corner */
/* 130,158 - 135,163 --- SAFE ZONE -- left up corner */
/* 164,158 - 169,163 --- SAFE ZONE -- right up corner */
/* 164,124 - 169,129 --- SAFE ZONE -- left bottom corner */

 

//===== rAthena Script =======================================
//= PVP Arena
//===== By: ==================================================
//= Phenomena
//===== Current Version: =====================================
//= 1.0 Initial Release
//===== Compatible With: =====================================
//= rAthena and eAthena
//===== Description: =========================================
//= 1.0 Simple Another PvP Arena
//===== Additional Comments: =================================
//= 1.0 Initial Release
//=	for map thanks Syouji
//= http://rathena.org/board/topic/79002-pvp-the-cell-games-dragon-ball-z/?hl=cell_game
//= for some help with script to: Khazou, Emistry
//= feel free and do what you want
//= P.S I'm newbie in scripting, so will trying make more intresting events, and trained my script skills 
//= P.S.S Sorry for english
//============================================================
prontera,155,180,4	script	Arena Battle Manager	100,{

	set .@arena_manager$,"^A14742[ Arena Battle Manager ]^000000";
	set .menu_list$, "Public Arena #1 - " + getmapusers( "pvp_arena01" ) + " / 40:Public Arena #2 - " + getmapusers( "pvp_arena02" ) + " / 40:Public Arena #3 - " + getmapusers( "pvp_arena03" ) + " / 40:Cancel";
	if( getgmlevel() >= 60 ) set .menu_list$, .menu_list$ + ":Administration Panel";
	set .gm_access_lvl, 60;
	
	mes .@arena_manager$;
	mes "^FF0000Its testing script, and not working fully!^000000";
	next;
	mes .@arena_manager$;
	mes "If you have any stack - just make relog. If you have no pvp maps, dont worry, you will be warped to your last save point!";
	emotion 18;
	next;
	switch( select( .menu_list$ )) {	
		case 1:
		goto #public_arena_one;
		end;
		
		case 2:
		goto #public_arena_two;
		end;
		
		case 3:
		goto #public_arena_three;
		end;
		
		case 4:
		goto #end_conversation;
		end;
		
		case 5:
		goto #Administration;
		end;
	}

#Administration:
	mes .@arena_manager$;
	mes "You now in the Administration Menu. This menu is under constraction...";
	next;
	mes .@arena_manager$;
	mes "Thanks for understanding...";
	mes " ";
	close;

#public_arena_one:
	mes .@arena_manager$;
	mes "Public Arena #1 allow you fight with 40 players. Its simple arena where all buffs allowed. Also this arena have some NPC Helpers, that can give you buff...";
	mes " ";
	mes "At that moment " + getmapusers( "pvp_arena01" ) + " users on arena.";
	if( getmapusers( "pvp_arena01" ) >= 40 ) {	mes "Arena is full."; close; }
	mes "You can enter arena now.";
	next;
	if( select( "GO", "Cancel" ) == 2 ) close;
	// Again check, maybe someone read faster than you .
	if( getmapusers( "pvp_arena01" ) >= 40 ) {	mes "Arena is full. maybe someone read text below faster than you, try to use another arena, thank you."; close; }
	close2;
	switch( rand( 4 ) ) {
	case 0: warp "pvp_arena01", 132, 126; end;	// Corner 1
	case 1: warp "pvp_arena01", 167, 126; end;	// Corner 2
	case 2: warp "pvp_arena01", 132, 160; end;	// Corner 3
	case 3: warp "pvp_arena01", 167, 160; end;	// Corner 4
	}
	end;
/* TODO */
/* This areas must be like under sage skill landprotector: No Damage, No Skills, Cant kill players - SAFE ZONE! */
/* 130,124 - 135,129 --- SAFE ZONE -- left bottom corner */
/* 130,158 - 135,163 --- SAFE ZONE -- left up corner */
/* 164,158 - 169,163 --- SAFE ZONE -- right up corner */
/* 164,124 - 169,129 --- SAFE ZONE -- left bottom corner */
#public_arena_two:
	mes .@arena_manager$;
	mes "Public Arena #2 allow you fight with 40 players. Its simple arena where all buffs allowed. But this arena have no NPC Helpers, that can give you buff...";
	mes " ";
	mes "At that moment " + getmapusers( "pvp_arena01" ) + " users on arena.";
	if( getmapusers( "pvp_arena02" ) >= 40 ) {	mes "Arena is full."; close; }
	mes "You can enter arena now.";
	next;
	if( select( "GO", "Cancel" ) == 2 ) close;
	// Again check, maybe someone read faster than you .
	if( getmapusers( "pvp_arena02" ) >= 40 ) {	mes "Arena is full. maybe someone read text below faster than you, try to use another arena, thank you."; close; }
	close2;
	switch( rand( 4 ) ) {
	case 0: warp "pvp_arena02", 132, 126; end;	// Corner 1
	case 1: warp "pvp_arena02", 167, 126; end;	// Corner 2
	case 2: warp "pvp_arena02", 132, 160; end;	// Corner 3
	case 3: warp "pvp_arena02", 167, 160; end;	// Corner 4
	}
	end;

#public_arena_three:
	mes .@arena_manager$;
	mes "Public Arena #3 allow you fight with 40 players. Its simple arena, but have no NPC Helpers restrictions to use buffs, pots and etc - like hard mode arena.";
	mes " ";
	mes "At that moment " + getmapusers( "pvp_arena03" ) + " users on arena.";
	if( getmapusers( "pvp_arena03" ) >= 40 ) {	mes "К сожалению, арена переполнена. Попробуйте воспользоваться ею когда там освободиться место, зарезервируйте место либо воспользуйтесь другой публичной ареной."; close; }
	mes "You can enter arena now.";
	next;
	if( select( "GO", "Cancel" ) == 2 ) close;
	// Again check, maybe someone read faster than you .
	if( getmapusers( "pvp_arena03" ) >= 40 ) {	mes "Arena is full. maybe someone read text below faster than you, try to use another arena, thank you."; close; }
	close2;
	sc_end SC_ALL;
	switch( rand( 4 ) ) {
	case 0: warp "pvp_arena03", 132, 126; end; // Corner 1
	case 1: warp "pvp_arena03", 167, 126; end; // Corner 2
	case 2: warp "pvp_arena03", 132, 160; end; // Corner 3
	case 3: warp "pvp_arena03", 167, 160; end; // Corner 4
	}
	end;
	
#end_conversation:
	mes .@arena_manager$;
	mes "Thank you.";
	close;
	
OnInit:
	end;
}

// ================================ Duplicate ================================
pvp_arena01,130,124,8	script	Arena Helper#p_a01	100,{

	set .@arena_helper$,"^A14742[ Arena Helper ]^000000";
	// Not implemented -- set .helper_menu$, "Blessing 10 Уровень:Increase Agility 10 Уровень:Restore HP and SP:Close";
	mes "Hello!";
	mes " ";
	mes "All my buffs allowed only on this arena, after exit they will be canceled.";
	mes " ";
	sc_start SC_BLESSING,240000,10;		// Blessing 10 Level
	specialeffect2 42;
	sc_start SC_INCREASEAGI,240000,10;	// Increase Agility 10 Level
	specialeffect2 43;
	percentheal 100,100;				// Restore full HP and SP
	close;
}
pvp_arena01,130,163,5	duplicate(Arena Helper#p_a01)	Arena Helper#p_a02	100
pvp_arena01,169,163,4	duplicate(Arena Helper#p_a01)	Arena Helper#p_a03	100
pvp_arena01,169,124,1	duplicate(Arena Helper#p_a01)	Arena Helper#p_a04	100

// ================================ OnPCKillEvent & OnPCDieEvent & OnPCLogoutEvent ================================
-	script	pvp_arena01#OnPCEvents	-1,{
OnPCDieEvent:
	getmapxy (.@map$, .@x, .@y, 0); 
	if(.@map$ == "pvp_arena01") {
		if( select( "Return to Save Zone:Back to Save Point" ) == 1 ) {
			warp "pvp_arena01",133,126;
			percentheal 100,100;
			specialeffect2 325;
			specialeffect2 83;
			end;
			}
		warp "SavePoint",0,0;
	}
	end;

OnPCKillEvent:
	getmapxy (.@map$, .@x, .@y, 0); 
	if( .@map$ == "pvp_arena01" ) {
		set .@killer_name$,strcharinfo(0);
		set .@killed_name$,rid2name(killedrid);
		switch( rand( 4 )) {
			case 0: mapannounce "pvp_arena01",""+.@killer_name$+" just kill "+.@killed_name$+".",1,0xD6A4E6; end;
			case 1: mapannounce "pvp_arena01",""+.@killer_name$+" destroyed "+.@killed_name$+".",1,0xD6A4E6; end;
			case 2: mapannounce "pvp_arena01",""+.@killer_name$+" ahinilated "+.@killed_name$+".",1,0xD6A4E6; end;
			case 3: mapannounce "pvp_arena01",""+.@killer_name$+" send to heaven "+.@killed_name$+".",1,0xD6A4E6; end;
		}
	}
	end;
}

-	script	pvp_arena02#OnPCEvents	-1,{
OnPCDieEvent:
	getmapxy (.@map$, .@x, .@y, 0); 
	if(.@map$ == "pvp_arena02") {
		if( select( "Return to Save Zone:Back to Save Point" ) == 1 ) {
			warp "pvp_arena02",133,126;
			percentheal 100,100;
			end;
			}
		warp "SavePoint",0,0;
	}
	end;

OnPCKillEvent:
	getmapxy (.@map$, .@x, .@y, 0); 
	if( .@map$ == "pvp_arena02" ) {
		set .@killer_name$,strcharinfo(0);
		set .@killed_name$,rid2name(killedrid);
		switch( rand( 4 )) {
			case 0: mapannounce "pvp_arena01",""+.@killer_name$+" just kill "+.@killed_name$+".",1,0xD6A4E6; end;
			case 1: mapannounce "pvp_arena01",""+.@killer_name$+" destroyed "+.@killed_name$+".",1,0xD6A4E6; end;
			case 2: mapannounce "pvp_arena01",""+.@killer_name$+" ahinilated "+.@killed_name$+".",1,0xD6A4E6; end;
			case 3: mapannounce "pvp_arena01",""+.@killer_name$+" send to heaven "+.@killed_name$+".",1,0xD6A4E6; end;
		}
	}
	end;
}
// ================================ Mapflags ================================
// No Return
pvp_arena01	mapflag	noreturn
pvp_arena02	mapflag	noreturn
pvp_arena03	mapflag	noreturn
// No Teleport
pvp_arena01	mapflag	noteleport
pvp_arena02	mapflag	noteleport
pvp_arena03	mapflag	noteleport
// No Save
pvp_arena01	mapflag	nosave
pvp_arena02	mapflag	nosave
pvp_arena03	mapflag	nosave
// No Memo
pvp_arena01	mapflag	nomemo
pvp_arena02	mapflag	nomemo
pvp_arena03	mapflag	nomemo
// No Trade
pvp_arena01	mapflag	notrade
pvp_arena02	mapflag	notrade
pvp_arena03	mapflag	notrade
// No Drop
pvp_arena01	mapflag	nodrop
pvp_arena02	mapflag	nodrop
pvp_arena03	mapflag	nodrop
// No Chat
pvp_arena01	mapflag	nochat
pvp_arena02	mapflag	nochat
pvp_arena03	mapflag	nochat
// No Vending
pvp_arena01	mapflag	novending
pvp_arena02	mapflag	novending
pvp_arena03	mapflag	novending
// No Penalty
pvp_arena01	mapflag	nopenalty
pvp_arena02	mapflag	nopenalty
pvp_arena03	mapflag	nopenalty
// No Branch
pvp_arena01	mapflag	nobranch
pvp_arena02	mapflag	nobranch
pvp_arena03	mapflag	nobranch
// PvP
pvp_arena01	mapflag	pvp
pvp_arena02	mapflag	pvp
pvp_arena03	mapflag	pvp
// Clouds
pvp_arena01	mapflag	clouds
pvp_arena02	mapflag	clouds
pvp_arena03	mapflag	clouds
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...