newja 53 Posted March 7, 2015 Share Posted March 7, 2015 M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) Spoiler Open char_item.cpp and find: sys_log(0, "PayPee End %d", cost); after this add: quest::CQuestManager::instance().upgrade(GetPlayerID(), pkNewItem); Open quest.h and find: QUEST_ITEM_INFORMER_EVENT, after this add: QUEST_UPGRADE_EVENT, Open questnpc.cpp and find: bool NPC::OnItemInformer(PC& pc, unsigned int vnum) after this add: bool NPC::OnUpgrade(PC& pc, LPITEM item) { return HandleEvent(pc, QUEST_UPGRADE_EVENT); } Open questnpc.h and find: bool OnItemInformer(PC& pc,unsigned int vnum); after this add: bool OnUpgrade(PC& pc,LPITEM item); Open questmanager.cpp and find: m_mapEventName.insert(TEventNameMap::value_type("item_informer", QUEST_ITEM_INFORMER_EVENT)); after this add: m_mapEventName.insert(TEventNameMap::value_type("upgrade", QUEST_UPGRADE_EVENT)); now find: void CQuestManager::ItemInformer(unsigned int pc,unsigned int vnum) after this add: void CQuestManager::upgrade(unsigned int pc, LPITEM item) { PC * pPC; if ((pPC = GetPC(pc))) { if (!CheckQuestLoaded(pPC)) return; SetCurrentItem(item); m_mapNPC[QUEST_NO_NPC].OnUpgrade(*pPC,item); } else sys_err("QUEST no such pc id : %d", pc); } Open questmanager.h and find: void ItemInformer(unsigned int pc, unsigned int vnum); after this add: void upgrade(unsigned int pc, LPITEM item); Example Quest: when upgrade begin vnum = item.vnum - 10 syschat("Sword+"..vnum.." >> Sword+"..vnum+1) end Regards, newja 1 1 1 11 Link to comment Share on other sites More sharing options...
Premium Galet 514 Posted March 7, 2015 Premium Share Posted March 7, 2015 Great dude ! You rock ! Link to comment Share on other sites More sharing options...
Premium MrLibya 558 Posted March 7, 2015 Premium Share Posted March 7, 2015 Nice , But Can u make it like that? when xx.upgrade begin If you're going to do something, then do it right. Link to comment Share on other sites More sharing options...
newja 53 Posted March 7, 2015 Author Share Posted March 7, 2015 Nice , But Can u make it like that? when xx.upgrade begin No need for that, you can use item.vnum in quest to see what was upgraded. Example when upgrade begin if item.vnum =< 19 and item.vnum >= 10 then syschat("Only 10-19 ID is checked") end end Also it's easier to use it with tables than copying 1000 times same phrase (xx.upgrade) with different item id, lol. 1 Link to comment Share on other sites More sharing options...
Former Staff Shisui 493 Posted March 7, 2015 Former Staff Share Posted March 7, 2015 Wow really nice, thank you. Link to comment Share on other sites More sharing options...
valessio 14 Posted March 7, 2015 Share Posted March 7, 2015 SUPER AMAZING FINALLY SOMEONE with balls that help us! thanks infinite! Link to comment Share on other sites More sharing options...
newja 53 Posted March 7, 2015 Author Share Posted March 7, 2015 If you want to trigger this event while upgrading with scroll you need to do following: Open char_item.cpp and search for this. Now add: quest::CQuestManager::instance().upgrade(GetPlayerID(), item); ######################################################## If you want to get data from actual item such as vnum, bonuses, sockets or slot number (e.g. Upgraded sword from +0 to +1, now you get ID 10 instead of new ID 11, continue reading to change that) you have to change all this: quest::CQuestManager::instance().upgrade(GetPlayerID(), item); with this quest::CQuestManager::instance().upgrade(GetPlayerID(), pkNewItem); Forgot to mention but this event is called only when upgrade is succesfull. Regards, newja 1 Link to comment Share on other sites More sharing options...
Former Staff Shisui 493 Posted March 7, 2015 Former Staff Share Posted March 7, 2015 Edit: Answer here ^ Link to comment Share on other sites More sharing options...
newja 53 Posted March 7, 2015 Author Share Posted March 7, 2015 This only works with blacksmith? Check post above yours. Link to comment Share on other sites More sharing options...
Former Staff Shisui 493 Posted March 7, 2015 Former Staff Share Posted March 7, 2015 (edited) This heappens when I upgrade for the very first time. Then, If I use again the same item. Edited August 19, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
newja 53 Posted March 7, 2015 Author Share Posted March 7, 2015 (edited) This heappens when I upgrade for the very first time. Then, If I use again the same item. After upgrade or /reload q? Happened to me after reload. If you want to get data from actual item such as vnum, bonuses, sockets or slot number (e.g. Upgraded sword from +0 to +1, now you get ID 10 instead of new ID 11, continue reading to change that) you have to change all this: quest::CQuestManager::instance().upgrade(GetPlayerID(), item); with this quest::CQuestManager::instance().upgrade(GetPlayerID(), pkNewItem); This fixed the problem. Edited August 19, 2022 by Metin2 Dev Core X - External 2 Internal 1 Link to comment Share on other sites More sharing options...
Former Staff Shisui 493 Posted March 7, 2015 Former Staff Share Posted March 7, 2015 After upgrade or /reload q? Happened to me after reload.After /reload q.I'll try that. 1 Link to comment Share on other sites More sharing options...
Recommended Posts