Назад

Warning

Автор: xDREDDx: Дата: 02.22.2011

обновил эмулятор до новой ревизии, до этого было всё впорядке. В нпц выбивают предупреждения, не знаю даже в чём проблема. Вобщем снова нуждаюсь в вашей помощи:)

Вот собственно и сам нпц:

-	shop	quest_shop#Helms	-1,501:50
prontera,143,283,6 script Шлемы 771,{
set @i,0;
callshop "quest_shop#Helms",1;
npcshopattach "quest_shop#Helms";
end;

OnBuyItem:
if(.BuildQuest) {
for(set .e,0; !compare(getarg(.e+1),"Zeny"); set .e,.e+2) {}
npcshopadditem "quest_shop#Helms",getarg(.e+2),getarg(.e)*compare(getarg(.e+1),"SZeny");
setarray .Shop[.i],getarg(.e+2);
set .i,.i+1;
goto Quest_Setup;
}
if(.Shop[@i]!=@bought_nameid) for(set @i,1; 1; set @i,@i+1) if(.Shop[@i]==@bought_nameid) { set .i,@i; callsub Quest_Setup; }
for(set @i,1; !@e; set @i,@i+1) if(.Shop[@i]==@bought_nameid) { set @e,1; set .i,@i; callsub Quest_Setup; }
mes "[Шлемы]";
mes "Нужно принести:";
for(set @i,0; !compare(getarg(@i+1),"Zeny"); set @i,@i+2) mes "^FF0000" + ((countitem(getarg(@i))>=getarg(@i+1))? "^00FF00":"") + "" + getarg(@i+1) + " " + getitemname(getarg(@i)) + " [" + countitem(getarg(@i)) + "/" + getarg(@i+1) + "]";
if(getarg(@i)) mes "^FF0000" + ((Zeny>=getarg(@i))? "^00FF00":"") + "" + getarg(@i) + " Zeny";
mes "^000000И получите:^0000FF";
for(set @i,@i+2; getarg(@i+1,0); set @i,@i+2) mes getarg(@i+1) + " " + getitemname(getarg(@i));
switch(select("Сделать:" + (((((getiteminfo(@bought_nameid,5) & 1) || (getiteminfo(@bought_nameid,5) & 256) || (getiteminfo(@bought_nameid,5) & 512)) && @equip==0))? "Примерить":"") + ":Выйти")) {
case 1:
for(set @i,0; !compare(getarg(@i+1),"Zeny"); set @i,@i+2) if(countitem(getarg(@i)) < getarg(@i+1)) {
next;
mes "У вас " + countitem(getarg(@i)) + " " + getitemname(getarg(@i)) + ", а нужно " + getarg(@i+1) + ".";
mes "Принесите ^FF0000" + (getarg(@i+1)-countitem(getarg(@i))) + " шт " + getitemname(getarg(@i)) + "^000000.";
close;
}
if(Zeny < getarg(@i)) {
next;
mes "У вас недостаточно денег.";
mes "Вам нужно еще ^FF0000" + (getarg(@i)-Zeny) + "к зени^000000.";
close;
}
for(set @i,0; !compare(getarg(@i+1),"Zeny"); set @i,@i+2) delitem getarg(@i),getarg(@i+1);
set Zeny,Zeny-getarg(@i);
for(set @i,@i+2; getarg(@i+1,0); set @i,@i+2) getitem getarg(@i),getarg(@i+1);
close;
case 2:
set @bottomview, getlook(3);
set @topview, getlook(4);
set @midview, getlook(5);
addtimer 1000, strnpcinfo(3)+"::On_Leave";
set @equip,getiteminfo(@bought_nameid, 5);
set @view, getiteminfo(@bought_nameid, 11);
if(@equip != -1 && @view > 0) {
if(@equip & 1) atcommand "@changelook 3 " + @view;
if(@equip & 256) atcommand "@changelook 1 " + @view;
if(@equip & 512) atcommand "@changelook 2 " + @view;
if(@equip & 5132) atcommand "@changelook 204 " + @view;
if(@equip & 6511) atcommand "@changelook 1197 " + @view;
if(@equip & 6512) atcommand "@changelook 1198 " + @view;
if(@equip & 6513) atcommand "@changelook 1199 " + @view;
if(@equip & 6514) atcommand "@changelook 1200 " + @view;
if(@equip & 5254) atcommand "@changelook 298 " + @view;
if(@equip & 8525) atcommand "@changelook 1016 " + @view;
if(@equip & 6930) atcommand "@changelook 1621 " + @view;
}
next;
goto OnBuyItem;
case 3:
close;
}
On_Leave:
atcommand "@changelook 1 " + @topview;
atcommand "@changelook 2 " + @midview;
atcommand "@changelook 3 " + @bottomview;
set @equip,0;
set @view,0;
set @topview,0;
set @midview,0;
set @bottomview,0;
end;
OnInit:
npcshopitem "quest_shop#Helms",0,0;
set .BuildQuest,1;
set .i,1;
Quest_Setup:
switch(.i) {
default: set .BuildQuest,0; set .e,0; set .i,0; end;
case 1: callsub OnBuyItem,5035,1,2254,5,2282,5,10000000,"SZeny",5132,1;
case 2: callsub OnBuyItem,5132,1,4001,10,975,5,10000000,"SZeny",6511,1;
case 3: callsub OnBuyItem,5132,1,4004,10,980,5,10000000,"SZeny",6512,1;
case 4: callsub OnBuyItem,5132,1,4196,10,978,5,10000000,"SZeny",6513,1;
case 5: callsub OnBuyItem,5132,1,4033,10,979,5,10000000,"SZeny",6514,1;
case 6: callsub OnBuyItem,5035,1,2255,5,923,20,10000000,"SZeny",5254,1;
case 7: callsub OnBuyItem,5254,1,2255,1,975,5,10000000,"SZeny",8525,1;
case 8: callsub OnBuyItem,5808,1,2228,1,5025,1,976,5,10000000,"SZeny",6930,1;
}
}


А вот эти варнинги (как заноза в Ж...)

[22/Feb 02:41][Warning]: Unexpected type for argument 1. Expected string.
[22/Feb 02:41][Debug]: Data: number value=1
[22/Feb 02:41][Debug]: Function: compare
[22/Feb 02:41][Debug]: Source (NPC): ╪ыхь√ at prontera (143,283)
[22/Feb 02:41][Warning]: Unexpected type for argument 1. Expected string.
[22/Feb 02:41][Debug]: Data: number value=5
[22/Feb 02:41][Debug]: Function: compare
[22/Feb 02:41][Debug]: Source (NPC): ╪ыхь√ at prontera (143,283)
[22/Feb 02:41][Warning]: Unexpected type for argument 1. Expected string.
[22/Feb 02:41][Debug]: Data: number value=5
[22/Feb 02:41][Debug]: Function: compare
[22/Feb 02:41][Debug]: Source (NPC): ╪ыхь√ at prontera (143,283)
[22/Feb 02:41][Warning]: Unexpected type for argument 1. Expected string.
[22/Feb 02:41][Debug]: Data: number value=1
[22/Feb 02:41][Debug]: Function: compare
[22/Feb 02:41][Debug]: Source (NPC): ╪ыхь√ at prontera (143,283)
[22/Feb 02:41][Warning]: Unexpected type for argument 1. Expected string.
[22/Feb 02:41][Debug]: Data: number value=10
[22/Feb 02:41][Debug]: Function: compare
[22/Feb 02:41][Debug]: Source (NPC): ╪ыхь√ at prontera (143,283)
[22/Feb 02:41][Warning]: Unexpected type for argument 1. Expected string.
[22/Feb 02:41][Debug]: Data: number value=5
[22/Feb 02:41][Debug]: Function: compare
[22/Feb 02:41][Debug]: Source (NPC): ╪ыхь√ at prontera (143,283)
[22/Feb 02:41][Warning]: Unexpected type for argument 1. Expected string.
[22/Feb 02:41][Debug]: Data: number value=1
[22/Feb 02:41][Debug]: Function: compare
[22/Feb 02:41][Debug]: Source (NPC): ╪ыхь√ at prontera (143,283)
[22/Feb 02:41][Warning]: Unexpected type for argument 1. Expected string.
[22/Feb 02:41][Debug]: Data: number value=10
[22/Feb 02:41][Debug]: Function: compare
[22/Feb 02:41][Debug]: Source (NPC): ╪ыхь√ at prontera (143,283)
[22/Feb 02:41][Warning]: Unexpected type for argument 1. Expected string.
[22/Feb 02:41][Debug]: Data: number value=5
[22/Feb 02:41][Debug]: Function: compare
[22/Feb 02:41][Debug]: Source (NPC): ╪ыхь√ at prontera (143,283)
[22/Feb 02:41][Warning]: Unexpected type for argument 1. Expected string.
[22/Feb 02:41][Debug]: Data: number value=1
[22/Feb 02:41][Debug]: Function: compare
[22/Feb 02:41][Debug]: Source (NPC): ╪ыхь√ at prontera (143,283)
[22/Feb 02:41][Warning]: Unexpected type for argument 1. Expected string.
[22/Feb 02:41][Debug]: Data: number value=10
[22/Feb 02:41][Debug]: Function: compare
[22/Feb 02:41][Debug]: Source (NPC): ╪ыхь√ at prontera (143,283)
[22/Feb 02:41][Warning]: Unexpected type for argument 1. Expected string.
[22/Feb 02:41][Debug]: Data: number value=5
[22/Feb 02:41][Debug]: Function: compare
[22/Feb 02:41][Debug]: Source (NPC): ╪ыхь√ at prontera (143,283)
[22/Feb 02:41][Warning]: Unexpected type for argument 1. Expected string.
[22/Feb 02:41][Debug]: Data: number value=1
[22/Feb 02:41][Debug]: Function: compare
[22/Feb 02:41][Debug]: Source (NPC): ╪ыхь√ at prontera (143,283)
[22/Feb 02:41][Warning]: Unexpected type for argument 1. Expected string.
[22/Feb 02:41][Debug]: Data: number value=10
[22/Feb 02:41][Debug]: Function: compare
[22/Feb 02:41][Debug]: Source (NPC): ╪ыхь√ at prontera (143,283)
[22/Feb 02:41][Warning]: Unexpected type for argument 1. Expected string.
[22/Feb 02:41][Debug]: Data: number value=5
[22/Feb 02:41][Debug]: Function: compare
[22/Feb 02:41][Debug]: Source (NPC): ╪ыхь√ at prontera (143,283)
[22/Feb 02:41][Warning]: Unexpected type for argument 1. Expected string.
[22/Feb 02:41][Debug]: Data: number value=1
[22/Feb 02:41][Debug]: Function: compare
[22/Feb 02:41][Debug]: Source (NPC): ╪ыхь√ at prontera (143,283)
[22/Feb 02:41][Warning]: Unexpected type for argument 1. Expected string.
[22/Feb 02:41][Debug]: Data: number value=5
[22/Feb 02:41][Debug]: Function: compare
[22/Feb 02:41][Debug]: Source (NPC): ╪ыхь√ at prontera (143,283)
[22/Feb 02:41][Warning]: Unexpected type for argument 1. Expected string.
[22/Feb 02:41][Debug]: Data: number value=20
[22/Feb 02:41][Debug]: Function: compare
[22/Feb 02:41][Debug]: Source (NPC): ╪ыхь√ at prontera (143,283)
[22/Feb 02:41][Warning]: Unexpected type for argument 1. Expected string.
[22/Feb 02:41][Debug]: Data: number value=1
[22/Feb 02:41][Debug]: Function: compare
[22/Feb 02:41][Debug]: Source (NPC): ╪ыхь√ at prontera (143,283)
[22/Feb 02:41][Warning]: Unexpected type for argument 1. Expected string.
[22/Feb 02:41][Debug]: Data: number value=1
[22/Feb 02:41][Debug]: Function: compare
[22/Feb 02:41][Debug]: Source (NPC): ╪ыхь√ at prontera (143,283)
[22/Feb 02:41][Warning]: Unexpected type for argument 1. Expected string.
[22/Feb 02:41][Debug]: Data: number value=5
[22/Feb 02:41][Debug]: Function: compare
[22/Feb 02:41][Debug]: Source (NPC): ╪ыхь√ at prontera (143,283)
[22/Feb 02:41][Warning]: Unexpected type for argument 1. Expected string.
[22/Feb 02:41][Debug]: Data: number value=1
[22/Feb 02:41][Debug]: Function: compare
[22/Feb 02:41][Debug]: Source (NPC): ╪ыхь√ at prontera (143,283)
[22/Feb 02:41][Warning]: Unexpected type for argument 1. Expected string.
[22/Feb 02:41][Debug]: Data: number value=1
[22/Feb 02:41][Debug]: Function: compare
[22/Feb 02:41][Debug]: Source (NPC): ╪ыхь√ at prontera (143,283)
[22/Feb 02:41][Warning]: Unexpected type for argument 1. Expected string.
[22/Feb 02:41][Debug]: Data: number value=1
[22/Feb 02:41][Debug]: Function: compare
[22/Feb 02:41][Debug]: Source (NPC): ╪ыхь√ at prontera (143,283)
[22/Feb 02:41][Warning]: Unexpected type for argument 1. Expected string.
[22/Feb 02:41][Debug]: Data: number value=5
[22/Feb 02:41][Debug]: Function: compare
[22/Feb 02:41][Debug]: Source (NPC): ╪ыхь√ at prontera (143,283)


Где бы копнуть?)

Автор: Jarek: Дата: 02.22.2011

Вы пытаетесь искать подстроку Zeny в целом числе.

Автор: xDREDDx: Дата: 02.22.2011

немогу понять(((
Разве в зени проблема?

Автор: Jarek: Дата: 02.22.2011

Эээ, я вообще то выделил жирным в чем проблема.
Компар работает только со строками, вы туда загоняете все аргументы, включая числа (кстати зачем?)

Автор: xDREDDx: Дата: 02.23.2011

Прочитал об изменениях в новом эмуле, там маленькие изменения в скрпитах)
Выходит что нужно было как написали вы выше, к функции

compare(getarg(.e+1),"Zeny");

добавить к ней ковычки)
compare(""+getarg(.e+1),"Zeny");


теперь при загрузке не показывает ошибок... но когда жмёш на него показывает снова....

Автор: Kill Spirit: Дата: 02.23.2011

compare("+getarg(.e+1),"Zeny"");

Автор: xDREDDx: Дата: 03.10.2011

script error on npc/DREDD`s work/QGlasses.txt line 13
parse_callfunc: not enough arguments, expected ','
8 : npcshopattach "quest_shop#Glasses";
9 : end;
10 :
11 : OnBuyItem:
12 : if(.BuildQuest) {
* 13 : for(set .e,0; !compare("+getarg(.e+1),"'Z'eny""); set .e
,.e+2) {}
14 : npcshopadditem "quest_shop#Glasses",getarg(.e+2),getarg(
.e)*compare(getarg(.e+1),"SZeny");
15 : setarray .Shop[.i],getarg(.e+2);
16 : set .i,.i+1;
17 : goto Quest_Setup;
18 : }

Автор: Renegade: Дата: 03.10.2011

а зачем вообще так усложнять итемквест? Всё гинеальное ж просто

if (countitem(909) > 99 && countitem(713) > 49  && countitem(619) > 0) {
next;
mes .npc$;
mes "Ты вернулся...Надеюсь у тебя все с собой?";
switch(select("Да у меня все с собой!:Уйти!")){
case 1: {
mes .npc$;
mes "Отлично я даю тебе твои чесно заслуженные ништячки";
delitem 909,100;
delitem 713,50;
delitem 619,1;
getitem 603,10;

Автор: xDREDDx: Дата: 03.10.2011

да ну) это уже устарело)

Автор: Jailow2: Дата: 03.11.2011

- shop quest_shop#Helms -1,501:50 вот вроде ошибка

Автор: xDREDDx: Дата: 03.12.2011

нет, не думаю. Сама ошибка прячется гдето в функции compare. Вот как бы правильно это всё связать....