NPC Commands + What they do!

Blaminator

VIP
Golden Oldie
Loyal Member
Jul 11, 2003
2,731
0
193
London
Could a mod make this sticky please,


Commands :

@main
CHECK
CHECKOPEN
CHECKUNIT
RANDOM
GENDER
DAYTIME
CHECKLEVEL
CHECKJOB
CHECKITEM
CHECKITEMW
CHECKGOLD
ISTAKEITEM
CHECKDURA
CHECKDURAEVA
DAYOFWEEK
HOUR
MIN
CHECKPKPOINT
CHECKLUCKYPOINT
CHECKMONMAP
CHECKMONAREA
CHECKHUM
CHECKBAGGAGE
CHECKNAMELIST
EQUAL
LARGE
SMALL
SET
RESET
SETOPEN
SETUNIT
RESETUNIT
TAKE
GIVE
TAKEW
CLOSE
MAPMOVE
MAP
BREAK
TIMERECALL
BREAKTIMERECALL
PARAM1
PARAM2
PARAM3
PARAM4
TAKECHECKITEM
MONGEN
MONCLEAR
MOV
INC
DEC
SUM
MOVR
EXCHANGEMAP
RECALLMAP
ADDBATCH
BATCHDELAY
BATCHMOVE
PLAYDICE
ADDNAMELIST
DELNAMELIST
GOQUEST
ENDQUEST
GOTO
#IF
#CALL
#ACT
#HOME
#SETHOME
#INCLUDE
#ELSEACT
#ELSESAY
#RAND
#DEFINE
@s_repair
@buy
@sell
@repair
@makedrug
@prices
@storage
@getback
@upgradenow
@getbackupgnow
@exit
~@upgradenow_ing
~@upgradenow_ok
~@upgradenow_fail
~@getbackupgnow_ok
~@getbackupgnow_ing
~@getbackupgnow_fail

@@buildguildnow
@@guildwar
@@donate
@requestcastlewarnow

@@withdrawal
@main
@@receipts
@openmaindoor
@closemaindoor
@repairdoornow
@repairwallnow1
@repairwallnow2
@repairwallnow3
@hireguardnow
@hireguards
@hirearchernow
 

Blaminator

VIP
Golden Oldie
Loyal Member
Jul 11, 2003
2,731
0
193
London
etc

set [x] 1/0

eg
set [30] 1


this will set the variable number with either a 1 or a 0




check [x] 1/0

eg
#IF
check [30] 1
#ACT
goto @talk


this will check the character variable number 30, if it is 1, then it will goto the sub named @talk




goto <sub procedure>


eg
goto @nextone


this will move the script on to the specified sub procedure




checkjob warrior/taoist/wizard

eg
#IF
checkjob warrior
#ACT
goto @hesawarrior


this checks the current characters job




checklevel x

eg
#IF
checklevel 30
#ACT
goto @heslevel30


this checks the current characters level





checkitem <item> <ammount>

eg
#IF
checkitem GoldBar 1
#ACT
goto @gotgoldbar


this will check if the user has got the specified ammount of the speicifed item




checkgold <ammount>

eg
#IF
checkgold 1000
#ACT
goto @gotthegold




this will check if the user has got the specified ammount of gold or not





give <item> <ammount>

eg
give GoldBar 3


this will give the user the specified ammount of the specified item




take <item> <ammount>

eg
take GoldBar 3


this will take away from the user the specified ammount of the specified item




map <map id>

eg
map B101




this will move the user to the specified map at a random coord







mapmove <map id> <x coord> <y coord>

eg
map 0 300 300




this will move the user to the speicifed map and coords




Param1 <map name>
Param2 <target x loc>
Param3 <target y loc>
MonGen <mob name> <ammount> <?>



eg
Param1 0102
Param2 7
Param3 7
MonGen Woomataurus 1 1


this will spawn the specified number of the specified mob on the specified map, at the specified loc(random?)




monclear <map name>


eg
monclear 0102


this will clear all the MOBS from the specified map, all NPCs will remain





daytime <time of day>


eg
#IF
daytime day
#SAY
Its daytime!


this will check what time it is, choices are day/night/sunraise/sunset




random <number>


eg
#IF
random 10
#SAY
A one out of ten chance, and you got it!
#ELSESAY
Rofl, joo sook


this will give the user a 1/x chance for the script to move on to the next command, x being the number entered




timerecall <time in minutes>


eg
#IF
checklevel 30
#SAY
In you go, ill fetch you out after five minutes!
#ACT
map g004 5 5
timerecall 5


this will recall the user from the map he was sent from in the specified number of minutes




breaktimerecall


eg
breaktimerecall


this will stop all timerecall timers for this character




checkbaggage


eg
#IF
checkbaggage
#SAY
you have room, here you go!
#ACT
give Woomahorn
#ELSESAY
you have no room! heres some gold instead.
#ELSEACT
give gold 1000000


this will check to see if you have room in your bag or not for an item




movr <variable name> <number>


eg
#ACT
movr d0 6
inc d0 1
#SAY
you have rolled the number <$STR(D0)>!


this will roll a number between 0 and the specified number, and store it in the specified variable
to access the stored number, look up <$STR(x)> below




inc <variable> <number>


eg
#ACT
movr d0 6
inc d0 1


this will increase the specified variable by the specified ammount




equal <variable> <number>


eg
#ACT
movr d0 6
inc d0 1
#IF
equal d0 1
#SAY
you rolled a one!


this will check to see if the variable specified is the number specified or not




playdice <number of dice> <target sub>


eg
[@main]
<Roll the dice!/@roll>

[@roll]
#ACT
movr d0 6
inc d0 1
playdice 1 @cube

[@cube]
#SAY
You rolled a <$STR(D0)>!


this will show the specified number of dice rolling(values stored in d0-9), after they have stopped rolling
they will move onto the specified sub-procedure



batchDelay <time in seconds>
addbatch <map name>
batchmove


eg
batchDelay 1
addbatch 0101
addbatch 0102
addbatch 0103
addbatch 0104
batchmove


this will move the player through each of the specified maps, at an interval of the specified seconds.




checkhum <map> <number>


eg
#IF
checkhum 0101 5
#SAY
Im afraid there are already two people in the room, come back later!
#ELSESAY
In you go!
#ELSEACT
map 0101




close


eg
close


this will close the current dialog box that is open


break


eg
break


this will stop the script. ie, it will not continue with the next #IF #ACT functions.

Example scripts using #SAY


[@main]
#IF
checkgold 3000
#SAY
You have 3000 gold, do you want to buy my uberthing?
<Yes/@buyit>
<No/@nothanks>


[@buyit]
#IF
checkgold 3000
#ACT
take gl 3000
give uberthing 1
#SAY
Heres your uberthing!
<Close/@exit>


[@nothanks]
#ACT
give notsouberthing 1
#SAY
Fine
heres a notsouberthing, on the house
Enjoy!


gender <gender>
Check if the character is male or female
For use with gender specific items (armour)

#IF
gender man
#SAY
You are male
#ELSESAY
You are female
(There is no Gender woman, for woman use #elseact )

DAYOFWEEK <3 letter day> ( MON TUE WED THU FRI SAT SUN )

eg
#if
DAYOFWEEK MON
#say
it is monday
#elsesay
It is not monday


Script Identifiers:

<$USERNAME> = current character name
<$USERWEAPON> = current characters weapon
<$STR(x)> = returns the value of the variable x
<$CASTLEWARDATE> = returns the date of the next sabuk war
<$LISTOFWAR> = lists all the upcomming subak wars

checkitemw <item>

Check's that the item is being worn by player.

takew <item>

Takes item being worn


in better detail
 

logic3

Dedicated Member
Dedicated Member
Nov 17, 2003
88
0
53
yo dude, can u make a NPC check for a chara name!? so that only i could use that certain NPC?

Nice work btw
 

DeathWish

LOMCN VIP
VIP
Oct 29, 2003
1,269
1
185
lol thats easy :P just use the checknamelist command :P


so like this...

[@main]
#IF
checknamelist something.txt
#SAY
Welcome logic3\
What would you like to do?\ \

<Blah blah/@blahblah>\
<Blah/@blah>\
#ELSESAY
You have no permision to be here\ \

<Ok Bye/@exit>\



but where u put ur npc like market_def folder u hav to make a .txt file called "something" in this case then you have to add ur char name to it.
 

logic3

Dedicated Member
Dedicated Member
Nov 17, 2003
88
0
53
DeathWish2003 said:
lol thats easy :P just use the checknamelist command :P


so like this...

[@main]
#IF
checknamelist something.txt
#SAY
Welcome logic3\
What would you like to do?\ \

<Blah blah/@blahblah>\
<Blah/@blah>\
#ELSESAY
You have no permision to be here\ \

<Ok Bye/@exit>\



but where u put ur npc like market_def folder u hav to make a .txt file called "something" in this case then you have to add ur char name to it.

Cheers for that m8
 

Zaron

Dedicated Member
Dedicated Member
Sep 22, 2003
198
1
64
so how wud a pet giver npc work? cud any1 write a script 4 me? :P
 

Aspious

Dedicated Member
Dedicated Member
Nov 27, 2003
21
0
47
Question..

[@aab]
#IF
DAYOFWEEK MON
#SAY
<Here is your task/@mon>
break
#IF
DAYOFWEEK TUE
#SAY
<Here is your task/@tue>

through to Sunday, would that work?

or this

[@aab]
#IF
DAYOFWEEK MON
#SAY
<Here is your task/@mon>
break
#ELSEIF
DAYOFWEEK TUE
#ELSESAY
<Here is your task/@tue>
 

nup72

Dedicated Member
Dedicated Member
Feb 28, 2004
101
3
64
:bannana:er can someone tell me where i put in there commands plz :spoke: just got a server up so i need a couple o npc's to make it good :D
 

Emin3m

Dedicated Member
Dedicated Member
Oct 12, 2003
42
0
53
is there any command to remove players skills and give them skills?
 

Sean

Developer
Golden Oldie
Loyal Member
May 13, 2003
699
0
172
Emin3m said:
is there any command to remove players skills and give them skills?

Sadly not.
And in response to somebody elses question.
What an NPC buys and sells is dictated by the top numbers

%100 - Saying that it buys and sells
+STD - Put the STD number of the item that you want to sell here

E.G.

%100
+5
+6

This NPC will buy, sell and repair Weapons and Pickaxes,
 

DeathWish

LOMCN VIP
VIP
Oct 29, 2003
1,269
1
185
Emin3m said:
is there any command to remove players skills and give them skills?

u can do freepk halfmoon, freepk skillname

and it deletes the skill, thats only if u hav deadsons m2server.exe