Risan 115 Posted September 14, 2014 Share Posted September 14, 2014 M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) Germany: Hallo leute, ich hab heute Gm-Items erstellt und diese sollte man nicht handeln (Lösbar per Antiflag), Nun wollte ich aber das der ganze Charakter nicht handeln kann, Idee per Game dies zu regeln. Nach kurzen überlegen kamm dies hierbei raus: Ordner: game/src/ char.cpp (Zeile: 584) -> void CHARACTER::OpenMyShop(const char * c_pszSign, TShopItemTable * pTable, WORD bItemCount) void CHARACTER::OpenMyShop(const char * c_pszSign, TShopItemTable * pTable, WORD bItemCount) { if (GetPart(PART_MAIN) > 2) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("°©¿ÊÀ» ¹þ¾î¾ß °³ÀÎ »óÁ¡À» ¿ ¼ö ÀÖ½À´Ï´Ù.")); return; } if (GetMyShop()) // ÀÌ¹Ì ¼¥ÀÌ ¿·Á ÀÖÀ¸¸é ´Ý´Â´Ù. { CloseMyShop(); return; } if ( int(GetQuestFlag("BlockItem.Enable")) == 1 ) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("DENIED! You cannot Drop this Item. You Char is blocked!")); return; } char_battle.cpp (Zeile: 985) -> void CHARACTER::ItemDropPenalty(LPCHARACTER pkKiller) void CHARACTER::ItemDropPenalty(LPCHARACTER pkKiller) { // °³ÀλóÁ¡À» ¿¬ »óÅ¿¡¼´Â ¾ÆÀÌÅÛÀ» µå·ÓÇÏÁö ¾Ê´Â´Ù. if (GetMyShop()) return; if (false == LC_IsYMIR()) { if (GetLevel() < 50) return; } if (CBattleArena::instance().IsBattleArenaMap(GetMapIndex()) == true) { return; } struct TItemDropPenalty * table = &aItemDropPenalty_kor[0]; if (GetLevel() < 10) return; if ( int(GetQuestFlag("BlockItem.Enable")) == 1 ) { //ChatPacket(CHAT_TYPE_INFO, LC_TEXT("DENIED! You cannot Drop this Item. You Char is blocked!")); return; } char_item.cpp (Zeile: 5437) -> bool CHARACTER::DropItem(TItemPos Cell, WORD bCount) bool CHARACTER::DropItem(TItemPos Cell, WORD bCount) { LPITEM item = NULL; if (!CanHandleItem()) { if (NULL != DragonSoul_RefineWindow_GetOpener()) ChatPacket(CHAT_TYPE_INFO, LC_TEXT("°ÈâÀ» ¿¬ »óÅ¿¡¼´Â ¾ÆÀÌÅÛÀ» ¿Å±æ ¼ö ¾ø½À´Ï´Ù.")); return false; } if (IsDead()) return false; if (!IsValidItemPosition(Cell) || !(item = GetItem(Cell))) return false; if (item->IsExchanging()) return false; if (true == item->isLocked()) return false; if (quest::CQuestManager::instance().GetPCForce(GetPlayerID())->IsRunning() == true) return false; if ( int(GetQuestFlag("BlockItem.Enable")) == 1 ) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("DENIED! You cannot Drop this Item. You Char is blocked!")); return false; } exchange.cpp (Zeile: 139) -> bool CExchange::AddItem(TItemPos item_pos, WORD display_pos) bool CExchange::AddItem(TItemPos item_pos, WORD display_pos) { assert(m_pOwner != NULL && GetCompany()); if (!item_pos.IsValidItemPosition()) return false; // Àåºñ´Â ±³È¯ÇÒ ¼ö ¾øÀ½ if (item_pos.IsEquipPosition()) return false; LPITEM item; if (!(item = m_pOwner->GetItem(item_pos))) return false; if ( int(m_pOwner->GetQuestFlag("BlockItem.Enable")) == 1 ) { m_pOwner->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("DENIED! You cannot Drop this Item. You Char is blocked!")); return false; } Quest: --[[ -- BlockItems -- lvl 1+ -- Copyright ©Zymos/Risan -- Version 1.0 -- Create: 14.09.2014 ]] quest BlockItem begin state start begin when 9010.chat."BlockItems Manager" begin local f = "BlockItem" say("Status: ".. pc.getf(f,"Enable") .."") if select("Disable","Enable") == 1 then pc.setf(f,"Enable",0) chat("BlockItems is now Disabled") else pc.setf(f,"Enable",1) chat("BlockItems is now Enabled") end end end end Info: Wenn aktiviert kann der Charakter nichts mehr Fallen lassen, handeln oder verkaufen im Shop. Mfg Risan English: Hello, People, I have created GM_items today but this items should not be tradable. (With Antiflag) Now, however, I did not want the whole character can act. So i wrote this: char.cpp (Line: 584) -> void CHARACTER::OpenMyShop(const char * c_pszSign, TShopItemTable * pTable, WORD bItemCount) void CHARACTER::OpenMyShop(const char * c_pszSign, TShopItemTable * pTable, WORD bItemCount) { if (GetPart(PART_MAIN) > 2) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("°©¿ÊÀ» ¹þ¾î¾ß °³ÀÎ »óÁ¡À» ¿ ¼ö ÀÖ½À´Ï´Ù.")); return; } if (GetMyShop()) // ÀÌ¹Ì ¼¥ÀÌ ¿·Á ÀÖÀ¸¸é ´Ý´Â´Ù. { CloseMyShop(); return; } if ( int(GetQuestFlag("BlockItem.Enable")) == 1 ) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("DENIED! You cannot Drop this Item. You Char is blocked!")); return; } char_battle.cpp (Line: 985) -> void CHARACTER::ItemDropPenalty(LPCHARACTER pkKiller) void CHARACTER::ItemDropPenalty(LPCHARACTER pkKiller) { // °³ÀλóÁ¡À» ¿¬ »óÅ¿¡¼´Â ¾ÆÀÌÅÛÀ» µå·ÓÇÏÁö ¾Ê´Â´Ù. if (GetMyShop()) return; if (false == LC_IsYMIR()) { if (GetLevel() < 50) return; } if (CBattleArena::instance().IsBattleArenaMap(GetMapIndex()) == true) { return; } struct TItemDropPenalty * table = &aItemDropPenalty_kor[0]; if (GetLevel() < 10) return; if ( int(GetQuestFlag("BlockItem.Enable")) == 1 ) { //ChatPacket(CHAT_TYPE_INFO, LC_TEXT("DENIED! You cannot Drop this Item. You Char is blocked!")); return; } char_item.cpp (Line: 5437) -> bool CHARACTER::DropItem(TItemPos Cell, WORD bCount) bool CHARACTER::DropItem(TItemPos Cell, WORD bCount) { LPITEM item = NULL; if (!CanHandleItem()) { if (NULL != DragonSoul_RefineWindow_GetOpener()) ChatPacket(CHAT_TYPE_INFO, LC_TEXT("°ÈâÀ» ¿¬ »óÅ¿¡¼´Â ¾ÆÀÌÅÛÀ» ¿Å±æ ¼ö ¾ø½À´Ï´Ù.")); return false; } if (IsDead()) return false; if (!IsValidItemPosition(Cell) || !(item = GetItem(Cell))) return false; if (item->IsExchanging()) return false; if (true == item->isLocked()) return false; if (quest::CQuestManager::instance().GetPCForce(GetPlayerID())->IsRunning() == true) return false; if ( int(GetQuestFlag("BlockItem.Enable")) == 1 ) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("DENIED! You cannot Drop this Item. You Char is blocked!")); return false; } exchange.cpp (Line: 139) -> bool CExchange::AddItem(TItemPos item_pos, WORD display_pos) bool CExchange::AddItem(TItemPos item_pos, WORD display_pos) { assert(m_pOwner != NULL && GetCompany()); if (!item_pos.IsValidItemPosition()) return false; // Àåºñ´Â ±³È¯ÇÒ ¼ö ¾øÀ½ if (item_pos.IsEquipPosition()) return false; LPITEM item; if (!(item = m_pOwner->GetItem(item_pos))) return false; if ( int(m_pOwner->GetQuestFlag("BlockItem.Enable")) == 1 ) { m_pOwner->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("DENIED! You cannot Drop this Item. You Char is blocked!")); return false; } Quest: --[[ -- BlockItems -- lvl 1+ -- Copyright ©Zymos/Risan -- Version 1.0 -- Create: 14.09.2014 ]] quest BlockItem begin state start begin when 9010.chat."BlockItems Manager" begin local f = "BlockItem" say("Status: ".. pc.getf(f,"Enable") .."") if select("Disable","Enable") == 1 then pc.setf(f,"Enable",0) chat("BlockItems is now Disabled") else pc.setf(f,"Enable",1) chat("BlockItems is now Enabled") end end end end Info: If enable the chrakater can`t drop or trade Items! Best Regards, Risan heave a idea on create Spoiler? 13 Link to comment Share on other sites More sharing options...
DarthNeno 5 Posted September 14, 2014 Share Posted September 14, 2014 Finde es sehr Nice Link to comment Share on other sites More sharing options...
safademirel 292 Posted September 14, 2014 Share Posted September 14, 2014 Thanks.This method is really effective. Link to comment Share on other sites More sharing options...
Premium Zonni 230 Posted September 14, 2014 Premium Share Posted September 14, 2014 Can you tell me for what I can use this? I haven't any idea, so please tell me. For what a player would block dropping items? Anyway, nice idea for use quest flag to set something in source Link to comment Share on other sites More sharing options...
Timasu 30 Posted September 15, 2014 Share Posted September 15, 2014 Can you tell me for what I can use this? I haven't any idea, so please tell me. For what a player would block dropping items? Anyway, nice idea for use quest flag to set something in source If you can, why not? ) Link to comment Share on other sites More sharing options...
Risan 115 Posted September 15, 2014 Author Share Posted September 15, 2014 is QuestFlag enable, the Player cannot annything Drop, Trade,Sell items..! is Nice for GameMasters.. Link to comment Share on other sites More sharing options...
Honorable Member martysama0134 7200 Posted September 15, 2014 Honorable Member Share Posted September 15, 2014 heave a idea on create Spoiler?[ spoiler ] [ / spoiler]It's the same on every kind of board. if ( int(m_pOwner->GetQuestFlag("BlockItem.Enable")) == 1 ) This is really disturbing: GetQuestFlag is already int so you don't need an extra "int()"int CHARACTER::GetQuestFlag This should be enough: (non-zero value true, zero value false)if (m_pOwner->GetQuestFlag("BlockItem.Enable")) Ymir has good fame about highering letters"block_item.enable" could be preferable There's no need to rewrite the thread twice to translate 2 sentences. 4 Check out my GitHub Link to comment Share on other sites More sharing options...
Premium MrLibya 557 Posted November 25, 2014 Premium Share Posted November 25, 2014 This Is Shut .. If you're going to do something, then do it right. Link to comment Share on other sites More sharing options...
emre 3 Posted June 3, 2015 Share Posted June 3, 2015 Germany: Hallo leute, ich hab heute Gm-Items erstellt und diese sollte man nicht handeln (Lösbar per Antiflag), Nun wollte ich aber das der ganze Charakter nicht handeln kann, Idee per Game dies zu regeln. Nach kurzen überlegen kamm dies hierbei raus: Ordner: game/src/ char.cpp (Zeile: 584) -> void CHARACTER::OpenMyShop(const char * c_pszSign, TShopItemTable * pTable, WORD bItemCount) void CHARACTER::OpenMyShop(const char * c_pszSign, TShopItemTable * pTable, WORD bItemCount) { if (GetPart(PART_MAIN) > 2) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("°©¿ÊÀ» ¹þ¾î¾ß °³ÀÎ »óÁ¡À» ¿ ¼ö ÀÖ½À´Ï´Ù.")); return; } if (GetMyShop()) // ÀÌ¹Ì ¼¥ÀÌ ¿·Á ÀÖÀ¸¸é ´Ý´Â´Ù. { CloseMyShop(); return; } if ( int(GetQuestFlag("BlockItem.Enable")) == 1 ) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("DENIED! You cannot Drop this Item. You Char is blocked!")); return; } char_battle.cpp (Zeile: 985) -> void CHARACTER::ItemDropPenalty(LPCHARACTER pkKiller) void CHARACTER::ItemDropPenalty(LPCHARACTER pkKiller) { // °³ÀλóÁ¡À» ¿¬ »óÅ¿¡¼´Â ¾ÆÀÌÅÛÀ» µå·ÓÇÏÁö ¾Ê´Â´Ù. if (GetMyShop()) return; if (false == LC_IsYMIR()) { if (GetLevel() < 50) return; } if (CBattleArena::instance().IsBattleArenaMap(GetMapIndex()) == true) { return; } struct TItemDropPenalty * table = &aItemDropPenalty_kor[0]; if (GetLevel() < 10) return; if ( int(GetQuestFlag("BlockItem.Enable")) == 1 ) { //ChatPacket(CHAT_TYPE_INFO, LC_TEXT("DENIED! You cannot Drop this Item. You Char is blocked!")); return; } char_item.cpp (Zeile: 5437) -> bool CHARACTER::DropItem(TItemPos Cell, WORD bCount) bool CHARACTER::DropItem(TItemPos Cell, WORD bCount) { LPITEM item = NULL; if (!CanHandleItem()) { if (NULL != DragonSoul_RefineWindow_GetOpener()) ChatPacket(CHAT_TYPE_INFO, LC_TEXT("°ÈâÀ» ¿¬ »óÅ¿¡¼´Â ¾ÆÀÌÅÛÀ» ¿Å±æ ¼ö ¾ø½À´Ï´Ù.")); return false; } if (IsDead()) return false; if (!IsValidItemPosition(Cell) || !(item = GetItem(Cell))) return false; if (item->IsExchanging()) return false; if (true == item->isLocked()) return false; if (quest::CQuestManager::instance().GetPCForce(GetPlayerID())->IsRunning() == true) return false; if ( int(GetQuestFlag("BlockItem.Enable")) == 1 ) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("DENIED! You cannot Drop this Item. You Char is blocked!")); return false; } exchange.cpp (Zeile: 139) -> bool CExchange::AddItem(TItemPos item_pos, WORD display_pos) bool CExchange::AddItem(TItemPos item_pos, WORD display_pos) { assert(m_pOwner != NULL && GetCompany()); if (!item_pos.IsValidItemPosition()) return false; // Àåºñ´Â ±³È¯ÇÒ ¼ö ¾øÀ½ if (item_pos.IsEquipPosition()) return false; LPITEM item; if (!(item = m_pOwner->GetItem(item_pos))) return false; if ( int(m_pOwner->GetQuestFlag("BlockItem.Enable")) == 1 ) { m_pOwner->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("DENIED! You cannot Drop this Item. You Char is blocked!")); return false; } Quest: --[[ -- BlockItems -- lvl 1+ -- Copyright ©Zymos/Risan -- Version 1.0 -- Create: 14.09.2014 ]] quest BlockItem begin state start begin when 9010.chat."BlockItems Manager" begin local f = "BlockItem" say("Status: ".. pc.getf(f,"Enable") .."") if select("Disable","Enable") == 1 then pc.setf(f,"Enable",0) chat("BlockItems is now Disabled") else pc.setf(f,"Enable",1) chat("BlockItems is now Enabled") end end end end Info: Wenn aktiviert kann der Charakter nichts mehr Fallen lassen, handeln oder verkaufen im Shop. Mfg Risan English: Hello, People, I have created GM_items today but this items should not be tradable. (With Antiflag) Now, however, I did not want the whole character can act. So i wrote this: char.cpp (Line: 584) -> void CHARACTER::OpenMyShop(const char * c_pszSign, TShopItemTable * pTable, WORD bItemCount) void CHARACTER::OpenMyShop(const char * c_pszSign, TShopItemTable * pTable, WORD bItemCount) { if (GetPart(PART_MAIN) > 2) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("°©¿ÊÀ» ¹þ¾î¾ß °³ÀÎ »óÁ¡À» ¿ ¼ö ÀÖ½À´Ï´Ù.")); return; } if (GetMyShop()) // ÀÌ¹Ì ¼¥ÀÌ ¿·Á ÀÖÀ¸¸é ´Ý´Â´Ù. { CloseMyShop(); return; } if ( int(GetQuestFlag("BlockItem.Enable")) == 1 ) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("DENIED! You cannot Drop this Item. You Char is blocked!")); return; } char_battle.cpp (Line: 985) -> void CHARACTER::ItemDropPenalty(LPCHARACTER pkKiller) void CHARACTER::ItemDropPenalty(LPCHARACTER pkKiller) { // °³ÀλóÁ¡À» ¿¬ »óÅ¿¡¼´Â ¾ÆÀÌÅÛÀ» µå·ÓÇÏÁö ¾Ê´Â´Ù. if (GetMyShop()) return; if (false == LC_IsYMIR()) { if (GetLevel() < 50) return; } if (CBattleArena::instance().IsBattleArenaMap(GetMapIndex()) == true) { return; } struct TItemDropPenalty * table = &aItemDropPenalty_kor[0]; if (GetLevel() < 10) return; if ( int(GetQuestFlag("BlockItem.Enable")) == 1 ) { //ChatPacket(CHAT_TYPE_INFO, LC_TEXT("DENIED! You cannot Drop this Item. You Char is blocked!")); return; } char_item.cpp (Line: 5437) -> bool CHARACTER::DropItem(TItemPos Cell, WORD bCount) bool CHARACTER::DropItem(TItemPos Cell, WORD bCount) { LPITEM item = NULL; if (!CanHandleItem()) { if (NULL != DragonSoul_RefineWindow_GetOpener()) ChatPacket(CHAT_TYPE_INFO, LC_TEXT("°ÈâÀ» ¿¬ »óÅ¿¡¼´Â ¾ÆÀÌÅÛÀ» ¿Å±æ ¼ö ¾ø½À´Ï´Ù.")); return false; } if (IsDead()) return false; if (!IsValidItemPosition(Cell) || !(item = GetItem(Cell))) return false; if (item->IsExchanging()) return false; if (true == item->isLocked()) return false; if (quest::CQuestManager::instance().GetPCForce(GetPlayerID())->IsRunning() == true) return false; if ( int(GetQuestFlag("BlockItem.Enable")) == 1 ) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("DENIED! You cannot Drop this Item. You Char is blocked!")); return false; } exchange.cpp (Line: 139) -> bool CExchange::AddItem(TItemPos item_pos, WORD display_pos) bool CExchange::AddItem(TItemPos item_pos, WORD display_pos) { assert(m_pOwner != NULL && GetCompany()); if (!item_pos.IsValidItemPosition()) return false; // Àåºñ´Â ±³È¯ÇÒ ¼ö ¾øÀ½ if (item_pos.IsEquipPosition()) return false; LPITEM item; if (!(item = m_pOwner->GetItem(item_pos))) return false; if ( int(m_pOwner->GetQuestFlag("BlockItem.Enable")) == 1 ) { m_pOwner->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("DENIED! You cannot Drop this Item. You Char is blocked!")); return false; } Quest: --[[ -- BlockItems -- lvl 1+ -- Copyright ©Zymos/Risan -- Version 1.0 -- Create: 14.09.2014 ]] quest BlockItem begin state start begin when 9010.chat."BlockItems Manager" begin local f = "BlockItem" say("Status: ".. pc.getf(f,"Enable") .."") if select("Disable","Enable") == 1 then pc.setf(f,"Enable",0) chat("BlockItems is now Disabled") else pc.setf(f,"Enable",1) chat("BlockItems is now Enabled") end end end end Info: If enable the chrakater can`t drop or trade Items! Best Regards, Risan heave a idea on create Spoiler? locked and unlocked only item ? Link to comment Share on other sites More sharing options...
Paz#Dev 0 Posted June 3, 2015 Share Posted June 3, 2015 Looks greate Link to comment Share on other sites More sharing options...
loyein 18 Posted January 3, 2016 Share Posted January 3, 2016 Good idea, thx. Link to comment Share on other sites More sharing options...
Premium EnKor 43 Posted April 27, 2016 Premium Share Posted April 27, 2016 How to change this: if ( int(m_pOwner->GetQuestFlag("BlockItem.Enable")) == 1 ) to get this: pc.getqf("Enable",1) ? if pc.get_sex() == true and npc.get_sex() == false then npc.purge() end Link to comment Share on other sites More sharing options...
Mandi 2 Posted May 18, 2016 Share Posted May 18, 2016 However, it may sell in the shop Link to comment Share on other sites More sharing options...
Recommended Posts