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

[PAID JOB] tfs1.2 nostalrius 7.7 dist -stack block walk and -spellLevel

Status
Not open for further replies.

Grinwick

Member
Joined
Aug 30, 2018
Messages
32
Reaction score
7
Greetings,

As noted in title, i'm using the nostalrius 7.7 distribution.

First i would like to disable walking over stacked parcels, i cant manage it by myself since i only have the 'hasHeight' function not the 'getheight' in 'tile.cpp'.
So i'm a bit lost there...
Secondly i would like to have it so buying spells is based on 'Mlvl' instead of 'Level', so far npc's can only call for 'SpellLevel(String)' .

Any help is welcome!

I would like to make clear i am not asking for somebody to do the dirty work, for example, in case all npc need to be edited, i will do that no problemo.
To be frank, i have no preference of how it gets fixed, if it takes you 1 minute or 1 day, the agreed upon price is yours.

Please, feel free to add me on discord Glitch_Benelux#0774

Thanks in Advance!
 
First i would like to disable walking over stacked parcels, i cant manage it by myself since i only have the 'hasHeight' function not the 'getheight' in 'tile.cpp'.
You can just copy the code of hasHeight, make it return height instead of true/false and get rid of those ifs. Like so:
Code:
uint32_t Tile::getHeight() const
{
	uint32_t height = 0;

	if (ground && ground->hasProperty(CONST_PROP_HASHEIGHT)) {
			++height;
	}

	if (const TileItemVector* items = getItemList()) {
		for (const Item* item : *items) {
			if (item->hasProperty(CONST_PROP_HASHEIGHT)) {
				++height;
			}
		}
	}
	return height;
}
 
unfortunately changing getLevel to getMagicLevel has had no effect, not completely sure why.
I've tried adding another case before also but i think i couldnt compile then. because obviously i was doing it wrong.

You can just copy the code of hasHeight, make it return height instead of true/false and get rid of those ifs. Like so:
Code:
uint32_t Tile::getHeight() const
{
    uint32_t height = 0;

    if (ground && ground->hasProperty(CONST_PROP_HASHEIGHT)) {
            ++height;
    }

    if (const TileItemVector* items = getItemList()) {
        for (const Item* item : *items) {
            if (item->hasProperty(CONST_PROP_HASHEIGHT)) {
                ++height;
            }
        }
    }
    return height;
}
i tried this
tried with uint32_t height also..
would your "tile.h" file look different then "uint32_t getHeight() const;" ?

gonna try some things with the suggestions,
Big thanks for the responses guys!
Much appreciated.
 
its comparing level < spelllevel, so do the same here, or create 2 new cases "magicLevel < spellMagicLevel" and edit all npcs
i wish to make 2 new cases and redo all the npc's,
so i compiled with magiclevel and spellmagiclevel but afterwards i cannot get the npc to load when i
change for example this -> "Topic=3,"yes",Level<SpellLevel(String) -> Amount=SpellLevel(String), "You need level %A to learn this spell."
 
check the new link i updated
Unfortunately i cannot get the npc to load in when i try this.


i get the error "unknown value" even though all the other edits compiled fine.
 
Last edited:
works for me, i attached the files incase you misspelled something
444.png
 

Attachments

oh! i tried again only a few mins ago, once i change the line in npc file they dont want to load.

i will download your files and have a look, i'll come back with what i found!


Edit:
-Is your char below lvl 9? else it would be able to buy it..., right?
-Your spells file also seems to use needlearn="0"
-Behaviourdatabase.h/.cpp are identical (notepad ++ compare plugin)
-When i (copy paste) edit npc line to "MagicLevel<SpellMagicLevel(String) -> Amount=SpellMagicLevel(String)" i get error unknown value

will sort it out eventually xD

thanks for the assistance!
 
Last edited:
needlearn is only for being able to use it for free without learning from npc
 
Status
Not open for further replies.
Back
Top