Jump to content
  • 0

OnNPCKillEvent Message Help


Kinx

Question


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  106
  • Reputation:   30
  • Joined:  04/03/17
  • Last Seen:  

hello

add pls, when you have killed all the Vitata 1x *you have killed all the vitata*, if you have killed all mobs 1x Player Annonce *you have done the quest*

anthell02,170,165,3	script	Waffel#0	112,{ 
mes "You have to kill:";
mes "You have "+VitataKills+"/10 Vitata...";
mes "You have "+AntEggKills+"/55 Ant Egg...";
mes "You have "+FamiliarKills+"/5 Familiar";
next;
if(VitataKills < 10) goto l_nokills;
if(AntEggKills < 55) goto l_nokills;
if(FamiliarKills < 5) goto l_nokills;
getitem 678,5 ;
close;
l_nokills:
mes "You didn't kill enough monsters!";
close;
OnNPCKillEvent:
if(killedrid == 1176) // = Vitata
{
set VitataKills,VitataKills + 1;
dispbottom "You killed "+VitataKills+"/10 Vitata.";
}else if (killedrid == 1097) // = Ant Egg
{
set AntEggKills,AntEggKills + 1;
dispbottom "You killed "+AntEggKills+"/55 AntEgg.";
}else if (killedrid == 1005) // = Familiar
{
set FamiliarKills,FamiliarKills + 1;
dispbottom "You killed "+FamiliarKills+"/5 Familiar.";
}
end;
}

 

screenTest Server007.jpg

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

Gonna take a look at home, gonna test it the too...

xX

Edit: Here is the upgraded and fully tested script:

Quote

anthell02,170,165,3    script    Warpra Helper#0    112,{ 
mes "[Warpra]";
mes "You need to kill the following monsters:";
for ( set .@m,0; .@m < getarraysize(.mob_id); set .@m,.@m + 1) {
    mes .mob_am[.@m]+"x "+strmobinfo(1,.mob_id[.@m]);
    if(getd(.mob_id[.@m]+"Kills") < .mob_am[.@m]) 
        set .@f,1;
}
if(!.@f) {
    getitem 678,5;
    for ( set .@m,0; .@m < getarraysize(.mob_id); set .@m,.@m + 1) {
        setd(.mob_id[.@m]+"Kills"),0;
        setd(.mob_id[.@m]+"Done"),0;
    }
    set QuestDone,0;
    end;
}

l_nokills:
next;
mes "[Warpra]";
mes "You didn't kill enough monsters yet.";
mes "You have:";
for ( set .@m,0; .@m < getarraysize(.mob_id); set .@m,.@m + 1) 
    mes getd(.mob_id[.@m]+"Kills")+"/"+.mob_am[.@m]+"x "+strmobinfo(1,.mob_id[.@m]);
close;

OnNPCKillEvent:
if(QuestDone) end;
for ( set .@k,0; .@k < getarraysize(.mob_id); set .@k,.@k +1)
    if(killedrid == .mob_id[.@k])
        if(getd(killedrid+"Kills") < .mob_am[.@k]) {
            setd(killedrid+"Kills"),getd(killedrid+"Kills") + 1;
            dispbottom "[Warpra]: You killed "+getd(killedrid+"Kills")+"/"+.mob_am[.@k]+" "+strmobinfo(1,killedrid)+".";
            if(getd(killedrid+"Kills") == .mob_am[.@k] && getd(killedrid+"Done") != 1) {
                dispbottom "[Warpra]: You have killed all "+strmobinfo(1,killedrid)+".";
                setd(killedrid+"Done"),1;
            }
        } else if(getd(killedrid+"Done") == 1)
            end;

for ( set .@k,0; .@k < getarraysize(.mob_id); set .@k,.@k +1) 
    if(getd(.mob_id[.@k]+"Done") != 1)
        set .@f,1;
    
if(.@f) end;
announce "[Warpra]: You have killed every Monster. Come back to me to recieve your reward!",bc_self;
set QuestDone,1;
end;

OnInit:
setarray .mob_id[0],1176,1097,1005;
setarray .mob_am[0],10,55,5;
end;
}

If you have questions or anything else, pm me ;).

Edit 2: Stupid e-mail protection, in case you don't have javascript activated:

bug_quest.txt

Regards,

Chris

Edited by llchrisll
Added fully tested script
  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

1 hour ago, Kinx said:

hello

add pls, when you have killed all the Vitata 1x *you have killed all the vitata*, if you have killed all mobs 1x Player Annonce *you have done the quest*


anthell02,170,165,3	script	Waffel#0	112,{ 
mes "You have to kill:";
mes "You have "+VitataKills+"/10 Vitata...";
mes "You have "+AntEggKills+"/55 Ant Egg...";
mes "You have "+FamiliarKills+"/5 Familiar";
next;
if(VitataKills < 10) goto l_nokills;
if(AntEggKills < 55) goto l_nokills;
if(FamiliarKills < 5) goto l_nokills;
getitem 678,5 ;
close;
l_nokills:
mes "You didn't kill enough monsters!";
close;
OnNPCKillEvent:
if(killedrid == 1176) // = Vitata
{
set VitataKills,VitataKills + 1;
dispbottom "You killed "+VitataKills+"/10 Vitata.";
}else if (killedrid == 1097) // = Ant Egg
{
set AntEggKills,AntEggKills + 1;
dispbottom "You killed "+AntEggKills+"/55 AntEgg.";
}else if (killedrid == 1005) // = Familiar
{
set FamiliarKills,FamiliarKills + 1;
dispbottom "You killed "+FamiliarKills+"/5 Familiar.";
}
end;
}

 

screenTest Server007.jpg

anthell02,170,165,3	script	Waffel#0	112,{ 
mes "You have to kill:";
mes "You have "+VitataKills+"/10 Vitata...";
mes "You have "+AntEggKills+"/55 Ant Egg...";
mes "You have "+FamiliarKills+"/5 Familiar";
next;
if(VitataKills < 10 && AntEggKills < 55 && FamiliarKills < 5) goto l_nokills;
getitem 678,5;
close;

l_nokills:
mes "You didn't kill enough monsters!";
close;

OnNPCKillEvent:
if(killedrid == 1176 && VitataKills < 10) // = Vitata
{
	set VitataKills,VitataKills + 1;
	dispbottom "You killed "+VitataKills+"/10 Vitata.";
	if(VitataKills == 10) 
		dispbottom "You have killed all Vitatas.";
		
} else if (killedrid == 1097 && AntEggKills < 55) // = Ant Egg
{
	set AntEggKills,AntEggKills + 1;
	dispbottom "You killed "+AntEggKills+"/55 AntEgg.";
	if(AntEggKills == 55)
		dispbottom "You have killed all AntEggs.";
		
}else if (killedrid == 1005 && FamiliarKills < 5) // = Familiar
{
	set FamiliarKills,FamiliarKills + 1;
	dispbottom "You killed "+FamiliarKills+"/5 Familiar.";
	if(FamiliarKills == 5)
		dispbottom "You have killed all Familiars.";
} else 
	announce "You have killed every Monster.",bc_self;
end;
}

Here you are, should be what you want, with some improvements :).

Regards,

Chris

Edited by llchrisll
Fixed typo
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  106
  • Reputation:   30
  • Joined:  04/03/17
  • Last Seen:  

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

Huh, typo ....

dispbottom not disbottom, at line 2063

Edited by llchrisll
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  106
  • Reputation:   30
  • Joined:  04/03/17
  • Last Seen:  

the if(VitataKills < 10 && AntEggKills < 55 && FamiliarKills < 5) goto l_nokills; is not working, i have kill all Ant Eggs and and get the item.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

Then it works just fine.

&& = checks if the next is also true

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  106
  • Reputation:   30
  • Joined:  04/03/17
  • Last Seen:  

if(VitataKills < 10 || AntEggKills < 55 || FamiliarKills < 5) goto l_nokills; is working :lol:

 

 

how do you do that announce "You have killed every Monster.",bc_self;  only comes once.

 

 

screenTest Server007.jpg

Edited by Kinx
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

else if(QuestDone != 0) {

Announce 

set QuestDone,1;

}

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  106
  • Reputation:   30
  • Joined:  04/03/17
  • Last Seen:  

this is my current script.

 

anthell02,170,165,3	script	Warpra Helper#0	112,{ 
if(VitataKills < 10 && AntEggKills < 55 && FamiliarKills < 5) goto l_nokills;
getitem 678,5;
close;

l_nokills:
mes "[Warpra]";
mes "You have to kill:";
mes "You have "+VitataKills+"/10 Vitata...";
mes "You have "+AntEggKills+"/55 Ant Egg...";
mes "You have "+FamiliarKills+"/5 Familiar";
close;

OnNPCKillEvent:
if(killedrid == 1176 && VitataKills < 10) // = Vitata
{
	set VitataKills,VitataKills + 1;
	dispbottom "You killed "+VitataKills+"/10 Vitata.";
	if(VitataKills == 10) 
		dispbottom "You have killed all Vitatas.";
		
} else if (killedrid == 1097 && AntEggKills < 55) // = Ant Egg
{
	set AntEggKills,AntEggKills + 1;
	dispbottom "You killed "+AntEggKills+"/55 AntEgg.";
	if(AntEggKills == 55)
	    dispbottom "You have killed all AntEggs.";
		
}else if (killedrid == 1005 && FamiliarKills < 5) // = Familiar
{
	set FamiliarKills,FamiliarKills + 1;
	dispbottom "You killed "+FamiliarKills+"/5 Familiar.";
	if(FamiliarKills == 5)
		dispbottom "You have killed all Familiars.";
}  
    else if(QuestDone != 0) {
	announce "You have killed every Monster.",bc_self;
	set QuestDone,1;
	}
end;
}

 

screenTest Server009.jpg

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...