• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Max experience - 2,147,483,647

Lukanio

### Own3D ###
Joined
Nov 25, 2008
Messages
325
Reaction score
6
Mam problem poniewaz jezeli ustawie wiecej niz experience="2,147,483,647" w data/monster jakiemus potworowi to gracz dostaje 0 expa. I mam pytanie jak mozna to zwiekszyc?
W C++ pisze ze to problem z Clientem, ale jezeli u mnie na servie jest exp x100 albo exp x10 to i tak jezeli przekrocze "2,147,483,647" gracz dostaje 0 expa , a tak to dostaje w zaleznosci od mnoznika albo exp x100 , albo x10

Prosze o pomoc.

Jestem w stanie zaplacic za POMOC!

~~PILNE~~
 
unit64_t @ monsters.cpp , nie pamiętam już. Przypomnę sobie jak zapłacisz coś :p
 
Zrób sobie system rebornów.
 
@Ralcoral
Mi nie chodzi o reborna, bo mam go... Mi chodzi o exp z potworow o ograniczenie!
 
Moje nie doczytanie, ale to wolno zrobić coś w stylu bonus doświadczenia. Czyli, gdy ktoś zabije danego potwora to mu dodaje za niego dodatkowe doświadczenie. Tutaj przykład na szybko, nie testowane:
Lua:
monsters = 
{
	-- ["nazwa potwora"] = ilosc doswiadczenia
	["Dragon"] = 10000
}

function onKill(cid, target)
	local experience = monsters[getCreatureName(target)]
	if (isnumber(experience))
		doPlayerAddExperience(cid, experience)
	end
	return true
end
 
A co z Stage Exp?

Nie da sie tego jakos ogarnac w C++ ? Zeby to normalnie zrobic?
 
A co z Stage Exp?

Nie da sie tego jakos ogarnac w C++ ? Zeby to normalnie zrobic?
Da się, ja dałem tylko wersje dla opornych. Co do rates, to wszystko wolno pobrać funkcjami, ale jeśli ciebie interesuje C++ to zastosuj się do rady Samme, który parę postów wyżej napisał co zrobić. Plus do tego, przy pobieraniu danych w XML też raczej trzeba zmienić typ zmiennej.
 
A co z Stage Exp?

Nie da sie tego jakos ogarnac w C++ ? Zeby to normalnie zrobic?

No przecież w LUA możesz pobrać aktualny stage gracza.

Lua:
doPlayerAddExperience(cid, experience * getExperienceStage(getPlayerLevel(cid))

Tylko musisz to zrobić w onDeath przy pomocy deathList, bo jak kilka graczy zabije danego potworka to musi podzielić exp przez graczy w deathList.
 
Nie sprawdzałem za długo ale samo odczytywanie z monsters expa jest ograniczone do int32_t
Code:
	if(readXMLInteger(root, "experience", intValue))
		mType->experience = intValue;
w tools.cpp
Code:
bool readXMLInteger(xmlNodePtr node, const char* tag, int32_t& value)
{
	char* nodeValue = (char*)xmlGetProp(node, (xmlChar*)tag);
	if(!nodeValue)
		return false;

	value = atoi(nodeValue);
	xmlFree(nodeValue);
	return true;
}
bool readXMLInteger64(xmlNodePtr node, const char* tag, int64_t& value)
{
	char* nodeValue = (char*)xmlGetProp(node, (xmlChar*)tag);
	if(!nodeValue)
		return false;

	value = atoll(nodeValue);
	xmlFree(nodeValue);
	return true;
}

Zamien to pierwsze w monsters.cpp z readXMLInteger na readXMLInteger64, ale nie daje głowy czy potem double gainexp nie ograniczy w player.cpp.
 
taki blad mi wyskakuje podczas kompilacji:

Code:
monsters.cpp: In member function 'bool Monsters::loadMonster(const std::string&, const std::string&, bool)':
monsters.cpp:959: error: invalid initialization of reference of type 'int64_t&' from expression of type 'int32_t'
tools.h:70: error: in passing argument 3 of 'bool readXMLInteger64(xmlNode*, const char*, int64_t&)'
 
A no nie zauważyłem że intValue jest tam jako int32_t, zamień całe
Code:
	if(readXMLInteger(root, "experience", intValue))
		mType->experience = intValue;
Na
Code:
        int64_t expValue;
	if(readXMLInteger64(root, "experience", expValue))
		mType->experience = expValue;
 
Back
Top Bottom