PDA

View Full Version : [Share] ai quest bounty rate changer


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;

Nurgl
01.12.2005, 16:11
nice share :wink:

kvoxi
01.12.2005, 17:17
PPL, do not convert from Unicode to ANSI before file processing. Just use this:
...
open($FHIN,"<:raw:encoding(utf16le)",$ai_in_dir."/".$ai_fname);
open($FHOUT,">:raw:encoding(utf16le)",$ai_out_dir."/".$ai_fname);
...
This is full working part of my perl-scripts.
If u want to create a LA2-unicode file, plz write first:
#open...
printf $FHOUT chr(0xFEFF);
#write...
#close...

serjr
02.12.2005, 07:52
thx for guide Kvoxi ;)

SOnick
02.12.2005, 12:29
And what will happen with quests like coin quest?
Does quests for levelling of clan (250k SP bounty) will triple?

serjr
02.12.2005, 12:31
all quests

rodier
04.12.2005, 04:56
hmm there is one multiplier writed in python.. look on berlios for wxparser .. I used it some times ago.. but it does not multiply all quests ;-( but if u look on that source codes.. its nice..