Автор: Sanasol: Дата: 05.23.2009
Много пишут в асю как убрать замки..... Надоели честное слово. Вот скрипт с 2мя замками
//===== eAthena Script =======================================
//= War of Emperium Guild Template File
//===== By: ==================================================
//= L0ne_W0lf
//= Edited by Sanasol
//===== Current Version: =====================================
//= 1.4
//===== Compatible With: =====================================
//= eAthena SVN
//===== Description: =========================================
//= [ Aegis Conversion]
//= ----------------------------------------------------------
//= - THIS FILE IS REQUIRED FOR GUILD CASTLES TO FUNCTION.
//= ----------------------------------------------------------
//= - Enables AGIT Manager inside Guild Strongholds.
//= Visible Name required: Agit
//= Manages the various functions used in and out of WoE.
//=
//= - Enables Stewards inside Guild Strongholds which let's
//= the guild master invest in Defense and Economy, and
//= to summon guardians, a Kafra, and enter master's room.
//=
//= - Guardian Spawning Template
//= Visible Name required: Guardian
//= Spawn guardians when guild castle data is recieved.
//=
//= - Enables Kafra Services inside Guild Strongholds.
//= Visible Name required: Kafra Staff
//= Storage, Guild Storage, Teleport Service, Cart rental.
//=
//= - Treasure Room Protection and Chest spawning.
//= Chests will NOT be saved anymore in the event of crashes.
//= Treasures will NOT spawn on a location that already has
//= treasure chest spawned.
//===== Additional Comments: =================================
//= 1.0 First Version. No longer uses functions. [L0ne_W0lf]
//= 1.1 Daily investement will now be reset. [L0ne_W0lf]
//= Template will no longer try to spawn chests.
//= 1.2 Fixed Eco Invest option charging twice. [L0ne_W0lf]
//= 1.3 Fixed a loading flag emblem for Payon 1. [L0ne_W0lf]
//= Fixed two typos regarding Guild Steward name.
//= 1.4 Fixed a typo in defense investment. [L0ne_W0lf]
//= 1.5 Fixed spawn point of the emperium in Payon 1. [L0ne_W0lf]
//= Double-investing doubles the price now.
//= Редактировано на 2 замка ========================================================
// AGIT Manager Template
//============================================================
- script Gld_Agit_Manager::Gld_Agit_Manager -1,{
end;
// Load (or reload) specific information for a castle.
OnInterIfInitOnce:
if (strnpcinfo(0) == "Gld_Agit_Manager") end;
GetCastleData strnpcinfo(2),0,strnpcinfo(0) + "::OnRecvCastle";
end;
// War of Emperium has started.
OnAgitStart:
if (strnpcinfo(0) == "Gld_Agit_Manager") end;
MapRespawnGuildID strnpcinfo(2),GetCastleData(strnpcinfo(2),1),2;
GvgOn strnpcinfo(2);
// Spawn (fall through), or respawn the Emperium once it has been broken.
OnStartArena:
// OnAgitStart will fall through and spawn the Emperium.
if (strnpcinfo(2) == "prtg_cas01") { setarray .@emproom[0],197,197; }
else if (strnpcinfo(2) == "prtg_cas02") { setarray .@emproom[0],157,174; }
// Add custom Guild Castles here.
else {
end;
}
if (!mobcount(strnpcinfo(2),"Agit#"+strnpcinfo(2)+"::OnAgitBreak")) {
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Emperium",1916,1,"Agit#"+strnpcinfo(2)+"::OnAgitBreak";
}
end;
// The Emperium has been broken.
OnAgitBreak:
set .@GID,getcharid(2);
// Show and log error if an unguilded player breaks the Emperium. (Should NEVER happen)
if (.@GID <= 0) {
set .@notice$,"Character "+strcharinfo(0)+" ("+getcharid(0)+") broke the Emperium in Castle: "+strnpcinfo(2)+" while guildless. No data will be saved and Emperium respawned.";
logmes .@notice$; debugmes .@notice$;
donpcevent "Agit#"+strnpcinfo(2)+"::OnStartArena";
end;
}
// Adjust Economy Invest Level for Castle
set .@Economy,GetCastleData(strnpcinfo(2),2) - 5;
if (.@Economy < 0) set .@Economy, 0;
SetCastleData strnpcinfo(2), 2, .@Economy;
// Adjust Defense Invest Level for Castle
set .@Defence,GetCastleData(strnpcinfo(2),3) - 5;
if (.@Defence < 0) set .@Defence, 0;
SetCastleData strnpcinfo(2), 3, .@Defence;
// Set new Castle Occupant
SetCastleData strnpcinfo(2),1, .@GID;
// Announce that the Emperium is destroyed, and respawn all but new castle-occupants.
mapannounce strnpcinfo(2),"The emperium has been destroyed.",bc_map,"0x00CCFF";
MapRespawnGuildID strnpcinfo(2),.@GID,2;
// Refresh castle data, disable Kafra and reset Invest information.
GetCastleData strnpcinfo(2),0,strnpcinfo(0)+"::OnRecvCastle";
disablenpc "Kafra Staff#"+strnpcinfo(2);
for( set .@i, 4; .@i <= 9; set .@i, .@i+1 ) {
SetCastleData strnpcinfo(2), .@i, 0;
}
// Erase Guardian Database information if the new owners do not have Guardian Research.
if( getgdskilllv(.@GID,10002) == 0 ) {
for( set .@i, 10; .@i <= 17; set .@i, .@i+1 ) {
SetCastleData strnpcinfo(2), .@i, 0;
}
}
// Respawn the Emperium, and display new owners.
sleep 500; // Slow down script execution slightly.
if( agitcheck() )
donpcevent "Agit#"+strnpcinfo(2)+"::OnStartArena";
sleep getbattleflag("gvg_eliminate_time");
announce "[WoE] Империум замка [" + getcastlename(strnpcinfo(2)) + "] разбила гильдия [" + getguildName(.@GID) + "] !.",bc_all,0xFF0000;
end;
// War of Emperium has ended.
OnAgitEnd:
if (strnpcinfo(0) == "Gld_Agit_Manager") end;
GvgOff strnpcinfo(2);
// If the castle has no owner at the end of WoE, do not kill Emperium.
if (GetCastleData(strnpcinfo(2),1)) {
KillMonster strnpcinfo(2),"Agit#"+strnpcinfo(2)+"::OnAgitBreak";
}
end;
// Occupying Guild has been disbanded.
OnGuildBreak:
if (strnpcinfo(0) == "Gld_Agit_Manager") end;
// Kill guardians, disable the Kafra, and set owner to 0.
killmonster strnpcinfo(2),"Guardian#"+strnpcinfo(2)+"::OnGuardianDied";
disablenpc "Kafra Staff#"+strnpcinfo(2);
SetCastleData strnpcinfo(2),0,0;
// Wait before refreshing guild information.
sleep getbattleflag("gvg_eliminate_time");
Announce "Guild Base [" + GetCastleName(strnpcinfo(2)) + "] has been abandoned.",0;
GetCastleData strnpcinfo(2),0,strnpcinfo(0)+"::OnRecvCastle";
end;
OnRecvCastle:
RequestGuildInfo GetCastleData(strnpcinfo(2),1);
// Spawn Monsters if the castle is empty.
set .@GID, GetCastleData(strnpcinfo(2),1);
if (.@GID == 0) {
killmonsterall strnpcinfo(2);
if (compare(strnpcinfo(2),"prtg")) {
// Normal Spawns
monster strnpcinfo(2),0,0,"Raydric",1163,1;
monster strnpcinfo(2),0,0,"Khalitzburg",1132,10;
monster strnpcinfo(2),0,0,"Abysmal Knight",1219,5;
monster strnpcinfo(2),0,0,"Bloody Knight",1268,5;
monster strnpcinfo(2),0,0,"Stormy Knight",1251,1;
monster strnpcinfo(2),0,0,"Hatii",1252,1;
monster strnpcinfo(2),0,0,"Raydric Archer",1276,5;
monster strnpcinfo(2),0,0,"Gryphon",1259,2;
monster strnpcinfo(2),0,0,"Chimera",1283,3;
monster strnpcinfo(2),0,0,"Alice",1275,1;
monster strnpcinfo(2),0,0,"Zealotus",1200,1;
// Set Emperium room spawn coordinates and spawn monsters.
if (strnpcinfo(2) == "prtg_cas01") { setarray .@emproom[0],197,197; }
else if (strnpcinfo(2) == "prtg_cas02") { setarray .@emproom[0],157,174; }
else if (strnpcinfo(2) == "prtg_cas03") { setarray .@emproom[0],16,220; }
else if (strnpcinfo(2) == "prtg_cas04") { setarray .@emproom[0],291,14; }
else if (strnpcinfo(2) == "prtg_cas05") { setarray .@emproom[0],266,266; }
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Guardian Knight",1268,1;
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Guardian Master",1251,1;
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Hatii",1252,1;
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Guardian Knight",1219,1;
monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Raydric Archer",1276,5;
}
// Add custom Guild Castles here.
else {
end;
}
donpcevent "Agit#"+strnpcinfo(2)+"::OnStartArena";
// Disable Kafra Staff...
disablenpc "Kafra Staff#"+strnpcinfo(2);
end;
}
else {
// Otherwise place the guild emblem on flags.
if (strnpcinfo(2) == "prtg_cas01") { donpcevent "::OnRecvCastlePt01"; }
else if (strnpcinfo(2) == "prtg_cas02") { donpcevent "::OnRecvCastlePt02"; }
// Add custom Guild Castles here.
else {
end;
}
// And load purchased Guardian in castles.
donpcevent "Guardian#"+strnpcinfo(2)+"::OnSpawnGuardians";
// And display Kafra if purchased.
if (GetCastleData(strnpcinfo(2),9) < 1) disablenpc "Kafra Staff#"+strnpcinfo(2);
}
end;
}
// Guild Steward Template
//============================================================
- script Gld_Mngr_Template::Gld_Mngr_Template -1,{
// What is the Display Name of the NPC?
set .@name$,strnpcinfo(1);
// Store the Guild ID of castle occupant.
set .@GID, GetCastleData(strnpcinfo(2),1);
// Define the types of guardians on a per castle basis.
// 1 - Soldier Guardian; 2 - Archer Guardian; 3 - Knight Guardian
// Define the x spawn point for each uardian.
// [0] = 1st guardian's x spawn point.
// Define the y spawn point for each guardian.
// [0] = 1st guardian's y spawn point.
// Define the coordinates of the "Treasure Room."
// Aldebaran (Luina) Castles
// Prontera (Valkyrie Realms) Castles
if (strnpcinfo(2) == "prtg_cas01") {
setarray .@guardiantype[0],1,1,1,2,2,3,3,3;
setarray .@guardianposx[0],182,182,153,59,50,184,196,107;
setarray .@guardianposy[0],62,116,86,28,36,183,189,179;
setarray .@masterroom[0],15,209;
}
else if (strnpcinfo(2) == "prtg_cas02") {
setarray .@guardiantype[0],3,3,3,1,1,2,2,2;
setarray .@guardianposx[0],161,153,178,71,49,64,7,75;
setarray .@guardianposy[0],161,161,44,75,28,186,196,175;
setarray .@masterroom[0],207,229;
}
// Add custom Guild Castles here.
else {
end;
}
mes "[ Steward " + .@name$ + " ]";
if (.@GID == 0) {
mes "I'm waiting for my master to return.";
mes "If you wish to speak with him, you will have to wait as well. ";
close;
}
if (getcharid(2) != .@GID || strcharinfo(0) != getguildmaster(.@GID)){
mes "I am loyal and I will follow my master ^ff0000" + getguildmaster(.@GID) + "^000000. We are Guardians! We defend to the bitter end!";
close;
}
mes "Welcome. My honorable master, ^ff0000" + getguildmaster(.@GID) + "^000000...";
mes "Whatever you need, I am at your service. I will be faithful in my duties.";
next;
switch(select("castle briefing:Invest in commercial growth:Invest in safeguard:Summon Guardian:Employ / discharge storehouse staff:Go into Master's room")) {
case 1:
mes "[ Steward " + .@name$ + " ]";
mes "I will report the Castle briefing, Master.";
mes " ";
mes " ^0000ffNow, commercial growth level is " + GetCastleData(strnpcinfo(2),2) + ".";
if (GetCastleData(strnpcinfo(2),4)) {
mes " You invested " + GetCastleData(strnpcinfo(2),4) + "times in last 1 day.";
}
mes " Now, safeguard level is " + GetCastleData(strnpcinfo(2),3) + ".^000000";
if (GetCastleData(strnpcinfo(2),5)) {
mes " ^0000ff- You invested " + GetCastleData(strnpcinfo(2),5) + "times in last 1 day.^000000";
}
mes " ";
mes "That's all to report, Master.";
close;
case 2:
set .@Economy,GetCastleData(strnpcinfo(2),2);
if(.@Economy < 8) set .@eco_invest,10000;
if(.@Economy >= 8) set .@eco_invest,20000;
if(.@Economy >= 16) set .@eco_invest,40000;
if(.@Economy >= 25) set .@eco_invest,80000;
if(.@Economy >= 34) set .@eco_invest,160000;
if(.@Economy >= 44) set .@eco_invest,320000;
if(.@Economy >= 54) set .@eco_invest,640000;
if(.@Economy >= 65) set .@eco_invest,1280000;
if(.@Economy >= 76) set .@eco_invest,2560000;
if(.@Economy >= 88) set .@eco_invest,5120000;
//Double the cost of investing if you've already invested once.
if (GetCastleData(strnpcinfo(2),4)) {
set .@eco_invest,.@eco_invest*2;
}
mes "[ Steward " + .@name$ + " ]";
mes "If you raise commercial growth, the quantity of goods made by the guild will increase. So if you want a prosperous future, investment will be required.";
mes " ";
mes "Originally you can invest just once but if you pay more money, you can invest twice.";
mes " ";
if (.@Economy == 100) {
mes "^ff0000But the commercial growth level of our castle is peaked at 100%. It doesn't need any more investment. As I expected you have a great acumen, Master.^000000";
close;
}
if (GetCastleData(strnpcinfo(2),4) == 2) {
mes "^ff0000But you already invested twice today so you cannot invest any more.^000000 I expect our riches to increase in growth level.";
close;
}
if (GetCastleData(strnpcinfo(2),4) == 0) {
mes "Now the needed investment amount is ^ff0000" + .@eco_invest + "^000000 zeny. Will you invest?";
}
else {
mes "You've invested once today... if you wish to invest once more, ^ff0000" + .@eco_invest + "^000000 more zeny will be needed.";
}
next;
switch(select("Invest in commercial growth:Cancel")) {
case 1:
if (Zeny < .@eco_invest) {
mes "[ Steward " + .@name$ + " ]";
mes "I'm sorry but there is not enough zeny to invest. You will have to try again when you have the funds, Master.";
close;
}
set zeny,zeny-.@eco_invest;
SetCastleData strnpcinfo(2),4,GetCastleData(strnpcinfo(2),4)+1;
SetCastleData strnpcinfo(2),2,.@Economy + 1 + (.@Economy<99 && rand(2) && getgdskilllv(.@GID,10014));
mes "[ Steward " + .@name$ + "]";
mes "We finished the investment safely. I expect that our growth level will be increased by tomorrow.";
close;
case 2:
mes "[ Steward " + .@name$ + " ]";
mes "I'll do as you bid, my master... There is no hurry. We will do our best.";
close;
}
case 3:
set .@Defence,GetCastleData(strnpcinfo(2),3);
if(.@Defence < 8) set .@def_invest,20000;
if(.@Defence >= 8) set .@def_invest,40000;
if(.@Defence >= 16) set .@def_invest,80000;
if(.@Defence >= 25) set .@def_invest,160000;
if(.@Defence >= 34) set .@def_invest,320000;
if(.@Defence >= 44) set .@def_invest,640000;
if(.@Defence >= 54) set .@def_invest,1280000;
if(.@Defence >= 65) set .@def_invest,2560000;
if(.@Defence >= 76) set .@def_invest,5120000;
if(.@Defence >= 88) set .@def_invest,10240000;
//Double the cost of investing if you've already invested once.
if (GetCastleData(strnpcinfo(2),5)) {
set .@def_invest,.@def_invest*2;
}
mes "[ Steward " + .@name$ + " ]";
mes "If you raise the safeguard, the durability of the Guardians and emperium will increase. So if you expect more defenses in battles, investment will be required.";
mes " ";
mes "Originally you can invest just once but if you pay more money, you can invest twice.";
mes " ";
if (.@Defence == 100) {
mes "^ff0000But the safeguard level of our castle is peaked at 100%. It doesn't need any more investment. As I expected you have a great acumen, Master.^000000";
close;
}
if (GetCastleData(strnpcinfo(2),5) == 2) {
mes "^ff0000But you already invested twice today so you cannot invest any more.^000000 I expect our riches to increase in growth level.";
close;
}
if (GetCastleData(strnpcinfo(2),5) == 0) {
mes "Now the needed investment amount is ^ff0000" + .@def_invest + "^000000 zeny. Will you invest?";
}
else {
mes "You've invested once today... if you wish to invest once more, ^ff0000" + .@def_invest + "^000000 more zeny will be needed.";
}
next;
switch(select("Invest in safeguard.:Cancel")) {
case 1:
if (Zeny < .@def_invest) {
mes "[ Steward " + .@name$ + " ]";
mes "I'm sorry but there is not enough zeny to invest. You will have to try again when you have the funds, Master.";
close;
}
set zeny,zeny-.@def_invest;
SetCastleData strnpcinfo(2),5,GetCastleData(strnpcinfo(2),5)+1;
SetCastleData strnpcinfo(2),3,.@Defence+1;
mes "[ Steward " + .@name$ + "]";
mes "We finished the investment safely. I expect that the safeguard level will be increased by tomorrow.";
close;
case 2:
mes "[ Steward " + .@name$ + " ]";
mes "I'll do as you bid, my master... There is no hurry. We will do our best.";
close;
}
case 4:
mes "[ Steward " + .@name$ + " ]";
mes "Will you summon a Guardian? It'll be a protector to defend us loyally.";
mes "Please select a guardian to defend us.";
next;
for( set .@i, 0; .@i <= 7 ; set .@i, .@i+1 ) {
if (.@guardiantype[.@i] == 1) { set .@type$,"Guardian Soldier"; }
else if (.@guardiantype[.@i] == 2) { set .@type$,"Guardian Archer"; }
else { set .@type$,"Guardian Knight"; }
if (guardianinfo(strnpcinfo(2),.@i,0)) {
setarray .@gname$[.@i], .@type$ + " - Implemented (" + guardianinfo(strnpcinfo(2),.@i,2) + "/" + guardianinfo(strnpcinfo(2),.@i,1) + ")";
}
else {
setarray .@gname$[.@i], .@type$ + " - Not Implemented";
}
}
set .@menu$,.@gname$[0]+":"+.@gname$[1]+":"+.@gname$[2]+":"+.@gname$[3]+":"+.@gname$[4]+":"+.@gname$[5]+":"+.@gname$[6]+":"+.@gname$[7];
set .@GDnum,select(.@menu$)+9;
mes "[ Steward " + .@name$ + " ]";
mes "Will you summon the chosen guardian? 10000 zeny is required to summon.";
next;
switch(select("Summon:Cancel")) {
case 1:
mes "[ Steward " + .@name$ + " ]";
if (getgdskilllv(.@GID,10002) == 0) {
mes "Master, we have not the resources to Summon the Guardian. If you want to accumulate them, you have to learn the Guild skill, We failed to summon the Guardian.";
close;
}
if (GetCastleData(strnpcinfo(2),.@GDnum) == 1) {
mes "Master, you already have summoned that Guardian. We cannot summon another.";
close;
}
if (Zeny < 1000) {
mes "Well... I'm sorry but we don't have funds to summon the Guardian. We failed to summon the Guardian.";
close;
}
set zeny,zeny-10000;
SetCastleData strnpcinfo(2),.@GDnum,1; // mark as 'installed'
set .@UseGID,.@GDnum - 10;
if (.@guardiantype[.@UseGID] == 1) { set .@type,1287; }
else if (.@guardiantype[.@UseGID] == 2) { set .@type,1285; }
else { set .@type,1286; }
guardian strnpcinfo(2),.@guardianposx[.@UseGID],.@guardianposy[.@UseGID],strmobinfo(2,.@type),.@type,"Guardian#"+strnpcinfo(2)+"::OnGuardianDied",.@UseGID;
mes "We completed the summoning of the Guardian. Our defenses are now increased with it in place.";
close;
case 2:
mes "[ Steward " + .@name$ + " ]";
mes "I did as you ordered. But please remember if you the have money to spare, it'll be better to set it up.";
close;
}
case 5:
if (GetCastleData(strnpcinfo(2),9) == 1) {
mes "[ Steward " + .@name$ + " ]";
mes "Now about the Kafra staff... Will you discharge the Kafra staff?";
next;
switch(select("Discharge:Cancel")) {
case 1:
cutin "kafra_01",2;
mes "[ Hired Kafra staff ]";
mes "I worked so hard... How can this be, Master?... I'll work harder if you're displeased... Please reconsider, Master.";
next;
switch(select("Discharge:Cancel")) {
case 1:
mes "[ Hired Kafra staff ]";
mes "Oh, my god! This is nonsense!";
next;
cutin "kafra_01",255;
break;
case 2:
mes "[ Hired Kafra staff ]";
mes "I'll work harder... Thank you!";
close2;
cutin "kafra_01",255;
end;
}
case 2:
mes "[ Steward " + .@name$ + " ]";
mes "Those Kafra are hard workers. I thought it would be best to keep the staff.";
close;
}
disablenpc "Kafra Staff#"+strnpcinfo(2);
SetCastleData strnpcinfo(2),9,0;
mes "[ Steward " + .@name$ + " ]";
mes "....";
mes "Discharged Kafra staff... But... are you displeased with something?";
close;
}
else {
mes "[ Steward " + .@name$ + " ]";
mes "Will you contract with the Kafra head office to hire Kafra staff in our castle?";
mes "^ff0000 10000zeny is needed to hire. ";
next;
switch(select("Hire.:Cancel")) {
case 1:
mes "[ Steward " + .@name$ + " ]";
if (getgdskilllv(.@GID,10001) == 0) {
mes "Master, we cannot hire Kafra staff because we didn't make a contract with the Kafra head office. If you want to make a contract with the Kafra head office, you have to learn the Guild skill.";
close;
}
if (Zeny < 10000) {
mes "Well... I'm sorry but we don't have enough funds. We are unable to hire the Kafra staff.";
close;
}
set zeny,zeny-10000;
enablenpc "Kafra Staff#"+strnpcinfo(2);
SetCastleData strnpcinfo(2),9,1;
mes "We finished making the contract with the Kafra head office successfully. We hired a Kafra staff.";
next;
cutin "kafra_01",2;
mes "[ Hired Kafra staff ]";
mes "How do you do? I'm a dispatched Kafra from head office.";
mes "I'll do my best to upkeep the reputation of Guild.";
next;
cutin "kafra_01",255 ;
mes "[ Steward " + .@name$ + " ]";
mes "The contract term of the hired Kafra staff is 1 month and after this term, you will have to pay an additional charge.";
mes "It will be useful for our members.";
close;
case 2:
mes "[ Steward " + .@name$ + " ]";
mes "I did as you ordered, but some of our members will be unhappy. It will be better to hire a Kafra staff quickly.";
close;
}
}
case 6:
mes "[ Steward " + .@name$ + " ]";
mes "Do you want to visit the room where our valuables are stored?";
mes "That room is restricted to you... you are the only one with access to it.";
next;
switch(select("Go into Master's room.:Cancel")) {
case 1:
mes "[ Steward " + .@name$ + " ]";
mes "Please follow me, I will show you the secret passage.";
mes "When you wish to return, pull this lever here...";
close2;
warp strnpcinfo(2),.@masterroom[0],.@masterroom[1];
end;
case 2:
mes "[ Steward " + .@name$ + " ]";
mes "Goods are produced once a day... if you don't make use of them, they will not produce.";
mes "Therefore it would be better that you remove them over time for the Guild.";
close;
}
}
}
// Guardian Spawner Template
//============================================================
- script Gld_Guard_Template::Gld_Guard_Template -1,{
// Spawn Guardians in castles
// When adding new castles, ensure that the coordinates coincide
// with the coordinates defined in the Guild Steward template.
OnSpawnGuardians:
// Define the types of guardians on a per castle basis.
// 1 - Soldier Guardian; 2 - Archer Guardian; 3 - Knight Guardian
// Define the x spawn point for each uardian.
// [0] = 1st guardian's x spawn point.
// Define the y spawn point for each uardian.
// [0] = 1st guardian's y spawn point.
// Aldebaran (Luina) Castles
// Prontera (Valkyrie Realms) Castles
if (strnpcinfo(2) == "prtg_cas01") {
setarray .@guardiantype[0],1,1,1,2,2,3,3,3;
setarray .@guardianposx[0],182,182,153,59,50,184,196,107;
setarray .@guardianposy[0],62,116,86,28,36,183,189,179;
}
else if (strnpcinfo(2) == "prtg_cas02") {
setarray .@guardiantype[0],3,3,3,1,1,2,2,2;
setarray .@guardianposx[0],161,153,178,71,49,64,7,75;
setarray .@guardianposy[0],161,161,44,75,28,186,196,175;
}
// Add custom Guild Castles here.
else {
end;
}
// Kill all existing guardians before spawning new ones.
// This should prevent duplicating Guardians when char Server disconnects.
killmonster strnpcinfo(2),strnpcinfo(0)+"::OnGuardianDied";
for( set .@i, 0; .@i <= 7 ; set .@i, .@i+1 ) {
set .@UseGID,.@i + 10;
if (.@guardiantype[.@i] == 1) { set .@type,1287; }
else if (.@guardiantype[.@i] == 2) { set .@type,1285; }
else { set .@type,1286; }
if (GetCastleData(strnpcinfo(2),.@UseGID)) {
guardian strnpcinfo(2),.@guardianposx[.@i],.@guardianposy[.@i],strmobinfo(2,.@type),.@type,"Guardian#"+strnpcinfo(2)+"::OnGuardianDied",.@i;
}
}
end;
OnGuardianDied:
end;
}
// Kafra Template
//============================================================
- script Gld_Kafra_Template::Gld_Kafra_Template -1,{
// Store the Guild ID of castle occupant.
set .@GID, GetCastleData(strnpcinfo(2),1);
if (compare(strnpcinfo(2),"prtg")) {
setarray .@destination$[0],"Prontera","prontera";
setarray .@coordinates[0],116,72;
}
// Add custom Guild Castles here.
else {
end;
}
cutin "kafra_01",2;
if (getcharid(2) == .@GID) {
mes "[Kafra staff]";
mes "Welcome. ^ff0000" + getguildname(.@GID) + "^000000 Member.";
mes "The Kafra Coporation will stay with you wherever you go.";
next;
switch(select("Use Storage:Use Guild Storage:Use Warp Service:Rent a Cart:Cancel")) {
case 1:
if (basicskillcheck() && getskilllv("NV_BASIC") < 6) {
mes "[Kafra staff]";
mes "I am sorry but you have to be at least Novice skill level 6 if you want to use the storage.";
}
else {
callfunc("F_CheckKafCode"); //check your storage password, if set
openstorage;
}
break;
case 2:
// Unofficial, but since it's already been in eA for ages
// and used, I can't exactly remove it, now, can I? >:(
if(guildopenstorage(0) == 1){
mes "[Kafra Employee]";
mes "I'm sorry but another guild member is using the guild storage";
mes "right now. Please wait until that person is finished.";
close2;
cutin "", 255;
end;
}
cutin "", 255;
close;
case 3:
mes "[Kafra staff]";
mes "Please let me know your destination.";
next;
switch(select(.@destination$ + " ^880000200 ^000000z:Cancel")) {
case 1:
if (Zeny < 200) {
mes "[Kafra staff]";
mes "You don't have enough money. Please check again.";
}
else {
set zeny,zeny-200;
set kf_10_pit,kf_10_pit+2;
cutin "kafra_01",255;
warp .@destination$[1],.@coordinates[0],.@coordinates[1];
end;
}
break;
case 2:
break;
}
break;
case 4:
if(baseClass != Job_Merchant){
mes "[Kafra staff]";
mes "I am sorry. The Cart Service is only provided for the Merchant and Blacksmith class.";
}
else if(checkcart() == 1){
mes "[Kafra staff]";
mes "You have a cart equipped already.";
}
else {
mes "[Kafra staff]" ;
mes "The cart fee is 800 zeny. Do you want to rent a cart?";
next;
switch(select("Yes.:Cancel.")) {
case 1:
if (Zeny < 800) {
mes "[Kafra staff]";
mes "You don't have enough Money. You need 800 Zeny to rent a cart.";
}
else {
close2;
cutin "kafra_01",255;
set kf_10_pit,kf_10_pit+8;
set zeny,zeny-800;
setcart;
end;
}
break;
case 2:
break;
}
}
break;
case 5:
mes "[Kafra staff]";
mes "The Kafra corp. always tries to give the best service.";
mes "Thank you for using Kafra corp. Please come again.";
}
}
else {
mes "[Kafra staff]";
mes "I am instructed to service only for the ^ff0000" + getguildname(.@GID) + "^000000 Guild. Please try another Kafra staff member around here. Sorry for the inconvenience.";
}
close2;
cutin "kafra_01",255;
end;
}
// Guild Dungeon Switch Template
//============================================================
- script Gld_Dun_Template::Gld_Dun_Template -1,{
// Store the Guild ID of castle occupant.
set .@GID, GetCastleData(strnpcinfo(2),1);
// Pick what Dungeon I should warp too, and where in that dungeon.
if (compare(strnpcinfo(2),"prtg")) {
set .@destination$,"gld_dun03";
if (compare(strnpcinfo(2),"cas01")) setarray .@coordinates[0],28,251;
else if (compare(strnpcinfo(2),"cas02")) setarray .@coordinates[0],164,268;
else if (compare(strnpcinfo(2),"cas03")) setarray .@coordinates[0],164,179;
else if (compare(strnpcinfo(2),"cas04")) setarray .@coordinates[0],268,203;
else if (compare(strnpcinfo(2),"cas05")) setarray .@coordinates[0],199,28;
}
// Add custom Guild Castles here.
else {
end;
}
if (.@GID == 0) {
mes "[ Echoing Voice ]";
mes " ' The one who can overcome an ordeal and show true bravery... will find the way... ' ";
close;
}
else {
mes "[ Echoing Voice ]";
mes " ' Only the one who can show true bravery can take this test. '";
next;
mes " ";
mes "There's a small lever. Will you pull it?";
next;
switch(select("Pull.:Do not.")) {
case 1:
if ((getcharid(2) == .@GID)) {
warp .@destination$,.@coordinates[0],.@coordinates[1];
end;
}
else {
mes " ";
mes " Nothing happened.";
close;
}
case 2:
close;
}
}
}
// Treasure Room Protection Template
//============================================================
- script Gld_Trea_Protect::Gld_Trea_Protect -1,{
//OnTouch2:
OnTouch:
// Store the Guild ID of castle occupant.
set .@GID, GetCastleData(strnpcinfo(2),1);
if (compare(strnpcinfo(2),"prtg")) {
warp "prontera",116,72;
}
// Add custom Guild Castles here.
else {
end;
}
}
end;
}
// Treasure Room Spawn Template
//============================================================
- script Gld_Trea_Spawn::Gld_Trea_Spawn -1,{
end;
OnClock0001:
// Do nothing if this script is the template.
if (strnpcinfo(1) == "Gld_Trea_Spawn") end;
// If there is no owner, do nothing.
if (!GetCastleData(strnpcinfo(2),1)) end;
// Is there Economy in this castle?
set .@Treasure,GetCastleData(strnpcinfo(2),2)/5+4;
// Set information
if (strnpcinfo(2) == "prtg_cas01") {
set .@treasurebox,1354;
setarray .@treasurex[0],10,11,11,10,8,9,10,11,12,13,13,13,13,13,13,12,11,10,9,8,8,8,8,8;
setarray .@treasurey[0],209,209,208,208,211,211,211,211,211,211,210,209,208,207,206,206,206,206,206,206,207,208,209,210;
}
else if (strnpcinfo(2) == "prtg_cas02") {
set .@treasurebox,1356;
setarray .@treasurex[0],201,202,202,201,199,200,201,202,203,204,204,204,204,204,204,203,202,201,200,199,199,199,199,199;
setarray .@treasurey[0],228,228,227,227,230,230,230,230,230,230,229,228,227,226,225,225,225,225,225,225,226,227,228,229;
// Add custom Guild Castles here.
else {
end;
}
// Reset daily investment limit.
setcastledata strnpcinfo(2),4,0;
setcastledata strnpcinfo(2),5,0;
// Spawn boxes in proper order.
for (set .@i,0; .@i <= .@Treasure ; set .@i,.@i+1) {
// set treasure box ID
set .@boxid, .@treasurebox + (.@i+2) % 2;
set .@box,1 << .@i;
// Spawn or do not spawn chests if one already exists.
if ((getd("$@"+strnpcinfo(2)+"_treasure") & .@box) == 0) {
monster strnpcinfo(2),.@treasurex[.@i],.@treasurey[.@i],"Treasure Chest",.@boxid,1,"Treasure#"+strnpcinfo(2)+"::OnTreasureDied"+.@i;
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") | .@box;
}
}
end;
// Individual "You killed a chest" events to ensure proper spawning at the change of day.
OnTreasureDied0:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~1;
end;
OnTreasureDied1:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~2;
end;
OnTreasureDied2:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~4;
end;
OnTreasureDied3:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~8;
end;
OnTreasureDied4:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~16;
end;
OnTreasureDied5:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~32;
end;
OnTreasureDied6:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~64;
end;
OnTreasureDied7:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~128;
end;
OnTreasureDied8:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~256;
end;
OnTreasureDied9:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~512;
end;
OnTreasureDied10:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~1024;
end;
OnTreasureDied11:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~2048;
end;
OnTreasureDied12:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~4096;
end;
OnTreasureDied13:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~8192;
end;
OnTreasureDied14:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~16384;
end;
OnTreasureDied15:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~32768;
end;
OnTreasureDied16:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~65536;
end;
OnTreasureDied17:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~131072;
end;
OnTreasureDied18:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~262144;
end;
OnTreasureDied19:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~524288;
end;
OnTreasureDied20:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~1048576;
end;
OnTreasureDied21:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~2097152;
end;
OnTreasureDied22:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~4194304;
end;
OnTreasureDied23:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~8388608;
end;
}
Автор: DarkWolf: Дата: 05.23.2009
а он будет хоть атаковать или также тупо стоять?
Автор: Cole McCormick: Дата: 05.23.2009
он будит тупо на месте убивать)
Автор: Sanasol: Дата: 05.23.2009
Да Сергей он будет убивать если сервер 99\70
Автор: Faith: Дата: 12.20.2009
гламурно :D умереть от руки "импа" - наверно сурово.. во!! внатурь!) сделаю ща спрайт у сатана как у импа но всё остальное оставлю :DD
Автор: MaHapX: Дата: 01.30.2010
МММ
Спасибо, уже разобрался!
Автор: Renegade: Дата: 01.31.2010
подозреваю что в mob.db