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

Search results

  1. leleco95

    Lua Optimize small code function

    he's iterating on size, not capacity I guess it's because the items are removed, so if you were iterating 0 to last you'd skip some because you're removing them during the walk, as well as the last one's index wouldn't be the same from when you started
  2. leleco95

    Lua Optimize small code function

    yeah I understand, my question was directed at OP also, would it make any difference to do it like this? local amount = 0 for index = corpse:getSize() - 1, 0, -1 do local containerItem = corpse:getItem(index) if containerItem then local itemId = containerItem:getId()...
  3. leleco95

    Lua Optimize small code function

    why do you need to check if it is stackable?
  4. leleco95

    Promotion and database

    I think it's because when a player gets promoted its base vocation doesn't change, what changes is the value of the column promotion, so you'll probably have to check there say a player's vocation is 4 and promotion is 1, that means he's an elite knight check out your db for your example...
  5. leleco95

    Popup information (TFS 1.3, Client 8.6)

    #playerInfo means "size of playerInfo", so when you insert the value in #playerInfo+1 you're appending it as the last (new) entry in the table
  6. leleco95

    TFS 0.X Convert SKILLS/ML when change vocation Dawnport

    you're probably right this happens due to this part of player's addSkillAdvance CreatureEventList advanceEvents = getCreatureEvents(CREATURE_EVENT_ADVANCE); for(CreatureEventList::iterator it = advanceEvents.begin(); it != advanceEvents.end(); ++it) (*it)->executeAdvance(this, skill...
  7. leleco95

    TFS 1.X+ PROBLEM WITH SPELL SCRIPT

    is this the whole script? you're also lacking an end in the end, because you opened a function and an if, but only closed one of them does it not give you an error? the other thing I'd say is does creature exist in this context? I don't see its declaration anywhere. is it a global?
  8. leleco95

    TFS 1.X+ PROBLEM WITH SPELL SCRIPT

    you did an assignment instead of comparison change (line 77) if creature:getStorageValue(94012) = 1 then to if creature:getStorageValue(94012) == 1 then
  9. leleco95

    TFS 1.X+ Problem with promotion npc

    I assume you have the default vocations.xml ids, so knights are 4, elite knights are 8 and seniors would be 12 taking this into consideration, an elite knight would have "vocid" 8 local count = math.floor(vocid / vocationCount) local canPromotion = (count - getPromotion.id) 8 / 4 = 2, so when...
  10. leleco95

    TFS 0.X Convert SKILLS/ML when change vocation Dawnport

    does it happen every time or only the first time you change to each vocation? example: 1 start as knight -> 2 go to sorcerer (lags) -> 3 go to knight (lags) -> 4 go to sorcerer again (does it lag again?) -> 5 go to knight again (does it lag again?) if that's what happens, it's probably due to...
  11. leleco95

    TFS 0.X Convert SKILLS/ML when change vocation Dawnport

    great! so we have progress. shield doesn't work because we put the wrong value, it's SKILL_SHIELD not SKILL_SHIELDING. local skills = { SKILL_FIST, SKILL_CLUB, SKILL_AXE, SKILL_SWORD, SKILL_SHIELD, SKILL_DISTANCE } but no idea what's happening to fist, I'll have to...
  12. leleco95

    TFS 0.X Convert SKILLS/ML when change vocation Dawnport

    I'll try it one last time. local vocation_stats = { [1] = {hp = 5, mp = 30, cap = 10}, [2] = {hp = 5, mp = 30, cap = 10}, [3] = {hp = 10, mp = 15, cap = 20}, [4] = {hp = 15, mp = 5, cap = 25} } local tiles = { --[actionid] = {vocation id} [65530] = { vocid = 1...
  13. leleco95

    Add different rewards with different amount online people

    fix line 42 assigning value instead of comparing if itemstable == nil then
  14. leleco95

    AutoLoot System for tfs 1.x

    did you configure their corpses correctly on items.xml? example: <item id="2806" article="a" name="dead troll"> <attribute key="weight" value="60000" /> <attribute key="containerSize" value="10" /> <attribute key="decayTo" value="2810" /> <attribute key="duration" value="600" />...
  15. leleco95

    C++ Quiver for Nostalrius 7.7

    I can't help you much, only explain some things That's because it doesn't belong there. As you can see, it sends a message saying that "Only ammunition is accepted in that container", so it has something to do with moving items to the quiver. Also, the errors indicate that variables...
  16. leleco95

    TFS 0.X Convert SKILLS/ML when change vocation Dawnport

    can't believe I missed that... you probably have a skill on 10 so no it didn't enter the loop and wasn't initialized fixed that and also noticed I fucked up magic level cus I was replacing instead of adding local vocation_stats = { [1] = {hp = 5, mp = 30, cap = 10}, [2] = {hp = 5, mp =...
  17. leleco95

    TFS 0.X Convert SKILLS/ML when change vocation Dawnport

    I'm back. I checked how it works better and noticed that I had a wrong assumption. Required skill tries actually returns how many tries are needed to advance, not total, so we need to sum all values to know how many skill tries we should give him back. I took itutorial's code as base and added...
  18. leleco95

    TFS 0.X Convert SKILLS/ML when change vocation Dawnport

    let's try calculating stuff then taking formulas from the source code you linked, we have that: skillMap[level] = (uint32_t)(skillBase[skill] * std::pow(skillMultipliers[skill], (level - 11))); is the formula for required skill tries to reach (level) skill skillBase and skillMultipliers are...
  19. leleco95

    TFS 0.X Convert SKILLS/ML when change vocation Dawnport

    hey buddy, I'm not sure if this is it, but judging from previous posts, "skillTries" might have two meanings: 1- getPlayerRequiredSkillTries: defines how many skill tries are needed to reach that skill 2- getPlayerSkillTries: gets how many skill tries the player has (for the current skill)...
  20. leleco95

    TFS 1.3 BUY PASS TO TRAINER

    on trainercheck.lua line 5 you named the variable "specstators" and then on line 9 referenced "spectators" so probably a mistype
Back
Top