Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Metin2 > Metin2 Private Server > Metin2 PServer Guides & Strategies
You last visited: Today at 18:11

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

Advertisement



Official Battle Arena Event (No Quest, Game File) Not Completed. Can Be Completed.

Discussion on Official Battle Arena Event (No Quest, Game File) Not Completed. Can Be Completed. within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old   #1
 
-TÜRK-'s Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 328
Received Thanks: 434
Official Battle Arena Event (No Quest, Game File) Not Completed. Can Be Completed.

Hello! Today I will share this system with the comm. Maybe you know it. I know you know it. But not full completed. You can complete this system. I'm sure somebody see this system(Code Stacks.) but passed through. (In pseudocode.) I think this system is very good.

Let's Start! [ANALYSE]

As first we have this quest trigger code;

PHP Code:
int __cdecl quest::ba_start(int a1)
{
  
int v1// eax@1
  
int v2// ecx@1
  
int result// eax@2
  
int v4// edx@4
  
double v5// [sp+10h] [bp-28h]@4
  
int v6// [sp+2Ch] [bp-Ch]@1

  
v6 = *(_DWORD *)_stack_chk_guard__FBSD_1_0;
  
LOBYTE(v1) = lua_isnumber(a11);
  if ( 
v1 )
  {
    
v5 lua_tonumber(a11);
    if ( !
singleton<CBattleArena>::ms_singleton )
      
__assert("instance""../../common/singleton.h"26);
    
CBattleArena::Start(
      
singleton<CBattleArena>::ms_singleton,
      
v4,
      
singleton<CBattleArena>::ms_singleton,
      (
signed int)v5);
  }
  
result 0;
  if ( *(
_DWORD *)_stack_chk_guard__FBSD_1_0 != v6 )
    
__stack_chk_fail(v2, *(_DWORD *)_stack_chk_guard__FBSD_1_0 v6);
  return 
result;

As we can see, this trigger triggering real system. Now let's look to main system:

PHP Code:
signed int __fastcall CBattleArena::Start(int a1int a2int a3int a4)
{
  
signed int result// eax@3
  
int v5// eax@6
  
int v6// ebx@6
  
int v7// edx@6
  
int v8// ecx@6
  
int v9// eax@6
  
int v10// edx@6
  
int v11// ecx@6
  
int v12// eax@6
  
int v13// eax@6
  
int v14// edx@6
  
int v15// ecx@6
  
int v16// eax@6
  
signed int v17// eax@7
  
int v18// edx@8
  
int v19// ecx@8
  
int v20// ebx@8
  
int v21// ebx@9
  
int v22// eax@14
  
int v23// esi@14
  
int v24// edx@16
  
int v25// [sp+10h] [bp-418h]@8
  
int v26// [sp+14h] [bp-414h]@6
  
char v27// [sp+1Ah] [bp-40Eh]@18
  
char v28// [sp+1Bh] [bp-40Dh]@8
  
char arg// [sp+1Ch] [bp-40Ch]@6
  
int v30// [sp+41Ch] [bp-Ch]@1

  
v30 = *(_DWORD *)_stack_chk_guard__FBSD_1_0;
  if ( *(
_DWORD *)(a3 8) || (unsigned int)(a4 1) > )
  {
    
result 0;
  }
  else
  {
    
v5 = *(_DWORD *)&nBATTLE_ARENA_MAP[a4];
    *(
_DWORD *)(a3 16) = a4;
    *(
_DWORD *)(a3 12) = v5;
    
v6 locale_find(a1a4, (int)&g_nation_name[32 * (unsigned __int8)a4]);
    
v9 locale_find(v8v7, (int)&unk_8337EE8);
    
snprintf(&arg0x400u, (const char *)v9v6);
    
BroadcastNotice(&arg);
    
v12 locale_find(v11v10, (int)&unk_8337F14);
    
BroadcastNotice((const char *)v12);
    
v13 AllocEventInfo<SBattleArenaInfo>((int)&v26);
    
v14 v26;
    
v15 v13;
    *(
_DWORD *)(v26 4) = *(_DWORD *)(a3 12);
    
v16 = *(_DWORD *)(a3 16);
    *(
_DWORD *)(v14 8) = 0;
    *(
_DWORD *)(v14 12) = 0;
    *(
_DWORD *)v14 v16;
    if ( 
test_server )
      
v17 60 passes_per_sec;
    else
      
v17 300 passes_per_sec;
    *(
_DWORD *)(a3 4) = event_create_ex((int)battle_arena_eventv15v17);
    
CBattleArena::SetStatus(v19v18a31);
    
v20 = *(_DWORD *)(a3 12);
    
std::string::string(&v25"battle_arena", &v28);
    if ( !
singleton<quest::CQuestManager>::ms_singleton )
      
__assert("instance""../../common/singleton.h"26);
    
quest::CQuestManager::RequestSetEventFlag(singleton<quest::CQuestManager>::ms_singleton, (int)&v25v20);
    
v21 v25 12;
    if ( (
char *)(v25 12) == std::string::_Rep::_S_empty_rep_storage )
      goto 
LABEL_27;
    
v22 _gthread_active;
    
v23 v21 8;
    if ( 
_gthread_active )
    {
      if ( 
pthread_once )
      {
        
pthread_mutex_lock(&__gthread_active_p_void_::__gthread_active_mutex);
        
pthread_once(&__gthread_active_p_void_::__gthread_active_once, (void (*)(void))__gthread_trigger);
        
pthread_mutex_unlock(&__gthread_active_p_void_::__gthread_active_mutex);
      }
      if ( 
_gthread_active )
        
_gthread_active 0;
      
v22 _gthread_active;
    }
    if ( 
v22 )
      
v24 __gnu_cxx::__exchange_and_add(v21 8, -1);
    else
      
v24 = (*(_DWORD *)v23)--;
    if ( 
v24 )
    {
LABEL_27:
      
result 1;
    }
    else
    {
      
std::string::_Rep::_M_destroy(v21, &v27);
      
result 1;
    }
  }
  if ( *(
_DWORD *)_stack_chk_guard__FBSD_1_0 != v30 )
    
__stack_chk_fail(a1, *(_DWORD *)_stack_chk_guard__FBSD_1_0 v30);
  return 
result;

Here we have bool trigger (true,false), it shows to us event status;

PHP Code:
bool __fastcall CBattleArena::IsRunning(int a1int a2int a3)
{
  
bool result// eax@1

  
result = *(_DWORD *)(a3 8) != 0;
  if ( *(
_DWORD *)_stack_chk_guard__FBSD_1_0 != *(_DWORD *)_stack_chk_guard__FBSD_1_0 )
    
__stack_chk_fail(a1, *(_DWORD *)_stack_chk_guard__FBSD_1_0 ^ *(_DWORD *)_stack_chk_guard__FBSD_1_0);
  return 
result;

Battle arena map check; (I will give dif about that, later.)

Map ID's: 190,191,192

PHP Code:
bool __fastcall CBattleArena::IsBattleArenaMap(int a1int a2int a3)
{
  
bool result// eax@3

  
if ( a3 == 190 || a3 == 191 )
    
result 1;
  else
    
result a3 == 192;
  if ( *(
_DWORD *)_stack_chk_guard__FBSD_1_0 != *(_DWORD *)_stack_chk_guard__FBSD_1_0 )
    
__stack_chk_fail(a1, *(_DWORD *)_stack_chk_guard__FBSD_1_0 ^ *(_DWORD *)_stack_chk_guard__FBSD_1_0);
  return 
result;

Event status change (We saw it at real system.);

PHP Code:
int __fastcall CBattleArena::SetStatus(int a1int a2int a3int a4)
{
  
int v4// ST14_4@1
  
int result// eax@1

  
v4 = *(_DWORD *)_stack_chk_guard__FBSD_1_0;
  *(
_DWORD *)(a3 8) = a4;
  
result = *(_DWORD *)_stack_chk_guard__FBSD_1_0 v4;
  if ( *(
_DWORD *)_stack_chk_guard__FBSD_1_0 != v4 )
    
__stack_chk_fail(a1a4);
  return 
result;

It should be calculate trigger for players. I'm not sure.

PHP Code:
int __fastcall CBattleArena::CBattleArena(int a1int a2int a3)
{
  
int v3// eax@1
  
char v4// zf@3
  
int result// eax@3
  
int v6// [sp+20h] [bp-8h]@1

  
v6 = *(_DWORD *)_stack_chk_guard__FBSD_1_0;
  
v3 singleton<CBattleArena>::ms_singleton;
  *(
_DWORD *)a3 137593144;
  if ( 
v3 )
    
__assert("singleton""../../common/singleton.h"13);
  
result = *(_DWORD *)_stack_chk_guard__FBSD_1_0 v6;
  
v4 = *(_DWORD *)_stack_chk_guard__FBSD_1_0 == v6;
  
singleton<CBattleArena>::ms_singleton a3;
  *(
_DWORD *)a3 137593128;
  *(
_DWORD *)(a3 4) = 0;
  *(
_DWORD *)(a3 8) = 0;
  *(
_DWORD *)(a3 12) = 0;
  *(
_DWORD *)(a3 16) = 0;
  *(
_BYTE *)(a3 20) = 0;
  if ( !
v4 )
    
__stack_chk_fail(a1a2);
  return 
result;

I am not sure but, it may be flag...

PHP Code:
int __fastcall _global_constructor_keyed_to_CBattleArena::CBattleArena(int a1int a2)
{
  if ( *(
_DWORD *)_stack_chk_guard__FBSD_1_0 != *(_DWORD *)_stack_chk_guard__FBSD_1_0 )
    
__stack_chk_fail(a1a2);
  return 
__static_initialization_and_destruction_0(165535);

Spawn boss for event.

PHP Code:
int __fastcall CBattleArena::SpawnLastBoss(int a1int a2int a3)
{
  
int v3// ebx@1
  
int result// eax@4
  
int v5// [sp+38h] [bp-10h]@1

  
v5 = *(_DWORD *)_stack_chk_guard__FBSD_1_0;
  
v3 = *(_DWORD *)(a3 12);
  if ( (
unsigned int)(v3 190) <= )
  {
    if ( !
singleton<CHARACTER_MANAGER>::ms_singleton )
      
__assert("instance""../../common/singleton.h"26);
    
CHARACTER_MANAGER::SpawnMob(
      (int)
singleton<CHARACTER_MANAGER>::ms_singleton,
      
8616,
      
v3,
      *(
_DWORD *)&CBattleArena::SpawnLastBoss_void_::position[* (v3 190)],
      *(
_DWORD *)&CBattleArena::SpawnLastBoss_void_::position[* (v3 190) + 4],
      
0,
      
0,
      
0xFFFFFFFFu,
      
1);
  }
  
result = *(_DWORD *)_stack_chk_guard__FBSD_1_0 v5;
  if ( *(
_DWORD *)_stack_chk_guard__FBSD_1_0 != v5 )
    
__stack_chk_fail(a1a2);
  return 
result;

Spawn random stone for event;

PHP Code:
int __fastcall CBattleArena::SpawnRandomStone(int a1int a2int a3)
{
  
int v3// ebx@1
  
int result// eax@1
  
int v5// eax@4
  
int v6// edi@4
  
int v7// esi@4
  
int v8// [sp+30h] [bp-28h]@4
  
int v9// [sp+34h] [bp-24h]@4
  
int v10// [sp+38h] [bp-20h]@4
  
int v11// [sp+48h] [bp-10h]@1

  
v11 = *(_DWORD *)_stack_chk_guard__FBSD_1_0;
  
v3 = *(_DWORD *)(a3 12);
  
result v3 190;
  if ( (
unsigned int)(v3 190) <= )
  {
    
v5 16 result;
    
v6 = *(_DWORD *)&CBattleArena::SpawnRandomStone_void_::region_info[v5];
    
v8 = *(_DWORD *)(v5 137592748);
    
v9 = *(_DWORD *)(v5 137592744);
    
v10 = *(_DWORD *)(v5 137592740);
    
v7 = *(_DWORD *)&CBattleArena::SpawnRandomStone_void_::vnum[number_ex(06, (int)"BattleArena.cpp"299)];
    if ( !
singleton<CHARACTER_MANAGER>::ms_singleton )
      
__assert("instance""../../common/singleton.h"26);
    
result CHARACTER_MANAGER::SpawnMobRange(
               (int)
singleton<CHARACTER_MANAGER>::ms_singleton,
               
v7,
               
v3,
               
v6,
               
v10,
               
v9,
               
v8,
               
0,
               
1,
               
0);
  }
  if ( *(
_DWORD *)_stack_chk_guard__FBSD_1_0 != v11 )
    
__stack_chk_fail(a1, *(_DWORD *)_stack_chk_guard__FBSD_1_0 v11);
  return 
result;

End event.

PHP Code:
int __cdecl CBattleArena::End(int a1)
{
  
int v1// edx@2
  
int v2// ecx@2
  
int v3// ebx@2
  
int result// eax@3
  
int v5// eax@7
  
int v6// esi@7
  
int v7// [sp+14h] [bp-14h]@1
  
char v8// [sp+1Ah] [bp-Eh]@11
  
char v9// [sp+1Bh] [bp-Dh]@1
  
int v10// [sp+1Ch] [bp-Ch]@1

  
v10 = *(_DWORD *)_stack_chk_guard__FBSD_1_0;
  *(
_BYTE *)(a1 20) = 0;
  *(
_DWORD *)(a1 4) = 0;
  *(
_DWORD *)(a1 12) = 0;
  *(
_DWORD *)(a1 16) = 0;
  *(
_DWORD *)(a1 8) = 0;
  
std::string::string(&v7"battle_arena", &v9);
  if ( !
singleton<quest::CQuestManager>::ms_singleton )
    
__assert("instance""../../common/singleton.h"26);
  
quest::CQuestManager::RequestSetEventFlag(singleton<quest::CQuestManager>::ms_singleton, (int)&v70);
  
v3 v7 12;
  if ( (
char *)(v7 12) != std::string::_Rep::_S_empty_rep_storage )
  {
    
v5 _gthread_active;
    
v6 v3 8;
    if ( 
_gthread_active )
    {
      if ( 
pthread_once )
      {
        
pthread_mutex_lock(&__gthread_active_p_void_::__gthread_active_mutex);
        
pthread_once(&__gthread_active_p_void_::__gthread_active_once, (void (*)(void))__gthread_trigger);
        
pthread_mutex_unlock(&__gthread_active_p_void_::__gthread_active_mutex);
      }
      if ( 
_gthread_active )
        
_gthread_active 0;
      
v5 _gthread_active;
    }
    if ( 
v5 )
      
v1 __gnu_cxx::__exchange_and_add(v3 8, -1);
    else
      
v1 = (*(_DWORD *)v6)--;
    if ( 
v1 <= )
      
std::string::_Rep::_M_destroy(v3, &v8);
  }
  
result = *(_DWORD *)_stack_chk_guard__FBSD_1_0 v10;
  if ( *(
_DWORD *)_stack_chk_guard__FBSD_1_0 != v10 )
    
__stack_chk_fail(v2v1);
  return 
result;

Force end event. (Reboot, By Quest etc.)

PHP Code:
int __fastcall CBattleArena::ForceEnd(int a1unsigned int a2int a3)
{
  
int v3// eax@2
  
int v4// eax@4
  
int result// eax@5
  
int v6// [sp+1Ch] [bp-Ch]@4
  
int v7// [sp+20h] [bp-8h]@1

  
v7 = *(_DWORD *)_stack_chk_guard__FBSD_1_0;
  if ( !*(
_BYTE *)(a3 20) )
  {
    
v3 = *(_DWORD *)(a3 4);
    *(
_BYTE *)(a3 20) = 1;
    if ( 
v3 )
      
event_cancel(a1a2, (unsigned int *)(a3 4));
    
v4 AllocEventInfo<SBattleArenaInfo>((int)&v6);
    
a1 v6;
    *(
_DWORD *)(v6 4) = *(_DWORD *)(a3 12);
    
a2 = *(_DWORD *)(a3 16);
    *(
_DWORD *)(a1 8) = 3;
    *(
_DWORD *)a1 a2;
    
event_create_ex((int)battle_arena_eventv4passes_per_sec);
  }
  
result = *(_DWORD *)_stack_chk_guard__FBSD_1_0 v7;
  if ( *(
_DWORD *)_stack_chk_guard__FBSD_1_0 != v7 )
    
__stack_chk_fail(a1a2);
  return 
result;

That's all. You can explain pseudecodo codes. For having idea.

Also you can start event with ba.start(empire id 1,2,3) . For test. (In quest.)

Enjoy! If you have idea please share with us .

1#
-TÜRK- is offline  
Thanks
15 Users
Old 02/05/2013, 20:41   #2
 
[SA]BlooD's Avatar
 
elite*gold: 0
Join Date: Jun 2012
Posts: 293
Received Thanks: 200
Tskr. (Danke)
[SA]BlooD is offline  
Thanks
2 Users
Old 02/05/2013, 21:08   #3
 
Rider4Fame's Avatar
 
elite*gold: 0
Join Date: May 2012
Posts: 296
Received Thanks: 64
sen bunu neye release edtin?
sry, für schlechte türkisch kentnisse, schreibe wenig türkisch obwohl ich selber türke bin.
Kusurabakma ^^.
Rider4Fame is offline  
Old 02/05/2013, 21:20   #4
 
-TÜRK-'s Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 328
Received Thanks: 434
Quote:
Originally Posted by Rider4Fame View Post
sen bunu neye release edtin?
sry, für schlechte türkisch kentnisse, schreibe wenig türkisch obwohl ich selber türke bin.
Kusurabakma ^^.
It's a official pvp-pve war. You can start trying this with this function ba.start(1) (In quest.) I did'nt try it. You can try it. Map ID's for event: 190,191,192. Good luck. I hope you got a Idea. =)

Es ist ein offizieller pvp-pve war. Sie können versuchen, dies mit dieser Funktion ba.start (1) (Auf der Quest.) I did not try it. You can try it. Ich habe es nicht ausprobiert. Sie können es versuchen. Map-IDs für die Veranstaltung: 190,191,192. Viel Glück. Ich hoffe, Sie haben eine Idee. =)
-TÜRK- is offline  
Old 02/05/2013, 22:15   #5
 
Anohros's Avatar
 
elite*gold: 0
Join Date: Dec 2008
Posts: 288
Received Thanks: 1,170
Hello,

argument of the quest function ba.start(empire) defined the empire.

Code:
enum BATTLEARENA_STATUS
{
	STATUS_CLOSE,
	STATUS_BATTLE,
	STATUS_END
};

class CBattleArena : public singleton<CBattleArena>
{
private:
	int m_pEvent;
	BATTLEARENA_STATUS m_status;
	int m_nMapIndex;
	int m_nEmpire;
	bool m_bForceEnd;
	
public:
	CBattleArena(void);
	static bool IsBattleArenaMap(int nMapIndex);
	bool IsRunning();
	void SetStatus(BATTLEARENA_STATUS status);
	bool Start(int nEmpire);
	void ForceEnd();
	void End();
	void SpawnLastBoss();
	void SpawnRandomStone();
};
With regards,
Anohros
Anohros is offline  
Thanks
2 Users
Old 02/05/2013, 22:20   #6
 
-TÜRK-'s Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 328
Received Thanks: 434
Quote:
Originally Posted by Anohros View Post
Hello,

argument of the quest function ba.start(empire) defined the empire.

Code:
enum BATTLEARENA_STATUS
{
	STATUS_CLOSE,
	STATUS_BATTLE,
	STATUS_END
};

class CBattleArena : public singleton<CBattleArena>
{
private:
	int m_pEvent;
	BATTLEARENA_STATUS m_status;
	int m_nMapIndex;
	int m_nEmpire;
	bool m_bForceEnd;
	
public:
	CBattleArena(void);
	static bool IsBattleArenaMap(int nMapIndex);
	bool IsRunning();
	void SetStatus(BATTLEARENA_STATUS status);
	bool Start(int nEmpire);
	void ForceEnd();
	void End();
	void SpawnLastBoss();
	void SpawnRandomStone();
};
With regards,
Anohros
Hey! Thank you for sharing this with us.
-TÜRK- is offline  
Old 02/05/2013, 22:52   #7
 
Anohros's Avatar
 
elite*gold: 0
Join Date: Dec 2008
Posts: 288
Received Thanks: 1,170
Hey,

Code:
long int battle_arena_event(EVENT *event)
{
  SBattleArenaInfo info; // esi@1
  int result; // eax@3
  int v5; // edx@8
  int v6; // ecx@8
  int v7; // eax@9
  char v8; // sf@9
  int v9; // edx@14
  int v10; // ecx@14
  int v11; // ebx@14
  int v12; // eax@14
  int v13; // ebx@14
  int v14; // eax@14
  int v15; // edx@18
  int v16; // ecx@18
  int v17; // ebx@18
  int v18; // eax@19
  int v19; // ebx@20
  char *v20; // ebx@23
  int v21; // eax@24
  int v22; // esi@24
  int v23; // edx@26
  int v24; // ebx@29
  int v25; // eax@29
  int v26; // edx@29
  int v27; // ecx@29
  int v28; // ebx@29
  int v29; // eax@29
  int v30; // edx@29
  int v31; // ecx@29
  int v32; // edx@29
  int v33; // ecx@29
  int v34; // eax@33
  char v35; // sf@33
  int v36; // ebx@34
  int v37; // eax@35
  int v38; // edx@35
  int v39; // eax@36
  int v40; // eax@38
  int v41; // eax@41
  int v42; // ebx@43
  int v43; // eax@43
  int v44; // ebx@44
  int v45; // esi@44
  int v46; // eax@44
  int v47; // edx@44
  int v48; // ecx@44
  unsigned __int8 v49; // al@47
  int v50; // edi@47
  __int64 v51; // ST04_8@49
  int v52; // ebx@57
  int v53; // eax@57
  int v54; // edx@57
  int v55; // ecx@57
  int v56; // ebx@57
  int v57; // eax@57
  int v58; // edx@57
  int v59; // ecx@57
  int v60; // edx@57
  int v61; // ecx@57
  int v62; // ebx@60
  int v63; // eax@60
  int v64; // edx@60
  int v65; // ebx@60
  int v66; // eax@60
  int v67; // edx@60
  int v68; // edx@60
  int v69; // eax@74
  int v70; // edi@74
  int v71; // [sp+0h] [bp-48h]@34
  int v72; // [sp+8h] [bp-40h]@18
  int v73; // [sp+Ch] [bp-3Ch]@28
  int v74; // [sp+1Ch] [bp-2Ch]@43
  int v75; // [sp+20h] [bp-28h]@47
  int v76; // [sp+24h] [bp-24h]@42
  int v77; // [sp+28h] [bp-20h]@42
  char *arg; // [sp+2Ch] [bp-1Ch]@21
  int v79; // [sp+30h] [bp-18h]@17
  char v80; // [sp+35h] [bp-13h]@28
  char v81; // [sp+36h] [bp-12h]@78
  int v82; // [sp+38h] [bp-10h]@1

  v82 = *(_DWORD *)_stack_chk_guard__FBSD_1_0;
  info = event.info;
  if ( !info || info.state > 7u )
  {
    result = 0;
    goto LABEL_4;
  }
  switch ( info.state )
  {
    case 0:
      info.state = 1;
      v39 = locale_find(a1, a2, (int)&unk_8337D94);
      BroadcastNotice((const char *)v39);
      if ( test_server )
        goto LABEL_13;
      result = 240 * passes_per_sec;
      goto LABEL_4;
    case 1:
      info.state = 2;
      v40 = locale_find(a1, a2, (int)&unk_8337DBC);
      BroadcastNotice((const char *)v40);
      if ( !test_server )
        goto LABEL_13;
      result = 10 * passes_per_sec;
      goto LABEL_4;
    case 2:
      info.state = 3;
      info.wait_count = 0;
      std__string__string(&v79, "battle_arena");
      if ( !singleton_quest__CQuestManager___ms_singleton )
        __assert("instance", "../../common/singleton.h", 26);
      quest__CQuestManager__RequestSetEventFlag(singleton_quest__CQuestManager___ms_singleton, (int)&v79, 0);
      v17 = v79 - 12;
      if ( (char *)(v79 - 12) != std__string___Rep___S_empty_rep_storage )
      {
        v69 = _gthread_active;
        v70 = v17 + 8;
        if ( _gthread_active < 0 )
        {
          if ( pthread_once )
          {
            pthread_mutex_lock(&__gthread_active_p_void_____gthread_active_mutex);
            pthread_once(&__gthread_active_p_void_____gthread_active_once, (void (*)(void))__gthread_trigger);
            pthread_mutex_unlock(&__gthread_active_p_void_____gthread_active_mutex);
          }
          if ( _gthread_active < 0 )
            _gthread_active = 0;
          v69 = _gthread_active;
        }
        if ( v69 )
          v15 = __gnu_cxx____exchange_and_add(v17 + 8, -1, v72, v73);
        else
          v15 = *(_DWORD *)v70--;
        if ( v15 <= 0 )
          std__string___Rep___M_destroy(v17, &v81, v72, v73);
      }
      v18 = locale_find(v16, v15, (int)&unk_8337DE4);
      BroadcastNotice((const char *)v18);
      if ( !singleton_SECTREE_MANAGER___ms_singleton )
        __assert("instance", "../../common/singleton.h", 26);
      v19 = SECTREE_MANAGER__GetMap(singleton_SECTREE_MANAGER___ms_singleton, info.nMapIndex);
      if ( v19 )
      {
        LocaleService_GetMapPath(a1);
        std__string__string(&arg);
        if ( *(_DWORD *)info > 0 )
        {
          std__string__append(&arg, 4 * *(_DWORD *)info + 139212544);
          regen_do(
            info.nMapIndex,
            *(_DWORD *)(v19 + 36),
            arg,
            info.nMapIndex,
            *(_DWORD *)(v19 + 36),
            *(_DWORD *)(v19 + 40),
            0,
            0);
        }
        v20 = arg - 12;
        if ( std__string___Rep___S_empty_rep_storage != arg - 12 )
        {
          v21 = _gthread_active;
          v22 = (int)(v20 + 8);
          if ( _gthread_active < 0 )
          {
            if ( pthread_once )
            {
              pthread_mutex_lock(&__gthread_active_p_void_____gthread_active_mutex);
              pthread_once(&__gthread_active_p_void_____gthread_active_once, (void (*)(void))__gthread_trigger);
              pthread_mutex_unlock(&__gthread_active_p_void_____gthread_active_mutex);
            }
            if ( _gthread_active < 0 )
              _gthread_active = 0;
            v21 = _gthread_active;
          }
          if ( v21 )
            v23 = __gnu_cxx____exchange_and_add(v20 + 8, -1, v72, v73);
          else
            v23 = *(_DWORD *)v22--;
          if ( v23 <= 0 )
            std__string___Rep___M_destroy(v20, &v80, v72, v73);
        }
      }
      goto LABEL_12;
    case 3:
      if ( !singleton_SECTREE_MANAGER___ms_singleton )
        __assert("instance", "../../common/singleton.h", 26);
      if ( SECTREE_MANAGER__GetMonsterCountInMap(singleton_SECTREE_MANAGER___ms_singleton, info.nMapIndex) )
      {
        v34 = info.wait_count + 1;
        v35 = info.wait_count - 3 < 0;
        info.wait_count = v34;
        if ( (unsigned __int8)(v35 ^ __SETO__(v34, 4)) | v34 == 4 )
          goto LABEL_10;
        ++info.state;
        v36 = info.nMapIndex;
        v71 = (int)&unk_8337E30;
      }
      else
      {
        v36 = info.nMapIndex;
        info.state = 6;
        v71 = (int)&unk_8337E0C;
      }
      v37 = locale_find(a1, v5, v71);
      SendNoticeMap(a1, v38, v37, v36, 0);
      goto LABEL_12;
    case 4:
      info.state = 5;
      v24 = info.nMapIndex;
      v25 = locale_find(a1, a2, (int)&unk_8337E54);
      SendNoticeMap(v27, v26, v25, v24, 0);
      v28 = info.nMapIndex;
      v29 = locale_find(v31, v30, (int)"Àá½Ã ÈÄ ¸¶À»·Î µ¹¾Æ°©´Ï´Ù.");
      SendNoticeMap(v33, v32, v29, v28, 0);
      if ( !singleton_SECTREE_MANAGER___ms_singleton )
        __assert("instance", "../../common/singleton.h", 26);
      SECTREE_MANAGER__PurgeMonstersInMap(singleton_SECTREE_MANAGER___ms_singleton, info.nMapIndex);
      result = 30 * passes_per_sec;
      goto LABEL_4;
    case 5:
      if ( !singleton_SECTREE_MANAGER___ms_singleton )
        __assert("instance", "../../common/singleton.h", 26);
      v41 = SECTREE_MANAGER__GetMap(singleton_SECTREE_MANAGER___ms_singleton, info.nMapIndex);
      if ( !v41 || (v76 = v41 + 8, v77 = *(_DWORD *)(v41 + 16), *(_DWORD *)(v41 + 16) == v41 + 8) )
        goto LABEL_53;
      break;
    case 6:
      info.state = 7;
      v11 = info.nMapIndex;
      info.wait_count = 0;
      v12 = locale_find(a1, a2, (int)&unk_8337E78);
      SendNoticeMap(v10, v9, v12, v11, 0);
      v13 = info.nMapIndex;
      v14 = locale_find(v10, v9, (int)&unk_8337E98);
      SendNoticeMap(v10, v9, v14, v13, 0);
      if ( !singleton_CBattleArena___ms_singleton )
        __assert("instance", "../../common/singleton.h", 26);
      CBattleArena__SpawnLastBoss(a1, v9, singleton_CBattleArena___ms_singleton);
      if ( !test_server )
        goto LABEL_16;
      goto LABEL_13;
    case 7:
      if ( !singleton_SECTREE_MANAGER___ms_singleton )
        __assert("instance", "../../common/singleton.h", 26);
      if ( SECTREE_MANAGER__GetMonsterCountInMap(singleton_SECTREE_MANAGER___ms_singleton, info.nMapIndex) )
      {
        v7 = info.wait_count + 1;
        v8 = info.wait_count - 4 < 0;
        info.wait_count = v7;
        if ( (unsigned __int8)(v8 ^ __SETO__(v7, 5)) | v7 == 5 )
        {
LABEL_10:
          if ( !singleton_CBattleArena___ms_singleton )
            __assert("instance", "../../common/singleton.h", 26);
          CBattleArena__SpawnRandomStone(a1, v5, singleton_CBattleArena___ms_singleton);
LABEL_12:
          if ( test_server )
LABEL_13:
            result = 60 * passes_per_sec;
          else
LABEL_16:
            result = 300 * passes_per_sec;
        }
        else
        {
          v52 = info.nMapIndex;
          v53 = locale_find(v6, v5, (int)&unk_8337C3F);
          SendNoticeMap(v55, v54, v53, v52, 0);
          v56 = info.nMapIndex;
          v57 = locale_find(v59, v58, (int)"Àá½Ã ÈÄ ¸¶À»·Î µ¹¾Æ°©´Ï´Ù.");
          SendNoticeMap(v61, v60, v57, v56, 0);
          if ( !singleton_SECTREE_MANAGER___ms_singleton )
            __assert("instance", "../../common/singleton.h", 26);
          SECTREE_MANAGER__PurgeMonstersInMap(singleton_SECTREE_MANAGER___ms_singleton, info.nMapIndex);
          if ( !singleton_SECTREE_MANAGER___ms_singleton )
            __assert("instance", "../../common/singleton.h", 26);
          SECTREE_MANAGER__PurgeStonesInMap(singleton_SECTREE_MANAGER___ms_singleton, info.nMapIndex);
          result = 60 * passes_per_sec;
          info.state = 5;
        }
      }
      else
      {
        v62 = info.nMapIndex;
        v63 = locale_find(a1, v5, (int)&unk_8337EBC);
        SendNoticeMap(a1, v64, v63, v62, 0);
        v65 = info.nMapIndex;
        v66 = locale_find(a1, v67, (int)"Àá½Ã ÈÄ ¸¶À»·Î µ¹¾Æ°©´Ï´Ù.");
        SendNoticeMap(a1, v68, v66, v65, 0);
        result = 60 * passes_per_sec;
        info.state = 5;
      }
      goto LABEL_4;
  }
  do
  {
    v43 = *(_DWORD *)(v77 + 20);
    v42 = *(_DWORD *)(v43 + 16);
    v74 = v43 + 8;
    while ( v42 != v74 )
    {
      v46 = std___Rb_tree_increment(v42);
      v44 = *(_DWORD *)(v42 + 16);
      v45 = v46;
      if ( CEntity__IsType(v48, v47, v44, 0) && *(_DWORD *)(v44 + 36) )
      {
        if ( !test_server && (unsigned __int8)CHARACTER__GetGMLevel(v44) )
        {
          v42 = v45;
          continue;
        }
        v49 = *(_BYTE *)(v44 + 3665);
        v50 = 0;
        v75 = 0;
        if ( (unsigned __int8)(v49 - 1) <= 2u )
        {
          v50 = *(_DWORD *)&g_start_position[8 * v49 + 4];
          v75 = *(_DWORD *)&g_start_position[8 * v49];
        }
        HIDWORD(v51) = v50;
        LODWORD(v51) = v75;
        CHARACTER__WarpSet(v44, v51, *(_DWORD *)&g_start_map[4 * v49]);
      }
      v42 = v45;
    }
    v77 = std___Rb_tree_increment(v77);
  }
  while ( v77 != v76 );
LABEL_53:
  if ( !singleton_CBattleArena___ms_singleton )
    __assert("instance", "../../common/singleton.h", 26);
  CBattleArena__End(singleton_CBattleArena___ms_singleton);
  result = 0;
LABEL_4:
  if ( *(_DWORD *)_stack_chk_guard__FBSD_1_0 != v82 )
    __stack_chk_fail(a1, *(_DWORD *)_stack_chk_guard__FBSD_1_0 ^ v82);
  return result;
}
See:
Code:
struct SBattleArenaInfo
{
    int nEmpire;
    int nMapIndex;
    int state;
    int wait_count;
};

SBattleArenaInfo info;
unsigned int pInfo = AllocEventInfo<SBattleArenaInfo>((int)&info);
info.nEmpire = this->m_nEmpire;
info.nMapIndex = this->m_nMapIndex;
info.state = 0;
info.wait_count = 0;
this->m_pEvent = event_create_ex((long int)&battle_arena_event, pInfo, 300 * passes_per_sec);
So in the switch cases you see the sequence of the event.

With regards,
Anohros
Anohros is offline  
Thanks
1 User
Old 02/05/2013, 23:05   #8
 
-TÜRK-'s Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 328
Received Thanks: 434
Quote:
Originally Posted by Anohros View Post
Hey,

Code:
long int battle_arena_event(EVENT *event)
{
  int v3; // esi@1
  int result; // eax@3
  int v5; // edx@8
  int v6; // ecx@8
  int v7; // eax@9
  char v8; // sf@9
  int v9; // edx@14
  int v10; // ecx@14
  int v11; // ebx@14
  int v12; // eax@14
  int v13; // ebx@14
  int v14; // eax@14
  int v15; // edx@18
  int v16; // ecx@18
  int v17; // ebx@18
  int v18; // eax@19
  int v19; // ebx@20
  char *v20; // ebx@23
  int v21; // eax@24
  int v22; // esi@24
  int v23; // edx@26
  int v24; // ebx@29
  int v25; // eax@29
  int v26; // edx@29
  int v27; // ecx@29
  int v28; // ebx@29
  int v29; // eax@29
  int v30; // edx@29
  int v31; // ecx@29
  int v32; // edx@29
  int v33; // ecx@29
  int v34; // eax@33
  char v35; // sf@33
  int v36; // ebx@34
  int v37; // eax@35
  int v38; // edx@35
  int v39; // eax@36
  int v40; // eax@38
  int v41; // eax@41
  int v42; // ebx@43
  int v43; // eax@43
  int v44; // ebx@44
  int v45; // esi@44
  int v46; // eax@44
  int v47; // edx@44
  int v48; // ecx@44
  unsigned __int8 v49; // al@47
  int v50; // edi@47
  __int64 v51; // ST04_8@49
  int v52; // ebx@57
  int v53; // eax@57
  int v54; // edx@57
  int v55; // ecx@57
  int v56; // ebx@57
  int v57; // eax@57
  int v58; // edx@57
  int v59; // ecx@57
  int v60; // edx@57
  int v61; // ecx@57
  int v62; // ebx@60
  int v63; // eax@60
  int v64; // edx@60
  int v65; // ebx@60
  int v66; // eax@60
  int v67; // edx@60
  int v68; // edx@60
  int v69; // eax@74
  int v70; // edi@74
  int v71; // [sp+0h] [bp-48h]@34
  int v72; // [sp+8h] [bp-40h]@18
  int v73; // [sp+Ch] [bp-3Ch]@28
  int v74; // [sp+1Ch] [bp-2Ch]@43
  int v75; // [sp+20h] [bp-28h]@47
  int v76; // [sp+24h] [bp-24h]@42
  int v77; // [sp+28h] [bp-20h]@42
  char *arg; // [sp+2Ch] [bp-1Ch]@21
  int v79; // [sp+30h] [bp-18h]@17
  char v80; // [sp+35h] [bp-13h]@28
  char v81; // [sp+36h] [bp-12h]@78
  int v82; // [sp+38h] [bp-10h]@1

  v82 = *(_DWORD *)_stack_chk_guard__FBSD_1_0;
  v3 = *(_DWORD *)(a3 + 8);
  if ( !v3 || *(_DWORD *)(v3 + 8) > 7u )
  {
    result = 0;
    goto LABEL_4;
  }
  switch ( *(_DWORD *)(v3 + 8) )
  {
    case 0:
      *(_DWORD *)(v3 + 8) = 1;
      v39 = locale_find(a1, a2, (int)&unk_8337D94);
      BroadcastNotice((const char *)v39);
      if ( test_server )
        goto LABEL_13;
      result = 240 * passes_per_sec;
      goto LABEL_4;
    case 1:
      *(_DWORD *)(v3 + 8) = 2;
      v40 = locale_find(a1, a2, (int)&unk_8337DBC);
      BroadcastNotice((const char *)v40);
      if ( !test_server )
        goto LABEL_13;
      result = 10 * passes_per_sec;
      goto LABEL_4;
    case 2:
      *(_DWORD *)(v3 + 8) = 3;
      *(_DWORD *)(v3 + 12) = 0;
      std__string__string(&v79, "battle_arena");
      if ( !singleton_quest__CQuestManager___ms_singleton )
        __assert("instance", "../../common/singleton.h", 26);
      quest__CQuestManager__RequestSetEventFlag(singleton_quest__CQuestManager___ms_singleton, (int)&v79, 0);
      v17 = v79 - 12;
      if ( (char *)(v79 - 12) != std__string___Rep___S_empty_rep_storage )
      {
        v69 = _gthread_active;
        v70 = v17 + 8;
        if ( _gthread_active < 0 )
        {
          if ( pthread_once )
          {
            pthread_mutex_lock(&__gthread_active_p_void_____gthread_active_mutex);
            pthread_once(&__gthread_active_p_void_____gthread_active_once, (void (*)(void))__gthread_trigger);
            pthread_mutex_unlock(&__gthread_active_p_void_____gthread_active_mutex);
          }
          if ( _gthread_active < 0 )
            _gthread_active = 0;
          v69 = _gthread_active;
        }
        if ( v69 )
          v15 = __gnu_cxx____exchange_and_add(v17 + 8, -1, v72, v73);
        else
          v15 = *(_DWORD *)v70--;
        if ( v15 <= 0 )
          std__string___Rep___M_destroy(v17, &v81, v72, v73);
      }
      v18 = locale_find(v16, v15, (int)&unk_8337DE4);
      BroadcastNotice((const char *)v18);
      if ( !singleton_SECTREE_MANAGER___ms_singleton )
        __assert("instance", "../../common/singleton.h", 26);
      v19 = SECTREE_MANAGER__GetMap(singleton_SECTREE_MANAGER___ms_singleton, *(_DWORD *)(v3 + 4));
      if ( v19 )
      {
        LocaleService_GetMapPath(a1);
        std__string__string(&arg);
        if ( *(_DWORD *)v3 > 0 )
        {
          std__string__append(&arg, 4 * *(_DWORD *)v3 + 139212544);
          regen_do(
            *(_DWORD *)(v3 + 4),
            *(_DWORD *)(v19 + 36),
            arg,
            *(_DWORD *)(v3 + 4),
            *(_DWORD *)(v19 + 36),
            *(_DWORD *)(v19 + 40),
            0,
            0);
        }
        v20 = arg - 12;
        if ( std__string___Rep___S_empty_rep_storage != arg - 12 )
        {
          v21 = _gthread_active;
          v22 = (int)(v20 + 8);
          if ( _gthread_active < 0 )
          {
            if ( pthread_once )
            {
              pthread_mutex_lock(&__gthread_active_p_void_____gthread_active_mutex);
              pthread_once(&__gthread_active_p_void_____gthread_active_once, (void (*)(void))__gthread_trigger);
              pthread_mutex_unlock(&__gthread_active_p_void_____gthread_active_mutex);
            }
            if ( _gthread_active < 0 )
              _gthread_active = 0;
            v21 = _gthread_active;
          }
          if ( v21 )
            v23 = __gnu_cxx____exchange_and_add(v20 + 8, -1, v72, v73);
          else
            v23 = *(_DWORD *)v22--;
          if ( v23 <= 0 )
            std__string___Rep___M_destroy(v20, &v80, v72, v73);
        }
      }
      goto LABEL_12;
    case 3:
      if ( !singleton_SECTREE_MANAGER___ms_singleton )
        __assert("instance", "../../common/singleton.h", 26);
      if ( SECTREE_MANAGER__GetMonsterCountInMap(singleton_SECTREE_MANAGER___ms_singleton, *(_DWORD *)(v3 + 4)) )
      {
        v34 = *(_DWORD *)(v3 + 12) + 1;
        v35 = *(_DWORD *)(v3 + 12) - 3 < 0;
        *(_DWORD *)(v3 + 12) = v34;
        if ( (unsigned __int8)(v35 ^ __SETO__(v34, 4)) | v34 == 4 )
          goto LABEL_10;
        ++*(_DWORD *)(v3 + 8);
        v36 = *(_DWORD *)(v3 + 4);
        v71 = (int)&unk_8337E30;
      }
      else
      {
        v36 = *(_DWORD *)(v3 + 4);
        *(_DWORD *)(v3 + 8) = 6;
        v71 = (int)&unk_8337E0C;
      }
      v37 = locale_find(a1, v5, v71);
      SendNoticeMap(a1, v38, v37, v36, 0);
      goto LABEL_12;
    case 4:
      *(_DWORD *)(v3 + 8) = 5;
      v24 = *(_DWORD *)(v3 + 4);
      v25 = locale_find(a1, a2, (int)&unk_8337E54);
      SendNoticeMap(v27, v26, v25, v24, 0);
      v28 = *(_DWORD *)(v3 + 4);
      v29 = locale_find(v31, v30, (int)"Àá½Ã ÈÄ ¸¶À»·Î µ¹¾Æ°©´Ï´Ù.");
      SendNoticeMap(v33, v32, v29, v28, 0);
      if ( !singleton_SECTREE_MANAGER___ms_singleton )
        __assert("instance", "../../common/singleton.h", 26);
      SECTREE_MANAGER__PurgeMonstersInMap(singleton_SECTREE_MANAGER___ms_singleton, *(_DWORD *)(v3 + 4));
      result = 30 * passes_per_sec;
      goto LABEL_4;
    case 5:
      if ( !singleton_SECTREE_MANAGER___ms_singleton )
        __assert("instance", "../../common/singleton.h", 26);
      v41 = SECTREE_MANAGER__GetMap(singleton_SECTREE_MANAGER___ms_singleton, *(_DWORD *)(v3 + 4));
      if ( !v41 || (v76 = v41 + 8, v77 = *(_DWORD *)(v41 + 16), *(_DWORD *)(v41 + 16) == v41 + 8) )
        goto LABEL_53;
      break;
    case 6:
      *(_DWORD *)(v3 + 8) = 7;
      v11 = *(_DWORD *)(v3 + 4);
      *(_DWORD *)(v3 + 12) = 0;
      v12 = locale_find(a1, a2, (int)&unk_8337E78);
      SendNoticeMap(v10, v9, v12, v11, 0);
      v13 = *(_DWORD *)(v3 + 4);
      v14 = locale_find(v10, v9, (int)&unk_8337E98);
      SendNoticeMap(v10, v9, v14, v13, 0);
      if ( !singleton_CBattleArena___ms_singleton )
        __assert("instance", "../../common/singleton.h", 26);
      CBattleArena__SpawnLastBoss(a1, v9, singleton_CBattleArena___ms_singleton);
      if ( !test_server )
        goto LABEL_16;
      goto LABEL_13;
    case 7:
      if ( !singleton_SECTREE_MANAGER___ms_singleton )
        __assert("instance", "../../common/singleton.h", 26);
      if ( SECTREE_MANAGER__GetMonsterCountInMap(singleton_SECTREE_MANAGER___ms_singleton, *(_DWORD *)(v3 + 4)) )
      {
        v7 = *(_DWORD *)(v3 + 12) + 1;
        v8 = *(_DWORD *)(v3 + 12) - 4 < 0;
        *(_DWORD *)(v3 + 12) = v7;
        if ( (unsigned __int8)(v8 ^ __SETO__(v7, 5)) | v7 == 5 )
        {
LABEL_10:
          if ( !singleton_CBattleArena___ms_singleton )
            __assert("instance", "../../common/singleton.h", 26);
          CBattleArena__SpawnRandomStone(a1, v5, singleton_CBattleArena___ms_singleton);
LABEL_12:
          if ( test_server )
LABEL_13:
            result = 60 * passes_per_sec;
          else
LABEL_16:
            result = 300 * passes_per_sec;
        }
        else
        {
          v52 = *(_DWORD *)(v3 + 4);
          v53 = locale_find(v6, v5, (int)&unk_8337C3F);
          SendNoticeMap(v55, v54, v53, v52, 0);
          v56 = *(_DWORD *)(v3 + 4);
          v57 = locale_find(v59, v58, (int)"Àá½Ã ÈÄ ¸¶À»·Î µ¹¾Æ°©´Ï´Ù.");
          SendNoticeMap(v61, v60, v57, v56, 0);
          if ( !singleton_SECTREE_MANAGER___ms_singleton )
            __assert("instance", "../../common/singleton.h", 26);
          SECTREE_MANAGER__PurgeMonstersInMap(singleton_SECTREE_MANAGER___ms_singleton, *(_DWORD *)(v3 + 4));
          if ( !singleton_SECTREE_MANAGER___ms_singleton )
            __assert("instance", "../../common/singleton.h", 26);
          SECTREE_MANAGER__PurgeStonesInMap(singleton_SECTREE_MANAGER___ms_singleton, *(_DWORD *)(v3 + 4));
          result = 60 * passes_per_sec;
          *(_DWORD *)(v3 + 8) = 5;
        }
      }
      else
      {
        v62 = *(_DWORD *)(v3 + 4);
        v63 = locale_find(a1, v5, (int)&unk_8337EBC);
        SendNoticeMap(a1, v64, v63, v62, 0);
        v65 = *(_DWORD *)(v3 + 4);
        v66 = locale_find(a1, v67, (int)"Àá½Ã ÈÄ ¸¶À»·Î µ¹¾Æ°©´Ï´Ù.");
        SendNoticeMap(a1, v68, v66, v65, 0);
        result = 60 * passes_per_sec;
        *(_DWORD *)(v3 + 8) = 5;
      }
      goto LABEL_4;
  }
  do
  {
    v43 = *(_DWORD *)(v77 + 20);
    v42 = *(_DWORD *)(v43 + 16);
    v74 = v43 + 8;
    while ( v42 != v74 )
    {
      v46 = std___Rb_tree_increment(v42);
      v44 = *(_DWORD *)(v42 + 16);
      v45 = v46;
      if ( CEntity__IsType(v48, v47, v44, 0) && *(_DWORD *)(v44 + 36) )
      {
        if ( !test_server && (unsigned __int8)CHARACTER__GetGMLevel(v44) )
        {
          v42 = v45;
          continue;
        }
        v49 = *(_BYTE *)(v44 + 3665);
        v50 = 0;
        v75 = 0;
        if ( (unsigned __int8)(v49 - 1) <= 2u )
        {
          v50 = *(_DWORD *)&g_start_position[8 * v49 + 4];
          v75 = *(_DWORD *)&g_start_position[8 * v49];
        }
        HIDWORD(v51) = v50;
        LODWORD(v51) = v75;
        CHARACTER__WarpSet(v44, v51, *(_DWORD *)&g_start_map[4 * v49]);
      }
      v42 = v45;
    }
    v77 = std___Rb_tree_increment(v77);
  }
  while ( v77 != v76 );
LABEL_53:
  if ( !singleton_CBattleArena___ms_singleton )
    __assert("instance", "../../common/singleton.h", 26);
  CBattleArena__End(singleton_CBattleArena___ms_singleton);
  result = 0;
LABEL_4:
  if ( *(_DWORD *)_stack_chk_guard__FBSD_1_0 != v82 )
    __stack_chk_fail(a1, *(_DWORD *)_stack_chk_guard__FBSD_1_0 ^ v82);
  return result;
}
See:
Code:
struct SBattleArenaInfo
{
    int nEmpire;
    int nMapIndex;
    int state;
    int wait_count;
};

SBattleArenaInfo info;
unsigned int pInfo = AllocEventInfo<SBattleArenaInfo>((int)&info);
info.nEmpire = this->m_nEmpire;
info.nMapIndex = this->m_nMapIndex;
info.state = 0;
info.wait_count = 0;
this->m_pEvent = event_create_ex((long int)&battle_arena_event, pInfo, 300 * passes_per_sec);
So in the switch cases you see the sequence of the event.

With regards,
Anohros
Ahh, I did'nt see that. Very good job. Also we can see time of sequences and we can change it.

Example:
PHP Code:
    case 0:
      *(
_DWORD *)(v3 8) = 1;
      
v39 locale_find(a1a2, (int)&unk_8337D94);
      
BroadcastNotice((const char *)v39);
      if ( 
test_server )
        goto 
LABEL_13;
      
result 240 passes_per_sec;
      goto 
LABEL_4
240 Seconds for an case.
-TÜRK- is offline  
Old 02/05/2013, 23:58   #9
 
elite*gold: 0
Join Date: May 2009
Posts: 95
Received Thanks: 95
how start battle arena event and show scores?
deco016 is offline  
Old 02/06/2013, 00:13   #10
 
-TÜRK-'s Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 328
Received Thanks: 434
Quote:
Originally Posted by deco016 View Post
how start battle arena event and show scores?
mini example:

PHP Code:
quest asdas begin
    state start begin
        when 9001.chat
."Start War." begin
            ba
.start(1)
            
say("war successfull started.")
        
end
        when kill with pc
.get_map_index() == 190 and npc.is_pc() begin
            old_score 
pc.getqf("score")
            
pc.setqf("score"score")+1
            score = pc.getqf("
score")
            notice_all(""..score.."")
        end
    end
end 
-TÜRK- is offline  
Thanks
1 User
Old 02/06/2013, 01:56   #11

 
elite*gold: 0
Join Date: Jul 2009
Posts: 2,471
Received Thanks: 5,622
Or you just do /weeklyevent <empire here>
It's like Siege War but you have to kill boss monster waves.
.Alpha. is offline  
Thanks
2 Users
Old 02/06/2013, 09:51   #12
 
elite*gold: 0
Join Date: Feb 2013
Posts: 1
Received Thanks: 1
Teşekkürler
orkostr is offline  
Thanks
1 User
Old 02/06/2013, 15:28   #13
 
elite*gold: 0
Join Date: Aug 2010
Posts: 3
Received Thanks: 1
Bu ne işe yarıyor hacı ?
Bozkurt123 is offline  
Old 02/06/2013, 16:40   #14
 
-TÜRK-'s Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 328
Received Thanks: 434
Quote:
Originally Posted by Bozkurt123 View Post
Bu ne işe yarıyor hacı ?
Bi çeşit event, game dosyasının içinde orjinal halde.
-TÜRK- is offline  
Old 02/07/2013, 06:42   #15
 
pirulipipi's Avatar
 
elite*gold: 20
Join Date: Feb 2009
Posts: 45
Received Thanks: 140
Quote:
Originally Posted by -TÜRK- View Post
Bi çeşit event, game dosyasının içinde orjinal halde.
Try activate using command from .Nova, after find NPC 20020 located 2 Village.
He wil ask about one ticket, its Spider Dungeon 2 Ticket, you need one for enter or you cant participate.
All kingdoms have 10 minutes for enter after this NPC will lock entries and all Boss will appear automatically, remember this is a full automatic event, just need fix small minor bugs.
If players defead all monster in 30 Minutes the BIG BIG BIG Boss will appear, now try find who is this mob and what he can do.


Attention:

This event is done three times a day, one by kingdom
Visitors from other kingdoms have penalty of -20% in defense and attack inside enemy kingdom castle.


I Hope this is useful, sometimes people try to change things and not know that can use something already done and funny.
pirulipipi is offline  
Thanks
2 Users
Reply


Similar Threads Similar Threads
Help Diff 6th skill and query file game 2089
10/03/2013 - Metin2 Private Server - 1 Replies
Resolt close thread
Selling Battle.net account with Diablo 3 EU - Game hasn't been completed once!
01/03/2013 - Diablo 3 Trading - 8 Replies
Hello. I'm here to sell my Diablo 3 account. It has no big items, nor a high level char. I'm selling it cheap. $20 is my asking price. I'm willing to go first if you're trusted. If not - we'll use a MM. http://i45.tinypic.com/b9d0j.jpg
Item Drop Event Flags (Game File) / With C++ Codes
05/30/2012 - Metin2 PServer Guides & Strategies - 10 Replies
Event Flag Names: 2006_drop (Vnum: 50037) 2007_drop (Vnum: 50043) newyear_fire (Vnum: 50107) newyear_moon (Vnum: 50016~50017~50018~50019) valentine_drop (Vnum: 50513) drop_moon (Vnum: 50024~50025) whiteday_drop (Vnum: 50031 ~ 50032) kids_day_drop (Vnum: 50034)
[HELP]Flag Event / Battle Arena / Knight Quest
03/17/2012 - SRO Private Server - 2 Replies
Flag Event / Battle Arena / Knight Quest when time's up but dont go automatic to town. Help me pls :( GameServer : 2012-03-09 20:25:00 Async GameWorldQuery failed!!! TYPE RequestorJID 2012-03-09 20:25:00 Async GameWorldQuery failed!!! TYPE RequestorJID 2012-03-09 20:25:00 Async GameWorldQuery failed!!! TYPE RequestorJID 2012-03-09 20:25:00 Async GameWorldQuery failed!!! TYPE RequestorJID 2012-03-09 20:25:00 Async GameWorldQuery failed!!! TYPE RequestorJID
Flag Event -Battle arena
09/27/2011 - SRO Private Server - 10 Replies
Hi guys. What you think ? Flag event or battle arena :) i have tried flag event :) http://img94.imageshack.us/img94/1033/flagm.png



All times are GMT +1. The time now is 18:12.


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