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

Nostalrius 7.7

By edit, I mean adding an elf outfit, for example. If the source needs to be edited, which file should I look for?
i dont get it...
elf outfit like - custom
or as monster look like?

if monster - you edit that in database - looktype
elf - 62
elf arcanist - 63
elf scout - 64
 
Exactly, but I still haven't found a way to do that.
All of the bank code is on a single file: gen-bank.ndb
hey bro you found how to make it work for all except the bank?
Post automatically merged:

The problem itself it's the dialog, you can't check for currency when you talk to npc like that:
hhUTngc.png

The only workaround I can imagine is to use something different on bank npc than %1:
Code:
Topic=91,%1,0<%1 -> Amount=%1*100, Price=%1, "So I should change %A of your gold coins to %P platinum coins for you?", Topic=96
But I'm stucked now.
this one i meant
 
hey bro you found how to make it work for all except the bank?
Post automatically merged:


this one i meant
You have to rise amount on cpp file, and compile again. I donr remember now, but look in whole project for "500"
 
You have to rise amount on cpp file, and compile again. I donr remember now, but look in whole project for "500"

Yes I know where to change it, but how to change it work only for cash in banks and not for every other things?
 
There is none on the vanilla engine, but should be fairly easy to do by editing script from other project.
 
Great distro, trying to get the bank system to work, even though it wasn't implented until 7.9. Depositing and withdrawing works but the transfer function does not. There are several functions which needs to be implented in behaviourdatabase.cpp/.h for it to work.

GetString, Guid, PlayerExists, FullDigit and Transfer

Found the FullDigit from Retricaria but they didn't have the rest either. Trying to figure out how to make it work, but as a novice it's hard. I've made quite the mess but give me a couple of years and I've got it working.

Example code from gen-bank.ndb, which won't work since these functions don't exist:

Code:
FullDigit,%1,0<%1,Topic=205 -> Amount=%1, "So you would like to transfer %A gold coins to whom?", Topic=206
FullDigit,"transfer",%1,0<%1 -> *
GetString,Topic=206,Guid=PlayerExists -> "You cannot transfer gold to yourself."
GetString,Topic=206,PlayerExists=0 -> "A player with this name does not exist."
GetString,Topic=206,PlayerExists>=1 -> "So you would like me to transfer %A gold coins to %S, is this correct?", Topic=207
Topic=207 -> "Maybe some other time."

"yes",Topic=207,Balance>=Amount -> "You have transferred %A gold coins to %S.", Transfer(Amount)
 
Last edited:
COMBAT_PARAM_DISPEL
Anyone out there having a problem with Exana pox? When walking 100% it doesn't remove the poison, and when stopped it has a small chance of failing.
Post automatically merged:

By edit, I mean adding an elf outfit, for example. If the source needs to be edited, which file should I look for?
Outfit color elf is id 144 and dwarf is 160
 
Last edited:
COMBAT_PARAM_DISPEL
Anyone out there having a problem with Exana pox? When walking 100% it doesn't remove the poison, and when stopped it has a small chance of failing.
Post automatically merged:


Outfit color elf is id 144 and dwarf is 160

Add
Lua:
creature:removeCondition(CONDITION_POISON)

To
Lua:
function onCastSpell(creature, variant)
for antidote spell and rune
 
Please, refrain from making multiple words inside the same inverted commas, rather use: "bring","me","to","thais" instead, another detail, make sure to set Price inside the conditions instead of the actions, the CountMoney function is not going to check any money because the variable is not assigned prior to this function call.



You can use the function

Ruby:
CreateContainer(CONTAINER_ID, ITEM_ID, DATA)

Just place it along side the actions within the NPC behavior structure, example:

Ruby:
"backpack" -> CreateContainer(1988,2006,10), "Here you are!"
How do i get the npc to charge me 3 items in the quality of each one? example:
Npc: I will give you 1 steel helmet if you bring me 10 meats, 5 hams and 2 bottles of milk.


Oh, sorry, reversing my doubt here, i found out.

C++:
Topic=2,"yes", Count(1231)>=10, Count(1232)>=7, Count(1233)>=2 -> "Here. I hope that's it now.", Amount=10, Delete(1231), Amount=7, Delete(1232), Amount=2, Delete(1234), Type=3370, Amount=1, Create(Type)
 
testing it.. very nice project!
i will try drowngrade it for 7.4..
i will need to remove selling wands, rods and runes from npcs, cast spells souls and levels,.. anything else?
 
C++:

Replace with something like
C++:

I think you will need to do this in sources.

Specifically, look for
C++:
bool ConjureSpell::conjureItem(Creature* creature) const

Under
C++:
bool foundReagent = false;

Remove
C++:
        Item* item = player->getInventoryItem(CONST_SLOT_LEFT);
        if (item && item->getID() == reagentId) {
            foundReagent = true;

            // left arm conjure
            int32_t index = player->getThingIndex(item);
            g_game.internalRemoveItem(item);

            Item* newItem = Item::CreateItem(conjureId, conjureCount);
            if (!newItem) {
                return false;
            }

            ReturnValue ret = g_game.internalAddItem(player, newItem, index);
            if (ret != RETURNVALUE_NOERROR) {
                delete newItem;
                return false;
            }

            g_game.startDecay(newItem);

            Spell::postCastSpell(player, conjureCost, soulCost);
        }

        item = player->getInventoryItem(CONST_SLOT_RIGHT);
        if (item && item->getID() == reagentId && player->getMana() >= conjureCost) {
            foundReagent = true;

            // right arm conjure
            int32_t index = player->getThingIndex(item);
            g_game.internalRemoveItem(item);

            Item* newItem = Item::CreateItem(conjureId, conjureCount);
            if (!newItem) {
                return false;
            }

            ReturnValue ret = g_game.internalAddItem(player, newItem, index);
            if (ret != RETURNVALUE_NOERROR) {
                delete newItem;
                return false;
            }

            g_game.startDecay(newItem);

            Spell::postCastSpell(player, conjureCost, soulCost);
        }


Replace with something like
C++:
        int32_t itemCount = player->getItemTypeCount(reagentId);
        int32_t subdata = -1;
        uint32_t conjureItem = conjureId;
        uint32_t newCount = conjureCount;
        if (itemCount && itemCount >= 1 && player->getMana() >= conjureCost) {
            foundReagent = true;

            if (player->removeItemOfType(reagentId, 1, subdata)) {            
                Item* newItem = Item::CreateItem(conjureItem, newCount);

                if (!newItem) {
                    return false;
                }
             
                ReturnValue ret = g_game.internalPlayerAddItem(player, newItem);
                if (ret != RETURNVALUE_NOERROR) {
                    delete newItem;
                    return false;
                }

                g_game.startDecay(newItem);

                Spell::postCastSpell(player, conjureCost, soulCost);
            }
        }


Probably don't need to to do the new conjure count part, this is just my code, but ive ripped out some custom changes for prem players conjuring more charges. I'm just too tired atm to clean this up any further.
it didnt work for me :/
with it nor puting in the hand.
help? how do rune without put it on hands
 
Does anyone know how to fix that?
Open iologindata.cpp, and the function to save player, you have to cast sex as an actual sex.
C++:
// Load player function
player->setSex(static_cast<PlayerSex_t>(result->getNumber<uint16_t>("sex")));

// Save player function
query << "`sex` = " << static_cast<uint16_t>(player->sex) << ',';
 
Back
Top