BlockMapExp

06/04/2018 02:52 redbull2905#1
Good evening, I would like to have help I try to block the experiments on the cards at a certain level. Can you tell me if I forget something or do wrong?

[Only registered and activated users can see links. Click Here To Register...]
06/04/2018 03:34 0Lucifer0#2
This is a very strange code >< firstly you forgot a } and secondly your return; everywhere Moreover the 2 nd else if is useless just use the first part with the correct values.
Seems you don’t really understand what you are trying to do.
06/04/2018 04:24 redbull2905#3
I'm not sure to remember "MapLevelNoXp" the normally I did everything well

[Only registered and activated users can see links. Click Here To Register...]
06/04/2018 06:33 0Lucifer0#4
this just prove you don't understand at all what you are doing... At least you don't understand return [Only registered and activated users can see links. Click Here To Register...]
2nd block is useless.
1st block can be merged

return just stop the method...
this is an equivalent of your code
Quote:
public void MapLevelNoExp(ClientSession, int MapId,int Level)
{

}
PS:not exactly equivalent because your code use more CPU than a empty code. But your code do nothing
06/04/2018 10:50 Saber none#5
in a nutshell, normally you use a return to return a certain value or object, moreover you only want to use it if you want to go out of the methode. Btw the data type of your methode is void so you actually dont need to return something.
06/04/2018 11:35 Blowa#6
[Only registered and activated users can see links. Click Here To Register...]

Your code does nothing actually except wasting some CPU cycles. (and fucking naming conventions)

So, to answer your question, your code won't work.

Simply as is :
Quote:
// i don't remind the correct method that is doing the job for xp
public void GetJobLevelXp()

// IsOnNoXpMap should be a method in Map object since your maps contains ITS infos
if (MapInstance.IsOnNoXpMap(session))
{
// not getting xp
return;
}

// add xp here
session.Character.JobXpUp(xp);
06/04/2018 11:54 redbull2905#7
This is the code of zanou I specify
06/04/2018 12:07 0Lucifer0#8
I don’t think this is the code of Zanou or if it is his code you remove most of it. This is a non-sens piece of code. this is what someone who don’t know anything would do. Zanou already added thing to his server so I suppose he know at least how to do a if statement correctly!
06/04/2018 12:14 FI0w#9
I use for this example the Basic OpenNos Source.

First you go to this line:

[Only registered and activated users can see links. Click Here To Register...]


there you add a line over it:

Code:
bool BlockedExpMap(int mapid){
	switch(mapid){
		case 1:
		case 2:
			return true;
		default:
			return false;
	}
}
and under this:
[Only registered and activated users can see links. Click Here To Register...]

Code:
if(BlockedExpMap(Session.CurrentMapInstance.Map.MapId)){
	return;
}
06/04/2018 12:21 Itachi-Senpai#10
Or you just remove the xp on your database for the special monster`s o.o
06/04/2018 12:46 FI0w#11
Quote:
Originally Posted by Itachi-Senpai View Post
Or you just remove the xp on your database for the special monster`s o.o
Tell me why you should do a bullshit Database when you can do it in Source ?
06/04/2018 17:52 Itachi-Senpai#12
Quote:
Originally Posted by xSensitivex View Post
Tell me why you should do a bullshit Database when you can do it in Source ?
Cause something like this appears xD
Quote:
Originally Posted by redbull2905 View Post
Good evening, I would like to have help I try to block the experiments on the cards at a certain level. Can you tell me if I forget something or do wrong?

[Only registered and activated users can see links. Click Here To Register...]
06/04/2018 18:43 redbull2905#13
At worst you can not just get me the code to know that I use opennos-dev de ciapa
06/04/2018 19:18 Zanouu#14
Quote:
Originally Posted by redbull2905 View Post
At worst you can not just get me the code to know that I use opennos-dev de ciapa
They gave him to you several times, furthermore you could avoid adding some shit and saying that his my "code" . Monkey .. :facepalm:

Code:
public void MapLevelNoExp(ClientSession Session, Int MapId, Int Level)
{
if (Session.CurrentMapInstance.Map.MapId == MapId)
{
if (Session.Character.Level <= Level)
{
return;
}
}
}
=> In your GetExp ( GetJExp , etc) Just added

Session.Character.MapLevelNoExp(Session,YOURMAPID, YOURLEVEL); Woaw
06/04/2018 22:20 0Lucifer0#15
Quote:
Originally Posted by Zanouu View Post
They gave him to you several times, furthermore you could avoid adding some shit and saying that his my "code" . Monkey .. :facepalm:

Code:
public void MapLevelNoExp(ClientSession Session, Int MapId, Int Level)
{
if (Session.CurrentMapInstance.Map.MapId == MapId)
{
if (Session.Character.Level <= Level)
{
return;
}
}
}
=> In your GetExp ( GetJExp , etc) Just added

Session.Character.MapLevelNoExp(Session,YOURMAPID, YOURLEVEL); Woaw
This code can’t work and have nothing to do in Character