Jump to content

Question

Hi guys,

Can someone good with scripting help me with this idea?

I want teleport skill (AL_WARP) to make a waitingroom (chat) or if not possible just one normal Message on top of the portal... with destination map (memo)....

is this possible to make?

if not possible, is possible to make Player create chatroom with destination map or send message, after use skill?

Bcuz in my server everyone have teleport/portal, there is no warp command or itens,

my hexed is 2014-03-05 

Hope you guys can help me !

Thank you !!!

Share this post


Link to post
Share on other sites

23 answers to this question

Recommended Posts

  • 0

if you mean like event script, that waitingroom can be open/close, that warp player to event map when its open

prontera,158,185,5	script	jdshfjsdfh	1_F_MARIA,{
	if ( .start )
		mes "The event is OPEN";
	else
		mes "The event is CLOSED";
	close;
OnInit:
	bindatcmd "asdf", strnpcinfo(NPC_NAME)+"::Onaaa";
	waitingroom "Event", 0;
	end;
Onaaa:
	.start ^= 1;
	delwaitingroom strnpcinfo(NPC_NAME);
	if ( .start )
		waitingroom "Event", 2, strnpcinfo(NPC_NAME)+"::Onstart", 1;
	else
		waitingroom "Event", 0;
	end;
Onstart:
	getwaitingroomstate 0;
	unitwarp $@chatmembers[0], "guild_vs2", 49,49;
	end;
}

 

however if it is for player, I have absolutely no idea what your point is ...
PS: I think ... like I have to fix my OnPCUseSKillEvent ....

Share this post


Link to post
Share on other sites
  • 0

yea, but is there anyway to put This waitingroom open/close in the use of AL_WARP skill(portal) linking to chosen Map? (/memo)

like HIDDEN_NPC, or something invisible....

 

Also, do you know if it's possible to make npc sprite visible but not targetable? like the Chat cursor..

Edited by skyundersea

Share this post


Link to post
Share on other sites
  • 0

I don't understand what topic request talking about

Spoiler

1. I get his/her server allow every player has warp portal skill, but warp portal require /memo to be use efficiently
so that means every player can have different set of portal location ? just like every priest memo differently
this means every time acolyte cast a warp portal skills, above the portal creates a temporary chat-room that tells where's the destination ?

2. then why you request having an npc sprite with non-targetable ?
if this is cast from player skill, there is no need for an npc

ok I'm confused

if anyone understand this topic, please help me rephrase his/her sentence

Share this post


Link to post
Share on other sites
  • 0
25 minutes ago, AnnieRuru said:

1. I get his/her server allow every player has warp portal skill, but warp portal require /memo to be use efficiently
so that means every player can have different set of portal location ? just like every priest memo differently
this means every time acolyte cast a warp portal skills, above the portal creates a temporary chat-room that tells where's the destination ?

There is no problem with the skill and warp, i just want the SKILL to create a WAITINGROOM chat, Showing /memo destination of Caster.... if possible

 

26 minutes ago, AnnieRuru said:

2. then why you request having an npc sprite with non-targetable ?
if this is cast from player skill, there is no need for an npc

This is for other npc i have, and want to make it untargetable with mouse, if its possible

Share this post


Link to post
Share on other sites
  • 0

although I want to say impossible ...

but I can think of 1 work around ...
use duplicatenpc modification ...
create a chat-room on the duplicate npc ...
chatroom title... generate from data/mapnametable.txt ...

Share this post


Link to post
Share on other sites
  • 0
11 hours ago, skyundersea said:

Like this, just for visual purpose, a chatroom or message with link to map destination of portal

Screenshot_1.jpg

Those warp are static or generated via script and changes location?

If they are meant to be static, you can use newer client feature named (signboard) and just link to those warp co ordinates.

Share this post


Link to post
Share on other sites
  • 0

Thanks for help guys, i wonder if the caster can send message of destination map.... but i don't even know where to edit the skill, i just know where to edit cost, requeriment and skilltree... this easy things,

But thanks anyway!!!

I'll wait if someone who know how to edit skills come here and see if its possible..

 

Any help with non targetable visible NPC sprites? Do you guys know?

Share this post


Link to post
Share on other sites
  • 0
2 hours ago, skyundersea said:

Thanks for help guys, i wonder if the caster can send message of destination map....

By script (easier), skill is source (harder).

make a clone npc at destination with on touch then announce something 

 

2 hours ago, skyundersea said:

but i don't even know where to edit the skill, i just know where to edit cost, requeriment and skilltree... this easy things,

But thanks anyway!!!

I'll wait if someone who know how to edit skills come here and see if its possible..

Database support not script anymore!

anyway~

any filename that has "skill"

1. hercules\db\

2.1  hercules\db\pre-re\

or

2.2  hercules\db\re\

OR

3  you want customly made stuff ( aka custom skill )

https://herc.ws/wiki/Adding_new_skills  ( BENEFICIAL read)  ( sorry to make it caps, no people takes reading stuff seriously these days )

 

2 hours ago, skyundersea said:

Any help with non targetable visible NPC sprites? Do you guys know?

Yes we know the good old floating npc which no normal play can click see or OnTouch...

 

Edited by utofaery

Share this post


Link to post
Share on other sites
  • 0
27 minutes ago, utofaery said:

By script (easier), skill is source (harder).

make a clone npc at destination with on touch then announce something 

I didnt untersdand... but is not to announce, is like a normal message for around players see the destination of memo portal.... like this look

1.thumb.jpg.86da25ea5bc0e2680bb513df3ecbc7cb.jpg

2.thumb.jpg.e0f7fed484dd9f3ac48b74adcf364f62.jpg

Did you understand?

 

29 minutes ago, utofaery said:
2 hours ago, skyundersea said:

Any help with non targetable visible NPC sprites? Do you guys know?

Yes we know the good old floating npc which no normal play can click see or OnTouch...

And for this, do you know any way to make just the sprite appears? not the name and the chat cursor....

3.thumb.jpg.27cd3506fb347b63dc74f49b30bd0c35.jpg

Share this post


Link to post
Share on other sites
  • 0

no.1 ... wait until I fix OnPCUseSkillEvent
that modification allows to manipulate everything with a skill cursor ....

 

no.2

1 hour ago, skyundersea said:

And for this, do you know any way to make just the sprite appears? not the name and the chat cursor....

3.thumb.jpg.27cd3506fb347b63dc74f49b30bd0c35.jpg

you mean like adding 3D object into the game without telling player that object is manipulate from server side ?

none, perhaps you can try with browedit if you want to customize the map

Share this post


Link to post
Share on other sites
  • 0
7 minutes ago, AnnieRuru said:

no.1 ... wait until I fix OnPCUseSkillEvent
that modification allows to manipulate everything with a skill cursor ....

Thank you Annie :)

no2.

"you mean like adding 3D object into the game without telling player that object is manipulate from server side ?

none, perhaps you can try with browedit if you want to customize the map"

 

No, just the 2d npc sprite..... The npc and npc file exists, but player cant see the Name and cant click on the npc, just it

Edited by skyundersea

Share this post


Link to post
Share on other sites
  • 0
message strcharinfo(0),"Heal Cost "+.@price+" Zeny.";

Hey Annie look this, it send message above players head...

Its from a healer NPC...

can we put this on a event with warp skill, with map destination? 

do you know how to do it?

Share this post


Link to post
Share on other sites
  • 0

message script command obviously doesn't work ...

if the player not within the vicinity when the player cast the portal, they can only see the portal, not the message

that's why chat-room might be the only choice to show it like a signboard, that can move into any location, and remove anytime

On 3/12/2019 at 1:22 AM, skyundersea said:

No, just the 2d npc sprite..... The npc and npc file exists, but player cant see the Name and cant click on the npc, just it


if you don't want to show npc name, make the npc name like #asdf, any characters after # will hide the npc name
but making an npc that you can't click on it, impossible

in fact, I don't know any object that can control server side that will pop up an object on the client that you can't click on it

enum bl_type {
	BL_NUL   = 0x000,
	BL_PC    = 0x001,
	BL_MOB   = 0x002,
	BL_PET   = 0x004,
	BL_HOM   = 0x008,
	BL_MER   = 0x010,
	BL_ITEM  = 0x020,
	BL_SKILL = 0x040,
	BL_NPC   = 0x080,
	BL_CHAT  = 0x100,
	BL_ELEM  = 0x200,

	BL_ALL   = 0xFFF,
};

yup, none, all these objects will change the cursor

Share this post


Link to post
Share on other sites
  • 0
On 3/10/2019 at 6:17 AM, skyundersea said:

Like this, just for visual purpose, a chatroom or message with link to map destination of portal

Screenshot_1.jpg

 

On 3/12/2019 at 1:17 AM, AnnieRuru said:

no.1 ... wait until I fix OnPCUseSkillEvent
that modification allows to manipulate everything with a skill cursor ....

now that I've fixed OnPCUseSkillEvent, its time to show off its awesomeness its usefulness

you also need 2nd plugin to do this
https://github.com/dastgirp/HPM-Plugins/blob/master/src/plugins/npc-duplicate.c

 

db/re/skill_db.conf

{
	Id: 2993
	Name: "CUSTOM_setpos"
	Description: "CUSTOM_setpos"
	MaxLevel: 3
	Range: 15
	SkillType: {
		Place: true
	}
	CoolDown: 10000
},

 

data/luafiles514/lua files/skillinfoz/skillinfolist.lub

	[SKID.CUSTOM_setpos] = {
		"CUSTOM_setpos";		
		SkillName = "Get Position",
		MaxLv = 3,
		Type = "Quest",
		SpAmount = { 0 },
		bSeperateLv = true,
		AttackRange = { 15 },
	},

 

data/luafiles514/lua files/skillinfoz/skillid.lub

	CUSTOM_setpos = 2993,  

 

data/luafiles514/lua files/skillinfoz/skilldescript.lub

	[SKID.CUSTOM_setpos] = {
		"Warp to various towns",
		"MAX Lv : 3 ",
		"Lv 1: warp to prontera.",
		"Lv 2: warp to payon.",
		"Lv 3: warp to alberta.",
	},

 

conf/import/OnPCUseSkillEvent.conf

OnPCUseSkillEvent: (
{
	SkillName: "CUSTOM_setpos"
	Event_Label: "qwer::Onpos"
},
)

 

and finally the npc script

-	script	asdf	FAKE_NPC,2,2,{
	end;
OnTouch:
	switch( $@warplv ) {
	case 1: warp "prontera", 156,191; break;
	case 2: warp "payon", 162,233; break;
	case 3: warp "alberta", 192,147;
	}
	end;
OnInit:
	switch( $@warplv ) {
	case 1: waitingroom "prontera", 0; break;
	case 2: waitingroom "payon", 0; break;
	case 3: waitingroom "alberta", 0;
	}
	end;
}

-	script	qwer	FAKE_NPC,{
Onpos:
	if ( @create_warp_npc_delay + 10 > gettimetick(2) ) {
		dispbottom "cooldown";
		end;
	}
	@create_warp_npc_delay = gettimetick(2);
	.@i = .i++;
	$@warplv = @useskilllv;
	duplicatenpc "asdf", "asdf", .@i +"", strcharinfo(PC_MAP), @useskillx, @useskilly, DIR_SOUTH, 1_SHADOW_NPC, 2,2;
	$@warplv = 0;
	sleep 5000;
	duplicateremove "asdf#"+ .@i;
	end;
OnPCStatCalcEvent:	
	skill CUSTOM_setpos, 3;
	end;
}

 

result

screen2019Hercules040.jpg

 

this screenshot is NOT tampered ... taken in-game without any photoshop or ms-paint edits

Edited by AnnieRuru

Share this post


Link to post
Share on other sites
  • 0

this is very nice, but this will be on fixed locations....

is there anyway for:

case 1:

/memo location 1

case 2:

/memo location 2

case 3:

/memo location 3

 

of skill AL_Warp?

so ppl can choose where to go not just fixed warps

Share this post


Link to post
Share on other sites
  • 0

this is not fixed location, OnPCUseSkillEvent allow to create warp portal anywhere with a target cursor

and if you want to change player's warp portal coordinate, just do bindatcmd "@memoportal" something like that
"@memoportal 1" will save the location for 1st location on level 1 portal ...
"@memoportal 2" will save the location for 2nd location on level 2 portal ...

if I still remember correctly, this OnPCUseSkillEvent allows to create up to level 100
let me test ....
yup, level 100 warp portal after apply this patch

 src/map/pc.c    | 2 +-
 src/map/skill.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/map/pc.c b/src/map/pc.c
index ea18715bb..9882fe2a8 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4230,7 +4230,7 @@ static int pc_skill(struct map_session_data *sd, int id, int level, int flag)
 		ShowError("pc_skill: Skill with id %d does not exist in the skill database\n", id);
 		return 0;
 	}
-	if( level > MAX_SKILL_LEVEL ) {
+	if ( id != 2993 && level > MAX_SKILL_LEVEL ) {
 		ShowError("pc_skill: Skill level %d too high. Max lv supported is %d\n", level, MAX_SKILL_LEVEL);
 		return 0;
 	}
diff --git a/src/map/skill.c b/src/map/skill.c
index 633a73d67..d2ee741b5 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -14154,7 +14154,7 @@ static int skill_check_condition_castbegin(struct map_session_data *sd, uint16 s
 			}
 	}
 
-	if( skill_lv < 1 || skill_lv > MAX_SKILL_LEVEL )
+	if ( skill_id != 2993 && ( skill_lv < 1 || skill_lv > MAX_SKILL_LEVEL ) )
 		return 0;
 
 	require = skill->get_requirement(sd,skill_id,skill_lv);

screen2019Hercules041.jpg

 

remember, since OnPCUseSkillEvent is basically an NPC script, you can manipulate it with any kind of script commands available
bindatcmd + save a player variable ... or open a menu with select script command ....
what ever you like

Edited by AnnieRuru

Share this post


Link to post
Share on other sites
  • 0

I've test this script now and the problem is,

that the part for the waitingroom aren't attached to the player.
So, if I want to create own warps by players like @memo, the name can't be shown.

Like :
OnInit:
    switch( $@warplv ) {
    case 1: 
        waitingroom #memo1$, 0; 
        break;

 

So yea.. atm the warps called by OnPCUseSkillEvent aren't rly static. Only if you want to use the waitingroom stuff.
Any solutions for this? 

Btw, isn't there a way to use the "real" warp skill (AL_Warp)?
Don't know if it's possible to use the npc_duplicate in skill.c by this part:

 

group->val1 = (group->val1<<16)|(short)0;
// record the destination coordinates
group->val2 = (x<<16)|y;
group->val3 = map_index;

or use the status.memo_point
 

mapindex_id2name(sd->status.memo_point[i].map)
sd->status.memo_point[i].x,
sd->status.memo_point[i].y);

 

Edited by Zero Human

Share this post


Link to post
Share on other sites
  • 0

long time i search for this idea...i want like this too...around 2004-2007 some official server botter set the acolyte as the warper...when we deal some price of zeny the acolyte will use memo skill to selected destination...bot will create chat room and say 150z pay_dun/100z orc_dun/120z hidden_temple..when we paid the amount they automatically open the portal...

Share this post


Link to post
Share on other sites
  • 0

Don't know what u try to say, sorry.
That if we try to use this system, bots will use this?
The "waitingrooms" above the warp aren't joinable.
 

Share this post


Link to post
Share on other sites
  • 0

since there are people bumping this thread, and a lot of stuffs has changed since then, I decided to redo this again

 

1st, stupid patch because of this commit

 src/common/mmo.h | 2 +-
 src/map/skill.c  | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/common/mmo.h b/src/common/mmo.h
index e4b5a8bd5..6d029228a 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -234,7 +234,7 @@
 #define MAX_CART 100
 #endif
 #ifndef MAX_SKILL_DB
-#define MAX_SKILL_DB 1314 ///< Maximum number of skills in the skill DB (compacted array size)
+#define MAX_SKILL_DB 1319 ///< Maximum number of skills in the skill DB (compacted array size)
 #endif
 #ifndef MAX_SKILL_ID
 #define MAX_SKILL_ID 10015   // [Ind/Hercules] max used skill ID
diff --git a/src/map/skill.c b/src/map/skill.c
index c2a336d7e..f827eb21f 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -97,6 +97,7 @@ static const struct {
 	{ HLIF_HEAL, MH_VOLCANIC_ASH },
 	{ MS_BASH, MER_INVINCIBLEOFF2 },
 	{ EL_CIRCLE_OF_FIRE, EL_STONE_RAIN },
+	{ 2991, 2995 },
 	{ GD_APPROVAL, GD_DEVELOPMENT },
 	CUSTOM_SKILL_RANGES
 };

then .... as usual, using latest OnPCUseSkillEvent ver1.5 and dastgir's duplicate npc

db/re/skill_db.conf

{
	Id: 2995
	Name: "CREATE_PORTAL"
	Description: "CREATE_PORTAL"
	MaxLevel: 3
	Range: 15
	SkillType: {
		Place: true
	}
	CoolDown: 10000
	Event_Label: "qwer::Onpos"
},

data/luafiles514/lua files/skillinfoz/skillinfolist.lub

	[SKID.CREATE_PORTAL] = {
		"CREATE_PORTAL";		
		SkillName = "Create Portal",
		MaxLv = 3,
		Type = "Quest",
		SpAmount = { 0 },
		bSeperateLv = true,
		AttackRange = { 15 },
	},

data/luafiles514/lua files/skillinfoz/skillid.lub

CREATE_PORTAL = 2995

data/luafiles514/lua files/skillinfoz/skilldescript.lub

	[SKID.CREATE_PORTAL] = {
		"Warp to various towns",
		"MAX Lv : 3 ",
		"Lv 1: warp to prontera.",
		"Lv 2: warp to payon.",
		"Lv 3: warp to alberta.",
	},

 

npc script

-	script	asdf	FAKE_NPC,2,2,{
	dispbottom strnpcinfo(0);
	end;
OnTouch:
	switch($@warplv) {
	case 1: warp "prontera", 156,191; break;
	case 2: warp "payon", 162,233; break;
	case 3: warp "alberta", 192,147;
	}
	end;
OnInit:
	switch($@warplv) {
	case 1: waitingroom "prontera", 0; break;
	case 2: waitingroom "payon", 0; break;
	case 3: waitingroom "alberta", 0;
	}
	end;
}

-	script	qwerty	FAKE_NPC,{
Onpos:
	if (@create_warp_npc_delay + 10 > gettimetick(2)) {
		dispbottom "cooldown";
		end;
	}
	@create_warp_npc_delay = gettimetick(2);
	.@i = ++.counter;
	$@warplv = @useskilllv;
	duplicatenpc "asdf", "asdf#"+ .@i, strcharinfo(PC_MAP), @useskillx, @useskilly, DIR_SOUTH, 1_SHADOW_NPC, 2,2;
	$@warplv = 0;
	sleep 5000;
//	duplicateremove "asdf#"+ .@i; // Dastgir needs to fix this
	disablenpc "asdf#"+ .@i;
	end;
OnPCStatCalcEvent:	
	skill CREATE_PORTAL, 3;
	end;
}

 

hmmm ..... its kinda working in theory but dastgir's .... plugin is broken currently

 

1. duplicateremove can cause server crash

2. OnTouch doesn't seem to work ...

 

I think someone needs to fix duplicatenpc plugin ....

..... meh lots of problem of this mod, not in the mood to do this so push this aside ...... for now

 

 

Share this post


Link to post
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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

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