serjr
01.12.2005, 12:32
This little perl script will change money exp and sp bounty for quests in Ai.obj to 6/4/4 change this numbers for your own. Before run script convert ai.obj to ANSI.
P.S. need testing if you found any bug post will try to solve
#!/usr/bin/perl -w
use strict;
use warnings;
use Data::Dumper;
our $AI_FILE = 'ai.obj';
open F, $AI_FILE or die $!;
my $ai = join '', <F>;
close F;
# money money money
# push_const 57
# push_const 1500
# func_call 77 // func[GiveItem1]
$ai =~ s/(push_const\s+57\s+push_const\s+)(\d+)(\s+func_cal l\s+77)/$1.(int($2)*6).$3/iegs;
# exp
# push_const 0
# push_const 3600
# func_call 171 // func[IncrementParam]
$ai =~ s/(push_const\s+0\s+push_const\s+)(\d+)(\s+func_call \s+171)/$1.(int($2)*4).$3/iegs;
# sp
# push_const 1
# push_const 3600
# func_call 171 // func[IncrementParam]
$ai =~ s/(push_const\s+1\s+push_const\s+)(\d+)(\s+func_call \s+171)/$1.(int($2)*4).$3/iegs;
open F, ">$AI_FILE.new" or die $!;
print F $ai;
close F;
P.S. need testing if you found any bug post will try to solve
#!/usr/bin/perl -w
use strict;
use warnings;
use Data::Dumper;
our $AI_FILE = 'ai.obj';
open F, $AI_FILE or die $!;
my $ai = join '', <F>;
close F;
# money money money
# push_const 57
# push_const 1500
# func_call 77 // func[GiveItem1]
$ai =~ s/(push_const\s+57\s+push_const\s+)(\d+)(\s+func_cal l\s+77)/$1.(int($2)*6).$3/iegs;
# exp
# push_const 0
# push_const 3600
# func_call 171 // func[IncrementParam]
$ai =~ s/(push_const\s+0\s+push_const\s+)(\d+)(\s+func_call \s+171)/$1.(int($2)*4).$3/iegs;
# sp
# push_const 1
# push_const 3600
# func_call 171 // func[IncrementParam]
$ai =~ s/(push_const\s+1\s+push_const\s+)(\d+)(\s+func_call \s+171)/$1.(int($2)*4).$3/iegs;
open F, ">$AI_FILE.new" or die $!;
print F $ai;
close F;