HUGAMES
[C++] Vörös és Kék ital tiltása adott mapindexen - Printable Version

+- HUGAMES (http://hugames.hu)
+-- Forum: Metin2 (http://hugames.hu/forumdisplay.php?fid=1)
+--- Forum: General (http://hugames.hu/forumdisplay.php?fid=2)
+---- Forum: C++ / DIFF / Source (http://hugames.hu/forumdisplay.php?fid=10)
+---- Thread: [C++] Vörös és Kék ital tiltása adott mapindexen (/showthread.php?tid=262)



[C++] Vörös és Kék ital tiltása adott mapindexen - Pisti95 - 05-27-2018

Megírom ezt is, mondjuk nem bonyolult már az Elixírek mintájára beilleszteni a megfelelő kód részletet a case USE_POTION részbe.  Rolleyes


Ezt a részt:
Code:
                    case USE_POTION:
                        if (CArenaManager::instance().IsArenaMap(GetMapIndex()) == true)
                        {
                            if (quest::CQuestManager::instance().GetEventFlag("arena_potion_limit") > 0)
                            {
                                ChatPacket(CHAT_TYPE_INFO, LC_TEXT("´ë·ĂŔ忡Ľ­ »çżëÇĎ˝Ç Ľö ľř˝Ŕ´Ď´Ů."));
                                return false;
                            }
                        
                            switch (item->GetVnum())
                            {
                                case 27001 :
                                case 27002 :
                                case 27003 :
                                case 27004 :
                                case 27005 :
                                case 27006 :
                                    if (quest::CQuestManager::instance().GetEventFlag("arena_potion_limit_count") < 10000)
                                    {
                                        if (m_nPotionLimit <= 0)
                                        {
                                            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»çżë Á¦ÇŃ·®Ŕ» ĂĘ°úÇĎż´˝Ŕ´Ď´Ů."));
                                            return false;
                                        }
                                    }
                                    break;

                                default :
                                    ChatPacket(CHAT_TYPE_INFO, LC_TEXT("´ë·ĂŔ忡Ľ­ »çżëÇĎ˝Ç Ľö ľř˝Ŕ´Ď´Ů."));
                                    return false;
                            }
                        }


Lecseréled erre:

Code:
                    case USE_POTION:
                        if (CArenaManager::instance().IsArenaMap(GetMapIndex()) == true)
                        {
                            if (quest::CQuestManager::instance().GetEventFlag("arena_potion_limit") > 0)
                            {
                                ChatPacket(CHAT_TYPE_INFO, LC_TEXT("´ë·ĂŔ忡Ľ­ »çżëÇĎ˝Ç Ľö ľř˝Ŕ´Ď´Ů."));
                                return false;
                            }
                            
                                    if (GetMapIndex() == 113 || GetMapIndex() == 112) /////elixírek tiltása
                                    { ////OX
                                            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("potik tiltas"));
                                            return false;
                                    }
                                    ////////////////////////////////////////////
                        
                            switch (item->GetVnum())
                            {
                                case 27001 :
                                case 27002 :
                                case 27003 :
                                case 27004 :
                                case 27005 :
                                case 27006 :
                                    if (quest::CQuestManager::instance().GetEventFlag("arena_potion_limit_count") < 10000)
                                    {
                                        if (m_nPotionLimit <= 0)
                                        {
                                            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»çżë Á¦ÇŃ·®Ŕ» ĂĘ°úÇĎż´˝Ŕ´Ď´Ů."));
                                            return false;
                                        }
                                    }
                                    break;

                                default :
                                    ChatPacket(CHAT_TYPE_INFO, LC_TEXT("´ë·ĂŔ忡Ľ­ »çżëÇĎ˝Ç Ľö ľř˝Ŕ´Ď´Ů."));
                                    return false;
                            }
                        }



locale_string.txt:

Code:
"potik tiltasa";
"Az italokat nem használhatod ezen a területen!";


Üdv, Pisti95