Risolto Problema anello anti-exp

Stato
Discussione chiusa ad ulteriori risposte.

ScrikersTV

Utente Electrum
5 Gennaio 2018
274
23
43
104
Ciao ragazzi, piccolo problema. sto testando lo script dell'anello anti-exp, ma sia attivandolo che disattivandolo ricevo cmq exp.
Come posso risolvere in modo che attivanto anello NON ricevo piu exp^ grazie.
Ecco lo script

Codice:
quest AntiExpRing begin
	state start begin
		when 90014.use begin
			if pc.getqf("inel_anti_exp") == 0 then
				syschat("Anti Exp - Attivato.")
				
				pc.setqf("inel_anti_exp", 1);
				pc.block_exp();
			else
				syschat("Anti Exp - Disattivato.")
				
				pc.setqf("inel_anti_exp", 0);
				pc.unblock_exp();
			end
		end
		
		when login begin
			if pc.getqf("inel_anti_exp") == 1 then
				syschat("L'anello anti-exp è attivato.")
				
				pc.block_exp();
			else
				syschat("L'anello anti-exp è disattivato.")
				
				pc.unblock_exp();
			end
		end
	end
end
 
Ciao ragazzi, piccolo problema. sto testando lo script dell'anello anti-exp, ma sia attivandolo che disattivandolo ricevo cmq exp.
Come posso risolvere in modo che attivanto anello NON ricevo piu exp^ grazie.
Ecco lo script

Codice:
quest AntiExpRing begin
    state start begin
        when 90014.use begin
            if pc.getqf("inel_anti_exp") == 0 then
                syschat("Anti Exp - Attivato.")
               
                pc.setqf("inel_anti_exp", 1);
                pc.block_exp();
            else
                syschat("Anti Exp - Disattivato.")
               
                pc.setqf("inel_anti_exp", 0);
                pc.unblock_exp();
            end
        end
       
        when login begin
            if pc.getqf("inel_anti_exp") == 1 then
                syschat("L'anello anti-exp è attivato.")
               
                pc.block_exp();
            else
                syschat("L'anello anti-exp è disattivato.")
               
                pc.unblock_exp();
            end
        end
    end
end

Perchè utilizza la funzione pc.block_exp() e molto probabilmente non hai questa funziona implementata
Qua trovi tutte le risposte che ti servono https://www.inforge.net/forum/threads/codice-anello-anti-exp.562218/
 
si ho provato anche quella quest, ma nulla..cioè funziona ma quando vado a disattivare l'anello anti exp mi sale al 38.52% e poi non sale piu, mentre attivando l'anello mi si azzera continuamente
Da quello che leggo molto probabilmente come ti è stato detto non è presente nel codice sorgente la funzione block_exp()
Per risolvere tale problema aggiungi il seguente codice al tuo codice sorgente:

Codice:
File Char.h
Cerca:
```
SetExp(DWORD exp)
```

Aggiungi:

```
bool            block_exp;
```

----------------------------------------------------------

File Char.cpp
Cerca:
```
case POINT_EXP:
{
```

Aggiungi:

```
if (block_exp)
    {
        return;
    }
```

----------------------------------------------------------

File questlua_pc.cpp
Cerca:
```
void RegisterPCFunctionTable()
```
Aggiungi PRIMA:

```
int32_t _block_exp(lua_State* L)
{
    LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
    ch->block_exp = true;
    return 0;
}
int32_t _unblock_exp(lua_State* L)
{
    LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
    ch->block_exp = false;
    return 0;
}
```

SEMPRE NELLO STESSO FILE, ALLA FINE PRIMA DI:
```
{NULL, NULL}
```

Aggiungi:
{ "block_exp", _block_exp },
            
{ "unblock_exp", _unblock_exp },


----------------------------------------------------------

File input_login.cpp
Cerca:
```
if (g_noticeBattleZone)
```

Aggiungi DOPO TUTTO L'IF:

```
ch->block_exp = false;
```

----------------------------------------------------------

File guild.cpp
Cerca:
```
bool CGuild::OfferExp(
```

Aggiungi:

```
if (block_exp)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You have your experience locked, please unlock it"));
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("to can give EXP to you're guild."));
        return;
    }
```

----------------------------------------------------------

File winscp directory/ quest_functions
Aggiungi:
```
pc.block_exp
pc.unblock_exp
```

----------------------------------------------------------

Quest:

quest AntiExpRing begin
    state start begin
        when 90014.use begin
            if pc.getqf("inel_anti_exp") == 0 then
                syschat("Anti Exp - Attivato.")
                
                pc.setqf("inel_anti_exp", 1);
                pc.block_exp();
            else
                syschat("Anti Exp - Disattivato.")
                
                pc.setqf("inel_anti_exp", 0);
                pc.unblock_exp();
            end
        end
        
        when login begin
            if pc.getqf("inel_anti_exp") == 1 then
                syschat("L'anello anti-exp è attivato.")
                
                pc.block_exp();
            else
                syschat("L'anello anti-exp è disattivato.")
                
                pc.unblock_exp();
            end
        end
    end
end
 
  • Mi piace
Reazioni: isPsycho
Da quello che leggo molto probabilmente come ti è stato detto non è presente nel codice sorgente la funzione block_exp()
Per risolvere tale problema aggiungi il seguente codice al tuo codice sorgente:

Codice:
File Char.h
Cerca:
```
SetExp(DWORD exp)
```

Aggiungi:

```
bool            block_exp;
```

----------------------------------------------------------

File Char.cpp
Cerca:
```
case POINT_EXP:
{
```

Aggiungi:

```
if (block_exp)
    {
        return;
    }
```

----------------------------------------------------------

File questlua_pc.cpp
Cerca:
```
void RegisterPCFunctionTable()
```
Aggiungi PRIMA:

```
int32_t _block_exp(lua_State* L)
{
    LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
    ch->block_exp = true;
    return 0;
}
int32_t _unblock_exp(lua_State* L)
{
    LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
    ch->block_exp = false;
    return 0;
}
```

SEMPRE NELLO STESSO FILE, ALLA FINE PRIMA DI:
```
{NULL, NULL}
```

Aggiungi:
{ "block_exp", _block_exp },
            
{ "unblock_exp", _unblock_exp },


----------------------------------------------------------

File input_login.cpp
Cerca:
```
if (g_noticeBattleZone)
```

Aggiungi DOPO TUTTO L'IF:

```
ch->block_exp = false;
```

----------------------------------------------------------

File guild.cpp
Cerca:
```
bool CGuild::OfferExp(
```

Aggiungi:

```
if (block_exp)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You have your experience locked, please unlock it"));
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("to can give EXP to you're guild."));
        return;
    }
```

----------------------------------------------------------

File winscp directory/ quest_functions
Aggiungi:
```
pc.block_exp
pc.unblock_exp
```

----------------------------------------------------------

Quest:

quest AntiExpRing begin
    state start begin
        when 90014.use begin
            if pc.getqf("inel_anti_exp") == 0 then
                syschat("Anti Exp - Attivato.")
                
                pc.setqf("inel_anti_exp", 1);
                pc.block_exp();
            else
                syschat("Anti Exp - Disattivato.")
                
                pc.setqf("inel_anti_exp", 0);
                pc.unblock_exp();
            end
        end
        
        when login begin
            if pc.getqf("inel_anti_exp") == 1 then
                syschat("L'anello anti-exp è attivato.")
                
                pc.block_exp();
            else
                syschat("L'anello anti-exp è disattivato.")
                
                pc.unblock_exp();
            end
        end
    end
end
Grazie ho risolto :)
 
Stato
Discussione chiusa ad ulteriori risposte.