Itutorial
Legendary OT User
- Joined
- Dec 23, 2014
- Messages
- 2,336
- Solutions
- 68
- Reaction score
- 1,015
1): MAIN FUNCTIONS
A) Creature Scripts:
B) GlobalEvents:
C) MoveEvents:
D) TalkActions:
F) Spells:
When writing a script you will always start with one of these main function. They define what action the player must do for the script to start.
A) Creature Scripts:
Code:
onLogin(cid)
onLogout(cid)
onAdvance(cid, skill, oldLevel, newLevel)
onStatsChange(cid, attacker, type, combat, value)
onDirection(cid, old, current)
onOutfit(cid, old, current)
onSendMail(cid, receiver, item, openBox)
onReceiveMail(cid, sender, item, openBox)
onTradeRequest(cid, target, item)
onTradeAccept(cid, target, item, targetItem)
onJoinChannel(cid, channel, users)
onLeaveChannel (cid, channel, users)
onLook(cid, thing, position, lookDistance)
onThink(cid, interval)
onTextEdit(cid, item, newText)
onReportBug(cid, comment)
onAreaCombat(cid, tileItem, tilePosition, isAggressive)
onPush(cid, target)
onTarget(cid, target)
onFollow(cid, target)
onCombat(cid, target)
onAttack(cid, target)
onCast(cid, target)
onKill(cid, target, lastHit)
onDeath(cid, corpse, deathList)
onPrepareDeath(cid, deathList)
B) GlobalEvents:
Code:
onThink(interval, lastExecution, thinkInterval)
onStartup()
onShutdown()
onRecord(current, old, cid)
onTimer()
C) MoveEvents:
Code:
onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)
onEquip(cid, item, slot)
onDeEquip(cid, item, slot)
onAddItem(moveItem, tileItem, position, cid)
onRemoveItem(moveItem, tileItem, position, cid)
D) TalkActions:
Code:
onSay(cid, words, param, channel)
F) Spells:
Code:
onCastSpell(cid, var)
When writing a script you will always start with one of these main function. They define what action the player must do for the script to start.