/
LUA_FUNCTIONS
1207 lines (1082 loc) · 35.9 KB
/
LUA_FUNCTIONS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
[ LUA FUNCTIONS
Project Name
The Forgotten Server
Version
0.3.7
Codenamed
Crying Damson
License
GNU GPLv3
Forum
http://otland.net/
]
[ ABOUT
List with all available Lua functions.
You can read a short instruction for all of them;
how to use them, what they return and see an usage examples.
If some function parameters are in bracket ([]) - it means that these are optional
E.g.
doPlayerAddItem(uid, itemid[, count/subtype[, canDropOnMap]])
Means that count/subtype + canDropOnMap parameters can but don't have to be specified
Example:
doPlayerAddItem(cid, 2160) --adds 1 crystal coin
doPlayerAddItem(cid, 2160, 10, TRUE) --adds 10 crystal coins and allow item to be dropped on map if player can't lift it
]
[ "get" functions
Introduction
These functions will return a requested string or value.
If specified thing is not found, function returns false. Example: getCreatureName(666) will return false, as creature with cid 666 doesn't exists.
LIST
*Creatures (means, that these are accessible for all players, monsters, npcs)
getCreatureName(cid)
Info
This function checks creature name.
Returns
Creature name.
getCreatureHealth(cid)
Info
This function checks creature current health points.
Returns
Creature current health points.
getCreatureMaxHealth(cid)
Info
This function checks creature max health points.
Returns
Creature max health points.
getCreatureMana(cid)
Info
This function checks creature current mana points.
Returns
Creature current mana points.
getCreatureMaxMana(cid)
Info
This function checks creature max mana points.
Returns
Creature max mana points.
getCreaturePosition(cid)
Info
This function checks creature current position.
Returns
Creature position.
For example:
{x = 127, y = 7, z = 9, stackpos = 1}
{x = 396, y = 582, z = 13, stackpos = 2} (when creature is on an item)
Example
local pos = getCreaturePosition(cid)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your current position is [X: "..pos.x.." | Y: "..pos.y.." | Z: "..pos.z.."].")
getCreatureLookDirection(cid)
Info
This function checks creature direction.
Returns
Creature direction.
For example:
NORTH (0) - creature is looking up (north) (/\)
EAST (1) - creature is looking right (east) (>)
SOUTH (2) - creature is looking down (south) (\/)
WEST (3) - creature is looking left (west) (<)
Example
local direction = getCreatureLookDirection(cid)
if direction == NORTH then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are looking to north.")
elseif direction == EAST then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are looking to east.")
elseif direction == SOUTH then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are looking to south.")
else --when west
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are looking to west.")
end
getCreatureSkullType(cid)
Info
This function checks creature current skull.
Returns
Creature skull.
For example:
SKULL_NONE (0) - means, no SKULL_GREEN
SKULL_YELLOW (1)
SKULL_GREEN (2)
SKULL_WHITE (3)
SKULL_RED (4)
SKULL_BLACK (5)
Example
local skullNames = {"Yellow", "Green", "White", "Red", "Black"}
local creatureSkull = getCreatureSkullType(cid)
if creatureSkull ~= SKULL_NONE then
doPlayerSendTextMessage(cid, "Your current skull color is " .. skullNames[creatureSkull] .. ".")
else
doPlayerSendTextMessage(cid, "You don't have any skull :(")
end
getCreatureMaster(cid)
Info
This function checks creature master. Its used for summoned creatures, to check who has summoned it.
Returns
Creature master cid if found, otherwise self cid.
getCreatureSummons(cid)
Info
This functions checks for creature summons list.
Returns
false if creature not found, otherwise table with creatures list (NOTE: Can be empty!)
Example
local summons = getCreatureSummons(cid)
if(table.maxn(summons) <= 0) then -- no summons
doPlayerSendCalcel(cid, "You don't have any summons..")
return false
end
-- remove all summons ;)
for _, pid in ipairs(summons) do
doRemoveCreature(pid)
end
getCreatureOutfit(cid)
Info
This function checks creature current outfit.
Returns
Creature outfit in array.
For example:
{lookType = 266, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0} --my current God outfit
Example
local myOutfit = getCreatureOutfit(cid)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Im currently wearing outfit with lookType = " .. myOutfit.lookType .. ".")
getCreatureByName(name)
Info
This function will search in current creatures list being in game for specified name.
NOTE: this function is not case-sensitive. So searching for 'GM MASTER' is same as searching for 'GM Master'.
Returns
Creature cid, if creature has been found, otherwise false.
For example:
false - Creature with name 'asdasdasdasdasd' has not been found :(
268475687 - my current cid
Example
local firstDragonFound = getCreatureByName('Dragon')
doSendMagicEffect(getCreaturePosition(firstDragonFound), CONST_ME_CAKE) --Lets display some effect on this creature :D
*Players
getPlayerExperience(cid)
Info
This function checks player experience points.
Returns
Player experience points.
Example
doPlayerSendTextMessage(cid, "You have " .. getPlayerExperience(cid) .. " experience points!")
getPlayerLevel(cid)
Info
This function checks player level.
Returns
Player level.
getPlayerMagLevel(cid)
Info
This function checks player magic level.
Returns
Player magic level.
getPlayerFood(cid)
Info
This function checks how many seconds a player is full.
Returns
Time in second for which player is full: 360.
Ham - 360, Meat - 180, Fish - 145
getPlayerAccess(cid)
Info
This function checks player access.
Returns
Player access.
getPlayerSkillLevel(cid, skillid)
Info
This function checks player skill level.
Skillid can be:
SKILL_FIST (0) = Fist Fighting
SKILL_CLUB (1) = Club Fighting
SKILL_SWORD (2) = Sword Fighting
SKILL_AXE (3) = Axe Fighting
SKILL_DISTANCE (4) = Distance Fighting
SKILL_SHIELD (5) = Shielding
SKILL_FISHING (6) = Fishing
Returns
Player skill level.
For Example
37
10
Example
if getPlayerSkillLevel(cid, SKILL_SWORD) >= 20 then --checking for sword skill value
doPlayerAddItem(cid, 2376) --gives sword, when skill >= 20
else
doPlayerSendCancel(cid, "Sorry, your sword skill is not high enough.")
end
getPlayerTown(cid)
Info
This function checks player actually Town ID.
Returns
Player Town ID.
For Example:
1
3
Example
local playerTown = getPlayerTown(cid)
local playerPos = getCreaturePosition(cid)
if playerTown == 1 then
doSendAnimatedText(playerPos, 'I am living in a town with id 1 (Main City)! :)', TEXTCOLOR_GOLD)
elseif playerTown == 2 then
doSendAnimatedText(playerPos, 'I am living in a town with id 2 (Desert City)! :)', TEXTCOLOR_GOLD)
end
getPlayerVocation(cid)
Info
This function checks player Vocation ID.
Returns
Player Vocation ID.
For Example:
1 - when player vocation is Sorcerer
7 - when player vocation is Royal Paladin
Example
local playerVoc = getPlayerVocation(cid)
if playerVoc == 1 then --If Vocation is Sorcerer or Master Sorcerer then weapon = Wand
weapon = 2190 --Wand of vortex
elseif playerVoc == 2 then --If Voc == Druid or Elder Druid then weapon = Rod
weapon = 2182 --Snakebite Rod
elseif playerVoc == 3 then --If Voc == Paladin or Royal Paladin then weapon = Spear
weapon== 2389 --Spear
elseif playerVoc == 4 then --If Voc == Knight or Elite Knight then weapon = Sword
weapon = 2412 --Katana
end
doPlayerAddItem(cid, weapon)
getPlayerItemCount(cid, itemid)
Info
This function checks how much items with specified id is player holding.
Returns
A count of itemid.
For Example:
2 - when player have 2x royal spear
73 - when player have 73 platinum coins
Example
local crystalCoins = getPlayerItemCount(cid, 2160)
local platinumCoins = getPlayerItemCount(cid, 2152)
local goldCoins = getPlayerItemCount(cid, 2148)
money = crystalCoins * 10000 + platinumCoins * 100 + goldCoins
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your money: " .. money .. "gp")
getPlayerSoul(cid)
Info
This function checks how much soul points player actually have.
Returns
Player actually soul points.
For Example:
27 - when player have 27 soul points
134 - when player have 134 soul points
Example
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your soul points: " .. getPlayerSoul(cid))
getPlayerFreeCap(cid)
Info
This function checks how much free cap points player actually have.
Returns
Player actually cap points.
For Example:
181 - when player have 181 capacity
1460 - when player have 1460 capacity
Example
local playerCap = getPlayerFreeCap(cid)
local item = 2393 --Giant Sword
local itemweight = getItemWeight(item, 1)
if playerCap >= itemweight then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a giant sword.')
doPlayerAddItem(cid,item)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a giant sword weighing ' ..itemweight.. ' oz it\'s too heavy.')
getPlayerLight(cid)
Info
This function checks player actually light.
Returns
Player actually light.
For Example:
215 - after using "utevo gran lux"
getPlayerSlotItem(cid, slot)
Info
This function checks what item player have actually in slot.
Slot can be:
CONST_SLOT_HEAD (1) = helmet
CONST_SLOT_NECKLACE (2) = necklace slot (amulet of loss etc.)
CONST_SLOT_BACKPACK (3) = backpack, bag
CONST_SLOT_ARMOR (4) = armor
CONST_SLOT_LEFT (5) = left hand (its really hand placed >> (right page on screen))
CONST_SLOT_RIGHT (6) = right hand (its really hand placed << (left page on screen))
CONST_SLOT_LEGS (7) = legs
CONST_SLOT_FEET (8) = boots
CONST_SLOT_RING (9) = ring slot
CONST_SLOT_AMMO (10) = ammo slot (arrows etc.)
Returns
Array with item which is actually in slot. When slot is empty, then returns false
For Example:
{itemid = 2493, uid = 70001, actionid = 0} (demon helmet, slot = 1)
Example
if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2173 then --checking if player have amulet of loss in necklace slot
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Ok, you can go.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, you need amulet of loss to go.")
doTeleportThing(cid, fromPosition, TRUE)
end
getPlayerDepotItems(cid, depotid)
Info
This function checks how much items (slots reserved, becouse 10cc = 1 slot) player have in depo.
Depotid = number, which depo we want to check.
Returns
Busy slots in depot.
For example:
7 - when player have in depo:
- sword
- rope
- 100 uh
- parcel (inside: 10 crystal coins + label)
- depot chest (standard, all players have it)
Example
depotItems = getPlayerDepotItems(cid, 3) -- 3 = Desert City
if depotItems < 2 then --When depo contains only 1 ITEM.
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Your depot contains 1 item.")
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Your depot contains " ..depotItems.. " items.")
end
getPlayerSex(cid)
Info
This function checks player sex.
Returns
Player sex.
For example:
PLAYERSEX_FEMALE (0) - when player is female
PLAYERSEX_MALE (1) - when player is male
PLAYERSEX_GAMEMASTER (2) - gamemaster (Means if player have changed their sex to type = 2)
Example
local playerPos = getCreaturePosition(cid)
local playerSex = getPlayerSex(cid)
if playerSex == PLAYERSEX_FEMALE then --female
doSendAnimatedText(playerPos, 'GiRl :*:*', TEXTCOLOR_GOLD)
elseif playerSex == PLAYERSEX_MALE then --male
doSendAnimatedText(playerPos, 'Wtf? I aM BoY.', TEXTCOLOR_GOLD)
else --hermaphrodite
doSendAnimatedText(playerPos, 'Who am I? :(', TEXTCOLOR_GOLD)
end
getPlayerGUID(cid)
Info
This function checks player guid.
Returns
Player id. When checked creature isn't player then returns false.
For example:
61 - when player id in database is 61
false - when checked creature is NPC
Example
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are player with id: " .. getPlayerGUID(cid))
getPlayerFlagValue(cid, flag)
Info
This function checks player flag value.
Returns
Return true if player have specified flag, otherwise false
For example:
true - checking GM for PlayerFlag_CannotBeAttacked
false - checking player for PlayerFlag_CannotBeAttacked
Example
if getPlayerFlagValue(cid, PlayerFlag_CanSummonAll) then --if can
doSummonCreature("Demon", fromPosition)
else --if cant
doSummonCreature("Rat", fromPosition)
end
getPlayerCustomFlagValue(cid, flag)
Info
Same as getPlayerFlagValue, but there are checked custom flags, which was introduced in TFS 0.3
This function checks player custom flag value.
Returns
Return true if player have specified custom flag, otherwise false
For example:
true - checking GM for PlayerCustomFlag_CanLoginMultipleCharacters
false - checking player for PlayerCustomFlag_CanLoginMultipleCharacters
getPlayerGroupId(cid)
Info
This function checks player group ID.
Returns
Player group id.
For example (using standard TFS groups):
1 - when checked player is player
2 - when checked player is gamemaster
3 - when checked player is god
Example
local group = getPlayerGroupId(cid)
if group == 3 then--when God
doPlayerAddItem(cid, 2160, 100) --100 crystal coins
elseif group == 2 then--when Gamemaster
doPlayerAddItem(cid, 2160, 50) --50 crystal coins
else
doPlayerSendCancel(cid, "Sorry, cheats doesnt work for you."
end
getPlayerGuildId(cid)
Info
This function returns player's guild id.
Returns
Players guild id.
For example
21 - The guild the player is in has the guild id 21, as stored in the database.
Example
local guildId = getPlayerGuildId(cid)
if guildId == 21 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Welcome in our guild hunting place!")
elseif guildId == 22 then
doPlayerSendCancel(cid, "This area is not for your guild!")
end
getPlayerGuildName(cid)
Info
Used to get player's guild name.
Returns
Players guild name in a string.
For example
"Lost Dragons"
Example
local guildName = getPlayerGuildName(cid)
doSendAnimatedText(getCreaturePosition(cid),guildName, TEXTCOLOR_GOLD)
getPlayerGuildRank(cid)
Info
Used to get player's rank name in a guild.
Returns
The players current rank in his guild in a string
For example
"Senator"
Example
local rank = getPlayerGuildRank(cid)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You're a " .. rank .. " in your guild.")
getPlayerGuildNick(cid)
Info
Used to get player's nick in his guild.
Returns
The players current nick in a string.
For example
"The protector"
Example
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Your guild nick is " .. getPlayerGuildNick(cid) .. ".")
]
[ "set" functions
Introduction
These functions usually changes thing properties.
List
*Creatures
setCreatureMaxHealth(cid, health)
Info
This function changes creature max health.
Returns
Returns true - if creature found and max health changed, otherwise return false
setCreatureMaxMana(cid, mana)
Info
This function changes creature max mana.
Returns
Returns true - if creature found and max mana changed, otherwise return false
]
[ "do" functions
Introduction
These functions usually execute an action.
List
*Creatures
*Players
doPlayerSendCancel(cid, text)
Info
This function will send cancel message do player (visible in bottom of a screen)
Returns
Returns true - when msg was sent, false - when it was impossible.
Example
if getPlayerLevel(cid) >= 10 then --checking level
doSummonCreature("Chicken", fromPosition)
else
doPlayerSendCancel(cid, "Sorry, your level isnt enought to summon this monster.")
end
]
[ LIST
[ Note
There are few latest missing...
]
//get*
getCreatureHealth(cid)
getCreatureMaxHealth(cid)
getCreatureHideHealth(cid)
getCreatureMana(cid)
getCreatureMaxMana(cid)
getCreatureSpeakType(cid)
getCreatureMaster(cid)
getCreatureSummons(cid)
getCreatureOutfit(cid)
getCreaturePosition(cid)
getCreatureLastPosition(cid)
getCreatureLookDirection(cid)
getCreatureName(cid)
getCreatureSpeed(cid)
getCreatureBaseSpeed(cid)
getCreatureTarget(cid)
getCreatureByName(name)
getCreatureSkullType(cid)
getCreatureCondition(cid, condition[, subId = 0])
getCreatureNoMove(cid)
getCreatureStorage(cid, key)
getMonsterInfo(name)
getMonsterSummonList(name)
getMonsterTargetList(cid)
getMonsterFriendList(cid)
getPlayerByNameWildcard(name~[, ret = false])
getPlayerLossSkill(cid)
getPlayerLossPercent(cid, lossType)
getPlayerGUIDByName(name[, multiworld = false])
getPlayerNameByGUID(guid[, multiworld = false])
getPlayerFood(cid)
getPlayerLevel(cid)
getPlayerExperience(cid)
getPlayerMagLevel(cid[, ignoreBuffs = false])
getPlayerSpentMana(cid)
getPlayerAccess(cid)
getPlayerGhostAccess(cid)
getPlayerSkillLevel(cid, skillId)
getPlayerSkillTries(cid, skillId)
getPlayerTown(cid)
getPlayerVocation(cid)
getPlayerRequiredMana(cid, magicLevel)
getPlayerRequiredSkillTries(cid, skillId, skillLevel)
getPlayerItemCount(cid, itemid[, subType = -1])
getPlayerSoul(cid)
getPlayerAccountId(cid)
getPlayerAccount(cid)
getPlayerIp(cid)
getPlayerFreeCap(cid)
getPlayerLight(cid)
getPlayerSlotItem(cid, slot)
getPlayerWeapon(cid[, ignoreAmmo = false])
getPlayerItemById(cid, deepSearch, itemId[, subType = -1])
getPlayerDepotItems(cid, depotid)
getPlayerGuildId(cid)
getPlayerGuildName(cid)
getPlayerGuildRank(cid)
getPlayerGuildNick(cid)
getPlayerGuildLevel(cid)
getPlayerSex(cid)
getPlayerGUID(cid)
getPlayerFlagValue(cid, flag)
getPlayerCustomFlagValue(cid, flag)
getPlayerPromotionLevel(cid)
getPlayerGroupId(cid)
getPlayerLearnedInstantSpell(cid, name)
getPlayerInstantSpellCount(cid)
getPlayerInstantSpellInfo(cid, index)
getPlayerBlessing(cid, blessing)
getPlayerStamina(cid)
getPlayerExtraExpRate(cid)
getPlayerPartner(cid)
getPlayerParty(cid)
getPlayerPremiumDays(cid)
getPlayerBalance(cid)
getPlayerMoney(cid)
getPlayerSkullTicks(cid, type)
getPlayerModes(cid)
getPlayerRates(cid)
getPlayerLastLogin(cid)
getPlayerLastLoginSaved(cid)
getPlayerAccountManager(cid)
getPlayerTradeState(cid)
getInstantSpellInfo(cid, name)
getPlayersByAccountId(accountNumber)
getPlayersByIp(ip[, mask = 0xFFFFFFFF])
getChannelUsers(channelId)
getPlayersOnline()
getPartyMembers(lid)
getAccountIdByName(name)
getAccountByName(name)
getAccountIdByAccount(accName)
getAccountByAccountId(accId)
getIpByName(name)
getItemRWInfo(uid)
getItemProtection(uid)
getItemDescriptionsById(itemid)
getItemWeightById(itemid, count[, precise])
getItemDescriptions(uid)
getItemWeight(uid[, precise])
getItemParent(uid)
getItemAttack(uid)
getItemExtraAttack(uid)
getItemDefense(uid)
getItemExtraDefense(uid)
getItemArmor(uid)
getItemAttackSpeed(uid)
getItemHitChance(uid)
getItemShootRange(uid)
getItemIdByName(name)
getItemLevelDoor(itemid)
getItemWeaponType(uid)
getFluidSourceType(type)
getContainerSize(uid)
getContainerCap(uid)
getContainerItem(uid, slot)
getTileItemById(pos, itemId[, subType = -1])
getTileItemsByType(pos, type)
getTileThingByPos(pos)
getTileInfo(pos)
getTopCreature(pos)
getClosestFreeTile(cid, targetpos[, extended = false[, ignoreHouse = true]])
getThingFromPos(pos)
getThing(uid)
getThingPosition(uid)
getHouseInfo(id)
getHouseAccessList(houseid, listid)
getHouseByPlayerGUID(playerGUID)
getHouseFromPos(pos)
getTownId(townName)
getTownName(townId)
getTownTemplePosition(townId)
getTownHouses(townId)
getWorldType()
getWorldTime()
getWorldLight()
getWorldCreatures(type) //0 players, 1 monsters, 2 npcs, 3 all
getWorldUpTime()
getVocationInfo(id)
getGuildId(guildName)
getGuildMotd(guildId)
getSpectators(centerPos, rangex, rangey[, multifloor = false])
getSearchString(fromPosition, toPosition[, fromIsCreature = false[, toIsCreature = false]])
getWaypointPosition(name)
getGameState()
getStorage(key)
getNotationsCount(accountId[, playerId])
getStatementsCount(name/guid[, channelId])
getBanData(value[, type[, param]])
getBanList(type[, value[, param]])
getBanReason(id)
getBanAction(id[, ipBanishment = false])
getExperienceStage(level)
getConfigFile()
getConfigValue(key)
getModList()
doUpdateHouseAuctions()
loadmodlib(lib)
domodlib(lib)
dodirectory(dir[, recursively = false])
errors(var)
getDataDir()
getLogsDir()
getVocationList()
getGroupList()
getChannelList()
getTownList()
getWaypointList()
getTalkActionList()
getExperienceStageList()
//set*
setCreatureMaxHealth(cid, health)
setCreatureMaxMana(cid, mana)
setHouseOwner(houseid, ownerGUID)
setHouseAccessList(houseid, listid, listtext)
setItemName(uid)
setItemPluralName(uid)
setItemArticle(uid)
setItemAttack(uid, attack)
setItemExtraAttack(uid, extraattack)
setItemDefense(uid, defense)
setItemArmor(uid, armor)
setItemExtraDefense(uid, extradefense)
setItemAttackSpeed(uid, attackspeed)
setItemHitChance(uid, hitChance)
setItemShootRange(uid, shootRange)
setCombatArea(combat, area)
setCombatCondition(combat, condition)
setCombatParam(combat, key, value)
setConditionParam(condition, key, value)
setCombatCallBack(combat, key, function_name)
setCombatFormula(combat, type, mina, minb, maxa, maxb)
setConditionFormula(combat, mina, minb, maxa, maxb)
setWorldType(type)
//do*
doCreatureAddHealth(cid, health[, force])
doCreatureAddMana(cid, mana)
doCreatureSetDropLoot(cid, doDrop)
doCreatureSetSkullType(cid, skull)
doCreatureSetSpeakType
doCreatureSetLookDirection(cid, dir)
doPlayerSetMaxCapacity(cid, cap)
doCreatureChangeOutfit(cid, outfit)
doCreatureSay(uid, text, type[, ghost = false[, cid = 0[, pos]]])
doCreatureSetNoMove(cid, cannotMove)
doCreatureSetStorage(cid, key, value)
doSetCreatureLight(cid, lightLevel, lightColor, time)
doSetCreatureOutfit(cid, outfit[, time = -1])
doRemoveCreature(cid[, forceLogout = true])
doMoveCreature(cid, direction[, flag = FLAG_NOLIMIT])
doSteerCreature(cid, position)
doConvinceCreature(cid, target)
doChallengeCreature(cid, target)
doChangeSpeed(cid, delta)
doSummonMonster(name, pos)
doCreateMonster(name, pos[, extend = false[, force = false]])
doMonsterChangeTarget(cid)
doMonsterSetTarget(cid, target)
doCreateNpc(name, pos)
doSetMonsterOutfit(cid, name[, time = -1])
doPlayerBroadcastMessage(cid, message[, type])
doPlayerSetSex(cid, newSex)
doPlayerSetTown(cid, townid)
doPlayerSetVocation(cid, voc)
doPlayerSetGroupId(cid, newGroupId)
doPlayerSetPromotionLevel(cid, level)
doPlayerSetStamina(cid, minutes)
doPlayerSetBalance(cid, balance)
doPlayerSetExtraExpRate(cid, value)
doPlayerSetPartner(cid, guid)
doPlayerFollowCreature(cid, target)
doPlayerRemoveItem(cid, itemid, count[, subtype])
doPlayerAddExperience(cid, amount)
doPlayerSetGuildId(cid, id)
doPlayerSetGuildRank(cid, rank)
doPlayerSetGuildNick(cid, nick)
doPlayerAddOutfit(cid,looktype, addon)
doPlayerRemoveOutfit(cid,looktype[, addon = 0])
doPlayerAddOutfitId(cid, outfitId, addon)
doPlayerRemoveOutfitId(cid, outfitId[, addon = 0])
doPlayerSetRedSkullTicks(cid, amount)
doPlayerSetLossPercent(cid, lossType, newPercent)
doPlayerSetLossSkill(cid, doLose)
doPlayerAddSkillTry(cid, skillid, n)
doPlayerAddSpentMana(cid, amount)
doPlayerAddSoul(cid, soul)
doPlayerAddItem(uid, itemid[, count/subtype = 1[, canDropOnMap = true[, slot = 0]]])
doPlayerAddItemEx(cid, uid[, canDropOnMap = false[, slot = 0]])
doPlayerSendTextMessage(cid, MessageClasses, message[, animatedText[, color[, pos]]])
doPlayerSendChannelMessage(cid, author, message, SpeakClasses, channel)
doPlayerSendToChannel(cid, targetId, SpeakClasses, message, channel[, time])
doPlayerOpenChannel(cid, channelId)
doPlayerAddMoney(cid, money)
doPlayerRemoveMoney(cid, money)
doPlayerTransferMoneyTo(cid, target, money)
doPlayerPopupFYI(cid, message)
doPlayerSendTutorial(cid, id)
doPlayerAddMapMark(cid, pos, type[, description])
doPlayerAddPremiumDays(cid, days)
doPlayerAddBlessing(cid, blessing)
doPlayerResetIdleTime(cid)
doPlayerLearnInstantSpell(cid, name)
doPlayerUnlearnInstantSpell(cid, name)
doPlayerFeed(cid, food)
doPlayerSendCancel(cid, text)
doPlayerSendDefaultCancel(cid, ReturnValue)
doPlayerSetRate(cid, type, value)
doPlayerJoinParty(cid, lid)
doPlayerLeaveParty(cid[, forced = false])
doPlayerSendOutfitWindow(cid)
doPlayerSwitchSaving(cid)
doPlayerSave(cid[, shallow = false])
doCreateItem(itemid[, type/count = 1], pos)
doCreateItemEx(itemid[, count/subtype])
doAddContainerItemEx(uid, virtuid)
doAddContainerItem(uid, itemid[, count/subtype = 1])
doChangeTypeItem(uid, newtype)
doDecayItem(uid)
doRemoveItem(uid[, count = -1])
doTransformItem(uid, toitemid[, count/subtype])
doSetItemActionId(uid, actionid)
doSetItemText(uid, text[, writer[, date]])
doSetItemSpecialDescription(uid, desc)
doSetItemOutfit(cid, item[, time = -1])
doSetItemProtection(uid, value)
doTileAddItemEx(pos, uid)
doTileQueryAdd(uid, pos[, flags])
doItemRaidUnref(uid)
doAddCondition(cid, condition)
doRemoveCondition(cid, type[, subId])
doRemoveConditions(cid[, onlyPersistent])
doAreaCombatHealth(cid, type, pos, area, min, max, effect)
doTargetCombatHealth(cid, target, type, min, max, effect)
doAreaCombatMana(cid, pos, area, min, max, effect)
doTargetCombatMana(cid, target, min, max, effect)
doAreaCombatCondition(cid, pos, area, condition, effect)
doTargetCombatCondition(cid, target, condition, effect)
doAreaCombatDispel(cid, pos, area, type, effect)
doTargetCombatDispel(cid, target, type, effect)
doCombat(cid, combat, param)
doTeleportThing(cid, newpos[, pushmove = true])
doCreateTeleport(itemid, topos, createpos)
doSendCreatureSquare(cid, color[, player])
doSendMagicEffect(pos, type[, player])
doSendDistanceShoot(frompos, topos, type[, player])
doSendAnimatedText(pos, text, color[, player])
doShowTextDialog(cid, itemid, text)
doRelocate(pos, toPos[, creatures = true[, unmovable = true]])
doCleanTile(pos[, forceMapLoaded = false])
doBroadcastMessage(message, type)
doWaypointAddTemporial(name, pos)
doSetGameState(stateId)
doSetStorage(key, value)
doAddIpBanishment(ip[, mask[, length[, reason[, comment[, admin[, statement]]]]]])
doAddPlayerBanishment(name/guid[, type[, length[, reason[, action[, comment[, admin[, statement]]]]]]])
doAddAccountBanishment(accountId[, playerId[, length[, reason[, action[, comment[, admin[, statement]]]]]]])
doAddNotation(accountId[, playerId[, reason[, comment[, admin[, statement]]]]]])
doAddStatement(name/guid[, channelId[, reason[, comment[, admin[, statement]]]]]])
doRemoveIpBanishment(ip[, mask])
doRemovePlayerBanishment(name/guid, type)
doRemoveAccountBanishment(accountId[, playerId])
doRemoveNotations(accountId[, playerId])
doRemoveStatements(name/guid[, channelId])
doSaveServer([shallow = false])
doReloadInfo(id[, cid])
doCleanHouse(houseId)
doCleanMap()
doRefreshMap()
//is*
isCreature(cid)
isMonster(uid)
isNpc(uid)
isPlayer(cid)
isPlayerPzLocked(cid)
isPlayerSaving(cid)
isPlayerProtected(cid)
isItemStackable(itemid)
isItemRune(itemid)
isItemMovable(itemid)
isItemDoor(itemid)
isItemContainer(itemid)
isItemFluidContainer(itemid)
isContainer(uid)
isCorpse(uid)
isMovable(uid)
isSightClear(fromPos, toPos, floorCheck)
isIpBanished(ip[, mask])
isPlayerBanished(cid, type)
isPlayerNamelocked(name)
isAccountBanished(accountId[, playerId])
isInArray({array}, value[, lower = true])
isSummon(uid)
isUnderWater(uid)
//others
registerCreatureEvent(uid, eventName)
unregisterCreatureEvent(uid, eventName)
createCombatArea({area}[, {exArea}])
createConditionObject(type[, ticks[, buff[, subId]]])
addDamageCondition(condition, rounds, time, value)
addOutfitCondition(condition, lookTypeEx, lookType, lookHead, lookBody, lookLegs, lookFeet)
createCombatObject()
numberToVariant(number)
stringToVariant(string)
positionToVariant(pos)
targetPositionToVariant(pos)
variantToNumber(var)
variantToString(var)
variantToPosition(var)
canPlayerWearOutfit(cid, lookType[, addon = 0])
canPlayerWearOutfitId(cid, outfitId[, addon = 0])
executeRaid(name)
addEvent(callback, delay, ...)
stopEvent(eventid)
addDialog(dialog, dialogId, cid, callback)
hasPlayerClient(cid)
hasItemProperty(uid, prop)
//db table
db.query(query)
db.storeQuery(query)
db.escapeString(str)
db.escapeBlob(s, length)
db.lastInsertId()
db.stringComparison()
db.updateLimiter()
db.connected()
//result table
result.getDataInt(resId, s)
result.getDataLong(resId, s)
result.getDataString(resId, s)
result.getDataStream(resId, s, length)
result.next(resId)
result.free(resId)
//bit table
#bit.cast
bit.bnot(n)
bit.band(type, n)
bit.bor(type, n)