• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Penetration by players

SpecyficznyP

New Member
Joined
Aug 27, 2017
Messages
6
Reaction score
0
Hi, I from Poland and sorry for my English.
I'm looking for a script where I could set the penetration of players in the city on the rookgard.
Possibly some tips on how I could do it.
 
Hi, I'm from Poland too.
Tips for you, as you wish:
- I do not care if you're from Poland.
- Take your time to check where you should ask about something.
- To set the penetration of players in the city on the rookgard:

When your server is running, loading monsters, pvp-arenas etc. (probably otserv.cpp) add:
C++:
int minX = fromWhereCityStartsX;
int maxX = endOfCityX;

int minY = fromWhereCityStartsY;
int maxY = endOfCityY;

int minZ = fromWhereCityStartsZ;
int maxZ = endOfCityZ;

for(int x = minX; x < maxX; x++){
    for(int y = minY; i < maxY; y++){
        for(int z = minZ; i < maxZ; z++){
            Tile* tile = getTile(x, y, z);
            if(tile)
                tile->setCity(1);//TODO: Tile function setCity with int attribute (city number) to set tile as a city-tile.
        }
    }
}

Now in some doAttack function or something like that (as an owner of your server I'm almost sure you will find the function) you have to add:
C++:
Tile* tile = getTile(player->position);
if(tile){
    if(tile->getCity == 1)//TODO: Tile function getCity to find out if it's the city.
        damage/2;
}

And that's all.
 
Back
Top