Hi Friends, I need support, I'm putting together a custom event, where the NPC summons a clone to fight against the player who summoned it, I wanted to insert a condition that if he kills the clone, he is teleported to another map, and if he dies the clone also dies, could you help me?
I've been trying alone for days, but I can't
Here's the script:
prt_fild01,76,171,5 script Kelly 4_F_KHELLY,{
OnInit:
mes "[NPC Challenge]";
mes "Hello, adventurer. Are you ready for the next test?";
next;
mes "[NPC Challenge]";
mes "To pass this test, you will have to face your greatest weakness: yourself.";
next;
mes "[NPC Challenge]";
mes "Now, get ready...";
next;
mes "[NPC Challenge]";
mes "I have summoned a shadowy clone of you. Only you can see it and defeat it.";
next;
mes "[NPC Challenge]";
mes "Defeat your own clone to pass this challenge.";
next;
// Get the name of the player interacting with the NPC
set .@player_name$, strcharinfo(0);
// Check if the player has already defeated the shadow clone
if (getcharid(0, "ShadowClone_Slain") == 1) {
mes "[NPC Challenge]";
mes "Congratulations! You have already defeated your own clone.";
close;
}
// Call the @clone command to summon the shadow clone
clone "anrydrago", 76, 171, "@EvilClone_Event_" + .@player_name$, getcharid(0), 0, 0;
close;
OnEvilClone_Event:
mes "[Shadow Clone Event]";
mes "You have defeated your own clone. Congratulations!";
next;
// Mark that the player has slain the shadow clone
setcharid(0, "ShadowClone_Slain", 1);
// Teleport the player to Prontera
warp "prontera", 150, 150;
Question
feehcarvalhoce
Hi Friends, I need support, I'm putting together a custom event, where the NPC summons a clone to fight against the player who summoned it, I wanted to insert a condition that if he kills the clone, he is teleported to another map, and if he dies the clone also dies, could you help me?
I've been trying alone for days, but I can't
Here's the script:
prt_fild01,76,171,5 script Kelly 4_F_KHELLY,{
OnInit:
mes "[NPC Challenge]";
mes "Hello, adventurer. Are you ready for the next test?";
next;
mes "[NPC Challenge]";
mes "To pass this test, you will have to face your greatest weakness: yourself.";
next;
mes "[NPC Challenge]";
mes "Now, get ready...";
next;
mes "[NPC Challenge]";
mes "I have summoned a shadowy clone of you. Only you can see it and defeat it.";
next;
mes "[NPC Challenge]";
mes "Defeat your own clone to pass this challenge.";
next;
// Get the name of the player interacting with the NPC
set .@player_name$, strcharinfo(0);
// Check if the player has already defeated the shadow clone
if (getcharid(0, "ShadowClone_Slain") == 1) {
mes "[NPC Challenge]";
mes "Congratulations! You have already defeated your own clone.";
close;
}
// Call the @clone command to summon the shadow clone
clone "anrydrago", 76, 171, "@EvilClone_Event_" + .@player_name$, getcharid(0), 0, 0;
close;
OnEvilClone_Event:
mes "[Shadow Clone Event]";
mes "You have defeated your own clone. Congratulations!";
next;
// Mark that the player has slain the shadow clone
setcharid(0, "ShadowClone_Slain", 1);
// Teleport the player to Prontera
warp "prontera", 150, 150;
close;
}
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.