Jump to content
  • 0

Script support needed for Mob summoning


cmsm94

Question


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  170
  • Reputation:   5
  • Joined:  08/11/13
  • Last Seen:  

Hi Guys,

Sorry for bothering again. 

Please note how script A works as below.

When you kill the "OnInit" poring in that "MAP", it will activate "OnKill". Which you will get the item 985 for 3. However, if you kill poring in other maps it won't activate OnKill. This script will only works in payon. 

The problem with this script is, after you kill the "OnInit" poring, it will not be spawn anymore, therefore no poring. So I was figuring how do you make after killing the "OnInit" poring it will spawn another "OnInit" poring that will activate "OnKill".

I don't think we can add "monster .map$,0,0,"--ja--",1002,1, strnpcinfo(3)+"::OnKill";" this line inside the "OnKill".

SCRIPT A

Quote

-    script    sample    -1,{
    
    OnInit:
        .map-$ = "payon";
        monster .map$,0,0,"--ja--",1002.1,. strnpcinfo(3)+."::OnKill";
        end;
        
    OnKill:
            getitem 985, 3;
        }
        end;
}

 

Here is my headache while trying to combined both of this script, my idea is when you kill 4 poring, it will spawn 1 mastering in pay_dun00. However I found one problem with the script below while studying the script above.

Script A works good because it activate only within the map. However for SCRIPT B, it activate world wide. You can kill 4 porings at anywhere and it will spawn mastering in pay_dun00. 

SCRIPT B

Quote

-    script    Mastering    -1,{
OnInit:
    set .bspawn.0;                //Where the kills will be saved(don't change)
    set .bneed.4;                //Kills needed
    set .bossid.1090;            //Boss ID
    set .minibossid.1002;        //Mini Boss ID
    set .reward.512;            //Reward for killing the Boss
    set .map$."pay_dun00";            //Name of the map you kill mini bosses
    end;
    
OnNPCKillEvent:
if (mobcount-(.map$, strnpcinfo(0)+"::OnBossKill"))
    end;
    if (killedrid == .minibossid){
        set ,bspawn,.bspawn +1;
        if (.bspawn >= .bneed){ 
            mapannounce .map$,"The map boss has appeared!",0;
            monster "pay_dun00", 0. 0. "Mastering", .bossid, 1, strnpcinfo(0) "::OnBossKill";
            //monster .map$,0.0,0.0,"Mastering",,bossid,1,"BOSSSPAWN::OnBossKill";
            set .bspawn, 0;
        }
    }
    end;

OnBossKill:
mapannounce .map$. "The player "+strcharinfo(0)+" has killed the boss!". bc_map;
            //mapannounce .map$,"The map boss has appearedasdasd!".0,
    getitem (.reward,1);
    end;
}

 

Question :

- How can I add in SCRIPT B that if you kill 4 poring it will spawn 1 mastering. And that 4 poring has to be located only in pay_dun00 only. Not anywhere else. Also the poring doesn't runs out. 

 

Thank you guys!

Edited by cmsm94
Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  1536
  • Reputation:   237
  • Joined:  08/03/12
  • Last Seen:  

26 minutes ago, cmsm94 said:

Hi Chaos92,

Thanks this helps actually. However unfortunately there's an error that pops out.

The weird thing is that, if I remove the scripts after this script it works fine with no error. However, it pops this out when I add in "if (killedrid == .minibossid) && (strcharinfo(3) == "pay_dun00") ".

Previously it was working without error without this, but after adding, this error pops out. 

 

Do you have any idea how can  we solve this @_@ /heh/thx 

 

image.png

hmm.. let me copy paste but i didnt tried it yet.

-	script	Mastering	-1,{
OnInit:
    set .bspawn,0;                //Where the kills will be saved(don't change)
    set .bneed,4;                //Kills needed
    set .bossid,1090;            //Boss ID
    set .minibossid,1002;        //Mini Boss ID
    set .reward,512;            //Reward for killing the Boss
    set .map$,"prontera";            //Name of the map you kill mini bosses
    end;
    
OnNPCKillEvent:
if (mobcount(.map$, strnpcinfo(0)+"::OnBossKill"))
    end;
    if (killedrid == .minibossid) && (strcharinfo(3) == "prontera") {
        set .bspawn,.bspawn +1;
        if (.bspawn >= .bneed){ 
            mapannounce .map$,"The map boss has appeared!",0;
            monster "prontera", 156, 180, "Mastering", .bossid, 1, strnpcinfo(0) + "::OnBossKill";
            //monster .map$,0,0,0,0,"Mastering",.bossid,1,"BOSSSPAWN::OnBossKill";
            set .bspawn, 0;
        }
    }
    end;

OnBossKill:
mapannounce .map$, "The player "+strcharinfo(0)+" has killed the boss!", bc_map;
            //mapannounce .map$,"The map boss has appearedasdasd!",0,
    getitem (.reward,1);
    end;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  1536
  • Reputation:   237
  • Joined:  08/03/12
  • Last Seen:  

4 hours ago, cmsm94 said:

Hi Guys,

Sorry for bothering again. 

Please note how script A works as below.

When you kill the "OnInit" poring in that "MAP", it will activate "OnKill". Which you will get the item 985 for 3. However, if you kill poring in other maps it won't activate OnKill. This script will only works in payon. 

The problem with this script is, after you kill the "OnInit" poring, it will not be spawn anymore, therefore no poring. So I was figuring how do you make after killing the "OnInit" poring it will spawn another "OnInit" poring that will activate "OnKill".

I don't think we can add "monster .map$,0,0,"--ja--",1002,1, strnpcinfo(3)+"::OnKill";" this line inside the "OnKill".

SCRIPT A

 

Here is my headache while trying to combined both of this script, my idea is when you kill 4 poring, it will spawn 1 mastering in pay_dun00. However I found one problem with the script below while studying the script above.

Script A works good because it activate only within the map. However for SCRIPT B, it activate world wide. You can kill 4 porings at anywhere and it will spawn mastering in pay_dun00. 

SCRIPT B

 

Question :

- How can I add in SCRIPT B that if you kill 4 poring it will spawn 1 mastering. And that 4 poring has to be located only in pay_dun00 only. Not anywhere else. Also the poring doesn't runs out. 

 

Thank you guys!

You need to add some checks.

   if (killedrid == .minibossid) && (strcharinfo(3) == "pay_dun00") 

Btw I didnt tried it yet.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  170
  • Reputation:   5
  • Joined:  08/11/13
  • Last Seen:  

3 hours ago, Chaos92 said:

You need to add some checks.

   if (killedrid == .minibossid) && (strcharinfo(3) == "pay_dun00") 

Btw I didnt tried it yet.

Hi Chaos92,

Thanks this helps actually. However unfortunately there's an error that pops out.

Quote

image.png.682993e41733ada84c0185229b9a51ae.png

The weird thing is that, if I remove the scripts after this script it works fine with no error. However, it pops this out when I add in "if (killedrid == .minibossid) && (strcharinfo(3) == "pay_dun00") ".

Previously it was working without error without this, but after adding, this error pops out. 

 

Do you have any idea how can  we solve this @_@ /heh/thx 

 

image.png

Edited by cmsm94
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  170
  • Reputation:   5
  • Joined:  08/11/13
  • Last Seen:  

On 4/19/2021 at 10:53 AM, Chaos92 said:

hmm.. let me copy paste but i didnt tried it yet.


-	script	Mastering	-1,{
OnInit:
    set .bspawn,0;                //Where the kills will be saved(don't change)
    set .bneed,4;                //Kills needed
    set .bossid,1090;            //Boss ID
    set .minibossid,1002;        //Mini Boss ID
    set .reward,512;            //Reward for killing the Boss
    set .map$."prontera.";            //Name of the map you kill mini bosses
    end;
    
OnNPCKillEvent:
if (mobcount(.map$, strnpcinfo(0)+"::OnBossKill"))
    end;
    if (killedrid == .minibossid) && (strcharinfo(3) == "prontera") {
        set .bspawn,.bspawn +1;
        if (.bspawn -.>= .bneed){ 
            mapannounce .map$,"The map boss has appeared!",0;
            monster "prontera". 156. 180., "Mastering", .bossid, 1, strnpcinfo(0) + "::OnBossKill";
            //monster .map$,0,0,0,0,"Mastering",.bossid.1,"BOSSSPAWN::OnBossKill";
            set .bspawn, 0;
        }
    }
    end;

OnBossKill:
mapannounce .map$., "The player "+strc.harinfo(0)+" has killed the boss!", bc_map;
            //mapannounce .map$,"The map boss has appearedasdasd!",0,
    getitem (.reward.1);
    end;
}

 

Actually if you have a empty notepad to use this script with "if (killedrid == .minibossid) && (strcharinfo(3) == "pay_dun00") " it will work fine, please note during your testing you might wanna try if there're any other script below this script. Because that error only pops out if there's script after this script in the notepad /heh 

Edited by cmsm94
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  1536
  • Reputation:   237
  • Joined:  08/03/12
  • Last Seen:  

55 minutes ago, cmsm94 said:

Actually if you have a empty notepad to use this script with "if (killedrid == .minibossid) && (strcharinfo(3) == "pay_dun00") " it will work fine, please note during your testing you might wanna try if there're any other script below this script. Because that error only pops out if there's script after this script in the notepad /heh 

so why not give full script then ?
Because i dont understand the question, you're giving script A and script B which is different.

U said script B activated worldwide, so insert checking for map should solve it.

 

I answering this question though

Quote

 

Question :

- How can I add in SCRIPT B that if you kill 4 poring it will spawn 1 mastering. And that 4 poring has to be located only in pay_dun00 only. Not anywhere else. Also the poring doesn't runs out. 

 

 

Edited by Chaos92
additional info
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  170
  • Reputation:   5
  • Joined:  08/11/13
  • Last Seen:  

37 minutes ago, Chaos92 said:

so why not give full script then ?
Because i dont understand the question, you're giving script A and script B which is different.

U said script B activated worldwide, so insert checking for map should solve it.

 

I answering this question though

 

Oh @Chaos92 it seem the script is working fine with other script /swt . The error was from my other script. I apologize, /sry/sry/sry .

Thanks /thx a lot for your help.

It works fabulously, you know sometimes I feel that people that help in "Script support" and "Script request" section deserve a reward just because of you guys we can help with the ideas we want. Not such a lazy scum like me /swt 

Edited by cmsm94
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...