Jump to content
  • 0

Needing help with a script again


Kidlatsv

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   0
  • Joined:  09/19/17
  • Last Seen:  

How do I activate and deactivate OnNPCKillEvent?

prt_fild08,240,263,3    script    Little Annie    716,{
// INITIAL ENCOUNTER
if (FirstEncounter == 0) {
    if(1) {
    mes .npc$;
    mes "Hi, mister...";
        emotion e_sob,0,"Little Annie";
    }
    else {
    mes .npc$;
    mes "Hi, miss...";
        emotion e_sob,0,"Little Annie";
    }
        next;
    mes "["+strcharinfo(0)+"]";
    mes "What's wrong?";
        next;
    mes .npc$;
    mes "My little Okja here is being bullied by Porings!";
        next;
    mes "["+strcharinfo(0)+"]";
    mes "Do you want me to teach them a lesson?";
        next;
    mes .npc$;
    mes "You'd do that for us?";
        next;
    mes "["+strcharinfo(0)+"]";
    mes "Yes I would, so don't be sad anymore.";
        next;
    mes .npc$;
    mes "If you could, please kill 10 Porings to teach them not to bully my little Okja anymore.";
        next;
    mes "["+strcharinfo(0)+"]";
    mes "I'll go and teach them a lesson, cheer-up!";
        next;
    mes .npc$;
    mes "Please teach those bullies a lesson for us...";
        set FirstEncounter, 1;
        close;
    }
// SUCCEEDING ENCOUNTERS
{
if ((FirstEncounter == 1) && (PoringKills < 10)) { 
    mes .npc$;
    mes "Please, punish those bullies for us.";
        }
        else {
if ((FirstEncounter == 1) && (PoringKills >= 10))
    mes .npc$;
    mes "You've done it! You punished those Poring Bullies!";
        next;
    mes .npc$;
    mes "I hope you don't mind, but little Okja tells me that we should give you a reward for your assistance.";
        next;
    mes .npc$;
    mes "You see, I make hats adorned with ears resembling those of my cute little Okja, and I want to make one for you as a form of recompense.";
        next;
    mes .npc$;
    mes "Speak to me again if you're interested!";
        set killingdone, 1;
        close;
    }
//
if (killingdone == 1) {
    mes .npc$;
    mes "As I've already mentioned, I can make you a hat adorned with replicas of my cute little Okja's ears.";
        next;
    mes .npc$;
    mes "I'll need materials to make it for you though, so please gather them for me~";
        next;
    mes .npc$;
    mes "I'll need 10,000 Zenies, 50 Animal Skins, 25 Green Herbs, and a Sweet Milk for my consumption, Hee~hee~.";
        next;
    mes "["+strcharinfo(0)+"]";
    mes "Make it for me then!";
        next;
            if ((Zeny >= 10000) && (countitem(919) >= 50) && (countitem(511) >= 25) && (countitem(627) >= 1)) {
                delitem 919,50;
                delitem 511,25;
                delitem 627,1;
                set Zeny, Zeny-10000;
                set PoringKills,PoringKills - 10;
                set oquest, 1;
                    mes .npc$;
                    mes "Here you are, thank you again!";
                        emotion e_no1,0,"Little Annie";
                        getitem 5407,1;
            }
                else {
                        mes .npc$;
                        mes "Come on, "+strcharinfo(0)+", I can't make the hat for you if you don't bring me what I need.";
                            close;
        }
    }
//
        OnNPCKillEvent:
        if( killedrid == 1002 ){
            set PoringKills,PoringKills +1;
            dispbottom "You have killed "+PoringKills+" Porings.";
        }
        end;
//
OnInit:
    .npc$ = "[^51ba31Little Annie^000000]";
    
    while(1){
        npctalk "Don't worry Okja, we'll punish them soon enough!";
        sleep 30000;
        }
    end;
    }
}
prt_fild08    mapflag    loadevent

Like here, I want the OnNPCKillEvent to activate only after line 37, then deactivate after line 59?

Edited by Cyro
code box
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  477
  • Reputation:   269
  • Joined:  06/13/17
  • Last Seen:  

Here's the Script

        OnNPCKillEvent:
        if(FirstEncounter==1 && PoringKills<10){
          if( killedrid == 1002 ){
              set PoringKills,PoringKills +1;
              dispbottom "You have killed "+PoringKills+" Porings.";
          }
		}
        end;

 

Edited by Haruka Mayumi
Changed Comment
  • Upvote 2
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...