View Single Post
Old 29.09.2009, 16:27   #1
Lightmare
Guest
 
Posts: n/a
Default [Help]Quest rate

Kation once posted a perl script, which works with one quest item at a time, but is not difficult to modify so that it changes multiple items. Can't find it here, Google doesn't have it, hope Kation doesn't mind me posting it :)

open(log_file, ">", "qItemAmountlogs.txt") or die "Cannot create the file: $!";

print log_file "-= QuestItemAmountChanger-ai.obj: Log File =-\n\n";

print log_file "Changes:\n";

#reading ai.obj (ai.obj remember to convert- ANSI encoding)

open(ai_old, "<", "ai.obj") or die "Cannot open the file: $!";

open(ai_new, ">", "ai_qAmount.obj") or die "Cannot open the file: $!";

$line = "";

$linePrev = "";

$linePrev2 = "";

$counterLine = 0;

$counterChanges = 0;

$class = "";

#qItemId - Quest Item ID (ex. 7254 - Broken Relic Part - quest to get s grade weapon recipe ImperialTomb)

$qItemId = 7254;

#qItemMultipler - multiple amount of quest item (for 1x quest item amount put 1 for 5x quest item amount put 5 etc)

$qItemMultipler = 3;

while (<ai_old>) {

$counterLine++;

$linePrev2=$linePrev;

$linePrev=$line;

$line=$_;

if($line=~/class 1 /)

{

@tabTempClass = split(' 1 ', $line);

@tabClass = split(' : ', $tabTempClass[1]);

$class=$tabClass[0];

}

if(($line=~/184746111/)&&($linePrev=~/push_const/)&&($linePrev2=~/push_const/))

{

@tabAmount = split('const ', $linePrev);

@tabId = split('const ', $linePrev2);

if(($tabId[1]==$qItemId)&&($tabAmount[1]>=1))

{

print log_file "Line: ".$counterLine." Class: ".$class." Quest Item Id:".$qItemId." New Amount:".$tabAmount[1]*$qItemMultipler." Previous Amount:".$tabAmount[1];

$tabAmount[1]=$tabAmount[1]*$qItemMultipler;

$tabAmount[1]=$tabAmount[1]."\n";

$counterChanges++;

}

$linePrev = join('const ',@tabAmount);

}

print ai_new $linePrev;

}

print ai_new $line;

close ai_old;

close ai_new;

print log_file "\n Changed: ".$counterChanges." lines.\n";

close log_file;

Версия форума 2009–2010. Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Время показано по часам снимка; часовой пояс не установлен. Дата в снимке: 09-29-2009, 04:27 PM. Открыть источник.