Register for your free account! | Forgot your password?

You last visited: Today at 15:37

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[C++]DevilTower minor bug fix

Discussion on [C++]DevilTower minor bug fix within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old   #1
 
MrLibya's Avatar
 
elite*gold: 30
Join Date: Mar 2012
Posts: 517
Received Thanks: 339
[C++]DevilTower minor bug fix

Hello

It's a minor bug but it's important , when u kill the devil tower boss and get ur reward and try to upgrade ur weapon or anything if u press yes and u haee money less then the cost u will lost the reward .

so here even if u have no money u will not lost the reward

to fix it :
open input_main.cpp
Code:
add : 
#include "refine.h"
// find this
    if (!item)
    {
        ch->ClearRefineMode();
        return;
    }
// a new code block
    const TRefineTable * prt = CRefineManager::instance().GetRefineRecipe(item->GetRefineSet());
    if (!prt)
    {
        ch->ClearRefineMode();
        return;
    }  
now search for : 
if (ch->GetQuestFlag("deviltower_zone.can_refine"))
replace the whole condition with this : 
if (ch->GetQuestFlag("deviltower_zone.can_refine"))
                {
                    if (ch->GetGold() >= prt->cost)
                    {
                        ch->DoRefine(item, true);
                        ch->SetQuestFlag("deviltower_zone.can_refine", 0);
                    }
                    else
                        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("±¹°ي؟، µ·ہج ؛خء·اد°إ³ھ µ·ہ» °،ء®؟أ¼ِ ¾ّ´آ »َب²ہش´د´ظ"));
                }
sry 4 my english
MrLibya is offline  
Thanks
3 Users
Old 03/10/2017, 22:59   #2


 
elite*gold: 1860
Join Date: Jan 2012
Posts: 2,209
Received Thanks: 1,630
Nice thanks for the fix. I still can remember the bug again.
MaxChri is offline  
Old 03/11/2017, 00:53   #3
 
elite*gold: 260
Join Date: Jan 2013
Posts: 178
Received Thanks: 104
well done
PHP Code:
// find this
    
if (!item)
    {
        
ch->ClearRefineMode();
        return;
    }
// a new code block
    
const TRefineTable prt CRefineManager::instance().GetRefineRecipe(item->GetRefineSet());
    if (!
prt)
    {
        
ch->ClearRefineMode();
        return;
    } 
should look like this because it might cause a crash if the proto is null.
Metin2 Team is offline  
Thanks
3 Users
Old 03/11/2017, 09:42   #4
 
MrLibya's Avatar
 
elite*gold: 30
Join Date: Mar 2012
Posts: 517
Received Thanks: 339
Quote:
Originally Posted by Metin2 Team View Post
well done
PHP Code:
// find this
    
if (!item)
    {
        
ch->ClearRefineMode();
        return;
    }
// a new code block
    
const TRefineTable prt CRefineManager::instance().GetRefineRecipe(item->GetRefineSet());
    if (!
prt)
    {
        
ch->ClearRefineMode();
        return;
    } 
should look like this because it might cause a crash if the proto is null.
Oh , thx i will update the topic
MrLibya is offline  
Old 03/11/2017, 11:27   #5
 
EULOG1SON's Avatar
 
elite*gold: 0
Join Date: Jun 2013
Posts: 196
Received Thanks: 50
Find:

Replace it with:
EULOG1SON is offline  
Thanks
1 User
Old 03/11/2017, 16:51   #6
 
Yiv's Avatar
 
elite*gold: 47
Join Date: Feb 2012
Posts: 2,282
Received Thanks: 2,579
You can just check the return value of the DoRefine function:

Replace this:
Code:
if (ch->GetQuestFlag("deviltower_zone.can_refine"))
{
	ch->DoRefine(item, true);
	ch->SetQuestFlag("deviltower_zone.can_refine", 0);
}
with this:
Code:
if (ch->GetQuestFlag("deviltower_zone.can_refine"))
{
	if (ch->DoRefine(item, true))
	{
		ch->SetQuestFlag("deviltower_zone.can_refine", 0);
	}
}
I just did a real quick look but the DoRefine function returns false if the requirements to do the upgrade are not fulfilled by the player so this should be enough.

Regards
Yiv is offline  
Thanks
8 Users
Reply


Similar Threads Similar Threads
Problen with deviltower
01/25/2015 - Metin2 Private Server - 0 Replies
After kill all mobs on second floor deviltower,client close! On tha map all texture of deviltower i see! Where is problem?
[HowTo] Affendungeon + Deviltower Mobs pro Etage bestimmen
07/19/2011 - Metin2 PServer Guides & Strategies - 11 Replies
Hallu, heute möchte ich euch nach diesem Kommentar für die "Anfänger" was pubben ;) Viele von euch wissen das bestimmt schon aber nunja habe in der Sufu auch kein TuT gefunden. So... HowTo Mobs im AD/DT pro Etage bestimmen: 1.) Ihr macht euren Server an. 2.) Geht in Filezilla in den Pfad: "/usr/rain/channel/share_data/data/dungeon&qu ot;
Deviltower Blacksmith?
05/07/2010 - Metin2 Private Server - 4 Replies
how can i make 66 armor > hwang on the devil tower blacksmith? help please



All times are GMT +1. The time now is 15:41.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.