*Problemă/Întrebare: Cum pot sa rezolv bugul la cuferele aurii si argintii?
Tipologie server(PvM / PvP): Pvm
*Resursă folosită: *Link exclusiv J4M* -
*ServerFiles utilizat: -
*Syserr: -
Poză: -
*Detalii suplimentare: Salutare ! Vreau sa fac stack la cuferele argintii si aurii cu + si fara (cele ce se deschid cu cheile de aur si argint). Daca fac stack pe ele, cand pun cheia respectiva dispar toate adica daca am 10 cufere si pun o cheie, le deschide pe toate si primesc premiul doar dintr-o cutie....ma poate ajuta cineva ? Stiu ca este din char_item.cpp dar nu stiu ce sa modific. Am gasit acest cod. Multumesc !
Probleme cufere aurii si argintii
- Iamandi Mihai
-

- Mesaje: 148
- Membru din: 04 Mar 2016, 15:17
- Server: WF 2
- Regat: Shinsoo
- Aprecieri: 308
- Mulţumiri: 7
- Discord: https://discord.com/invite/DXe" id="input794074" style="display:none;">Copiază ID
- Contact:
- [HF]White
-

- Mesaje: 2684
- Membru din: 03 Iul 2018, 13:40
- Regat: Jinno
- Aprecieri: 338
- Mulţumiri: 5331
- Rezolvări prob.: 13
- Discord: Copiază ID
- Contact:
Poti face pe quest si ai scapat de problema asta.
Cod: Selectaţi tot
----------------------------------------------------
--MYSTERY_KEY
--www.metin2-draco.ro
----------------------------------------------------
quest mystery_key begin
state start begin
when 50132.use begin
if pc.count_item(50150)>=1 or pc.count_item(50156)>=1 then
say_title(item_name(item.vnum) .. ": ")
say("Doreºti sã deschizi cufãrul cu cheia? ")
local main_set_1 = select("Da, deschide cufãrul ","Nu, nu acum ")
if main_set_1 == 1 then
pc.removeitem(50132, 1)
if pc.count_item(50150)>=1 then
pc.removeitem(50150, 1)
end
local box_50132=number(1, 20)
if 1>=box_50132 then
pc.give_item2("70039", 1)
elseif 2>=box_50132 then
pc.give_item2("30191", 5)
elseif 3>=box_50132 then
pc.give_item2("27992", 1)
elseif 4>=box_50132 then
pc.give_item2("71054", 1)
elseif 5>=box_50132 then
pc.give_item2("72001", 1)
elseif 6>=box_50132 then
pc.give_item2("72004", 1)
elseif 7>=box_50132 then
pc.give_item2("72022", 1)
elseif 8>=box_50132 then
pc.give_item2("71027", 15)
elseif 9>=box_50132 then
pc.give_item2("71028", 15)
elseif 10>=box_50132 then
pc.give_item2("71029", 15)
elseif 11>=box_50132 then
pc.give_item2("71030", 15)
elseif 12>=box_50132 then
pc.give_item2("71044", 15)
elseif 13>=box_50132 then
pc.give_item2("71045", 15)
elseif 14>=box_50132 then
pc.give_item2("27993", 1)
elseif 15>=box_50132 then
pc.give_item2("27994", 1)
elseif 16>=box_50132 then
pc.give_item2("71050", 15)
elseif 17>=box_50132 then
pc.give_item2("71107", 1)
elseif 18>=box_50132 then
pc.give_item2("50513", 1)
elseif 19>=box_50132 then
pc.give_item2("50011", 5)
elseif 20>=box_50132 then
pc.give_item2("50037", 5)
end
end
if main_set_1 == 2 then
return
end
else
say_title(item_name(item.vnum) .. ": ")
say("Ai nevoie de o Cheie de Rubin sau de o Cheie de[ENTER]Diamant pentru a deschide Cutie Rubin Misterioasa. ")
end
end
when 50133.use begin
if pc.count_item(50151)>=1 or pc.count_item(50156)>=1 then
say_title(item_name(item.vnum) .. ": ")
say("Doreºti sã deschizi cufãrul cu cheia? ")
local main_set_2 = select("Da, deschide cufãrul ","Nu, nu acum ")
if main_set_2 == 1 then
pc.removeitem(50133, 1)
if pc.count_item(50151)>=1 then
pc.removeitem(50151, 1)
end
local box_50133=number(1, 10)
if 1>=box_50133 then
pc.give_item2("27101", 15)
elseif 2>=box_50133 then
pc.give_item2("27104", 15)
elseif 3>=box_50133 then
pc.give_item2("72002", 1)
elseif 4>=box_50133 then
pc.give_item2("72005", 1)
elseif 5>=box_50133 then
pc.give_item2("72023", 1)
elseif 6>=box_50133 then
pc.give_item2("71113", 15)
elseif 7>=box_50133 then
pc.give_item2("71094", 15)
elseif 8>=box_50133 then
pc.give_item2("71001", 15)
elseif 9>=box_50133 then
pc.give_item2("72017", 1)
elseif 10>=box_50133 then
pc.give_item2("70020", 15)
end
end
if main_set_2 == 2 then
return
end
else
say_title(item_name(item.vnum) .. ": ")
say("Ai nevoie de o Cheie de Smarald sau de o Cheie de[ENTER]Diamant pentru a deschide Cutie Smarald Misterios. ")
end
end
when 50134.use begin
if pc.count_item(50152)>=1 or pc.count_item(50156)>=1 then
say_title(item_name(item.vnum) .. ": ")
say("Doreºti sã deschizi cufãrul cu cheia? ")
local main_set_3 = select("Da, deschide cufãrul ","Nu, nu acum ")
if main_set_3 == 1 then
pc.removeitem(50134, 1)
if pc.count_item(50152)>=1 then
pc.removeitem(50152, 1)
end
local box_50134=number(1, 49)
if 1>=box_50134 then
pc.give_item2("73001", 1)
elseif 2>=box_50134 then
pc.give_item2("73002", 1)
elseif 3>=box_50134 then
pc.give_item2("73003", 1)
elseif 4>=box_50134 then
pc.give_item2("73004", 1)
elseif 5>=box_50134 then
pc.give_item2("73005", 1)
elseif 6>=box_50134 then
pc.give_item2("73006", 1)
elseif 7>=box_50134 then
pc.give_item2("73007", 1)
elseif 8>=box_50134 then
pc.give_item2("73008", 1)
elseif 9>=box_50134 then
pc.give_item2("73009", 1)
elseif 10>=box_50134 then
pc.give_item2("73010", 1)
elseif 11>=box_50134 then
pc.give_item2("73011", 1)
elseif 12>=box_50134 then
pc.give_item2("73012", 1)
elseif 13>=box_50134 then
pc.give_item2("73251", 1)
elseif 14>=box_50134 then
pc.give_item2("73252", 1)
elseif 15>=box_50134 then
pc.give_item2("73253", 1)
elseif 16>=box_50134 then
pc.give_item2("73254", 1)
elseif 17>=box_50134 then
pc.give_item2("73255", 1)
elseif 18>=box_50134 then
pc.give_item2("73256", 1)
elseif 19>=box_50134 then
pc.give_item2("73257", 1)
elseif 20>=box_50134 then
pc.give_item2("73258", 1)
elseif 21>=box_50134 then
pc.give_item2("73259", 1)
elseif 22>=box_50134 then
pc.give_item2("73260", 1)
elseif 23>=box_50134 then
pc.give_item2("73261", 1)
elseif 24>=box_50134 then
pc.give_item2("73262", 1)
elseif 25>=box_50134 then
pc.give_item2("73501", 1)
elseif 26>=box_50134 then
pc.give_item2("73502", 1)
elseif 27>=box_50134 then
pc.give_item2("73503", 1)
elseif 28>=box_50134 then
pc.give_item2("73504", 1)
elseif 29>=box_50134 then
pc.give_item2("73505", 1)
elseif 30>=box_50134 then
pc.give_item2("73506", 1)
elseif 31>=box_50134 then
pc.give_item2("73507", 1)
elseif 32>=box_50134 then
pc.give_item2("73508", 1)
elseif 33>=box_50134 then
pc.give_item2("73509", 1)
elseif 34>=box_50134 then
pc.give_item2("73510", 1)
elseif 35>=box_50134 then
pc.give_item2("73511", 1)
elseif 36>=box_50134 then
pc.give_item2("73512", 1)
elseif 37>=box_50134 then
pc.give_item2("73751", 1)
elseif 38>=box_50134 then
pc.give_item2("73752", 1)
elseif 39>=box_50134 then
pc.give_item2("73753", 1)
elseif 40>=box_50134 then
pc.give_item2("73754", 1)
elseif 41>=box_50134 then
pc.give_item2("73755", 1)
elseif 42>=box_50134 then
pc.give_item2("73756", 1)
elseif 43>=box_50134 then
pc.give_item2("73757", 1)
elseif 44>=box_50134 then
pc.give_item2("73758", 1)
elseif 45>=box_50134 then
pc.give_item2("73759", 1)
elseif 46>=box_50134 then
pc.give_item2("73760", 1)
elseif 47>=box_50134 then
pc.give_item2("73761", 1)
elseif 48>=box_50134 then
pc.give_item2("73762", 1)
elseif 49>=box_50134 then
pc.give_item2("71124", 1)
end
end
if main_set_3 == 2 then
return
end
else
say_title(item_name(item.vnum) .. ": ")
say("Ai nevoie de o Cheie de Safir sau de o Cheie de[ENTER]Diamant pentru a deschide Cutie Safir Misterioasa. ")
end
end
when 50135.use begin
if pc.count_item(50153)>=1 or pc.count_item(50156)>=1 then
say_title(item_name(item.vnum) .. ": ")
say("Doreºti sã deschizi cufãrul cu cheia? ")
local main_set_4 = select("Da, deschide cufãrul ","Nu, nu acum ")
if main_set_4 == 1 then
pc.removeitem(50135, 1)
if pc.count_item(50153)>=1 then
pc.removeitem(50153, 1)
end
local box_50135=number(1, 21)
if 1>=box_50135 then
pc.give_item2("71032", 1)
elseif 2>=box_50135 then
pc.give_item2("71015", 1)
elseif 3>=box_50135 then
pc.give_item2("71016", 1)
elseif 4>=box_50135 then
pc.give_item2("71017", 1)
elseif 5>=box_50135 then
pc.give_item2("71027", 15)
elseif 6>=box_50135 then
pc.give_item2("71028", 15)
elseif 7>=box_50135 then
pc.give_item2("71029", 15)
elseif 8>=box_50135 then
pc.give_item2("71030", 15)
elseif 9>=box_50135 then
pc.give_item2("71044", 15)
elseif 10>=box_50135 then
pc.give_item2("71045", 15)
elseif 11>=box_50135 then
pc.give_item2("71018", 15)
elseif 12>=box_50135 then
pc.give_item2("71019", 15)
elseif 13>=box_50135 then
pc.give_item2("71080", 1)
elseif 14>=box_50135 then
pc.give_item2("71081", 1)
elseif 15>=box_50135 then
pc.give_item2("71082", 1)
elseif 16>=box_50135 then
pc.give_item2("27987", 1)
elseif 17>=box_50135 then
pc.give_item2("71004", 15)
elseif 18>=box_50135 then
pc.give_item2("50513", 1)
elseif 19>=box_50135 then
pc.give_item2("72018", 1)
elseif 20>=box_50135 then
pc.give_item2("27989", 1)
elseif 21>=box_50135 then
pc.give_item2("71003", 1)
end
end
if main_set_4 == 2 then
return
end
else
say_title(item_name(item.vnum) .. ": ")
say("Ai nevoie de o Cheie de Ametist sau de o Cheie de[ENTER]Diamant pentru a deschide Cutie Ametist Misterios. ")
end
end
when 50136.use begin
if pc.count_item(50154)>=1 or pc.count_item(50156)>=1 then
say_title(item_name(item.vnum) .. ": ")
say("Doreºti sã deschizi cufãrul cu cheia? ")
local main_set_5 = select("Da, deschide cufãrul ","Nu, nu acum ")
if main_set_5 == 1 then
pc.removeitem(50136, 1)
if pc.count_item(50154)>=1 then
pc.removeitem(50154, 1)
end
local box_50136=number(1, 20)
if 1>=box_50136 then
pc.give_item2("71103", 1)
elseif 2>=box_50136 then
pc.give_item2("71104", 1)
elseif 3>=box_50136 then
pc.give_item2("71105", 1)
elseif 4>=box_50136 then
pc.give_item2("71106", 1)
elseif 5>=box_50136 then
pc.give_item2("70024", 1)
elseif 6>=box_50136 then
pc.give_item2("71014", 15)
elseif 7>=box_50136 then
pc.give_item2("71101", 15)
elseif 8>=box_50136 then
pc.give_item2("71109", 1)
elseif 9>=box_50136 then
pc.give_item2("71083", 1)
elseif 10>=box_50136 then
pc.give_item2("71084", 1)
elseif 11>=box_50136 then
pc.give_item2("71085", 1)
elseif 12>=box_50136 then
pc.give_item2("72003", 1)
elseif 13>=box_50136 then
pc.give_item2("72006", 1)
elseif 14>=box_50136 then
pc.give_item2("72024", 1)
elseif 15>=box_50136 then
pc.give_item2("71113", 15)
elseif 16>=box_50136 then
pc.give_item2("71020", 15)
elseif 17>=box_50136 then
pc.give_item2("71012", 1)
elseif 18>=box_50136 then
pc.give_item2("72015", 1)
elseif 19>=box_50136 then
pc.give_item2("72018", 1)
elseif 20>=box_50136 then
pc.give_item2("71004", 15)
end
end
if main_set_5 == 2 then
return
end
else
say_title(item_name(item.vnum) .. ": ")
say("Ai nevoie de o Cheie de Topaz sau de o Cheie de[ENTER]Diamant pentru a deschide Cutie Topaz Misterioasa. ")
end
end
when 50137.use begin
if pc.count_item(50155)>=1 or pc.count_item(50156)>=1 then
say_title(item_name(item.vnum) .. ": ")
say("Doreºti sã deschizi cufãrul cu cheia? ")
local main_set_6 = select("Da, deschide cufãrul ","Nu, nu acum ")
if main_set_6 == 1 then
pc.removeitem(50137, 1)
if pc.count_item(50155)>=1 then
pc.removeitem(50155, 1)
end
local box_50137=number(1, 21)
if 1>=box_50137 then
pc.give_item2("27102", 15)
elseif 2>=box_50137 then
pc.give_item2("27105", 15)
elseif 3>=box_50137 then
pc.give_item2("25040", 1)
elseif 4>=box_50137 then
pc.give_item2("71095", 1)
elseif 5>=box_50137 then
pc.give_item2("71083", 1)
elseif 6>=box_50137 then
pc.give_item2("71084", 1)
elseif 7>=box_50137 then
pc.give_item2("71085", 1)
elseif 8>=box_50137 then
pc.give_item2("71109", 1)
elseif 9>=box_50137 then
pc.give_item2("70024", 1)
elseif 10>=box_50137 then
pc.give_item2("71049", 1)
elseif 11>=box_50137 then
pc.give_item2("71057", 1)
elseif 12>=box_50137 then
pc.give_item2("71058", 1)
elseif 13>=box_50137 then
pc.give_item2("71059", 1)
elseif 14>=box_50137 then
pc.give_item2("71060", 1)
elseif 15>=box_50137 then
pc.give_item2("71061", 1)
elseif 16>=box_50137 then
pc.give_item2("71062", 1)
elseif 17>=box_50137 then
pc.give_item2("71063", 1)
elseif 18>=box_50137 then
pc.give_item2("71064", 1)
elseif 19>=box_50137 then
pc.give_item2("71065", 1)
elseif 20>=box_50137 then
pc.give_item2("71066", 1)
elseif 21>=box_50137 then
pc.give_item2("71067", 1)
end
end
if main_set_6 == 2 then
return
end
else
say_title(item_name(item.vnum) .. ": ")
say("Ai nevoie de o Cheie de Citrin sau de o Cheie de[ENTER]Diamant pentru a deschide Cutie Citrin Misterioasã. ")
end
end
end
end- [RaffaeL]
-

- Mesaje: 3223
- Membru din: 19 Mar 2016, 12:58
- Server: ...
- Aprecieri: 15
- Mulţumiri: 2502
- Rezolvări prob.: 2
- Discord: Copiază ID
- Contact:
Cod: Selectaţi tot
ITEM_MANAGER::instance().RemoveItem(item); ->sterge itemul indiferent de cantitateCod: Selectaţi tot
item->SetCount(item->GetCount()-1);sterge doar un item din stack- Pentru acest mesaj, [RaffaeL] for the post:
- Iamandi Mihai
- Iamandi Mihai
-

- Mesaje: 148
- Membru din: 04 Mar 2016, 15:17
- Server: WF 2
- Regat: Shinsoo
- Aprecieri: 308
- Mulţumiri: 7
- Discord: https://discord.com/invite/DXe" id="input794118" style="display:none;">Copiază ID
- Contact:
Multumesc pentru ranspuns ! unde trebuie sa modific ?
Am incercat aici si cand dau cu cheia imi ramane acelasi numar de cufere si imi deschide 1
ITEM_MANAGER::instance().RemoveItem(item);
ITEM_MANAGER::instance().RemoveItem(item2);
Aici am functia ! Ai putea sa o editezi te rog? Multumesc mult !
Am incercat aici si cand dau cu cheia imi ramane acelasi numar de cufere si imi deschide 1
ITEM_MANAGER::instance().RemoveItem(item);
ITEM_MANAGER::instance().RemoveItem(item2);
Cod: Selectaţi tot
case ITEM_TREASURE_BOX:
{
return false;
}
break;
case ITEM_TREASURE_KEY:
{
LPITEM item2;
if (!GetItem(DestCell) || !(item2 = GetItem(DestCell)))
return false;
if (item2->IsExchanging())
return false;
if (item2->GetType() != ITEM_TREASURE_BOX)
{
ChatPacket(CHAT_TYPE_TALKING, LC_TEXT_LANG("열쇠로 여는 물건이 아닌것 같다.", GetLanguage()));
return false;
}
if (item->GetValue(0) == item2->GetValue(0))
{
DWORD dwBoxVnum = item2->GetVnum();
std::vector <DWORD> dwVnums;
std::vector <DWORD> dwCounts;
std::vector <LPITEM> item_gets;
int count = 0;
if (GiveItemFromSpecialItemGroup(dwBoxVnum, dwVnums, dwCounts, item_gets, count))
{
ITEM_MANAGER::instance().RemoveItem(item);
ITEM_MANAGER::instance().RemoveItem(item2);
for (int i = 0; i < count; i++){
switch (dwVnums[i])
{
case CSpecialItemGroup::GOLD:
ChatPacket(CHAT_TYPE_INFO, LC_TEXT_LANG("돈 %d 냥을 획득했습니다.", GetLanguage()), dwCounts[i]);
break;
case CSpecialItemGroup::EXP:
ChatPacket(CHAT_TYPE_INFO, LC_TEXT_LANG("상자에서 부터 신비한 빛이 나옵니다.", GetLanguage()));
ChatPacket(CHAT_TYPE_INFO, LC_TEXT_LANG("%d의 경험치를 획득했습니다.", GetLanguage()), dwCounts[i]);
break;
case CSpecialItemGroup::MOB:
ChatPacket(CHAT_TYPE_INFO, LC_TEXT_LANG("상자에서 몬스터가 나타났습니다!", GetLanguage()));
break;
case CSpecialItemGroup::SLOW:
ChatPacket(CHAT_TYPE_INFO, LC_TEXT_LANG("상자에서 나온 빨간 연기를 들이마시자 움직이는 속도가 느려졌습니다!", GetLanguage()));
break;
case CSpecialItemGroup::DRAIN_HP:
ChatPacket(CHAT_TYPE_INFO, LC_TEXT_LANG("상자가 갑자기 폭발하였습니다! 생명력이 감소했습니다.", GetLanguage()));
break;
case CSpecialItemGroup::POISON:
ChatPacket(CHAT_TYPE_INFO, LC_TEXT_LANG("상자에서 나온 녹색 연기를 들이마시자 독이 온몸으로 퍼집니다!", GetLanguage()));
break;
case CSpecialItemGroup::MOB_GROUP:
ChatPacket(CHAT_TYPE_INFO, LC_TEXT_LANG("상자에서 몬스터가 나타났습니다!", GetLanguage()));
break;
default:
if (item_gets[i])
{
if (dwCounts[i] > 1)
ChatPacket(CHAT_TYPE_INFO, LC_TEXT_LANG("상자에서 %s 가 %d 개 나왔습니다.", GetLanguage()), item_gets[i]->GetName(), dwCounts[i]);
else
ChatPacket(CHAT_TYPE_INFO, LC_TEXT_LANG("상자에서 %s 가 나왔습니다.", GetLanguage()), item_gets[i]->GetName());
}
}
}
}
else
{
ChatPacket(CHAT_TYPE_TALKING, LC_TEXT_LANG("열쇠가 맞지 않는 것 같다.", GetLanguage()));
return false;
}
}
else
{
ChatPacket(CHAT_TYPE_TALKING, LC_TEXT_LANG("열쇠가 맞지 않는 것 같다.", GetLanguage()));
return false;
}
}
break;- Iamandi Mihai
-

- Mesaje: 148
- Membru din: 04 Mar 2016, 15:17
- Server: WF 2
- Regat: Shinsoo
- Aprecieri: 308
- Mulţumiri: 7
- Discord: https://discord.com/invite/DXe" id="input794122" style="display:none;">Copiază ID
- Contact:
AM REZOLVAT ! CER T/C. MULTUMESC [RaffaeL]
- Ionuţ M.
-

- Mesaje: 2680
- Membru din: 28 Noi 2015, 22:02
- Aprecieri: 170
- Mulţumiri: 12723
- Rezolvări prob.: 2
- Discord: Copiază ID
- Contact:
Mutat in Probleme Rezolvate.
-
- Informaţie
-
Cine este conectat
Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 36 vizitatori




