Created
May 17, 2018 20:33
-
-
Save allanon/bb833a95570e228f12ae3159c7ba210a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro quest_juice { | |
if (@config(quest_juice) == complete) stop | |
# Get 1 Meat. | |
call quest_talk prontera '64 125' 'b b0,1 e' | |
# => 1x Meat | |
# Morrison | |
call quest_talk prt_in '47 173' 'r1 r1 e' | |
# Marianne | |
call quest_talk prt_in '49 172' 'e' | |
log Juice quest complete! | |
do conf -f quest_juice complete | |
stop | |
# Fruit juice workshop. | |
do move 188 146 payon_in03 10 | |
} | |
macro newbie_all { | |
call newbie_1 | |
pause 4 | |
call newbie_2 | |
pause 4 | |
call newbie_3 | |
pause 10 | |
call newbie_4 | |
} | |
macro newbie_1 { | |
# Sprakki#1 | |
do move 53 114 new_1-1 10 | |
do talknpc 53 114 e | |
# => quest 7117 | |
# => 2x Pumpkin Pie | |
do move 148 112 | |
pause 2 | |
# Sprakki#2 | |
do move 101 29 | |
do talknpc 100 29 r0 | |
# <= quest 7117 | |
# => quest 7118 | |
# => 2 xp, 6 jxp | |
} | |
macro newbie_2 { | |
# Brade | |
do move 100 100 | |
do talknpc 100 105 e | |
# <= quest 7118 | |
# => quest 7119 | |
# => 13 xp, 2 jxp | |
# => 1x Tattered Novice Ninja Suit | |
# => 1x Somber Novice Hood | |
# => 1x Novice Slippers | |
# => 1x Novice False Eggshell | |
# => 1x Novice Main-Gauche | |
# => 1x Novice Guard | |
# => 300x Novice Potion | |
# Equip our new gear. | |
do eq &inventory(Tattered Novice Ninja Suit) | |
do eq &inventory(Somber Novice Hood) | |
do eq &inventory(Novice Slippers) | |
do eq &inventory(Novice False Eggshell) | |
do eq &inventory(Novice Main-Gauche) | |
do eq &inventory(Novice Guard) | |
# Brade | |
do talknpc 100 105 e | |
# <= quest 7119 | |
# => quest 7120 | |
# => 9 xp, 0 jxp | |
# => 50x Novice Fly Wing | |
# => 20x Novice Butterfly Wing | |
# Jinha | |
do move 110 110 | |
do talknpc 115 120 r0 e | |
# => skill First Aid | |
# Brade | |
do talknpc 100 105 e | |
# <= quest 7120 | |
# => 1x Novice Adventurer's Suit [1] | |
# Equip our new gear. | |
pause 1 | |
do eq &inventory(Novice Adventurer's Suit [1]) | |
} | |
macro newbie_3 { | |
do move 73 106 | |
pause 2 | |
# Chocolat and crew | |
do talknpc 33 172 e | |
# => quest 7121 | |
do talknpc 30 176 r0 r4 e | |
do talknpc 33 172 e | |
do talknpc 33 176 e | |
do talknpc 33 172 e | |
do talknpc 36 176 e | |
do talknpc 33 172 e | |
# <= quest 7121 | |
# => xp 11, jxp 0 | |
# => 20x Free Ticket for Kafra Storage | |
# => 30x Free Ticket for Kafra Transportation | |
# => teleport new_1-3 | |
# Wait for teleport to complete and actors to appear. | |
pause 3 | |
# Brade again. | |
do talknpc 96 30 e | |
# => quest 7122 | |
# Kill porings until base 10 and job 10. | |
[ | |
do conf lockMap new_1-3 | |
do conf route_randomWalk 1 | |
do conf follow 0 | |
do conf attackAuto 2 | |
do conf attackAuto_party 1 | |
do conf attackUseWeapon 1 | |
do conf attackMinPlayerDistance 2 | |
do conf itemsMaxWeight 89 | |
do conf attackDistanceAuto 1 | |
do conf attackDistance 1 | |
do conf attackMaxDistance 1 | |
do conf autoHealTarget none | |
do conf autoWeight 0 | |
do conf autoArrows 0 | |
do conf sitAuto_hp_lower 0 | |
do conf sitAuto_sp_lower 0 | |
do conf basic_heals.aggressives none | |
do conf basic_heals.notInTown none | |
do ai on | |
] | |
} | |
# Kill one poring (quest 7122), then... | |
macro newbie_4 { | |
# Brade, final time. | |
call quest_talk new_1-3 '96 30' e | |
# <= quest 7122 | |
do eq Novice Cutter [3] | |
# Get quests from job guides. | |
# Swordsman Guide | |
call quest_talk new_1-3 '97 41' r2 | |
# => quest 7123 (kill 2 Pickys) | |
# Mage Guide | |
call quest_talk new_1-3 '101 41' r2 | |
# => quest 7124 (kill 5 Lunatics) | |
# Thief Guide | |
call quest_talk new_1-3 '105 41' r2 | |
# => quest 7127 (kill 5 Willows) | |
# Merchant Guide | |
call quest_talk new_1-3 '109 41' r2 | |
# => quest 7126 (gain 300 zeny) | |
# Get Thief Job Manual. The manuals are mutually exclusive, and the thief one has a good passive skill (Double Attack). | |
call quest_talk new_1-3 '105 41' 'r0 r0' | |
# => 1x Thief Manual | |
# Getting a manual unequips everything. Re-equip. | |
do eq Novice False Eggshell | |
do eq Novice Adventurer's Suit [1] | |
do eq Novice Guard | |
do eq Novice Slippers | |
do eq Novice Cutter [3] | |
do eq Thief Manual | |
call newbie_4a | |
# Go complete quests. | |
} | |
automacro newbie_brade_heal { | |
CurrentHP < 80% | |
NpcNear /Brade/ | |
InMap new_1-3,new_2-3,new_3-3,new_4-3,new_5-3 | |
timeout 10 | |
call { | |
log HP [$.CurrentHPLast] [$.CurrentHPLastPercent] | |
do talknpc 96 30 e | |
} | |
} | |
macro newbie_4a { | |
# Sell junk. | |
call quest_talk new_1-3 '100 50' s | |
[ | |
@equips = (Club [3],Club [4],Cotton Shirt,Hat,Knife [3],Novice Main-Gauche,Somber Novice Hood,Tattered Novice Ninja Suit) | |
while (@equips > 0) as equips | |
$equip = &shift(@equips) | |
$ids = &Inventory($equip) | |
if ($ids != -1) { | |
do sell $ids | |
} | |
end equips | |
do sell 'Barren Trunk,Clover,Feather,Feather of Birds,Fine-grained Trunk,Fluff,Iron Ore,Jellopy,Mushroom Spore,Resin,Shell,Solid Trunk,Spawn,Sticky Mucus,Sticky Webfoot,Tree Root' | |
do sell 'Green Herb' | |
do sell done | |
] | |
} | |
macro newbie_5 { | |
if (&questCompleteCount(7123) == 1) { | |
# Swordsman Guide | |
call quest_talk new_1-3 '97 41' r3 | |
# <= quest 7123 | |
# => 200x Novice Potion | |
# => 200/100 xp | |
} | |
if (&questCompleteCount(7124) == 1) { | |
# Mage Guide | |
call quest_talk new_1-3 '101 41' r3 | |
# <= quest 7124 | |
# => 30x Novice Butterfly Wing | |
# => 200/100 xp | |
} | |
if (&questCompleteCount(7127) == 1) { | |
# Thief Guide | |
call quest_talk new_1-3 '105 41' r3 | |
# <= quest 7127 | |
# => 50x Novice Fly Wing | |
# => 200/100 xp | |
} | |
if (&questCompleteCount(7126) == 1) { | |
# Merchant Guide | |
call quest_talk new_1-3 '109 41' r3 | |
# <= quest 7126 | |
# => 7x Phracon | |
# => 200/100 xp | |
} | |
} | |
macro newbie_6 { | |
# Leave the newbie castle. | |
[ | |
do conf attackMinPlayerDistance 6 | |
do conf attackAuto_onlyWhenSafe 1 | |
] | |
if (&config(job_base) = merchant) { | |
call quest_talk new_1-4 '100 29' 'r0 r3' | |
call job_merchant | |
} | |
if (&config(job_base) = thief) { | |
call quest_talk new_1-4 '100 29' 'r1 r3 r0 r0 r0 r1 r0 r0 r0 r0 r1 r0 r1 r0 r0 r2 r2 r1 r0 r2 r2 r1 r1 r0' | |
# => 1x Novice Main Gauche [3] | |
# => tele morocc 155 44 | |
call job_thief | |
} | |
if (&config(job_base) = acolyte) { | |
call quest_talk new_1-4 '100 29' 'r1 r0 r1 r2 r1 r0 r1 r0 r1 r0 r1 r1 r0 r1 r1 r1 r0 r2 r1 r0 r1 r3 r0 r0' | |
# => 5x Free Ticket for Kafra Storage | |
# => 5x Free Ticket for Kafra Transportation | |
# => 1x Novice Mace [3] | |
# => tele prt_church 172 19 | |
call job_acolyte | |
} | |
if (&config(job_base) = mage) { | |
call quest_talk new_1-4 '100 29' 'r1 r1 r0 r2 r0 r1 r1 r0 r1 r0 r0 r0 r1 r1 r0 r1 r0 r0 r0 r0 r1 r3 r2 r0' | |
# => 5x Free Ticket for Kafra Storage | |
# => 5x Free Ticket for Kafra Transportation | |
# => 1x Novice Rod [3] | |
# => 1x Novice Cutter [3] | |
# => tele geffen_in 163 98 | |
call job_mage | |
} | |
if (&config(job_base) = swordsman) { | |
call quest_talk new_1-4 '100 29' 'r1 r1 r1 r2 r1 r1 r2 r0 r1 r0 r1 r1 r1 r0 r1 r0 r0 r2 r0 r1 r2 r1 r1 r0' | |
# => 5x Free Ticket for Kafra Storage | |
# => 5x Free Ticket for Kafra Transportation | |
# => 1x Novice Falchion [3] | |
# => tele izlude_in 74 167 | |
call job_swordsman | |
} | |
if (&config(job_base) = archer) { | |
} | |
} | |
macro job_archer { | |
# Archer Guildsman | |
call quest_talk payon_in02 '64 71' 'r0 r0 r0' | |
# <= 3x Fine-grained Trunk | |
# <= 5x Solid Trunk | |
# <= 3x Barren Trunk | |
# => 1x Bow [4] | |
# => 42x Arrow | |
} | |
macro job_mage { | |
# Mage Guildsman | |
call quest_talk geffen_in '164 124' 'r0 r0' | |
# => quest 1007 | |
# => 1x Empty Test Tube | |
# Dollshoi | |
call quest_talk pay_arche '122 100' 'r0' | |
# <= 1x Empty Test Tube | |
# <= 50z | |
# => 1x Payon Solution | |
call quest_talk geffen_in '164 112' 'r0 r0 r0 d6 r1 d1 r3 r0 r0 d2750 r0 r2' | |
# <= 6x Jellopy | |
# <= 1x Fluff | |
# <= 1x Payon Solution | |
# <= 1x Blue Gemstone | |
# => 1x Unknown Test Tube | |
# Mage Guildsman | |
call quest_talk geffen_in '164 124' 'e' | |
# <= quest 1007 | |
# <= 1x Unknown Test Tube | |
# => job Mage | |
} | |
macro job_swordsman { | |
# Swordsman | |
call quest_talk izlude_in '74 172' 'r0 r0 r0' | |
# => quest 1014 | |
# Swordsman (teleporter) | |
call quest_talk izlude_in '62 170' 'e' | |
# => tele izlude_in 39 170 | |
# Test Hall Staff | |
call quest_talk izlude_in '30 163' 'e' | |
# => tele sword_1-1 10 245 | |
do conf route_avoidWalls 0 | |
pause 5 | |
call job_swordsman_test1 | |
pause 5 | |
call job_swordsman_test2 | |
pause 5 | |
call job_swordsman_test3 | |
pause 5 | |
do conf route_avoidWalls 1 | |
# Swordsman | |
call quest_talk izlude_in '74 172' 'r0' | |
# <= quest 1014 | |
# => job Swordsman | |
} | |
macro job_swordsman_test1 { | |
# do move 65 117 | |
do move 12 247 | |
do move 22 247 | |
do move 24 249 | |
do move 34 249 | |
do move 36 247 | |
do move 48 241 | |
do move 98 241 | |
do move 98 240 | |
do move 118 240 | |
do move 118 249 | |
do move 140 251 | |
do move 175 251 | |
do move 175 245 | |
do move 187 243 | |
do move 192 244 | |
pause 2 | |
do move 223 243 | |
} | |
macro job_swordsman_test2 { | |
# do move 161 27 | |
do move 11 202 | |
do move 188 202 | |
do move 188 207 | |
do move 193 207 | |
pause 2 | |
do move 223 205 | |
} | |
macro job_swordsman_test3 { | |
# do move 239 117 | |
do move 21 168 | |
do move 21 175 | |
do move 36 175 | |
do move 36 173 | |
do move 43 173 | |
do move 43 172 | |
do move 45 172 | |
do move 45 171 | |
do move 51 171 | |
do move 51 172 | |
do move 58 172 | |
do move 58 169 | |
do move 92 169 | |
do move 92 171 | |
do move 129 171 | |
do move 129 174 | |
do move 151 174 | |
do move 151 171 | |
do move 170 171 | |
do move 180 171 | |
do move 180 172 | |
do move 183 172 | |
do move 183 173 | |
do move 191 173 | |
do move 191 168 | |
do move 193 168 | |
pause 2 | |
do talknpc 223 167 e | |
# => tele izlude_in 66 173 | |
} | |
macro job_acolyte { | |
# Cleric | |
call quest_talk prt_church '184 41' 'r0' | |
# => quest 1003 | |
# Ascetic (Father Yosuke) | |
call quest_talk prt_fild00 '208 218' 'e' | |
# Cleric | |
call quest_talk prt_church '184 41' 'e' | |
# <= quest 1001 | |
# <= quest 1002 | |
# <= quest 1003 | |
# => job Acolyte | |
# => 21 xp | |
# Re-equip what we can. | |
do eq Novice Adventurer's Suit [1] | |
do eq Novice Mace [3] | |
# Drop junk equipment we can't wear anymore. | |
do drop &inventory(Novice False Eggshell) | |
do drop &inventory(Novice Guard) | |
do drop &inventory(Novice Slippers) | |
} | |
macro job_priest { | |
# High Bishop - Bishop Paul | |
do move 16 41 prt_church 20 | |
do conf debugPacket_received 2 | |
do conf debugPacket_sent 2 | |
do talknpc 16 41 r0 r0 r0 e | |
# Kore thinks the conversation is done, but the server does not. | |
# Try to convince the server we're done. | |
# pause 5 | |
# log Good luck? | |
# $test = @eval( $::talk{canceled} = 1 ) | |
# $test = @eval( $::messageSender->sendTalkCancel(pack 'V', 50351) ) | |
# pause 5 | |
# log Did it work? | |
# do talk no | |
pause 3 | |
do move 25 187 | |
pause 3 | |
do conf debugPacket_received 0 | |
do conf debugPacket_sent 0 | |
# Father Peter | |
# Only one person can do the job quest at once. Most quests handle this with a chat, but for this one we have to just keep talking to the NPC until he teleports us. | |
# This doesn't always work. It's harmless to re-try, so just re-try a few times. | |
while (&npc(24 187) != -1) as peter_loop | |
do talknpc 24 187 r0 r0 e | |
pause 3 | |
do talk no | |
pause 3 | |
end peter_loop | |
# Move north through the Zombies, 10 steps at a time. | |
#do move 24 53 job_prist | |
do north 10 | |
pause 1 | |
do a 0 | |
do a 1 | |
do a 2 | |
do north 10 | |
pause 1 | |
do a 0 | |
do a 1 | |
do a 2 | |
do north 10 | |
pause 1 | |
do a 0 | |
do a 1 | |
do a 2 | |
do north 10 | |
pause 1 | |
do a 0 | |
do a 1 | |
do a 2 | |
do north 10 | |
pause 1 | |
do a 0 | |
do a 1 | |
do a 2 | |
do move 24 109 1 | |
# Deviruchi | |
do move 168 46 job_prist | |
pause 3 | |
do talknpc 168 46 r1 r1 e | |
pause 2 | |
# Doppelganger | |
do move 168 81 job_prist | |
pause 3 | |
do talknpc 168 81 r1 r1 e | |
pause 2 | |
# Dark Lord | |
do move 168 116 job_prist | |
pause 3 | |
do talknpc 168 116 r1 r1 e | |
pause 2 | |
# Baphomet | |
do move 168 151 job_prist | |
pause 3 | |
do talknpc 168 151 r1 r1 e | |
pause 2 | |
do ss 29 10 | |
do move 168 180 | |
do north 70 | |
# Sister Cecilia | |
do talknpc 27 24 r0 r1 r0 r0 r1 r1 r0 r0 | |
# Father Thomas | |
do talknpc 16 41 e | |
} | |
macro job_thief { | |
# Thief Guide | |
call quest_talk moc_prydb1 '39 129' 'r0 r0 r0 r0 r0' | |
# => quest 1013 | |
# Mr Irrelevant | |
call quest_talk moc_ruins '141 125' e | |
# => tele job_thief1 38 50 | |
do conf lockMap job_thief1 | |
# Don't attack Spore. They're too hard to kill at this level, as a novice. | |
do eval $mon_control{spore} = { attack_auto => 0 } | |
do eval $mon_control{chonchon} = { attack_auto => 0 } | |
do ai on | |
# Collect 25 points of mushrooms. | |
} | |
macro job_thief2 { | |
# Comrade | |
call quest_talk moc_prydb1 '42 133' 'e' | |
# <= quest 1013 | |
# <= 25x Orange Gooey Mushroom | |
# => job Thief | |
# => 46 xp | |
# => 250z | |
# Re-equip what we can. | |
do eq Novice Adventurer's Suit [1] | |
do eq Novice Main Gauche [3] | |
# Drop junk equipment we can't wear anymore. | |
do drop &inventory(Novice False Eggshell) | |
do drop &inventory(Novice Guard) | |
do drop &inventory(Novice Slippers) | |
} | |
macro job_assassin { | |
# Guildsman: Ferocious-looking guy | |
call quest_talk in_moc_16 '19 33' 'r0' | |
# => tele in_moc_16 19 76 | |
pause 3 | |
# Guildsman: Assassin 'Khai' | |
# Automatic conversation. | |
call quest_talk in_moc_16 '25 90' 'e' | |
do move 25 90 | |
pause 2 | |
do talk resp 0 | |
# => quest 8001 | |
# => tele in_moc_16 19 144 | |
# nameless one | |
# Automatic conversation. | |
pause 2 | |
do talknpc 19 144 r2 r~/Right hand Mastery/ r~/Poison/ r~/Recover 90% of damage decrease/ r~/Red Gemstone/ r~/Venom Dust/ r~/Cloaking/ r~/Red Gemstone/ r~/Elder Willow/ r~/It's a passive skill, so SP use is 0/ r~/Wind Main Gauche/ | |
# <= quest 8001 | |
# => quest 8002 | |
# Test Guide: Barcardi | |
# Automatic conversation. | |
do move 19 164 | |
pause 5 | |
# <= quest 8002 | |
# => quest 8003 | |
} | |
macro job_assassin_2 { | |
[ | |
# Add npcs to map as unwalkable tiles. | |
@poss = (62 168,62 169,63 168,63 169,64 162,64 163,64 174,64 175,65 162,65 163,65 170,65 174,65 175,66 155,66 170,66 171,67 170,67 171,68 158,68 159,69 158,69 159,72 166,72 167,72 168,72 169,72 174,72 175,73 166,73 167,73 168,73 169,73 172,73 174,73 175,76 158,78 168,78 169,79 168,79 169,80 172,80 173,81 172,81 173,82 172,82 173,83 172,83 173,84 150,84 160,84 161,85 160,85 161,86 154,86 155,86 160,86 161,86 166,86 167,87 154,87 155,87 160,87 161,87 166,87 167,88 160,88 161,88 162,88 172,88 174,88 175,89 160,89 161,89 174,89 175,90 164,90 165,91 164,91 165) | |
while (@poss > 0) as poss | |
$pos = &shift(@poss) | |
@xy = &split(' ', $pos) | |
$junk = &eval(substr($::field->{dstMap}, $::field->width * $xy[1] + $xy[0], 1) = chr 0) | |
#log $pos ord substr &eval($::field->width) * $xy[1] + $xy[0], 1 | |
#log $pos &eval(ord substr $::field->{dstMap}, $::field->width * $xy[1] + $xy[0], 1) | |
end poss | |
# Set route_step to 2 to avoid making large steps. The server normally prevents us from running into walls, but not here. | |
do conf route_step 2 | |
] | |
} | |
macro job_assassin_3 { | |
# Guildmaster | |
# Automatic conversation. If somebody else is already talking, the conversation will trigger after they are done. | |
do move 149 80 | |
call quest_talk moc_in_16 '149 80' 'r2 r0 r0 r0 r0 r1' | |
# <= quest 8006 | |
# => quest 8007 | |
# => 1x Katar [2] | |
# => 1x Necklace of Oblivion | |
# => tele in_moc_16 17 19 | |
# Guildsman: Assassin Expert 'Huey' | |
call quest_talk moc_in_16 '19 33' 'e' | |
# <= quest 8007 | |
# => job Assassin | |
} | |
macro job_merchant { | |
call quest_talk alberta_in '53 43' 'r0 r0 r0' | |
# => quest 1012 | |
# => 1x Delivery Message | |
while (&eval( quest_active(1012) ) == 1) as quest1012 | |
# Merchant Guildsman | |
call quest_talk alberta_in '28 29' 'r0 r3 d3543625 r0' | |
# => 1x Delivery Box | |
# Kafra Employee | |
call quest_talk izlu2dun '106 58' e | |
# <= 1x Delivery Box | |
# => 1x Voucher 3543625 | |
# Merchant Guildsman | |
call quest_talk alberta_in '28 29' e | |
# Merchant: Chief Mahnsoo | |
call quest_talk alberta_in '53 43' e | |
# <= quest 1012 | |
# => achievement 200005 | |
# => job change to Merchant | |
end quest1012 | |
} | |
macro job_blacksmith { | |
# Guildsman: Altazen | |
call quest_talk geffen_in '110 169' 'r0' | |
# => quest 2000 | |
# Guildsman: Getsufenst | |
call quest_talk alberta_in '180 30' "r0 r~/Aldebaran/ r~/3 zeny/ r~/need a cart/ r~/Alberta/ r~/5 O'clock/ r~/Claymore/ r~/Mink Coat/ r~/4/ r~/ANOLIAN/ r~/Money/" | |
# <= quest 2000 | |
# => quest 2002 | |
# Guildsman: Getsufenst | |
call quest_talk alberta_in '180 30' 'e' | |
# <= quest 2002 | |
# => quest 2007 | |
# Guildsman: Getsufenst | |
call quest_talk alberta_in '180 30' 'r1' | |
# <= quest 2007 | |
# <= 8x Iron | |
# <= 20x Green Herb | |
# <= 2x Animal Skin | |
# <= Ring Pommel Saber [2] | |
# => quest 2012 | |
# => Ring Pommel Saber [2] | |
# Guildsman: Getsufenst | |
call quest_talk comodo '158 342' 'r1' | |
# <= Ring Pommel Saber [2] | |
# => Voucher 2485741 | |
# Guildsman: Getsufenst | |
call quest_talk alberta_in '180 30' 'r1' | |
# <= quest 2012 | |
# <= Voucher 2485741 | |
# => quest 2013 | |
# Guildsman: Altazen | |
call quest_talk geffen_in '110 169' 'r0' | |
# <= quest 2013 | |
# => quest 2014 | |
# Blacksmith Guildsman: Mitmair | |
call quest_talk morocc '95 133' "r0 r~/Ask him what he needs/ r~/Alberta/ r~/5 O'clock/ r~/Geffen/ r~/DEX/" | |
# <= quest 2014 | |
# => quest 2015 | |
# => 1x Hammer of Blacksmith | |
# Guildsman: Altazen | |
call quest_talk geffen_in '110 169' 'e' | |
# <= quest 2014 | |
# <= 1x Hammer of Blacksmith | |
# => job Blacksmith | |
# => 30x Steel (if job 50) | |
} | |
macro newbie_l2 { | |
$newbiefield = new_2-3 | |
$newbieresp = r0 | |
call newbie_level | |
} | |
macro newbie_l3 { | |
$newbiefield = new_3-3 | |
$newbieresp = r1 | |
call newbie_level | |
} | |
macro newbie_level { | |
do move 101 36 | |
do talknpc 103 50 r0 $newbieresp e | |
} | |
macro quest_talk { | |
$map = $.param1 | |
$pos = $.param2 | |
$talk = $.param3 | |
call quest_talk_dist $map '$pos' 13 '$pos' "$talk" | |
} | |
macro quest_talk_dist { | |
$map = $.param1 | |
$standpos = $.param2 | |
$distmax = $.param3 | |
$npcpos = $.param4 | |
@talk = &split('#', $.param5) | |
# Move to the specified distance from the NPC. | |
call quest_move $map '$standpos' $distmax | |
# Talk using the given sequence. | |
while (@talk > 0) as talk_loop | |
$seq = &shift(@talk) | |
if ($seq == NOSEQ) { | |
do talk &npc($npcpos) | |
pause 0.1 | |
stop | |
} | |
log talknpc $npcpos $seq | |
do talknpc $npcpos $seq | |
pause 0.1 | |
end talk_loop | |
} | |
macro quest_move { | |
$map = $.param1 | |
$standpos = $.param2 | |
$distmax = $.param3 | |
if ($distmax == ) $distmax = 10 | |
# Move to the specified distance from the NPC. | |
$dist = $distmax | |
while (1 == 1) as move | |
$x = &eval( (split( ' ', '$standpos' ))[0] ) | |
$y = &eval( (split( ' ', '$standpos' ))[1] ) | |
$d = &eval( Misc::distance(Misc::calcPosition($::char), { x => '$x', y => '$y' }) ) | |
if ($.map == $map && $d <= $distmax) stop | |
do move $standpos $map $dist | |
pause 0.1 | |
$dist-- | |
# TODO: Find another spot to stand that isn't in the direct line to the target. | |
if ($dist < 1) stop | |
end move | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment