UltimaForum

Wsparcie [VX] - Większy loot z potworków

marsonek - Pią 13 Sty, 2012 23:11
Temat postu: Większy loot z potworków
Siemacie. Chciałbym się dowiedzieć jak zrobić by z potworka wypadało więcej niż dwa przedmioty. Z góry dzięki za pomocne odpowiedzi
paciorx123 - Sob 14 Sty, 2012 01:33

Albo się nie da albo trzeba mieć skrypt :)
Yoroiookami - Sob 14 Sty, 2012 01:38

Pewnie że się da, ale trzeba się namęczyć ze zdarzeniami. :-?
Najlepiej by było mieć skrypt, jednak nie mogłem niczego znaleźć w internecie. :I

Ktoś tu kiedyś na pewno zamieści coś co ci pomoże...może :roll:

CrasheR - Sob 14 Sty, 2012 01:56

Mozesz tez zrobic cos takiego, ze utworzysz np Goblin A i Goblin B. Połączysz ich w jednej grupie przeciwników i ustawisz każdemu inne przedmioty. Ja to wykorzystałem przy misji "Przynieś mi cos tam z Goblina", zabawa była trudniejsza, gdyż trzeba bylo trafić na odpowiedniego Goblina, a gdy juz trafiliśmy to i tak nie zawsze wypadał nam przedmiot, którego szukamy.


Wiem głupie xD

marsonek - Sob 14 Sty, 2012 11:14

No ja właśnie też tak robiłem jak ty "CrasheR" ale myślałem że będzie istniał jakiś prostszy sposób. A moje drugie pytanie brzmi jak zrobić by np. przynieść gościowi co daje ci misję 10x jakieś przedmiotu np. w moim przypadku 10 skrzydeł nietoperza. Męczę się już nad tym drugi dzień :D
CrasheR - Sob 14 Sty, 2012 11:36

Robisz to za pomocą zmiennej. Np gdy zdobywasz jedno skrzydło zmienna dodaje się o 1 "misja + 1". U tego kto daje Ci tę misję tworzysz warunek zmienna "misja = 10" .
Ziolus - Sob 14 Sty, 2012 11:52

Spoiler:

#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ Item Drop Expansion - KGC_ExtraDropItem
#_/ Last Update: 2008/08/28
#_/ Translation by Mr. Anonymous
#_/ KGC Site:
#_/ http://f44.aaa.livedoor.j...echlist_vx.html
#_/ Translator's Blog:
#_/ http://mraprojects.wordpress.com
#_/----------------------------------------------------------------------------
#_/ This script allows you to increase the amount of items and equipment which
#_/ are "dropped" by an enemy after it is defeated.
#_/----------------------------------------------------------------------------
#_/ Instructions For Usage
#_/ To make use of this function, you must insert the <drop> tag into the
#_/ "Notes" box in the desired enemy in the database.
#_/
#_/ The format is as such: <drop ItemType:ID Probability/Percentile>
#_/ Where ItemType = A = Armor, I = Item, W = Weapon
#_/ Where ID = The ID # of the item/equipment in the database
#_/ Where Probability = A fraction statement (IE 1/4) which determines the
#_/ chance of the item dropping
#_/ OR
#_/ Where Percentile = A percentage chance (IE 70%) of the item dropping
#_/============================================================================
#_/ Example: You have a bandit (enemy) who has a Long Sword you'd like for him
#_/ to drop at a 50% chance. Tag him with:
#_/ <drop W:2 50%>
#_/ OR
#_/ <drop W:2 1/2>
#_/ Simple, yes?
#_/============================================================================
#_/ Installation: Insert above KGC_BattleDifficulty and KGC_EnemyGuide.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

$imported = {} if $imported == nil
$imported["ExtraDropItem"] = true

module KGC
module ExtraDropItem
# Regular Expression Defined
module Regexp
# Base Enemy Module
module Enemy
# Drop Item tag string
DROP_ITEM = /<(?:DROP|drop)\s*([IWA]):(\d+)\s+(\d+)([%%])?>/i
end
end
end
end

#==============================================================================
# ■ RPG::Enemy
#==============================================================================

class RPG::Enemy
#--------------------------------------------------------------------------
# ○ Generate Extra Drop Items Cache
#--------------------------------------------------------------------------
def create_extra_drop_item_cache
@__extra_drop_items = []

self.note.split(/[\r\n]+/).each { |line|
case line
when KGC::ExtraDropItem::Regexp::Enemy::DROP_ITEM
# Drop Item
item = RPG::Enemy::DropItem.new
case $1.upcase
when "I" # Item
item.kind = 1
item.item_id = $2.to_i
when "W" # Weapon
item.kind = 2
item.weapon_id = $2.to_i
when "A" # Armor
item.kind = 3
item.armor_id = $2.to_i
else
next
end
# Drop Rate
if $4 != nil
item.drop_prob = $3.to_i
else
item.denominator = $3.to_i
end
@__extra_drop_items << item
end
}
end
#--------------------------------------------------------------------------
# ○ Return Extra Drop Items
#--------------------------------------------------------------------------
def extra_drop_items
create_extra_drop_item_cache if @__extra_drop_items == nil
return @__extra_drop_items
end
end

#==============================================================================
# ■ RPG::Enemy::DropItem
#==============================================================================

unless $@
class RPG::Enemy::DropItem
#--------------------------------------------------------------------------
# ● Public Instance Variable
#--------------------------------------------------------------------------
attr_accessor :drop_prob # Drop rate
#--------------------------------------------------------------------------
# ● Object initialization
#--------------------------------------------------------------------------
def drop_prob
@drop_prob = 0 if @drop_prob == nil
return @drop_prob
end
end
end

#==============================================================================
# ■ Game_Enemy
#==============================================================================

class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ○ Aquire Item Drop
#--------------------------------------------------------------------------
def extra_drop_items
return enemy.extra_drop_items
end
end

#==============================================================================
# ■ Game_Troop
#==============================================================================

class Game_Troop < Game_Unit
#--------------------------------------------------------------------------
# ● Create Item Drop Array
#--------------------------------------------------------------------------
alias make_drop_items_KGC_ExtraDropItem make_drop_items
def make_drop_items
drop_items = make_drop_items_KGC_ExtraDropItem

dead_members.each { |enemy|
enemy.extra_drop_items.each_with_index { |di, i|
next if di.kind == 0
if di.drop_prob > 0
# Probability specification
next if di.drop_prob < rand(100)
else
# Denominator specification
next if rand(di.denominator) != 0
end
if di.kind == 1
drop_items.push($data_items[di.item_id])
elsif di.kind == 2
drop_items.push($data_weapons[di.weapon_id])
elsif di.kind == 3
drop_items.push($data_armors[di.armor_id])
end
# Set up compatability with KGC_EnemyGuide.
if $imported["EnemyGuide"]
KGC::Commands.set_enemy_item_dropped(enemy.enemy.id, i + 2)
end
}
}
return drop_items
end
end



W notatce u potwora wpisujesz drop.
Przykład:
<drop A:54 33%>
<drop W:55 1%>
<drop I:56 100%>
<drop A:57 30%>
<drop W:25 40%>
<drop W:26 30%>
A-zbroja W-broń I-przedmiot

marsonek - Sob 14 Sty, 2012 23:10

Kurde dzięki wielki :D Gra w końcu ruszyła :D Na to czekałem :P jesli chodzi o skrypt to dam znać po weekendzie czy działa :P

Mały add Co do tego że 10x skrzydeł to zmienna będzie 10 a ty je w miedzy czasie możesz sprzedać


Powered by phpBB modified by Przemo © 2003 phpBB Group