Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Got “VMware Workstation and Device/Credential Guard are not compatible” error in VMware Workstation on Windows 10? Solution: You need to disable Device Guard and turn off Hyper-V.
Step 1: gpedit.msc Computer Configuration -> Administrative Template -> System -> Device Guard Set “Turn On Virtualization Based Security” to Disabled
Or regedit Navigate HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\DeviceGuard Add a new DWORD value named EnableVirtualizationBasedSecurity and set its value to 0
Step 2: Turn off Hyper-V bcdedit /set hypervisorlaunchtype off
Step 3: Reboot.
Recovery steps: Step 1: gpedit.msc Computer Configuration -> Administrative Template -> System -> Device Guard Set “Turn On Virtualization Based Security” to Not configured
Or regedit Navigate HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\DeviceGuard Delete the registry “EnableVirtualizationBasedSecurity”
Step 2: Turn on Hyper-V bcdedit /set hypervisorlaunchtype auto
config setup # strictcrlpolicy=yes # uniqueids = no
conn L2TP-PSK-noNAT authby=secret #shared secret. Use rsasig for certificates. auto=add #the ipsec tunnel should be started and routes created when the ipsec daemon itself starts. keyingtries=3 #Only negotiate a conn. 3 times. ikelifetime=8h keylife=1h ike=aes256-sha1,aes128-sha1,3des-sha1 type=transport #because we use l2tp as tunnel protocol left=1.2.3.4 # Your server's public IP #fill in server IP above leftprotoport=17/1701 right=%any rightprotoport=17/%any dpddelay=10 # Dead Peer Dectection (RFC 3706) keepalives delay dpdtimeout=20 # length of time (in seconds) we will idle without hearing either an R_U_THERE poll from our peer, or an R_U_THERE_ACK reply. dpdaction=clear # When a DPD enabled peer is declared dead, what action should be taken. clear means the eroute and SA with both be cleared.
[global] ipsec saref = yes saref refinfo = 30 ;debug avp = yes ;debug network = yes ;debug state = yes ;debug tunnel = yes [lns default] ip range = 192.168.1.2-192.168.1.100 ; IP address range for clients local ip = 192.168.1.1 ; Local IP address for VPN server require chap = yes refuse pap = yes require authentication = yes ;ppp debug = yes pppoptfile = /etc/ppp/options.xl2tpd length bit = yes
sudo nano /etc/ppp/options.xl2tpd
1 2 3 4 5 6 7 8 9 10 11 12 13
require-mschap-v2 ms-dns 8.8.8.8 ms-dns 8.8.4.4 auth mtu 1200 mru 1000 crtscts hide-password modem name l2tpd proxyarp lcp-echo-interval 30 lcp-echo-failure 4
從 How I Met Your Mother S4E23 聽到的 經歷了數場戀愛卻都宣告失敗的 Ted 正向 Stella 吐苦水 Ted 多麼希望能擁有像 Marshall 和 Lilly 一樣的真愛 Stella 說了這句話安慰感到人生很難的 Ted: “She’s on her way, Ted. And she’s getting here as fast as she can.” 此時這首歌正好和兩人的心境相呼應:兩人都被分手了 Ted 上一次被分手真的受了不小的打擊,原本以為可以和她走到以後 Stella 則是好幾年前分手後,就專心當個全職媽媽,不再對男人抱持希望
It's the little things
They pulled me in
And I'm defenseless
I try to ignore
Like I've done before
But it's just useless
I’ve made up my mind that I’m gonna let you in And I’m not afraid But I have to say
This is gonna hurt if it ever ends But somehow you out shattered my defense This is gonna hurt if it ever starts So promise you’ll be careful with my heart
It’s the things you do They made me fall hard for you and I can’t help it And it’s every day that I feel this way So just don’t stop it
I’ve made up my mind that I’m gonna let you in And I’m not afraid But I have to say
This is gonna hurt if it ever ends But somehow you out shattered my defense This is gonna hurt if it ever starts So promise you’ll be careful with my heart
I won’t make excuses They just all seem useless You don’t have the time I guess I’ll take my chances now that I know love is on the line
This is gonna hurt if it ever ends But somehow you out shattered my defense This is gonna hurt if it ever starts So promise you’ll be careful with my heart
Hello, and welcome to my attempt to teach everyone NPC scripts better. Regardless of the countless tutorials, and countless Help threads that have been posted and solved, people still seem to have issues with NPCs. Hopefully, with this tutorial, people will learn something. Before we start, let me tell you a bit about myself. I joined RageZone in October of 2008. I started just like most of you guys, not knowing a god damn thing. I’ve had my share of nub questions asked, but I’ve also learned from the help others have given me. I read tutorial after tutorial to learn more, so I didn’t have to rely on others to answer my questions. Sure, there are still quite a few things I don’t know, no one knows everything. Anyone who says otherwise is a damn fool. The main point I’m trying to make is, if you truly want to be good at something, it takes work. You can’t sit back, have others do the work, and expect to become a pro at whatever it is you wish to do. You have to show initiative, and want to learn. I hope my tutorial teaches you something, even if it’s just one thing.
functionstart() { cm.sendOk("哈囉,你帶來 #v" + gl + "#了嗎?"); // Calls the variable gl, and the information it is replacing cm.dispose(); }
As you can see from the example, the item id 4000313 is being replaced with the variable “gl”. Even though it’s only a minor difference, I shortend the script by 1 character. Now imagine having hundreds of places on a script where 4000313 was replaced by “gl”. It adds up on how much space you save by using variables. That was an example on how to use a variable for a number. Here is one on how to use a variable for a string, or text sentence.
As you can see, the item ids are placed in the order they are shown in the sendSimple. The [selection] in the cm.gainItem method, calls the Array to determine which item to give the player. If they chose the second selection, it would call the second number in the Array. By placing the items in an Array, it shortens the script by a lot. Here is what the script would look like without an Array.
There is a clear difference between the two in which is longer. One of the most common ways to use Arrays, is with the infamous for loop, which I will explain in a later lesson.
第二課: 學習多維陣列與亂數
本節我會教你多維陣列和亂數。Now, I’m not an expert at this, so I’ll only be able to show you what I know. 什麼是多維陣列?多維陣列就是由陣列組成的陣列。Basically, you can have more than one array, and simplify them further by making them into a multi-dimentional array. Unfortunately, I only know how to use them with randoms, so that is what I’ll be teaching you. First, lets’ set up a simple multi-dimentional array NPC.
Alright, time to explain. This is the multi-dimentional array.
1
var item = [[4001129, 4001129], [1082025, 1102023], [4000313, 1002085]];
Each separete array is colored, so you can see the 3 different arrays within the multi-dimentional array. Next is the random part, or this little snippet.
Think of this as if it were a dice. The number symbolizes the sides of a dice. So on this dice, there are 100 sides. Continue reading the random part as you read this. If the dice lands on side 1 - 50, give an item in the first array. If the dice lands on side 51 - 90, give an item in the second array. If it lands on any other side, give an item in the third array. This line here…
Basically follows through with the action. That is all I know about these types of arrays.
第三課: Learning the Infamous For Loop
你可曾在腳本看見這樣的東西?
1 2
for (var i = 0; i < options.length; i++) text += "\r\n#L"+i+"#"+options[i]+"#l";
This is the infamous for loop. It simplifies almost anything it is used with. It was created to specifically deal with Arrays. Here is the entire part of the code, so I can explain what it means.
1 2 3 4 5
var text = "#e#k What region have you trained in?#b"; var options = newArray("Aqua Road Region = 1 #v4001010#", "Ariant Region = 1 #v4001011#", "El Nath Region = 1 #v4001013#", "Ludas Lake Region = 1 #v4001012#", "Minar Forest Region = 1 #v4001009#", "Victoria Island Region = 5 #v4001126#", "World Tour = 5 #v4001129#", "Ores/Crystals = 1 #v4001014#"); for (var i = 0; i < options.length; i++) text += "\r\n#L"+i+"#"+options[i]+"#l"; cm.sendSimple(text);
Ok so, i = 0. While 0 is less than the options array, do the code. After executing the code, do i++. i++ basically tells the program running the script to increase i until it reaches the length of the array. So since the options array has a length of 8, it will keep increasing until it displays all 8 options.
Contributions from other members Spoiler:
Quote Originally Posted by .:LastBreath:. View Post
Insert In NpcConversatonManager:
1 2 3 4
publicvoidchangeKeyBinding(int key, int type, int action){ getPlayer().changeKeybinding(key, new MapleKeyBinding(type, action)); getPlayer().sendKeymap(); }
functionaction(mode, type, selection) { if (mode == -1) { cm.dispose(); } else { if (mode == 0 && status == 1) { cm.dispose(); return; } if (mode == 1) status++; else status--; if (status == 0) { cm.sendYesNo("Hello there! Do you want to learn 二段跳?"); } elseif (status == 1) { cm.sendSimple("Which key do you want #fSkill/411.img/skill/4111006/icon# on? #b\r\n#L59#F1#L60#F2#L61#F3#L62#F4#L63#F5#L64#F6#L65#F7#L66#F8#L67#F9 \r\n #L68#F10#L87#F11#L88#F12 \r\n#L2#1#L3#2#L4#3#L5#4#L6#5#L7#6#L8#7#L9#8#L10#9#L11#0#L12#-#L13#= \r\n#L16#Q#L17#W#L18#E#L19#R#L20#T#L21#Y#L22#U#L23#I#L24#O#L25#P#L26#[#L27#] \r\n#L30#A#L31#S#L32#D#L33#F#L34#G#L35#H#L36#J#L37#K#L38#L#L39#;#L40#' \r\n#L42#Shift#L44#Z#L45#X#L46#C#L47#V#L48#B#L49#N#L50#M#L51#,#L52#.#L42#Shift \r\n#L29#Ctrl#L56#Alt#L57#SPACE#L56#Alt#L29#Ctrl \r\n#L82#Ins#L71#Hm#L73#Pup#L83#Del#L79#End#L81#Pdn"); } elseif (status == 2) {2 cm.sendOk("There you go!"); cm.changeKeyBinding(selection, 1, 4111006); cm.dispose(); } else { cm.sendOk("See you next time then."); cm.dispose(); } } }
CM command: Code: changeKeyBinding allows you to place a skill anywhere in your key config. How to use: cm.changeKeyBinding(selection, 1, SKILLID); (THINKS THATS HOW TO USE?) ALL CREDITS GOES TO “made4forum” FROM HIS RELEASE LINK:Skill teaching NPC …. Further Explanation of the For Loop Quote Originally Posted by Rice
Final Words
This concludes the tutorial. There is still quite a bit I don’t know, even with NPCs. If anyone has something they wish to add/contribute, feel free to post it and I’ll include it with credits. I hope you enjoyed my wall of text and learned something valuable. Please leave credits if this is posted anywhere else. Lastly, if you need help with an NPC script or have trouble understanding something, feel free to ask HERE. Do not quote the entire tutorial. If you do, I will ask a Mod to remove your post, because it’s an inconvenience for others.
Credits: Shawn aka bboy242 aka DevonsDaddy
Special Thanks: Moogra and Osiris .:LastBreath:. made4forum Alcohol Rice