Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Metin2 > Metin2 Private Server
You last visited: Today at 15:03

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

Advertisement



[C++]Hilfe bei d.notice verändern

Discussion on [C++]Hilfe bei d.notice verändern within the Metin2 Private Server forum part of the Metin2 category.

Reply
 
Old   #1
 
Creek''s Avatar
 
elite*gold: 258
Join Date: Dec 2015
Posts: 106
Received Thanks: 127
[C++]Hilfe bei d.notice verändern

Hallo,
Ich wollte die Funktion d.notice verändern und zwar, dass gewisse Leute welche eine Questflag haben eine andere Nachricht kriegen.


dungeon.cpp
Code:
namespace
{
	struct FNotice
	{
		FNotice(const char * psz) : m_psz(psz)
		{
		}

		void operator() (LPENTITY ent)
		{
			if (ent->IsType(ENTITY_CHARACTER))
			{
				LPCHARACTER ch = (LPCHARACTER) ent; //hier
				if(ch->GetQuestFlag("questname.flag") == 1){
					ch->ChatPacket(CHAT_TYPE_NOTICE, "%s TEST1", m_psz);
				}
				else{
					ch->ChatPacket(CHAT_TYPE_NOTICE, "%s TEST2", m_psz);
				}
			}
		}

		const char * m_psz;
	};
}
Nur der Core schmiert dann ab wenn eine Nachricht ausgelöst werden soll.
Creek' is offline  
Old 02/21/2016, 18:46   #2
 
elite*gold: 0
Join Date: Mar 2015
Posts: 49
Received Thanks: 40
Stacktrace könnte helfen
Norri is offline  
Old 02/21/2016, 20:30   #3
 
Creek''s Avatar
 
elite*gold: 258
Join Date: Dec 2015
Posts: 106
Received Thanks: 127
Quote:
Originally Posted by Norri View Post
Stacktrace könnte helfen
Code:
#0  std::_Rb_tree<std::string, std::pair<std::string const, int>, std::_Select1st<std::pair<std::string const, int> >, std::less<std::string>, std::allocator<std::pair<std::string const, int> > >::find (this=0x40, __k=@0xbfbfa7ac)
    at stl_tree.h:495
495           { return static_cast<_Link_type>(this->_M_impl._M_header._M_parent); }
[New Thread 28c05500 (LWP 101028/game)]
[New Thread 28c05200 (LWP 101021/game)]
[New Thread 28c04f00 (LWP 101020/game)]
[New Thread 28c04300 (LWP 100080/game)]
(gdb) bt
#0  std::_Rb_tree<std::string, std::pair<std::string const, int>, std::_Select1st<std::pair<std::string const, int> >, std::less<std::string>, std::allocator<std::pair<std::string const, int> > >::find (this=0x40, __k=@0xbfbfa7ac)
    at stl_tree.h:495
#1  0x081eb4a1 in quest::PC::GetFlag (this=0x0, name=@0xbfbfa7ac)
    at stl_map.h:542
#2  0x0811750b in CDungeon::Notice (this=0x6981fe00,
    msg=0x697f3570 "Du befindest dich am Siegeltor im 3. Stock. Hier")
    at [COLOR="Red"]dungeon.cpp:1098[/COLOR]
#3  0x081a2693 in quest::dungeon_notice (L=0x697df880)
    at questlua_dungeon.cpp:48
#4  0x083e54ba in luaD_precall (L=0x697df880, func=0x6997eb6c) at ldo.c:260
#5  0x083ed286 in luaV_execute (L=0x697df880) at lvm.c:627
#6  0x083e57ad in resume (L=0x697df880, ud=0xbfbfa964) at ldo.c:344
#7  0x083e513b in luaD_rawrunprotected (L=0x697df880, f=0x83e5780 <resume>,
    ud=0xbfbfa964) at ldo.c:88
#8  0x083e52db in lua_resume (L=0x697df880, nargs=0) at ldo.c:371
#9  0x0819fd12 in quest::CQuestManager::RunState (this=0xbfbfe7a0,
    qs=@0x68e958e4) at questlua.cpp:803
#10 0x081d1f3b in quest::CQuestManager::ExecuteQuestScript (pc=@0x69823314,
    quest_name=@0x2a047f14, state=0,
    code=0x2982a000 "if pc . in_dungeon ( ) and pc . get_map_index ( ) >= 660000 and pc . get_map_index ( ) < 670000 then d . setf ( \"level\" , 4 ) \nlocal pos---Type <return> to continue, or q <return> to quit---
itions = deviltower_zone . get_4floor_stone_pos ( ) \nfor i = 1 ,"...,
    code_size=895, pChatScripts=0x0, bUseCache=true) at questmanager.cpp:1599
#11 0x081d25e6 in quest::CQuestManager::ExecuteQuestScript (pc=@0x69823314,
    quest_index=17, state=0,
    code=0x2982a000 "if pc . in_dungeon ( ) and pc . get_map_index ( ) >= 660000 and pc . get_map_index ( ) < 670000 then d . setf ( \"level\" , 4 ) \nlocal positions = deviltower_zone . get_4floor_stone_pos ( ) \nfor i = 1 ,"...,
    code_size=895, pChatScripts=0x0, bUseCache=true) at questmanager.cpp:1545
#12 0x081e5674 in quest::NPC::HandleEvent (this=0x2a3cb114, pc=@0x69823314,
    EventIndex=1) at questnpc.cpp:504
#13 0x081e5aa1 in quest::NPC::OnKill (this=0x2a3cb114, pc=@0x69823314)
    at questnpc.cpp:317
#14 0x081d7343 in quest::CQuestManager::Kill (this=0xbfbfe7a0, pc=57724,
    npc=8016) at questmanager.cpp:437
#15 0x0808fb09 in CHARACTER::Reward (this=0x69543000, bItemDrop=true)
    at char_battle.cpp:788
#16 0x08091000 in CHARACTER::Dead (this=0x69543000, pkKiller=0x697a4000,
    bImmediateDead=false) at char_battle.cpp:1419
#17 0x08091a7b in CHARACTER::Damage (this=0x69543000, pAttacker=0x697a4000,
    dam=818, type=DAMAGE_TYPE_NORMAL) at char_battle.cpp:2179
#18 0x0806283e in battle_hit (pkAttacker=0x697a4000, pkVictim=0x69543000,
    iRetDam=@0xbfbfafe4) at battle.cpp:690
#19 0x08062ac0 in battle_melee_attack (ch=0x697a4000, victim=0x69543000)
    at battle.cpp:165
#20 0x08093cb9 in CHARACTER::Attack (this=0x697a4000, pkVictim=0x69543000,
    bType=0 '\0') at char_battle.cpp:228
#21 0x0814efc4 in CInputMain::Attack (this=0x68ce5c9c, ch=0x697a4000,
    header=2 '\002', data=0x6986c000 "\002") at input_main.cpp:1943
#22 0x08155ec5 in CInputMain::Analyze (this=0x68ce5c9c, d=0x68ce5c00,
    bHeader=<value optimized out>, c_pData=0x6986c000 "\002")
    at input_main.cpp:3391
#23 0x0813d8bb in CInputProcessor::Process (this=0x68ce5c9c,
    lpDesc=0x68ce5c00, c_pvOrig=0x6986c000, iBytes=9,
    r_iBytesProceed=@0xbfbfb564) at input.cpp:103
#24 0x08106753 in DESC::ProcessInput (this=0x68ce5c00) at desc.cpp:313
#25 0x08269ba4 in io_loop (fdw=0x2981a3e0) at main.cpp:1075
#26 0x0826a621 in idle () at main.cpp:952
#27 0x0826bcb6 in main (argc=1, argv=0xbfbfec68) at main.cpp:607
dungeon.cpp:1098
= die Questflag-Abfrage
Creek' is offline  
Old 02/22/2016, 05:51   #4
 
elite*gold: 0
Join Date: Mar 2015
Posts: 49
Received Thanks: 40
ch ist null
Norri is offline  
Thanks
1 User
Old 02/23/2016, 17:59   #5
 
Creek''s Avatar
 
elite*gold: 258
Join Date: Dec 2015
Posts: 106
Received Thanks: 127
Quote:
Originally Posted by Norri View Post
ch ist null
Hab eine Abfrage davor gepackt, aber geht irgendwie trotzdem nicht^^
Könntest du mir vllt den Code bearbeiten?
Creek' is offline  
Old 02/24/2016, 12:14   #6


 
Benhero's Avatar
 
elite*gold: 964
Join Date: Mar 2008
Posts: 2,629
Received Thanks: 1,636
Code:
if (ent != null && ent->IsType(ENTITY_CHARACTER))
{
	LPCHARACTER ch = (LPCHARACTER) ent; //hier
	if(ch->GetQuestFlag("questname.flag") == 1){
		ch->ChatPacket(CHAT_TYPE_NOTICE, "%s TEST1", m_psz);
	}
	else{
		ch->ChatPacket(CHAT_TYPE_NOTICE, "%s TEST2", m_psz);
	}
}
Probierr es mal damit..


Grüße
Benhero is offline  
Thanks
1 User
Old 02/24/2016, 14:19   #7
 
Creek''s Avatar
 
elite*gold: 258
Join Date: Dec 2015
Posts: 106
Received Thanks: 127
Quote:
Originally Posted by Benhero View Post
Code:
if (ent != null && ent->IsType(ENTITY_CHARACTER))
{
	LPCHARACTER ch = (LPCHARACTER) ent; //hier
	if(ch->GetQuestFlag("questname.flag") == 1){
		ch->ChatPacket(CHAT_TYPE_NOTICE, "%s TEST1", m_psz);
	}
	else{
		ch->ChatPacket(CHAT_TYPE_NOTICE, "%s TEST2", m_psz);
	}
}
Probierr es mal damit..


Grüße
Schmiert leider trotzdem ab.

Code:
#0  std::_Rb_tree<std::string, std::pair<std::string const, int>, std::_Select1st<std::pair<std::string const, int> >, std::less<std::string>, std::allocator<std::pair<std::string const, int> > >::find (this=0x40, __k=@0xbfbfa7ac)
    at stl_tree.h:495
#1  0x081eb8b1 in quest::PC::GetFlag (this=0x0, name=@0xbfbfa7ac)
    at stl_map.h:542
#2  0x0811791d in CDungeon::Notice (this=0x75d23100,
    msg=0x75d1ca20 "Du befindest dich am Siegeltor im 3. Stock. Hier")
    at dungeon.cpp:1100
#3  0x081a2aa3 in quest::dungeon_notice (L=0x75d27ac0)
    at questlua_dungeon.cpp:48
#4  0x083e5a9a in luaD_precall (L=0x75d27ac0, func=0x7609886c) at ldo.c:260
#5  0x083ed866 in luaV_execute (L=0x75d27ac0) at lvm.c:627
#6  0x083e5d8d in resume (L=0x75d27ac0, ud=0xbfbfa964) at ldo.c:344
#7  0x083e571b in luaD_rawrunprotected (L=0x75d27ac0, f=0x83e5d60 <resume>,
    ud=0xbfbfa964) at ldo.c:88
#8  0x083e58bb in lua_resume (L=0x75d27ac0, nargs=0) at ldo.c:371
#9  0x081a0122 in quest::CQuestManager::RunState (this=0xbfbfe7a0,
    qs=@0x75596704) at questlua.cpp:803
#10 0x081d234b in quest::CQuestManager::ExecuteQuestScript (pc=@0x75e4b0d4,
    quest_name=@0x2a177714, state=0,
    code=0x2a037400 "if pc . in_dungeon ( ) and pc . get_map_index ( ) >= 660000 and pc . get_map_index ( ) < 670000 then d . setf ( \"level\" , 4 ) \nlocal pos---Type <return> to continue, or q <return> to quit---
itions = deviltower_zone . get_4floor_stone_pos ( ) \nfor i = 1 ,"...,
    code_size=895, pChatScripts=0x0, bUseCache=true) at questmanager.cpp:1599
#11 0x081d29f6 in quest::CQuestManager::ExecuteQuestScript (pc=@0x75e4b0d4,
    quest_index=17, state=0,
    code=0x2a037400 "if pc . in_dungeon ( ) and pc . get_map_index ( ) >= 660000 and pc . get_map_index ( ) < 670000 then d . setf ( \"level\" , 4 ) \nlocal positions = deviltower_zone . get_4floor_stone_pos ( ) \nfor i = 1 ,"...,
    code_size=895, pChatScripts=0x0, bUseCache=true) at questmanager.cpp:1545
#12 0x081e5a84 in quest::NPC::HandleEvent (this=0x295f7b14, pc=@0x75e4b0d4,
    EventIndex=1) at questnpc.cpp:504
#13 0x081e5eb1 in quest::NPC::OnKill (this=0x295f7b14, pc=@0x75e4b0d4)
    at questnpc.cpp:317
#14 0x081d7753 in quest::CQuestManager::Kill (this=0xbfbfe7a0, pc=59288,
    npc=8016) at questmanager.cpp:437
#15 0x0808fb59 in CHARACTER::Reward (this=0x76010000, bItemDrop=true)
    at char_battle.cpp:788
#16 0x08091050 in CHARACTER::Dead (this=0x76010000, pkKiller=0x75d78000,
    bImmediateDead=false) at char_battle.cpp:1419
#17 0x08091acb in CHARACTER::Damage (this=0x76010000, pAttacker=0x75d78000,
    dam=541, type=DAMAGE_TYPE_NORMAL) at char_battle.cpp:2179
#18 0x0806285e in battle_hit (pkAttacker=0x75d78000, pkVictim=0x76010000,
    iRetDam=@0xbfbfafe4) at battle.cpp:690
#19 0x08062ae0 in battle_melee_attack (ch=0x75d78000, victim=0x76010000)
---Type <return> to continue, or q <return> to quit---
    at battle.cpp:165
#20 0x08093d09 in CHARACTER::Attack (this=0x75d78000, pkVictim=0x76010000,
    bType=0 '\0') at char_battle.cpp:228
#21 0x0814f3c4 in CInputMain::Attack (this=0x7567349c, ch=0x75d78000,
    header=2 '\002', data=0x75715000 "\002") at input_main.cpp:1943
#22 0x081562c5 in CInputMain::Analyze (this=0x7567349c, d=0x75673400,
    bHeader=<value optimized out>, c_pData=0x75715000 "\002")
    at input_main.cpp:3391

#23 0x0813dcab in CInputProcessor::Process (this=0x7567349c,
    lpDesc=0x75673400, c_pvOrig=0x75715000, iBytes=9,
    r_iBytesProceed=@0xbfbfb564) at input.cpp:103
#24 0x08106b13 in DESC::ProcessInput (this=0x75673400) at desc.cpp:313
#25 0x0826a184 in io_loop (fdw=0x2978b540) at main.cpp:1075
#26 0x0826ac01 in idle () at main.cpp:952
#27 0x0826c296 in main (argc=1, argv=0xbfbfec68) at main.cpp:607
Creek' is offline  
Old 02/26/2016, 08:53   #8
 
elite*gold: 0
Join Date: Jan 2014
Posts: 268
Received Thanks: 373
Erst will er Stacktrace und dann guckt er nicht drauf
Der Core stürzt bei PC::GetFlag ab -> wird von ch->GetQuestFlag gecallt. Du überprüfst nicht ob ch ein PC ist und GetQuestFlag auf Monster / NPCs auszuführen ist tödlich
ch kann gar nicht null sein, da ent ja vorher schon benutzt wird, dann würde er da abschmieren (und ent == ch ist).
Einfach nur mal Fehlermeldung angucken

Kind Regards....
Lefloyd is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
<hilfe> Bei img klick eine andere Bildposition verändern </hilfe>
01/30/2015 - Web Development - 6 Replies
Guten Abend, ich habe eine Seite erstellt, aus der man aus mehreren bildern eins anklicken soll und nach dem Anklicken soll sich bei einem anderen Bild die background-position ändern. Da hänge ich irgendwie... Habt ihr ne' Idee?
[Frage/Hilfe] Reichsrüssi verändern Hilfe bitte :S
10/01/2011 - Metin2 Private Server - 1 Replies
So hey Leute, hab ne Frage als ich hab die Reichsrüssi von dem Theard hier http://www.elitepvpers.com/forum/metin2-pserver-gu ides-strategies/540312-release-reichs-kingr-ssi.ht ml Und meine Frage lautet wie folgt: wie heißt die Rüssi datei in dem Source ordner also eben bei Fr, weil ja zb der ssp heißt 4_1 usw und wollt fragen ob wer weiß wie die reichsrüssi heißt, würd gern die farbe etc verändern und sie auch bissl chrome dazufügen ^^ Würd mich auf ne schnelle und positive Antowrt...
[HILFE] NPC Chat verändern
08/17/2011 - Metin2 Private Server - 0 Replies
NPC Chat verändern Hallo zusammen! Ich will den Text, die meine NPCs auf MAP1 die sie von sich geben verändern, laut wenigen Threads kann man dies in der Germany/quests/locale_lua machen! Laut igorglock gibt es aber auch einen einfacheren Weg, allerdings hab ich mit der Sufu nix gefunden! Nur der Richtigkeit halber, das ich in den Quests den Text ändern kann was die NPC sagen wenn man sie anklickt weiß ich und ist ja einfach.
*Notice*Warning Password stealing site*Notice*
12/28/2009 - World of Warcraft - 0 Replies
Notice is as follows, do not enter this site, if you get a notice in your email like this for gawd sakes dont give anyone your password Subject:World of Warcraft Account Trade Dispute Notice When we carry out a routine check when the account, we have evidence to show that your account has been involved in the disputed transactions. So we have to inform you visit our website(worldofwarcraft*com]fill out some information to facilitate our investigation. If you can not tie in with our soon...



All times are GMT +2. The time now is 15:03.


Powered by vBulletin®
Copyright ©2000 - 2024, 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 ©2024 elitepvpers All Rights Reserved.