Jump to content
Close

kobrapl

Member
  • Content Count

    9
  • Joined

  • Last visited

  1. As the title, player do dmg to other players by ue without pk turned on, but only with ue, to use normal spells/atk players he need to turn on pk so whats the reason that ue makes the dmg? Is it fault of spell? Here's example of one ue spell: local combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -125.0, 0, -150.0, 0) local combat2 = createCombatObject() setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat2, COMBAT_PARAM_EFFECT, 5) local combat3 = createCombatObject() setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat3, COMBAT_PARAM_EFFECT, 5) arr1 = { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 1, 1, 2, 1, 1, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, } arr2 = { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, } arr3 = { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 2, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, } local area1 = createCombatArea(arr1) local area2 = createCombatArea(arr2) local area3 = createCombatArea(arr3) setCombatArea(combat1, area1) setCombatArea(combat2, area2) setCombatArea(combat3, area3) local function onCastSpell1(parameters) doCombat(parameters.cid, parameters.combat1, parameters.var) end local function onCastSpell2(parameters) doCombat(parameters.cid, parameters.combat2, parameters.var) end local function onCastSpell3(parameters) doCombat(parameters.cid, parameters.combat3, parameters.var) end function onCastSpell(cid, var) local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3 } addEvent(onCastSpell1, 0, parameters) addEvent(onCastSpell2, 0, parameters) addEvent(onCastSpell3, 150, parameters) return true end[/CODE] But i dont see here nothing wrong? Do i need to add any script that gonna want PK on to do dmg on players? Or maybe something at source? oh i forgot : tibia 8,6 tfs 0.4 rev 3777 Looks like its fault of that combat area cuz even whis staff makes dmg to player so whats wrong here ;x Same, kame/flash blabla also do dmg to player w/o pk turned on ;x dunno what is going on, and yea ofc it generate skull after that but why it does dmg w/o pk turned on thats the prob Maybe is it fault that worldtype = "open" ? so like pvp enforced? I found this at source:[code] if(worldType == "open" || worldType == "2" || worldType == "openpvp") { g_game.setWorldType(WORLDTYPE_OPEN); std::clog << "Open PvP" << std::endl; } else if(worldType == "optional" || worldType == "1" || worldType == "optionalpvp") { g_game.setWorldType(WORLDTYPE_OPTIONAL); std::clog << "Optional PvP" << std::endl; But then if i set to optional then even if i turn PK on on char, cant attack 2nd char Or maybe its possible with one of those errors? Those are warnings while i compile source: Well problem is i got pretty much of those warnings cuz i been trying to change skills etc and thats why im asking cuz my skills grows so fast even with config script for them+they have no limit ;/ one guy have 300+ fishing (energy def at my ots/ while i had it on windows it been fine, but now while using vps and compiled for linux thats happend ;x) Okay so i post all i have of them for now: luascript.h: In file included from baseevents.h:22:0, from actions.h:20, from actions.cpp:20: luascript.h: In member function ‘virtual bool Action::executeUse(Player*, Item*, const PositionEx&, const PositionEx&, bool, uint32_t)’: luascript.h:277:106: warning: ‘<anonymous>.PositionEx::stackpos’ may be used uninitialized in this function [-Wmaybe-uninitialized] L, const PositionEx& position) {pushPosition(L, position, position.stackpos);} [/CODE] As i guess its about push, works but dunno can it cause any bug? game.cpp: [CODE]game.cpp: In member function ‘bool Game::combatChangeHealth(CombatType_t, Creature*, Creature*, int64_t, MagicEffect_t, Color_t, bool)’: game.cpp:4431:39: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘int64_t {aka long int}’ [-Wformat=] sprintf(buffer, "+%d", healthChange); ^ game.cpp:4456:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (random_range(1, 500) <= critx) //use that random function if it works for you, but I used to always use the uniform_random(int,int) func on tfs ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ game.cpp:4483:38: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘int64_t {aka long int}’ [-Wformat=] sprintf(buffer, "%d", manaDamage); ^ game.cpp:4664:34: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘int64_t {aka long int}’ [-Wformat=] sprintf(buffer, "%d", damage); ^ game.cpp: In member function ‘bool Game::combatChangeMana(Creature*, Creature*, int64_t)’: game.cpp:4697:37: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘int64_t {aka long int}’ [-Wformat=] sprintf(buffer, "+%d", manaChange); ^ game.cpp:4735:34: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘int64_t {aka long int}’ [-Wformat=] sprintf(buffer, "%d", manaLoss); ^ game.cpp: In constructor ‘Game::Game()’: game.cpp:80:24: warning: iteration 2 invokes undefined behavior [-Waggressive-loop-optimizations] globalSaveMessage[i] = false; ~~~~~~~~~~~~~~~~~~~~~^~~~~~~ game.cpp:79:23: note: within this loop for(int32_t i = 0; i < 3; i++) ~~^~~ In file included from game.cpp:18:0: game.h: In member function ‘void Game::globalSave()’: game.h:615:78: warning: iteration 2 invokes undefined behavior [-Waggressive-loop-optimizations] setGlobalSaveMessage(int16_t key, bool value) {globalSaveMessage[key] = value;} ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ game.cpp:6384:23: note: within this loop for(int16_t i = 0; i < 3; i++) ~~^~~ [/CODE] Most of them are int64 not 32, cuz of hp/mp% but the other? Ah and critical skill there too item.cpp: [CODE]item.cpp: In member function ‘virtual Attr_ReadValue Item::readAttr(AttrTypes_t, PropStream&)’: item.cpp:649:10: warning: this statement may fall through [-Wimplicit-fallthrough=] break; ^ item.cpp:652:3: note: here default: ^~~~~~~[/CODE] No idea manager.cpp: [CODE] manager.cpp: In member function ‘virtual void ProtocolManager::parsePacket(NetworkMessage&)’: manager.cpp:254:4: warning: this statement may fall through [-Wimplicit-fallthrough=] } ^ manager.cpp:257:3: note: here case MP_MSG_CHAT_REQUEST: ^~~~ [/CODE] Same here... monster.cpp: [CODE] monster.cpp: In member function ‘bool Monster::isFriend(const Creature*)’: monster.cpp:315:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if(creature->getPlayer() && !targetPlayers) ^~ monster.cpp:318:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ if(!isSummon() || !master->getPlayer()) ^~ [/CODE] delete if? player.cpp: [CODE] player.cpp: In member function ‘int32_t Player::getWeaponSkill(const Item*) const’: player.cpp:400:60: warning: left operand of comma operator has no effect [-Wunused-value] return getSkill(SKILL_SWORD, SKILL_LEVEL) && (SKILL_AXE,SKILL_LEVEL); ^~~~~~~~~~~ player.cpp:406:60: warning: left operand of comma operator has no effect [-Wunused-value] return getSkill(SKILL_AXE, SKILL_LEVEL) && (SKILL_SWORD,SKILL_LEVEL); ^~~~~~~~~~~ player.cpp:409:60: warning: left operand of comma operator has no effect [-Wunused-value] return getSkill(SKILL_AXE, SKILL_LEVEL) && (SKILL_SWORD,SKILL_LEVEL); ^~~~~~~~~~~ player.cpp: In member function ‘virtual void Player::drainHealth(Creature*, CombatType_t, int64_t)’: player.cpp:1870:143: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘int64_t {aka long int}’ [-Wformat=] s.", damage, (damage != 1 ? "s" : ""), attacker->getNameDescription().c_str()); ^ player.cpp:1872:80: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘int64_t {aka long int}’ [-Wformat=] sprintf(buffer, "You lose %lld hitpoint%s.", damage, (damage != 1 ? "s" : "")); ^ player.cpp: In member function ‘virtual void Player::drainMana(Creature*, CombatType_t, int64_t)’: player.cpp:1883:111: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘int64_t {aka long int}’ [-Wformat=] na blocking an attack by %s.", damage, attacker->getNameDescription().c_str()); ^ player.cpp:1885:46: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘int64_t {aka long int}’ [-Wformat=] sprintf(buffer, "You lose %d mana.", damage); ^ player.cpp: In member function ‘virtual void Player::onAttackedCreatureDrain(Creature*, int64_t)’: player.cpp:3858:93: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘int64_t {aka long int}’ [-Wformat=] , "You deal %lld damage to %s.", points, target->getNameDescription().c_str()); ^ player.cpp: In member function ‘virtual void Player::onSummonAttackedCreatureDrain(Creature*, Creature*, int64_t)’: player.cpp:3867:124: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘int64_t {aka long int}’ [-Wformat=] %s.", summon->getName().c_str(), points, target->getNameDescription().c_str()); ^ player.cpp: In member function ‘ItemVector Player::getWeapons() const’: player.cpp:345:5: warning: this statement may fall through [-Wimplicit-fallthrough=] if(item->getAmmoType() != AMMO_NONE) ^~ player.cpp:348:4: note: here case WEAPON_SWORD: ^~~~ player.cpp: In member function ‘void Player::manageAccount(const string&)’: player.cpp:4870:20: warning: iteration 11 invokes undefined behavior [-Waggressive-loop-optimizations] talkState[i] = false; ~~~~~~~~~~~~~^~~~~~~ player.cpp:4869:26: note: within this loop for(int8_t i = 2; i <= 14; i++) ~~^~~~~ [/CODE] As i said few of them are here cuz i changed skills from fist etc to crit blabla, and made to advance 2 skills from 1 weap protocolgame.cpp: [CODE] protocolgame.cpp: In member function ‘void ProtocolGame::sendMagicEffect(const Position&, uint8_t)’: protocolgame.cpp:2260:10: warning: comparison is always false due to limited range of data type [-Wtype-limits] if(type > MAGIC_EFFECT_LAST || !canSee(pos)) ~~~~~^~~~~~~~~~~~~~~~~~~ protocolgame.cpp: In member function ‘void ProtocolGame::AddCreatureSpeak(NetworkMessage_ptr, const Creature*, SpeakClasses, std::__cxx11::string, uint16_t, uint32_t, Position*, ProtocolGame*)’: protocolgame.cpp:2978:158: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] CustomFlag(PlayerCustomFlag_HideLevel) && (pg == NULL || pg != NULL && !pg->getIsCast())) ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ [/CODE] weapons.cpp: [CODE] weapons.cpp: In member function ‘bool Weapons::loadDefaults()’: weapons.cpp:85:6: warning: this statement may fall through [-Wimplicit-fallthrough=] if(it->ammoType != AMMO_NONE) ^~ weapons.cpp:88:5: note: here case WEAPON_AMMO: ^~~~[/CODE]
  2. As the title says, im looking for script that will add me "fishing tries" when i get hit by magic, I already done that fishing is absorb etc, but have no idea from what to start here (useless to do fishing to get higher absorb XD). What function it shall be im pretty fresh but i think it shall be StatsChange or On attack and made by monster function but not sure what to start from and how it should look. Any help/ideas/guide?In short i want to get fishing skill incerase if i get hitd by magicTFS 0,4 rev 3777 Edited source and ofc fishing=abosrb and it absorbs magic (ENERGY) dmg w/o any problem, but the problem is to get fishing skill after i got hit by magic :D
  3. As i cant find solution of a problem i have that monsters / npc stands always face to north so i had idea to do the tile that switch their lookdir but i need some help how to do it / edit im fresh in making ots so any help will be awesome; P But all my tries ends in errors at console; x No idea shall it be aid or uid? Maybe thats what im doing wrong; / Found that getPlayerLookDir = getCreatureLookDirection getPlayerLookDirection = getCreatureLookDirection doCreatureSetLookDir = doCreatureSetLookDirection getPlayerLookPos = getCreatureLookPosition getPosByDir = getPositionByDirection And thats my trying to make it work: local dirs = {"south", "east", "north", "west"} local tile.actionid = {2501, 2502, 2503, 2504} local nextDir = dirs[i + 1] function onStepIn (cid, creature, direction, aid) if tile.actionid == 2501 and if(creature:isNPC)|| if(creature:isMonster) then getPosByDir == "north" then doCreatureSetLookDirection == "south" return true end and other try: function getPositionByDirection(cid, position, direction, size) local actionid = {2501, 2502, 2503, 2504} local n = size or 1 local table_dirs = { ["south"] == position.y = position.y + n}, ["north"] == position.y = position.y - n}, ["east"] == position.x = position.x + n}, ["west"] == position.x = position.x - n} function onStepIn (cid, creature, direction, aid) if actionid == 2501 then doCreatureSetLookDir == south end return true else getPosByDir == north then doCreatureSetLookDir == south end return true end I know for sure i do something wrong but i just need some tip / help cuz as i said im fresh and need to learn some things; P Even if u know / make any script ready (what will be great) will be nice to explain working of it etc. I forgot to mention it, TFS 0.4 rev 3777, source Code: https://tibiaking.com/forums/topic/76241-dbo-rox-v2-860-open-source99-sem-bugs/ BTW i tried many scripts etc and this one work w / o console error Code: local dirs = {"south", "east", "north", "west"} local aid = {2501, 2502, 2503, 2504} function onStepIn (cid, creature, direction, aid) local tile = Tile(creature:getDirection()):getGround() if ground.aid == 2501 then doCreatureSetLookDirection = SOUTH return true else doCreatureSetLookDirection = SOUTH return true end end But still its not this one, cuz nothing happens tried to make 0 than south cuz thats what i have at lib's, still nothing, also tried to make position.y + 1], Any tips / ideas? As i said im fresh and trying to learn so even small tip might be helpfull and once again sry i broke the rules
  4. Ok so i cant get help, map editor doesnt help too so i though about fixing it in another way I though about making a tile that npc / monster stands on it and changes it direction? Is it even possible? Something like: function onStepIn (cid, target) local table = { NPC / Monster name, what lookdir to set } But have no idea how this code might look;/ I want it to type to have less files and loads. Cuz im already stupid do i have something in constant / lib / checked almost evrything and cant find a solution; x So in shortcut i want something like, if monster / npc is on tile of pos XYZ he stands (not goes up/down) only turns around to: north / sout etc
  5. Sorry but as i wrote: Switching at RME map from north to south doesnt work too
  6. Hello, of the says title i have a small problem and have no idea what fault can it be, are The problem Is that type, any NPC with doesnt walk or monsters Which is "the sample" to the tp exp place, is standing back not by face (its annoying to dont see full look of it) to check how it looks, what kind of problem it can be? Im using tfs 0.4 rev 3777, is it possible its fault of spr / dat? it load "back" of npc / monster than "face up"? If so how to fix it? Switching at RME map from north to south doesnt work too, i also tried few tfs, deleted spawn.xml and added again, still same, everything stands facing north, while at RME they are changed, any tips?
  7. Well didnt find solution yet, maybe cuz im fresh in making at ots, had added some saga scripts etc but dunno yet how to complie sources, got few errors, anyway thx ;]
  8. Hello, did u fixed it and tell me how? :D
  9. Sorry for refresh but i need working saga system too, i already know how to add monsters etc but the saga monsters attack player even if he doesnt have this saga, no errors in console, im fresh in making ots, maybe i need somehow to set storage value to those monsters? Example: moon file: <? xml version = "1.0" encoding = "UTF-8"?> <monster name = "Freezer First Form" nameDescription = "the freeza" race = "blood" experience = "0" speed = "810" manacost = " 480 "> <health now =" 4550000 "max =" 4550000 "/> <look type =" 256 "corpse =" 0 "/> <targetchange interval =" 5000 "chance =" 8 "/> <strategy attack =" 100 "defense =" 0 "/> <flags> <flag summonable =" 0 "/> <flag attackable =" 1 "/> <flag hostile =" 1 "/> <flag storage =" 8000 "/> <flag sid = "15" /> <flag killstorage = "16" /> <flag illusionable = "1" /> <flag convinceable = "1" /> <flag pushable = "0" /> <flag canpushitems = "1 "/> <flag canpushcreatures = "1" /> <flag targetdistance = "1" /> <flag staticattack = "90" /> <flag runonhealth = "0" /> Rest of this not needed. Ofc i registered at xml too , <monster name = "Freezer First Form" file = "saga / freezer first form.xml" /> Also ofc added Saga registerCreatureEvent (cid, "Saga") to login.lua So i have no idea, maybe i have wrong Saga.lua script at creaturescripts / scripts help pls or maybe i need to change storage of player / monster? but in this i have no idea how; x Or maybe someone have working saga files for dragon ball ots?

Open Tibia Server

Quer aprender a criar seu próprio servidor de Tibia? Então está no lugar certo, aqui você encontrará milhares de tutorias, scripts, códigos, mapas e utilitários para que você possa fazer o seu próprio servidor de Tibia começando do zero.

Redes Sociais

Anuncie no Tibia King

Precisa de mais visibilidade em seus projetos? Quer fazer um plano publicitário para o seu servidor? Anuncie no Tibia King e faça sua divulgação, possuímos centenas de acessos simultâneos e milhares diários, com certeza será a sua solução!

×
×
  • Create New...