• 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!

[Germany] MasterCores.com [7.4/Custom]

Status
Not open for further replies.
hasn't been any crashes in the last hours, its ddos. seems it is much stronger than before and gets through to the game once again. not much you can do
 
Good day.

22:06 New record of players online is: 345

Now fix uh/parcel trap and TibiCam and maybe it'll go to 400-500 then.

Greetings! :)
 
Last edited:
Damn, sick player record. Gz erik and znote

Now gogogo uh/parcel trap and tibicam for serv
 
also is exura sio working through m walls? haven't tested yet. but would be a nice extra thing for me as druid.
 
Enjoy it Znote and Erik ;]
I'll give it for free!

How to fix UH Trap and Parcel Trap:

game.cpp
Code:
Thing* Game::internalGetThing(Player* player, const Position& pos, int32_t index,
	uint32_t spriteId /*= 0*/, stackPosType_t type /*= STACKPOS_NORMAL*/)
{
	if(pos.x != 0xFFFF){
		Tile* tile = getTile(pos.x, pos.y, pos.z);
 
		if(tile){
			/*look at*/
			if(type == STACKPOS_LOOK){
				return tile->getTopThing();
			}
 
			Thing* thing = NULL;
 
			/*for move operations*/
			if(type == STACKPOS_MOVE){
				Item* item = tile->getTopDownItem();
				if(item && !item->isNotMoveable())
					thing = item;
				else
					thing = tile->getTopCreature();
			}
			/*use item*/
			else if(type == STACKPOS_USE){
				thing = tile->getTopDownItem();
			}
			else if(type == STACKPOS_USEITEM){
				 //First check items with topOrder 2 (ladders, signs, splashes)
				Item* item =  tile->getItemByTopOrder(0);
				if(item && g_actions->hasAction(item)){
					thing = item;
				}
				else{
					//then down items
					thing = tile->getTopDownItem();
					if(thing == NULL){
						//then last we check items with topOrder 3 (doors etc)
						thing = tile->getTopTopItem();
					}
				}
			}
			else{
				thing = tile->__getThing(index);
			}
 
			if(player){
				//do extra checks here if the thing is accessable
				if(thing && thing->getItem()){
					if(tile->hasProperty(ISVERTICAL)){
						if(player->getPosition().x + 1 == tile->getPosition().x){
							thing = NULL;
						}
					}
					else if(tile->hasProperty(ISHORIZONTAL)){
						if(player->getPosition().y + 1 == tile->getPosition().y){
							thing = NULL;
						}
					}
				}
			}
 
			return thing;
		}
	}
	else{
		//container
		if(pos.y & 0x40){
			uint8_t fromCid = pos.y & 0x0F;
			uint8_t slot = pos.z;
 
			Container* parentcontainer = player->getContainer(fromCid);
			if(!parentcontainer)
				return NULL;
 
			return parentcontainer->getItem(slot);
		}
		else if(pos.y == 0 && pos.z == 0){
			const ItemType& it = Item::items.getItemIdByClientId(spriteId);
			if(it.id == 0){
				return NULL;
			}
 
			int32_t subType = -1;
			if(it.isFluidContainer()){
				int32_t maxFluidType = sizeof(reverseFluidMap) / sizeof(uint32_t);
				if(index < maxFluidType){
					subType = reverseFluidMap[index];
				}
			}
 
			return findItemOfType(player, it.id, true, subType);
		}
		//inventory
		else{
			slots_t slot = (slots_t)static_cast<unsigned char>(pos.y);
			return player->getInventoryItem(slot);
		}
	}
 
	return NULL;
}

game.cpp
Code:
ReturnValue Game::internalMoveCreature(Creature* creature, Direction direction, uint32_t flags /*= 0*/)
{
	Cylinder* fromTile = creature->getTile();
	Cylinder* toTile = NULL;

	const Position& currentPos = creature->getPosition();
	Position destPos = currentPos;

	bool canChangeFloor = true;
	switch(direction){
		case NORTH:
			destPos.y -= 1;
			break;

		case SOUTH:
			destPos.y += 1;
			break;

		case WEST:
			destPos.x -= 1;
			break;

		case EAST:
			destPos.x += 1;
			break;

		case SOUTHWEST:
			destPos.x -= 1;
			destPos.y += 1;
			canChangeFloor = false;
			break;

		case NORTHWEST:
			destPos.x -= 1;
			destPos.y -= 1;
			canChangeFloor = false;
			break;

		case NORTHEAST:
			destPos.x += 1;
			destPos.y -= 1;
			canChangeFloor = false;
			break;

		case SOUTHEAST:
			destPos.x += 1;
			destPos.y += 1;
			canChangeFloor = false;
			break;
	}

	if(creature->getPlayer() && canChangeFloor){
		//try go up
		if(currentPos.z != 8 && creature->getTile()->hasHeight(3)){
			Tile* tmpTile = map->getTile(currentPos.x, currentPos.y, currentPos.z - 1);
			if(tmpTile == NULL || (tmpTile->ground == NULL && !tmpTile->hasProperty(BLOCKSOLID))){
				tmpTile = map->getTile(destPos.x, destPos.y, destPos.z - 1);
				if(tmpTile && tmpTile->ground && !tmpTile->hasProperty(BLOCKSOLID)){
					flags = flags | FLAG_IGNOREBLOCKITEM | FLAG_IGNOREBLOCKCREATURE;
					destPos.z -= 1;
				}
			}
		}
		else{
			//try go down
			Tile* tmpTile = map->getTile(destPos);
			if(currentPos.z != 7 && (tmpTile == NULL || (tmpTile->ground == NULL && !tmpTile->hasProperty(BLOCKSOLID)))){
				tmpTile = map->getTile(destPos.x, destPos.y, destPos.z + 1);

				if(tmpTile && tmpTile->hasHeight(3)){
					flags = flags | FLAG_IGNOREBLOCKITEM | FLAG_IGNOREBLOCKCREATURE;
					destPos.z += 1;
				}
			}
		}
	}

	toTile = map->getTile(destPos);
	
	Tile* toPos = getTile(destPos.x, destPos.y, destPos.z);
	Tile* fromPos = getTile(currentPos.x, currentPos.y, currentPos.z);
	
	ReturnValue ret = RET_NOTPOSSIBLE;

	if(toTile != NULL){
		if (currentPos.z > destPos.z && toPos->getHeight() > 1);
			// not possible
		else if ((((toPos->getHeight() - fromPos->getHeight()) < 2)) || 
			(fromPos->hasHeight(3) && (currentPos.z == destPos.z)) ||
			((currentPos.z < destPos.z) && (toPos->hasHeight(3) && (fromPos->getHeight() < 2))))
			ret = internalMoveCreature(creature, fromTile, toTile, flags);
	}

	if(ret != RET_NOERROR){
		if(Player* player = creature->getPlayer()){
			player->sendCancelMessage(ret);
			player->sendCancelWalk();
		}
	}

	return ret;
}

Tile.cpp:

Change
Code:
uint32_t Tile::getHeight() const

To this:
Code:
int32_t Tile::getHeight() const

Tile.h:

Change this:
Code:
uint32_t getHeight() const;

To this:
Code:
int32_t getHeight() const;
 
Status
Not open for further replies.

Similar threads

Back
Top