Add mobile touch UI and AVA2 biology system with server tools

This commit is contained in:
shen
2026-10-14 19:12:38 -07:00
parent e7f2202a94
commit 6472d17306
68 changed files with 4447 additions and 197 deletions
+30 -1
View File
@@ -35,6 +35,33 @@ echo "$VILLAGES" | while read -r map x y dir; do cp -p "$MAPS/$map/npc.txt" "$BA
mysqldump -uroot player shop shop_item item_proto mob_proto > "$BACKUP/player-shop.sql"
echo "backup: $BACKUP"
# Optional stone restoration: reuse the corresponding valid +3 row for flags and
# socket family, then apply the extracted +6 values. Preserve its existing name.
if [ -f "$SHOP_DIR/stones.tsv" ]; then
awk -F'\t' -v OFS='\t' '
NR==FNR {if ($1 !~ /^#/ && NF==12) {wanted[$1]=$6; count++} next}
{line[NR]=$0; order[++n]=$1; original[$1]=$0}
END {
for (i=1;i<=n;i++) {
v=order[i]
if (v in wanted) {
split(original[v], old, "\t")
base=28330+v-28700
if (!(base in original)) exit 1
split(original[base], a, "\t")
a[1]=v; a[2]=old[2]; a[10]=1; a[11]=0; a[20]=wanted[v]
for (j=1;j<=33;j++) printf "%s%s",a[j],(j==33 ? "\n" : OFS)
found++
} else print original[v]
}
if (found!=count || count!=14) exit 1
}' "$SHOP_DIR/stones.tsv" "$PROTO" > "$BACKUP/stones.new"
cat "$BACKUP/stones.new" > "$PROTO"
awk -F'\t' '$1 !~ /^#/ && NF==12 {
printf "UPDATE item_proto SET type=%d,subtype=%d,wearflag=%d,applytype0=%d,applyvalue0=%d,applytype1=0,applyvalue1=0,applytype2=0,applyvalue2=0,value0=%d,value1=%d,value2=%d,value3=%d,value4=%d,value5=%d,shop_buy_price=0 WHERE vnum=%d;\n",$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$1
}' "$SHOP_DIR/stones.tsv" | mysql -uroot player
fi
# item_proto.txt column 10 is the price an NPC shop sells the item for (TItemTable::dwGold).
awk -F'\t' -v OFS='\t' 'NR == FNR { if ($1 !~ /^#/ && NF >= 3) { price[$1] = $3; want++ } next }
($1 in price) { $10 = price[$1]; n++ } { print }
@@ -105,7 +132,9 @@ fi
echo "$VILLAGES" | while read -r map x y dir; do
npc="$MAPS/$map/npc.txt"
if awk -F'\t' -v v=$NPC_VNUM '$11 == v { found = 1 } END { exit !found }' "$npc"; then
echo "$map: NPC $NPC_VNUM already placed"
awk -F'\t' -v OFS='\t' -v v=$NPC_VNUM -v x="$x" -v y="$y" -v dir="$dir" '$11==v {$2=x; $3=y; $7=dir} {print}' "$npc" > "$BACKUP/$map.npc.new"
cat "$BACKUP/$map.npc.new" > "$npc"
echo "$map: NPC $NPC_VNUM positioned at $x,$y"
else
[ -z "$(tail -c 1 "$npc")" ] || echo >> "$npc"
printf 'm\t%d\t%d\t0\t0\t0\t%d\t1m\t100\t1\t%d\n' "$x" "$y" "$dir" "$NPC_VNUM" >> "$npc"