Creation/Dev/Script/Client/TServerNPC: Difference between revisions

From Graal Bible
mNo edit summary
 
 
(7 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<pre>
[[Category:Scripting Reference]]
          TServerNPC (TServerPlayer):
Inherits [[Creation/Dev/Script/Client/TServerPlayer|TServerPlayer]].
            actionplayer - integer (read only)
 
            hearts - float
=Variables=
            height - float (read only)
{| border="1" cellpadding="2" width="100%"
            horseimg - string
| '''Name'''
            hp - float
| '''Type'''
            hurtdx - float
| '''Description'''
            hurtdy - float
|-
            image - string
| actionplayer
            layer - integer
| integer (read only)
            peltwithblackstone - boolean (read only)
|
            peltwithbush - boolean (read only)
|-
            peltwithnpc - boolean (read only)
| hearts
            peltwithsign - boolean (read only)
| float
            peltwithstone - boolean (read only)
|
            peltwithvase - boolean (read only)
|-
            save - object (read only)
| height
            shieldpower - integer
| float (read only)
            sprite - integer
|
            swordpower - integer
|-
            visible - boolean
| horseimg
            width - float (read only)
| string
            x - float
|
            y - float
|-
            blockagain()
| hp
            blockagainlocal()
| float
            canbecarried()
|
            canbepulled()
|-
            canbepushed()
| hurtdx
            cannotbecarried()
| float
            cannotbepulled()
|
            cannotbepushed()
|-
            carryobject(str)
| hurtdy
            changeimgcolors(int, float, float, float, float)
| float
            changeimgmode(int, int)
|
            changeimgpart(int, int, int, int, int)
|-
            changeimgvis(int, int)
| image
            changeimgzoom(int, float)
| string
            destroy()
|
            dontblock()
|-
            dontblocklocal()
| layer
            drawaslight()
| integer
            drawoverplayer()
|
            drawunderplayer()
|-
            findimg(int) - returns object
| peltwithblackstone
            hide()
| boolean (read only)
            hideimg(int)
|
            hideimgs(int, int)
|-
            hidelocal()
| peltwithbush
            hurt(int)
| boolean (read only)
            lay(str)
|
            message(str)
|-
            move(float, float, float, int)
| peltwithnpc
            setbow(str)
| boolean (read only)
            setcharani(str, str)
|
            setchargender(str)
|-
            setcoloreffect(float, float, float, float)
| peltwithsign
            seteffectmode(int)
| boolean (read only)
            setimg(str)
|
            setimgpart(str, int, int, int, int)
|-
            setshape(int, int, int)
| peltwithstone
            setshape2(int, int, obj)
| boolean (read only)
            setzoomeffect(float)
|
            shootarrow(int)
|-
            shootball()
| peltwithvase
            shootfireball(int)
| boolean (read only)
            shootfireblast(int)
|
            shootnuke(int)
|-
            show()
| save
            showani(int, float, float, int, str) - returns object
| object (read only)
            showani2(int, float, float, float, int, str) - returns object
|
            showcharacter()
|-
            showimg(int, str, float, float) - returns object
| shieldpower
            showimg2(int, str, float, float, float) - returns object
| integer
            showlocal()
|
            showpoly(int, obj) - returns object
|-
            showpoly2(int, obj) - returns object
| sprite
            showtext(int, float, float, str, str, str) - returns object
| integer
            showtext2(int, float, float, float, str, str, str) - returns object
|
            take(str)
|-
            take2(int)
| swordpower
            takehorse(int)
| integer
            throwcarry()
|
            timereverywhere()
|-
            toweapons(str)
| visible
</pre>
| boolean
| True if the NPC is not hidden
|-
| isblocking
| boolean (read only)
| True if the NPC is blocking
|-
| width
| float (read only)
|
|-
| x
| float
|
|-
| y
| float
|
|}
 
=Functions=
{| border="1" cellpadding="2" width="100%"
| '''Name'''
| '''Return Type'''
| '''Description'''
|-
| blockagain()
|
|
|-
| blockagainlocal()
|
|
|-
| canbecarried()
|
|
|-
| canbepulled()
|
|
|-
| canbepushed()
|
|
|-
| cannotbecarried()
|
|
|-
| cannotbepulled()
|
|
|-
| cannotbepushed()
|
|
|-
| carryobject(str)
|
|
|-
| changeimgcolors(int, float, float, float, float)
|
|
|-
| changeimgmode(int, int)
|
|
|-
| changeimgpart(int, int, int, int, int)
|
|
|-
| changeimgvis(int, int)
|
|
|-
| changeimgzoom(int, float)
|
|
|-
| destroy()
|
|
|-
| dontblock()
|
|
|-
| dontblocklocal()
|
|
|-
| drawaslight()
|
|
|-
| drawoverplayer()
|
|
|-
| drawunderplayer()
|
|
|-
| findimg(int)
| object
|
|-
| hide()
|
|
|-
| hideimg(int)
|
|
|-
| hideimgs(int, int)
|
|
|-
| hidelocal()
|
|
|-
| hurt(int)
|
|
|-
| lay(str)
|
|
|-
| message(str)
|
|
|-
| move(float, float, float, int)
|
|
|-
| setbow(str)
|
|
|-
| setcharani(str, str)
|
|
|-
| setchargender(str)
|
|
|-
| setcoloreffect(float red, float green, float blue, float alpha)
|
| Sets the color and alpha transparency of the npc, use seteffectmode(1) to make the npc alpha-transparent instead of displaying it as a light.
|-
| seteffectmode(int)
|
|
|-
| setimg(str)
|
|
|-
| setimgpart(str, int, int, int, int)
|
|
|-
| setshape(int, int, int)
|
| Enables rectangular blocking behaviour for the NPC. Parameters are shape type (right now only 1 for rectangular is supported), and the width and height in pixels.
|-
| setshape2(int, int, obj)
|
| Enables tile-based blocking behaviour. Parameters are tile width, height and an array of tile types. Supported tile types:
  {| border="1" cellpadding="2" width="100%"
  | '''Value'''
  | '''Description'''
  |-
  | 0
  | Nonblocking
  |-
  | 2
  | Hurting underground
  |-
  | 3
  | Chair
  |-
  | 4
  | Bed upper side
  |-
  | 5
  | Bed lower side
  |-
  | 6
  | Swamp
  |-
  | 7
  | Lava swamp
  |-
  | 8
  | Near water
  |-
  | 9
  | Near lava
  |-
  | 11
  | Water
  |-
  | 12
  | Lava
  |-
  | 20
  | Throw-through (fences)
  |-
  | 21
  | Jumping stone
  |-
  | 22
  | Blocking tile
  |}
|-
| setzoomeffect(float)
|
|
|-
| shootarrow(int)
|
|
|-
| shootball()
|
|
|-
| shootfireball(int)
|
|
|-
| shootfireblast(int)
|
|
|-
| shootnuke(int)
|
|
|-
| show()
|
|
|-
| showani(int, float, float, int, str)
| object
|
|-
| showani2(int, float, float, float, int, str)
| object
|
|-
| showcharacter()
|
|
|-
| showimg(int, str, float, float)
| object
|
|-
| showimg2(int, str, float, float, float)
| object
|
|-
| showlocal()
|
|
|-
| showpoly(int, obj)
| object
|
|-
| showpoly2(int, obj)
| object
|
|-
| showtext(int, float, float, str, str, str)
| object
|
|-
| showtext2(int, float, float, float, str, str, str)
| object
|
|-
| take(str)
|
|
|-
| take2(int)
|
|
|-
| takehorse(int)
|
|
|-
| throwcarry()
|
|
|-
| timereverywhere()
|
|
|-
| toweapons(str)
|
|
|}

Latest revision as of 14:00, 14 April 2012

Inherits TServerPlayer.

Variables

Name Type Description
actionplayer integer (read only)
hearts float
height float (read only)
horseimg string
hp float
hurtdx float
hurtdy float
image string
layer integer
peltwithblackstone boolean (read only)
peltwithbush boolean (read only)
peltwithnpc boolean (read only)
peltwithsign boolean (read only)
peltwithstone boolean (read only)
peltwithvase boolean (read only)
save object (read only)
shieldpower integer
sprite integer
swordpower integer
visible boolean True if the NPC is not hidden
isblocking boolean (read only) True if the NPC is blocking
width float (read only)
x float
y float

Functions

Name Return Type Description
blockagain()
blockagainlocal()
canbecarried()
canbepulled()
canbepushed()
cannotbecarried()
cannotbepulled()
cannotbepushed()
carryobject(str)
changeimgcolors(int, float, float, float, float)
changeimgmode(int, int)
changeimgpart(int, int, int, int, int)
changeimgvis(int, int)
changeimgzoom(int, float)
destroy()
dontblock()
dontblocklocal()
drawaslight()
drawoverplayer()
drawunderplayer()
findimg(int) object
hide()
hideimg(int)
hideimgs(int, int)
hidelocal()
hurt(int)
lay(str)
message(str)
move(float, float, float, int)
setbow(str)
setcharani(str, str)
setchargender(str)
setcoloreffect(float red, float green, float blue, float alpha) Sets the color and alpha transparency of the npc, use seteffectmode(1) to make the npc alpha-transparent instead of displaying it as a light.
seteffectmode(int)
setimg(str)
setimgpart(str, int, int, int, int)
setshape(int, int, int) Enables rectangular blocking behaviour for the NPC. Parameters are shape type (right now only 1 for rectangular is supported), and the width and height in pixels.
setshape2(int, int, obj) Enables tile-based blocking behaviour. Parameters are tile width, height and an array of tile types. Supported tile types:
Value Description
0 Nonblocking
2 Hurting underground
3 Chair
4 Bed upper side
5 Bed lower side
6 Swamp
7 Lava swamp
8 Near water
9 Near lava
11 Water
12 Lava
20 Throw-through (fences)
21 Jumping stone
22 Blocking tile
setzoomeffect(float)
shootarrow(int)
shootball()
shootfireball(int)
shootfireblast(int)
shootnuke(int)
show()
showani(int, float, float, int, str) object
showani2(int, float, float, float, int, str) object
showcharacter()
showimg(int, str, float, float) object
showimg2(int, str, float, float, float) object
showlocal()
showpoly(int, obj) object
showpoly2(int, obj) object
showtext(int, float, float, str, str, str) object
showtext2(int, float, float, float, str, str, str) object
take(str)
take2(int)
takehorse(int)
throwcarry()
timereverywhere()
toweapons(str)