gudan garam's best answers

  • gudan garam

    sql query, problem

    DELETE players FROM players INNER JOIN accounts ON accounts.id = players.account_id WHERE players.id = :playerid AND accounts.password = :password I think this should work.
  • gudan garam

    Lua Simple and Advanced quest help

    Always use the code highlight when posting code: I don't manage maps but as far as I know it works like this: Action Id 2000 for a chest, unique id will be the storage used to keep track of which chests the player has already opened. So if you set two different chests to the unique id 1001...
  • gudan garam

    First server/map quest - please help!

    The object containing the reward to your quest can be done through an action, you can use already done actions as example, they are inside the data/actions folder. The npc you can easily see how other NPCs were made and will understand how it works with keywords and the phrases it can say randomly.
  • gudan garam

    Help with a script

    If statements follow an order. You need to change the order to do checks that will prevent the fixed conditions, like being vocation id 4, so you have to check that first. What you are doing right now is basically checking if the player knows the spell and teaching him the spell, before...
  • gudan garam

    custom items.otb

    otland/forgottenserver From line 287 to 295 there are version checks being made, I think you are fine commenting just the last one though, on line 292. But, if the problem you are having is a crash and not one of thoose errors on the lines I showed you, than that wouldn't be engouh I think...
  • gudan garam

    C++ using getStorageValue in source code

    Hey, I know you've already solved your problem, I just wanted to tell you that it would probably be a better idea if, instead of a storage, you created a boolean attribute on the player and set that to true or false. I'm telling you tbis because storages are better used (or even designed) when...
  • gudan garam

    Player Loot Rate

    Since I have not worked with older tfs versions for a while, I don't have the tools set up to compile and test it, so I'd assume you will get compile errors, if you do, let me know. As you can see, I'm not very good at styiling my posts, so take care when following the steps to minimize the...
  • gudan garam

    TFS 1.X+ quests.xml |STATE|

    It would be easier for you to set the storage (19008 in this case) to 0 when the player requests the task to the NPC, and change the startvalue to 1. It is counting when its 0 because the startvalue is 0 and when the player kills the first monster, he probably had that storagevalue set to -1...
  • gudan garam

    Need % hp/mn command

    Change lines 2885 and 2886 (protocolgame.cpp): otland/forgottenserver from: msg.add<uint16_t>(std::min<int32_t>(player->getHealth(), std::numeric_limits<uint16_t>::max())); msg.add<uint16_t>(std::min<int32_t>(player->getMaxHealth(), std::numeric_limits<uint16_t>::max())); to: if...
  • gudan garam

    TFS 1.X+ I have weird Health/Mana bug with transforms

    I'm sorry, I forgot. You must add the declartion of thoose methods: luascript.h below: static int luaPlayerAddManaSpent(lua_State* L); add: static int luaPlayerGetBaseMaxHealth(lua_State* L); static int luaPlayerGetBaseMaxMana(lua_State* L); My bad on that.
  • gudan garam

    Lua Parameter CreateItem

    There are spells can conjure items in newer version, i.e. diamond arrows and they will disappear after 1 hour but thats a decay attribute on the item itself, not that the spell will take care of that. All of the field runes (firebomb, energybomb, etc) work like that, the only thing you need to...
  • gudan garam

    Change Level to Experience

    This should work fine. void ProtocolGame::AddPlayerStats(NetworkMessage* msg) { msg->AddByte(0xA0); msg->AddU16(player->getHealth()); msg->AddU16(player->getPlayerInfo(PLAYERINFO_MAXHEALTH)); msg->AddU16((int32_t)player->getFreeCapacity()); if (player->getLevel() >= 0xFFFF)...
  • gudan garam

    Lua EXP potion should effect 2 hours, but its over so fast

    as @miszczbobek said, the script seems fine. I made some changes to it and will give you a check on your login.lua so that if the player gets offline during the timout ot the exp bonus he will lose it when he logs in. function ExpBackNormal_EndVoucher(cid, bonus) local rates =...
Top