• TibiaFace

    Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...

    .
    demo menumenu

    Afiliados



    Votar:

    Guia Basica De Creature event

    Compartir:

    Ver el tema anterior Ver el tema siguiente Ir abajo  Mensaje (Página 1 de 1.)

    1Guia Basica De Creature event Empty Guia Basica De Creature event Lun Dic 21, 2015 1:52 am

    Krapula

    Krapula
    Miembro
    Miembro
    Guia Basica De Creature event Percent_0


    Advierto que 1 esto es copy paste y es para que uds aprendan y para yo tener 1 chuleta de mas facil acceso aqui en nuestr forum y no en otro


    CreatureEvent Types
    OTx = tfs 0.3 0.4

    Código:
    type="login"
       function onLogin(cid)

    type="logout"
       function onLogout(cid)

    type="advance"
       function onAdvance(cid, skill, oldLevel, newLevel)

    type="think"
       function onThink(cid, interval)

    type="kill"
       function onKill(cid, target, lastHit)

    type="death"
       function onDeath(cid, corpse, deathList)

    type="preparedeath"
       function onPrepareDeath(cid, deathList)

    type="statschange"
       function onStatsChange(cid, attacker, type, combat, value)

    type="combat"
       function onCombat(cid, target)

    type="target"
       function onTarget(cid, target)

    type="look"
       function onLook(cid, thing, position, lookDistance)

    type="textedit"
       function onTextEdit(cid, item, newText)

    type="outfit"
       function onOutfit(cid, old, current)

    type="push"
       function onPush(cid, target)

    type="follow"
       function onFollow(cid, target)

    type="attack"
       function onAttack(cid, target)

    type="areacombat"
       function onAreaCombat(cid, tileItem, tilePosition, isAggressive)

    type="cast"
       function onCast(cid, target)

    type="direction"
       function onDirection(cid, old, current)

    type="reportbug"
       function onReportBug(cid, comment)

    type="sendmail"
       function onSendMail(cid, receiver, item, openBox)

    type="receivemail"
       function onReceiveMail(cid, sender, item, openBox)

    type="traderequest"
       function onTradeRequest(cid, target, item)

    type="tradeaccept"
       function onTradeAccept(cid, target, item, targetItem)

    type="joinchannel"
       function onJoinChannel(cid, channel, users)

    type="leavechannel"
       function onLeaveChannel(cid, channel, users)


    Para Tfs 1

    Código:
    type="login"
       function onLogin(cid)

    type="logout"
       function onLogout(cid)

    type="think"
       function onThink(cid, interval)

    type="preparedeath"
       function onPrepareDeath(cid, killer)

    type="death"
       function onDeath(cid, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified)

    type="kill"
       function onKill(cid, target)

    type="advance"
       function onAdvance(cid, skill, oldLevel, newLevel)

    type="modalwindow"
       function onModalWindow(cid, modalWindowId, buttonId, choiceId)

    type="textedit"
       function onTextEdit(cid, item, text)

    type="changehealth"
       function onChangeHealth(cid, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType)

    type="changemana"
       function onChangeMana(cid, attacker, manaChange)

    type="extendedopcode"
       function onExtendedOpcode(cid, opcode, buffer)

    Types that need to be registered will only be executed for the player or monster where it is registered.
    Registering it in login.lua means it will be executed always for all players. If it should be executed always for certain monsters, register it in the monster file.[/CENTER]


    login

    When executed:
    - When a player logs in

    Parameters:
    - cid = creatureid of the player who logs in.

    Feature return false:
    - None

    Register creature event:
    - No

    ~~~~

    logout

    When executed:
    - When a player logs out by clicking the logout option in the client. This won't happen if a player dies, gets disconnected or xlogs

    Parameters:
    - cid = creatureid of the player who logs out

    Feature return false:
    - Player can't logout

    Register creature event:
    - No

    ~~~~

    advance

    When executed:
    - Every time a player advances in level, magic level or any other skill

    Parameters:
    - cid = creatureid of the player who advanced
    - skill = type of skill the player advanced in
    Código:
    SKILL_FIST = 0
    SKILL_CLUB = 1
    SKILL_SWORD = 2
    SKILL_AXE = 3
    SKILL_DISTANCE = 4
    SKILL_SHIELD = 5
    SKILL_FISHING = 6
    SKILL__MAGLEVEL = 7
    SKILL__LEVEL = 8

    - oldlevel = the previous skill level before the player advanced
    - newlevel = the new skill level

    Feature return false:
    - None

    Register creature event:
    - Yes

    ~~~~

    think

    When executed:
    - On time

    Parameters:
    - cid = creatureid of the player or monster
    - interval = interval time when it gets executed, for example 500 when it's executed every 0.5 seconds

    Feature return false:
    - None

    Register creature event:
    - Yes

    ~~~~

    kill

    When executed:
    - When killing a player or monster

    Parameters:
    - cid = creatureid of the player or monster who kills
    - target = creatureid of the player or monster that is killed

    Feature return false:
    - The target won't die (You still need to add the health/mana).

    Register creature event:
    - Yes

    ~~~~

    death

    When executed:
    - When a player or monster dies

    Parameters:
    - cid = creatureid of the player or monster who dies
    - corpse = corpse of the player or monster who died

    Example of adding 3 crystal coins in the corpse

    Código:
    doAddContainerItem(corpse.uid, 2160, 3)

    - deathlist = a table with the killers

    Feature return false:
    - Corpse won't be created

    Register creature event:
    - Yes

    ~~~~

    preparedeath

    When executed:
    - When a player or monster is dieing (can be used for scripts that should happen right before someone dies)

    Parameters:
    - cid = creatureid of the player or monster who is dieing
    - deathlist = a table with the killers

    Feature return false:
    - The player or monster won't die (you will still need to add the health/mana)

    Register creature event:
    - Yes

    ~~~~

    statschange

    When executed:
    - When a player or monster gains or loses health/mana from a combat or function (combats are not only from spells, but also weapons/fist/melee and monsters ofc don't have mana)

    Parameters:
    - cid = creatureid of the player or monster who gains or loses health/mana
    - attacker = creatureid of the player or monster that causes the health/mana change
    - type = type of change, healthgain, healthloss, managain or manaloss

    Código:
    STATSCHANGE_HEALTHGAIN = 0
    STATSCHANGE_HEALTHLOSS = 1
    STATSCHANGE_MANAGAIN = 2
    STATSCHANGE_MANALOSS = 3

    - combat = the type of combat that caused the health/mana change

    Código:
    COMBAT_NONE = 0
    COMBAT_PHYSICALDAMAGE = 1
    COMBAT_ENERGYDAMAGE = 2
    COMBAT_EARTHDAMAGE = 4
    COMBAT_POISONDAMAGE = 4
    COMBAT_FIREDAMAGE = 8
    COMBAT_UNDEFINEDDAMAGE = 16
    COMBAT_LIFEDRAIN = 32
    COMBAT_MANADRAIN = 64
    COMBAT_HEALING = 128
    COMBAT_DROWNDAMAGE = 256
    COMBAT_ICEDAMAGE = 512
    COMBAT_HOLYDAMAGE = 1024
    COMBAT_DEATHDAMAGE = 2048

    - value = how much it is changed

    Feature return false:
    - The player or monster won't gain or lose mana/health from a combat or function. This can be used to make it become immortal for a certain time or not be able to receive damage from certain players/monsters

    Register creature event:
    - Yes

    ~~~~

    combat

    When executed:
    - When a player or monster uses a combat (this is not only from spells, but also weapons/fist/melee, so any kind of attack)

    Parameters:
    - cid = creatureid of the player or monster who uses the combat
    - target = creatureid of the player or monster that gets hit by the combat

    Feature return false:
    - The player or monster won't be able to attack, this also includes that it can't target someone/something. This can be used to make the target become immortal for a certain time or to not be able to deal damage to certain players/monsters

    Register creature event:
    - Yes


    No quize lanzarme esa traducida en español
    usen google Ghrome Very Happy hasta la proxima Twisted Evil

    Guia Basica De Creature event 29vjnnd

    2 participantes
    https://www.facebook.com

    2Guia Basica De Creature event Empty Re: Guia Basica De Creature event Lun Dic 21, 2015 6:12 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    buen aporte +1 :(MG):



    Guia Basica De Creature event YNU5B25
    2 participantes
    http://www.tibiaface.com

    Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje (Página 1 de 1.)

    Permisos de este foro:
    No puedes responder a temas en este foro.

     

    BienvenidosTibiaFace es una comunidad de Open Tibia. Para participar debes estar registrado (click para Regístrate).