Перейти к содержанию

Помогите с модернизацией плагина. (Скрипт, диалоги)


123456

Рекомендуемые сообщения

Возможно кто еще помнит, что есть такой плагин как "Фондовая биржа". Плагин довольно интересный, и с ним можно поиграться, но для меня он очень неудобный. Максимум там можно купить 10 акций одного Великого дома, но я хочу сделать 1000, 10000 и 100000 акций, т.к деньгами я там располагаю немалыми. Но я так и не разобрался как там все это поменять. Все мои попытки порождали баги.

 

Ссылка на сам плагин: http://www.fullrest....balmorastock-1c

 

Сам скрипт:

 

begin StockMarket
short nolore
short stockprice
short lastday
short sharesowned
short initialized
short buyoneok
short buytenok
short selloneok
short selltenok
short bankrupt
short temp
short daystocalc
short buying
short selling
if (initialized == 0)
set stockprice to 40
set lastday to 16
set sharesowned to 0
set initialized to 1
set buying to 0
set selling to 0
endif
set daystocalc to 0
; Check the days and recalc the stock price
if (Day != lastday)
if (Day < lastday)
 set daystocalc to 3
else
 set daystocalc to (Day - lastday)
endif
set lastday to Day
; Messagebox "Updating for next day. Lastday: %d Day: %d Calc: %d", lastday, Day, daystocalc
; if (daystocalc == 3)
;  messagebox "Yes, daystocalc is actually 3."
endif
endif
if (daystocalc > 10)
set daystocalc to 10
; messagebox "Calc: %d", daystocalc
; messagebox "Daystocalc is actually 10."
endif
while (daystocalc > 0)
set daystocalc to (daystocalc - 1)
set stockprice to (stockprice - 3)
set temp to random, 7
set stockprice to (stockprice + temp)
endwhile
if (stockprice < -10)
set stockprice to -10
endif
if (stockprice < 0)
set bankrupt to 1
else
set bankrupt to 0
endif
if (stockprice > 100)
set stockprice to 100
endif
;Stock splitting
if (stockprice > 90)
set stockprice to (stockprice / 2)
set sharesowned to (sharesowned * 2)
endif
set buyoneok to 0
set buytenok to 0
set selloneok to 0
set selltenok to 0
if (sharesowned >= 10)
set selltenok to 1
endif
if (sharesowned >= 1)
set selloneok to 1
endif
set temp to ( stockprice + 10 )
if ( Player->GetItemCount Gold_001 >= temp )
set buyoneok to 1
endif
set temp to (stockprice * 10)
set temp to (temp + 10)
if ( Player->GetItemCount Gold_001 >= temp )
set buytenok to 1
endif

; And now the buying/selling bit, triggered in dialogue  Unfortunately,
; additem and removeitem can't take a variable
; for count.
if (buying > 0)
set temp to (stockprice * buying)
; Commission
player->removeitem gold_001 10
;Gradual formula for culling temp amount of gold.
messagebox "Let me count this out for you."

while (temp >= 500)
 set temp to (temp - 500)
 player->removeitem gold_001 500
endwhile
while (temp >= 100)
 set temp to (temp - 100)
 player->removeitem gold_001 100
endwhile
while (temp >= 50)
 set temp to (temp - 50)
 player->removeitem gold_001 50
endwhile
while (temp >= 10)
 set temp to (temp - 10)
 player->removeitem gold_001 10
endwhile
while (temp >= 5)
 set temp to (temp - 5)
 player->removeitem gold_001 5
endwhile
while (temp >= 1)
 set temp to (temp - 1)
 player->removeitem gold_001 1
endwhile
messagebox "All done!"
set buying to 0
endif
if (selling > 0)
set temp to (stockprice * selling)

;Gradual formula for culling temp amount of gold.
messagebox "Let me count this out for you."

while (temp >= 500)
 set temp to (temp - 500)
 player->additem gold_001 500
endwhile
while (temp >= 100)
 set temp to (temp - 100)
 player->additem gold_001 100
endwhile
while (temp >= 50)
 set temp to (temp - 50)
 player->additem gold_001 50
endwhile
while (temp >= 10)
 set temp to (temp - 10)
 player->additem gold_001 10
endwhile
while (temp >= 5)
 set temp to (temp - 5)
 player->additem gold_001 5
endwhile
while (temp >= 1)
 set temp to (temp - 1)
 player->additem gold_001 1
endwhile

messagebox "Все сделанно!"
set selling to 0
endif

end StockMarket

 

 

http://imgur.com/NqSoqdi - диалог продажи 10 акций.

http://imgur.com/8nbiAF6 - диалог покупки 10 акций.

 

Просто на одном примере покажите как сменить 10 на 10000, а дальше я разберусь.

 

-У меня получилось купить и продать 500 акций. На 1000 акций уже не тратятся и не выдаются деньги, хотя написано то, что у меня именно 1000 акцйи.

А нельзя изменить цены на акции. Например вместо 30-70 золотых, поменять на 50-150 золотых?

Изменено пользователем 123456
Ссылка на комментарий
Поделиться на другие сайты

Для публикации сообщений создайте учётную запись или авторизуйтесь

Вы должны быть пользователем, чтобы оставить комментарий

Создать учетную запись

Зарегистрируйте новую учётную запись в нашем сообществе. Это очень просто!

Регистрация нового пользователя

Войти

Уже есть аккаунт? Войти в систему.

Войти
  • Последние посетители   0 пользователей онлайн

    • Ни одного зарегистрированного пользователя не просматривает данную страницу
×
×
  • Создать...